Packet

From Hackepedia
Jump to navigationJump to search

A packet is a construct of bits or bytes that gets sent over LAN or WAN links in order to make the internet work. A packet holds the data used in telecommunication. A packet, also called a frame, has a header and a body (or payload). Inside the header there is a destination and a source address. Given that information a router knows where to send the packet and if it doesn't know it'll send a reply packet indicating the error (see ICMP).

IPv4 Packet

An IP packet has a header minimally 20 bytes long and maximally 60 bytes long. In its body it usually carries a TCP or UDP packet that has its own tcp header and payload. The header of an IPv4 packet has to be on a 4 byte boundary, this means that the packet header length could be 28 but not 26. Just think of the allowed length to be a multiple of four. More about IPv4 packet headers in RFC 791.

IPv6 Packet

An IPv6 packet has a header 40 bytes long. Unlike having options like an IPv4 packet, an IPv6 packet can have multiple headers all which have their own size. An IPv6 header has to be on an 8 byte boundary. More about IPv6 packet headers in RFC 2460.

Packet dump

This is a layer 2+ dump of a link. tcpdump and snoop could help with that.