12

4 PCs are connected to a switch and this switch is aware of their MAC addresses (all 4 PCs). Computer A and Computer D have not communicated ever earlier hence they both don't have their ARP table updated with each other's MAC address.

Computer A wants to communicate with Computer D, hence it sends out an ARP request for Computer D's MAC address. This ARP would be a broadcast message (with FF:FF:FF:FF:FF:FF as destination MAC in ARP packet).

I'd want to understand as how switch will take it up as it's already aware of Computer D's MAC but Computer A is not. Will the switch let Computer D respond to the ARP messgage (the broadcast) or drop that ARP request and directly route Computer A's packet to Computer D (since switch is already aware of Computer D's MAC)?

  • 2
    In addition to the answers, all operating systems that I'm aware of nowadays issue a Gratuitous ARP when the link is brought up. – AbraCadaver Aug 8 '16 at 15:35
  • @AbraCadaver That's not really relevant. Gratuitous ARP should only existing ARP cache entries, not create new ones. It's meant to force out obsolete entries when an IP moves or a NIC is replaced, not preload caches. – Barmar Aug 12 '16 at 17:29
  • @Barmar: No. Bridge/switch sees frame, records source MAC and port. That's how it works. – AbraCadaver Aug 12 '16 at 18:08
  • @AbraCadaver What does that have to do with how gratuitous ARP is processed? – Barmar Aug 12 '16 at 18:09
  • @Barmar: Gratuitous ARP is not processed by a switch. It sees an Ethernet frame with a source MAC come in on a particular port, that's it... – AbraCadaver Aug 12 '16 at 18:14
24

The ARP request will of course go through.

The switch doesn’t know about ARP. It only knows about Ethernet (ie. MAC addresses on Ethernet frames), not protocols on top of it. (Some switches offer advanced features like IGMP snooping, but that’s not relevant here.)

Because it’s a broadcast message, it has to be delivered to all (connected) ports. That’s all the switch cares about. It can’t know it’s really destined for computer D.

  • Well, Ethernet is a protocol. However, a simple switch does just pay attention to some protocols (like Ethernet), and not others (like Internet Protocol version 4, or Transmission Control Protocol). – TOOGAM Aug 8 '16 at 7:15
  • 2
    The ARP request asks: "Where is 192.168.0.1?" The switch hasn't got any idea about this. – Michael Hampton Aug 8 '16 at 21:43
11

An ARP request is simply a message that says "You there at IP whatever! What's your MAC address?" Even though ARP deals with discovering layer 2 addresses, it's inherently a layer 3 request because it's being sent to an IP address. Switches don't operate at layer 3.

In the example you gave, you know something that the switch does not; that the IP address in the ARP request belongs to computer D. The destination MAC address is a broadcast and that's all the switch knows or cares about. If the switch sees a broadcast MAC, then it will broadcast that packet plain and simple.

Yes there are layer 3 switches out there, and pedants would point out that ARP technically isn't a layer 3 protocol, but none of that matters for this example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.