MAC learning on switch

Hi All,

I thought that MAC learning process is purely hardware, but wa recently told that in fact most decent hi-end L2 switches off-load part of this activity on the host CPU, specifically -- every time a switch gets new MAc addrss to record in its internal table, it will notify the host (interrupt for example, or whatever other means are available) and the host will either grant the switch permission to proceed with that MAC, or reject it.

I don't quite understand this approach -- why it can be necessary, i.e. switches are smart enough to make such decisions independently?

Would be glad if someone could clarify this. Thanks !

Mark

Reply to
Mark
Loading thread data ...

They were presumable talking about the CPU in the switch (which is usually what manages the forward table, runs the spanning tree stuff, etc.), not one of the machines on the network.

Reply to
Robert Wessel

They were talking about the "host" CPU, i.e. machine on the network. I can understand the management of FDB (adding/deleting static entries, changing ageing period) is purely a host CPU task, but how can the CPU tell the switch which MAC addresses to store in the internal table? Isn't it a prerogative of the switch per se ?

Mark

Reply to
Mark

Someone, either you or the instructor, was confused. The host is part of the switch, not a separate computer on the network.

A modern switch has a CPU that handles things like user interface, configuration management, and infrequent tasks like authorizing MAC addresses. It also contains a switching engine that handles the high-performance task of forwarding packets. The CPU is the "host" that they were presumably talking about. After it makes a decision about a MAC address, it downloads it into the memory of the switching engine.

Reply to
Barry Margolin

They were referring to "host" CPU as part of ethernet switch, i.e. connected to switch chip either via PCI or any other interface. And it is the CPU that runs OS, drivers, command-line interface application, and various L2 protocols.

Sorry for not beaing accurate enough.

So, my question is why the CPU, i.e. software, will make decision about MAC address. I thought that this job is directly handled by hardware.

Mark

Reply to
Mark

The actual hardware on the port is usually pretty limited in terms of intelligence, and the setup of the forwarding tables and such is punted to the switch's CPU. In the simplest switches, there's really no intelligence at all in the port hardware, and it just sends and receives frames, and everything is handled by the CPU.

Faster switches are able to look up a MAC address plus source port in a forwarding table (the "filtering database", in 802.1D terms), and handle the forward on their own - but the CPU is still the one setting up that forwarding table, and to do that it does need to know about certain events seen by the port hardware.

Reply to
Robert Wessel

Right, that's what makes them high-end switches. Low-end switches just add all MAC addresses and you can't change it. High-end switches permit you to have more control over the MAC learning process. Otherwise, they could not implement things like port security, fixed MAC entries, and so on.

You may be getting confused by terminology here. By "switch" we don't mean a physical device labeled "switch". We mean the actual piece of hardware that does *only* the switching of packets. Maintaining a MAC table is *not* switching packets, so it is not done by the switch. The switch switches packets. Anything other than switching packets is done by something else.

DS

Reply to
David Schwartz

As others have said - the hardware section of a switch is designed to do the stuff that has to be done in hardware to offload the processor.

FWIW a CPU is usually the way to handle complex tasks that may have to change - and is usually a cheap way to implement logic compared to burning it into hardware.

MAC learning is one of those tasks that is not time sensitive compared to packet forwarding, and where there may be a complex set of criteria about which MAC addresses to install into tables and when (and when to take them out again).

For example MAC learning interacts with spanning tree state, and the related standards (must be a dozen or more by now), and MAC learning may change when QoS or IGMP pruning is set up, or VLAN "stuff" is turned on, or the chip is part of a layer 3 switch - so it makes sense to push that function into CPU software, which is much cheaper to change.

Reply to
Stephen

All, thanks for good answers !

Mark

Reply to
Mark

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.