Prerequisite – just how ARP works?To transport a packet from resource to destination, both MAC address and IP resolve of the destination should be known. If the location MAC attend to is not present then ARP will fix this issue very first then the packet will be delivered to location host.There are an easy rules because that a packet flow in a network:If the location host is existing in the same network the the source host then the packet will be ceded directly come the location host utilizing MAC address.Within a network, the packet will certainly be delivered on the basis of MAC address.MAC deal with never crosses its broadcast domain.Now, very first we need to take an idea about ARP.

You are watching: A computer has to send a packet to a destination host in the same lan. how will the packet be sent?

Address Resolution Protocol –Address Resolution Protocol is a class 2(Data connect layer) protocol which is offered to find MAC deal with of the well-known IP address.There are some necessary terms linked with ARP:


ARP cache is a table kept by ARP which has IP address with its linked MAC resolve and type. If MAC resolve is learned dynamically then the type will it is in dynamic and also if MAC attend to is added manually then kind will be static.ARP inquiry is a transfer message generated by the source to uncover the destination MAC address if the ARP is not fixed initially.ARP answer is a unicast article from location to source device containing the destination MAC address.Explanation –The steps consisted of in ARP process are as follows:-When a source wants to send a packet come destination machine then,


1. The source ARP cache is examine if the ARP is addressed or not. If the ARP is no resolved, that puts the packet ~ above hold and also generates one ARP request.2. If the ARP is currently resolved then the packet will certainly be delivered to location host.3. The ARP inquiry is broadcast all over the network to find out the machine having destination IP address.Note – If the destination is current in the very same network climate ARP will discover out destination MAC deal with but if it is present in various network then ARP will find out default gateway MAC address.4. When the an equipment having the location IP deal with receives the ARP request, the updates it’s very own ARP cache.5. The location host machine generates an ARP reply containing it’s own MAC address.6. Now, the machine having the resource IP attend to receives the ARP reply and update it’s ARP cache.7. Since, both resource and location IP address and MAC resolve are accessible now thus the packet is ceded to the destination host.


Now, we have actually taken an idea around the ARP protocol. Let’s see about the packet flow.Now we will certainly understand exactly how the packet is delivered to location when the location is current in very same network(network the the source).Here is the topology in which host A having actually IP resolve 192.168.1.1, organize B having actually IP resolve 192.168.1.2 and also the router having actually IP deal with 192.168.1.3 on interface fa0/0.Now just how source device will recognize that the location is present in exact same or different network. Let us understand:-AND operation is performed between source IP address, source subnet mask and destination IP address, resource subnet mask. If the resultant of both is exact same then the destination is current in the exact same network otherwise in different network.Let us try to ping organize B from host A.As you have the right to see 2 packets room generated, among ICMP and the various other of ARP(green). ARP frame is generated due to the fact that the host A has actually not yet communicated to host B i.e. The ARP has actually not been fixed i.e ARP will certainly be resolved first so that hold A have actually an entrance for organize B MAC address.


As currently explained the ARP request will be broadcast very first for the target IP deal with within the network because routers execute not forward broadcast packet. The broadcast inquiry is obtained by the switch as shown in the over figure.The switch transfer the ARP request together the entry in the ethernet header is FFFF.FFFF.FFFF (broadcast MAC address).The request is received by host B as displayed in the over figure. The organize B generates one ARP reply immediately specifying its own MAC address.Now the hold B unicast the ARP answer to the hold A i m sorry is received by the switch which consequently forward it come the hold A as displayed in the over 2 figures.Note –The switch is able to unicast the reply because the switch has put an entry for hold A in it MAC table as soon as the hold A transfer the ARP request.in the exact same way,switch has likewise put an entry for the hold B as soon as the move receivesthe ARP reply.Now the ARP has been resolved and also the ICMP will be unicast come the organize B from host A(as presented above).

See more: Watch Margin Call Free Online Free At Fpxtv, Watch Margin Call For Free Online

Now the ICMP acknowledgment packet will certainly be unicast from hold B to hold A i.e. Host B is successfully ping from hold A as presented in the over figures.Attention reader! Don’t stop finding out now. Acquire hold of every the crucial CS Theory concepts for SDE interviews with the CS concept Course in ~ a student-friendly price and also become industry ready.