CN
BCA-5003: Unit III
Switching, Sliding Window ARQ & ISDN
🏠
Subject: BCA-5003 (Networks) ⭐ GBN vs Selective Repeat & ISDN PYQs Day 3 Focus (Distributed Plan)

Unit III: Switching, Sliding Window ARQ & Telephony

Comprehensive conceptual textbook guide covering Switching Techniques (Circuit vs. Packet vs. Message), Flow & Error Control (Stop-and-Wait, Go-Back-N, Selective Repeat ARQ), and Digital Telephony (PSTN, T1/E1 Carriers, and ISDN BRI/PRI Architecture).

🎯 Unit Learning Objectives:
  1. Compare Circuit Switching, Packet Switching (Datagram vs. Virtual Circuit), and Message Switching.
  2. Explain the mechanics of Stop-and-Wait ARQ and calculate channel efficiency.
  3. Diagram and contrast Go-Back-N (GBN) with Selective Repeat (SR) Sliding Window ARQ protocols.
  4. Calculate sender and receiver window bounds ($W_S \le 2^m - 1$ for GBN vs. $W_S \le 2^{m-1}$ for SR).
  5. Explain Digital T-carrier (T1 at 1.544 Mbps) and E-carrier (E1 at 2.048 Mbps) multiplexing.
  6. Describe the channels (B, D, H) and service interfaces of ISDN (Basic Rate Interface BRI vs. Primary Rate Interface PRI).
💡 Conceptual Intuition: Why Did the Internet Choose Packet Switching Over Circuit Switching?
In the old landline telephone network (**Circuit Switching**), when you placed a call from Kanpur to Delhi, physical copper switches locked a dedicated path just for your voice. Even if you paused for 20 seconds without speaking, that circuit remained reserved and blocked from all other callers! This was extraordinarily wasteful.
The Internet uses **Packet Switching**: It takes your file, chops it into small discrete numbered **packets**, and sends them over shared optical links. Packets from thousands of different users mingle across the same fiber line, and routers forward each packet along the fastest available path. Bandwidth is shared dynamically with 99% efficiency!
1. Switching Techniques: Circuit, Packet & Message
⭐ CSJMU PYQs: 2024–25, 2023–24, 2021 (Compare Circuit Switching vs Packet Switching with diagrams)

Switching is the process of forwarding data from an incoming transmission port to an outgoing transmission port towards its final destination across an interconnected network.

Evaluation Factor Circuit Switching Packet Switching (Datagram) Message Switching
Dedicated Physical Path Yes: Dedicated physical path established prior to data transfer. No: Shared links; packets routed dynamically and independently. No: No dedicated path; entire message stored and forwarded.
Transmission Phases Strictly 3 Phases: 1. Circuit Setup $\to$ 2. Data Transfer $\to$ 3. Teardown. No setup phase (Datagram); packets transmitted immediately upon arrival. No setup phase; message stored on disk at each node.
Bandwidth Utilization Low / Inefficient: Channel is reserved even during silent gaps. High / Optimal: Multiplexed dynamic bandwidth sharing. Moderate.
Per-Packet Header Overhead Zero header overhead during transfer (path already fixed). High: Every individual packet carries source and destination IP addresses. Header on complete message.
Primary Application Traditional analog landline telephone networks (PSTN). The Modern Internet (IP Networks), cellular 4G/5G data. Historical telegraph networks, early email.

Packet Switching: Datagram vs. Virtual Circuit

  • Datagram Approach (Connectionless): Each packet is treated as an independent entity called a datagram. Routers evaluate routing tables on-the-fly. Packets may follow completely different physical paths across the country and arrive out of order at the receiver (requiring reassembly).
  • Virtual Circuit Approach (Connection-Oriented): A logical path is pre-determined during a setup phase. All packets in the session follow the exact same route and arrive in order. Instead of long IP headers, packets carry a compact Virtual Circuit Identifier (VCI) e.g. ATM, Frame Relay.
