2.1.1. Example: IP Addressing And Routing

The IP addressing mechanism assigns a distinct address to each network interface. The address is 4 bytes long in IP protocol version 4 and 16 bytes long in IP protocol version 6. In both versions, the address is structured into parts of variable length, typically including the address prefix, the subnet identification and the interface identification. The address prefix determines the class of the address, with each class of addresses having a specific use. The subnet identification is a part of the address that is common for all hosts connected to the same network segment. The interface identification is a part of the address that distinguishes hosts within the network segment.

The IP routing mechanism distinguishes two basic situations when sending a data packet depending on whether both the sender and the recipient share the same network segment. When this is the case, the IP routing mechanism uses the network hardware to send the packet directly to the recipient, otherwise the packet is sent to a router on the same network segment rather than to the recipient.

The IP addresses are not related to the addresses used by the network hardware. When sending a data packet, ARP (Address Resolution Protocol) is used to query the address used by the network hardware. The result of the query is cached to avoid the overhead of sending the ARP query and receiving the ARP reply whenever sending a data packet.

References. 

  1. Postel J.: RFC 0791 - Internet Protocol Version 4 (IPv4) Specification

  2. Postel J.: RFC 0792 - Internet Control Message Protocol (ICMPv4) Specification

  3. Plummer D. C.: RFC 0826 - Ethernet Address Resolution Protocol

  4. Hinden R., Deering S.: RFC 2373 - Internet Protocol Version 6 Addressing Architecture

  5. Deering S., Hinden R.: RFC 2460 - Internet Protocol Version 6 (IPv6) Specification

  6. Conta A., Deering S.: RFC 2463 - Internet Control Message Protocol (ICMPv6) Specification

  7. Hinden R., Deering S.: RFC 3513 - Internet Protocol Version 6 (IPv6) Addressing Architecture