|
|
Section 1.3 in the text book deals with packet and circuit switching in data transfer applications. These are additional notes on this topic. The basic idea is this: In circuit switching, a user gets a dedicated channel for data transfer, regardless of how often that circuit is being actually used. This is the case in many Internet applications, such as web browsing - the actual data transfer occupies only a fraction of the total usage time; rest of the time is spent reading the materials or other activities. With email, most of the time is spent composing the mail, rather than in actual transmission. Packet switching exploits this inactivity period to support more users at the same bandwidth or to provide each user a higher bandwidth. Packet switching is usually used with message segmentation. This is the process by which a single message or chunk of data is cut into smaller segments, each wrapped in its own packet headers and sent independently to the destination, where the pieces are re-assembled. It's like buying a computer and the various pieces (CPU, monitor, printer etc.) arriving in separate packets, rather than one enormous bundle. What is the advantage of segmentation in this case? Consider host A transmitting to host B through routers R1 and R2, each link having a capacity of 1Mbps (This means that data is pushed out of the interface to the wire at the rate of 1 Mega-bits, or 10^6 bits, per second. The assumption is that the propagation delay is negligible, so that once a bit leaves the interface onto the wire, it is received at the destination instantly.) |
|
Suppose you have a piece of application data 5 megabits (NOT 5 Mb, which is 5 Megabytes!) in size to send from A to B. With no segmentation:Assuming no other traffic, it will take A's interface 5 seconds ( (5*10^6 bits)/(1*10^6 bits/sec) = 5 sec) to push out the complete data/message. Assuming that the actual travel time of a signal on the wire is negligible (depending on many things, the transmission speed of an electrical signal on a metallic wire could theoretically come close to the speed of light, a little above 3*10^8 meters/sec – generally it is a little less than that due to internal resistance in the wire), R1 gets the message in 5 seconds. By a similar reasoning, it takes 5 seconds for the message to reach R2, and another 5 to reach B. So it takes 15 seconds for the whole transmission. With segmentation:Now assume that the data is segmented into 1000 chunks, each 5*10^6/1000=5000 bits long. In practice, each of these segments have to be wrapped in headers that allow the destination to reassemble the pieces. These headers are tiny in comparison to the data, so we will neglect them for now. So A now has 1000 packets, each 5000 bits long. Suppose A starts transmitting – it takes (5000 bits)/(10^6 bits/sec)=.005 seconds for the first segment to reach R1. R1 can immediately transmit that segment to R2, which will take .005 sec, and R2 can send it to B in another .005 sec, so that the first segment arrives at B in 3*.005=0.015 seconds. The second segment reaches R1 from A in .005+.005 sec; and so on. (The n-th segment reaches R1 from A in .005*n seconds.) Now focus on the last segment, the 1000-th one. This last segment reaches R1 from A in 1000*.005=5 sec. It takes another .005 seconds for R1 to push the last segment to R2, and another .005 seconds for R2 to push it to B. So the last segment reaches B in 5+.005+.005=5.010 sec. So the entire transmission takes 5.010 sec, which is a three-fold improvement over the case with no segmentation. Why?In circuit switching, R1 and R2 are idle while A is transmitting. R1 doesn't start till A is completely finished, which takes 5 seconds. In packet switching, R1 starts transmission .005 seconds after A starts, and R2 starts after .010 seconds, so that all the nodes are simultaneously working for most of the time. This parallel utilization of available bandwidth makes packet switching more efficient.
|
|
|
|
|
|
Last changed: