Computer Networking › Section A · Computer networks and the internet › Topic A.3

The network core: packet and circuit switching

Between the access networks lies the core: a mesh of routers and high-capacity links that carries everyone's traffic. How the core shares those links, packet by packet or by reserving circuits, explains both the internet's efficiency and its unpredictable delays.

Two ways to share a network

The network core is the web of routers and links that joins the access networks to one another. Its central problem is that many conversations want the same links at the same time. There are two fundamental answers. Circuit switching reserves capacity along the whole path for each conversation before it starts, as the traditional telephone network did. Packet switching reserves nothing: each packet uses a link only while it is being sent, and packets from many users take turns. The internet is packet-switched, and this topic shows why, and what that choice costs.

Packet switching and transmission time

A source host breaks a long message into packets. Each packet crosses a series of links and switches, and on each link it is sent at that link's full transmission rate. A packet of \(L\) bits on a link of rate \(R\) bit/s therefore takes

d_{\text{trans}} = \frac{L}{R}

seconds to push onto the link. A 12,000-bit packet on a 100 Mbps link takes \(12{,}000 \div 10^8 = 0.00012\) s, or 120 µs. The topic Delay, loss, and throughput adds the time bits spend travelling along the link; here that propagation time is ignored.

Store-and-forward transmission

Nearly all routers work by store-and-forward: a switch must hold the complete packet before it sends the first bit onward. Picture a source, one router and a destination. The source finishes sending at time \(L/R\), when the router holds the complete packet; the router then needs another \(L/R\), so the destination has it at \(2L/R\). Over a path of \(N\) links of rate \(R\), with \(N - 1\) routers, one packet's delay is

d_{\text{end-to-end}} = N\frac{L}{R}

When \(P\) packets are sent back to back, they move like a pipeline: the last one arrives after \((N + P - 1)L/R\).

Worked example: four links, five packets

A host sends 1,000-byte packets across 4 links, each 2 Mbps, through 3 store-and-forward routers. Ignore propagation, processing and queueing. 1. Packet size: \(L = 1{,}000 \times 8 = 8{,}000\) bits. 2. Time per link: \(L/R = 8{,}000 \div (2 \times 10^6) = 0.004\) s, or 4 ms. 3. One packet: \(N L/R = 4 \times 4 = 16\) ms. 4. Five packets back to back: \((4 + 5 - 1) \times 4 = 32\) ms. Check: the first packet arrives at 16 ms, and each later one arrives 4 ms after the one before, so the fifth arrives at \(16 + 4 \times 4 = 32\) ms.

Queues, delay and loss

A router has an output buffer, or queue, for each of its links. A packet that arrives while its link is busy waits there, and this queueing delay depends on congestion. Suppose two hosts feed a router over 1 Gbps links, but all their traffic leaves on one 50 Mbps link. While their combined rate stays below 50 Mbps, packets pass with little waiting; during a burst above it, the queue grows. Buffers are finite, so when one is full, an arriving or queued packet is dropped: packet loss.

Forwarding tables and routing protocols

How does a router pick the outgoing link? Every host has an IP address, and the source writes the destination's address into each packet's header. IP addresses are hierarchical, like postal addresses with country, city and street. Every router keeps a forwarding table linking destination addresses, or blocks of them, to its outgoing links; it looks up the arriving packet's address and sends the packet to the matching link. The tables are not typed in by hand: routing protocols run between routers and fill them in automatically, for example by computing shortest paths. Section E, The network layer: control plane, covers routing protocols in depth.

Circuit switching: FDM and TDM

In a circuit-switched network, the network first sets up an end-to-end connection, a circuit; every switch on the path keeps state for it and reserves a fixed share of each link's capacity until the call ends. The sender then gets a guaranteed constant rate. A link carries several circuits by multiplexing. Frequency-division multiplexing (FDM) gives each circuit its own frequency band, about 4 kHz wide for a telephone call. Time-division multiplexing (TDM) divides time into repeating frames of fixed slots and gives each circuit one slot per frame, so a circuit's rate is frames per second times bits per slot: \(8{,}000 \times 8 = 64\) kbps in classic digital telephony.

