Skip to content
GATEiit

GATE CSE · Computer Networks

Basics of switching (circuit, packet and virtual circuit) and performance metrics

Circuit, datagram and virtual-circuit switching compared, the four delays and bandwidth-delay product, store-and-forward timing, and link utilisation of stop-and-wait, Go-Back-N and Selective Repeat.

Before you start

  • Layers and headers →

    Packet sizes include headers, and the layer decides whether delivery is hop by hop or end to end.

  • Logarithms base 2

    Sequence-number bits come from ⌈log⁡2(sequence numbers needed)⌉.

This topic comes before: Data link layer: error detection, medium access control and Ethernet, DNS and HTTP, TCP: flow control and congestion control; socket API

Concept notes

1. Circuit switching

In circuit switching a dedicated path is set up between the two ends before any data flows. The call has three phases: setup, data transfer, teardown.

  • Each link on the path reserves a fixed share of capacity for the call, using FDM (a frequency band) or TDM (a time slot in every frame).
  • Once set up, data flows at a guaranteed rate with a constant delay. There is no queuing at the switches and no per-packet header.
  • The reserved capacity is wasted when the call is idle, which makes it poor for bursty computer traffic.

Time to send an L-bit message over a circuit of rate R:

T=Tsetup+LR+Tp

The message is transmitted once; intermediate switches do not store and forward it, so the number of hops adds only propagation delay.

With TDM, if a link of rate R is shared among n slots, each circuit gets R/n. GATE often gives the rate of one circuit; check whether it is the link rate or the per-circuit rate.

2. Packet switching: datagrams and virtual circuits

In packet switching a message is split into packets that share link capacity on demand (statistical multiplexing). Each router uses store-and-forward: it must receive the whole packet before sending it on the next link. Packets may wait in queues, and may be dropped if buffers fill.

