Types of Packet Switching
1. Connection-oriented Packet Switching (Virtual Circuit)
Before starting the transmission, it establishes a logical path or virtual connection using a signaling protocol, between sender and receiver and all packets belongs to this flow will follow this predefined route. Virtual Circuit ID is provided by switches/routers to uniquely identify this virtual connection. Data is divided into small units and all these small units are appended with help of sequence numbers. Packets arrive in order at the destination. Overall, three phases take place here- The setup, data transfer and tear-down phases.
All address information is only transferred during the setup phase. Once the route to a destination is discovered, entry is added to the switching table of each intermediate node. During data transfer, packet header (local header) may contain information such as length, timestamp, sequence number, etc.
Connection-oriented switching is very useful in switched WAN. Some popular protocols which use the Virtual Circuit Switching approach are X.25, Frame-Relay, ATM, and MPLS(Multi-Protocol Label Switching).
2. Connectionless Packet Switching (Datagram)
Unlike Connection-oriented packet switching, In Connectionless Packet Switching each packet contains all necessary addressing information such as source address, destination address, port numbers, etc. Packets belonging to one flow may take different routes because routing decisions are made dynamically, so the packets that arrived at the destination might be out of order. It has no connection setup and teardown phase, like Virtual Circuits.
Packet delivery is not guaranteed in connectionless packet switching, so reliable delivery must be provided by end systems using additional protocols.
A—R1—R2—BA is the sender (start)R1, R2 are two routers that store and forward dataB is receiver(destination)
To send a packet from A to B there are delays since this is a Store and Forward network.
Packet Switching and Delays in Computer Network
Packet Switching in computer networks is a method of transferring data to a network in the form of packets. In order to transfer the file fast and efficiently over the network and minimize the transmission latency, the data is broken into small pieces of variable length, called Packet. At the destination, all these small parts (packets) have to be reassembled, belonging to the same file. A packet is composed of a payload and various control information. No pre-setup or reservation of resources is needed.
Packet Switching uses the Store and Forward technique while switching the packets; while forwarding the packet each hop first stores that packet then forwards. This technique is very beneficial because packets may get discarded at any hop for some reason. More than one path is possible between a pair of sources and destinations. Each packet contains the Source and destination address using which they independently travel through the network. In other words, packets belonging to the same file may or may not travel through the same path. If there is congestion at some path, packets are allowed to choose different paths possible over an existing network.