Packet Switching in Computer Networks



Packet switching is a connectionless network switching technique. In this method, data is not sent as one single continuous message. Instead, the complete message is broken into many small units called packets. These packets are then sent separately from the source to the destination through the network.

Unlike circuit switching, packet switching does not require any dedicated path to be established before communication starts. There is no fixed route decided in advance. Each packet can travel independently and may even take different paths to reach the destination.

Packet Switching Diagram

Packet switching is widely used in modern computer networks because it makes better use of bandwidth and allows multiple users to communicate at the same time. The Internet itself is the most prominent example of packet switching. All emails, websites, and file transfers are broken into packets. Other examples include: email systems, web browsing, cloud storage, online file sharing, and instant messaging applications. Even streaming platforms use packet switching, though they combine it with buffering techniques to reduce delay.

Basics of Packet Switching

In packet switching, the sender first divides the message into smaller pieces. Each piece is called a packet. Every packet is treated as an independent unit by the network. This means the network does not care whether packets belong to the same message or not. It only looks at each packet individually and forwards it based on its address.

Since packets move independently, they do not always follow the same route. One packet may go through one router, while another packet from the same message may go through a completely different router. This makes the network more flexible and efficient.

Packets Taking Different Routes

At the destination side, all packets are collected. Because packets may arrive in different order, the destination system is responsible for arranging them in the correct order and reconstructing the original message.

Structure of a Packet

Each packet in a packet switching system is made up of two main parts −

  • Header
  • Payload

The header contains important control information that includes the source address, destination address, packet number, and sometimes error checking information. Routers use the header to decide where the packet should go next.

The payload is the actual data being sent. This is the part that contains user information such as text, images, audio, or video.

Packet Structure (Header + Payload)

Because each packet carries its own address, routers do not need to remember previous packets. They simply read the header and forward the packet accordingly.

Packet Switching Process

Packet switching follows a series of steps that take place very quickly −

  • The sender divides the message into smaller packets.
  • Each packet is given a header with addressing information.
  • Packets are transmitted as soon as they are ready.
  • Routers forward packets based on header information.
  • Packets may travel through different routes.
  • The destination collects all packets.
  • Packets are reordered and combined to form the original message.

A packet is transmitted as soon as it becomes available at a node. There is no waiting for the complete message. This reduces delay and improves speed, especially when sending large data.

Since packets can take different paths, they may arrive at the destination in an out-of-order manner. It is the responsibility of the destination system to reorder the packets correctly.

Reordering Packets at Destination

Packet Routing and Reordering

Routers play a very important role in packet switching. A router receives a packet, reads its header, checks the destination address, and decides the best next hop for that packet.

Routing decisions depend on factors like network traffic, link speed, congestion, and availability of paths. Because of this, two packets from the same message may be routed through totally different paths.

At the destination side, special protocols ensure that packets are reordered correctly. If any packet is missing, the destination can request retransmission.

Why Packet Switching is Used?

Packet switching is used because it is more efficient and reliable compared to older switching techniques. It allows many users to share the same network resources without wasting bandwidth.

In packet switching, network links are not reserved for one user. Instead, packets from different users are mixed together and sent over the same link. This is known as statistical multiplexing. It's due to this resource sharing ability, overall network utilization becomes much better.

Pros and Cons of Packet Switching

The advantages of using Packet Switching are listed below −

  • Low Delay in Delivery − Packets are sent as soon as they are available. There is no need to wait for the complete message. This reduces delay and makes communication faster.
  • Efficient Use of Bandwidth − Multiple users can share the same communication channel. This ensures better bandwidth usage and avoids wastage of network resources.
  • Fault Tolerance − If a link fails, packets can be routed through alternate paths. Data delivery can continue even during partial network failure.
  • No Need for Dedicated Path − Since there is no dedicated circuit, network resources are not locked for a single user. This makes packet switching very flexible.
  • Suitable for Data Networks − Packet switching works very well for data communication like emails, file transfer, web browsing, and cloud services.

The following list highlights the disadvantages of Packet Switching −

  • Not Suitable for Real-Time Voice − Packet switching is not ideal for applications that require constant delay-free communication, such as high-quality voice calls or live video without buffering.
  • Packet Loss and Errors − Network congestion or failure may cause packet loss or corruption. If not handled properly, important data may be lost.
  • Complex Protocols Required − Packet switching needs complex protocols for routing, error control, flow control, and packet reassembly. All these protocols eventually increase the system complexity.
  • Installation and Maintenance Cost − Packet switching networks require advanced routers and software, which increases installation and maintenance cost.

Circuit Switching vs Packet Switching

The following three points highlight how Packet Switching stands apart from Circuit Switching −

  • In circuit switching, a dedicated path is established before communication starts. In packet switching, there is no such dedicated path.
  • Circuit switching is good for continuous voice communication. Packet switching is better for data transmission where small delays are acceptable.
  • Packet switching allows better utilization of network resources compared to circuit switching.

Conclusion

Packet switching is a powerful and flexible network switching technique. By dividing data into small packets and routing them independently, it allows efficient use of network resources. It supports multiple users, handles failures well, and forms the backbone of modern data networks.

Although it has some disadvantages like delay and packet loss, proper protocols and network design help overcome these issues. Because of its efficiency and scalability, packet switching is widely used in today’s computer networks and is the foundation of the Internet.

Advertisements