Unix Programming - Bandwidth

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > September 2005 > Bandwidth





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Bandwidth
rishi.shah@patni.com

2005-09-29, 6:00 pm

This may not be exactly a unix question but I am implementing a project
in UNIX/C++. I could not find the group on which I can post the
message.
I am implementing a simulation that is supposed to have the bandwidth
of 9.6kbps. (The actual bandwidth is much more but I have supposed to
simulate the network at a bandwidth of 9.6kbps).
The distance between a particular set of nodes is 40 meters. From the
above information how do I calculate the time it takes for the packet
to go from one node to another node?

Pascal Bourguignon

2005-09-29, 6:00 pm

"rishi.shah@patni.com" <rishi.shah@patni.com> writes:

> This may not be exactly a unix question but I am implementing a project
> in UNIX/C++. I could not find the group on which I can post the
> message.
> I am implementing a simulation that is supposed to have the bandwidth
> of 9.6kbps. (The actual bandwidth is much more but I have supposed to
> simulate the network at a bandwidth of 9.6kbps).
> The distance between a particular set of nodes is 40 meters. From the
> above information how do I calculate the time it takes for the packet
> to go from one node to another node?


DOES NOT COMPUTE

INSUFFICIENT INFORMATION



You have bit/second and meter, and you want second.
Then you need some meter/bit too.

--
"Our users will know fear and cower before our software! Ship it!
Ship it and let them flee like the dogs they are!"
rishi.shah@patni.com

2005-09-29, 6:00 pm

Can't we do it like
Trasmit time = Packet Size/Bandwidth ?

Gordon Burditt

2005-09-29, 6:00 pm

>This may not be exactly a unix question but I am implementing a project
>in UNIX/C++. I could not find the group on which I can post the
>message.
>I am implementing a simulation that is supposed to have the bandwidth
>of 9.6kbps. (The actual bandwidth is much more but I have supposed to
>simulate the network at a bandwidth of 9.6kbps).
>The distance between a particular set of nodes is 40 meters. From the
>above information how do I calculate the time it takes for the packet
>to go from one node to another node?


The time from when you START sending the packet to the time when the
recipient receives the whole packet is the transmission time of the
packet (N bits / (9600bits/sec)) in seconds, plus the propagation
delay. If it's async transmission over RS-232 you actually transmit
10 bits per byte, counting the start and stop bits.

The speed-of-light propagation delay (133 nanoseconds) is negligible
compared to 1 character sent async (10 bits, including start and
stop bits) = about 1 millisecond. The delay may be much more than
the speed-of-light delay if there's anything in between, such as
modulation/demodulation (modem), or a store-and-forward node (ethernet
switch), or whatever.

It is highly probable that a 40-meter straight-line cable will
violate OSHA safety regulations by providing a trip hazard, so your
cable may be much longer than 40 meters. The speed of electricity
in twisted-pair or shielded cables is somewhat less than the speed
of light in a vacuum.

Gordon L. Burditt
Pascal Bourguignon

2005-09-29, 6:00 pm

"rishi.shah@patni.com" <rishi.shah@patni.com> writes:
> Can't we do it like
> Trasmit time = Packet Size/Bandwidth ?


check your units!

--
"You question the worthiness of my code? I should kill you where you
stand!"
Pascal Bourguignon

2005-09-29, 6:00 pm

gordonb.67fne@burditt.org (Gordon Burditt) writes:

>
> The time from when you START sending the packet to the time when the
> recipient receives the whole packet is the transmission time of the
> packet (N bits / (9600bits/sec)) in seconds, plus the propagation
> delay. If it's async transmission over RS-232 you actually transmit
> 10 bits per byte, counting the start and stop bits.
>
> The speed-of-light propagation delay (133 nanoseconds) is negligible


The speed of light in materials is MUCH slower than in a vacuum.
http://www.livinginternet.com/i/ip_speed.htm


