G27
Self-checkedTier 1 8 min readcn.switching-types

Circuit, packet and virtual-circuit switching

How data is moved through a network of links and nodes: circuit switching (reserved path, set-up time, no store and forward), packet switching (datagrams routed one by one, store and forward, statistical multiplexing) and virtual circuits (a path set up once, short labels per link); the total delay of a message split into packets over several links, the saving from splitting, and the probability that statistical multiplexing overloads a link, all computed exactly and cross-checked by an event simulation.

Why it exists

Two computers on opposite sides of a country are not joined by one wire. Their data crosses many links and nodes shared with many other users. How the nodes forward the data decides the delay, how many users can share the links, and what happens when a node fails. There are three classical answers.

Prerequisites

You need the idea of layers (layering).

Precise definitions

Circuit switching. Before data flows, a connection set-up reserves a fixed share of every link on the path (a time slot or frequency band, a circuit). The reserved capacity belongs to this connection for the whole call even when nothing is sent. Data then travel without waiting at nodes. Telephone networks work this way.

Packet switching. The message is cut into packets, each carrying its own header; packets share the links and are queued at nodes. Each node receives a whole packet before it starts to forward it (store and forward). Capacity is shared on demand, which is called statistical multiplexing.

Packet switching comes in two forms:

  • Datagram network: no set-up. Every packet carries the full destination address and each router chooses the outgoing link for every packet independently from a forwarding table; packets of one message may take different routes and arrive out of order (this is how IP works).
  • Virtual-circuit network: a path is chosen and state is set up before data (the connection setup); every packet carries only a short virtual-circuit identifier (VCI) which each switch rewrites on every link; all packets of the call follow the same path in order; the capacity is not reserved exclusively (unless the network also reserves resources). ATM and frame relay worked this way.
circuit switchingvirtual circuitdatagram
set-up before datayesyesno
capacityreserved per callsharedshared
packet carriesnothing (the circuit is the address)short VCIfull destination address
pathfixedfixed per callmay change per packet
order of deliveryin orderin ordernot guaranteed
router stateper callper callforwarding table only
node failurecall droppedcall droppedpackets rerouted
congestionrefused at set-up (busy signal)can occurcan occur

The table is quoted from the textbooks.

How it works

Take NN links in a row, each with rate RR and propagation delay dd. A message of MM bits is cut into PP packets of L=M/PL = M/P bits (no headers, no processing and no queueing delay other than waiting for the previous packet on the same link).

  • One packet (P=1P = 1): every node has to receive the whole packet before forwarding it, so the transmission delay is paid on every link: N⋅L/R+NdN \cdot L/R + N d.
  • PP packets: the first packet needs NL/RN L/R to reach the end; each further packet follows one packet-time behind it, so the last packet arrives after
(N+P−1) LR+Nd.(N + P - 1)\,\frac{L}{R} + N d.
  • Circuit switching: after the set-up time tst_s the message is sent as a stream over the reserved path without store and forward: ts+M/R+Ndt_s + M/R + N d.

Time to send 1 Mbit over 3 links of 1 Mbps: start

Computed by a script, not typed
methodtotal timeformula
packet switching, 1 packet of 1000000 bits
packet switching, 10 packets of 100000 bits
packet switching, 100 packets of 10000 bits
packet switching, 1000 packets of 1000 bits
circuit switching, setup 0.1 s
circuit switching, setup 0.5 s

Step 0

One message of 10^6 bits, three links of 10^6 bits per second, no propagation delay, no queueing, no header overhead. Computed by the store-and-forward model of scripts/cn_lib.py (path_delay).

0 / 6
computed by script: exact arithmetic (fractions), CRC long division and exhaustive enumeration of error patterns. python3 scripts/gen-cn1-traces.py

A 11-megabit message over three 11-Mbps links takes 33 s as one packet, but only 1.21.2 s as 1010 packets, 1.021.02 s as 100100 packets and 1.0021.002 s as 10001000 packets: splitting lets the links work in parallel (a pipeline). In the limit the time tends to M/RM/R (the time on one link) plus the delay of one small packet per extra link. With a set-up time of 0.10.1 s circuit switching needs 1.11.1 s, so packet switching with enough packets can be faster even for one message. The saving is real only while the header added to each packet is small; with headers of hh bits per packet each term grows to (L+h)/R(L + h)/R and there is an optimum number of packets.

A 1010 Mbps link serves users who each send at 11 Mbps when active. Circuit switching can serve 1010 users (one circuit each). Packet switching admits more users because users are not active all the time:

Statistical multiplexing: how often is the link overloaded?: start

Computed by a script, not typed
populationusers circuit switching can serveP(more than 10 active)as a percentage
35 users, each active 10 % of the time
20 users, each active 10 % of the time
50 users, each active 10 % of the time
30 users, each active 20 % of the time

Step 0

