# Store-and-forward packet switching delays

My question arose as i was reading Computer Networking a Top Down Approach . The author said the following regarding packet switching:

L = length of packet(bits)
R = transmission rate(bits/sec)

"To gain some insight into store-and-forward transmission, let’s now calculate the amount of time that elapses from when the source begins to send the packet until the destination has received the entire packet. (Here we will ignore propagation delay—the time it takes for the bits to travel across the wire at near the speed of light—which will be discussed in Section 1.4.) The source begins to transmit at time 0; at time L/R seconds, the source has transmitted the entire packet, and the entire packet has been received and stored at the router (since there is no propagation delay). At time L/R seconds, since the router has just received the entire packet, it can begin to transmit the packet onto the outbound link towards the destination; at time 2L/R, the router has transmitted the entire packet, and the entire packet has been received by the destination. Thus, the total delay is 2L/R. If the switch instead forwarded bits as soon as they arrive (without first receiving the entire packet), then the total delay would be L/R since bits are not held up at the router."

But, I was confused when he said:

If the switch instead forwarded bits as soon as they arrive (without first receiving the entire packet), then the total delay would be L/R since bits are not held up at the router."

But, this does not click with me because if it takes 2L/R for one packet to go from the source PC to the destination PC with the router storing and forwarding packets, why would it take L/R if the router just forwarded the bits immediately without buffering an entire packet before transmitting it onto the outbound link? Considering we know that the two PCs are connected by a router with the first link connecting the source PC to the router and the second link connecting the router to the destination PC, and that both links transmit at R, should it not still take 2L/R amount of time regardless of buffering?

What this is trying to communicate is that as soon as a bit is received on one interface, it could be transmitted on the next interface.

Think of the packet as a snake, and the threshold of a door as the router. If the entire snake curls up on the threshold before crossing it, that is store and forward, and it will take the snake twice as long to get completely across the doorway as it would for the snake to simply slither straight across the doorway.

The length of the snake and its speed dictate how long it would take for the entire snake to enter the doorway by slithering straight across the door sill, but if it must get fully on the door sill first, then it will take twice as long.

• oooooohhh, so basically every time the buffer is buffering for bits could be time that another bit is being transmitted onto the other interface. Therefore it would make sense that it takes half the time if the bits were just passing right through without having to wait in the output buffer. Thank you so much, you really helped a high school student out. Oct 19, 2017 at 21:43

With store-and-forward, the router starts sending the first bit of the packet to the final destination only after receiving the last bit from the source.

When not buffering, the router will start sending the first bit of the packet immediately after receiving it. The first bit is arrives at the final destination when the second bit arrives at the router.

By receiving and sending the packet in parallel, the router can finish the job faster. One could argue the actual delay in this case is (L+1)/R because the sending can only start after receiving one bit, thus after a time 1/R.

• There's nothing special about 1 bit. A switch could start forwarding sub-bit (like a hub). In real life a switch has to wait until it has the destination MAC address (8 framing + 6 address = 14 octets) which is why the destination is before the source. Under some circumstances it can decide with only a partial destination address. Oct 20, 2017 at 13:08
• I was trying to follow the abstractions in the original quoted text, which talks about bits and seems to ignore addressing. In the case of a switch, you are right about the MAC address. The text mentions a router, which would need the destination IP. Oct 24, 2017 at 20:43