Sub topic 7
Packet Switching and Store-and-Forward
This chapter assumes you know bits, bytes, bit rates, basic algebra, and the roles of network layers. We focus on how packet-switched networks divide data and move it through intermediate nodes.
What packet switching means
In packet switching, a message is divided into smaller units called packets. Each packet contains part of the user data plus control information, such as source and destination addresses. Routers and switches forward packets one at a time.
A packet-switched network shares links among many users. A link is used by whichever packet is ready to transmit. This is called statistical multiplexing because capacity is assigned dynamically rather than reserved permanently for one connection.
Packet switching is efficient for bursty traffic. A web request may use a link briefly, leaving the link available for other traffic at other times.
Store-and-forward operation
A store-and-forward node receives the complete packet before transmitting that packet on the next link. The node therefore performs these steps:
- Receive all packet bits.
- Store the packet temporarily.
- Inspect its header and choose an outgoing link.
- Transmit the complete packet on that link.
If a path contains several links, every link must transmit the packet. The packet's transmission time is therefore paid once per link.
For a packet of \(L\) bits sent over a link with rate \(R\) bits per second:
\[ d_{\text{transmission}}=\frac{L}{R} \]
Propagation delay is the time for a signal to travel through the medium:
\[ d_{\text{propagation}}=\frac{\text{distance}}{\text{signal speed}} \]
Ignoring processing and queuing delays, a path with \(N\) identical store-and-forward links has:
\[ d{\text{end-to-end}}=N\frac{L}{R}+d{\text{propagation,total}} \]
Worked numerical example
A 12,000-bit packet crosses three 10 Mbps links. The total cable distance is 3,000 km, and the propagation speed is \(2\times10^8\) m/s.
The transmission delay per link is:
\[ \frac{12{,}000}{10{,}000{,}000}=0.0012\text{ s} \]
The total propagation delay is:
\[ \frac{3{,}000{,}000}{2\times10^8}=0.015\text{ s} \]
Therefore:
\[ d=3(0.0012)+0.015=0.0186\text{ s} \]
def end_to_end_delay(packet_bits, rate_bps, links, distance_m, prop_speed_mps):
"""Store-and-forward delay; queuing and processing are ignored."""
transmission = packet_bits / rate_bps
propagation = distance_m / prop_speed_mps
return links * transmission + propagation
print(round(end_to_end_delay(12_000, 10_000_000, 3, 3_000_000, 2e8), 6))
# 0.0186Why segmentation creates a pipeline
Suppose a message is divided into packets. While packet 1 travels over link 2, packet 2 can use link 1. This overlap is called pipelining.
For \(P\) equal packets crossing \(N\) equal-rate links, with propagation and overhead ignored:
\[ d_{\text{message}}=(N+P-1)\frac{L}{R} \]
Sending one large message without segmentation takes approximately \(N\) message-transmission times. Segmentation usually reduces completion time because links work simultaneously, although headers and packet processing add overhead.
Exercise
A 2,000-bit packet crosses four 1 Mbps store-and-forward links. Ignore propagation, processing, and queuing delay. What is the end-to-end delay?
Show answer
The transmission time per link is 2,000 / 1,000,000 = 0.002 s. It is paid on four links, so the delay is 0.008 s, or 8 ms.