09-24-2018 05:50 AM - edited 03-08-2019 04:13 PM
As per me when PC want to send a frame to switch, first it looked at PC arp ( if destination frame is within subnet ). if tt is not find within the PC ARP table, PC will send a ARP request with destination IP address. In this process we do not require Switch ARP. may i know why we have Switch ARP and different between PC ARP vs Switch ARP.
PC ARP
09-24-2018 09:42 AM
09-24-2018 02:23 PM
Hello
For a Layer 2 switching process, once the packet comes from the network layer to the data link layer the source host1 will check the arp table for a cached mapping mac address entrys for destination host2 and if their isnt one it will arp broadcast and send a arp frame to the switch with the source host1 ip and source host1 mac address and a destination mac header of ffff.ffff.fff ( broadcast)
The switch will check the l2 header and see its a broadcast and flood it out on all ports other than the host the frame came in on, whilst this is happening the ip packet of host 1 will be put on hold (buffered)
Host 2 will see this is arp request and prepares a arp replay, The switch will log the source host1 ip and source host 1mac addresses and the port it came in on from the arp request and eventually also the destination host2 ip and destination host2 mac address and port from its arp reply
At this point the switch now knows the src/dst mac addresses of each host and will forward host 1
packet and the frame towards the appropriate ports.
Host 2 checks the L2 header and sees that its for itself and strips it off
host 2 checks the l3 header and sees that its for itself and strips it off
host 2 checks dest port and proceeds to process the data.
L3 switch process is similar but the host will see that the destination address isnt on the same subnetwork so it will arp toward its own defined default gateway of which the router will reply to the arp broadcast
A frame will then be created sent to the router, where this frame will be read strip off and the process begins from the router perspective towards host2
The reply from either process wont be as long due to now all the cam and arp tables will now have been populated (cached) so lookups will be quicker
09-25-2018 04:47 AM
09-25-2018 11:14 AM
I mostly agree with Joseph but would explain it a bit differently. He is quite correct that when performing layer 2 forwarding a switch does not need to arp. A layer 2 switch does need to arp if the IP frame was originated by the switch itself and if the destination is an address in the local subnet.
HTH
Rick
09-25-2018 04:53 PM
09-26-2018 08:56 AM
Yes. We sometimes have different ways of explaining the same underlying behavior. And I do believe that for many people this can be very helpful. It is one of the benefits of these communities.
We typically talk about 2 kinds of switch. In this case I really do like Joseph suggesting that we consider 3 kinds of switch. +5
HTH
Rick
09-24-2018 12:24 PM - edited 09-24-2018 12:26 PM
Hello Karunakar454
ARP will be used when host needs to know destination MAC address to reach destination IP address. For PC it's usually ARP for another host if in same subnet, or ARP for default gateway if traffic needs to be routed.
Switches operate on same principle. If some traffic is generated by the switch, it will use ARP to know destination MAC address for next L3 hop (for example, SNMP traffic generated by the switch). If switch is L3 switch and default gateway for a subnet, it will have ARP entries for hosts in that subnet, so that it knows destination MAC address to send traffic to those hosts. If the switch is L3 switch and performing routing, then it will have ARP entry for next L3 hop towards destination IP address.
I hope this answers your questions.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide