[Bridge] RSTP user mode implementation

Srinivas M.A. srinivas.aji at gmail.com
Thu May 8 09:17:33 PDT 2008


Hi,

I am attaching a newer version that I have (Tarball includes .git/).
Stephen Hemminger has not put the newer version in his git. I rewrote
the RSTP logic, replacing RSTPLIB, based on the 802.1D-2004 standard.
The RSTP logic is in the files rstp.[ch] and the rest interfaces this to work
on a Linux bridge.

There was some discussion about this on the Linux bridge mailing list
(https://lists.linux-foundation.org/mailman/listinfo/bridge).
You can look at last month's archives. There a thread of discussions
with Joakim Tjernlund trying this out.

If you are trying to run RSTP for Linux bridging, what you get out of
this tarball I am sending will work, with some caveats about startup.

Let me write some notes on how this works, which may avoid initial
confusion. One of the complications in the currnet Linux bridge STP is
that we have an STP implementation in the kernel, as well as a
framework to let userspace do STP (which is how this RSTP
implementation works.). In relatively new kernels (2.6.21+), the way
the STP implementation is chosen is this. When you do
"brctl stp <br> on", the kernel tries to run "/sbin/bridge-stp <br> start".
If this program can be run and its exit status is 0, userspace is
assumed to handle STP for this bridge, else kernel STP is used.
The sample bridge-stp in the tarball just exits with status 0 if the
bridge name is one of those listen in the variable RSTP_BRIDGES in the
script.

So to get this working, follow these steps:
1. Put the file bridge-stp in the tarball at /sbin/bridge-stp, with
   execute permission.

2. Edit RSTP_BRIDGES in that file to the list of bridges on which you
   want RSTP rather than kernel STP.

3. Start rstpd before bringing up any bridges (from an init script,
   perhaps.)

4. Enable stp on the bridge before bringing it up. (There is currently
   no notification from kernel to rstpd for STP state change, but there
   is for bridge up/down. So if STP state is set before the bridge is
   brought up, things work fine.)

In any case, let me know how it goes.

Srinivas


On Wed, May 7, 2008 at 4:36 PM, Benoit PAPILLAULT
<benoit.papillault at free.fr> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I'm new to STP and RSTP. I'm however trying to implement a new bridge
> protocol. I'm trying the RSTP code available at :
>
> git clone git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/rstp.git
>
> It compiles fine. However, it segfaults using a 2.6.22 kernel from
> Ubuntu. Since the documentation is pretty scare, are there requirements
> on the kernel version or kernel features?
>
> Moreover, it seems the last commit was done in May 2007. Are new
> developments taking place at some other location? Or is the project
> dead? I really like the idea of implementing bridging at user level, it
> should allow me to try a new bridge protocol pretty easily.
>
> Regards,
> Benoit
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFIIY1MOR6EySwP7oIRAsULAKDuR3667Gsmc9hTulKrlXZeuXYb5ACgyGnA
> R8cRMbR98E06PK0kEn6Nlms=
> =x0MY
> -----END PGP SIGNATURE-----
> _______________________________________________
> Bridge mailing list
> Bridge at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/bridge
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rstp.tgz
Type: application/x-gzip
Size: 424605 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/bridge/attachments/20080508/374fedf2/attachment-0001.bin 


More information about the Bridge mailing list