Weighted bandwidth allocation for adaptive routing

Systems and methods of routing are provided. In the system, one or more processors determine that a packet is to be transmitted to a destination. In one or more aspects of the system, the one or more processors select a next port to be used for transmitting the packet by selecting a set of ports among a plurality of ports based on a static weight configuration associated with each port. The next port may be selected from the set of ports based on a number of hops required to reach the destination from each port and based on an estimated latency from each port to the destination. The one or more processors may then route the packet through the selected next port.

BACKGROUND

To send a packet from a source to a destination in a network, the packet may be routed through a series of switch devices, each of which may have a plurality of output ports. These switch devices and output ports thus provide multiple routes through which the packet may be transmitted. A static or an adaptive routing method may be used to select an optimal route for transmitting the packet. In this regard, a static routing method may choose a route to transmit the packet based on predetermined parameters of the network, such as bandwidth available at each output port at each switch device. However, such static routing methods may not be able to adapt to changing network conditions. For instance, at a given moment, an output port with higher bandwidth may become more congested than an output port with lower bandwidth. In contrast, an adaptive routing method may choose a route to transmit the packet based on network conditions, such as current congestion conditions in the network. However, such adaptive routing methods may not consider predetermined parameters in the overall network. For instance, an output port upstream with lower congestion at a given moment may be selected, but selecting that output port may lead to an output port downstream that has low bandwidth.

BRIEF SUMMARY

One aspect of the technology provides a method for selecting a next port for transmitting a packet, comprising determining, by one or more processors, that a packet is to be transmitted to a destination; selecting, by the one or more processors, a next port to be used for transmitting the packet by: selecting, by the one or more processors, a set of ports among a plurality of ports based on a static weight configuration associated with each port of the plurality of ports; and selecting, by the one or more processors, the next port among the set of ports based on a number of hops required to reach the destination from each port of the set of ports and based on an estimated latency to the destination associated with each port of the set of ports; and routing, by the one or more processors, the packet through the selected next port.

Selecting a set of ports may be based on static weights assigned by weighted cost multipath routing (WCMP).

The method may further comprise repeating, by the one or more processors, the selection of a next port at each hop until the packet reaches the destination.

The method may further comprise categorizing, by the one or more processors, each of the plurality of ports as a primary port or a secondary port based on a number of hops required to reach the destination. Selection of the set of ports may be separately performed for the primary ports and the secondary ports, resulting in a set of primary ports and a set of secondary ports. The next port may be selected among the set of primary ports and the set of secondary ports. The primary ports and the secondary ports may be stored in separate lists accessible by the one or more processors.

The latency may be estimated based on at least one of: a number of hops required to reach the destination, a network congestion condition, and one or more heuristic offsets.

The method may further comprise selecting, by the one or more processors, a first set of ports among the plurality of ports based on the static weight configuration associated with each of the plurality of ports; selecting, by the one or more processors, a second set of ports among the first set of ports based on congestive conditions along routes requiring equal number of hops to reach the destination; selecting, by the one or more processors, the next port among the second set of ports based on estimated latency to destination associated with each port of the second set of ports. The selection of the first set of ports may be separately performed for primary ports and secondary ports, resulting in a first set of primary ports and a first set of secondary ports.

Another aspect of the technology provides a system comprising one or more processors, the one or more processors configured to determine that a packet is to be transmitted to a destination; select a next port to be used for transmitting the packet by: selecting a set of ports among a plurality of ports based on static weight configuration associated with each port of the plurality of ports; and selecting the next port among the selected set of ports based on a number of hops required to reach the destination from each port of the set of ports and based on an estimated latency to the destination associated with each port of the set of ports; and route the packet through the selected next port.

The system may further comprise one or more memories accessible by the one or more processors, wherein information on the plurality of ports are stored in the one or more memories. The one or more processors may be further configured to categorize each of the plurality of ports as a primary port or a secondary port based on a number of hops required to reach the destination, and the one or more memories may store information on the primary ports and the secondary ports in separate lists. The one or more processors may be further configured to perform selection of the set of ports separately for the primary ports and the secondary ports, resulting in a set of primary ports and a set of secondary ports.

The one or more processors may be further configured to select a first set of ports among the plurality of ports based on static weight configuration associated with each port of the plurality of ports; select a second set of ports among the first set of ports based on congestive condition along routes requiring equal number of hops to reach the destination; select the next port among the second set of ports based on estimated latency to the destination associated with each port of the second set of ports.

