Chapter 11 of 12

Switching

In a computer network, data often needs to travel from one device to another through several intermediate devices. But how does the network decide where the data should go?

The process of forwarding data from a source to the correct destination through a network is called switching.

In simple words, switching is the technique used to move data between devices across a network.

For example:

Computer A → Switch → Router → Switch → Computer B

Switching helps the network efficiently deliver data instead of creating a separate physical connection between every pair of devices.

Why Do We Need Switching?

Imagine an office with 100 computers. If every computer had a direct physical connection to every other computer, the network would require a huge number of connections.

Switching solves this problem by allowing devices to share communication paths and forwarding data only where it needs to go.

It provides:

  • Efficient use of network resources

  • Communication between multiple devices

  • Better scalability

  • Reduced need for direct connections

  • More organized data forwarding


Types of Switching

The three traditional switching techniques are:

  1. Circuit Switching

  2. Packet Switching

  3. Message Switching

Let's understand them one by one.


1. Circuit Switching

In Circuit Switching, a dedicated communication path is established between the sender and receiver before data transmission begins.

Sender ═══════════════════ Receiver
       Dedicated Path

Once the connection is established, the path remains reserved for the communication session.

Example

The traditional telephone network used circuit switching.

When two people made a call, a dedicated communication path was established between them for the duration of the call.

Advantages

  • Dedicated path

  • Predictable communication once the circuit is established

  • Suitable for continuous communication

Disadvantages

  • Resources remain reserved even when no data is being sent

  • Connection setup takes time

  • Less efficient for bursty data


2. Packet Switching

In Packet Switching, data is divided into smaller units called packets.

Each packet can be forwarded through the network toward the destination.

Message
   ↓
Packet 1
Packet 2
Packet 3
   ↓
Network
   ↓
Destination

Unlike circuit switching, packet switching does not require a dedicated path for the entire communication.

This makes it much more efficient for computer networks and Internet communication.

Example

When you send a message or upload a file over the Internet, the data is transmitted using packets.

Advantages

  • Efficient use of network resources

  • No dedicated path is required

  • Multiple users can share network links

  • Suitable for computer and Internet communication

Disadvantages

  • Packets can experience delay

  • Packets may take different paths

  • Packets can be lost and may need retransmission depending on the protocol


3. Message Switching

In Message Switching, the complete message is treated as a single unit.

A network device receives the entire message, stores it, and then forwards it to the next device.

This technique is called store-and-forward switching.

Sender
  ↓
Node A
  ↓
Node B
  ↓
Receiver

Each intermediate node must receive and store the complete message before forwarding it.

Advantages

  • No dedicated path is required

  • Network resources can be used efficiently

Disadvantages

  • Requires significant storage

  • Large messages can cause considerable delay

  • Not suitable for real-time communication

Message switching is mainly of historical importance and is not the usual technique used for modern Internet traffic.


Comparison of Switching Techniques

Feature

Circuit Switching

Packet Switching

Message Switching

Dedicated Path

Yes

No

No

Data Unit

Continuous stream

Packets

Complete message

Storage Required

Low at intermediate nodes

Usually limited buffering

High

Delay

Setup delay, then predictable

Variable

Can be high

Resource Usage

Can be inefficient

Efficient

Efficient but can require large storage

Common Use

Traditional telephone systems

Internet and modern data networks

Mostly historical


Packet Switching: Two Approaches

Packet switching is commonly discussed using two approaches.

Datagram Switching

In Datagram Switching, each packet is treated independently.

Packets belonging to the same message may travel through different routes.

Packet 1 → Route A
Packet 2 → Route B
Packet 3 → Route A

The packets can potentially arrive in a different order from the one in which they were sent.

The Internet's IP service is based on the datagram approach.

Virtual Circuit Switching

In Virtual Circuit Switching, a logical path is established before packets are sent.

The packets generally follow the same logical route during the communication.

Sender → Node A → Node B → Receiver
          Same Logical Path

It combines some characteristics of circuit-oriented communication with packet-based transmission.


Switching vs Routing

These two terms are often confused.

Switching generally refers to forwarding data within a network or between directly connected network segments.

Routing is the process of determining paths between different networks and deciding where packets should be forwarded.

For example:

Computer → Switch → Router → Router → Server

Here, the switch handles local forwarding, while the routers determine and forward traffic between networks.

Conclusion

Switching is the process of forwarding data through a network so that it can reach its destination efficiently.

The traditional switching techniques are circuit switching, packet switching, and message switching.

Modern computer networks, especially the Internet, primarily rely on packet-based communication because it allows many users to share network resources efficiently.

The key idea to remember is:

Circuit Switching → Dedicated path

Packet Switching → Data divided into packets

Message Switching → Complete message stored and forwarded