# ARP address resolution protocal
###### tags:`OSI`,`ARP`
ref: https://www.youtube.com/watch?v=ArLgEC4bsps


ref https://www.youtube.com/watch?v=mqWEWye-8m8&ab_channel=HusseinNasser
----
#### IP function

#### ARP : ip to mac

operation: 1 for request ,2 for reply
EA: ethernet addr == MAC addr
send from A to router

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

hardware len:6 bytes / protocal len:4 bytes



if target mac match then receive or discard

router send back reply ; operation type: reply 2


ARP receive response and update ARP table

now the ethernet frame target MAC can be filled


arp table query

#### ARP work example
C send to A

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

send broadcast query A MAC addr

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



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

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