Yet another aspect of the technology provides for a computer-readable storage medium storing instructions executable by one or more processors for performing a method, comprising determining that a packet is to be transmitted to a destination; selecting a next port to be used for transmitting the packet by: selecting a set of ports among a plurality of ports based on static weight configuration associated with each port of the plurality of ports; and selecting the next port among the set of ports based on a number of hops required to reach the destination from each port of the set of ports and based on an estimated latency to the destination associated with each port of the set of ports; and routing the packet through the selected next port.

The method may further comprise categorizing each of the plurality of ports as a primary port or a secondary port based on a number of hops required to reach the destination. Selection of the set of ports may be separately performed for the primary ports and the secondary ports, resulting in a set of primary ports and a set of secondary ports.

The method may further comprise selecting a first set of ports among the plurality of ports based on static weight configuration associated with each port of the plurality of ports; selecting a second set of ports among the first set of ports based on congestive condition along routes requiring equal number of hops to reach the destination; selecting the next port among the second set of ports based on estimated latency to the destination associated with each port of the second set of ports.

The method may further comprise repeating the selection of a next port at each hop until the packet reaches the destination.

DETAILED DESCRIPTION

The technology relates generally to routing packets in a network. In this regard, when a packet at a node in the network is to be transmitted, one or more processors at the node may select a next port to be used for transmitting the packet based on both static and adaptive routing parameters. For instance, a set of ports may be selected among a plurality of ports based on static weight configurations associated with each port of the plurality of ports. Then, the next port to be used for transmitting the packet may be selected among the set of ports based on estimated latency to the destination associated with each port of the set of ports under current network conditions.

FIG. 1illustrates a network100according to aspects of the technology. As shown, the network100comprises a plurality of switches102,112,114,116,122,124,126,132, and142. Each of the switches102-142may be provided at a node of the network100, such as coupled to a server computing device or other computing device, for routing data packets to other nodes of the network100. While only a few switches102-142are shown, it should be understood that the network100may be expanded to include any number of switches, for example, to reach a greater number of nodes or locations, or to accommodate greater amounts of network traffic.

Each switch102-142may be coupled to one or more of the other switches in the network100, forming one or more routes. For example, a number of routes are shown between switch102and switch142. A packet may be transmitted between switch102and switch142via any of these routes. For instance, one route may include switches102,112,122, and142, another route may include switches102,114,124,132,142, yet another route may include switches102,116,126, and142, and still another route may include switches102,112,124,132,142, etc. Thus, some routes between switch102and switch142may require a packet to be transmitted via a greater number of hops than others. In this regard, the routes that require a minimal number of hops, such as those through switch122and switch126(e.g., 3 hops), may be referred to as “minimal routes” or “primary routes,” and the routes that require a greater number of hops, such as those through switch124shown (e.g., 4 hops), may be referred to as “non-minimal routes” or “secondary routes.”

The switches102-142may be coupled via data ports (not shown inFIG. 1, examples are shown inFIG. 4). Each switch102-142may include a predetermined number of data ports. The number of data ports may vary depending on, for example, a type of switch used. Some ports may be dedicated to downlink traffic (e.g., for transmitting data from switch112to switch122), while others may be dedicated to uplink traffic (e.g., for transmitting data from switch112to switch102). Alternatively or additionally, some ports may be dedicated to ingress while others may be dedicated to egress. The number of data ports may also dictate the number of links that may be established with other network devices, such as with other switches. In some instances, ports may be assigned weights based on the network topology, which is described further in reference toFIG. 4.

Although only a few routes are shown connecting switch102to switch142, additional routes may be available. The additional routes may be formed by additional connections between the switches shown inFIG. 1, or may involve additional switches not shown inFIG. 1. Further, some of the routes shown may be active routes where all ports along the route are active, while others shown may be inactive routes where one or more ports along the route are inactive.

The switches102-142may be routers, chips, or any other type of device capable of receiving packets at a first port and transmitting the packets through a second port, and in many instances, capable of receiving and transmitting packets between multiple ports.FIG. 2illustrates an example of a switch, such as the switch102. The switch102may comprise one or more processors210and a memory220coupled to the one or more processors210. The memory220may include instructions222and data224. The switch102may further comprise a number of data ports, such as uplink data ports260and downlink data ports270.

