PUBLISHED ON: APRIL 27, 2021
Packet Switching in Computer Networks
In this tutorial, we will be covering the concept of Packet Switching in Computer Networks.
Packet Switching is a technique of switching in which the message is usually divided into smaller pieces that are known as packets.
-
Every packet contains a header that contains the knowledge of the destination. With the help of this knowledge/information, these packets find the route.
-
A unique number is given to each packet in order to identify them at the receiving end.
-
One of the biggest examples of the Packet-switched network is the Internet.
-
The header of the Packet mainly comprises of two things: header and payload.
-
This switching is also based on the store and forward method.
-
In the Packet Switched network, there is no resource reservation, and resources are allocated on demand.
-
As we know that each packet contains the information of source and destination in their headers. Thus all packets can independently travel in the network.
-
Packets related to the same file might take different paths and it mainly depends upon the availability of the path. These packets will be then re-assembled at the destination. It is the responsibility of the receiver node to re-arrange the received packet in order to get the original data.
-
The message of acknowledgment will be sent by the receiver if packets reach the receiver in the correct order.
-
In case of a missing packet or corrupted packet, the message will be sent by the receiver to the sender to resend the message.
Figure: Packet Switching
Two different approaches used for Packet switching are as follows:
Let us discuss these two approaches one by one:
Datagram Packet Switching
In Datagram Switching, the packet is commonly known as a datagram. Datagram Packet switching is also known as Connectionless Packet Switching. In this technique, each packet routed individually by network devices on the basis of the destination address that is contained within each packet.
-
Each packet is basically treated independently of all others.
-
Datagram packet switching is done at the network layer.
-
This is Connectionless packet switching because the packet switch does not keep the information about the connection state.
-
In the Datagram packet switching the path is not fixed.
-
Routing decisions are taken by the intermediate nodes in order to forward the packets.
-
Thus all datagrams that belong to the same message may travel through different paths in order to reach their destination.
-
On the receiving node, all the packets are reassembled to get the message in the original form.
-
Due to lack of resources packets may also be lost or dropped.
-
In most of the protocols, it is the responsibility of the upper-layer protocol to reorder the datagrams or to ask for the lost datagrams before passing them on to the application.
Virtual Circuit Switching
Virtual Circuit Switching is also known as Connection-Oriented Switching. This switching contains the characteristics of circuit switching as well as datagram packet switching. In this type of packet switching the data-packets are first assembled and then sequentially numbered. Now they are ready to travel across a predefined route, sequentially. The information about the address is not required here, because all the data packets are sent in sequence.
-
In addition to the data transfer phase, there are setup and teardown phases.
-
The resource allocation is done during the setup phase like it is done in the circuit-switched network or it can be done on demand like in datagram networks.
-
The data is in the form of packets like the datagram network and also each packet carries the destination address in the header.
-
Like the circuit-switched network, all packets in the Virtual network follows the same path that is established during the connection.
-
This switching is normally implemented in the data link layer.
Advantages of Packet Switching
Given below are some benefits of the Packet Switching:
-
More efficient utilization of bandwidth.
-
Latency in the transmission is minimum in packet switching.
-
This technique is cheaper to implement and thus it is cost-effective.
-
The same channel can be used by many users simultaneously.
- As there are improved protocols, thus packet switching is used by many applications like Skype, WhatsApp, etc.
-
The fault tolerance in this technique is more in case of any link down because packets may follow different paths.
-
This technique is more reliable than other techniques because it can easily detect missing packets.
Disadvantages of Packet Switching
Some of the drawbacks of Packet Switching are as follows:
-
This technique cannot be used by those applications that cannot afford more delays like applications of high-quality voice calls.
-
Protocols used in this technique are complex and thus their implementation cost is high.
-
In the case of an overloaded network, the packet may get lost or there might occur delay which causes the loss of critical information.
-
On the receiver's side sorting of the packets sent by the sender is required.