Funny thing that WDS

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
nariub
DD-WRT Novice


Joined: 31 Mar 2011
Posts: 20

PostPosted: Fri Sep 02, 2011 1:38    Post subject: Funny thing that WDS Reply with quote
I am having a strange issue
I turn on WDS on three devices
I turn on STP on all three
If I configure for a full mesh (each has an active neighbor with the other two, for failover)
Then wireless DHCP is flaky
sometimes i get an IP, sometimes I don't

Wired ports on the three routers get DHCP from the Main Router every time.

Main Router running the only DHCP Server
others set for DHCP-Server and Disabled
However, I get the same effect if i set them for DHCP-Forwarder with the IP address of the Main Router

I can disable one of the WDS neighbors in the config.
I watch the br0 topology change and congeal again.
(without the possibility of a loop)
and Wireless DHCP is working fine again.

WDS configured all with the same channel, 40Mhz, same SSID, same WPA2-AES-PSK, and as I said, she seems to be perfect until I add the other neighbor and let spanning tree get involved.

I have seen the notes about STP on with WDS and WPA2
and STP off with WDS and WEP or no security.

I assume the presence or absence of STP is just for loopback prevention in this instance?


Main Router
Asus RT-N16
running
dd-wrt.v24-14929_NEWD-2_K2.6_big
(which calls itself mega when on the router)

The other two are
Linksys WRT-310Nv1's
running
dd-wrt.v24-14929_NEWD-2_K2.6_std_nokaid_small

Any suggestions?
Sponsor
oxygenx
DD-WRT Guru


Joined: 11 Nov 2007
Posts: 566

PostPosted: Fri Sep 02, 2011 5:35    Post subject: Reply with quote
dont use a mesh topology with WDS, it's not supposed to worked that way. if you want to use a mesh, use OLSR or BATMAN
_________________
Router: WNDR3300 (wl0: n-Only 5Ghz, WPA2-AES, wl1: g-Only, WPA-Mixed-Mixed)
WDS Node 1: WNDR3300 (wl0: n-Only 5Ghz, WPA2-AES, WDS-connected Router, wl1: g-Only WPA-Mixed-Mixed)
WDS Node 2: WRT54GL (g-Only, WPA-Mixed-Mixed WDS-connected to Router)
Modem: Cisco EPC3202
clients: Notebook 1, D-Link 323, PS3 Slim, Kathrein UFC960 connected to WDS Node 1 via Gigabit Switch. Notebook 2, Deskjet 6980 connected to WDS Node 2
nariub
DD-WRT Novice


Joined: 31 Mar 2011
Posts: 20

PostPosted: Fri Sep 02, 2011 15:12    Post subject: Reply with quote
I appreciate that,
But Spanning Tree -is- supposed to act a particular way. And you are right, it isn't working well on WDS.

That is the salient bit of the post.
Why does Spanning Tree -not- work on WDS.

EDIT
ssh to the MainRouter
and the following commands are helpful in inspecting the bridge and spanning tree instance.

brctl show
brctl showstp br0

I moved my root bridge from one of the 310N's to my ASUS

MainRouter# brctl setbridgeprio br0 99

looked up some notes on brctl on the internet
found only one default ddwrt value that deviates from the recommended

forward delay
is set to 1 second by default,
internet indicates it should be set to 4 seconds
to allow for time to coordinate with other devices prior to joining a STP domain
left it alone this time.

I went and changed my hello from 2 seconds(default) to 1 second to get STP hellos more often

brctl sethello br0 1

I went and changed my max message age from 20 seconds (default) to 4 seconds again to get STP to be a bit more proactive on faults.

brctl setmaxage br0 4


wds interfaces appear to the bridge as ethernet and all ethernet get a default 100 cost. no reliability or speed calculations in STP. So I have to find my WDS interface I want to use as a backup

nvram show | grep wds[123]_ | sort

and you get descriptions and MAC addresses which will let you distinguish one WDS router from the other
lines we are looking for are
wl0_wds2_if=wds0.1
wl0_wds3_if=wds0.2

my wds0.2 is the backup link (it has a smaller SNR and lower connection speed per my eyeball)

so i give it a 300 cost on both the Main and Media Routers

MainRouter# brctl setpathcost br0 wds0.2 300
MediaRouter# brctl setpathcost br0 wds0.2 300

in theory,
all three routers would get

/usr/sbin/brctl sethello br0 1
/usr/sbin/brctl setmaxage br0 4