2. Flow & Error Control: Stop-and-Wait, Go-Back-N & Selective Repeat
⭐ CSJMU PYQs: 2025–26, 2024–25, 2023–24, 2022–23, 2019 (High frequency! Compare GBN vs Selective Repeat with timeline diagrams)

Automatic Repeat reQuest (ARQ) protocols manage flow control (preventing a fast sender from overwhelming a slow receiver) and error control (retransmitting lost or corrupted frames).

Sender Receiver Frame 0 ACK 1 ❌ Lost! Frame 2 (Discarded in GBN) Retransmit Frame 1
Sliding Window ARQ Timeline Under Frame Loss
Evaluation Parameter Stop-and-Wait ARQ Go-Back-N (GBN) ARQ Selective Repeat (SR) ARQ
Sender Window Size ($W_S$) $W_S = 1$ $W_S = 2^m - 1$ ($N$ frames) $W_S = 2^{m-1}$
Receiver Window Size ($W_R$) $W_R = 1$ $W_R = 1$ (strictly in-order only) $W_R = 2^{m-1}$ (buffers out-of-order)
Behavior on Lost Frame $k$ Timer expires $\to$ retransmits frame. Receiver discards frame $k$ and all subsequent frames; sender retransmits ALL frames from $k$ to $k+N-1$! Receiver buffers subsequent frames; sender retransmits ONLY the lost frame $k$!
Acknowledgment Type Positive ACK for each frame. Cumulative ACK: ACK $n$ confirms all frames up to $n-1$. Individual / Selective ACK: Confirms specific received frame numbers.
Channel Efficiency Very low for high-delay links ($\eta = \frac{1}{1 + 2a}$). Moderate; wastefully retransmits valid frames if loss occurs. Maximum efficiency; optimal utilization of noisy, high-bandwidth channels.
Why Must Window Sizes Obey $W_S + W_R \le 2^m$?
If the sequence numbers are represented using $m$ bits, there are $2^m$ distinct numbers ($0$ to $2^m - 1$). If $W_S + W_R > 2^m$, sequence numbers wrap around prematurely: If all ACKs are lost, the sender retransmits old frames, but the receiver mistakes them for completely new frames with the wrapped sequence number!
• In GBN: $W_R = 1 \implies W_S \le 2^m - 1$.
• In Selective Repeat: $W_S = W_R \implies 2 W_S \le 2^m \implies \mathbf{W_S = W_R = 2^{m-1}}$.
3. Digital Telephony & Integrated Services Digital Network (ISDN)
⭐ CSJMU PYQs: 2025–26, 2024–25, 2022–23, 2020 (What is ISDN? Compare BRI and PRI, explain T1 carrier)

1. Digital T-Carrier and E-Carrier Multiplexing

Standard telephone voice has a bandwidth of $4\text{ kHz}$. By the Nyquist sampling theorem, it is sampled at $2 \times 4000 = 8000\text{ samples/sec}$. Each sample is encoded in 8 bits via Pulse Code Modulation (PCM) $\implies 8000 \times 8 = \mathbf{64\text{ kbps}}$ (the standard Digital Signal 0 / DS0 rate).

Carrier Standard Geographic Region Channel Structure Gross Data Rate Calculation
T1 Carrier (DS1) North America, Japan 24 Voice Channels + 1 Framing Bit $(24 \times 8 + 1) = 193\text{ bits/frame} \times 8000\text{ frames/sec} = \mathbf{1.544\text{ Mbps}}$
E1 Carrier Europe, India, Worldwide 32 Channels (30 Voice + 1 Signaling + 1 Sync) $(32 \times 8) = 256\text{ bits/frame} \times 8000\text{ frames/sec} = \mathbf{2.048\text{ Mbps}}$

2. Integrated Services Digital Network (ISDN)

