From: Mark on
Hello

Linux kernel has its own implementation of the spanning tree, it comes along
with the bridge functionallity. Many Layer2 switch vendors ship their SDK
(full sources, inlcuding Linux kernel), implementing VLAN, ACL etc.
functions as well as STP.

What is the point of doing this? Is Linux's STP implementation not entirely
802.1d compliant, or not scalable? Or is it a specifics of the Linux'
networking stack architecture?
Thanks.

--
Mark

From: David Schwartz on
On Nov 19, 5:23 pm, "Mark" <mark_cruzNOTFORS...(a)hotmail.com> wrote:

> Linux kernel has its own implementation of the spanning tree, it comes along
> with the bridge functionallity. Many Layer2 switch vendors ship their SDK
> (full sources, inlcuding Linux kernel), implementing VLAN, ACL etc.
> functions as well as STP.

> What is the point of doing this? Is Linux's STP implementation not entirely
> 802.1d compliant, or not scalable? Or is it a specifics of the Linux'
> networking stack architecture?
> Thanks.

Their STP implementation has to hook in with their hardware
acceleration. The Linux STP implementation is designed to bridge
network interfaces. A typical switch STP implementation bridges switch
ports which normally don't present as network interfaces to the OS.

For example, when a packet arrives on a network interface, typically
the network interfaces passes it to the operating system. But a switch
will often only present a single network interface to the operating
system. So how would the OSes STP implementation know which port an
STP packet was received on unless there was some custom logic to
interface with the switch ASIC?

So the short answer is that the two implementations are adopted to
completely different purposes. However, you can fairly trivially turn
one into the other. All you need is a special hook to tell the switch
ASIC to pass all STP packets to the OS along with an identifier of
which port they were received on and a special hook to allow the OS to
control which switch ports are in forwarding states and which are in
blocked states (often on a per-VLAN basis on both counts).

DS
From: Mark on
David Schwartz wrote:
> Their STP implementation has to hook in with their hardware
> acceleration. The Linux STP implementation is designed to bridge
> network interfaces. A typical switch STP implementation bridges switch
> ports which normally don't present as network interfaces to the OS.
>
[skip]
Thanks, it sounds as a clear and straighforward explanation. I think the
same reasons apply to vendor-implemented VLAN functionality vs. kernel
native VLAN.

--
Mark