IP Packet Processing
Transmission of a frame over Ethernet
The IP packet is placed in an Ethernet frames as follows:
- IP Broadcast/Multicast Address: The IP destination address is checked to see if the system should also receive a copy of the packet. This happens if this is an IP network broadcast address (or a multicast address is used that matches one of the registered IP multicast filters set by the IP receiver). If a copy is required, it is sent to the loopback interface. This directly delivers the packet to the IP input routine. the original packet continues to be processed
- IP Unicast Address: The IP destination address is checked to see if the address is the unicast (source) IP address of the sending system. Such packets are sent directly to the loopback interface (i.e. never reach the physical Ethernet interface)
- Next Hop IP Address: The sender then determines the next hop address - that is the IP address of the next Intermediate System/End System to receive the packet. Once this address is known, the Address Resolution Protocol (arp) is used to find the appropriate MAC address to be used in the Ethernet frame. This is a two stage process: (i) the arp cache is consulted, to see if the MAC address is already known, in which case the correct address is added and the packet queued for transmission. (ii) If the MAC address is not in the arp cache, the arp protocol is used to request the address, and the packet is queued until an appropriate response (or timeout) occurs.
- MTU: The size of the packet is checked against the MTU of the link on which it is to be sent. (Note the MTU of the loopback interface may be different to that of Ethernet). If required, IP fragmentation is performed, or an ICMP error message is returned, which may trigger Path MTU Discovery at the sending End Host.
- Encapsulation: The Ethernet frame is completed, by inserting the Destination, Source and Ethernet Type fields. When Tags are used, the appropriate 802.1pQ Tag is inserted following the MAC header (the Priority field in the Tag may be set based on the IP DSCP value).
- Transmit: The frame is transmitted using the MAC procedure for Ethernet.
Reception of a frame from Ethernet
The following summary shows the processing performed by an end system in an IP network. It is assumed that the system is connected to an Ethernet network.
The received frames are processed as follows:
- MAC Protocol: The Ethernet controller in the network interface card verifies that the frame is:
- Not less than the minimum frame length not greater than the maximum length (1500 B)
- Contains a valid CRC at the end
- Does not contain a residue (i.e. extra bits which do not form a byte)
- MAC Address: The frame is then filtered based on the MAC destination address and accepted only if:
- It is a broadcast frame (i.e. all bits of the destination address field are set to 1)
- It is a multicast frame to a registered MAC group address
- It is a unicast frame to the node's own MAC address
- Or the interface is acting in promiscuous mode (i.e. as a bridge)
- MAC SAP: The frame is then demultiplexed based on the specified MAC packet type (SAP)
- Frames carrying an IEEE 802.1pQ Tag will have their Virtual LAN information checked and processed, before skipping the Tag field and reading the following EtherType field.
- It is passed to the appropriate protocol layer (e.g. LLC, ARP, IP)
- Frames carrying Packets destined for IP have a type field of 0x0800 and those for arp have a value 0x0806.
- IP Check: The IP packet header is checked, including:
- By checking the protocol type =4 (i.e. current version of IP)
- By verifying the header checksum
- By checking the header packet length
- IP Address: The destination IP network address is then checked:
- If it matches an IP address of the node then it is accepted
- If it is network broadcast packet to the node's network it is accepted
- If it is a multicast packet to an IP multicast address which is in use then it is accepted
- If it is none of these, it is forwarded using the routing table (if possible) or discarded
- IP Fragmentation: Packets for the node are then checked concerning whether reassembly is required:
- The fragmentation offset value and more flags are inspected
- Fragments are placed in a buffer until other fragments are received to complete the packet.
- IP SAP: The IP protocol field (SAP) is checked:
Some decodes of IP Packet Headers
Introduction to Routers
Operation of a Router
Gorry Fairhurst - Date: 11/02/2006 EG3557