Docstoc

ARP

Document Sample
ARP Powered By Docstoc
					               Cache Table
State Queue Attempt Time out IP @          Physical @
R         5              900 180.3.6.1     ACAE32457342
P         2       2          129.34.4.8
P        14       5          201.11.56.7
R         8              450 114.5.7.89    457342ACAE32
P        12       1          220.55.5.7
F
R         9               60 19.1.7.82     4573E242ACA
P        18       3          188.11.8.71
              ARP Modules
                           IP Layer
                                                                     IP Packet




ARP                                        Output Module


                                                  IP Packet
                                                                   Queues
                   Cache Table
      Cache
      Control
      Module



                                                   IP Packet




                                                Input Module




      ARP Packet
                              ARP Packet        ARP Packet     IP Packet      ARP Packet     IP Packet
                           (request or reply)     (reply)                      (request)
       (request)                                             (with resolved                (with resolved
                                                              Hardware @)                   Hardware @)



                      Data Link Layer
                          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 (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
•   If (not found)
     –   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)
     –   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
•   If (not found)
     –   Create an entry
     –   Add the entry to the table
•   If (the packet is a request)
     –   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)

State Queue Attempt Time out IP @          Physical @
R         5              900 180.3.6.1     ACAE32457342
P         2        2         129.34.4.8
P        14        5         201.11.56.7
R         8              450 114.5.7.89 457342ACAE32
P        12        1         220.55.5.7
P        23        1         116.1.7.22
R         9               60 19.1.7.82     4573E242ACA
P        18        3         188.11.8.71
          Cache Table (15 sec later)

State Queue Attempt Time out IP @          Physical @
R         5              900 180.3.6.1     ACAE32457342
P         2       2          129.34.4.8
P        14       5          201.11.56.7
R         8              450 114.5.7.89    457342ACAE32
P        12       1          220.55.5.7
P        23       1          116.1.7.22
R         9               60 19.1.7.82     4573E242ACA
R        18              900 188.11.8.71 E34573242CA
         Cache Table (after 25 sec)

State Queue Attempt Time out IP @              Physical @
R         5                  840 180.3.6.1     ACAE32457342
P         2         3             129.34.4.8
F             6>5
R         8                  390 114.5.7.89    457342ACAE32
P        12         2             220.55.5.7
P        23         2             116.1.7.22
F                       60-60=0
R        18                  875 188.11.8.71 E34573242CA

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:31
posted:12/1/2011
language:English
pages:8