The switch102may also include one or more forwarding tables230, one or more static weight configuration tables such as Weighted Cost Multi Path (WCMP) tables240, and network condition data250, which are described further in reference toFIGS. 5 and 6. For example, the forwarding tables230may include a number of entries, each listing a key and an action. As packets are received by the switch102, header information in those packets may be matched against the keys of the forwarding table230to determine a corresponding action (e.g., a next hop). The WCMP table240may, for example, include a weighting of each of the uplink data ports260(and/or downlink data ports270) on the switch102, and may be used to determine which port the packet should be transmitted through. The network condition data250may include real time or recent network congestion information at various data ports in the network100. While the forwarding table230, WCMP table240, and network condition data250are shown as being stored separately from the memory220, it should be understood that the forwarding table230, WCMP table240, network condition data250, instructions222, and/or data224may be stored in the same medium.

The one or more processors210may be any conventional processors, such as processors in commercially available routers. Alternatively, the processor may be a dedicated controller such as an ASIC or other hardware-based processor. The processor and memory may actually comprise multiple processors and memories that may or may not be stored within the same physical housing. For example, memory may be a hard drive or other storage media located in a server farm of a data center. Accordingly, references to a processor, memory, or computer will be understood to include references to a collection of processors, memories or computers that may or may not operate in parallel.

The memory220stores information accessible by the one or more processors210, including instructions222that may be executed or otherwise used by the processor210, and data224. The memory220may be of any type capable of storing information accessible by the processor, including a computer-readable medium, or other medium that stores data that may be read with the aid of an electronic device, such as a hard-drive, memory card, ROM, RAM, DVD or other optical disks, as well as other write-capable and read-only memories. Systems and methods may include different combinations of the foregoing, whereby different portions of the instructions and data are stored on different types of media.

The instructions222may be any set of instructions to be executed directly (such as machine code) or indirectly (such as scripts) by the one or more processors210. For example, the instructions may be stored as computer code on the computer-readable medium. In that regard, the terms “instructions” and “programs” may be used interchangeably herein. The instructions may be stored in object code format for direct processing by the processor, or in any other computer language including scripts or collections of independent source code modules that are interpreted on demand or compiled in advance. Functions, methods and routines of the instructions are explained in more detail below.

The data224may be retrieved, stored or modified by processor210in accordance with the instructions222. For instance, although the system and method is not limited by any particular data structure, the data may be stored in computer registers, in a relational database as a table having a plurality of different fields and records, XML documents or flat files. The data may also be formatted in any computer-readable format. The data may comprise any information sufficient to identify the relevant information, such as numbers, descriptive text, proprietary codes, references to data stored in other areas of the same memory or different memories (including other network locations) or information that is used by a function to calculate the relevant data.

While the components of the switch102have been described with respect to a particular switch, it should be understood that a similar architecture may be imparted to any of the other switches ofFIG. 1. The switches in the network100may be configured the same, or may be configured differently. For instance, switches112-142may each include respective processors, memory storing instructions and data, forwarding tables, WCMP tables, network condition data, upload data ports, download data ports, etc. However, some of the switches102-142may have different number of data ports than other switches, and may make different connections and be part of different routes as other switches. As such, forwarding tables, WCMP tables, network condition data stored at each of the switches102-142may differ with respect to the data ports, connections, and routes available at each switch.

FIG. 3illustrates an example routing according to aspects of the disclosure. The example ofFIG. 3shows selections performed in two stages. The routing may be performed by any switch of a network, for example by switch102of network100. For instance, the one or more processors210of the switch102may determine that a packet is to be transmitted to a destination, such as to a computing device coupled to switch142. The packet may originate from a computing device coupled to switch102, or may be received from another switch in the network100.

As shown inFIGS. 2 and 3, the one or more processors210may determine that a plurality of ports300-307may be used to transmit the packet to destination switch142. The one or more processors210may make such a determination by looking up the destination in a forwarding table, such as forwarding table230. As examples, port301of switch102may be on route R1which further includes ports of switches112,122, and142; port305of switch102may be on route R5which further includes ports of switches116,122, and142; and port306may be on route R6which further includes ports of switches116,126, and142. Because these routes include the lowest number of hops, R1, R5, and R6may be categorized as minimal routes or primary routes (denoted as “P”), and the corresponding ports301,305and306may be categorized as primary ports. In contrast, port304may be on route R4which further includes ports of switches102,114,124,132, and142, and port307may be on route R7which further includes ports of switches102,112,124,132, and142. Because routes R4and R7require a greater number of hops than routes R1, R5, and R6, routes R4and R7are may be categorized as non-minimal or secondary routes (denoted as “S”), and the corresponding ports304and307may be categorized as secondary ports. In some instances, the primary ports and the secondary ports may be stored in separate lists on the switch102or otherwise accessible by processors210.

