Abstract:
The invention provides a method and apparatus for managing operation of a spanning tree protocol process in a network bridge. This comprises setting the network bridge to either an active mode or a defer mode in which a spanning tree protocol process is not run in response to a triggering event. The system remains in the defer mode for a period of time in which no further operations of the state machines will take place, before reverting to the active mode and normal processing of triggering events is carried out.

Description:
CROSS REFERENCE TO RELATED APPLICATIONS 
       [0001]    The present application claims priority to UK Patent Application No. 1405776.4 filed Mar. 31, 2014, the entirety of the disclosure of which is expressly incorporated herein by reference. 
       STATEMENT RE: FEDERALLY SPONSORED RESEARCH/DEVELOPMENT 
       [0002]    Not Applicable. 
       FIELD OF THE INVENTION 
       [0003]    The present invention relates to operation of a Spanning Tree Protocol and in particular how the protocol is operated under different loads. 
       BACKGROUND OF THE INVENTION 
       [0004]    The Spanning Tree Protocol is a network protocol which is designed to maintain a loop-free topology in a bridged local area network. A family of spanning tree protocols is defined in IEEE 802.1D and IEEE 802.1Q, the content of which is incorporated herein. These protocols are widely deployed in Ethernet networks. The family of Spanning Tree Protocols includes the original Spanning Tree Protocol (STP), Rapid Spanning Tree Protocol (RSTP) and Multiple Spanning Tree Protocol (MSTP). RSTP is an extension of the original STP and provides significantly faster conversions after a change in the topology of a network. MSTP is a further extension to RSTP to allow it to construct different active topologies for different VLANs which can be useful for load balancing traffic. The configuration and operation of these protocols is defined by the IEEE standards mentioned above as a series of interconnected state machines.  FIG. 1  shows FIG. 13-13 from IEEE 802.1Q-2011 (page 354). This figure shows the series of interconnected state machines used to operate the STP protocols. 
         [0005]    The basic function of the Spanning Tree Protocol is to allow the bridges of a Bridged Local Area Network (referred to as a network herein) to collectively determine a spanning tree for controlling communication across the network. Such a spanning tree ensures that there are unique paths between all bridges on the network and avoids the formation of loops. Loops are particularly disadvantageous in such networks as frames can end up being endlessly switched around the network leading to saturation of the network capacity and potentially complete failure of the network. It is therefore extremely important that such loops are avoided. 
         [0006]    The Spanning Tree Protocol is therefore used to establish a spanning tree based on the current layout and state of the elements of a network. However, the topology of a network can change. The removal of a bridge from a network or even the disabling of one port on a bridge, may result in the path between two elements on the network being removed. It would therefore be necessary for the spanning tree to be modified or recalculated to provide an alternative link path between each of the elements of the network to allow continued communication between them. This active responsiveness to changes in topology requires active monitoring and maintenance using the Spanning Tree Protocol. 
         [0007]    As indicated above, the bridges collectively compute the spanning tree, with each bridge making its own calculations to determine which ports on that bridge are used for what purpose. Each bridge will therefore have to run the state machines shown in  FIG. 1  in order to establish how it should manage its own ports. It will then communicate with other bridges in the network using special frames called Bridge Protocol Data Units (BPDUs) to exchange information about themselves and the network with other bridges in the network. 
         [0008]    For example, the network initially needs to determine a root bridge which acts as the root of the spanning tree. Once the root bridge has been determined, each bridge then determines the least cost path to the root bridge, to establish which port is connected to the path that has the least cost to the root bridge. That port is then determined as the root port and communication with the root bridge will be made through that port. 
         [0009]    For each Local Area Network (LAN) connected to ports on two or more bridges, it is necessary to determine a designated port for that LAN on a suitable bridge. Thus for a given LAN connected to two or more bridges, one of the ports on one of the bridges will be determined to be the designated port for that LAN and communication between that LAN and the root bridge will pass through the designated port. For each LAN, if the bridge with the port selected as the designated port for that LAN has any other ports to the same LAN, these ports are determined to be backup ports. Once the root ports, designated ports and backup ports have been determined, the remaining ports will normally be selected as alternate ports (although some versions of the standard allow different port roles to be defined). Ports with roles Alternate or Backup are blocked, meaning that frames are not switched through those ports. 
         [0010]    The configuration of the spanning tree for a given network is defined in detail in the IEEE standards mentioned above. 
         [0011]    From the above, it will be apparent that when a network is initially configured or when the topology has changed, a significant amount of calculation must be done to establish the correct states for the bridge and its ports. This is done by running the state machines shown in  FIG. 1 , as defined in the IEEE standard. As part of this, a considerable amount of information must be exchanged between the bridges so that each bridge can collect suitable information about which bridge is to be the root, the path cost to the root and so on. In order to establish the state of the bridges, the state machines in each bridge run until they reach a stable state. Once the state machines in all the bridges are stable, then it can be said that the network has reached steady state, at that moment in time. 
         [0012]    However such a stable state may be disturbed by some event which requires the status of the spanning tree state machines to be reviewed, for example the reception of an external input such as a timer pop, a received packet, or a port going down. The reference to an “external input” refers to inputs which are external to the spanning tree state (e.g. a timer pop is internal to the bridge but external to the state machines). Such input events cause the state machines to run again until they reach a stable state. 
         [0013]    It will be appreciated that when one or part of a network changes then this may trigger the state machines in one bridge to run and potentially determine a different set of conditions/states. This will be communicated using BPDU frames to advise the other bridges in the network of the change in its state. The reception of such frames by other bridges will cause them to run their own state machines until they again reach a stable state based on the newly received information. It will be appreciated that the changes may create a cascade of changes of state in other bridges as each of the bridges recalculate their own states and issue BPDU frames to other bridges which in turn cause them to calculate their own state and so on. 
         [0014]    This creates a substantial load on the controllers within each of the bridges that have to operate the state machines. As the state machines run in response to external inputs, if the level of such inputs increases, as they will when the network is under higher load, this increased load can lead to substantial degradation in the performance of the Spanning Tree Protocol. This effect is particularly noticeable as the number of ports on a given bridge is increased. 
         [0015]    The non-linear degradation in performance relative to the number of ports on a bridge is explained below with reference to the  FIG. 1 , which shows the various state machines that operate when the bridge state has to be recalculated. 
         [0016]    Firstly, a larger number of ports means there will be a larger number of external inputs (such as per-port timer pops). Secondly, in a single bridge, where an external input has caused the state machines to be run, it will be appreciated that the amount of work increases with the number of ports. For example, some of the state machines that have to be run in order to return the bridge to a stable state are required to be run for each of the ports on the bridge. 
         [0017]    Additionally, looking at  FIG. 1 , when the Port Role Selection (PRS) state machine (shown in the centre of  FIG. 1 ) runs, it examines all ports on the bridge. Consequently the performance cost of running the PRS state machine increases as the number of ports on the bridge increases. Similarly, procedures such as SetSyncTree( ) within the Port Role Transitions (PRT) state machine (shown below the PRS state machine in  FIG. 1 ) also examines all the ports on the bridge and so its performance is also related to the number of ports. 
         [0018]    It will therefore be appreciated that if there are a large number of external events (i.e. the system is under load), particularly for a bridge having a large number of ports, the amount of time spent running the spanning tree state machines is significant. Additionally, if there are a large number of ports on the bridge then the total input events from all of these ports results in an increased load and further degradation in the performance for the establishment of a stable spanning tree. 
         [0019]    Slow performance of one bridge within the network is bad for the overall network because if one node becomes overloaded, it may delay both sending BPDU frames and processing received BPDU frames. This can have a knock-on effect around the rest of the network with the end result that the whole network is overloaded and potentially the network becoming practically inoperable. 
         [0020]    It is therefore an aim of the present invention to overcome or at least ameliorate some of the problems referred to above. 
       SUMMARY OF THE INVENTION 
       [0021]    Therefore, according to the present invention there is provided a method for managing operation of a in a network bridge, the method comprising: setting the network bridge to either: an active mode, in which said spanning tree protocol process is run in response to a triggering event; or a defer mode in which said spanning tree protocol process is not run immediately in response to a triggering event; and reverting from said defer state to said active mode after a delay period. 
         [0022]    By setting a defer mode, the operation of the network bridge can continue without having to carry out the spanning tree protocol process in response to every triggering event. This means that the operation of the network bridge and the spanning tree operation can continue with a reduced work load. This helps to reduce delays in the system which could lead to slow running of the network or worse. 
         [0023]    The defer mode is preferably set in response to running of the spanning tree protocol process. This means that once a spanning tree process is run, it will not run again until the defer mode has been reverted back to active mode after the delay period. 
         [0024]    The delay period is preferably based upon the load on the network bridge. The load on the network bridge can be determined in different ways. For example, the delay period may be based upon the number of pending tasks in a queue on the network bridge when the defer mode is set. Alternatively, the delay period may be a fixed period of time. The fixed period may be altered periodically based on the load. 
         [0025]    When the defer mode is set, a new task can be added to the queue. By adding an item to the queue, other items in front of it in the queue are processed before the new task is reached. When the new item reaches the front of the queue, this can trigger ending of the delay period. In this way, the delay period is determined by the number of items in front of the new item in the queue and how long it takes to process those items, which reflects the load on the network bridge. 
         [0026]    The network bridge may include a token counter. The method may further comprise periodically increasing the value of the token counter, whilst it is less than a maximum value. The value of said token counter can be reduced when the spanning tree protocol process is run. The said defer mode can be set in response to running of the spanning tree protocol process when the token counter has a zero value, wherein the delay period corresponds to the period in which the token counter has a zero value. With this arrangement, the method limits the rate at which the spanning tree protocol process can be run under high load conditions but under lower load conditions, the process can be run immediately and for a short transient burst of work, the immediate running of the spanning tree protocol process can still be allowed. 
         [0027]    In the above arrangement, the rate at which the value of said token counter is periodically increased may be based on the maximum desired rate for running the spanning tree protocol process under high load conditions. 
         [0028]    The method of the present invention preferably further comprises storing any triggering events received when the defer mode is set, so that it can be processed when the spanning tree protocol process is run. In this way, if a number of triggering events have been received whilst the defer mode is set, when the spanning tree protocol process is run, any changes in state or state variables from each of the triggering events can be taken account of. 
         [0029]    In the invention, the running of the spanning tree protocol process preferably includes running a plurality of state machines to determine a stable state of the network bridge parameters. 
         [0030]    The present invention further provides a network bridge for operating a spanning tree protocol process, the bridge comprising: a controller arranged to run a spanning tree protocol process in response to a triggering event, wherein said network bridge can be set to be in either: an active mode, in which said processor runs a spanning tree protocol process run in response to a triggering event; or a defer mode in which a spanning tree protocol process is not run in response to a triggering event, and said controller is arranged to revert said network bridge from said defer mode to said active mode after a delay period. 
         [0031]    The controller is preferably arranged to set said defer mode in response to running of said spanning tree protocol process. 
         [0032]    The delay period may be based upon the load on the network bridge. For example, this may be achieved by basing the delay period upon the number of pending tasks in a queue on the network bridge when the defer mode is set. 
         [0033]    The controller is preferably arranged to add a new task to the queue as the defer mode is set. Then, when the new task reaches the front of the queue, this can signify the end of the delay period. 
         [0034]    Alternatively, the network bridge may include a token counter wherein the controller is arranged to: periodically increase the value of the token counter, whilst it is less than a maximum value; reduce the value of the token counter when the spanning tree protocol process is run; and set the defer mode in response to running of the spanning tree protocol process when the token counter has a zero value, wherein the delay period corresponds to the period in which the token counter has a zero value. 
         [0035]    The controller is preferably arranged to periodically increase the value of the token counter at a rate based on the maximum desired rate for running the spanning tree protocol process under high load conditions. 
         [0036]    The controller preferably stores any triggering events received when the defer mode is set, so that they can be processed when the spanning tree protocol process is run again. 
         [0037]    Preferably, the spanning tree protocol process run by the controller includes running a plurality of state machines to determine a stable state of said network bridge parameters. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0038]      FIG. 1  shows an overview diagram of the state machines used to establish a spanning tree using the Spanning Tree Protocol; 
           [0039]      FIG. 2  shows schematically the operation of the bridge under relatively low load conditions; and 
           [0040]      FIG. 3  shows the operation of the bridge under higher load conditions. 
       
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0041]    However, under high load conditions, the state machines may not have completed their operation and returned to a stable state before further inputs have arrived which may again require the state machines to restart. Furthermore, any break between running of the state machines may not allow sufficient time for other tasks to be run. 
         [0042]    The present invention aims to deal with this issue by running the state machines as normal under normal load conditions but deferring the running of the state machines when the system is under load. It is generally undesirable to defer running the state machines after receiving an input, as this would delay the establishment of the new spanning tree for the network. However, the present invention provides a system which recognises when a system is under load and only defers running of the state machines under those conditions to prevent the perhaps more undesirable situation of overloading the bridge controller. 
         [0043]    In this way, when the system is not under load, the state machines will respond rapidly to inputs ensuring that the system responds quickly to changes. However when the system is under load, it defers running the state machines to minimise the amount of work that the system has to do to thereby improve the overall performance. 
         [0044]      FIG. 2  shows schematically the chronological sequence of events during the operation of a bridge when it is not under load. The system is initially in a stable state, i.e. the various state machines have been previously run and have arrived at a stable condition. As indicated above, this position will be maintained until an external input (INPUT  1 ) is received. The input is received and entered into the work queue. Since the queue does not contain any other items of work, the INPUT  1  is at the front of the queue and is processed as the next item. On receipt of the input, the state machines begin to run immediately. For a period of time represented by the shaded box, the state of the various state machines is not stable. 
         [0045]    Once the state machines have run, they will again return to a stable state. At this point, a special “Reschedule Message” is created and added to the queue and the bridge is put into a defer mode. The queue may contain items of work to be carried out by the STP controller in the bridge, although in the example of  FIG. 2  the queue is again empty. The various items of work are processed sequentially and jobs are held in the queue until they are processed. Whilst the bridge is in the defer mode, any external inputs will not initiate the state machines to run. 
         [0046]    Depending on the workload condition of the controller, the queue may already contain a number of pending items of work to be completed or the queue may be relatively unpopulated if the system is not under load. In this example, the queue is empty. Any items in the queue ahead of the Reschedule Message have been processed, as shown. When the Reschedule Message reaches the end of the queue, it is processed, switching back from the defer mode. 
         [0047]    Once the Reschedule Message has been processed, the controller may then go on to continue to process other items in the queue behind the Reschedule Message or which arrive subsequently. However, having received and processed the Reschedule Message, the network is returned from the defer mode to a normal, or active mode. In this active mode, the controller is in a state which is responsive to new external inputs. In this example, as soon as another external input (INPUT  2 ) arrives, the controller will initiate the operation of the state machines (as represented by the lower shaded box in  FIG. 2 ) to re-determine a new stable state. In this way, the state machines are run as soon as the external input is received avoiding any delay in responding to, for example, changes in the topology of the network. 
         [0048]      FIG. 3  shows the situation when the system is under load. In this case, multiple external inputs (INPUT  1 -INPUT  4 ) are received. INPUT  1  is received and entered into the queue. However, as the bridge is already busy processing other tasks, INPUT  1  is not immediately passed to the initiate the state machines to run. In the interim INPUT  2  and INPUT  3  arrive and are added to the queue. Once the system is ready to process the next item in the queue, INPUT  1  is processed, which causes the controller to initiate running the state machines. Whilst the state machines are running another external input (INPUT  4 ) is received and is placed at the back of the work queue. 
         [0049]    The state machines complete the task (i.e. have returned to a stable state) and a Reschedule Message is issued putting the bridge into the defer mode. The Reschedule Message is added to the queue of work items for the controller to complete, behind INPUT  4 , INPUT  3  and INPUT  2 . There may also be other tasks waiting to be processed which are not shown in this example. 
         [0050]    When the system is under load, the number of items of work in the queue may be significantly greater meaning that the Reschedule Message is further down the queue and it will typically be longer before it is processed. Once the state machines have completed operation and returned to a stable state, the controller goes back to processing other items of work in the queue. 
         [0051]    As shown in  FIG. 3 , an external input (INPUT  2 ) is processed next. However, the bridge is still in defer mode since the controller has not reached the Reschedule Message in the queue. In this instance, the controller updates state variables as a direct result of the external input (INPUT  2 ) but does not initiate running of the state machines. Rather, the state machines are left in an unstable state temporarily. The controller then simply continues processing the items of work in the queue. 
         [0052]    Further external inputs (INPUT  3  and INPUT  4 ) successively reach the front of the queue and are processed. In the same way as for INPUT  2 , the controller updates state variables as a direct result of the input, but does not initiate running of the state machines. Finally, the Reschedule Message reaches the front of the queue and is processed. The controller will then switch out of defer mode and into active mode. At this point the controller initiates running of the state machines to return the system to a stable state. 
         [0053]    In this way, the controller is effectively running the state machines once for a batch of inputs (INPUT  2 , INPUT  3  and INPUT  4 ), rather than running the state machines multiple times, once for each input. This means that the state machines are run less frequently, thereby reducing the overall processing load on the controller. This allows it to deal with other tasks to manage the higher load rather than spending significant amounts of time running the state machines. 
         [0054]    The result of the above method is that when the system is not under load, the state machines are run with a minimum amount of delay allowing them to respond quickly to topology changes in the system and other triggers. However under load, the number of times the state machines are run is reduced in order to reduce the processing burden on the controller to provide an improvement in performance compared to running the state machines in response to every single external input. This means that the performance under load is improved without significantly compromising the ability of the system to respond to changes (for example, for protection switching). 
         [0055]    The above-described embodiment of the present invention is responsive to the loading of the system by inserting the Reschedule Message into a queue. The length of the queue and the rate at which items in the queue are processed reflect the load on the system and effectively provide a delay before running the state machines in response to external inputs where the system is under load. 
         [0056]    In an alternative embodiment of the invention, a modified version of the load monitoring may be achieved by using a token-bucket mechanism. In this arrangement, the system would operate in a similar way to that described above in that when an external input is received, the state machines are operated until they return to a stable condition. Before the state machines can run though, a token must be available from the notional bucket. It is assumed in this instance that at least one token is provisionally available. Once the state machines have been run, the token is used up. 
         [0057]    New tokens will be added to the bucket at a predetermined rate until it is full (reaches a predetermined limit). As long as a token is available, the controller is able to run the state machines in response to external inputs. In this example, the rate at which the bucket is refilled with tokens is determined according to the rate at which the state machines should be run when the system is under stress. In other words, if it is desired to only run the state machines after a period T when the system is under stress, a token is added to the bucket at a rate corresponding to T. 
         [0058]    In this way, when the system is not under stress and is operating at lower load level, the tokens should be replenished into the bucket at a rate which is greater than the rate at which they are used. The token bucket will therefore remain in a substantially full state, meaning that there will typically always be a token available to allow running of the state machines when an external input is received. 
         [0059]    When the system is under load and the requirement to run the state machines exceeds the predetermined rate, the tokens in the bucket start to be depleted. Once the store of tokens in the bucket has been depleted, the bridge will go into defer mode and further external inputs will not trigger running of the state machines. If external inputs continue to arrive, the rate at which the state machines will run will correspond to that of the predetermined rate. In other words, the state machines will not be run until the next token becomes available and then not again until the subsequent token is available and so on. 
         [0060]    The rate at which the bucket is refilled may be controlled to reflect the status of the system. For example, filling of the bucket may be changed to reflect different load conditions. Under high load, the filling rate may be reduced further than the predetermined rate mentioned above. 
         [0061]    With the above arrangement, the size of the bucket can be controlled to provide a degree of delay before the rate at which the state machines are run is reduced. Under low load conditions the bucket is likely to be full or nearly full. If a burst of external inputs suddenly occurs, then until the bucket is empty, running of the state machines is not limited. This allows the system to cope with a small burst of external inputs before backing off. 
         [0062]    If the system load does increase, the rate at which the tokens are removed from the bucket will exceed the rate at which they are added and the tokens in the bucket will start to be depleted, as described above. This means that if there is a transient increase in loading, the state machines will initially run immediately upon receipt of the external inputs. However, if the increase in load persists, the tokens will be depleted as the rate of arrival of the external inputs will exceed the rate at which tokens are added to the bucket. Once the bucket is empty, the rate at which the state machines run will decline to the permitted rate set by the rate at which the bucket is filled. 
         [0063]    The size of the bucket may alternatively be selected to hold a maximum of one token. This means it will respond much more rapidly to even transient changes in the loading on the system. Even if two external inputs arrive in quick succession, the bucket will be emptied by the first and will not be replenished until after the predetermined period and so the running of the machines will be deferred 
         [0064]    In the above embodiment the invention is presumed to operate all the time, so that operation of the state machines can be delayed whenever the bridge is under load. However, the invention may be implemented in a selective manner, so that the bridge can be operated to use the invention at some times but switched back to operating without the invention under certain conditions.