5.3. MAC and IP AddressesEach node has an IP address. Each node's adapter to its attached link has a link-layer address, which is in fact the MAC address . A MAC address is as wide as 6 bytes and is normally shown in hexadecimal notation, such as 00-40-33-25-85-BB. The MAC address is unique for each device and is permanently stored in the adapter's read-only memory. Consequently, networking manufacturers need to purchase MAC addresses for their products. Unlike an IP address, a MAC address is not hierarchical. The advantage of MAC addressing is that a device may not need to have an IP address in order to communicate with the surrounding devices in its own LAN. Each node adapter that receives a frame checks whether the MAC address of the frame matches its own MAC address. If the addresses match, the adapter extracts the inner packet and passes it up the protocol stack. In summary, each destination address specified in an IP header is the logical address and is different from the physical or the link-layer address. For a packet from a source host to be delivered successfully to its destination, the host needs to identify both the IP address and the link-layer address. The source uses the address resolution protocol (ARP) to find the link-layer address of a destination. 5.3.1. Address Resolution Protocol (ARP)The Address Resolution Protocol (ARP) is designed to convert IP addresses to MAC addresses or vice versa. Suppose that a user wants to transmit a packet to its destination. If it does not know the link-layer address of the destination, the sender broadcasts an ARP packet requesting the link-layer address given the IP address. The destination is denoted by its IP address in the ARP request. Only the destination replies with its link-layer address. The sender then stores this address in the local ARP table for its subsequent use. Each networking device, such as a host or a router, has an interface, or adapter . Each adapter has a table that keeps the MAC address of each device within the network it is attached to. MAC addresses are listed in the adapter's ARP table.
5.3.2. Reverse Address Resolution Protocol (RARP)Reverse Address Resolution Protocol (RARP) too is a protocol to find a certain address. But in this case, RARP is used when the link-layer address of the destination is known but not its IP address. The host broadcasts the link-layer address of the destination and requests the IP address. The destination responds by sending the IP address. |