Cache Table - Al Akhawayn University in Ifrane

Download Report

Transcript Cache Table - Al Akhawayn University in Ifrane

Cache Table
State Queue Attempt Time out IP @
Physical @
R
5
ACAE32457342
P
2
2
129.34.4.8
P
14
5
201.11.56.7
R
8
P
12
900 180.3.6.1
450 114.5.7.89
1
457342ACAE32
220.55.5.7
F
R
9
P
18
60 19.1.7.82
3
188.11.8.71
4573E242ACA
ARP Modules
IP Layer
ARP
IP Packet
Output Module
IP Packet
Cache
Control
Module
Queues
Cache Table
IP Packet
Input Module
ARP Packet
(request)
ARP Packet
(request or reply)
ARP Packet
(reply)
IP Packet
(with resolved
Hardware @)
Data Link Layer
ARP Packet
(request)
IP Packet
(with resolved
Hardware @)
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)
State Queue Attempt Time out IP @
Physical @
R
5
ACAE32457342
P
2
2
129.34.4.8
P
14
5
201.11.56.7
R
8
P
12
1
220.55.5.7
P
23
1
116.1.7.22
R
9
P
18
900 180.3.6.1
450 114.5.7.89 457342ACAE32
60 19.1.7.82
3
188.11.8.71
4573E242ACA
Cache Table (15 sec later)
State Queue Attempt Time out IP @
Physical @
R
5
ACAE32457342
P
2
2
129.34.4.8
P
14
5
201.11.56.7
R
8
P
12
1
220.55.5.7
P
23
1
116.1.7.22
R
9
R
18
900 180.3.6.1
450 114.5.7.89
60 19.1.7.82
457342ACAE32
4573E242ACA
900 188.11.8.71 E34573242CA
Cache Table (after 25 sec)
State Queue Attempt Time out IP @
Physical @
R
5
ACAE32457342
P
2
F
840 180.3.6.1
3
129.34.4.8
6>5
R
8
P
12
2
220.55.5.7
P
23
2
116.1.7.22
F
R
390 114.5.7.89
457342ACAE32
60-60=0
18
875 188.11.8.71 E34573242CA