Overview of Circuit Switching and Packet Switching

This post gives a brief overview of circuit switching and two types of packet switching, namely Virtual Circuit based packet switching and datagram based packet switching.

Switching Process

Switching is the method by which data is transferred from an input port to an output port of an intermediate exchange switch. The most popular methods of switching are Circuit Switching and Packet Switching. Packet Switching can be further classified into two sub-types, namely, Virtual Ciruit (VC) switching and Datagram based packet switching.

Circuit Switching

Circuit switching is primarily used in Telephone networks and not in Computer networks. In circuit switching,

  • An End to end circuit (path) is first reserved using a separate signaling protocol
  • Data transfer proceeds only after the circuit establishment phase
  • All data of that session passes through the same circuit 
  • No other user can use this circuit till this session is completed
  • No signaling information is sent along with the data
  • Circuit is released after data transfer using the signaling protocol
An example illustrating circuit switching during a telephone call setup

An example illustrating circuit switching during a telephone call setup

Packet Switching

Packet switching is the process of transmitting data in small units called as packets. In packet switching, data that is to be transmitted is split into smaller units.  A small header containing signalling/addressing information about the source and destination nodes is added to each such small data unit, to form packets. Each packet is then routed from the source to the destination by intermediate data exchange devices, using the signalling information present in each packet. Packet switching is the switching method used in data networks for computer communication.
The diagram given below illustrates basic packet switching between a sender and a receiver through a packet switched data network.
A typical packet switching process where each packet of the same session may take different routes

A typical packet switching process where each packet of the same session may take different routes

In packet switching,
  • There is no end to end circuit reservation
  • A packet consists of a header and data
  • Each packet has signaling information in the form of source and destination addresses in the packet header.
  • Signalling information is used by intermediate data exchange devices to route packets. 
  • Exchange devices like routers and switches use a store and forward approach for transmitting packets from an input port to an output port 
  • Link utilization is efficient because there is no end to end reservation of telecommunication links and multiple connections can simultanesouly share the link.
  • Virtual Circuit and Datagram are two types of packet switching, both of which are used in Computer Communication at different layers. While VC based packet switching is used primarily at the data link layer, datagram based packet switching is used both at the data link and network layers.

VC based Packet Switching

VC based switching is a method widely used in computer communication, especially at the data link layer, to switch packets inside switched WAN networks. Popular protocols using VC based switching include X.25, Frame-Relay, ATM and MPLS.
VC based switching is also called as connection-oriented packet switching because a logical (not physical) connection is first established between sender and receiver, before data transfer starts.
In VC based switching,
  • Whenever a new session/flow of data transfer needs to happen between a source and a destination node, a connection establishment phase is executed in the switched WAN network, using a signalling protocol.
  • The signalling protocol (e.g. Label Distriution Protocol (LDP) in MPLS) is first used to identify an end to end path between the source and destination nodes. Once such a path is identified, all packets of the data session/flow MUST follow the same path. But this path is not reserved for this session alone and multiple sessions can share the links in this path.
  • After identifying the path, packet switches/routers allocate a set of  VC IDs or labels to uniquely identify this connection. These labels do not have end-to-end significance and only have local significance at each intermediate device.
  • Data is split into small units and appended with a packet header (containing labels) to form packets. 
  • Packets are switched within the WAN network through labels . Usually the length of the label is shorter than IP and layer 2 addresses thereby enabling faster lookup.
  • At each intermediate device/packet switch, the device looks at the incoming label and link. Based on this, it identifies a suitable outgoing link and an outgoing label, by consulting a local VC table. The label inside the packet header is modified accordingly and the packet is switched out of the outgoing link.
  • At the end of the data transfer phase, the labels are released from the VC table.
  • VC based switching is very useful in Switched WAN Core Backbone Networks for fast switching and better traffic Engineering

The diagram given below illustrates a sample VC based switched WAN topology involving six routers (R1 to R6), with two different flows. The first flow is shown in red colour and is through the path R1-R2-R3-R4. The second flow is shown in green colour and is through the path R5-R3-R6.

An example illustrating VC based switching for two separate flows

An example illustrating VC based switching for two separate flows

Note that all packets of the same flow follow the same path. A sample VC table at Router R3 is shown in the diagram given below:

Sample VC table at Router R3

A sample VC table at R3 containing labels for both the flows

A sample VC table at R3 containing labels for both the flows

As shown in the above VC table, the first entry is for the flow shown in red colour. It states that if a packet comes to R3 via. link 2 and with label 45, then R3 has to change the label in the packet to value 33 and send it via. its link 5. Similarly, the second entry in the table is for the flow shown in green colour. It states that if a packet comes to R3 via. link 3 and with label 22, then R3 has to change the label in the packet to value 24 and send  it via. its link 4.

Since all packets of the same flow follow the same path, prioritized treatment could be given to packets belonging to specific flows, inside packet switches, for the purpose of better Quality Of Service (QOS).

Datagram based Packet Switching

Datagram switching is simpler and more widely used than VC based switching. Datagram based packet switching is the fundamental method/technique used in the Internet for end-to-end routing of packets at the Network Layer, between remote communicating computers.
In datagram based switching, data is split into smaller units and a header containing source and destination addresses is added to each small unit to form packets. The packets of a flow are given to the network and the network treats each packet independently and routes the packet using the packet header alone.
The difference between VC based packet switching and datagram based packet switching mainly consists of the following:
 – there is no signalling/call establishment phase in datagram based switching.
 – there is no concept of labels in datagram based packet switching and packets are routed based on the destination address present in the packet header
– In datagram based packet switching, destination address is left unchanged at each intermediate device
– In datagram based packet switching, each packet of a flow need not follow the same path between the source and destination nodes and may take different routes.
The following holds true for Datagram based packet switching
  • It is also called connectionless packet switching
  • It has no connection establishment and termination phases
  • Each packet has  header information and data
  • Each packet of a data session/flow is independently handled by the network, with no correllation between other packets in the flow
  • Packets of each session may take different routes
  • Packets may also arrive out of order at the receiver
  • Very simple to implement and scales well, as there are no signalling protocols and VC tables required at intermediate nodes
  • IP and Ethernet are example protocols using the principle of Datagram based Packet Switching
The diagram given below illustrates a sample datagram based switching topology involving six routers (R1 to R6), with two different flows. The first flow (say FLOW1) is shown in red colour and is between a sender connected to R1 and a receiver connected to R4. . The second flow (say FLOW 2) is shown in green colour and is between a sender connected to R5 and a receiver connected to R6.
An example for datagram based packet switching with two different flows

An example for datagram based packet switching with two different flows

Note that in datagram based packet switching, some packets of FLOW1 take the path R1-R3-R4, whereas some other packets of the same FLOW1 take the path R1-R4 directly.
Similarly, note that some packets of FLOW2 take the path R5-R3-R6, whereas some other packets of the same FLOW2 take the path R5-R6 directly.

2 comments for “Overview of Circuit Switching and Packet Switching

Leave a Reply

Your email address will not be published. Required fields are marked *

Current ye@r *