Packet switching is a method of transferring data to a network in form of packets. In order to transfer the file fast and efficiently manner 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 composes of a payload and various control information. No pre-setup or reservation of resources is needed.
Packet Switching uses Store and Forward technique while switching the packets; while forwarding the packet each hop first stores that packet than forward. This technique is very beneficial because packets may get discarded at any hop due to 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.
Packet-Switched networks were designed to overcome the weaknesses of Circuit-Switched networks since circuit-switched networks were not very effective for small messages.
Packet switching is a technique used in computer networks to transmit data in the form of packets, which are small units of data that are transmitted independently across the network. Each packet contains a header, which includes information about the packet’s source and destination, as well as the data payload.
One of the main advantages of packet switching is that it allows multiple packets to be transmitted simultaneously across the network, which makes more efficient use of network resources than circuit switching. However, packet switching can also introduce delays into the transmission process, which can impact the performance of network applications.
Here are some of the types of delays that can occur in packet switching:
- Transmission delay: This is the time it takes to transmit a packet over a link. It is affected by the size of the packet and the bandwidth of the link.
- Propagation delay: This is the time it takes for a packet to travel from the source to the destination. It is affected by the distance between the two nodes and the speed of light.
- Processing delay: This is the time it takes for a packet to be processed by a node, such as a router or switch. It is affected by the processing capabilities of the node and the complexity of the routing algorithm.
- Queuing delay: This is the time a packet spends waiting in a queue before it can be transmitted. It is affected by the number of packets in the queue and the priority of the packets.
while packet switching can introduce delays in the transmission process, it is generally more efficient than circuit switching and can support a wider range of applications. To minimize delays, various techniques can be used, such as optimizing routing algorithms, increasing link bandwidth, and using quality of service (QoS) mechanisms to prioritize certain types of traffic.
Advantages of Packet Switching over Circuit Switching:
- More efficient in terms of bandwidth, since the concept of reserving a circuit is not there.
- Minimal transmission latency.
- More reliable as a destination can detect the missing packet.
- More fault tolerant because packets may follow a different path in case any link is down, Unlike Circuit Switching.
- Cost-effective and comparatively cheaper to implement.
Disadvantage of Packet Switching over Circuit Switching:
- Packet Switching doesn’t give packets in order, whereas Circuit Switching provides ordered delivery of packets because all the packets follow the same path.
- Since the packets are unordered, we need to provide sequence numbers for each packet.
- Complexity is more at each node because of the facility to follow multiple paths.
- Transmission delay is more because of rerouting.
- Packet Switching is beneficial only for small messages, but for bursty data (large messages) Circuit Switching is better.
Modes 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. In Datagram Packet Switching, each packet is treated independently. 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 is the sender (start)
R1, R2 are two routers that store and forward data
B is receiver(destination)
To send a packet from A to B there are delays since this is a Store and Forward network.
Delays in Packet switching:
- Transmission Delay: Time required by station to transmit data to the link.
- Propagation Delay: Time of data propagation through the link.
- Queuing Delay: Time spend by the packet at the destination’s queue.
- Processing Delay: Processing time for data at the destination.