> compared to 1 character sent async (10 bits, including start and
> stop bits) = about 1 millisecond. The delay may be much more than
> the speed-of-light delay if there's anything in between, such as
> modulation/demodulation (modem), or a store-and-forward node (ethernet
> switch), or whatever.
>
> It is highly probable that a 40-meter straight-line cable will
> violate OSHA safety regulations by providing a trip hazard, so your
> cable may be much longer than 40 meters. The speed of electricity
> in twisted-pair or shielded cables is somewhat less than the speed
> of light in a vacuum.


Who said there was a 40 m cable between the two nodes?

--
__Pascal Bourguignon__ http://www.informatimago.com/

The world will now reboot. don't bother saving your artefacts.
rishi.shah@patni.com

2005-09-29, 8:49 pm

I may have created some confusion by my expalnation early on.
Here are the specifications more clearly
I am implementing the project in unix/c++ and each node represents a
process on a separate machine.
They communicte using TCP sockets
Each node has a configuration file that has the location co-ordinates.
When I said 40m distance, I meant the euclidean distance between two
nodes is 40m.

I have the formula
Latency = Propagation time + Transmit time + Queing time
where Propagation time = Distance / Speed of light = m/ (m/s) = seconds
and Transmit time = Packet size/ Bandwidth = bits / (bits/s) = seconds

I assumed that the Propagation time = 0 since the distance is
negligible as compared to speed of light.
Now is my assumption of packets travelling on a TCP socket as fast as
light incorrect?
Since this project is a simulation I am not aware of the actual
material between the nodes.

Queing time I have assumed to be zero since it is my own simulation.
In such a case is the formula Latency = Packet Size/Bandwidth. Am I
Correct?
If I wnat to consider the tranmission time do I have first find the
material and then the speed of travelling in that material. Am I
Correct?

rishi.shah@patni.com

2005-09-29, 8:49 pm

I am sorry I had a typo in the questions at last.

In such a case is the formula Latency = Packet Size/Bandwidth correct?
If I want to consider the tranmission time do I have first find the
material and then the speed of travelling in that material?

Gordon Burditt

2005-09-30, 2:50 am

>I may have created some confusion by my expalnation early on.
>Here are the specifications more clearly
>I am implementing the project in unix/c++ and each node represents a
>process on a separate machine.
>They communicte using TCP sockets
>Each node has a configuration file that has the location co-ordinates.
>When I said 40m distance, I meant the euclidean distance between two
>nodes is 40m.
>
>I have the formula
>Latency = Propagation time + Transmit time + Queing time
>where Propagation time = Distance / Speed of light = m/ (m/s) = seconds


Propagation time is the time from when the first bit is transmitted to
when the first bit is received. It needs to account for *ALL* of
the time-consuming things that happen to the bits on the way from
one node to another. Speed is part of it, but not nearly all of it.

Modulation and de-modulation take time.

If there is a store-and-forward node along the path (e.g. ethernet
switch, or worse, router, or worse yet, mail server with queue),
you might have to add in the transmit time (possibly multiple times).

Processing in the TCP stack takes time.
TCP retransmission due to dropped packets can take a LOT of time,
compared to the other stuff mentioned, especially if you're trying
to calculate a worst-case response time.

>and Transmit time = Packet size/ Bandwidth = bits / (bits/s) = seconds


>I assumed that the Propagation time = 0 since the distance is
>negligible as compared to speed of light.


If the speed of light in whatever medium is involved is only 0.1 c,
propagation time is probably still negligible, especially when
dealing with a transmit time of about 1 millisecond per character.

>Now is my assumption of packets travelling on a TCP socket as fast as
>light incorrect?


In this case, if you assume it's travelling at 0.01 c, it's STILL
negligible. However, passing through a modem may not be negligible.


>Since this project is a simulation I am not aware of the actual
>material between the nodes.


Try throwing in some real numbers and you'll likely find it's
negligible regardless of what material you use within reason.