The one or more processors210may additionally determine that one or more ports and/or routes at switch102are inactive. For example, processors210may determine that port300is inactive and thus route R0including port300is also inactive, likewise, processors210may determine that ports302and303, and corresponding routes R2and R3, are also inactive. As such, processors210may not consider ports302and303as options for transmitting the packet.

The one or more processors210may select a next port to be used for transmitting the packet to destination. In this regard, the one or more processors210may perform one or more selections based on both static and adaptive routing parameters. For instance as shown inFIG. 3, in the first stage, the one or more processors210may perform a first selection310based on static parameters. The first selection310may be performed based on static weight configurations.

FIG. 4shows an example static weight configuration in accordance with aspects of the disclosure. In particular, the configuration uses a Weighted Cost Multi Path (WCMP) flow distribution. For ease of illustration, only a few switches and connections fromFIG. 1are reproduced inFIG. 4. However, it should be understood that the static weight configuration may be performed similarly for all connections between switches in the network100. Referring toFIG. 4, switch112includes connection412to switch122, connection414to switch124, and connection416to switch126; switch114includes connection422to switch124, connection424to switch122, and connection426to switch126; and switch116includes connection432to switch126, connection434to switch122, and connection436to switch124.

Further, switch112may have 14 ports, and thus 14 links may be established between the switch112and the switches122-126. Because there are three switches122-126, and because 14 does not divide equally by 3, there may be an uneven distribution of links among the switches122-126(e.g., uneven striping). For example, the connection412between the switch112and the switch122may comprise 6 links (e.g., coupled to ports1-6of the switch112), while the connections414,416between the switch112and each of the switches124,126may comprise 4 links (e.g., coupled to ports7-10and ports11-14, respectively, of the switch112).

This network topology may cause congestion in an Equal Cost Multiple Path (ECMP) flow distribution, where each connection is configured with equal static weight such that traffic is equally likely to be transmitted through each of the connections. For example, using ECMP, traffic is equally likely to transmit through the connection412including 6 links as the connection414including 4 links. Because each of the 6 links in connection412may have lower bandwidth than each of the 4 links in connection414, congestion may occur at the connection412.

Using WCMP flow distribution may ameliorate this problem and provide improved load balancing. With WCMP, each connection may be given a weight based on a number of links in the connection. For example and as shown, the connection412may be given a weight of 4, while the connections414and416may each be given a weight of 6. Thus, for example, 4 flows are transmitted over each of the links in connection412, 6 flows are transmitted over each of the links in connection414and 6 flows are transmitted over each of the links in connection416. In this regard, the switch122may avoid becoming oversubscribed, and therefore less likely to drop packets.

The weighting of the flows may be managed, for example, using a forwarding table and a WCMP table.FIG. 5illustrates an example of the forwarding table510and the WCMP table550for switch112. The forwarding table510may include a number of entries512,514,516, each entry having a key and an action. The key may comprise a number of bits representing, for example, a destination address. The action may comprise information representing a next hop for each packet that is received with a destination matching a key. The WCMP table550may include a plurality of entries, with each entry identifying a port of the switch112through which received packets may be forwarded. The number of entries listing a particular port may vary depending on a weight assigned to that port. For example, the 6 links in the connection412coupled to ports1-6of the switch112were assigned a weight of 4, as discussed above in connection withFIG. 4. Accordingly, each of ports1-6may have 4 entries in the WCMP table550. Similarly, the 4 links in the connection414coupled to the ports7-10of the switch112were assigned a weight of 6. Therefore, each of the ports7-10may have 6 corresponding entries in the WCMP table550.

Similar forwarding tables and WCMP tables may be stored or made accessible to each of the switches in the network100ofFIG. 1. For example, forwarding table230and WCMP table240for switch102may be configured similarly as forwarding table510and WCMP table550for switch112, except forwarding table230stores entries for ports of switch102and WCMP table240stores weights based on connections at switch102. In some instances where the primary ports and the secondary ports are stored in separate lists, a forwarding table and/or a WCMP table may be provided for the primary ports and another forwarding table and/or WCMP table may be separately provided for the secondary ports. While the foregoing description ofFIG. 5provides one example in which weighting of flows may be achieved, it should be understood that other hardware related weighting schemes may alternatively or additionally be used. For example, the hardware may be able to take a weight along with each port and implement a hash algorithm such that particular ports may be picked more often than others based on their weight.