Exact binomial sums (fractions) rounded for printing; users are assumed independent. Real traffic is burstier than this model.

0 / 4
computed by script: exact arithmetic (fractions), CRC long division and exhaustive enumeration of error patterns. python3 scripts/gen-cn1-traces.py

With 3535 users, each active 1010 percent of the time independently, more than 1010 are active at once with probability only 0.0004240.000424: the link is overloaded rarely, and then packets queue briefly. Packet switching therefore carries 3.53.5 times as many users as circuit switching at almost the same quality. Packet switching is better for bursty traffic; circuit switching for steady streams that need guaranteed rate and no delay variation.

Worked examples

EX 1One packet over several links

Easy

A 1200012000-bit packet crosses 44 links of 22 Mbps with 11 ms propagation delay each: 4×12000/(2×106)+4×1 ms=24+4=284 \times 12000/(2\times 10^6) + 4 \times 1\text{ ms} = 24 + 4 = 28 ms.

EX 2Splitting into packets

Medium

A 11-Mbit message, 33 links of 11 Mbps, no propagation delay, no headers. In 1010 packets of 100100 kbit: (3+10−1)×0.1=1.2(3 + 10 - 1) \times 0.1 = 1.2 s. In 100100 packets: 102×0.01=1.02102 \times 0.01 = 1.02 s. As one packet: 33 s.

EX 3Circuit against packet

Medium

Same message, circuit set-up 0.50.5 s: 0.5+1=1.50.5 + 1 = 1.5 s, slower than 1010 packets (1.21.2 s) and faster than one packet (33 s). With a set-up of 0.10.1 s circuit switching (1.11.1 s) beats 1010 packets but not 100100.

EX 4Typical questions

GATE level

(a) "Which switching technique needs a connection set-up and delivers in order?" Circuit switching and virtual circuits. (b) "Which uses the full destination address in every packet?" Datagram networks. (c) "Which technique wastes capacity during silences?" Circuit switching. (d) "Number of users that circuit switching supports on a 1010 Mbps link if each needs 11 Mbps?" 1010. (e) "Store and forward delay of a PP-packet message over NN links?" (N+P−1)L/R(N + P - 1) L/R plus propagation.

Cheat box

Cheat box

  • Circuit: reserved path, set-up, no queueing, wasteful for bursts. Packet: shared, store and forward, queueing delay.
  • Datagram: full address per packet, no set-up, order not guaranteed. Virtual circuit: set-up, short VCI, in order.
  • One packet over NN links: NL/RN L/R (+ NdN d). PP equal packets: (N+P−1)L/R(N + P - 1) L/R (+ NdN d).
  • Circuit: ts+M/R+Ndt_s + M/R + N d.
  • Statistical multiplexing admits more users than circuits if traffic is bursty.

Traps and GATE patterns

Connections

The delay terms are defined on the next page (performance metrics). The Internet is a datagram network at the IP layer (IPv4 addressing, routing) on top of which TCP builds a reliable stream; the switches of a LAN forward frames in a similar store and forward way.

PYQs

6 previous year questions from your book. I re-solved each one myself (6 by running or simulating, 0 by reasoning only); the book's key is shown next to my answer. All PYQs

GATE 2026 · MCQ · 1 markQ1 · page 533 of the book
Consider a file of size 4 million bytes being
transferred between two hosts connected via a path
consisting of three consecutive links of bandwidth
2 Mbps, 500 kbps, and 1 Mbps, respectively.

All processing delays and propagation delays are
negligible. Assume there is no other background
traffic over the path and no additional overhead to
transfer the file.

Which one of the following is the total time

(in seconds) to transfer the file?

Note: 1M = 106, 1k = 103
  • (a)731
  • (b)64
  • (c)8
  • (d)16
GATE 2015 · NATQ23 · page 536 of the book
Two hosts are connected via a packet switch with 107
bits per second links. Each link has a propagation
delay of 20 microseconds. The switch begins
forwarding a packet 35 microseconds after it receives
the same. If 10000 bits of data are to be transmitted
between the two hosts using a packet size of 5000
bits, the time elapsed between the transmission of the
first bit of data and the reception of the last bit of the
data in microseconds is:

COMPUTER NETWORK
GATE 2014 · MCQQ28 · page 537 of the book
Consider the store and forward packet switched
network given below. Assume that the bandwidth of
each link is 10^6 bytes/sec. A user on host A sends a
file of size 10^3 bytes to host B through routers R1
and R2 in three different ways. In the first case, a
single packet containing the complete file is
transmitted from A to B. In the second case, the file
is transmitted from A to B. In the third case, the file
is split into 20 equal parts and these packets are sent
from A to B. Each packet contains 100 bytes of
header information along with the user data. Consider
only transmission time and ignore processing,
queuing and propagation delays. Also assume that
there are no errors during transmission. Let T1, T2,
and T3 be the times taken to transmit the file in the
first, second, and third case respectively. Which one
of the following is CORRECT?
  • (a)T1 < T2 < T3
  • (b)T1 > T2 > T3
  • (c)T2 = T3, T3 < T1
  • (d)T1 = T3, T3 > T2
