Network Packets
Network packets are like Russian dolls. Each layer adds more information necessary to do the transmission.
Data, in form of bits and bytes is split into segments by a transport layer protocol such as TCP. The TCP header adds various pieces of information to each segment, most importantly the
sequence number
source port number
destination port number
TCP Segment |
Sequence Number |
Source Port |
Destination Port |
Each segment is then packaged up into an IP packet. This adds a header which includes the source IP address and destination IP address, which is necessary for relaying datagram across network boundaries.
IP Packet |
Source IP |
Destination IP |
TCP Segment |
Sequence Number |
Source Port |
Destination Port |
When sending an IP packet over Ethernet, it is put into a Ethernet frame, which adds the source and destination MAC address within the local network.
Ethernet Frame |
Source MAC |
Destination MAC |
IP Packet |
Source IP |
Destination IP |
TCP Segment |
Sequence Number |
Source Port |
Destination Port |
UDP Packets have the same kind of structure. Since their UDP segment headers are smaller, the total packet is more compact.
Ethernet Frame |
Source MAC |
Destination MAC |
IP Packet |
Source IP |
Destination IP |
UDP Segment |
Source Port |
Destination Port |
The following sections will explain how these packets can travel through our networks.