Recall warm-up
- What does a router do with a packet under store-and-forward?
Stuck? Peek at 1.2.2 Packet switching: store-and-forward, datagrams, statistical multiplexing
- Packet switching: packets with headers; no reservation; full link rate while sending.
- Store-and-forward: receive whole packet → buffer/queue → forward; full buffer → loss.
- Datagram: each packet routed independently; may reorder; robust to failures.
- Statistical multiplexing: share capacity on demand; P(exactly k of n) = C(n,k)pᵏ(1−p)ⁿ⁻ᵏ.
- Three phases of circuit switching?
Stuck? Peek at 1.2.1 Circuit switching: setup, reserved resources, teardown
- Circuit switching: setup → data transfer → teardown.
- Dedicated path; each link's share (time slot or frequency band) is reserved: circuit rate = R/n.
- Total time = setup + bits/circuit rate (+ travel time if given).
- + guaranteed rate, in order, no queues; − setup delay, idle capacity wasted, fragile.
- Which OSI layer chooses routes across networks?
Stuck? Peek at 1.1.2 The OSI 7 layers and the TCP/IP model
- OSI bottom-up: Physical, Data link, Network, Transport, Session, Presentation, Application.
- Scope: link → hop → host-to-host → process-to-process.
- Routers: layers 1–3; hosts: 1–7.
- TCP/IP (5): application (= OSI 5–7), transport, network, data link, physical.
- Encryption/compression = presentation; dialogue control = session.
The Hook
A taxi rank at an airport: the first time you go to a hotel, the dispatcher writes the route on a card and gives your group a short card number. Every later taxi of your group just shows "card 7" and drivers already know the way. No lane is reserved — taxis still share the road — but the route is decided once. That is a virtual circuit.
Predict First
In a virtual circuit, does a packet need to carry the full destination address in every header?
,No. After setup, each packet carries only a short virtual-circuit identifier (VCI); each switch looks it up in a table built during setup. The full address is needed only in the setup request.
Core Concept
Virtual circuit: setup + packets
It has the same three phases as a circuit (setup, data transfer, teardown) but the data moves as packets with store-and-forward.
VC tables and label swapping
Each switch keeps a table: (incoming link, incoming VCI) → (outgoing link, outgoing VCI). The VCI usually changes at each hop — each link has its own numbering — so a switch rewrites the label as it forwards ("label swapping").
| Switch | In link | In VCI | Out link | Out VCI |
|---|---|---|---|---|
| S1 | 1 | 12 | 3 | 22 |
| S2 | 2 | 22 | 1 | 7 |
Connection-oriented vs connectionless
Connection-oriented: a setup phase creates state before data flows (circuit switching, virtual circuits). Connectionless: no setup; every unit is independent (datagrams).
The full comparison
GATE favourite. Learn this table row by row.
| Property | Circuit | Virtual circuit | Datagram |
|---|---|---|---|
| Setup phase | yes | yes | no |
| Resources reserved | yes (link capacity) | no (only table entries) | no |
| Addressing in each unit | none needed | short VCI | full destination address |
| Path | fixed | fixed after setup | per packet |
| Order | in order | in order | may reorder |
| Store-and-forward / queueing | no | yes | yes |
| Effect of a switch failure | call drops | all VCs through it drop | only packets there are lost; others reroute |
| Link capacity use | wasted when idle | shared | shared |
Putting it together
- A virtual circuit sets up a path once and then forwards packets by short labels.
- It is connection-oriented like a circuit, but shares link capacity like datagrams.
- Know the comparison table: setup, reservation, addressing, path, order, failure.
Visual
Worked Examples
Which of circuit, virtual circuit, datagram: (a) has no setup; (b) reserves link capacity; (c) uses a short label in each packet?
Show the full solution
(a) Datagram. (b) Circuit. (c) Virtual circuit.
A full destination address takes 32 bits; a VCI takes 12 bits. A connection carries 10,000 packets. How many header bits per packet, and how many bytes in total, does the VC save?
Show the full solution
Per packet: 32 − 12 = 20 bits. Total: 20 × 10,000 = 200,000 bits = 25,000 bytes.
Which are true? (i) In a virtual circuit network, all packets of a connection follow the same path. (ii) Virtual circuits reserve link capacity at setup. (iii) Datagram networks need no setup phase. (iv) In a virtual circuit network packets can arrive out of order.
Show the full solution
(i) True. (ii) False — only table state, no link capacity reservation. (iii) True. (iv) False — one path means order is preserved.
GATE Traps
- Virtual circuits do not reserve link capacity — packets still queue and can be dropped.
- The VCI is local to each link and usually changes at every hop.
- Both circuit and virtual-circuit networks deliver in order; only datagrams may reorder.
Memory Hook
"Circuit = private road. Virtual circuit = shared road with a fixed route card. Datagram = every car asks for directions at each junction."
Connect the Dots
We now know three ways for our packets to cross the network. Next (Ch 1.3): how long does it actually take? We need to measure delays: how long to push bits onto a link, how long they travel, and how long they wait.
Self-Test
- MCQ
Which switching method reserves link capacity for the whole connection?
- Datagram
- Virtual circuit
- Circuit
- All three
- MSQ
Which are true of virtual-circuit switching?
- It has a setup phase.
- Packets carry a short VC identifier.
- Packets of one connection can take different paths.
- Packets can be queued at switches.
- MCQ
In which method can packets of one message arrive out of order?
- Circuit
- Virtual circuit
- Datagram
- None
- NAT
Full address 32 bits, VCI 10 bits. Header bits saved over 500 packets?
Write your answer before opening the key.
Rule Card
- Virtual circuit: setup chooses a path, switches store (in-link, in-VCI → out-link, out-VCI); packets carry short VCIs; no link capacity reserved.
- Connection-oriented: circuit, VC. Connectionless: datagram.
- Setup? reserved? per-packet routing? → circuit Y/Y/N · VC Y/N/N · datagram N/N/Y.
- Order kept by circuit and VC; datagrams may reorder.
Concept Ledger
- virtual circuit
- VC identifier (VCI), label swapping
- connection-oriented vs connectionless
- circuit / VC / datagram comparison
Answer Vault
Try the questions first. Open when you are ready to check.
Warm-up answers
- Receives it completely, stores it, then forwards it.
- Setup, data transfer, teardown.
- The network layer.
Self-test answers
- C — Only circuit switching reserves link capacity.
- A: Datagrams reserve nothing.
- B: VCs keep table entries but share link capacity.
- D: Only circuits reserve.
- ABD — Setup, short labels, store-and-forward queues.
- C: All packets of a VC follow the path chosen at setup.
- C — Only independent datagrams can take different paths.
- A: Fixed path → in order.
- B: Fixed path → in order.
- D: Datagrams can reorder.
- 11000 — 22 × 500 = 11,000 bits.
Flashcards
- Does a virtual circuit reserve link capacity?
Reveal answer
No — only table entries in switches. - Which methods keep packet order?
Reveal answer
Circuit and virtual circuit. - Connectionless switching method?
Reveal answer
Datagram.
Exam shortcuts
- Three questions decide the type: setup? reserved link capacity? per-packet routing? circuit = yes/yes/no · VC = yes/no/no · datagram = no/no/yes. — any classification question about switching.