ISDN was developed by ITU-T to replace the analog telephone local loop with a pure end-to-end digital network capable of transmitting voice, data, fax, and video simultaneously over standard copper lines.

Channel Type Channel Name Bit Rate Core Function
B Channel Bearer Channel $64\text{ kbps}$ Carries user voice, audio, video, or data payload (basic digital pipe).
D Channel Delta Channel $16\text{ kbps}$ (BRI) or $64\text{ kbps}$ (PRI) Carries out-of-band call control, signaling, and packet telemetry.
H Channel High-Speed Channel $384\text{ kbps}$ ($H_0$), $1.536\text{ Mbps}$ ($H_{11}$), $1.920\text{ Mbps}$ ($H_{12}$) Fast digital pipe for high-definition video conferencing and bulk data.

ISDN User Interfaces: BRI vs. PRI

Service Interface Channel Composition User Bit Rate Target Market & Use Case
Basic Rate Interface (BRI) $2\text{B} + 1\text{D}$ ($2 \times 64\text{k} + 16\text{k}$) $144\text{ kbps}$ ($192\text{ kbps}$ with framing) Residential homes and small retail offices (simultaneous phone call + internet on one line).
Primary Rate Interface (PRI) $23\text{B} + 1\text{D}$ (US/T1) or $30\text{B} + 1\text{D}$ (Europe/E1) $1.544\text{ Mbps}$ (US) or $2.048\text{ Mbps}$ (Europe/India) Large corporate enterprises, universities, call centers with digital PBX switchboards.
4. Data Link Layer Framing: Byte Stuffing & Bit Stuffing
⭐ CSJMU PYQs: 2024–25, 2022–23, 2020 (Explain framing methods: character stuffing and bit stuffing with examples)

The Data Link Layer divides the continuous raw bit stream from the Physical Layer into discrete logical units called Frames. Framing allows the receiver to detect where a frame starts and ends.

Framing Method Mechanism Vulnerability / Solution
Character Count Uses a header integer field to indicate total characters in the frame. Fatal flaw: If transmission error flips the count integer, frame synchronization is permanently lost! Rarely used today.
Byte (Character) Stuffing Frame begins and ends with delimiter flag bytes (e.g. DLE STX and DLE ETX). If the user payload itself contains DLE, the sender inserts an extra escape DLE before it. Receiver removes the escape DLE automatically. Works on 8-bit character-oriented protocols (e.g. BISYNC).
Bit Stuffing Frame begins and ends with a unique 8-bit flag: 01111110 (six consecutive 1s). Whenever the sender detects five consecutive 1s in the user payload, it automatically injects a dummy 0 bit! The receiver monitors the incoming bit stream: when it sees five 1s followed by a 0, it removes (destuffs) the 0. If it sees five 1s followed by a 1 and 0, it knows it is the end-of-frame flag!
Solved Exam Problem: Bit Stuffing (CSJMU 2024–25):
• Original Data Bit Stream: 01101111111011111010
• Bit-Stuffed Stream: After every five consecutive 1s, insert a 0:
0110111110110111110010
• Receiver automatically destuffs the bold 0 bits to recover the original stream!
5. Error Detection & Correction: CRC & Hamming Code
⭐ CSJMU PYQs: 2025–26, 2024–25, 2023–24, 2021, 2018 (Extremely High Frequency 10–15 Mark Numericals!)

1. Cyclic Redundancy Check (CRC) Polynomial Division

CRC is a powerful polynomial code used in Ethernet, Wi-Fi, and hard drives. It treats bit strings as polynomials with coefficients in GF(2) (binary arithmetic using XOR without carry).

The CRC Algorithm Steps:
1. Let $M$ be the $k$-bit data string, and $G(x)$ be an $(r+1)$-bit generator polynomial divisor.
2. Append $r$ zero bits to the data string ($M \cdot 2^r$).
3. Divide $(M \cdot 2^r)$ by $G$ using modulo-2 division (bitwise XOR; like bits yield 0, unlike bits yield 1).
4. The $r$-bit remainder $R$ is appended to $M$ to form the transmitted codeword $T = M \cdot 2^r \oplus R$.
5. The receiver divides the received codeword by $G$: If the remainder is strictly zero, no error is detected!