in their startup config

MainRouter would also get
/usr/sbin/brctl setbridgeprio br0 99
/usr/sbin/brctl setpathcost br0 wds0.2 300

MediaRouter would also get
/usr/sbin/brctl setpathcost br0 wds0.2 300


I will let it bake for a few days and let you know if it remains unstable.
nariub
DD-WRT Novice


Joined: 31 Mar 2011
Posts: 20

PostPosted: Fri Sep 02, 2011 23:29    Post subject: Reply with quote
it works,
it takes about 2 minutes to fail/recover from path to the other.

first fail 30 seconds
first recover 2 minutes
second fail 2 minutes
second recover 30 seconds

went ahead and changed the forward delay to 4 seconds.

put them all in the startup config



Don't suppose I could talk someone into mentioning brctl and it's options on the wiki page?

http://www.dd-wrt.com/wiki/index.php/Spanning_Tree_Protocol
GeeTek
DD-WRT Guru


Joined: 06 Jun 2006
Posts: 3763
Location: I'm the one on the plate.

PostPosted: Fri Sep 02, 2011 23:36    Post subject: Reply with quote
nariub wrote:
Don't suppose I could talk someone into mentioning brctl and it's options on the wiki page?

http://www.dd-wrt.com/wiki/index.php/Spanning_Tree_Protocol

