In a system having multiple nodes, routing protocols may be employed to route data from a source node to a destination node. In order to determine what paths are available to route data from the source node to the destination node, algorithms may be employed, for example, a shortest path first algorithm. The routing protocol may then route data in accordance with the result of the executed shortest path first algorithm.
In a system having multiple nodes, routing protocols may be employed to determine where packets are to be forwarded between nodes. Routing protocols may be based on, for example, execution of a shortest path first (SPF) algorithm. The SPF algorithm may be a recursive algorithm such that all paths from a source node to a destination node may be traversed such that the cost for each path is determined. The SPF algorithm may then identify the lowest cost from the source node to the destination node as the shortest path.
SPF algorithms are thorough, but require CPU memory and processing power to complete for very large networks. By storing costs, pre-populated and/or previously learned by earlier executed SPF algorithms, the number of iterations of the algorithm may be reduced and the performance of the algorithm can be increased.
As discussed herein, cost information may be stored for paths between nodes in a system. The cost information may be stored, for example, locally on one or more nodes in a system, or may be stored globally where all nodes in a system may access the information.
For example, a node may locally store information related to cost of paths between itself and other nodes in a system. Alternatively, cost information may be globally stored in one table accessible by multiple nodes in the system. A given node may have multiple paths to any given destination node. These paths might traverse other nodes that are neither the source nor the destination node. The cost from the source node or nodes that are being traversed to the destination node may be pre-populated. The storage of costs may be accessed to determine if a cost to the destination node is stored. If the cost to the destination node is not stored, a SPF algorithm may be executed to identify a shortest path from the current node to the destination node having the lowest cost. If the cost is stored, then the nodes adjacent to the current node may not be queried for the cost to the destination node, as is more fully discussed below. This process may be performed on the source node and/or all intermediate nodes until either a node is reached with a populated cost or the destination node is reached.
It may be appreciated that system environment may be implemented in a network where the nodes are not configured in a stack, for example, are components within the same computing device, are networked computing devices, etc.
System environment 100 includes nodes 1, 2, 3, 4, 5, 6, 7 and 8. Each of the nodes may be implemented as a networking device, for example, a switch, router, or other computing device, etc., having one or more ports. The lines between the nodes in
All of the nodes depicted in
Nodes 1-8 may be implemented through any suitable combinations of software including machine readable instructions executable by a processor, firmware, including machine readable instructions executable by a processor and stored in one or more non-transitory computer-readable media, and/or hardware. Secondary memory may be implemented within the device and/or may be implemented as external data storage. Primary and/or secondary memory may be computer-readable mediums configurable to store modules as discussed herein. Primary and/or secondary memory may further be configurable to receive an installation pack from an external memory, for example, a portable computer-readable medium, for example, a Compact Disc/Digital Video Disc, etc.
Paths within system environment 100 may be one or more links that connect one node to another node.
A shortest path may be a path between a source node and a destination node that has the lowest cost between them.
Any node depicted in
In addition to components to perform normal networking node functionality, node 1 includes routing module 110, SPF module 112, storage management module 114, secondary memory 116, processor 118, and memory 120. It may be appreciated that the modules shown with respect to node 1 may be included in nodes 2, 3, 4, 5, 6, 7 and 8.
Routing module 110 may route information to the destination node based on information stored in routing tables as determined shortest path by SPF module 112. SPF module 112 may refer to storage via storage management module 114 to determine if a cost is associated with a path between two nodes and, if not, execute a shortest path algorithm. Storage management module 114 may manage information stored in secondary memory 116, the information relating to costs between nodes in system environment 100. Processor 118 may execute a set of instructions, stored in a computer-readable medium, to perform the functionality associated with each of the modules discussed herein. Each of these modules is discussed more fully below.
As discussed herein, a system may be implemented as any wide area network (WAN) or local area network (LAN). For example, a system may be implemented as any wired or wireless network, including an enterprise network, wideband code division multiple access (WCDMA), personal communication services (PCS), worldwide interoperability for microwave access (WiMAX), local area network (LAN), wide area network (WAN), etc. In the example in
It may further be appreciated that all of the nodes in the system may be implemented as software objects within the system where the system is implemented as a software application that may be executed, by a processor, on a computing device.
In an alternative embodiment,
The cost array may be pre-populated with cost information, for example, when the system is deployed. For example, when a system is deployed, information regarding direct links is determined in order to create the system. Assuming all links have a known cost, the cost array may be pre-populated with the cost of links between the adjacent nodes. For example, where the cost of all links on the system is 1, the cost array may be pre-populated with the cost of 1 for all links adjacent to the node. As shown in
As shown in
If the cost is equal to one (408, Yes), then the nodes are adjacent links and the cost from the current node to the node on the other side of the link (the adjacent node) is set at “1” in the cost array (410). If the cost is not equal to “1”, then processing proceeds to 406, where the next link is selected as the current node. After the algorithm is complete, the cost array 300 is fully pre-populated.
As noted above, in one embodiment, the cost of each of the links in the system may be arbitrary. In this case, the system may have a predefined minimum weight for all links in the system. If the cost of the link is less than or equal to 2 times the minimum cost of any link, then the link is determined to be a link to an adjacent node and the table may be pre-populated with the cost of the link.
In other words, for each link on each node of a plurality of nodes, it may be determined if a cost between a node and a node on the other side of the link is less than or equal to a minimum link cost ×2. If the cost is less than or equal to a minimum link cost ×2, a storage location associated with the path between the node and the node on the other side of the link may be updated with the determined cost.
Alternatively, if paths are symmetric, the paths for the reverse path may be updated. A path may be symmetric if the cost of the link is the same in both directions, i.e., from the source node to the destination node and the path from the destination node to the source node. In some systems, it may be presumed that the paths are symmetrical. Alternatively, there may be an additional calculation to determine if the path from the destination node to the source node is symmetrical. If it is determined that the path is symmetrical, then the storage management module may update the cost array with the cost from the source node to the destination node with the same cost from the destination node to the source node.
Storage management module 114 may create, add, modify and delete information stored in cost array 200, cost array 300, etc.
Storage management module 114 may create cost array 200, cost array 300, etc., in storage based on the number of nodes in the system. Storage management module may pre-populate the cost array 200, cost array 300, etc., with the cost for the paths between adjacent nodes using the cost for links between the nodes as noted above with regard to
As new lowest costs are learned, storage management module 114 may update the cost array 200 with the new costs.
SPF module 112 may determine a lowest cost path between a source node and a destination node by executing an algorithm that may include execution of an SPF algorithm. It may be appreciated that the SPF algorithm may employ, in addition to the functionality discussed herein, an open shortest path first algorithm, a recursive open shortest path first algorithm, etc.
Prior to executing an SPF algorithm, the SPF module 112 may query storage management module 114 to determine if the cost from the source node to the destination node is stored. If the cost is stored, then the SFP algorithm is not executed. This is because only the lowest cost between two nodes is stored in the cost array 200, cost array 300, etc. If the cost is not stored, then a SPF algorithm may be executed as follows.
In executing a SPF algorithm, the source node will consider the cost of each path through all of the node's links to the destination node. To determine the cost of getting to the destination through a link, the cost of the link to its adjacent node is added to the cost of getting from the node on the other side of the link to the destination node. That cost may be stored in the storage management module or the SPF algorithm will query all of the node's (current node) links. Once the cost is determined for all of the node's links, the SPF module may select the path that has the lowest cost. The lowest cost may be forwarded to the storage management module and stored in cost array 200.
By updating the local cost array 200, global cost array 300, etc., with the determined cost for the shortest path between the source node and the destination node, if the source node is an intermediate node from another source to the same destination, the path does not need to be re-calculated because the cost is already known.
The following represents an example implementation of a portion of the SPF module. In the following example, cost and weight are interchangeable. Node and member are interchangeable.
Referring to
SPF module 112 begins execution of a SPF algorithm by traversing all of the nodes linked with node 1, namely nodes 2, 4 and 6. Starting with node 2, SPF module 112 may transmit a query to node 2 for a cost between node 2 and node 8.
When the request is received at node 2, SPF module at node 2 may query storage management module at node 2 for a value associated with the path between node 2 and node 8. Storage management module, for example, returns the stored value “3”, where the cost array at node 2 is populated. Value “3” indicates that the lowest cost for this path is known. This value is returned to node 1. The cost to get from 1 to 8 via this link is 4. This value may be transmitted to the storage management module 114 for temporary storage until the cost through each of the links is determined.
SPF module 112 continues execution of the SPF algorithm by traversing the next node linked with node 1, namely node 4. Thus, a query is transmitted to node 4 for a cost between node 4 and node 8.
When the request is received at node 4, SPF module at node 4 may query storage management module at node 4 for a value associated with the path between node 4 and node 8. Storage management module, for example, returns the stored value “1” where the cost array at node 4 is pre-populated with a value “1”, because nodes 4 and 8 are adjacent. Value “1” indicates that the lowest cost for this path is known. This value is returned to node 1. The cost to get from 1 to 8 via this link is 2. This value may be transmitted to the storage management module 114 for temporary storage until the cost through each of the links is determined.
SPF module 112 continues execution of the SPF algorithm by traversing the next node linked with node 1, namely node 6. SPF module 112 may transmit a query to node 6 for a cost between node 6 and node 8.
When the request is received at node 6, SPF module at node 6 may query storage management module at node 6 for a value associated with the path between node 6 and node 8. Storage management module, for example, returns the stored value “−1”. Value “−1” indicates that the lowest cost for this path is not known. Thus, the SPF module at node 6 executes a SPF algorithm to determine the lowest cost path between node 6 and 8.
SPF module at node 6 begins execution of a SPF algorithm by traversing all of the nodes linked with node 6, namely node 7. Node 6 will not traverse the link that the query came in on. A query is transmitted to node 7 for a cost between node 7 and node 8.
When the request is received at node 7, SPF module at node 7 may query storage management module at node 7 for a value associated with the path between node 7 and node 8. Storage management module, for example, returns the stored value “1”. Value “1” indicates that the lowest cost for this path is known. This value is returned to node 6. Node 7 returns the cost of 1 to node 6 which returns the cost of 2 to node 1, and the cost to get to node 8 via that link is 3. This value may be transmitted to the storage management module 114 for temporary storage.
Once all of the path costs to get to node 8 through each of the links at node 1 have been determined, the SPF module 112 selects the lowest cost path (in this example, cost =2 through node 4) and transmits the lowest cost value to the storage management module 114. The storage management module associates the value with the path between the source node and the destination node and stores the value in the cost array 200.
Alternatively, the algorithm may be implemented such that a temporary lowest cost is stored. Each time a cost is received at storage management module for a path through one of the node's links, the cost through the current node is compared with the temporary lowest cost. If the cost through the current node is lower than the temporary lowest cost, then the temporary lowest cost is updated with the cost through the current node. If the cost through the current node is greater than the temporary lowest cost, then the temporary lowest cost is not updated with the cost through the current node.
When the configuration depicted in
A destination node is determined for information that is to be transmitted (504).
It is determined if a cost from the source node to the destination node is stored (506).
If the cost from the source node to the destination node is not stored, a SPF algorithm is executed to identify a shortest path from the source node to the destination node having the lowest cost (508).
In executing the SPF algorithm, it may be determining if a cost for a path between a linked node to the destination node is stored. If the cost for the path between the linked node to the destination node is stored, the SPF module may identify the stored cost as the lowest cost for the path between the linked node and the destination node. After determining the cost to the destination node through all of nodes linked to the source node, the lowest cost path may be determined. The information may be routed to the destination node based on the determined lowest cost path.
Alternatively, the costs that are stored in the cost array 200, cost array 300, etc., may be considered states of the lowest cost path between two nodes. Thus, when the SPF module 112 is determining the lowest cost path, and referring to the cost array 200, cost array 300, etc., the costs that are stored may be considered previous states of the shortest paths that have previously been determined. Information may be routed from a source node to a destination node based on the determined lowest cost path.
It may be appreciated that once a lowest cost for a path is determined between two nodes, one or more routing tables may be updated within system environment 100 (not shown) to reflect the link to the node having the lowest cost.
When a destination node is determined, a determination is made as to whether the cost of the path from the source node to the destination node is stored (602). If the cost of the path between the source node and destination node is stored (602, Yes), then processing is complete.
If the cost is not stored (602, No), then all nodes linked to the source node are identified (604). The first linked node is set as the current node (606). The source node then queries the current node for the cost from the current node to the destination node (608). The source node then receives a response to the query, the response including the cost from the current linked node to the destination node and the source node determines the cost from the source node to the destination node via the current linked node is the cost received in the response from the query, plus 1 (the cost from the source node to the current linked node) (610).
The source node determines if the cost has been determined for all links of adjacent nodes of the source node (612). If the cost has not been determined for all links (612, No), then the current node is set as the next linked node (614) and processing returned to 608. If the cost has been determined for all links (612, Yes), then the source node selects the path through the link with the lowest cost (618). The lowest cost is then stored in the cost array 200 (620).
It may be appreciated that when the query is sent to the linked node for the cost from the linked node to the destination node (608), the linked node may perform the process shown in
Any node in system environment that is queried to identify the path from the node to the destination node may perform the process shown in