Let's try an analysis for a different situation: you're sending
the packet by air courier from Dallas to Houston. You have:
(1) Office to airport by car
(2) Getting through security
(3) Boarding time
(4) Flight time
(5) Un-boarding time
(6) Getting out of the airport
(7) Refill gas tank of car
(8) Airport to destination office by car.

(3), (5) and (6) are probably negligible. For a short flight like
Dallas to Houston, (4) is negligible (so the speed of an airplane
DOES NOT MATTER). Post 9/11 (2) probably dominates, (except right
after Rita when (7) may take weeks), so much that driving direct
without the air leg may be faster, and replacing the plane with a
warp-9 space ship won't help.

>Queing time I have assumed to be zero since it is my own simulation.


Even if you assume communication between the two nodes is all that
is going on, queueing may not be negligible. If you're using, say,
100-byte packets at 9600 b/s, it takes 0.1 seconds to transmit a
packet and if you try to transmit a second packet while the first
is still being transmitted, you have to wait. If your protocol
between the nodes is such that this can't happen, (e.g. you won't
even TRY to send a packet until the last one is answered) an
assumption of 0 is OK.

>In such a case is the formula Latency = Packet Size/Bandwidth. Am I
>Correct?


Yes, given assumptions above of what's negligible.

>If I wnat to consider the tranmission time do I have first find the
>material and then the speed of travelling in that material. Am I
>Correct?


No. There's a lot more to transmission time than the speed, although
the difference may be negligible. For instance, I seem to recall
that a propagation time of 0.1 seconds was a pretty good number for
getting data signals through the voice telephone network between
two points in the USA provided no satellites were involved, regardless
of distance (next door vs. coast-to-coast). What's involved is
some of the filters used in the telephone system and in modems,
which dominate speed-of-light issues.

Gordon L. Burditt
Pascal Bourguignon

2005-09-30, 5:56 pm

"rishi.shah@patni.com" <rishi.shah@patni.com> writes:

> I may have created some confusion by my expalnation early on.
> Here are the specifications more clearly
> I am implementing the project in unix/c++ and each node represents a
> process on a separate machine.
> They communicte using TCP sockets
> Each node has a configuration file that has the location co-ordinates.
> When I said 40m distance, I meant the euclidean distance between two
> nodes is 40m.


Which is a useless data.

For example, when I communicate with my customer that's at 10 km, if
there was a direct earth cable between us, it would take 20 km because
there's a sea between us, and in actuality, it takes more like 1600
km, because the internet is not as meshed as its propaganda let you
believe, it's really a hierarchical star topology, and that, that
we've got the same ISP, our packets still traverse forth and back the
country.

If you restrict yourself to LAN, nowaday ethernet is a star topology
too, with a central HUB. The distance between the nodes doesn't matter
what matters is the length of the cables.


> I have the formula
> Latency = Propagation time + Transmit time + Queing time
> where Propagation time = Distance / Speed of light = m/ (m/s) = seconds
> and Transmit time = Packet size/ Bandwidth = bits / (bits/s) = seconds
>
> I assumed that the Propagation time = 0 since the distance is
> negligible as compared to speed of light.


We don't have enough data to say so.


> Now is my assumption of packets travelling on a TCP socket as fast as
> light incorrect?


This is meaningless! Think about what you're writing!


> Since this project is a simulation I am not aware of the actual
> material between the nodes.


You can parametrize it, and look up technical data on the web.


> Queing time I have assumed to be zero since it is my own simulation.
> In such a case is the formula Latency = Packet Size/Bandwidth. Am I
> Correct?


With some assumptions.


> If I wnat to consider the tranmission time do I have first find the
> material and then the speed of travelling in that material. Am I
> Correct?


Yes.


--
__Pascal Bourguignon__ http://www.informatimago.com/
Grace personified,
I leap into the window.
I meant to do that.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com