4.3.7 · HinglishComputer Networks

Switching — circuit, packet, virtual circuit

2,421 words11 min readRead in English

4.3.7 · Coding › Computer Networks


Switching KYA hota hai?

Poora subject do sawaalon ke around split hota hai:

  1. Kya advance mein ek dedicated path reserved ki jaati hai? (resource reservation)
  2. Kya har switch per-connection state rakhta hai?
Path reserved? Per-connection state? Decision time
Circuit switching Haan (poora bandwidth) Haan Data se pehle (setup)
Packet switching (datagram) Nahi Nahi Har packet ke liye, on the fly
Virtual circuit Logical path, bandwidth nahi Haan (VC table) Setup, phir label se forward

1. Circuit Switching

YEH kaise kaam karta hai

  • Setup: ek request hop-by-hop propagate hoti hai; har switch ek channel reserve karta hai (jaise TDM mein ek time slot ya FDM mein ek frequency band) aur input↔output ko link karta hai.
  • Transfer: data bina per-hop header processing ke flow karta hai — path hardwired hai.
  • Teardown: resources release ho jaate hain.

Total delay derive karna

Maano:

  • = setup time (circuit banane ke liye signaling),
  • = links ki sankhya (hops), = har link par propagation delay,
  • = message size (bits), = link rate (bits/s).

Jab circuit exist kar jaata hai, message continuously stream hota hai; yeh har switch par store nahi hota, isliye bits ek pipe mein paani ki tarah flow karte hain.

Yeh form kyun hai? Setup ke baad, pehla bit saare links cross karta hai (cost ), aur source rate par saare bits push karta hai (cost ). Koi store-and-forward nahi transmission term par nahi.


2. Packet Switching (Datagram)

Table kaise kaam karta hai: har router destination address dekhta hai aur forwarding/routing table consult karta hai → outgoing link. State per-connection nahi hoti; yeh per-destination hoti hai (global routes).

Delay derive karna (store-and-forward)

bits ka ek message (single packet) links across bhejo, rate , propagation per link.

Kyunki har switch ko packet aage bhejne se pehle poora packet receive karna hota hai, har links mein se har ek ko serially ek transmission time lagta hai:

kyun? Packet har hop par reborn hota hai — switch 1 receive karna finish karta hai (time ) switch 2 ko push karne se pehle, etc. Yeh serial replay store-and-forward ki cost hai.

Ab magic — packets ke saath pipelining. ko packets mein split karo, har ek ki size (header ignore karo). Pehla packet destination tak pahunchta hai transmission ke baad, phir baaki packets pipeline-style peeche stream karte hain, ek dusre se apart:

Pipelining kyun help karta hai: jab link 2 packet 1 carry kar raha hai, link 1 already packet 2 carry kar raha hai. Jaise badhta hai, , toh transmission cost — wahi jaise sirf ek hop ho! Chhote packets ⇒ zyada pipelining ⇒ kam delay (jab tak headers dominate na karen).

Figure — Switching — circuit, packet, virtual circuit

3. Virtual Circuit Switching

Label swapping kaise kaam karta hai: har hop par switch incoming VC number read karta hai, use lookup karta hai, apni table se outgoing number se swap karta hai, aur forward karta hai. Label sirf locally meaningful hota hai.

Comparison summary

Feature Circuit Datagram Virtual Circuit
Setup phase Haan (BW reserve karo) Nahi Haan (sirf logical)
Bandwidth reserved Haan Nahi Nahi
Per-packet address kuch nahi full destination chhota VC label
Path fixed, dedicated har packet mein vary karta hai fixed, shared
Ordering guaranteed Haan Nahi Haan
Switch mein state per-circuit per-destination route per-VC table
Header overhead low high low
Idle hone par BW waste Haan Nahi Nahi



Recall Feynman: ek 12-saal ke bachche ko explain karo

Socho tum toy cars apne dost ke paas ek crossroads wale shehar mein bhej rahe ho. Circuit switching: tum pehle call karke policemen se kehte ho ki sirf tumhari cars ke liye ek poori private road clear karo — fast aur smooth, lekin road khali baithti hai jab tum decide kar rahe ho kaunsi car bhejna hai, aur koi aur use nahi kar sakta. Packet switching: tum apne dost ka poora address har car par likhte ho aur unhe normal traffic mein push kar dete ho. Woh jo bhi streets open hain le lete hain, shayad ulta-pulta pahunchte hain — lekin roads shared hain toh kuch waste nahi hota. Virtual circuit: tum pehle ek baar drive karke har crossroad par chhote colored stickers se route mark karte ho. Phir tumhari cars sirf stickers follow karti hain (padhna sasta hai) aur order mein rehti hain — lekin doosre logon ki cars abhi bhi same roads use karti hain.


Connections

  • Computer Networks
  • Routing Algorithms (datagram ko routing tables chahiye; VC ko setup signaling)
  • Multiplexing — TDM, FDM (circuits channels kaise reserve karte hain)
  • TCP — reliable ordered delivery (datagram reordering fix karta hai)
  • MPLS / ATM (real virtual-circuit technologies)
  • Store-and-Forward and Network Delays
  • Queueing Delay

Flashcards

Circuit switching ke teen phases kya hain?
Setup, data transfer, teardown.
Circuit switching delay mein sirf EK term kyun hota hai, nahi?
Setup ke baad path ek dedicated pipe hai — koi store-and-forward nahi, toh message ek baar transmit hota hai aur propagate karta hai; hops sirf propagation add karte hain.
links par 1 packet ke liye datagram delay?
(store-and-forward har hop par replay karta hai).
packets ke liye pipelined datagram delay?
; jaise transmission .
Chhote packets delay kyun kam karte hain?
Zyada packets links across zyada pipelining overlap, toh effective transmission ek single-hop ke paas pahunch jaata hai (jab tak header overhead dominate na kare).
Switch datagram packet vs VC packet mein kya carry karta hai?
Datagram: full destination address. VC: ek chhota locally-meaningful label/VC number.
Label swapping kya hota hai?
Har hop par ek switch (in link, in VC#) → (out link, out VC#) map karta hai aur label replace karta hai, table lookup se forward karta hai.
Kya virtual circuit bandwidth reserve karta hai?
Nahi — yeh ek logical path reserve karta hai aur labels install karta hai; bandwidth abhi bhi shared hai (statistically multiplexed).
Kaun se switching methods packet order preserve karte hain?
Circuit aur virtual circuit (single fixed path); datagram nahi karta.
Har switch kaun sa state rakhta hai?
Circuit: per-circuit reservation. Datagram: per-destination routing table. VC: per-virtual-circuit table entry.
Virtual circuits use karne wali do real technologies?
ATM, Frame Relay, MPLS (koi bhi do).
Circuit switching kab wasteful hota hai?
Bursty traffic ke liye — reserved bandwidth silent periods mein idle baithti hai, doosron ko block karti hai.

Concept Map

answers

answers

type 1

type 2

type 3

reserves

three phases

gives

no store-and-forward

motivated by

splits data into

forwards by

combines

combines

Switching

Is path reserved?

Per-connection state?

Circuit Switching

Packet Switching datagram

Virtual Circuit

Dedicated end-to-end path

Setup - Transfer - Teardown

T = S + d·tp + L/R

No xd on transmission

Bursty traffic

Independent packets

VC table label