Internet Protocol (IP) Packet Format
The Internet Protocol specified in RFC 791 defines the IP packet format. The IP packet header has specific fields that contain information about the packet and about the sending and receiving hosts. Below is a list of the fields in the IP header and a brief description for each one. You should already be familiar with destination IP address, source IP address, version, and Time To Live (TTL ) fields. The other fields are important but are outside the scope of this course.
Version - Version number (4 bits); predominant version is IP version 4 (IPv4)
IP header length - Header length in 32-bit words (4 bits)
Precedence and type of service - How the datagram should be handled (8 bits); the first 3 bits are precedence bits (this use has been superseded by Differentiated Services Code Point [DSCP], which uses the first 6 bits [last 2 reserved])
Packet length - Total length (header + data) (16 bits)
Identification - Unique IP datagram value (16 bits)
Flags - Controls fragmenting (3 bits)
Fragment offset - Supports fragmentation of datagrams to allow differing maximum transmission units (MTUs) in the Internet (13 bits)
Time to Live (TTL) - Identifies how many routers can be traversed by the datagram before being dropped (8 bits)
Protocol - Upper-layer protocol sending the datagram (8 bits)
Header checksum - Integrity check on the header (16 bits)
Source IP address - 32-bit source IP address (32 bits)
Destination IP address - 32-bit destination IP address (32 bits)
IP options - Network testing, debugging, security, and others (0 or 32 bits, if any)
MAC Layer Frame Format
The Layer 2 data link frame usually contains header information with a data link source and destination address, trailer information, and the actual transmitted data. The data link source address is the Layer 2 address of the interface that sent the data link frame. The data link destination address is the Layer 2 address of the interface of the destination device. Both the source and destination data link interfaces are on the same network. As a packet is forwarded from router to router, the Layer 3 source and destination IP addresses will not change; however, the Layer 2 source and destination data link addresses will change. This process will be examined more closely later in this section.
Note: When NAT (Network Address Translation) is used, the destination IP address does change, but this process is of no concern to IP and is a process performed within a company's network. Routing with NAT is discussed in a later course.
The Layer 3 IP packet is encapsulated in the Layer 2 data link frame associated with that interface. In this example, we will show the Layer 2 Ethernet frame. The figure shows the two compatible versions of Ethernet. Below is a list of the fields in an Ethernet frame and a brief description of each one.
Preamble - Seven bytes of alternating 1s and 0s, used to synchronize signals
Start-of-frame (SOF) delimiter - 1 byte signaling the beginning of the frame
Destination address - 6 byte MAC address of the sending device on the local segment
Source address - 6 byte MAC address of the receiving device on the local segment
Type/length - 2 bytes specifying either the type of upper layer protocol (Ethernet II frame format) or the length of the data field (IEEE 802.3 frame format)
Data and pad - 46 to 1500 bytes of data; zeros used to pad any data packet less than 46 bytes
Frame check sequence (FCS) - 4 bytes used for a cyclical redundancy check to make sure the frame is not corrupted