Master Solved Numerical: CRC Generation & Checking

Problem: Given Data bit stream $M = 100100$ and Generator polynomial $G(x) = x^3 + x^2 + 1$ (bit string $1101$). Find the transmitted CRC codeword.

• Degree of $G(x) = 3 \implies$ Append $r = 3$ zeros to $M$: Appended string = 100100000.
• Generator $G = 1101$ (4 bits).

        111101   (Quotient)
1101 | 100100000
       1101
       -----
        1000
        1101
        -----
         1010
         1101
         -----
          1110
          1101
          -----
           0110
           0000
           -----
            1100
            1101
            -----
             001  <-- Remainder R = 001 (3 bits)

Transmitted Codeword $T = \text{Data} + R = \mathbf{100100001}$.
Receiver Check: Dividing $100100001$ by $1101$ yields remainder $000 \implies$ Valid frame accepted!

2. Hamming Code Single-Bit Error Correction

Algorithm (Richard Hamming):
• If data has $m$ bits and $p$ parity bits are added, the total bits $n = m + p$ must satisfy: $$\mathbf{2^p \ge m + p + 1}$$ • Parity bits occupy bit positions that are powers of 2 ($1, 2, 4, 8, \dots$, i.e. $P_1, P_2, P_4, P_8$).
• Data bits occupy remaining positions ($3, 5, 6, 7, \dots$).
• Each parity bit checks specific bit positions whose binary representation has a 1 in that bit's power-of-2 position:
$P_1$ checks positions $1, 3, 5, 7, 9, 11\dots$ (binary $xx1$)
$P_2$ checks positions $2, 3, 6, 7, 10, 11\dots$ (binary $x1x$)
$P_4$ checks positions $4, 5, 6, 7, 12, 13\dots$ (binary $1xx$)

Solved Exam Problem: 7-Bit Hamming Code

Problem: Encode 4-bit data $D = 1011$ using even parity Hamming code, and demonstrate error correction if bit 5 flips during transit.

• Data bits $m = 4 \implies 2^p \ge 4 + p + 1 \implies p = 3$ ($2^3 = 8 \ge 8$ ✓). Total codeword length $= 7$ bits.
• Bit positions: $1(P_1), 2(P_2), 3(D_3), 4(P_4), 5(D_5), 6(D_6), 7(D_7)$.
• Place data $D = 1011$: $D_7=1, D_6=0, D_5=1, D_3=1$.
• Calculate Parity Bits (Even Parity):
$P_1 \oplus D_3 \oplus D_5 \oplus D_7 = 0 \implies P_1 \oplus 1 \oplus 1 \oplus 1 = 0 \implies P_1 = \mathbf{1}$
$P_2 \oplus D_3 \oplus D_6 \oplus D_7 = 0 \implies P_2 \oplus 1 \oplus 0 \oplus 1 = 0 \implies P_2 = \mathbf{0}$
$P_4 \oplus D_5 \oplus D_6 \oplus D_7 = 0 \implies P_4 \oplus 1 \oplus 0 \oplus 1 = 0 \implies P_4 = \mathbf{0}$
• Codeword: $P_1 P_2 D_3 P_4 D_5 D_6 D_7 = \mathbf{1010101}$.

Error Detection at Receiver: Suppose bit 5 flips from $1 \to 0$, received word is $1010\mathbf{0}01$.
Check parity equations:
$C_1 = b_1 \oplus b_3 \oplus b_5 \oplus b_7 = 1 \oplus 1 \oplus 0 \oplus 1 = 1$
$C_2 = b_2 \oplus b_3 \oplus b_6 \oplus b_7 = 0 \oplus 1 \oplus 0 \oplus 1 = 0$
$C_4 = b_4 \oplus b_5 \oplus b_6 \oplus b_7 = 0 \oplus 0 \oplus 0 \oplus 1 = 1$
Syndrome word $= C_4 C_2 C_1 = \mathbf{101_2 = 5_{10}}$! The syndrome points directly to Bit 5! Inverting bit 5 instantly corrects the error!

