Hi Vitali,
I have written a set of utilities which are useful for mstpd. Since we support only STP/RSTP for now, I havent added support for MSTP related commands in the utilities. Would you like me to attach the patch files for the utilities as is, or would you like me to extend support for MSTP too and then attach them below? Please let me know.
All these utilities except the restart one, are similar to existing bridge-utils
The utilities are:
1. Helper ifupdown scripts for mstpctl, so that mstpctl configuration can be present in /etc/network/interface and configuration would be replayed at bootup/networking stop/start.
2. Bash completion script
3. Helper restart script which can be invoked from init.d file for mstpd to add the bridge in mstpctl and replay mstpctl configuration by parsing the /etc/network/interfaces file
4. Man pages for mstpctl and mstpctl-utils-interfaces
Thanks,
Satish
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Vitali,
I have added the files as attachments below.
For the ifupdown script, the idea was to use either bridge_ports or mstpctl_ports in /etc/network/interfaces file and not both, so there was some replication of the code which is already present in bridge-utils-interfaces file.
Please let me know if you have any questions regarding the changes..
Please feel free to change it appropriately for MSTP.
The idea was to just specify the following in interfaces file.
Naturally, I have some modifications to the man pages. The main changes are:
1) MSTP is fully supported by mstpd/mstpctl, it is not supported only by interface extension scripts (ifupdown). I have stated this point clearly;
2) Priority description reflects current status: priorities are in range 0-15. in natural units. When/if I'll be convinced that priorities should be in multiplies of 16/4096, we'll change the man pages accordingly. Perhaps, they'll be generated differently based on the conditional variable from the makefile. For now, they should describe things as they are;
Please, review the following patch and tell me if you agree with the changes:
Index: lib/bash_completion===================================================================--- lib/bash_completion (revision 50)+++ lib/bash_completion (working copy)@@ -16,7 +16,7 @@
setportautoedge setportp2p setportrestrrole setportrestrtcn \
setbpduguard settreeportprio settreeportcost showbridge \
showmstilist showmstconfid showvid2fid showfid2mstid showport \
- showportdetail showtree showtreeport showall \+ showportdetail showtree showtreeport \
sethello setageing setportnetwork" -- "$cur" ) )
;;
2)
Index: lib/mstpctl-utils-interfaces.5===================================================================--- lib/mstpctl-utils-interfaces.5 (revision 50)+++ lib/mstpctl-utils-interfaces.5 (working copy)@@ -29,7 +29,8 @@
.P
The main extension is the mstpctl_ports option, with it you describe that the
interface is a bridge and what ports does it have. Spanning Tree protocol
-paramaters can also be specified.+parameters can also be specified.+Currently multiple spanning trees are not supported by this extension (although mstpd/mstpctl supports MSTP without restrictions). This means that all settings here are applied to the CIST tree.
.P
We'll see this with an example:
.EX
@@ -81,67 +82,59 @@
.SS
.TP
.BI mstpctl_maxage " time"
-set max message age to \fItime\fP seconds, default is 20, can have a-fractional part.+set max message age to \fItime\fP seconds, default is 20.
.TP
.BI mstpctl_fdelay " time"
set bridge forward delay to \fItime\fP seconds, default is 15.
.TP
.BI mstpctl_maxhops " max_hops"
-set bridge maximum hops to \fImax_hops\fP, default is 15.+set bridge maximum hops to \fImax_hops\fP, default is 20.
.TP
.BI mstpctl_forcevers " mstp|rstp|stp"
-sets the bridge's force STP version to either rstp/stp. mstp is-not supported currently, default is rstp.+forces the bridge to use specific STP protocol version. mstp is the default.
.TP
.BI mstpctl_txholdcount " tx_hold_count"
set bridge transmit hold count to \fItx_hold_count\fP, default is 6.
.TP
.BI mstpctl_treeprio " priority"
-set bridge tree priority, \fIpriority\fP is between 0 and 65535,-is a multiple of 4096 and default is 32768. Bridge priority affects-bridge id, lowest priority bridge will be the root.+set bridge tree priority, \fIpriority\fP is between 0 and 15. Bridge priority affects bridge id, lowest priority bridge will be the root. Note that traditionally bridge priority is a multiple of 4096 and ranges from 0 to 15*4096 = 61440. mstpd is different - it throws out that useless "multiple of 4096" rule and expresses bridge priority in natural units (0-15). Default is 8.
.TP
.BI mstpctl_portpathcost " port cost"
-set path cost for a port, default is 0, \fIport\fP is the name of+set path cost for a port, default is 0 (= auto), \fIport\fP is the name of
the interface to which this setting applies.
.TP
.BI mstpctl_portadminedge " port yes|no"
-Enables/disables the initial edge state of the port <port>, default is no.+Enables/disables the admin edge state of the \fIport\fP, default is no.
.TP
.BI mstpctl_portautoedge " port yes|no"
-Enables/disables the auto transition to/from edge state of the port <port>,+Enables/disables the auto transition to/from edge state of the \fIport\fP,
default is no.
.TP
-.BI mstpctl_portp2p " port yes|no"-Enables/disables the point2point detection mode of the port <port>,-default is no.+.BI mstpctl_portp2p " port yes|no|auto"+Enables/disables the point2point detection mode of the \fIport\fP,+default is auto.
.TP
.BI mstpctl_portrestrrole " port yes|no"
-Enables/disables the port ability to take root role of the port <port>,-default is no.+Enables/disables the restrictions on the \fIport\fP's ability to take root role,+default is no (i.e. no restrictions on the port's role).
.TP
.BI mstpctl_portrestrtcn " port yes|no"
-Enables/disables the port ability to propagate received topology change-notification of the port <port>, default is no.+Enables/disables the restrictions on the \fIport\fP's ability to propagate received topology change notification, default is no (i.e. no restrictions on the TCN propagation).
.TP
.BI mstpctl_bpduguard " port yes|no"
-Enables/disables the bpduguard configuration of the port, default is no.+Enables/disables the bpduguard configuration of the \fIport\fP, default is no.
.TP
.BI mstpctl_treeportprio " port priority"
-sets the port <port>'s priority to <priority> for the MSTI instance.-The priority value is a number between 0 and 240, is a multiple of 16,-default is 128. Only MSTI 0 is supported currently.+sets the \fIport\fP's priority to \fIpriority\fP. The priority value is a number between 0 and 15. Note that traditionally port priority is a multiple of 16 and ranges from 0 to 15*16 = 240. mstpd is different - it throws out that useless "multiple of 16" rule and expresses port priority in natural units (0-15). Default is 8.
.TP
.BI mstpctl_hello " time"
set hello time to \fItime\fP seconds, default is 2.
.TP
.BI mstpctl_ageing " time"
-sets the ethernet (MAC) address ageing time, in seconds for the bridge-when the running version is STP, but not RSTP/MSTP, default is 300s.+sets the ethernet (MAC) address ageing \fItime\fP, in seconds. Used only when protocol version is forced to STP, default is 300s. Note that this parameter differs from the other ones: it is only informational parameter. By setting it in the mstpd one do not change the real bridge's Ageing Time; it is supposed to be set as information to the mstpd that real Ageing Time in the real bridge was changed.
.TP
.BI mstpctl_portnetwork " port yes|no"
-Enables/disables the bridge assurance capability for a network port <port>,+Enables/disables the bridge assurance capability for a \fIport\fP,
default is no.
.TP
.BI mstpctl_stp " state"
Index: lib/mstpctl.8===================================================================--- lib/mstpctl.8 (revision 50)+++ lib/mstpctl.8 (working copy)@@ -16,105 +16,88 @@
.\"
.TH MSTPCTL 8 "April 29, 2013" "" ""
.SH NAME
-mstpctl \- STP/RSTP/MSTP configuration+mstpctl \- mstpd configuration
.SH SYNOPSIS
.BR "mstpctl [command]"
.SH DESCRIPTION
.B mstpctl
-is used to configure Spanning Tree and Rapid Spanning Tree-configuration. Multiple Spanning Tree configuration is not supported-currently. MSTPCTL is used for configuring STP parameters on bridges-which have STP enabled. Currently, STP is disabled by default on the bridge.-To enable STP, configure "brctl stp <bridge> on".+is used to configure Multiple Spanning Tree daemon (mstpd). MSTPCTL is used for configuring STP parameters on bridges which have user-space STP enabled. Currently, STP is disabled by default on the bridge. To enable user-space STP, configure "brctl stp <bridge> on" while ensuring that /sbin/bridge-stp kernel helper script will return success (0) for this operation.
.SH SPANNING TREE PROTOCOL CONFIGURATION
.IR mstpctl(8)
can be used for configuring certain spanning tree protocol
parameters. For an explanation of these parameters, see the IEEE
-802.1D and 802.1Q specification .+802.1D-2004 and 802.1Q-2005(-2011) standards.
.B mstpctl setmaxage <bridge> <max_age>
-sets the bridge's 'maximum age' to <time> seconds.+sets the <bridge>'s 'maximum age' to <max_age> seconds, default is 20.
.B mstpctl setfdelay <bridge> <time>
-sets the bridge's 'bridge forward delay' to <time> seconds.+sets the <bridge>'s 'forward delay' to <time> seconds, default is 15.
.B mstpctl setmaxhops <bridge> <max_hops>
-sets the bridge's 'maximum hops' to <max_hops>.+sets the <bridge>'s 'maximum hops' to <max_hops>, default is 20.
.B mstpctl setforcevers <bridge> {mstp|rstp|stp}
-sets the bridge's force STP version to either rstp/stp. mstp is-not supported currently.+forces the <bridge> to use specific STP protocol version. mstp is the default.
.B mstpctl settxholdcount <bridge> <tx_hold_count>
-sets the bridge's 'bridge transmit hold count' to <tx_hold_count>.+sets the <bridge>'s 'transmit hold count' to <tx_hold_count>.
.B mstpctl settreeprio <bridge> <mstid> <priority>
-sets the bridge tree priority to <priority> for an MSTI instance.-Only mstid value 0 is supported currently. The priority value is a number-between 0 and 65535 and is a multiple of 4096. The bridge with the lowest-priority will be elected 'root bridge'.+set <bridge>'s priority for the tree with id = <mstid>, <priority> is between 0 and 15. Bridge priority affects bridge id, lowest priority bridge will be the (regional) root. Note that traditionally bridge priority is a multiple of 4096 and ranges from 0 to 15*4096 = 61440. mstpd is different - it throws out that useless "multiple of 4096" rule and expresses bridge priority in natural units (0-15). Default is 8.
.B mstpctl setportpathcost <bridge> <port> <cost>
-sets the port cost of the port <port> in bridge <bridge> to <cost>.+sets the port cost of the <port> in <bridge> to <cost>. Default is 0 (= auto).
.B mstpctl setportadminedge <bridge> <port> {yes|no}
-Enables/disables the initial edge state of the port <port> in bridge <bridge>.+Enables/disables the admin edge state of the <port> in <bridge>, default is no.
.B mstpctl setportautoedge <bridge> <port> {yes|no}
-Enables/disables the auto transition to/from edge state of the port <port> in-bridge <bridge>.+Enables/disables the auto transition to/from edge state of the <port> in <bridge>, default is no.
.B mstpctl setportp2p <bridge> <port> {yes|no|auto}
-Enables/disables the point2point detection mode of the port <port> in-bridge <bridge>.+Enables/disables the point2point detection mode of the <port> in <bridge>, default is auto.
.B mstpctl setportrestrrole <bridge> <port> {yes|no}
-Enables/disables the port ability to take root role of the port <port> in-bridge <bridge>.+Enables/disables the restrictions on the <port>'s ability to take root role in <bridge>, default is no (i.e. no restrictions on the port's role).
.B mstpctl setportrestrtcn <bridge> <port> {yes|no}
-Enables/disables the port ability to propagate received topology change-notification of the port <port> in bridge <bridge>.+Enables/disables the restrictions on the <port>'s ability to propagate received topology change notification in <bridge>, default is no (i.e. no restrictions on the TCN propagation).
.B mstpctl setbpduguard <bridge> <port> {yes|no}
-Enables/disables the bpduguard configuration of the port in bridge <bridge>.+Enables/disables the bpduguard configuration of the <port> in <bridge>, default is no.
.B mstpctl settreeportprio <bridge> <port> <mstid> <priority>
-sets the port <port>'s priority to <priority> for the MSTI instance.-The priority value is a number between 0 and 240 and is a multiple of 16.+sets the <port>'s priority in <bridge> to <priority> for the MSTI with id = <mstid>. The priority value is a number between 0 and 15. Note that traditionally port priority is a multiple of 16 and ranges from 0 to 15*16 = 240. mstpd is different - it throws out that useless "multiple of 16" rule and expresses port priority in natural units (0-15). Default is 8.
.B mstpctl sethello <bridge> <time>
-sets the bridge's 'bridge hello time' to <time> seconds.+sets the <bridge>'s 'hello time' to <time> seconds, default is 2.-.B mstpctl setageing <brname> <time>-sets the ethernet (MAC) address ageing time, in seconds for the bridge-when the running version is STP, but not RSTP/MSTP.+.B mstpctl setageing <bridge> <time>+sets the ethernet (MAC) address ageing <time>, in seconds, for the <bridge>. Used only when protocol version is forced to STP, default is 300s. Note that this parameter differs from the other ones: it is only informational parameter. By setting it in the mstpd one do not change the real bridge's Ageing Time; it is supposed to be set as information to the mstpd that real Ageing Time in the real bridge was changed.
.B mstpctl setportnetwork <bridge> <port> {yes|no}
-Enables/disables the bridge assurance capability for a network port <port> in-bridge <bridge>.+Enables/disables the bridge assurance capability for a <port> in <bridge>,+default is no.
.SH SPANNING TREE PROTOCOL SHOW COMMANDS
-.B mstpctl showbridge <brname>-will show information of the bridge.+.B mstpctl showbridge [<bridge>]+will show information of the <bridge>'s CIST instance. If <bridge> parameter is omitted - shows info for all bridges.-.B mstpctl showport <brname>-will show information of the bridge ports.+.B mstpctl showport <bridge> [<port>]+will show short (one-line) information about the <port> of the <bridge>'s CIST instance. If <port> parameters is omitted - shows info for all ports.-.B mstpctl showportdetail <brname>-will show detailed information of the bridge ports.+.B mstpctl showportdetail <bridge> [<port>]+will show detailed information about the <port> of the <bridge>'s CIST instance. If <port> parameters is omitted - shows info for all ports.-.B mstpctl showtree <brname> <mstid>-will show tree information of the bridge in MSTI instance.+.B mstpctl showtree <bridge> <mstid>+will show information of the <bridge>'s MST instance with id = <mstid>.-.B mstpctl showtreeport <brname> <port> <mstid>-will show per tree port information of the bridge port in MSTI instance.+.B mstpctl showtreeport <bridge> <port> <mstid>+will show detailed information about the <port> of the <bridge>'s MST instance with id = <mstid>.-.B mstpctl showall-will show detailed information of the bridge.-
.SH SEE ALSO
.BR brctl(8)
Hi Vitali,
I have written a set of utilities which are useful for mstpd. Since we support only STP/RSTP for now, I havent added support for MSTP related commands in the utilities. Would you like me to attach the patch files for the utilities as is, or would you like me to extend support for MSTP too and then attach them below? Please let me know.
All these utilities except the restart one, are similar to existing bridge-utils
The utilities are:
1. Helper ifupdown scripts for mstpctl, so that mstpctl configuration can be present in /etc/network/interface and configuration would be replayed at bootup/networking stop/start.
2. Bash completion script
3. Helper restart script which can be invoked from init.d file for mstpd to add the bridge in mstpctl and replay mstpctl configuration by parsing the /etc/network/interfaces file
4. Man pages for mstpctl and mstpctl-utils-interfaces
Thanks,
Satish
Please send them as-is, we can expand them later on.
Hi Vitali,
I have added the files as attachments below.
For the ifupdown script, the idea was to use either bridge_ports or mstpctl_ports in /etc/network/interfaces file and not both, so there was some replication of the code which is already present in bridge-utils-interfaces file.
Please let me know if you have any questions regarding the changes..
Please feel free to change it appropriately for MSTP.
The idea was to just specify the following in interfaces file.
auto br0
iface br0 inet static
address 12.0.0.3
netmask 255.255.255.0
mstpctl_ports swp1 swp2 swp3
mstpctl_stp on
mstpctl_maxage 20
mstpctl_fdelay 15
mstpctl_maxhops 20
mstpctl_txholdcount 6
mstpctl_forcevers rstp
mstpctl_portpathcost swp1=0 swp2=0
mstpctl_portadminedge swp1=no swp2=no
mstpctl_portautoedge swp1=yes swp2=yes
mstpctl_portp2p swp1=no swp2=no
mstpctl_portrestrrole swp1=no swp2=no
mstpctl_bpduguard swp1=no swp2=no
mstpctl_portrestrtcn swp1=no swp2=no
mstpctl_treeprio 32768
mstpctl_treeportprio swp3=128
mstpctl_hello 2
mstpctl_portnetwork swp1=no
Thanks,
Satish
Last edit: Satish Ashok 2013-06-25
Hi Satish!
Applied as revision [r50], thanks!
Naturally, I have some modifications to the man pages. The main changes are:
1) MSTP is fully supported by mstpd/mstpctl, it is not supported only by interface extension scripts (ifupdown). I have stated this point clearly;
2) Priority description reflects current status: priorities are in range 0-15. in natural units. When/if I'll be convinced that priorities should be in multiplies of 16/4096, we'll change the man pages accordingly. Perhaps, they'll be generated differently based on the conditional variable from the makefile. For now, they should describe things as they are;
Please, review the following patch and tell me if you agree with the changes:
Vitalii
Related
Commit: [r50]
Hi Vitali,
Thanks for committing the utilities.. The changes for the man_pages looks good.
Thanks,
Satish
Applied as revision [r54], thanks for the review!
Vitalii
Related
Commit: [r54]