Packet
- In Turkish
- Paket
In short
A packet is a small, formatted unit of data sent across a network, made of a header with addressing information and a payload that carries the actual data.
What is a packet?
A packet is a small chunk of data that travels across a network as a single unit. Instead of sending a large file or web page in one piece, the sender splits it into many packets, sends them independently, and the receiver puts them back together. This approach, called packet switching, is the foundation of how the internet works.
Each packet has two main parts: a header and a payload. The header holds control information, such as the source and destination IP addresses, the protocol, and a time-to-live (TTL) counter that stops a packet from looping forever. The payload is the actual data being carried. Routers read the header of each packet and forward it toward its destination, and packets from the same message may take different routes.
Think of mailing a long book by putting each page in its own numbered envelope and letting the recipient reassemble them. If one envelope is lost, only that page needs to be resent. Developers encounter packets when debugging network problems with tools such as tcpdump or Wireshark, and when dealing with packet loss, which causes stuttering calls and slow connections.
The words packet, segment, datagram, and frame are often used loosely, but they describe data at different layers. A frame is the unit at the link layer (for example, Ethernet or Wi-Fi), a packet is the unit at the IP layer, and a TCP segment or UDP datagram is the unit at the transport layer, each wrapped inside the next like nested envelopes. The largest packet a link can carry, typically 1,500 bytes on Ethernet, is called the MTU (maximum transmission unit).
At a glance
Key takeaways
- A packet is a small unit of data sent across a network.
- It has a header with addressing and control information and a payload with the data.
- Large messages are split into packets and reassembled by the receiver.
- Routers forward each packet independently, so packets can take different paths.
- Packet loss, often caused by congestion or weak Wi-Fi, leads to retransmissions or glitches.
Example
# Capture 5 packets on any interface going to or from port 443
sudo tcpdump -i any -c 5 port 443
# Show packet contents in hex and ASCII for HTTP traffic
sudo tcpdump -i any -c 3 -X port 80
# Check for packet loss: send 20 packets and read the summary
ping -c 20 example.com
# e.g. "20 packets transmitted, 19 received, 5% packet loss"Readers ask
What is packet loss?
Packet loss happens when packets never reach their destination, often because of network congestion, faulty hardware, or a weak wireless signal. TCP detects lost packets and resends them, while real-time apps using UDP usually skip them, which causes glitches.
How big is a network packet?
On most Ethernet and home networks, the maximum packet size, called the MTU, is 1,500 bytes including headers. Larger data is split across many packets.
What is the difference between a packet and a frame?
A packet is the unit of data at the IP layer and carries IP addresses, while a frame is the unit at the link layer, such as Ethernet or Wi-Fi, and carries hardware (MAC) addresses. Each packet travels inside a new frame on every hop of its journey.
See also
- TCPNetworking, p. 30TCP is a core internet protocol that delivers data between two programs reliably and in order, by opening a connection and resending anything that gets lost.
- UDPNetworking, p. 35UDP is a lightweight internet protocol that sends small, independent messages called datagrams without a connection, favoring speed over guaranteed delivery.
- IP AddressNetworking, p. 10An IP address is a numeric label assigned to each device on a network so that data can be routed to it, much like a postal address for a house.
- LatencyNetworking, p. 14Latency is the delay between sending a request and the start of a response, usually measured in milliseconds, and it shapes how responsive an app feels.
- BandwidthNetworking, p. 2Bandwidth is the maximum amount of data a network connection can carry per second, usually measured in megabits or gigabits per second (Mbps or Gbps).
- FirewallNetworking, p. 8A firewall is a security system that checks network traffic and allows or blocks it based on rules, acting as a barrier between trusted and untrusted networks.
Spotted a mistake or something missing on this page?Suggest an edit