MAC learning on switch

Have a question or want to start a discussion? Post it! No Registration Necessary.  Now with pictures!

Threaded View
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



Re: MAC learning on switch
On Fri, 2 Sep 2011 09:23:32 -0400, "Mark"

Quoted text here. Click to load it


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.

Re: MAC learning on switch

Quoted text here. Click to load it

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



Re: MAC learning on switch

Quoted text here. Click to load it

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.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Re: MAC learning on switch

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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



Re: MAC learning on switch
On Fri, 2 Sep 2011 23:00:31 -0400, "Mark"

Quoted text here. Click to load it


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.

Re: MAC learning on switch
On Fri, 2 Sep 2011 23:00:31 -0400, "Mark"

Quoted text here. Click to load it

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.

Quoted text here. Click to load it
--
Regards

stephen_hope@xyzworld.com - replace xyz with ntl

Re: MAC learning on switch

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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

Re: MAC learning on switch
All, thanks for good answers !

 Mark



Site Timeline