Returning toFIG. 3, the result of the first selection310includes 4 ports—port301on route R1, port305on route R5, port304on route R4, and port307on route R7. The first selection310may be configured to reduce the plurality of available ports to a set of a predetermined number of ports, or a predetermined faction/percentage of ports, etc. In the particular example shown, the predetermined number of ports resulting from the first selection310is 4. In other examples, the result of the first selection may include fewer or more ports (or smaller or greater fraction/percentage). For example, if port selection is to be more heavily based on static weight configurations, the selection based on static weight configurations may be used to narrow down the ports to a smaller set, such as 2 or 3 ports. In contrast, if port selection is to be less heavily based on static weight configurations, the selection based on static weight configurations may be used to narrow down the ports to a larger set, such as 5 or more ports. Although the example result of the first selection310includes both primary ports and secondary ports, in other examples the result of the first selection310may include only primary ports or only secondary ports.

To ensure there are both primary ports and secondary ports in the result of the first selection310, optionally the selection performed based on static weight configurations may be separately performed for the primary ports and the secondary ports. Thus and as further shown inFIG. 3, optionally a selection312may be performed based on weights assigned among the primary ports301,305, and306, resulting in the selection of primary ports301and305. A separate selection314may be performed based on weights assigned among the secondary ports304and306, resulting in the selection of secondary ports304and307. This way, the first selection310will result in both primary ports and secondary ports.

Next, in the second stage, the processors210may perform a second selection320based on adaptive parameters on the set of ports resulting from the first selection310.FIG. 6illustrates example adaptive routing parameters610. The adaptive routing parameters610may include a plurality of entries, with each entry identifying a port of the switch112through which packets may be forwarded, such as ports300-307ofFIG. 3. For each port, the corresponding route may be identified, such as routes R0-R7ofFIG. 3, as well as a length of each route, which may be considered the number of hops required to destination. Further as shown, network condition data, such as congestive data, may be provided for each route. The congestive data c1, c4, c5, c6, c7may be provided in any appropriate format, such as numerical values representing the amount of traffic in front of a current data packet, percentages compared to a predetermined maximum level of congestion, or another format. For example, congestion for a particular data packet from an output port to reach destination may be calculated as q*H, where q is the amount of queue space taken at the output port, and H is the number of remaining hops to the destination. The adaptive routing parameters610may further include heuristic based offsets. For example, congestion for the data packet from the output port to destination may be expressed as q*H+b, where b is the offset. The offset may be based on any of a number of factors, such as those specific to a condition in a system or a network. AlthoughFIG. 6illustrates adaptive routing parameters610in a table format, the adaptive routing parameters may be provided in any format, such as logs, tables, graphs, etc.

The processors210may perform the second selection320based on these adaptive routing parameters. For instance, the processors210may determine an estimated latency for each route based on the length of the route, the congestive data along the route, and/or heuristic offsets for the route. By way of example, the processors210may determine the estimated latency for each route using a linear function of the adaptive routing parameters610.

The processors210may then select the next port to transmit the packet based on latency, and may make the selection from the set resulting from the first selection310. Thus as shown, the processors210may determine that route R7has the lowest estimated latency amongst routes R1, R5, R4and R7, and select port307for transmitting the packet. As also shown, where the first selection310resulted in a set of ports including both primary and secondary ports, the second selection320may be made from a set including both primary and secondary ports. Thus, a longer route may be chosen if its estimated latency is lower.

Once the next port is selected, the one or more processors210may route the packet through the next port. For example, the one or more processors210may route the packet through port307on its way to route R7. However, once the packet arrives on the next port of route R7, network conditions may have changed. As such, the processors of the next switch116on route R7may re-evaluate the available ports and routes, and select the next port. For example, processors of the next switch116may perform similar selections as shown inFIG. 3, although the available ports, routes, and connections may be different. Depending on the static and/or adaptive parameters, the next port selected by the next switch116may or may not cause the packet to continue on route R7. For example, the next port selected by processors of switch116may be switch126, thus continuing the packet's progress along route R7, or it may be switch124, and thus changing the path of the packet to route R4. By selecting the next port after each hop, the packet may be transmitted through the optimal port and route, thereby optimizing its transmission and the overall condition of the network.