Datagram networks (the Internet's IP): no setup; every packet carries the full destination address and is routed on its own, so packets may take different paths and arrive out of order. Routers keep no per-connection state.

Virtual circuit (VC) networks (ATM, Frame Relay, MPLS-like): a path is fixed during a setup phase; every packet carries a short VC identifier that each router looks up and may replace (label swapping). Packets follow one path and arrive in order. Routers keep per-connection state; if a router on the path fails, the VC breaks.

Circuit Virtual circuit Datagram
Setup needed Yes Yes No
Path Fixed Fixed Per packet
In-order delivery Yes Yes Not guaranteed
Address in each unit None Short VC id Full address
State in switches Per call Per VC None
Bandwidth Reserved Shared (may reserve) Shared
Router failure Call lost VC lost Rerouted

3. Delays, throughput and bandwidth-delay product

A packet of L bits on a link of rate R bit/s and length d sees four delays at each hop:

  • Transmission delay Tt=L/R: time to push all bits onto the link.
  • Propagation delay Tp=d/v: time for one bit to travel the link (v≈2×108 m/s in copper or fibre).
  • Queuing delay: waiting behind other packets (variable).
  • Processing delay: header checks and table lookup (usually ignored).

Store-and-forward timing. N equal packets crossing k links of equal rate (no queuing): the first packet needs k Tt, after which one packet arrives every Tt:

T=(k+N−1) Tt+k Tp.

So splitting a message into smaller packets pipelines the hops and cuts delay, but each packet carries its own header, so packets cannot be too small.

Throughput of a path is set by its bottleneck link: min⁡(R1,R2,… ).

Bandwidth-delay product R×Tp is the number of bits "in flight" on the link. RTT is the time from sending a bit to getting its reply; with negligible ACK size, RTT=2Tp.

Units: rates use powers of 10 (1 Mbps =106 bit/s); memory sizes in GATE are often powers of 2. Use what the question states.

4. Stop-and-wait and sliding window utilisation

In stop-and-wait the sender sends one frame and waits for its ACK. Ignoring ACK size and processing, one cycle is Tt+2Tp, of which only Tt is useful. With a=Tp/Tt:

ηSW=TtTt+2Tp=11+2a.

A sliding window protocol lets the sender have up to W unacknowledged frames:

η=min⁡(1,W1+2a),throughput=ηR.

Full utilisation needs W≥1+2a.

Sequence numbers. With k-bit sequence numbers there are 2k numbers.

Protocol Sender window Receiver window
Stop-and-wait 1 1
Go-Back-N at most 2k−1 1
Selective Repeat at most 2k−1 same as sender

In Go-Back-N, a lost frame makes the sender resend it and every frame after it; the receiver accepts only in order (cumulative ACKs). In Selective Repeat, only the lost frame is resent and the receiver buffers out-of-order frames. The SR limit stops a resent old frame from being mistaken for a new one.

To keep the link full: Go-Back-N needs k=⌈log⁡2(W+1)⌉ bits, Selective Repeat needs k=⌈log⁡2(2W)⌉ bits, with W=⌈1+2a⌉.

Sliding window timelineSenderReceiverF0ACK0F1ACK1F2ACK2F3busy 3TtidleACK0 back
Sliding window with W = 3 and Tp = 4 Tt. The sender is busy for 3 frame times in every Tt + 2Tp = 9 frame times, so efficiency is 3/9 = W/(1 + 2a).

Formulas to remember

Transmission delay
Tt=LR
Propagation delay
Tp=dv
Circuit-switched message time
T=Tsetup+LR+Tp
Store-and-forward, N packets over k linksEqual link rates, no queuing or processing
T=(k+N−1) Tt+k Tp
Bandwidth-delay productBits in flight on the link one way
BDP=R×Tp
Stop-and-wait efficiency
η=11+2a,a=TpTt
Sliding window efficiency
η=min⁡(1,W1+2a)
Throughput
Throughput=η×R
Window limits with k-bit sequence numbers
WGBN≤2k−1,WSR≤2k−1

Common mistakes

  • Using RTT where the formula needs one-way propagation delay: a=Tp/Tt, and the cycle is Tt+2Tp.
  • Forgetting the (N−1) pipelining term, or multiplying every packet by the number of hops.
  • Using 2k−1 for Selective Repeat; SR allows only 2k−1.
  • Mixing bytes and bits, or 103 and 210, when computing transmission time.
  • Taking the average link rate as throughput; the bottleneck (slowest) link decides it.
  • Charging circuit switching a transmission time per hop; the message is transmitted only once.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Circuit switching vs packet switching

numerical

A 10,000-bit message crosses 3 links (2 routers). Every link is 1 Mbps with 1 ms propagation delay. Ignore headers, queuing and processing. Find the delivery time if (a) it is sent as one packet, (b) it is sent as 10 packets of 1000 bits, (c) it is sent over a circuit with a 5 ms setup time.

  1. Step 1: Find the transmission time of the message and of one small packet.

    Try it on paper first.

Example 2: Stop-and-wait efficiency and the window to fill the pipe

numerical

Frames are 1000 bytes, the link is 1 Mbps and the one-way propagation delay is 20 ms. Find the stop-and-wait efficiency and throughput, the window needed for full utilisation, and the minimum sequence-number bits for Go-Back-N and Selective Repeat with that window.

  1. Step 1: Find $T_t$ and $a$.

    Try it on paper first.

Example 3: Bottleneck throughput and bits in flight

numerical

A file of 8×106 bits goes over a path of three links with rates 10 Mbps, 2 Mbps and 5 Mbps. Ignoring propagation and packet overheads, roughly how long does the transfer take? If the 2 Mbps link has a one-way propagation delay of 50 ms, how many bits are in flight on it when it is full?

  1. Step 1: Which link sets the throughput?

    Try it on paper first.

Example 4: Why Selective Repeat needs the smaller window

conceptual

With 2-bit sequence numbers (0 to 3), show what goes wrong if Selective Repeat uses a window of 3 instead of 2.

  1. Step 1: Send a full window and lose all the ACKs.

    Try it on paper first.

Previous year questions

10 official GATE CSE questions on this topic, newest first.

Practise these 10 PYQs →

Topic test

10 questions: up to 4 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE CSE syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.