GATE 2012 · MCQ · 2 marksQ30 · page 537 of the book
Consider a source computer (S) transmitting a file of
size 106 bits to a destination computer (D) over a
network of two routers (R1 and R2) and three links
(L1, L2, and L3).

COMPUTER NETWORK

L1 connects S to R1; L2 connects R1 to R2; and L3
connects R2 to D. Let each link be of length 100
km.

Assume signals travel over each link at a speed of
108meters per second.

Assume that the link bandwidth on each link is 1
Mbps. Let the file be broken down into 1000
packets, each of size 1000 bits.

Find the total sum of transmission and propagation
delays in transmitting the file from S to D?
  • (a)1005 ms
  • (b)1010 ms
  • (c)3000 ms
  • (d)3003 ms
GATE 2024 · MCQQ14 · page 549 of the book
Consider a network path P → Q → R between
nodes P and R via router Q. Node P sends a file of
size 106 bytes to R via this path, splitting the file
into chunks one after the other, each of size 103
bytes. Node P sends these chunks without any wait
time between the successive chunk transmissions.
Assume that the size of the extra headers added to
these chunks is negligible, and that the chunk size
is less than the MTU. Each of the links P → Q and
Q → R has a bandwidth of 106 bits/sec, and
negligible
propagation
latency.
Router
Q
immediately transmits every packet it receives
from P to R, with negligible processing and
queuing delays.

Assume P starts transmitting the chunks at time t =
0. Which one of the following options gives the
time (in seconds, rounded off to 3 decimal places)
at which R receives all the chunks of the file?
  • (a)16.000
  • (b)8.000
  • (c)8.008
  • (d)15.992
GATE 2005 · MCQ · 2 marksQ92 · page 563 of the book
In a packet switching network, packets are routed
from source to destination along a single path
having two intermediate nodes. If the message size
is 24 bytes and each packet contains a header of 3
bytes, then the optimum packet size is:
  • (a)4
  • (b)6
  • (c)7
  • (d)9

Self-check

Question 1

55 links of 1010 Mbps, no propagation delay. How long does a 22-Mbit message take as 2020 packets?

Show answer

Packet size 100100 kbit, packet time 1010 ms. (5+20−1)×10=240(5 + 20 - 1) \times 10 = 240 ms.

Question 2

Why does a datagram network need the full destination address in each packet?

Show answer

There is no per-call state in the routers; each router decides the next link from the packet's own destination address.

Question 3

A 11 Mbps link, users active 1010 percent of the time sending at 100100 kbps. How many users can circuit switching serve? Can packet switching serve more?

Show answer

1010 circuits of 100100 kbps. Packet switching can serve more, accepting a small probability that more than 1010 are active at once.

Revision card

One-screen revision

  • Circuit: set-up, reserved capacity, no queueing. Datagram: full address, no set-up. VC: set-up, short VCI, in order.
  • Store and forward: NN links, PP packets: (N+P−1)L/R+Nd(N + P - 1) L/R + N d.
  • Statistical multiplexing exploits burstiness.

References

  • ·Kurose, Ross, Computer Networking: A Top-Down Approach (8th edition), Chapter 1, Section 1.3 (The network core)
  • ·Tanenbaum, Wetherall, Computer Networks (5th edition), Chapter 5, Section 5.1 (Network layer design issues: datagram and virtual-circuit networks)

Verification

scripts/enum-checks/cn_basic_check.py: the pipelined store-and-forward delay computed by scripts/cn_lib.py (path_delay) agrees with an independent event-driven simulation on 1500 random paths (1 to 5 links, 1 to 5 packets, random rates and propagation delays); the closed forms N L/R + N d (one packet) and (N + P - 1) L/R + N d (P equal packets, equal links, no queueing) hold on 500 random cases; splitting a message into P packets saves the amount computed on the page on 300 cases; the statistical multiplexing probabilities are exact binomial sums, checked against enumeration of all subsets of users for populations up to 16. MODEL: no packet loss, no queueing other than at the first transmitter, infinite buffers, no header overhead, no processing delay (stated on every table); real networks have all of them. The comparison table of the three switching types and the description of virtual circuits and datagram networks are QUOTED from the textbooks. Textbook chapter references are from memory. SECOND PASS (2026-11-02, done by the assistant, not a human check): every Self-check question was solved before the printed answer was read and all agreed; the definitions, worked examples, cheat box and traps were read claim by claim and the numbers re-derived by hand or by a small script (CRC remainders, binomial tail, checksums); long C programs were not re-read line by line (they are compiled and compared by npm run verify:c, and their printed outputs were checked against the prose). No defect found. Status raised to self-checked; verified needs a textbook or human check.

last verified: never