4.3.7 · D2Computer Networks

Visual walkthrough — Switching — circuit, packet, virtual circuit

1,959 words9 min readBack to topic

We build one idea at a time. Nothing below uses a symbol before its picture exists.


Step 1 — What "sending a bit" even costs

WHAT. Picture the wire as a garden hose. Transmission is squeezing the water into the hose at the tap; propagation is the water travelling down the hose to the far end. They are different clocks.

WHY these two and not one. People lump "delay" into one number, but the tap-speed and the hose-length are independent. A short fat hose fills fast but is short; a long thin hose fills slow and is long. We must keep them separate or every later formula is wrong.

PICTURE. Look at the figure: yellow bits being pushed on at the left (transmission), then a single blue bit gliding rightward across the gap (propagation).

Every formula on this page is built from just these two numbers. See Store-and-Forward and Network Delays for the full delay taxonomy.


WHAT. Send bits across one wire. First bit leaves at time , arrives at . But the last bit only got pushed on at time . So the whole message finishes at .

WHY add, not multiply. The tap and the hose act in sequence for the last bit: it must first be pushed on (wait ), then travel (). Sequential costs add.

PICTURE. The staircase: the red line is the last bit. Its total journey = the push segment plus the glide segment, laid end to end.

This is our seed. Everything else asks: what happens with more than one link?


WHAT. Now put a switch in the middle: source → switch → destination, so links. The switch behaves like a person who refuses to start relaying a sentence until they've heard the whole sentence.

WHY it costs again. Because of that "hear the whole thing first" rule, the switch spends another full receiving before it re-pushes. The message is reborn at each hop.

PICTURE. Two staircases stacked: the switch's push (green) cannot begin until the source's push (yellow) has fully landed. See how the green block starts only after the yellow block ends.


WHAT. Chain links (so switches). Every link replays the full push ; every link is one glide .

WHY multiply by . Step 3 showed each hop adds one independent . With identical hops in series, we simply have of them.

PICTURE. staircases in a diagonal cascade — the packet marches down and to the right, one full block per hop.

  • = number of links along the path.
  • Every is one switch waiting for the whole packet, then pushing it.

This is the parent's T_datagram, 1 pkt. Now we attack the ugly term.


Step 5 — The trick: chop the message into packets

WHAT. Split bits into equal packets, each of size bits. Ignore header bits for now.

WHY smaller pieces. A small packet clears a switch quickly (only seconds), freeing that switch to receive the next packet while the first one moves ahead. Overlap = parallel work = less total time.

PICTURE. Same path as Step 4, but now packet 1 (blue) is on link 3 while packet 2 (yellow) is on link 2 and packet 3 (red) is on link 1 — three links busy in the same instant.

Each small-packet push now costs seconds — call it one tick.


Step 6 — Counting the ticks: pipelining assembled

WHAT. Track the last bit of the last packet — that bit finishing = whole message done.

WHY split the count in two. The delay has two clean parts:

  1. The first packet must cross all links → ticks.
  2. After it arrives, the remaining packets pour out of the last link one tick apart, because the source released them one tick apart and the pipe preserves that spacing.

PICTURE. The staircase for packet 1 climbs steps; then packets 2… arrive as a tight yellow stack, each one tick below the last.

Pull the common tick out of the first two terms:

  • = the "effective number of full pushes" — how many 's we really pay.
  • When : → back to Step 4. ✔ our formula contains the old one.

Step 7 — The limit: why the internet chose packets

WHAT. Let grow very large (many tiny packets). Watch the factor .

WHY a limit. We want the best case of chopping — the floor that transmission delay can reach.

PICTURE. A curve of the multiplier falling from (at ) toward as , flattening out.

The store-and-forward tax evaporates: transmission collapses to a single , as if the whole path were one hop. That is the payoff pipelining buys.


Step 8 — The degenerate cases (never leave a gap)

For circuit switching the whole store-and-forward chain is absent: after setup , the path is a continuous pipe, so appears once and we add setup and one propagation sweep: This is why big single transfers once favored circuits — but the killer is that fixed . Datagram pays no , so with enough pipelining it wins. See how Routing Algorithms and TCP — reliable ordered delivery then handle the out-of-order arrivals packets create.


The one-picture summary

One glance: circuit (one push after setup), datagram 1-packet (the tall store-and-forward staircase), datagram P-packets (the same staircase but slid together by pipelining down to nearly one push). The vertical distance you save is exactly the that pipelining gifts you.

Recall Feynman retelling — say it back in plain words

Imagine passing a long paragraph down a line of people, where each person insists on hearing the whole paragraph before repeating it. If you hand over the entire paragraph at once, only one person talks at a time and the last person finishes very late — that's the tall staircase, . Now cut the paragraph into single sentences. The moment person 1 finishes sentence one, person 2 starts repeating it while person 1 already speaks sentence two. Everyone talks at once — an assembly line. The last sentence pops out of the last mouth only a little after the first, so the total time drops until it's almost as if there were just one person. That's pipelining, and is the math of "everyone works at once." Circuit switching skips the relay-people entirely by building a private pipe first (paying a one-time setup toll ), but that toll is why the bursty, chatty internet went with tiny packets instead.

Recall Self-test

Why does store-and-forward put a factor of on transmission but circuit switching does not? ::: Store-and-forward makes each of the switches fully receive then re-push the packet, so is paid times; a circuit is a continuous reserved pipe with no re-buffering, so is paid once. What does approach as , and what stops us going there? ::: It approaches , collapsing transmission to a single ; fixed per-packet header overhead stops us from shrinking packets forever. In the 1 MB example, why does datagram-with-1000-packets beat circuit? ::: Pipelining pushes effective transmission down to about (~8 s) AND datagram pays no 100 ms setup , so it lands at ~8.019 s versus circuit's 8.103 s.