3

Hey I'm kinda new to networking. Forgive the basic nature of the doubt.

Switches, when they receive frames to an unknown destination, broadcast the frame to find the correct destination. Meanwhile routers use routing protocols like RIP, OSPF etc. to find the correct destination. My doubt is why can't switches also use some sort of protocol similar to RIP but at level 2 to find the MAC addresses of all the devices? We can avoid the unicast flooding which take away a lot of the bandwidth right?

1
  • I would suggest reading through this article series to "land the plan" on many of the networking concepts you may have confused.
    – Eddie
    Sep 16 '16 at 19:41
3

As mentioned in my comments on Ron Royston's answer, I assume you mean "why can't switches also use some sort of protocol to populate their mac-address-table". If that is not what you meant then disregard the rest of this answer. If that is what you meant then I think this is a great question!

First of all, if you really meant "why can't switches use..." then I think the answer is, theoretically they could - or at least off the top of my head I can't think of a reason why they could not. You could invent a L2 protocol that allows switches to query the device connected to a port to get the device's MAC address, or a list of MAC addresses reachable through that device (in case it is another switch). This could perhaps even remove the need for STP. Of course this are just my initial thoughts and real experts (which I don't consider myself to be) may have already given this much more thought and may have found specific reasons why this would not work.

However if your question (or next question) is "why don't switches use..." then I can think of a few reasons:

  • Ethernet existed before Ethernet switches were invented. Implementing a new protocol would mean no backward compatibility or in other words, you would have to upgrade firmware or hardware on all the devices on your network to implement this new protocol.
  • Time-to-market and competition may have been important (business driven rather than technical) considerations when the first switches were introduced.
  • CPU power in early switches may not have been enough to run such a protocol, or switches would have required more expensive CPUs.
  • the KISS principle. Such a new protocol would be much more complex than the current mac learning method.
  • as Ron Maupin mentions in his answer, in a network hosts may frequently connect/disconnect or roam (consider your phone connecting to different wifi APs when you walk around, so the LAN switches will see its mac address on different ports all the time), so this could generate a high amount of overhead (in terms of bandwidth used by the protocol, and CPU load on the switches to process the changes).
  • as Ron Maupin also mentions in his answer, unicast flooding happens (much) less than you may think. There are very few network connected devices that do not (or rarely) transmit frames on the network, and as soon as a device transmits a single frame, the switch learns its mac address. I want to add to that that many (most?) OS will send Gratuitous ARP packets causing the switch to learn the MAC as soon as the link comes up. Also, in the unlikely (but possible) scenario where a device does not transmit any frames, a managed switch typically offers you the possibility to configure a static entry in the mac-address-table (e.g. using mac-address-table static ... on a Cisco Catalyst switch.
2
  • Hey yes this is exactly what I was asking. I thought it was pretty clear, but when I re-read the question, I realized it could be interpreted other ways too. So sorry for the ambiguity guys. Sep 18 '16 at 12:30
  • And thank you for the excellent answer @hertitu Sep 18 '16 at 12:31
0

Unicast flooding happens less than you may think. It only takes a single frame from a host for the switch to learn the port where the host is connected.

The thing about switches is that they are fairly simple, transparent devices which have changes made all the time. Hosts come and go all the time as they are turned on or off. Sometimes a host may be connected to a different port. Routing protocols work best with a fairly stable environment, and that doesn't exist for switches.

1
  • Oh ok. Thank you Ron. But if hosts come and go all the time, each time shouldn't there be a unicast flooding each time? Sep 16 '16 at 19:04
0

IP addressing is intended to be designed/configured by administrators, allowing for route summarization which facilitates efficient routing. IP addresses are not meant to be universally unique identifiers (UUID's) whereas MAC addresses are.

6
  • Yes I get that, my question is why can't we use something similar to routing protocols to learn about the MAC addresses of the other devices in the LAN? Sep 16 '16 at 19:26
  • because they are not configurable, they are hard coded. Routing tables would be host tables. Trillions of entries? Sep 16 '16 at 19:28
  • Trillions of devices in a LAN??? The OP is not talking about building a table with all the MAC addresses in the whole world, just his local LAN. So there wouldn't be more mac addresses in the table than there are now, the table would just be populated in a different way.
    – hertitu
    Sep 17 '16 at 22:30
  • @hertitu The question is about the need for an Internet Protocol suite and becomes how, for example, do you communicate with devices on other networks (linked networking equipment) in the absence of IP. Why do we need IP? That's the question. Sep 17 '16 at 23:48
  • IMHO that is not the question, that is your interpretation of the question. My interpretation of the question is "why doesn't the switch use something else than mac learning to populate it's mac-address-table, something more similar to a routing protocol?". Re-reading the original question I have to agree that it was ambiguous on this point so your interpretation would be as good as mine. However in the comment that you replied to, Danis clarified "to learn about the MAC addresses of the other devices in the LAN". So this is about replacing mac-learning, not about replacing IP.
    – hertitu
    Sep 18 '16 at 7:45

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.