Worked example: a file over a TDM circuit

A circuit-switched network uses TDM links of 2.048 Mbps divided into 32 slots. Setting up a circuit takes 0.3 s. How long does sending a 1,280,000-bit file take? 1. Rate per circuit: \(2.048 \times 10^6 \div 32 = 64{,}000\) bit/s, or 64 kbps. 2. Transmission time: \(1{,}280{,}000 \div 64{,}000 = 20\) s. 3. Add the setup: \(20 + 0.3 = 20.3\) s. 4. The number of links does not matter: the reserved rate is the same on every link, and bits flow through without store-and-forward pauses. Check: \(64{,}000 \times 20 = 1{,}280{,}000\) bits.

Why packet switching usually wins

Circuits waste capacity whenever a user falls silent, and most data traffic is bursty. Take a 3 Mbps link whose users each send at 150 kbps while active but are active only 10% of the time. Circuit switching must reserve 150 kbps for every user, so it supports \(3{,}000 \div 150 = 20\) users. With packet switching and 100 users, the binomial probability that more than 20 are active at once is only about 0.0008. Almost always the link keeps up, so it serves five times as many users. This gain from sharing on demand is called statistical multiplexing. The price is that delay is variable and no rate is guaranteed: the internet makes a best effort.

A network of networks

Linking every pair of access ISPs directly would need far too many links, so ISPs form layers. Access ISPs buy transit from regional ISPs, which buy transit from tier-1 ISPs, a small group of global networks that reach each other without paying anyone for transit. A customer ISP pays its provider and connects at the provider's points of presence (PoPs), often to two or more providers for reliability, called multihoming. Nearby ISPs also peer, exchanging their own customers' traffic directly, usually without payment, often at internet exchange points (IXPs). Large content providers run private global networks that connect straight to access ISPs.

Common mistakes to avoid

First, forgetting store-and-forward: over \(N\) links one packet takes \(N L/R\), not \(L/R\). Second, adding \(N L/R\) for every packet in a burst instead of using the pipeline formula \((N + P - 1)L/R\). Third, multiplying a TDM circuit's transmission time by the number of links; a circuit's rate is reserved end to end. Fourth, saying packet switching is better in every respect: it gives up guaranteed rates and fixed delays. Fifth, confusing forwarding, the local table lookup in one router, with routing, the network-wide computation that fills the tables.

Key takeaways

Packets are sent at a link's full rate, taking \(L/R\) per link; store-and-forward gives \(N L/R\) over \(N\) links and \((N + P - 1)L/R\) for \(P\) packets. Output buffers cause queueing delay and, when full, packet loss. Routers forward by looking up destination addresses in forwarding tables that routing protocols fill. Circuit switching reserves a fixed rate per call using FDM or TDM; packet switching shares links on demand, supporting more bursty users through statistical multiplexing at the cost of variable delay. The internet is a network of networks: access, regional and tier-1 ISPs, PoPs, multihoming, peering, IXPs and content provider networks.

Flashcards

Flashcard

Network core

The web of routers and links that joins access networks

Run by ISPs.

Test your understanding

Question 1 of 5

One 1,500-byte packet crosses 3 links of 10 Mbps each through store-and-forward routers. Ignoring propagation, processing and queueing, what is its end-to-end delay?

Question 2 of 5

Four packets, each taking 2 ms to transmit on a link, are sent back to back over 3 store-and-forward links. When does the last packet arrive?

Question 3 of 5

A TDM link runs at 1.536 Mbps with 24 slots per frame. A circuit takes 0.5 s to set up. How long does sending a 960,000-bit file take?

Question 4 of 5

Why can a packet-switched link serve more bursty users than a circuit-switched link of the same rate?

Question 5 of 5

A regional ISP connects to two tier-1 providers and also exchanges traffic directly with a neighbouring regional ISP at an IXP. Which term describes the direct exchange?

← Previous topicNext topic →