🔌 Network Switching Tutorial

Circuit vs Packet Switching Explained

Understanding Network Switching

⚡ Circuit Switching

Establishes a dedicated path before transmission begins. Like making a phone call - the connection is reserved for the duration.

✓ Advantages:
  • Guaranteed bandwidth
  • Predictable performance
  • Low latency once connected
✗ Disadvantages:
  • Setup time overhead
  • Wasted bandwidth when idle
  • Blocking when network busy
T = U + L/R + Y

📦 Packet Switching

Breaks data into packets that travel independently. Like sending mail - each packet finds its own way to the destination.

✓ Advantages:
  • Efficient resource usage
  • No setup time needed
  • Better for bursty traffic
✗ Disadvantages:
  • Header overhead per packet
  • Routing delays
  • Possible network congestion
T = NX + (L+NH)/R + Y

📐 Variable Definitions

L = Message length (bits)
R = Transmission rate (bits/sec)
Y = Transfer delay per link (sec)
U = Circuit setup time (sec)
P = Packet size with header (bits)
H = Header size (bits)
X = Packet routing delay (sec)
N = Number of packets = ⌈L/(P-H)⌉

Version 1: Tandem Network

A simple point-to-point network: Node A sends a message to Node B through a single direct link.

Network Topology

Message Flow A Source B Destination Single Link

Simple Path: Message travels directly from Node A to Node B with no intermediate nodes

⚡ Circuit Switching

  1. Setup: Establish dedicated circuit (time U)
  2. Transmit: Send entire message at rate R
  3. Propagate: Signal travels through link (delay Y)
T = U + L/R + Y

📦 Packet Switching

  1. Fragment: Break message into N packets
  2. Add Headers: Attach header H to each packet
  3. Route: Each packet routed independently (delay X)
T = NX + (L+NH)/R + Y

🔑 Key Insight

Packet switching is faster when: U > N(X + H/R)

This means the circuit setup overhead must exceed the combined routing and header overhead of all packets.

Version 2: Star Network

A star topology where three sources (A, B, C) send messages to three destinations (D, E, F) through a central hub (Node G).

Network Topology

A Source 1 B Source 2 C Source 3 G HUB (Bottleneck) D Dest 1 E Dest 2 F Dest 3
Sources (A, B, C)
Hub (G) - Congestion Point
Destinations (D, E, F)

⚡ Circuit Switching

Messages must be transmitted sequentially — only one at a time.

T = 3 × (U + L/R + 2Y)

Note: 2Y because each message crosses two links

📦 Packet Switching

Packets can be transmitted concurrently with queuing at the hub.

T = (X+P/R+Y) + 3N(X+P/R) + Y

Includes queuing delays at hub node G

⚠️ Congestion Point

Node G is a bottleneck where all traffic converges. In packet switching, this creates queuing delays but allows concurrent transmission. In circuit switching, only one message can use the network at a time, causing blocking.

Interactive Calculator

⚡ Circuit Switching

Number of packets:
10
Total Time:
1.2500
seconds

📦 Packet Switching

Number of packets:
10
Total Time:
1.5000
seconds

💡 Key Insights

  • Circuit switching has fixed overhead (setup time U)
  • Packet switching overhead scales with N (routing + headers)
  • For short messages, packet switching is often faster
  • For long transfers with high setup cost, circuit may win