Section 5.3. MAC and IP Addresses


5.3. MAC and IP Addresses

Each 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.

Example.

Figure 5.4 shows that LAN1 has several users. A user with IP address 133.176.8.55 and adapter MAC address AB-49-9B-25-B1-66 wants to send a frame within its LAN to user 133.176.8.56 with adapter MAC address 11-40-33-55-A3-57. In this case, original packets are converted to frames in its adapter with the destination address AB-49-9B-25-B1-66. Now suppose that the same sender wants to send frames outside its LAN to a user in LAN3 with IP address 198.34.7.25 connected through a four-port router. But assume that the sender does not know the MAC address of the destination. In this case, the sender must broadcast an ARP packet to all users, but only the destination user replies to the ARP query, providing its adapter MAC address of 33-BA-76-55-A3-BD. This new address is used for the router to forward the message of the sending user to the destination.

Figure 5.4. ARP packets and MAC and port adapters

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.



Computer and Communication Networks
Computer and Communication Networks (paperback)
ISBN: 0131389106
EAN: 2147483647
Year: 2007
Pages: 211
Authors: Nader F. Mir

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net