The Internet relies on packet switching to transmit data efficiently between devices, using routers to direct packets along the best possible paths.
Packet switching
Packet switching is a network communication method that involves splitting data into smaller units called packets before sending them across a network. These packets travel independently and may take different routes to their destination. Once all packets arrive, they are reassembled into the original data at the receiving end.
This approach differs from older, less efficient communication methods and is one of the core reasons the Internet is able to function as flexibly and reliably as it does today.
Advantages of packet switching
Packet switching offers several major benefits:
Efficient use of bandwidth: Since packets from different communications can share the same transmission lines, the network can be used more efficiently than if connections were dedicated to one user at a time.
Robustness and fault tolerance: If a part of the network goes down, packets can be rerouted dynamically through other available paths.
Cost-effective: There’s no need to maintain a fixed path for the duration of the session, reducing infrastructure requirements.
Scalability: It supports a large number of devices and users without significant performance degradation.
Practice Questions
FAQ
If a packet is lost during transmission, it can result in incomplete or corrupted data at the receiving end. To address this, most packet-switched networks use reliable transmission protocols like TCP (Transmission Control Protocol). TCP ensures data integrity through mechanisms such as acknowledgements and retransmissions. When a sender transmits a packet, it expects an acknowledgement (ACK) from the receiver. If the sender does not receive an ACK within a specific timeframe, it assumes the packet was lost and retransmits it. Each packet also carries a sequence number, allowing the receiver to detect missing packets and request retransmission. This system ensures that data is delivered completely and in the correct order. In contrast, protocols like UDP (User Datagram Protocol) do not guarantee delivery, which may be acceptable for applications like streaming where occasional loss is tolerable. Network devices like routers typically do not handle retransmissions; instead, this responsibility lies with end systems using transport-layer protocols.
Packets may arrive out of order due to the nature of packet switching, where each packet can independently take different paths through the network based on current availability and routing decisions. Routers choose routes dynamically, and some paths may be faster or less congested than others. As a result, packets transmitted seconds apart might arrive earlier or later depending on their respective routes. This can cause the receiving system to receive packets in a jumbled sequence. To resolve this, each packet includes a sequence number in its header. The receiving device uses these numbers to reorder the packets into their original sequence before presenting the data to the application layer. In protocols like TCP, this reordering is handled automatically, ensuring the application sees a continuous and correctly ordered stream of data. The protocol will also request retransmission if a packet appears to be missing based on sequence gaps.
In a dynamic network, routers use routing protocols to automatically update their routing tables based on the current state of the network. Common dynamic routing protocols include RIP (Routing Information Protocol), OSPF (Open Shortest Path First), and BGP (Border Gateway Protocol). These protocols enable routers to communicate with each other to exchange routing information. For instance, in RIP, routers send updates to their neighbours at regular intervals, sharing their current view of network paths. OSPF uses a link-state method, where routers broadcast information about the state of their connections, allowing others to build a complete map of the network. BGP is used between autonomous systems on the Internet and shares information about reachability. Whenever a change occurs, such as a link failure or a new route becoming available, the routing tables are updated to reflect the new best path. This allows routers to adapt quickly and maintain efficient routing without manual configuration.
TTL, or Time to Live, is a field in the header of every IP packet that limits the lifespan of the packet on the network. It is expressed as a numerical value, typically an integer between 0 and 255. Each time the packet is forwarded by a router (each “hop”), the TTL value is decremented by one. If the TTL reaches zero before the packet reaches its destination, the router discards the packet and often sends an error message (typically an ICMP "Time Exceeded" message) back to the sender. TTL is crucial because it prevents infinite looping in cases where routing errors or misconfigurations cause packets to circulate endlessly between routers. Without TTL, such loops would congest the network and degrade performance. TTL also plays a role in network diagnostics; tools like traceroute rely on TTL to determine the path a packet takes through the network by deliberately sending packets with incrementally increasing TTL values.
Routers manage congestion through a combination of buffering, packet dropping, and queue management strategies. Each router interface has a buffer that temporarily stores incoming packets before they are forwarded. When traffic volume exceeds the capacity of the output link or the processing speed of the router, the buffer begins to fill. If the buffer becomes full, the router may drop packets, meaning they are discarded and not forwarded. This results in packet loss, which can be detected by transport-layer protocols like TCP. TCP responds by slowing down its transmission rate, effectively reducing congestion. Some routers use Active Queue Management (AQM) techniques like Random Early Detection (RED), which pre-emptively drop packets based on probabilistic algorithms before the buffer overflows, giving senders an early signal to reduce traffic. Congestion control is crucial for maintaining performance and reliability in packet-switched networks, especially during peak usage periods or in high-demand areas of the Internet.