Yes actually, I will be happy to add this info. I use WDS and STP and your findings will be helpful. If you could post the exact startup script then I can copy / paste it in. ( I'm a copy / paste level Linix Guru ). If you want to post a complete transcript to add that would earn you several extra beers.

_________________
http://69.175.13.131:8015 Streaming Week-End Disco. Station Ripper V 1.1 will do.
nariub
DD-WRT Novice


Joined: 31 Mar 2011
Posts: 20

PostPosted: Sat Sep 03, 2011 23:32    Post subject: Write up with some references Reply with quote
First let me apologize for the lack of actual art
I am an ASCII art type guy. Feel free to replace as you see fit.

Now the initial state:
Three routers
Main MAC:xxxxxxxxxxxx Asus RT-N16 running dd-wrt.v24-14929_NEWD-2_K2.6_big
Media MAC:xxxxxxxxxxx1 WRT-310Nv1 running dd-wrt.v24-14929_NEWD-2_K2.6_std_nokaid_small
Mid MAC:xxxxxxxxxxx2 WRT-310Nv1 running dd-wrt.v24-14929_NEWD-2_K2.6_std_nokaid_small

Main Has the WAN link to a PPPoE DSL
Link1 = WDS neighbors Main-Mid
Link2 = WDS neighbors Mid-Media
Link3 = WDS neighbors Media-Main

Now my ASCII art:

Code:

                  Main
                  |  \
                  |   \
                  |    \
                  |     \
                  |      Link1
                  |       \
                  |        \
              Link3         Mid
                  |         /
                  |        /
                  |       Link2
                  |      /
                  |     /
                  |    /
                 Media


By default DD-WRT exposes a single button on the webpage to toggle Spanning Tree On/Off

I was having a problem with DHCP and topology changes on Spanning Tree and suspected that STP was not working properly.
Specifically, my client would associate with the AP(dd-wrt router) but not get a DHCP assigned address.
Curiously the wired ports on the back seemed to always work just fine.
The issue was intermittant and bugged me greatly, in that I could simply turn off Link3 and have no issues at all for months at a time.

Since it was based on Linux
I googled up spanning tree and ubuntu and linux and various combinations and found that Linux has been using brctl since kernel 2.2.

I found that none of the controls were exposed in the DD-WRT front end, so I ssh'd to the devices.
(feel free to telnet or use the run command on the user interface for what follows)


first I checked to see if brctl was available with this command
Code:

root@Main:~#which brctl
/usr/sbin/brctl


I got it!!
now to business
brctl comes with the following options I will explain in a moment
Code:

Usage: brctl [commands]
commands:
        addbr           <bridge>                add bridge
        delbr           <bridge>                delete bridge
        addif           <bridge> <device>       add interface to bridge
        delif           <bridge> <device>       delete interface from bridge
        setageing       <bridge> <time>         set ageing time
        setbridgeprio   <bridge> <prio>         set bridge priority
        setfd           <bridge> <time>         set bridge forward delay
        sethello        <bridge> <time>         set hello time
        setmaxage       <bridge> <time>         set max message age
        setpathcost     <bridge> <port> <cost>  set path cost
        setportprio     <bridge> <port> <prio>  set port priority
        setportsnooping <bridge> <port> <addr>  set port snooping
        clearportsnooping       <bridge> <port> <addr>  clear port snooping
        showportsnooping        <bridge>        show port snooping
        enableportsnooping      <enable>                enable port snooping
        show                                    show a list of bridges
        showmacs        <bridge>                show a list of mac addrs
        showstp         <bridge>                show bridge stp info
        stp             <bridge> {on|off}       turn stp on/off



I peeked around to see what bridges were available
Code:

root@Main:~# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.xxxxxxxxxxxx       yes             vlan1
                                                        eth1
                                                        wds0.1
                                                        wds0.2


Which tells me I have one bridge named br0

Code:

root@Main:~# brctl showstp br0
br0
 bridge id              8000.xxxxxxxxxxxx
 designated root        8000.xxxxxxxxxxx1
 root port                 3                    path cost                100
 max age                  20.00                 bridge max age            20.00
 hello time                2.00                 bridge hello time          2.00
 forward delay             1.00                 bridge forward delay       1.00
 ageing time             300.00
 hello timer               0.00                 tcn timer                  1.79
 topology change timer     0.00                 gc timer                   0.83
 flags                  TOPOLOGY_CHANGE_DETECTED


vlan1 (1)
 port id                8001                    state                forwarding
 designated root        8000.xxxxxxxxxxx1       path cost                100
 designated bridge      8000.xxxxxxxxxxxx       message age timer          0.00
 designated port        8001                    forward delay timer        0.00
 designated cost         100                    hold timer                 0.83
 flags

eth1 (2)
 port id                8002                    state                forwarding
 designated root        8000.xxxxxxxxxxx1       path cost                100
 designated bridge      8000.xxxxxxxxxxxx       message age timer          0.00
 designated port        8002                    forward delay timer        0.00
 designated cost         100                    hold timer                 0.83
 flags

wds0.1 (3)
 port id                8003                    state                forwarding
 designated root        8000.xxxxxxxxxxx1       path cost                100
 designated bridge      8000.xxxxxxxxxxx1       message age timer         19.85
 designated port        8004                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.00
 flags

wds0.2 (4)
 port id                8004                    state                forwarding
 designated root        8000.xxxxxxxxxxx1       path cost                100
 designated bridge      8000.xxxxxxxxxxxx       message age timer          0.00
 designated port        8004                    forward delay timer        0.00
 designated cost         100                    hold timer                 0.83
 flags

root@Main:~#


Let's take a moment to interpret what we are seeing
bridge id is the MAC of your local bridge interface with "8000." out in front (8000.xxxxxxxxxxxx)
designated root is the MAC of the root bridge (spanning tree boss) with "8000." out in front (8000.xxxxxxxxxxx1)
root port is the port used to communicate with the root bridge (this case 3 which is wds0.1)
path cost is the culmulative cost of the path to root (how far away you are from the root bridge)
max age and bridge max age are the maximum age of the STP topology which is 20 seconds by default
hello time and bridge hello time is the number of seconds between hello messages on the bridge
forward delay and bridge forward delay are the time STP will wait before forwarding packets onto an existing bridge
which gives the new device time to find out what is going on before she starts talking into a network
ageing time is the length of time a MAC address is held in the forwarding table
the forwarding table remembers the source MAC when a packet crosses,
then it will store that MAC/port relation so when an packet comes in destined for the MAC
the switch will then forward the packet back down the port where it is last known to be
hello timer, tcn timer, topology change timer, and gc timer are all the current values in the live timers
flags is again a live value containing the last active flag value (my example indicates a topology change has been detected)


Looking at the remaining info are the port names(vlan1, eth1, wds0.1, wds0.2), physical port (number following the port names "1, 2, 3, 4"), port ids (8001-8004),
state (forwarding), path cost (all ethernet ports are default 100, we will revisit this in a moment) , and a bunch of timers and stuff.

The root bridge appears to be my Mid Router
and the path costs are default all the way around.

We would repeat the above procedure on the other two devices to ensure they all believed the root was the Mid Router and that all the path costs were the same.
in my case they were. So STP should have calculated a distance to the root bridge via link3 to be 200 (path cost of link3 added to the path cost of link 2).
Which it did not do in this case, because I initially had link3 disabled on the Media router. (so it would work)

first thing I wanted to do and I suggest for all involved.
Bring the root bridge to the WAN router, Main Router, in this case the newest and most powerful device ASUS RT-N16

By default, DDWRT assigns a root bridge priority of 100, I want my Main Router to be root so I influence this decision by lowering the Main Routers bridge priority to 99.
NOTE; real switch vendors set their default bridge priority much higher than this, cisco and brocade uses 32768 out of the box. There are some other out of the box default settings that DDWRT may want to review for compatibility with industry standard commercial hardware. Priority is one of the "needs to play nice" ones where the default 100 will make the DDWRT device assume root bridge from an existing STP domain.
http://www.brocade.com/support/Product_Manuals/ServerIron_SwitchRouterGuide/STP.pdf
http://www.cisco.com/en/US/docs/switches/lan/catalyst4500/12.1/8aew/configuration/guide/spantree.html#wp1020334


you cant wrap code in color, first actual change is to move the root where I want it
Code:

root@Main:~# brctl setbridgeprio br0 99



Code:

root@Main:~# brctl showstp br0
br0
 bridge id              0063.xxxxxxxxxxxx
 designated root        0063.xxxxxxxxxxxx
 root port                 0                    path cost                  0
 max age                  20.00                 bridge max age            20.00
 hello time                2.00                 bridge hello time          2.00
 forward delay             1.00                 bridge forward delay       1.00
 ageing time             300.00
 hello timer               1.81                 tcn timer                  0.00
 topology change timer     0.00                 gc timer                   0.81
 flags


vlan1 (1)
 port id                8001                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      0063.xxxxxxxxxxxx       message age timer          0.00
 designated port        8001                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.81
 flags

eth1 (2)
 port id                8002                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      0063.xxxxxxxxxxxx       message age timer          0.00
 designated port        8002                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.81
 flags

wds0.1 (3)
 port id                8003                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      0063.xxxxxxxxxxxx       message age timer          0.00
 designated port        8003                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.81
 flags

wds0.2 (4)
 port id                8004                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      0063.xxxxxxxxxxxx       message age timer          0.00
 designated port        8004                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.81
 flags

root@Main:~#



root@Mid:~# brctl showstp br0
br0
 bridge id              8000.xxxxxxxxxxx1
 designated root        0063.xxxxxxxxxxxx
 root port                 4                    path cost                100
 max age                  20.00                 bridge max age            20.00
 hello time                2.00                 bridge hello time          2.00
 forward delay             1.00                 bridge forward delay       1.00
 ageing time             300.00
 hello timer               0.00                 tcn timer                  0.00
 topology change timer     0.00                 gc timer                   1.24
 flags


eth0 (1)
 port id                8001                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      8000.xxxxxxxxxxx1       message age timer          0.00
 designated port        8001                    forward delay timer        0.00
 designated cost         100                    hold timer                 0.23
 flags

vlan1 (2)
 port id                8002                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      8000.xxxxxxxxxxx1       message age timer          0.00
 designated port        8002                    forward delay timer        0.00
 designated cost         100                    hold timer                 0.23
 flags

wds0.1 (3)
 port id                8003                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      8000.xxxxxxxxxxx1       message age timer          0.00
 designated port        8003                    forward delay timer        0.00
 designated cost         100                    hold timer                 0.23
 flags

wds0.2 (4)
 port id                8004                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      0063.xxxxxxxxxxxx       message age timer         19.20
 designated port        8003                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.00
 flags

root@Mid:~#

root@Media:~# brctl showstp br0
br0
 bridge id              8000.xxxxxxxxxxx2
 designated root        0063.xxxxxxxxxxxx
 root port                 3                    path cost                200
 max age                  20.00                 bridge max age            20.00
 hello time                2.00                 bridge hello time          2.00
 forward delay             1.00                 bridge forward delay       1.00
 ageing time             300.00
 hello timer               0.00                 tcn timer                  0.12
 topology change timer     0.00                 gc timer                   1.08
 flags                  TOPOLOGY_CHANGE_DETECTED


eth0 (1)
 port id                8001                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      8000.xxxxxxxxxxx2      message age timer          0.00
 designated port        8001                    forward delay timer        0.00
 designated cost         200                    hold timer                 1.08
 flags

vlan1 (2)
 port id                8002                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      8000.xxxxxxxxxxx2      message age timer          0.00
 designated port        8002                    forward delay timer        0.00
 designated cost         200                    hold timer                 1.08
 flags

wds0.1 (3)
 port id                8003                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      8000.xxxxxxxxxxx1       message age timer         19.36
 designated port        8003                    forward delay timer        0.00
 designated cost         100                    hold timer                 0.00
 flags

root@Media:~#




And we can now see that the ASUS xxxxxxxxxxxx is the designated root across all three devices
and the path cost to get to the root from the Media router is 200 (link1 plus link2)

now I want link3 to be less preferred so I want to make it's cost higher than the natural 100 (cost of link1 directly back to the root)
but first i have to figure out which link is which.. hmm. that is stored in the nvram variables

so in Main

Code:

root@Main:~# nvram show | grep wds[23]_ | sort
wl0_wds2_desc=Mid
wl0_wds2_enable=3
wl0_wds2_hwaddr=xx:xx:xx:xx:xx:x1
wl0_wds2_if=wds0.1
wl0_wds2_ipaddr=
wl0_wds2_netmask=
wl0_wds2_ospf=
wl0_wds3_desc=Media
wl0_wds3_enable=3
wl0_wds3_hwaddr=xx:xx:xx:xx:xx:x2
wl0_wds3_if=wds0.2
wl0_wds3_ipaddr=
wl0_wds3_netmask=
wl0_wds3_ospf=


I see that the one I am interested in is wds0.2
so my command is

My second change was to make the cost of link three higher than the cost of link1 plus link2 (201) would have worked to but I am big on round numbers
This is the first of two, I adjust the cost it on both sides of the connection,because I am a symmetric type of guy

Code:

root@Main:~#brctl setpathcost br0 wds0.2 300


Code:

root@Main:~# brctl showstp br0
br0
 bridge id              0063.xxxxxxxxxxxx
 designated root        0063.xxxxxxxxxxxx
 root port                 0                    path cost                  0
 max age                  20.00                 bridge max age            20.00
 hello time                2.00                 bridge hello time          2.00
 forward delay             1.00                 bridge forward delay       1.00
 ageing time             300.00
 hello timer               0.69                 tcn timer                  0.00
 topology change timer     0.00                 gc timer                   0.69
 flags


vlan1 (1)
 port id                8001                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      0063.xxxxxxxxxxxx       message age timer          0.00
 designated port        8001                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.00
 flags

eth1 (2)
 port id                8002                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      0063.xxxxxxxxxxxx       message age timer          0.00
 designated port        8002                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.00
 flags

wds0.1 (3)
 port id                8003                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                100
 designated bridge      0063.xxxxxxxxxxxx       message age timer          0.00
 designated port        8003                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.00
 flags

wds0.2 (4)
 port id                8004                    state                forwarding
 designated root        0063.xxxxxxxxxxxx       path cost                300
 designated bridge      0063.xxxxxxxxxxxx       message age timer          0.00
 designated port        8004                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.00
 flags

root@Main:~#



now I have to enable the WDS port in the Media router so I can see it's port name
so we do that in the GUI

repeat the

Code:

root@Media:~# nvram show | grep wds[12]_ | sort
wl0_wds1_desc=Main
wl0_wds1_enable=3
wl0_wds1_hwaddr=xx:xx:xx:xx:xx:xx
wl0_wds1_if=wds0.1
wl0_wds1_ipaddr=
wl0_wds1_netmask=
wl0_wds1_ospf=
wl0_wds2_desc=Mid
wl0_wds2_enable=3
wl0_wds2_hwaddr=xx:xx:xx:xx:xx:x1
wl0_wds2_if=wds0.2
wl0_wds2_ipaddr=
wl0_wds2_netmask=
wl0_wds2_ospf=


and we see it is wds0.1 now.
order is important this value will change based on where on the list it lies
be careful when adding and disabling values on the webpage, these will move about and may cause unintended side effects.



Here we cost the Media side of the Media-Main Link3
Code:

root@Media:~#brctl setpathcost br0 wds0.1 300


Code:

root@Media:~# brctl showstp br0
br0
 bridge id      8000.xxxxxxxxxxx2
 designated root   0063.xxxxxxxxxxxx
 root port         4         path cost       200
 max age        20.00         bridge max age        20.00
 hello time         2.00         bridge hello time      2.00
 forward delay         1.00         bridge forward delay      1.00
 ageing time       300.00
 hello timer         0.00         tcn timer         0.04
 topology change timer      0.00         gc timer       105.30
 flags

eth0 (1)
 port id      8001         state           forwarding
 designated root   0063.xxxxxxxxxxxx   path cost       100
 designated bridge   8000.xxxxxxxxxxx2   message age timer      0.00
 designated port   8001         forward delay timer      0.00
 designated cost    200         hold timer         0.66
 flags         

vlan1 (2)
 port id      8002         state           forwarding
 designated root   0063.xxxxxxxxxxxx   path cost       100
 designated bridge   8000.xxxxxxxxxxx2   message age timer      0.00
 designated port   8002         forward delay timer      0.00
 designated cost    200         hold timer         0.66
 flags         

wds0.1 (3)
 port id      8003         state             blocking
 designated root   0063.xxxxxxxxxxxx   path cost       300
 designated bridge   0063.xxxxxxxxxxxx   message age timer      3.41
 designated port   8004         forward delay timer      0.00
 designated cost      0         hold timer         0.00
 flags         

wds0.2 (4)
 port id      8004         state           forwarding
 designated root   0063.xxxxxxxxxxxx   path cost       100
 designated bridge   8000.xxxxxxxxxxx1   message age timer      2.40
 designated port   8003         forward delay timer      0.00
 designated cost    100         hold timer         0.00
 flags         

root@Media:~#




Some References
http://www.faqs.org/docs/Linux-HOWTO/BRIDGE-STP-HOWTO.html#STP
http://linux.die.net/man/8/brctl
http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge

setageing <bridge> <time> set ageing time (Default 300 seconds)
Sets the aging time. The aging time is the number of seconds a MAC-address will be kept in the forwarding database after having received a packet from this MAC address. The entries in the forwarding database are periodically timed out to ensure they won't stay around forever. Normally there should be no need to modify this parameter.
sets the ethernet (MAC) address ageing time, in seconds. After <time> seconds of not having seen a frame coming from a certain address, the bridge will time out (delete) that address from the Forwarding DataBase (fdb).

setbridgeprio <bridge> <prio> set bridge priority (default 100, lower is more preferred, industry standard default is 32768)
Sets the bridge's relative priority. The bridge with the lowest priority will be elected as the root bridge. The root bridge is the "central" bridge in the spanning tree.
sets the bridge's priority to <priority>. The priority value is an unsigned 16-bit quantity (a number between 0 and 65535), and has no dimension. Lower priority values are 'better'. The bridge with the lowest priority will be elected 'root bridge'.

setfd <bridge> <time> set bridge forward delay (default is 1, should be 4)
Sets the forwarding delay time. The forwarding delay time is the time spent in each of the Listening and Learning states before the Forwarding state is entered.
sets the bridge's 'bridge forward delay' to <time> seconds

sethello <bridge> <time> set hello time (default is 2, can be 1)
Sets the hello time. Every (this number) seconds, a hello packet is sent out by the Root Bridge and the Designated Bridges. Hello packets are used to communicate information about the topology throughout the entire Bridged Local Area Network.
sets the bridge's 'bridge hello time' to <time> seconds

setmaxage <bridge> <time> set max message age (default is 20, w/hello at 1, can be 4)
Sets the maximum message age. If the last seen (received) hello packet is more than this number of seconds old, the bridge in question will start the takeover procedure in attempt to become the Root Bridge itself.
sets the bridge's 'maximum message age' to <time> seconds

setpathcost <bridge> <port> <cost> set path cost (default is 100, higher is less preferred)
Sets the cost of receiving (or sending, I'm not sure) a packet on this interface. Faster interfaces should have lower path costs. These values are used in the computation of the minimal spanning tree. Paths with lower costs are likelier to be used in the spanning tree than high-cost paths (As an example, think of a gigabit line with a 100Mbit or 10Mbit line as a backup line. You don't want the 10/100Mbit line to become the primary line there.)
The Linux implementation currently sets the path cost of all eth* interfaces to 100, the nominal cost for a 10Mbit connection. There is unfortunately no easy way to discern 10Mbit from 100Mbit from 1Gbit Ethernet cards, so the bridge cannot use the real interface speed.
sets the port cost of the port <port> to <cost>. This is a dimensionless metric.

setportprio <bridge> <port> <prio> set port priority
sets the port <port>'s priority to <priority>. The priority value is an unsigned 8-bit quantity (a number between 0 and 255), and has no dimension. This metric is used in the designated port and root port selection algorithms. You use this one to distinguish between two equal cost ports.


To get mine to be stable and responsive to topology changes
I tweaked it as follows
I set the Hello to every one second vs two seconds, to make it detect a topology change faster
I changed the maximum age from twenty seconds to four seconds to make it refresh the topology more often.
I set the Forwarding delay to four seconds vs one second, to make it wait longer before participating in a STP domain

in the startup commands I put the following
Saved each,
then rebooted Main, Mid, and Media in sequence to make sure all were working from the same instructions

Code:
 Main
/usr/sbin/brctl sethello br0 1
/usr/sbin/brctl setmaxage br0 4
/usr/sbin/brctl setfd br0 4
/usr/sbin/brctl setbridgeprio br0 99
/usr/sbin/brctl setpathcost br0 wds0.2 300


Code:
 Mid
/usr/sbin/brctl sethello br0 1
/usr/sbin/brctl setmaxage br0 4
/usr/sbin/brctl setfd br0 4


Code:
 Media
/usr/sbin/brctl sethello br0 1
/usr/sbin/brctl setmaxage br0 4
/usr/sbin/brctl setfd br0 4
/usr/sbin/brctl setpathcost br0 wds0.1 300

[/color]

hopped back in on the command line
and looked at the spanning tree to ensure I was seeing what I expected.

Now she is up and stable
to test
i took a wireless client from on the Media router
started a streaming ping to google

removed power from the Mid router
she took about 30 seconds to switch paths

restored power to the Mid router
long pause while she booted while the ping was successful
then ping stopped for about 2 mins
then restored via the Mid router

removed power again from Mid router
ping stopped for about 2 mins
then restored over link3

restored power again to the Mid router
long pause while she booted while the ping was successful
then ping stopped for about 30 seconds
then restored via the Mid router

not exactly a scientific test but she sufficed for my purposes.
I can fail to an alternate path in less than 3 minutes if one of my routers go down.
Which is really good for consumer applications.


Last edited by nariub on Sun Sep 04, 2011 15:09; edited 1 time in total
GeeTek
DD-WRT Guru


Joined: 06 Jun 2006
Posts: 3763
Location: I'm the one on the plate.

PostPosted: Sun Sep 04, 2011 0:26    Post subject: Reply with quote
Thank you, that is very nice. I'll fix up a little diagram in Visio and then see about adding everything to the WiKi.

Edit - How does this diagram look ? Too large ?



WDS.png
 Description:
 Filesize:  72.47 KB
 Viewed:  20381 Time(s)

WDS.png



_________________
http://69.175.13.131:8015 Streaming Week-End Disco. Station Ripper V 1.1 will do.
GeeTek
DD-WRT Guru


Joined: 06 Jun 2006
Posts: 3763
Location: I'm the one on the plate.

PostPosted: Sun Sep 04, 2011 1:21    Post subject: Reply with quote
Do you think this should go in the STP Wiki, or maybe a new entry under WDS ? "WDS Mesh Script" perhaps ?
_________________
http://69.175.13.131:8015 Streaming Week-End Disco. Station Ripper V 1.1 will do.
nariub
DD-WRT Novice


Joined: 31 Mar 2011
Posts: 20

PostPosted: Sun Sep 04, 2011 4:11    Post subject: Reply with quote
Spanning Tree is Spanning Tree.
It's where I looked for information on how to query STP on the device to find out what was going on.

you could put a note on the WDS pages regarding MESH-> see STP.. because MESH WDS is really gonna need an understanding of STP.

but this note illustrates an investigation and configuration of STP via tools not available in the UserInterface.

if i had my druthers,
i would have liked root bridge priorty default set to industry standards and exposed on the routing/bridge tab. forward delay and others would be nice too.

I would also like the path cost exposed on the WDS page so the user interface would work out which is wds0.1 and which is wds0.2, etc because my way seems a little horky if i have several in there and choose to disable one high on the list. I now gotta go in and bump all the interface costs down one.

but the picture is fine. large but fine.

Again it is an exercise in command line STP, Applicable to other stuff than just WDS.
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Sun Sep 04, 2011 4:58    Post subject: Reply with quote
GeeTek, please advise when the wiki is setup.

Thanks.

_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
GeeTek
DD-WRT Guru


Joined: 06 Jun 2006
Posts: 3763
Location: I'm the one on the plate.

PostPosted: Sun Sep 04, 2011 5:01    Post subject: Reply with quote
OK, it is posted. I couldn't get my artwork to take, but your stick diagram looks better anyway. Let me know of any changes it might need.
_________________
http://69.175.13.131:8015 Streaming Week-End Disco. Station Ripper V 1.1 will do.
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Sun Sep 04, 2011 5:08    Post subject: Reply with quote
Just checked, couldnt find it under "WDS Mesh". I should probably wait till tomorrow to see it posted.

Will try it out and report on findings in a e3000 and WRT610n hybird environment.

_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
GeeTek
DD-WRT Guru


Joined: 06 Jun 2006
Posts: 3763
Location: I'm the one on the plate.

PostPosted: Sun Sep 04, 2011 5:17    Post subject: Reply with quote
Do the commands ( not the scripts ) need an NVram commit to make them survive a reboot ?

ndewan wrote:
Just checked, couldnt find it under "WDS Mesh".

I can't seem to edit any menus without screwing something else up. The STP entry should suffice.

Edit -
Also, could we label each of the actual changes with a step number ? For the mentally challenged such as myself it may not be clear which data is effecting system changes versus what is informational. If you want, just edit your post to make the commands that change something, and the start up scripts, to be red text and then I'll add step numbers to the WiKi.

I'll also fix the BOLD text tomorrow. The HTML did not survive the copy / paste.

_________________
http://69.175.13.131:8015 Streaming Week-End Disco. Station Ripper V 1.1 will do.
nariub
DD-WRT Novice


Joined: 31 Mar 2011
Posts: 20

PostPosted: Sun Sep 04, 2011 15:18    Post subject: Reply with quote
some formatting issues at the beginning.
no new line between the device descriptions (main, mid, media all on new lines)

the code sections seem to be mudging the first line of text
examples
brctl show command
brctl show br0

mostly formatting and readabiliy.

Edit
No the brctl commands are immediate
they are not nvram commands and do not need a commit


Last edited by nariub on Sun Sep 04, 2011 16:16; edited 1 time in total
nariub
DD-WRT Novice


Joined: 31 Mar 2011
Posts: 20

PostPosted: Sun Sep 04, 2011 16:13    Post subject: Reply with quote
Generalized
if you have less than three devices,
the default options should suffice

if you have three or more
query the native state of the bridge on each device, this will tell you what STP wants to do if left to its own devices.

I then suggest
Move the root bridge to the WAN facing router
(and add the command to the startup to make it permanent)

query the bridge on each device, to ensure they all still agree on who the root bridge is.


now it gets progressively more complicated
remember three devices equals three links
four devices will be six links
five devices will be ten links


Make a diagram of the devices and links
stare at it and try to find a loop free topology on your diagram

Failure analysis
now imagine if any one of your devices fail, what is the impact on your topology, what alternative path do you want it to use.
depending on how retentive you are,
repeat for each single device failure
repeat for any two devices, any three, etc until you get below two devices. at two devices we revert to it doesnt really matter that much any

since none of these are physically wired links, you dont have to repeat the above procedure for each defined link, or 2links or 3links, etc

based on the failure analysis
create a path cost plan that will support your topology and failover plan. (anyone see the advantage of small spanning tree domains yet?)

Remember you can you port cost or port priority
i am symmetrical about port cost, adding the same cost to both side of the link

port priority is used when links are the same cost it prefers one over the other. default is zero

my example above,
i could have simply changed port priority of link3 on the Media router if that was the only criteria. but the cost to the root via link3 was 100, the cost to the root via link2 was 200. In order to get priority to work, i would have had to recost link3 to 200 -and- set the priority to 1. I am a minimalist in this regard, why make two changes when one will suffice.

technically these are all locally significant, meaning i did not have to set the port cost on the root bridge (main).. i did because i have an addiction to symmetry. it is a personal issue i have battled all my life.


Enable all the WDS links on one device at a time, (this will allow you to use the nvram commands to see which wds0.X each of these are.
Write this down

Disable all the WDS links before leaving the device


define your plan,
put your commands for link costing in the startup config (admin > commands > startup) save config

(if you want to change hello/fwd delay/mess age you need to do this now too)

reboot all your devices

Enable all the WDS links on each device, and reboot

as they come up from the second reboot
they will come up with the WDS costing and hopefully the topology you desire

Query the devices to see if your settings took

Perform testing
based on your Failure analysis
fail each device, 2 devices, 3 devices etc
to see if she recovers on the backup path(s)
This also serves to tell you what your baseline recovery times are.

save your drawings/notes, device configs, log files etc. So you can rebuild it when sunspots destroy all your household electronics that survived the zombie attacks
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum