Professional Documents
Culture Documents
Figure 7.1
Figure 7.2
7.1 ARP
ARP associates an IP address with its physical address. On a typical physical network, such as a LAN, each device on a link is identified by a physical or station address that is usually imprinted on the NIC.
Figure 7.3
ARP operation
Figure 7.4
ARP packet
Figure 7.5
Note:
An ARP request is broadcast; an ARP reply is unicast.
Figure 7.9
ARP components
10
Output Module: 1. Waits until an IP packet is recived from IP software 2. Check cache table for an entry corresponding to the destination of this IP packet. 3. If ( found)
1. Retrieve the hardware address of this entry. 2. Send the packet along with the hardware address to the data link layer. 3. Return. 2. If (state is PENDDING) 1. Packet waits until the destination hardware address found. 2. Enqueue the packet to the corresponding queue. 3. Return. 4. If (not found) 1. Create a cache entry with state PENDING and ATTEMPTS set to 1. 2. Create a queue. 3. Enqueue the packet. 4. Send the request. 5. return.
TCP/IP Protocol Suite
1. If (state is RESOLVED)
11
Input Module: 1. Waits until ARP (request or reply) packet arrives. 2. Check the cache table to find an entry corresponding to the ARP packet. 3. If (found) 1. If ( the state is PENDING) 1. Update the entry (with RESOLVED state and TIMEOUT value) 2. While the queue is not empty 1. dequeue one packet 2. Send the packet and hardware address to the data link. 2. If ( the state is RESOLVED) 1. Update the entry with new hardware address and reset the TIMEOUT 4. If (not found) 1. Create an entry 2. Add the entry to the table (with resolved state and TIMEOUT) 5. If (the packet is a request) 1. Send an ARP reply immediately. 6. Return.
12
It is responsible for maintaining the cache table. 1. Periodically check the cache table entry by entry. 2. For every entry in the cache table 1. If ( the state is FREE) 1. continue. 2. If ( the state is PENDING) 1. Increment the value of ATTEMPTS by 1. 2. If (ATTEMPTS greater than maximum) 1. change the state to FREE. 2. Destroy the corresponding queue. 3. Else 1. send an ARP packet. 3. If ( the state is RESOLVED) 1. Decrement the value of time-out by the value of the elapsed time. 2. If (time- out less than or equal to zero) 1. change the state to FREE. 2. Destroy the corresponding queue. 3. Return
13
14
7.3 RARP
RARP finds the logical address for a machine that only knows its physical address.
15
Note:
16
Figure 7.10
RARP operation
17
18
Figure 7.12
19