قالب بسته ARP
The above fig shows the ARP format used , below is the explanation of each field:
Each data link layer protocol is assigned a number used in this field. For Ethernet it is 1.
Each protocol is assigned a number used in this field. For example, IPv4 is 0x0800.
Length in bytes of a hardware address. Ethernet addresses are 6 bytes long.
Length in bytes of a logical address. IPv4 addresses are 4 bytes long.
Specifies the operation the sender is performing: 1 for request, and 2 for reply.
There are actually four types of ARP messages that may be sent by the ARP protocol. These are identified by four values in the "operation" field of an ARP message. The types of message are
Sender hardware address
Hardware address of the sender.
Sender protocol address
Protocol address of the sender.
Target hardware address
Hardware address of the intended receiver. This field is zero on request.
Target protocol address
Protocol address of the intended receiver.
ARP Function explained
ARP is used in four cases when two hosts are communicating
1.When two hosts are on the same network and one desires to send a packet to the other
2.When two hosts are on the different networks and must use a gateway or router to reach the other host
3.When a router needs to forward a packet for one host through another router
4.When a router needs to forward a packet from one host to the destination host on the same network
When an ARP response arrives, the receiver inserts a binding into an ARP cache so that it can be used for further packets. The oldest entry is removed if the table is either full or after an entry has not been updated recently. When an ARP request arrives, the receiver checks if it has the senders protocol address in the cache; if so, then the receiver updates the cache entry with the sender's binding. After a host replies to an ARP request, it adds the sender's binding to the cache - if a message travels from one host to another, then a reply will often travel back.
To understand this further lets see how an ARP actually works
ARP works by broadcasting the packet to all hosts attached to an Ethernet network. The packet contains the IP address the sender is interested in communicating with. The target machine, recognizing that the IP address in the packet matches its own, returnsan answer. Hosts actually keep a cache of ARP responses
قالب بسته های RARP