FIG. 7illustrates another example of routing packets according to aspects of the disclosure. The example ofFIG. 7shows selections performed in three stages. The routing may be performed by any switch of a network, for example by switch102of network100.FIG. 7shows many similar features asFIG. 3, which are labeled as such. However, the routing shown inFIG. 7includes selections in three stages. In the first stage, the first selection310may be the same as described with reference toFIG. 3, for example based on WCMP as described with reference toFIGS. 4 and 5. Thus, a first set of ports may result from the first selection310, which includes ports301,305,304, and307. Further, the first selection310may be separately performed for primary ports and secondary ports, via selections312and314as described with respect toFIG. 3.

In the second stage, the second selection720ofFIG. 7may be performed differently from the second selection320ofFIG. 3. In the second selection720, routes of equal lengths are compared against each other. Thus, where the first selection310resulted in a set of routes that have different lengths, those with the same lengths are compared against each other during second selection720. For instance and as shown, selection722compares route R1with route R5, each having a hop number of 3, while selection724compares route R4with route R7, each having a hop number of 4. Since the lengths of routes in each comparison are equal, processors210may perform the second selections722and724based on only congestive conditions and/or heuristic offsets for these routes, such as described with reference toFIG. 6. The second selection720may be configured to reduce the plurality of available ports to a set of a predetermined number of ports, or a predetermined fraction/percentage of ports, etc. In the particular example shown, the predetermined number of ports resulting from the second selection720is 2 for each route length (2 ports resulting from selection722for routes with 3 hops and 2 ports resulting from selection724for routes with 4 hops). In other examples, the results of each of the second selections722and724may include fewer or more ports (or a smaller or greater fraction/percentage) than the example shown inFIG. 7.

In the third stage, the processors210may perform a third selection730on the set of ports resulting from second selection720. In this regard, the processors210may determine an estimated latency for each route resulting from the second selection720, and choose the port along the route with the lowest latency. For example, processors210may determine that route R7has the lowest estimated latency amongst routes R1and R7, and select port307for transmitting the packet. As compared toFIG. 3, because processors performing routing based onFIG. 7do not need to estimate latency until the set of ports are further narrowed among routes of equal lengths, this may result in increased efficiency in determining the optimal route.

FIG. 8is an example flow diagram700for routing using static and adaptive routing. Flow diagram800may be performed by one or more processors of one or more switch devices ofFIG. 1, such as one or more processors210shown inFIG. 2. For example, processors210may receive data and make various determinations as shown in the flow diagram800.

Referring toFIG. 8, at block810, it is determined that a packet is to be transmitted to a destination. For example as shown inFIGS. 3 and 7, processors210of switch102may determine that a packet is to be transmitted to a computing device coupled to switch142. The packet may originate from a computing device coupled to switch102, or received from another switch in the network.

At block820, a next port is selected to be used for transmitting the packet. For example and as shown inFIGS. 3 and 7, processors210of switch102may determine that a plurality of ports300-307, each leading to a respective route R0-R7, may be used to transmit the packet. Further as shown, processors210may determine that one or more of the ports and/or routes may be inactive.

The selections may be performed in two stages or more stages. In a first stage, a set of ports are selected among a plurality of ports based on a static weight configuration associated with each of the plurality of ports. For instance as shown inFIGS. 3 and 7, processors210of switch102may make a first selection based on static parameters. Processors210may use static weight configurations as shown inFIG. 4, which may be stored in tables such as those shown inFIG. 5. Further as shown inFIGS. 3 and 7, the first selection based on static parameters may be separately performed for primary ports and secondary ports.

In a second stage, the next port is selected among the set of ports based on a number of hops required to reach the destination from each port of the set of ports and based on an estimated latency from each port of the set of ports to the destination. For instance as shown inFIGS. 3 and 7, processors210of switch102may make a second selection based on adaptive parameters. Processors210may consider number of hops, congestion data, and heuristics such as those shown inFIG. 6.

At block830, the packet is routed through the selected next port. For instance as shown inFIGS. 3 and 7, the packet may be transmitted through port307, to be transmitted through route R7. Once the packet reaches the next switch along route R7, the process ofFIG. 8may be repeated, which may result in selection of a next port that may or may not continue along route R7. Further, the process ofFIG. 8may be repeated until the packet reaches the destination.

The technology is advantageous because it provides efficient routing of packets in a network. By considering both static and adaptive routing parameters, the system may more effectively adapt to changing network conditions without losing sight of the static topology, such as link configurations downstream in the network. Further, by considering both static and adaptive routing parameters for a packet at each hop along a path to destination, routing paths for each packet may be optimized even as network conditions continue to change.