6. Multiplexing: FDM, TDM & WDM
⭐ CSJMU PYQs: 2024–25, 2021 (Compare FDM vs TDM, Synchronous vs Statistical TDM)

Multiplexing is the technique of combining multiple low-speed signals into a single composite high-capacity physical transmission channel to optimize link utilization.

Multiplexing Type Operational Domain Working Principle Primary Application
Frequency Division Multiplexing (FDM) Analog Total link bandwidth is divided into discrete frequency bands separated by **guard bands** to prevent inter-channel interference. AM/FM radio, cable television (CATV), cellular 1G.
Time Division Multiplexing (TDM) Digital Total transmission time is divided into recurring time slots. Each user gets the entire bandwidth for a dedicated micro-interval. T1/E1 telephony lines, digital trunking.
Wavelength Division Multiplexing (WDM) Optical Multiple optical light signals of different wavelengths (colors) are combined over a single optical fiber using prisms or diffraction gratings. High-capacity undersea fiber optic cables.
Synchronous TDM vs. Statistical (Asynchronous) TDM:
• Synchronous TDM: Each source is pre-allocated a fixed time slot in every frame, even if it has no data to transmit. If a user is idle, their slot is transmitted empty, leading to wasted bandwidth.
• Statistical TDM: Time slots are dynamically allocated on demand only to active stations with data to send. High channel efficiency, but each slot must carry an address header identifying the source.
7. High-Level Data Link Control (HDLC) Protocol
⭐ CSJMU PYQs: 2023–24, 2020 (HDLC frame format, I-frame, S-frame, U-frame)

HDLC is a bit-oriented synchronous Data Link Layer protocol developed by ISO. Every HDLC frame has the standard structure:

| Flag (8 bits) | Address (8) | Control (8/16) | Payload (Variable) | FCS (16/32) | Flag (8) |
|   01111110    |  Station ID |   Frame Type   |     User Data      |   CRC-16    | 01111110 |
8. Exam Answer Blueprint: 10-Mark Model Structure
How to Score Full 10 Marks on "Go-Back-N vs. Selective Repeat ARQ":
  1. Definitions (2 Marks): State that both are sliding window protocols designed to keep the channel busy while awaiting ACKs.
  2. Window Constraints (2 Marks): State that in GBN, $W_S = 2^m - 1$ and $W_R = 1$. In SR, $W_S = W_R = 2^{m-1}$. Explain why.
  3. Timeline Diagrams (4 Marks): Draw two side-by-side timelines under frame loss:
    • GBN: Frame 1 is lost $\to$ receiver discards frames 2, 3 $\to$ sender retransmits 1, 2, 3.
    • SR: Frame 1 is lost $\to$ receiver buffers 2, 3 and sends NAK 1 $\to$ sender retransmits ONLY frame 1.
  4. Comparison Summary (2 Marks): Compare retransmission overhead, receiver buffering memory, and ACK types.
⚠️ Common Exam Pitfalls:
• Confusing Receiver Window in GBN: In Go-Back-N, the receiver window is strictly $1$. The receiver CANNOT buffer out-of-order frames! It simply drops them.
• Miscalculating T1 Bit Rate: Remember to include the $1$ framing bit! $(24 \times 8) + 1 = 193\text{ bits} \times 8000 = 1.544\text{ Mbps}$.
5. Unit III Examination Mastery MCQ Quiz

Verify your conceptual mastery across switching methods, sliding window ARQ protocols, T1 carriers, and ISDN with this 10-question quiz.