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.
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
- 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
- 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.
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
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
- 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