Everything you do on the Internet involves packets. For instance, every web page you view is delivered in the form of packets, and every email you send is also split into packets. Networks that transmit data in small packets are known as packet-switched networks.
When you send an email over the Internet, the network divides it into smaller chunks of a specific size, measured in bytes. These chunks are the packets. Each packet holds crucial information to ensure it reaches the right destination, including the sender’s IP address, the recipient’s IP address, data about how the email was split into packets, and the number of the specific packet. Packets are transmitted using the Internet’s protocols: Transmission Control Protocol/Internet Protocol (TCP/IP). Typically, a packet might carry around 1,000 to 1,500 bytes of data, which is a segment of your email’s content.
Each packet is routed independently to its destination via the most optimal path available at that moment. Some packets may take the same route as others, while some may follow entirely different paths. This flexibility boosts the efficiency of the network. For one, the network can distribute the load evenly across equipment on a millisecond-by-millisecond basis. Additionally, if there’s a malfunction in one part of the network, the packets can find alternate routes, ensuring the full message arrives intact.
Depending on the type of network, packets may be known by different names:
- frame
- block
- cell
- segment
Next, let's explore the components of packets and see an example of how packets are utilized in action.
Network Packet Structure
I've heard that data is transmitted in packets over computer networks. But what exactly is a packet, and why do networks rely on them?
2009 MytourMost network packets consist of three main components:
Header - The header carries the instructions necessary for interpreting the packet's contents. These details can include:
- Packet length (some networks use packets of fixed length, while others rely on the header for this information)
- Synchronization (a few bits to help align the packet with the network)
- Packet sequence number (identifies the position of the packet within a sequence)
- Protocol (on multi-purpose networks, the protocol determines the type of packet, such as e-mail, web page, or video stream)
- Destination address (the packet's destination)
- Originating address (the packet’s source)
Payload - Also known as the body or data of the packet. This is the actual content the packet is transmitting to its target. For fixed-length packets, the payload may be padded with filler data to meet the required size.
Trailer - The trailer, or footer, generally contains a few bits signaling the packet’s end. It may also include error detection. One common error check used is Cyclic Redundancy Check (CRC), which works as follows: It sums all the 1s in the payload and stores the result as a hexadecimal value in the trailer. The receiving device adds the 1s in the payload and compares the total to the trailer's value. If they match, the packet is considered intact. If they don’t, the receiving device asks the sender to resend the packet.
Let’s take an example of how an e-mail message is divided into packets. Imagine you send a 3,500-bit ( kilobit) e-mail to a friend. The network you use works with fixed-length packets of 1,024 bits (1 kilobit). Each packet has a 96-bit header and a 32-bit trailer, leaving 896 bits for the payload. To split the 3,500-bit message into packets, you need four packets (3,500 divided by 896). Three packets will contain 896 bits each, and the fourth will have 812 bits. Here’s what one of the packets will hold:
Each packet’s header will include the necessary protocols, the originating address (your computer’s IP address), the destination address (the IP address of the recipient’s computer), and the packet number (1, 2, 3, or 4 since there are four packets). Routers in the network will examine the destination address in the header and compare it with their lookup table to determine where to send the packet. When the packet reaches its destination, your friend’s computer will remove the header and trailer from each packet and reassemble the e-mail based on the packet sequence number.
