5

I've been reading 'Windows Networking Fundamentals' and in that book it says that a switch can learn what MAC address is associated with a particular port when the connected device makes its first transmission to the switch by checking the source of the packet. It goes on to say that if the packet destination is an unknown MAC address it will flood every port with the packet (except the port it received the packet from), and then can potentially use the reply from the destination device to learn the destination MAC address.

However, in my Networks lectures, I have been told that switches send an ARP request to any unknown devices when they are first connected and the ARP reply is used to obtain the MAC address.

If the switch does send an ARP request when devices are first connected, why would any of the first method ever need to occur?

So does the switch initiate the process of obtaining a MAC address? Or does the switch learn it after the device makes its first transmission to the switch? Or does it depend on some other factors?

1 Answer 1

8

You are confusing switching, where a switch creates and updates a MAC address table as frames pass through it, with the switch management.

Switching is a layer-2 function, and a dumb switch will never use ARP. ARP is used by layer-3 devices to relate a layer-3 address to a layer-2 address, something that is not done for simple layer-2 switching.

A managed switch will have a layer-3 management interface that acts like a host on the LAN, so that interface (virtual host) needs to use ARP to relate layer-3 addresses to layer-2 addresses for any layer-3 packets that the switch management interface needs to send to another device. That has nothing to do with the switching function of the switch.

4
  • So a layer 2 switch will never use ARP and a layer 3 switch will always use ARP? May 12, 2019 at 23:25
  • 1
    That's not at all what I said. A managed layer-2 switch will use ARP for its management interface because that is a layer-3 interface, but it has nothing to do with switching frames. A layer-3 switch is always a manged switch, but not all managed switches are layer-3 switches. Also, a layer-3 switch is still a layer-2 switch, and the layer-2 switching uses a MAC address table, like any other layer-2 switch. The layer-3 part is a routing module in the switch, and it uses ARP the same way a router does.
    – Ron Maupin
    May 12, 2019 at 23:30
  • Okay sorry, one more question. So if the layer-2 part of a layer-3 switch uses a MAC address table, why does the layer-3 part need to use ARP? Doesn't it already have the MAC address from the MAC address table used in layer-2? May 12, 2019 at 23:37
  • 2
    MAC address tables relate a MAC address to a switch interface, and that is completely different than what ARP does, which is to relate a layer-3 address to a layer-2 address. Switching doesn't know anything about layer-3, and that allows a switch to carry any layer-3 protocol. The layer-2 and layer-3 functions in a layer-3 switch are completely separate. It is like putting a router and a switch in the same box. The functions are very different.
    – Ron Maupin
    May 12, 2019 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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