---
# System prepended metadata

title: ARP address resolution protocal
tags: [OSI, ARP]

---

# ARP address resolution protocal

###### tags:`OSI`,`ARP`

ref: https://www.youtube.com/watch?v=ArLgEC4bsps

![](https://i.imgur.com/rQqSzsg.png)


![](https://i.imgur.com/AK5C229.png)
ref https://www.youtube.com/watch?v=mqWEWye-8m8&ab_channel=HusseinNasser


----

#### IP function

![](https://i.imgur.com/hztx0qb.png)
 


#### ARP : ip to mac


![](https://i.imgur.com/nDe1G3S.png)

operation: 1 for request ,2 for reply
EA: ethernet addr == MAC addr
send from A to router
![](https://i.imgur.com/1qsBf7A.png)

traget(router) mac is unknown then filled with 00:00:00:00..

![](https://i.imgur.com/Kbf05eT.png)



hardware len:6 bytes / protocal len:4 bytes
![](https://i.imgur.com/ssDbemv.png)

![](https://i.imgur.com/jeHw3aI.png)


![](https://i.imgur.com/Wv5G2Sm.png)


if target mac match then receive or discard
![](https://i.imgur.com/IHLxQXc.png)

router send back reply ; operation type: reply 2
![](https://i.imgur.com/uQvrtRM.png)

![](https://i.imgur.com/apVZme9.png)

ARP receive response and update ARP table

![](https://i.imgur.com/HUtvmp3.png)

now the ethernet frame target MAC can be filled

![](https://i.imgur.com/UJdAfJh.png)


![](https://i.imgur.com/uZQN4Vw.png)

arp table query
![](https://i.imgur.com/vDwgtZn.png)


#### ARP work example



C send to A 

![](https://i.imgur.com/hyzEzuF.png)

try to find A MAC addr in C cache table but in vain

![](https://i.imgur.com/AHaBEiu.png)

send broadcast query A MAC addr

![](https://i.imgur.com/vPatrJF.png)

A receive message and others discrad this query.
record C MAC addr in A ARP cache table.
prepare send back message to C.

![](https://i.imgur.com/MOZSUnK.png)

![](https://i.imgur.com/ohgxdpn.png)

![](https://i.imgur.com/Hw9ix0r.png)

C add A MAC addr to C's ARP cache table

![](https://i.imgur.com/0Qn5Kb6.png)


cf. dynamic has timer to expire the map record of IP:mac, owing to the IP:MAC for dynamic type might change ex. change NIC(network interface card)


ARP work within single network, not cross networks

![](https://i.imgur.com/7YY1tWB.png)
