CSC 498 · Computer Network and Data Communications
Our notes
3 min readCircuit switching
A dedicated path is set up before communication (call set-up), used for the whole session, then released. The classic telephone network.
- Fixed bandwidth and constant delay once connected (good for voice).
- Capacity is wasted during silences; set-up takes time; a busy network refuses new calls ("network busy").
Message switching
The whole message is sent to the next node, stored, then forwarded when the next link is free (telegrams, early email). No set-up and good line use, but long delays and big buffers.
Packet switching
Messages are cut into packets (with headers carrying addresses and sequence numbers); each is stored and forwarded independently. Links are shared by many users (statistical multiplexing). ARPANET (1969) proved the idea; it is how the Internet works.
- Datagram (connectionless): each packet is routed on its own and may take a different path and arrive out of order (IP). No set-up; robust to failures.
- Virtual circuit (connection-oriented): a route is chosen at set-up and all packets follow it in order; each packet carries a short circuit number (X.25, Frame Relay, ATM, MPLS in carrier networks).
| Circuit | Datagram packet | Virtual circuit packet | |
|---|---|---|---|
| Set-up | yes | no | yes |
| Path | fixed | per packet | fixed |
| Order | kept | may change | kept |
| Bandwidth | reserved | shared | shared |
| Failure of a node | call drops | packets rerouted | circuit must be re-made |
| Charging | by time | by data | by data |
Delays
For a message of L bits, link rate R, over k links (k − 1 switches), ignoring propagation and processing:
- Message switching: k × L/R.
- Packet switching with packets of P bits (n = L/P packets): L/R + (k − 1) P/R (pipelining: switches forward early packets while later ones are still arriving).
- Circuit switching: set-up time + L/R (+ propagation).
Worked example. L = 8,000 bits, R = 1 Mbps, k = 3 links.
- Message switching: 3 × 8 ms = 24 ms.
- Packets of 1,000 bits (8 packets, 1 ms each): 8 + 2 × 1 = 10 ms (headers ignored).
- Circuit switching with 15 ms set-up: 15 + 8 = 23 ms.
Smaller packets cut delay, but each packet carries a header, so too small wastes capacity.
- Total delay per hop = processing + queueing + transmission + propagation. Queueing grows sharply as a link nears full use (traffic intensity ρ = La/R close to 1, where a is the packet arrival rate).
Routing in outline
Each router keeps a routing table (destination → next hop). Tables are built by routing algorithms:
- Distance vector (Bellman-Ford; RIP): routers swap distance tables with neighbours.
- Link state (Dijkstra; OSPF): every router learns the whole map and computes shortest paths.
- BGP between the networks of different organisations (Internet service providers, MTN, Airtel, Glo, universities). Local traffic between Nigerian networks is exchanged at the Internet Exchange Point of Nigeria (IXPN), which keeps it from going abroad and back.
- Flooding (send on every link) is simple and robust but wasteful; used carefully in some protocols.
Exams usually ask: compare circuit, message and packet switching; datagram versus virtual circuit; calculate delays for each; components of delay; distance vector versus link state routing.
Common mistake: thinking packets wait until the whole message reaches each switch. Each packet moves on as soon as it has arrived, which is why packet switching is faster than message switching.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Computer Networks: A Systems Approach, 3.1 Switching basics
(opens book.systemsapproach.org in a new tab)
Peterson and Davie, Computer Networks: A Systems Approach, Computer Networks: A Systems Approach, 3.1 Switching basics, CC BY 4.0 · licence
-
MIT 6.02 notes: Communication networks: sharing and switches
MIT course notes chapter (PDF): fuller than our notes, with worked examples.
(opens ocw.mit.edu in a new tab)
MIT OpenCourseWare, MIT 6.02 notes: Communication networks: sharing and switches, CC BY-NC-SA 4.0 · licence
-
Packet switching
(opens en.wikipedia.org in a new tab)
Wikipedia, Packet switching, CC BY-SA 4.0 · licence
-
Circuit switching
(opens en.wikipedia.org in a new tab)
Wikipedia, Circuit switching, CC BY-SA 4.0 · licence
-
Message switching
(opens en.wikipedia.org in a new tab)
Wikipedia, Message switching, CC BY-SA 4.0 · licence
Watch
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.