Cache Table ARP Modules Output Module Sleep until
Cache Table
ARP Modules
Output Module • • • Sleep until IP packet is received from IP Software Check cache table for entry corresponding to the destination of this IP packet If (found) – – • If (not found) – – • If (the state = RESOLVED) • Extract the value of the hardware address from the Entry • Send the Packet and hardware address to data link layer • Return If (the state = PENDING) • Enqueue the packet to the corresponding queue • Return Create a cache entry with state= PENDING and ATTEMPT =1 Create a queue Enqueue the packet Send ARP request Return
Input Module • • • Sleep until ARP packet (request or reply) arrives Check cache table for entry corresponding to this ARP packet If (found) – – • If (not found) – – • Create an entry Add the entry to the table If (the packet is a request) – • Update the entry ( Set TIME_OUT, Set corresponding Hardware @) If (state = PENDING) • While (the queue is not empty) – Dequeue one Packet – Send the packet and the Hardware address to the data link Send an ARP reply Return
Cache Control Module • • Sleep until the periodic time matures For every entry in the cache table – – – • If (State = free) • continue If (the state = PENDING) • Attempt++ • If (Attempt > Maximum) – State = Free – Destroy the corresponding queue • Else – Send an ARP request • Continue If (the state = RESOLVED) • TIME_OUT = TIME_OUT – ELAPSED_TIME • If (TIME_OUT < 0) – The State = Free – Destroy the corresponding queue Return
Cache Table (after 20 sec)
Cache Table (15 sec later)
Cache Table (after 25 sec)
- Slides: 8