WO2014048339A1 - 路由更新方法、交换机及系统 - Google Patents

路由更新方法、交换机及系统 Download PDF

Info

Publication number
WO2014048339A1
WO2014048339A1 PCT/CN2013/084279 CN2013084279W WO2014048339A1 WO 2014048339 A1 WO2014048339 A1 WO 2014048339A1 CN 2013084279 W CN2013084279 W CN 2013084279W WO 2014048339 A1 WO2014048339 A1 WO 2014048339A1
Authority
WO
WIPO (PCT)
Prior art keywords
routing
unreachable
neighbor
reachable
update
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2013/084279
Other languages
English (en)
French (fr)
Inventor
邱谆
丁一
陈平平
钱波
丘子隽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to US14/431,594 priority Critical patent/US20150229560A1/en
Publication of WO2014048339A1 publication Critical patent/WO2014048339A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing

Definitions

  • the present invention claims the priority of the Chinese patent application filed on September 26, 2012, the Chinese Patent Office, the application number is 201210362754.2, and the invention is entitled "Routing Update Method, Switch and System", the entire contents thereof. This is incorporated herein by reference.
  • TECHNICAL FIELD The present invention relates to the field of computer networks, and in particular, to a route update method, a switch, and a system.
  • BACKGROUND OF THE INVENTION Routing protocols such as OSPF (Open Shortest Path First) protocol, BGP (Border Gateway Protocol) protocol, and ISIS (Classified Link State Routing Protocol) protocol, can implement any two nodes in the network. Communication between. For example, the switch can send OSPF protocol messages to all neighboring switches through all the output ports.
  • the OSPF protocol message is used to obtain the link status of the neighboring switches, and each adjacent switch sends the OSPF protocol message again. To all of its neighboring switches, and so on. In this way, since the link state information is frequently exchanged between the switches, all the switches can finally establish a link state database, which is actually the topology map of the entire network. Thus, each switch knows how many switches are in the entire network and which switches are connected. In this way, each switch can construct its own routing table using the shortest path routing algorithm based on the data in the link state database.
  • the data center network architecture shown in FIG. 1 has two types of switches in the data center network architecture, a "core switch” identified by C, and an “access switch” identified by A, wherein the core switch is only within the network. Other switches are connected, and the access switch is used to connect the core switch and the terminal devices in a specific network segment.
  • the number of core switches C in the data center network is usually 2 ⁇ 4, as shown in Figure 1, Cl, C2, C3, and C4; and the number of access switches A is at least 100, as shown in Figure 1. ⁇ An.
  • the data shown in Figure 1 After the OSPF routing protocol is running on the switch in the central network, the forwarding path from C to A is normally one hop. The forwarding path between any A is normally two hops. 4 forwarding paths, such as A1-[C1IC2IC3IC4]-A4.
  • the structure recalculates the forwarding path. For example, after the link between C1 and A4 is interrupted as shown in Figure 1, all switches must be recalculated to the forwarding path of A4. For example, A1 recalculates Al-C2-A4, A1-C3-A4, and A1-C4- The forwarding path of the A4 to A4 is one less than before the fault.
  • an embodiment of the present invention provides a route update method, a switch, and a system, so as to solve the problem that an existing route update method may cause some switches to perform many invalid calculations after a link failure occurs.
  • the technical solution is as follows:
  • a route update method includes:
  • the current device detects the link state of the at least two neighboring devices, where the neighboring device is an upstream device or a downstream device that is reachable by the current device;
  • the current device If the current device detects that the link state of the first neighboring device is unreachable, the current device selects a routing entry whose initial state is reachable among all the routing entries in the internal routing table that are corresponding to the first neighboring device. Set to unreachable;
  • the current device is set to not in the state of the at least one routing item due to the link state change. After the reachable, it is detected that all the routing entries corresponding to each target subnet in the internal routing table become unreachable. If all routing entries corresponding to one target subnet become unreachable, And sending a routing update message to the other neighboring devices that do not include the first neighboring device, so that the other neighboring device sets the routing entry in the internal routing table corresponding to both the current device and the target subnet as Unreachable.
  • the method further includes: the current device storing an internal routing table, and identifying, in the internal routing table, each routing item by using two-dimensional coordinates, the two-dimensional coordinate One of the coordinates is the neighbor device, and the other coordinate is the target subnet; for each routing item, if the coordinates of the routing item are passed to all of the current device to the target subnet The shortest path in the path, the routing item is always unreachable.
  • the method further includes:
  • the current device detects that the link state of the first neighboring device changes from unreachable to reachable, the current device sets the current device in the internal routing table corresponding to the first neighboring device. After the status of the at least one routing entry is restored to reachable, the switch detects whether all routing entries corresponding to each target subnet in the internal routing table are unreachable and become at least one reachable. If all the routing entries corresponding to one target subnet are detected to be at least one reachable, the routing update message is sent to other neighbor devices that do not include the first neighbor device, so that the neighbor device will use the internal routing table.
  • the method further includes:
  • the current device receives a routing update message of the second neighboring device, where the routing update message carries the identifier of the second neighboring device, the identifier of the target subnet, and whether the identifier is reachable;
  • the current device updates, by the current routing table, a routing item corresponding to the second neighboring device and the target subnet according to the identifier that is reachable, where the The new device includes the reachability of the routing entry being unreachable, or the unreachable recovery is reachable; the current device detects the internal route after the state of at least one routing entry is set to be unreachable due to the routing update. Whether all the routing entries corresponding to each target subnet in the table become unreachable. If all the routing entries corresponding to one target subnet become unreachable, the second is not included.
  • the neighboring device of the neighboring device sends a routing update message, so that the other neighboring device sets the routing entry corresponding to both the current device and the target subnet in the internal routing table to be unreachable;
  • the current device detects whether all routing entries corresponding to each target subnet in the internal routing table are unreachable. If at least one reachable is detected, if all routing entries corresponding to one target subnet are detected to be at least one reachable, a routing update message is sent to other neighbor devices that do not include the second neighbor device, so as to The neighbor device will be in the internal routing table.
  • the method further includes:
  • the time interval at which the current device sends a route update message to the neighboring device for the same routing entry is not less than a predetermined threshold.
  • a switch including:
  • a link detection module configured to detect a link state of at least two neighboring devices, where the neighbor device is an upstream device or a downstream device that is reachable by the switch;
  • a routing update module configured to: if the link detection module detects that the link state of the first neighboring device is unreachable, the initial state of all the routing entries corresponding to the first neighboring device in the internal routing table is The routing entry is set to be unreachable;
  • the update sending module is configured to detect, after the state of the at least one routing item is set to be unreachable, whether all routing entries corresponding to each target subnet in the internal routing table become unreachable If it is detected that all the routing entries corresponding to the target subnet become unreachable, send a routing update message to other neighboring devices that do not include the first neighboring device, so that the other neighboring devices will use the internal routing table.
  • the routing entry corresponding to both the switch and the target subnet is set to be unreachable.
  • the switch further includes:
  • the routing table storage module is configured to store an internal routing table, where each routing item is identified by a two-dimensional coordinate in the internal routing table, where one coordinate of the two-dimensional coordinates is the neighboring device, and another coordinate is The destination subnet is always unreachable if the path to the routing network is not the shortest path among all the paths of the current device to the target subnet. .
  • the route update module is further configured to: if the link detection module detects that the link state of the first neighbor device is unreachable and reachable, restore the reachability in the internal routing table to Reachable
  • the update sending module is further configured to detect, after the state of the at least one routing item is restored to reachable, respectively, whether all routing entries corresponding to each target subnet in the internal routing table are The unreachable becomes at least one reachable. If all the routing entries corresponding to one target subnet are detected to be at least one reachable, the route update message is sent to other neighbor devices that do not include the first neighbor device. Therefore, the neighboring device restores the routing entry corresponding to both the current device and the target subnet in the internal routing table from unreachable to reachable.
  • the switch further includes:
  • the message receiving module is configured to receive a route update message of the second neighboring device, where the route update message carries an identifier of the second neighboring device, an identifier of the target subnet, and an identifier of whether the device is reachable;
  • the routing update module is further configured to update, according to the identifier that is reachable by the routing entry corresponding to the second neighboring device and the target subnet in the internal routing table, the update This includes setting the reachability of the route entry to unreachable, or recovering from reachability to reachable.
  • the update sending module is further configured to: in the state of the at least one routing item, the routing update is After being set to be unreachable, it is detected that all routing entries corresponding to each target subnet in the internal routing table become unreachable. If all routing entries corresponding to one target subnet are detected, And sending, to the other neighboring devices that do not include the second neighboring device, a routing update message, so that the other neighboring device sends a routing entry corresponding to both the current device and the target subnet in the internal routing table. Set to unreachable;
  • the update sending module is further configured to: after detecting that the state of the at least one routing item is restored to reachable, respectively, detecting whether all routing entries corresponding to each target subnet in the internal routing table are All of the unreachables become at least one reachable, and if another neighbor device that detects a target second neighbor device sends a route update message, the neighbor device associates the current device with the current device and the target subnet. The routing entries corresponding to the two are restored from reachable to reachable.
  • the update sending module is further configured to send the routing update message to the neighboring device for the same routing item at a time interval that is not less than a predetermined threshold.
  • a network system including at least one switch according to another aspect, where the switch forms a switching network of two or more levels, and each switch only has a switch located at a higher level or The switches at the next level are connected.
  • the current device directly updates the internal routing table and does not notify other neighbor devices to update the internal routing table when it detects that the neighbor device is faulty. This solves the problem that the existing route update method will cause a link failure.
  • the switch performs a lot of invalid calculations, and the switch can only complete the routing update effect through the logical judgment of the single unit.
  • FIG. 1 is a schematic structural diagram of a data center network architecture in the prior art
  • FIG. 2 is an exemplary flowchart of a route update method according to Embodiment 1 of the present invention
  • FIG. 3A is an implementation environment according to Embodiment 2 of the present invention
  • FIG. 3B is an exemplary flowchart of a route update method according to Embodiment 2 of the present invention
  • FIG. 3C is an internal routing table of a plurality of switches in an initial state according to Embodiment 2 of the present invention
  • FIG. 3D is an embodiment of the present invention
  • An internal routing table of several switches after routing updates
  • FIG. 4A is a schematic structural diagram of an implementation environment according to Embodiment 3 of the present invention
  • FIG. 4B is an exemplary flowchart of a routing update method according to Embodiment 3 of the present invention
  • FIG. 4C is an initial state of a plurality of switches in Embodiment 3 of the present invention
  • the internal routing table is shown in FIG. 4D
  • FIG. 4D is an internal routing table after routing updates of several switches in Embodiment 3 of the present invention
  • FIG. 5 is a structural block diagram of a switch according to Embodiment 4 of the present invention.
  • FIG. 6 is a structural block diagram of a switch according to Embodiment 5 of the present invention.
  • FIG. 7 is a schematic structural diagram of a network system according to Embodiment 6 of the present invention.
  • FIG. 8 is a block diagram showing the structure of a switch provided in Embodiment 7 of the present invention.
  • FIG. 9 is a structural block diagram of a switch according to Embodiment 8 of the present invention.
  • Embodiment 1 is a structural block diagram of a switch according to Embodiment 8 of the present invention.
  • the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
  • Embodiment 1 is a structural block diagram of a switch according to Embodiment 8 of the present invention.
  • each device is only connected to a device located at a higher level or a device at a lower level.
  • a device connected to the current device and located at the upper level of the current device is called an "upstream device"; a device connected to the current device and located at the next level of the current device is called For "downstream equipment.”
  • the route update method specifically includes:
  • Step 201 The current device detects the link state of at least two neighboring devices, where the neighbor device is an upstream device or a downstream device that is reachable by the current device.
  • Step 202 If the current device detects that the link state of the first neighboring device is unreachable, the current device sets the routing entry whose initial state is reachable to all routing entries corresponding to the first neighboring device in the internal routing table. Da.
  • Step 203 After the status of the at least one routing item is set to be unreachable, the current device detects whether all routing entries corresponding to each target subnet in the internal routing table become unreachable. If all the routing entries corresponding to one target subnet become unreachable, the routing update message is sent to other neighboring devices except the first neighboring device, so that other neighboring devices can use the internal routing table and the current device. The routing entry corresponding to both the target subnet is unreachable.
  • the current device when the current device detects that the neighbor device is faulty, the current device directly updates the internal routing table by not calculating and selectively notifies other neighbor devices to update the internal routing table, thereby solving the problem.
  • the existing route update method may cause some switches to perform multiple invalid calculations after a link failure occurs, and the switch can only complete the routing update effect through the logical judgment of the single unit.
  • composition of the switching network An example of the composition of the switching network.
  • FIG. 3A shows a schematic structural diagram of an implementation environment involved in Embodiment 2 of the present invention.
  • the implementation environment is a switching network consisting of two switches in a data center. Each switch is only connected to a switch located at the upper level or a switch at the next level.
  • the switch connected to the current switch and located at the upper level of the current switch is called
  • Upstream device A switch connected to the current switch and located at the next level of the current switch is called a “downstream device.”
  • the implementation environment includes:
  • the four core switches Cl, C2, C3 and C4 are located in the upper level.
  • Each access switch is separately connected to the core switch.
  • A1 is connected to Cl, C2, C3 and C4 respectively;
  • A2 is connected to Cl, C2, C3 and C4 respectively;
  • A3 is connected to Cl, C2, C3 and C4 respectively.
  • Each access switch corresponds to a subnet.
  • the subnet of access switch A1 is the specific server access subnet 1 (subnetl) inside the data center;
  • the subnet of access switch A2 is the specific server inside the data center.
  • Access network segment subnet 2 subnet2
  • the border switch belongs to a special access switch.
  • the subnet corresponding to each border switch is the default route.
  • the border switch has the function of accessing the switch and runs other traditional routing protocols such as OSPF.
  • Network interconnection outside the data center That is, the border switch aggregates the internal routes of the data center and sends them to the outside to implement the requirements of data center and external interconnection.
  • Each border switch is also connected to the core switch.
  • B1 is connected to Cl, C2, C3 and C4 respectively
  • B2 is connected to Cl, C2, C3 and C4 respectively.
  • FIG. 3B an exemplary flowchart of a route update method provided by Embodiment 2 of the present invention is shown.
  • the routing update method is applied to the implementation environment shown in FIG. 3A as an example.
  • the upstream device or the downstream device connected to it is called a neighbor device.
  • the route update method specifically includes:
  • Step 301 The current device stores an internal routing table, and each routing item is identified by a two-dimensional coordinate in the internal routing table of the current device.
  • One coordinate in the two-dimensional coordinate is a neighbor device, and the other coordinate is a target subnet.
  • the path of the neighboring device corresponding to the coordinates of the routing entry to the target subnet corresponding to the coordinates of the routing entry is not the shortest of all paths from the current device to the target subnet
  • the path is always unreachable.
  • each switch stores an internal routing table in advance.
  • the forwarding path in the internal routing table is not the shortest path calculated in real time, but a fixed path based on the shortest path.
  • FIG. 3C an internal routing table of a plurality of switches in an initial state is shown. If the current device is the access switch A1, in the internal routing table of A1, each routing item is identified by two-dimensional coordinates, and the coordinates of the row in the two-dimensional coordinates are neighbor devices Cl, C2, C3, and C4, which are located in the column. The coordinates are the target subnet: subnet l ( subnetl ), subnet 2 ( subnet2 ), subnet 3 ( subnet3 ), , , , , and the default route ( default ).
  • the routing entry For each routing entry, if the number in the routing entry is 1, it means reachable. When the number in the routing entry is 0, it means unreachable. When the routing entry is blank, it is always unreachable. For example, for the target subnet subnet3, when the neighbor devices are Cl, C2, C3, and C4, they are both reachable and are the shortest two hops (2 hops) path; for example, for the target subnet subnetl, from the current The shortest path from the device A1 to the destination subnet subnet is itself. Therefore, the path from the neighbor device to the subnet1 is not the shortest path, so the routing entry in the first row is always unreachable.
  • each routing item is identified by two-dimensional coordinates, and the coordinates of the row in the two-dimensional coordinates are neighbor devices Al, A2, A3, ,,,,, An, Bl and B2, the coordinates of the column are the target subnet: subnet1 (subnetl), subnet 2 (subnet2), subnet 3 (subnet3), ,,, and the default route ( default ).
  • the number in the routing entry is 1 to indicate reachability. When the number in the routing entry is 0, it is unreachable. When the routing entry is blank, it is always unreachable.
  • the route to the subnet3 is the shortest 1 hop path, so the routing entry is reachable, but when the neighbor device is A1, it can pass C1.
  • a path such as -A1-C2-A3 leads to subnet3, but it is not the shortest path from C1 to subnet3, so the routing entry is always unreachable; for example, for the target subnet default, when the neighbor device is Bl or In B2, the route to B1 or B2 is the shortest 1 hop path, so the route entry is reachable, but when the neighbor device is A1 to An, it can pass C1-A1-C2-B1.
  • the path to default, but not the shortest path from C1 to default, so the corresponding routing item is always unreachable.
  • the current device is the boundary switch B1, in the internal routing table of B1, in two-dimensional coordinates Identifies each routing item.
  • the coordinates of the row in the 2D coordinates are the neighbor devices Cl, C2, C3, and C4.
  • the coordinates of the column are the target subnets: subnet l (subnetl), subnet 2 (subnet2), sub Net 3 ( subnet3 ), , , , , and default route ( default ).
  • For each routing entry if the number in the routing entry is 1, it means reachable. When the number in the routing entry is 0, it means unreachable. When the routing entry is blank, it is always unreachable.
  • the neighbor devices are Cl, C2, C3, and C4, they are both reachable and are the shortest 2 hops paths.
  • the target subnet default from the current device B1 to the target.
  • the shortest path of the subnet default is itself. Therefore, the path of the neighboring device to the default is not the shortest path, so the routing entry of the last line is always unreachable.
  • border switch B2 it is similar to border switch B1 and will not be described again.
  • Step 302 The current device detects the link state of at least two neighboring devices, where the neighbor device is an upstream device or a downstream device that is reachable by the current device.
  • the lhop-accessible devices are the core switches Cl, C2, C3, and C4 located at the upper level, so Al detects the link states of Cl, C2, C3, and C4, respectively.
  • A2 to An also detect the link states of Cl, C2, C3, and C4, respectively. If the current device is the core switch C1, the devices that are reachable by the lhop are the access switches A1 to An and the border switches Bl and B2 located at the next level, so C1 detects A1 to
  • C2 also detects link states of A1 to An, B1, and B2, respectively.
  • the lhop-accessible devices are the core switches Cl, C2, C3, and C4 located at the upper level, so B1 detects the link states of Cl, C2, C3, and C4, respectively.
  • B2 also detects the link states of Cl, C2, C3, and C4, respectively.
  • Step 303 If the current device detects that the link state of the first neighboring device is unreachable, the current device sets the routing entry whose initial state is reachable to all routing entries corresponding to the first neighboring device in the internal routing table. Da.
  • the first neighbor device is one of at least two neighbor devices of the current device. Among them, "first" is only for the convenience of description, and does not contain other special meanings.
  • A1 sets the routing entry whose initial state is reachable to all routing entries in the internal routing table. As shown in Figure 3D.
  • Step 304 After the status of the at least one routing item is set to be unreachable, the current device detects whether all routing entries corresponding to each target subnet in the internal routing table become unreachable. If all the routing entries corresponding to one target subnet become unreachable, the routing update message is sent to other neighboring devices except the first neighboring device, so that other neighboring devices can use the internal routing table and the current device. The routing entry corresponding to both the target subnet is unreachable.
  • A1 detects that the link state of C1 is unreachable.
  • A1 first sets the routing entries whose initial state is reachable to all routing entries in the internal routing table. Then, it is detected that all the routing entries corresponding to each target subnet in the internal routing table become unreachable, and it is detected that none of the routing entries corresponding to the target subnet becomes unreachable ( The destination subnet subnet2-default has four routing entries that are reachable, and now the corresponding three routing entries are reachable. Therefore, no subsequent processing is performed.
  • C1 sets the routing entries whose initial state is reachable to all the routing entries in the internal routing table. That is, the routing item corresponding to the first column of the first row is changed from "1" to "0", as shown in FIG. 3D;
  • C1 detects whether all the routing entries corresponding to each target subnet in the internal routing table become unreachable, and detects that all routing entries corresponding to subnet1 (subnetl) become unavailable. Up (that is, the routing entries in the first row all become unreachable), then C1 sends a routing update message to other neighbor devices except A1, so that other neighbor devices The routing entry corresponding to both C1 and subnet1 in the internal routing table is unreachable. As shown in Figure 3D, the routing entries corresponding to both C1 and subnet1 in A2 to An, B1, and B2. , all changed from "1" to "0".
  • Step 305 If the current device detects that the link state of the first neighboring device is unreachable and becomes reachable, the current device sets the initial state of all routing entries corresponding to the first neighboring device in the internal routing table to reachable. The item is restored from reachable to reachable.
  • C1 detects that the link state of A1 is reachable to reachable. Then, C1 restores the routing entries whose initial state is reachable to all the routing entries in the internal routing table. The reachable, that is, the routing entry corresponding to the first row of the first row is restored from "0" to "1", as shown in FIG. 3C.
  • Step 306 After the current state of the at least one routing item is restored to reachable, the current device detects whether all routing entries corresponding to each target subnet in the internal routing table are unreachable. At least one reachable, if it is detected that all routing entries corresponding to one target subnet are from unreachable to at least one reachable, send a routing update message to other neighbor devices that do not include the first neighbor device, so that the neighbor device The routing entries corresponding to both the current device and the target subnet in the internal routing table are restored from reachability to reachable.
  • C1 also detects whether all routing entries corresponding to each target subnet in the internal routing table are from unreachable to at least one reachable, and detecting that all routing entries corresponding to subnet1 are detected by If the unreachable becomes at least one reachable (that is, the route entry corresponding to the first row of the first row becomes reachable), C1 sends a route update message to other neighbor devices except A1, so that other The neighboring device restores the routing entries corresponding to both C1 and subnetl in the internal routing table from unreachable to reachable. As shown in Figure 3C, the routes corresponding to both C1 and subnet1 in A2 to An, B1, and B2. The item, all changed from "0" to "1".
  • the current device directly updates the internal routing table and selectively notifies other neighboring devices to update the internal routing table when the neighbor device fails to be detected, and the current device is resolved.
  • Some routing update methods may cause some switches to perform more than 4 invalid calculations after a link failure occurs. The switch can only complete the routing update effect through the logical judgment of the single unit.
  • FIG. 4A a schematic structural diagram of an implementation environment involved in Embodiment 3 of the present invention is shown.
  • the implementation environment is a switching network consisting of three switches in a data center.
  • the implementation environment includes:
  • the border switch belongs to a special access switch.
  • the subnet corresponding to each border switch is the default (default route).
  • the border switch runs the traditional routing protocol such as OSPF on the basis of the function of the access switch.
  • Network interconnection outside the data center That is, the border exchange device aggregates the data center internal routes and sends them to the outside to implement the requirements of data center and external interconnection.
  • Each border switch is also connected to the core switch. For example, B1 is connected to C1 and C2 respectively; B2 is connected to C1 and C2 respectively.
  • Each aggregation point switch is connected to a core switch.
  • G1 is connected to C1 and C2 respectively;
  • G3 is connected to C1 and C2, respectively.
  • Each of the aggregation point switches is further provided with a plurality of access switches, wherein G1 and G2 and the subordinate access switches form a first device cluster POD1; G3 and G4 and the subordinate access switches form a second device cluster POD2.
  • Each access switch corresponds to a subnet.
  • the subnet of access switch A1 is the specific server access subnet 1 (subnetl) inside the data center; the subnet of access switch A2 is the specific server inside the data center.
  • Access network segment subnet 2 subnet2 ), and so on.
  • the routing update method is applied to the implementation environment shown in FIG. 4A as an example.
  • the upstream device or the downstream device connected to it is called a neighbor device.
  • the route update method specifically includes: Step 401: The current device stores an internal routing table, and each routing item is identified by two-dimensional coordinates in an internal routing table of the current device. One coordinate in the two-dimensional coordinates is a neighbor device, and another coordinate is a target subnet.
  • the path of the neighboring device corresponding to the coordinates of the routing entry to the target subnet corresponding to the coordinates of the routing entry is not the shortest of all paths from the current device to the target subnet
  • the path is always unreachable.
  • each switch stores an internal routing table in advance.
  • the forwarding path in the internal routing table is not the shortest path calculated in real time, but a fixed path based on the shortest path.
  • FIG. 4C an internal routing table for a number of switches in an initial state is shown.
  • each routing item is identified by two-dimensional coordinates.
  • the coordinates of the row in the two-dimensional coordinates are neighbor devices G1 and G2, and the coordinates of the column are the target.
  • the number in the routing entry is 1 to indicate reachability. When the number in the routing entry is 0, it is unreachable. When the routing entry is blank, it is always unreachable. For example, for the target subnet subnet3, regardless of whether the neighbor devices are G1 and G2, they are reachable and are the shortest 2 hops paths.
  • the shortest path from the current device A1 to the target subnet subnet is itself, so no matter which neighbor device is, the path through the neighbor device to subnetl is not the shortest path, so the first line
  • the routing entry is always unreachable.
  • the access switches A2 to A8 are similar to the access switch A1 and will not be described again.
  • the current device is the aggregation point switch G1
  • each routing item is identified by two-dimensional coordinates, and the coordinates of the row in the two-dimensional coordinates are neighbor devices Al, A2, A3, A4, CI, and C2.
  • the coordinates of the column are the target subnets: subnet1, subnet2, subnet3, subnet8, subnet8, and default route.
  • For each routing entry if the number in the routing entry is 1, it means reachable; when the number in the routing entry is 0, it means unreachable; when the routing entry is blank, it means that it is always unreachable.
  • the path to the subnet3 through A3 is the shortest l hop path, so the routing entry is reachable, but when the neighbor is When the device is Al, although it can pass through a path such as G1-A1-G2-A3 to subnet3, but it is not the shortest path from G1 to subnet3, the routing item is always unreachable; for example, for the target sub If the neighbor device is C1 or C2, the path to C1 or C2 is the shortest 2 hop path. Therefore, the route entry is reachable. However, when the neighbor device is A1 to A4, the G1 can pass through G1.
  • a path such as -A1-G2-C1-B1 leads to default, but it is not the shortest path from G1 to default, so the corresponding routing entry is always unreachable.
  • the aggregation point switches G2, G3, and G4 are similar to the aggregation point switch G1 and will not be described again.
  • each routing item is identified by two-dimensional coordinates, and the coordinates of the row in the two-dimensional coordinates are neighbor devices G1, G2, G3, G4, Bl, and B2,
  • the coordinates of the column are the target subnets: subnet1 (subnetl), subnet 2 (subnet2), subnet 3 (subnet3), ,, , subnet 8 (subnet8), and default route (default) hail for each If the number in the routing entry is 1, it means reachable; when the number in the routing entry is 0, it means unreachable; when the routing entry is blank, it means that it is always unreachable.
  • the path to the subnet3 through G1 is the shortest 2 hop path. Therefore, the route entry is reachable.
  • the neighbor device is G3, it can pass C1-G3-C2-G1-A3. The path to subnet3, but not the shortest path from C1 to subnet3, so the routing entry is always unreachable.
  • core switch C2 it is similar to core switch C1 and will not be described again.
  • each routing item is identified by two-dimensional coordinates.
  • the coordinates of the row in the two-dimensional coordinates are neighbor devices C1 and C2, and the coordinates of the column are the target subnet. : subnet1, subnet2, subnet3, subnet8, subnet8, and default route (default).
  • For each routing entry if the number in the routing entry is 1, it means reachable; when the number in the routing entry is 0, it means unreachable; when the routing entry is blank, it means that it is always unreachable.
  • the neighbor devices are C1 and C2, they are all reachable and are the shortest 3 hops paths; for example, for the target subnet default, from the current device Bl to the target subnet default
  • the shortest path is itself, so no matter which neighbor device is, it passes through the neighbor device.
  • the path to default is not the shortest path, so the routing entry in the third row is always unreachable.
  • the border switch B2 it is similar to the border switch B1 and will not be described again.
  • Step 402 The current device detects the link state of at least two neighboring devices, where the neighbor device is an upstream device or a downstream device that is reachable by the current device.
  • the device whose lhop is reachable is the aggregation point switches G1 and G2 located at the upper level, so A1 detects the link status of G1 and G2 respectively.
  • A2 to A4 also detect the link states of Gl and G2, respectively.
  • A5 to A8 detect the link status of G3 and G4, respectively.
  • the devices whose 1 hop is reachable are the aggregation point switches C1 and C2 located at the upper level, and the access switches Al, A2, A3 and the next level.
  • the G1 detects link states of A1 to A4, C1 and C2, respectively.
  • G2 also detects the link status of A1 to A4, C1 and C2.
  • G4 detects the link status of A5 to A8, C1 and C2, respectively.
  • the lhop-accessible devices are the aggregation point switches G1 to G4 and the border switches Bl and B2 located at the next level, so C1 detects the link states of G1 to G4, B1, and B2, respectively.
  • C2 also detects the link states of G1 to G4, B1 and B2, respectively.
  • the devices whose lhops are reachable are the core switches C1 and C2 located at the upper level, so B1 detects the link states of C1 and C2 respectively.
  • B2 also detects the link status of C1 and C2, respectively.
  • Step 403 If the current device detects that the link state of the first neighboring device is unreachable, the current device sets the routing entry whose initial state is reachable to all routing entries corresponding to the first neighboring device in the internal routing table. Da.
  • the first neighbor device is one of the at least two neighbor devices of the current device.
  • “first” is only for the convenience of description, and does not contain other special meanings.
  • the default routes of B1 and B1 are used for example.
  • the data center does not need to access the external network, and the default routes of B1 and B2 are revoked.
  • the default routes of B1 and B2 are revoked.
  • C1 sets the routing entry whose initial state is reachable to all routing entries in the internal routing table and B1 and B2. Unreachable, that is, the routing entry whose initial state is "1" in the routing entry of the last row is set to "0", as shown in Figure 4D.
  • the core switch C2 will also set the routing entries whose initial state is reachable to all routing entries in the internal routing table and B1 and B2 to be unreachable, that is, the initial state of the last row of routing entries is "1".
  • the routing entry is set to "0" as shown in Figure 4D.
  • Step 404 After the status of the at least one routing item is set to be unreachable, the current device detects whether all routing entries corresponding to each target subnet in the internal routing table become unreachable. If all the routing entries corresponding to a target subnet become unreachable, the routing update message is sent to other neighbor devices that do not include the first neighboring device, so that other neighboring devices can associate the internal routing table with the current device. The routing entry corresponding to both the target subnet is unreachable.
  • C1 sets the routing entries whose initial state is reachable to all routing entries in the internal routing table and B1 and B2. After that, C1 detects the internal routing table and each. All the routing entries corresponding to the target subnet become unreachable. All the routing entries corresponding to the default are unreachable (that is, all the routing entries in the last row become unreachable). Then, C1 sends a routing update message to other neighboring devices except B1 and B2, so that other neighboring devices set the routing entries corresponding to both C1 and default in the internal routing table to be unreachable, as shown in FIG. 4D. The routing entries corresponding to both CI and default in Gl, G2, G3, and G4 are changed from "1" to "0".
  • C2 also detects each target sub-in the internal routing table. If all the routing entries corresponding to the network become unreachable, all the routing entries corresponding to the default are unreachable (that is, all the routing entries in the last row become unreachable), then C2 Send routing update messages to neighbors other than B1 and B2 so that other neighbors will have internal routing tables with C2 and default The routing entries corresponding to the two are unreachable. As shown in Figure 4D, the routing entries corresponding to both C2 and default in Gl, G2, G3, and G4 are changed from "1" to "0".
  • Step 402 to step 403 is that the current device triggers the route update by detecting the link state of the neighbor device. Obviously, the current device can also trigger routing updates by receiving routing update messages from neighbors. Please refer to the following steps:
  • Step 405 The current device receives a route update message of the second neighbor device, where the route update message carries the identifier of the second neighbor device, the identifier of the target subnet, and an identifier of whether the device is reachable.
  • Step 406 The current device updates the routing entry corresponding to the second neighboring device and the target subnet in the internal routing table according to the identifier that is reachable.
  • the updating includes setting the state of the routing entry from reachable to unreachable. Or, it is restored from reachability to reachable.
  • Step 407 After the status of the at least one routing item is set to be unreachable, the current device detects whether all routing entries corresponding to each target subnet in the internal routing table become unreachable, if If all the routing entries corresponding to a target subnet are unreachable, the routing update message is sent to other neighbor devices that do not include the second neighboring device, so that other neighboring devices have the internal routing table and the current device and the target subnet. The corresponding routing entry is set to be unreachable.
  • Step 408 After the current state of the at least one routing item is restored to reachable, the current device detects whether all routing entries corresponding to each target subnet in the internal routing table are unreachable and become at least one If it is detected that all the routing entries corresponding to one target subnet are from unreachable to at least one reachable, the routing update message is sent to other neighbor devices that do not include the second neighbor device, so that the neighbor device will be internal. The routing entry corresponding to both the current device and the target subnet in the routing table is restored from reachable to reachable.
  • G1 can receive a routing update message from C1, where the routing update message includes the C1 identifier, the default identifier, and the unreachable identifier. Then, G1 will internalize the routing table with C1 and The routing entry corresponding to both defaults from "1" to "0".
  • G1 will also receive a routing update message from C2, which is in the routing update message.
  • the identifier of C2, the identifier of default, and the identifier of unreachable are included. Then, G1 updates the routing entry corresponding to both C2 and default in the internal routing table from "1" to "0".
  • G1 will detect whether all the routing entries corresponding to each target subnet in the internal routing table become unreachable, and find that all routing entries corresponding to default become unreachable (that is, If the routing entries of the last row become unreachable, G1 sends a routing update message to other neighboring devices A1 to A4 that do not include C1 and C2, so that A1 to A4 correspond to both G1 and default in the internal routing table.
  • the routing entry is updated from "1" to "0".
  • G2, G3 and G4 will also perform the same operation as G1, and the final routing updated internal routing table is shown in Figure 4D.
  • the corresponding route update process is basically the reverse process of the above process, and will not be described again.
  • the time interval at which the current device sends a routing update message to the neighboring device for the same routing entry is not less than a predetermined threshold. That is, if the current device needs to send a routing update message to the neighboring device for the same routing entry, the interval between the sending times of the two routing update messages is not less than a predetermined threshold, in order to avoid route flapping.
  • the predetermined threshold may be 2 seconds, or other value specified by the designer.
  • the route update method provided in this embodiment not only has the advantages of the previous embodiment, but also receives the route update message of the second neighbor device, directly updates the internal routing table without calculation, and selectively does not include
  • the other neighboring devices of the second neighboring device reflect the routing update message, which solves the problem that the existing routing update method causes some switches to perform many invalid calculations after the link failure occurs, and the switch only needs to pass the logical judgment of the single unit. You can complete the effect of routing updates.
  • the following examples are illustrative of apparatus embodiments of the present invention and may be used to carry out embodiments of the methods of the present invention. For technical details not disclosed in the embodiment of the apparatus of the present invention, reference is made to the method embodiment of the present invention.
  • FIG. 5 is a structural block diagram of a switch according to Embodiment 4 of the present invention.
  • the switch can be one of a core switch, a convergence point switch, an access switch, and a border switch.
  • the switch includes a link detection module 520, a route update module 540, and an update transmission module 560.
  • the link detection module 520 is configured to detect a link state of at least two neighboring devices, where the neighbor device is an upstream device or a downstream device that is reachable by the switch.
  • the routing update module 540 is configured to: if the link detection module 520 detects that the link state of the first neighboring device is unreachable, the initial state of all the routing entries corresponding to the first neighboring device in the internal routing table is The reachable route entry is set to be unreachable.
  • the update sending module 560 is configured to detect, after the status of the at least one routing item is set to be unreachable by the routing update module 540, whether the routing entries corresponding to each target subnet in the internal routing table are respectively detected. If all the routing entries corresponding to one target subnet become unreachable, the routing update message is sent to other neighbor devices that do not include the first neighboring device, so that the other The neighboring device sets the routing entry corresponding to both the switch and the target subnet in the internal routing table to be unreachable.
  • the switch provided in this embodiment solves the existing routing update by directly updating the internal routing table and notifying other neighboring devices to update the internal routing table when the neighbor device fails to be detected.
  • the method may cause some switches to perform a lot of invalid calculations after a link failure occurs.
  • the switch can only complete the routing update effect through the logical judgment of the single unit.
  • FIG. 6 is a structural block diagram of a switch provided in Embodiment 5 of the present invention.
  • the switch can be one of a core switch, a convergence point switch, an access switch, and a border switch.
  • the switch includes a routing table storage module 510, a link detection module 520, a message receiving module 530, a routing update module 540, and an update sending module 560.
  • the routing table storage module 510 is configured to store an internal routing table, where each routing item is identified by a two-dimensional coordinate in the internal routing table, where one coordinate of the two-dimensional coordinates is the neighboring device, and another The coordinates are the target subnet; for each routing item, if The path of the target subnet is not the shortest path among all paths of the current device to the target subnet, and the routing entry is always unreachable.
  • the link detection module 520 is configured to detect a link state of at least two neighboring devices, where the neighboring device is an upstream device or a downstream device that is reachable by the switch.
  • the routing update module 540 is configured to: if the link detection module 520 detects that the link state of the first neighboring device is unreachable, the initial state of all the routing entries corresponding to the first neighboring device in the internal routing table is The reachable route entry is set to be unreachable.
  • the update sending module 560 is configured to detect, after the status of the at least one routing item is set to be unreachable by the routing update module 540, whether the routing entries corresponding to each target subnet in the internal routing table are respectively detected. If all the routing entries corresponding to one target subnet become unreachable, the routing update message is sent to other neighbor devices that do not include the first neighboring device, so that the other The neighboring device sets the routing entry corresponding to both the switch and the target subnet in the internal routing table to be unreachable.
  • the route update module 540 is further configured to: if the link detection module 520 detects that the link state of the first neighbor device is unreachable and reachable, the internal routing table is restored to the reachable state. .
  • the update sending module 560 is further configured to detect, after the state of the at least one routing item is restored to be reachable by the route update module 540, the link corresponding to each target subnet in the internal routing table. If the routing entry is from unreachable to at least one less than one reachable, sending a routing update message to other neighboring devices that do not include the first neighboring device, so that the neighboring device compares the internal routing table with the current device and The routing entry corresponding to the target subnet is restored from reachable to reachable.
  • the message receiving module 530 is configured to receive a routing update message of the second neighboring device, where the routing update message carries the identifier of the second neighboring device, the identifier of the target subnet, and an identifier that is reachable.
  • the routing update module 540 is further configured to: according to the message receiving module 530, a routing item corresponding to both the second neighboring device and the target subnet in the internal routing table. Whether the received reachable identifier is updated, the update includes setting the reachability of the route entry to be unreachable, or recovering from reachability to reachable.
  • the update sending module 560 is further configured to detect, after the state of the at least one routing item is set to be unreachable by the routing update module 540, the routing entries respectively detect all routing entries corresponding to each target subnet in the internal routing table. Whether it is all unreachable, if it is detected that all routing entries corresponding to one target subnet become unreachable, sending a routing update message to other neighbor devices not including the second neighboring device, so that The other neighboring device sets the routing entry corresponding to the current device and the target subnet in the internal routing table to be unreachable;
  • the update sending module 560 is further configured to detect, after the state of the at least one routing item is restored to be reachable by the routing update module 540, that the internal routing table corresponds to each target subnet respectively. If all the routing entries are from unreachable to at least one at least one reachable, the routing update message is sent to other neighboring devices that do not include the second neighboring device, so that the neighboring device compares the current routing table with the current The routing entry corresponding to both the device and the target subnet is restored from reachable to reachable.
  • the update sending module 560 is further configured to send the routing update message to the neighboring device for the same routing item at a time interval that is not less than a predetermined threshold.
  • the switch provided in this embodiment not only has the advantages of the previous embodiment, but also receives the routing update message of the second neighboring device, directly updates the internal routing table without calculation, and selectively does not include the second.
  • the other neighboring devices of the neighboring device reflect the routing update message, which solves the problem that the existing routing update method causes some switches to perform many invalid calculations after the link failure occurs.
  • the switch only needs to pass the logical judgment of the single unit. Complete the effect of routing updates.
  • FIG. 7 is a schematic structural diagram of a network system according to Embodiment 6 of the present invention.
  • the network system includes at least one switch 720 as provided in Embodiment 4 or Embodiment 5, and the switch 720 forms a switching network of two or more levels, and each switch It is only connected to the switch located at the upper level or the switch at the next level.
  • the serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
  • modules in the apparatus in the above examples may be distributed in the device of the example according to the description of the examples, or may be correspondingly changed in one or more devices different from the present example.
  • the modules of the above examples may be combined into one module, or may be further split into multiple sub-modules.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.
  • the program code can be downloaded from the server computer by the communication network.
  • a system or apparatus provided with a storage medium on which software program code implementing the functions of any of the above-described embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus is stored
  • the program code stored in the storage medium is read and executed.
  • Figures 8 and 9 show still another schematic diagram of a switch in accordance with an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a switch provided in Embodiment 7 of the present invention.
  • the switch can include a memory 820 and a processor 810 in communication with the memory 820, wherein the memory 820 stores link probe instructions 821, routing update instructions 822, and update send instructions 823 that are executable by the processor 810. .
  • the link detection command 821 is used to indicate the link state of the at least two neighboring devices.
  • the neighbor device is an upstream device or a downstream device that is reachable by the switch.
  • the routing update instruction 822 is configured to indicate that if the link state of the first neighboring device is detected as unreachable by executing the link detection command 821, the first routing update sending instruction 823 in the internal routing table is used in the After the status of the at least one routing item is set to be unreachable by executing the routing update command 822, the link status of each of the internal routing tables is determined to be unreachable. If the neighboring device of the neighboring device detects that the routing update message is sent, the other neighboring device sets the routing entry corresponding to the switch and the target subnet in the internal routing table to be unreachable.
  • FIG. 9 shows a schematic structural view of a switch provided in Embodiment 8 of the present invention.
  • the switch can include a memory 920 and a processor 910 in communication with the memory 920, wherein the memory 920 stores link detect instructions 921, routing update instructions 922, update send instructions 923 that are executable by the processor 910. And the message receives the instruction 924.
  • an internal routing table is also stored in the memory 920.
  • Each routing item is identified by two-dimensional coordinates in the internal routing table, one coordinate of the two-dimensional coordinates is the neighboring device, and another coordinate is the target subnet; for the coordinates of the routing item
  • the path of the corresponding target subnet is not the shortest path among all the paths of the current device to the target subnet, and the routing item is always unreachable.
  • the link detection command 921 is used to indicate the link state of the at least two neighboring devices, and the neighbor device is an upstream device or a downstream device that is reachable by the switch.
  • the routing update command 922 is configured to indicate that if the link state of the first neighbor device is detected as unreachable by executing the link detection command 921, the first routing update sending command 923 in the internal routing table is used to indicate The state of at least one routing entry is changed due to the link state.
  • the routing update command 922 is set to be unreachable, it is detected whether all routing entries corresponding to each target subnet in the internal routing table become unreachable, and if a target subnet is detected If all the corresponding routing entries become unreachable, the routing update message is sent to other neighboring devices that do not include the first neighboring device, so that the other neighboring devices associate the internal routing table with the switch and the target. The routing entry corresponding to both subnets is unreachable.
  • the routing update instruction 922 is further configured to: if the link state of the first neighboring device is detected to be reachable from being unreachable by performing the link detection command 921, the internal routing entry is restored from unreachable to Reachable.
  • the update sending instruction 923 is further configured to: after detecting that the state of the at least one routing item is restored to reachable by performing the routing update command 922, the internal routing table and each target subnet are respectively detected. If all the corresponding routing entries are unreachable and become at least one reachable, if all routing entries corresponding to one target subnet are detected to be at least one reachable, the first neighbor is not included.
  • the neighboring device of the device sends a routing update message, so that the neighboring device restores the routing entry corresponding to both the current device and the target subnet in the internal routing table from unreachable to reachable.
  • the message receiving instruction 924 is configured to receive a routing update message of the second neighboring device, where the routing update message carries the identifier of the second neighboring device, the identifier of the target subnet, and an identifier of whether the device is reachable.
  • the routing update instruction 922 is further configured to: update an identifier of the internal routing table that is reachable by the first information receiving instruction 924, where the update includes: setting a status of the routing item to reach It is unreachable, or it is restored to reachable by unreachable.
  • the update sending instruction 923 is further configured to: after the state of the at least one routing item is set to be unreachable by performing the routing update command 922, respectively, detecting, respectively, corresponding to each target subnet in the internal routing table. Whether all the routing entries become unreachable, if other neighboring devices of the second neighboring device send a routing update message, so that the other neighbors The device sets the routing entry corresponding to both the current device and the target subnet in the internal routing table to be unreachable;
  • the update sending instruction 923 is further configured to: after detecting that the state of the at least one routing item is restored to reachable by performing the routing update command 922, the internal routing table and each target sub-detection are respectively detected. If all the routing entries corresponding to the network are unreachable and become at least one reachable, if all the routing entries corresponding to one target subnet are detected to be at least one reachable, then the first is not included.
  • the neighboring device of the neighboring device sends a routing update message, so that the neighboring device restores the routing entry corresponding to both the current device and the target subnet in the internal routing table from unreachable to reachable.
  • the update sending instruction 923 is further configured to indicate that the time interval for sending the routing update message to the neighboring device for the same routing item is not less than a predetermined threshold.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Description

路由更新方法、 交换机及系统 本申请要求于 2012 年 09 月 26 日提交中国专利局、 申请号为 201210362754.2、 发明名称为"路由更新方法、 交换机及系统 "的中国专 利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域 本发明涉及计算机网络领域, 特别涉及一种路由更新方法、 交换机 及系统。 发明背景 路由协议, 如 OSPF ( Open Shortest Path First, 开放最短路径优先 ) 协议、 BGP ( Border Gateway Protocol, 边界网关协议)协议及 ISIS (分 级的链路状态路由协议)协议可以实现网络内任意两节点间的通信。 例 如, 交换机可以通过所有的输出端口向所有相邻的交换机发送 OSPF协 议消息, 该 OSPF协议消息用于获取相邻交换机的链路状态, 而每一个 相邻的交换机又再将该 OSPF协议消息发往其所有的相邻交换机, 依次 类推。 这样, 由于各交换机间频繁地交换链路状态信息, 因此, 所有的 交换机最终都能建立一个链路状态数据库, 这个链路状态数据库实际上 就是整个网络的拓朴结构图。 由此, 每一个交换机都知道整个网络内共 有多少个交换机, 以及哪些交换机是相连的。 这样, 每一个交换机就可 以根据该链路状态数据库中的数据采用最短路径路由算法来构建自己 的路由表。
例如图 1所示的数据中心网络架构, 该数据中心网络架构中有两类 交换机, 由 C标识的 "核心交换机 "及由 A标识的 "接入交换机", 其中, 核心交换机仅与网络内的其他交换机相连, 而接入交换机则用于连接所 述核心交换机及具体网段内的终端设备。 该数据中心网络中的核心交换 机 C的数量通常是 2~4台, 如图 1中的 Cl、 C2、 C3及 C4; 而接入交 换机 A的数量至少在 100台,如图 1给出的 Al~An。在图 1所示的数据 中心网络内的交换机运行 OSPF路由协议后, C到 A的转发路径正常情 况下都是单跳( one hop )的, 任意 A之间的转发路径正常情况下都是两 跳(two hops ), 有 4条转发路径, 如 A1-[C1IC2IC3IC4]-A4。
在网络运行的过程中, 只要有一个交换机的链路状态发生了变化, 整个网络就要重新通过 OSPF协议来获取新的网络拓朴结构, 网络中的 所有交换机都要根据该新的网络拓朴结构重新计算转发路径。 例如, 如 图 1所示的 C1到 A4间的链路中断后, 所有交换机要重新计算至 A4的 转发路径, 如 A1重新计算出 Al-C2-A4、 A1-C3-A4和 A1-C4-A4这 3 条至 A4的转发路径, 比故障前少了 1条。 这种当网络内出现交换机的 链路状态发生变化, 所有交换机就要重新计算转发路径的情况, 将会导 致交换机计算资源的浪费, 也不利于整个路由信息维护的收敛。 具体以 C1为例来讲, C1还会计算至 A4的 3 hops (故障前是 1 hop )绕行路径: Cl-[AllA2IA3IA5IAn]-[C2IC3IC4]-A4,一共是 3*( n-2 )条,当假设 n=102, 那么 C1-A4链路故障后, C1会计算出 300条至 A4的绕行路径, 而实际 上, 没有任何一台 A会选择 C1至 A4的转发路径, 因此 C1计算的绕行 路径实际上是无效的, 但这种无效计算会占用 C1 大量的计算资源, 最 终造成交换机的设计变得较为复杂, 成本高昂。 发明内容 有鉴于此,本发明实施例提供了一种路由更新方法、交换机及系统, 以便解决现有的路由更新方法在出现链路故障后会导致部分交换机进 行很多无效计算的问题。 所述技术方案如下:
一个方面, 提供了一种路由更新方法, 所述方法包括:
当前设备探测至少两个邻居设备的链路状态, 所述邻居设备为所述 当前设备一跳可达的上游设备或者下游设备;
若所述当前设备探测到第一邻居设备的链路状态为不可达, 则所述 当前设备将内部路由表中与所述第一邻居设备对应的所有路由项中初 始状态为可达的路由项置为不可达;
所述当前设备在至少一个路由项的状态因链路状态改变被置为不 可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项 是否变成均为不可达, 若检测到一个目标子网所对应的所有路由项变成 均为不可达, 则向不包括所述第一邻居设备的其它邻居设备发送路由更 新消息, 以便所述其它邻居设备将内部路由表中与所述当前设备和所述 目标子网两者均对应的路由项置为不可达。
进一步地, 所述当前设备探测邻居设备的链路状态之前, 还包括: 所述当前设备存储内部路由表, 在所述内部路由表中以二维坐标标 识每个路由项, 所述二维坐标中的一个坐标为所述邻居设备, 另一个坐 标为所述目标子网; 对于每个路由项, 若经过与所述路由项的坐标所对 所述当前设备通往所述目标子网的所有路径中的最短路径, 则所述路由 项始终为不可达。
进一步地, 所述方法, 还包括:
若所述当前设备探测到所述第一邻居设备的链路状态由不可达变 为可达, 则所述当前设备将内部路由表中与所述第一邻居设备对应的所 所述当前设备在至少一个路由项的状态因链路状态改变被恢复为 可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项 是否由均为不可达变成至少一个可达, 若检测到一个目标子网所对应的 所有路由项由均为不可达变成至少一个可达, 则向不包括第一邻居设备 的其它邻居设备发送路由更新消息, 以便所述邻居设备将内部路由表中
;达。 * ' 进一步地, 所述方法, 还包括:
所述当前设备接收第二邻居设备的路由更新消息, 所述路由更新消 息携带有所述第二邻居设备的标识、 目标子网的标识和是否可达的标 识;
所述当前设备将所述内部路由表中与所述第二邻居设备和所述目 标子网两者均对应的路由项根据所述是否可达的标识进行更新, 所述更 新包括将路由项的状态有可达置为不可达,或者, 由不可达恢复为可达; 所述当前设备在至少一个路由项的状态因路由更新被置为不可达 之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项是否 变成均为不可达, 若检测到一个目标子网所对应的所有路由项变成均为 不可达, 则向不包括所述第二邻居设备的其它邻居设备发送路由更新消 息, 以便所述其它邻居设备将内部路由表中与所述当前设备和所述目标 子网两者均对应的路由项置为不可达;
和 /或,所述当前设备在至少一个路由项的状态因路由更新被恢复为 可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项 是否由均为不可达变成至少一个可达, 若检测到一个目标子网所对应的 所有路由项由均为不可达变成至少一个可达, 则向不包括第二邻居设备 的其它邻居设备发送路由更新消息, 以便所述邻居设备将内部路由表中
;达。 * ' 进一步地, 所述方法, 还包括:
所述当前设备向所述邻居设备针对同一路由项发送路由更新消息 的时间间隔不小于预定阈值。
另一方面, 提供了一种交换机, 包括:
链路探测模块, 用于探测至少两个邻居设备的链路状态, 所述邻居 设备为所述交换机一跳可达的上游设备或者下游设备;
路由更新模块, 用于若所述链路探测模块探测到第一邻居设备的链 路状态为不可达, 则将内部路由表中与所述第一邻居设备对应的所有路 由项中初始状态为可达的路由项置为不可达;
更新发送模块, 用于在至少一个路由项的状态因链路状态改变被置 为不可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路 由项是否变成均为不可达, 若检测到一个目标子网所对应的所有路由项 变成均为不可达, 则向不包括所述第一邻居设备的其它邻居设备发送路 由更新消息, 以便所述其它邻居设备将内部路由表中与所述交换机和所 述目标子网两者均对应的路由项置为不可达。 进一步地, 所述交换机, 还包括:
路由表存储模块;
所述路由表存储模块, 用于存储内部路由表, 在所述内部路由表中 以二维坐标标识每个路由项, 所述二维坐标中的一个坐标为所述邻居设 备, 另一个坐标为所述目标子网; 对于每个路由项, 若经过与所述路由 网的路径并非所述当前设备通往所述目标子网的所有路径中的最短路 径, 则所述路由项始终为不可达。
进一步地, 所述路由更新模块, 还用于若所述链路探测模块探测到 所述第一邻居设备的链路状态由不可达变为可达, 则将内部路由表中与 可达恢复为可达;
所述更新发送模块, 还用于在至少一个路由项的状态因链路状态改 变被恢复为可达之后, 分别检测内部路由表中与每个目标子网所对应的 所有路由项是否由均为不可达变成至少一个可达, 若检测到一个目标子 网所对应的所有路由项由均为不可达变成至少一个可达, 则向不包括第 一邻居设备的其它邻居设备发送路由更新消息, 以便所述邻居设备将内 部路由表中与所述当前设备和所述目标子网两者均对应的路由项由不 可达恢复为可达。
进一步地, 所述交换机, 还包括:
消息接收模块;
所述消息接收模块, 用于接收第二邻居设备的路由更新消息, 所述 路由更新消息携带有所述第二邻居设备的标识、 目标子网的标识和是否 可达的标识;
所述路由更新模块, 还用于将所述内部路由表中与所述第二邻居设 备和所述目标子网两者均对应的路由项根据所述是否可达的标识进行 更新, 所述更新包括将路由项的状态有可达置为不可达, 或者, 由不可 达恢复为可达;
所述更新发送模块, 还用于在至少一个路由项的状态因路由更新被 置为不可达之后, 分别检测内部路由表中与每个目标子网所对应的所有 路由项是否变成均为不可达, 若检测到一个目标子网所对应的所有路由 项变成均为不可达, 则向不包括所述第二邻居设备的其它邻居设备发送 路由更新消息, 以便所述其它邻居设备将内部路由表中与所述当前设备 和所述目标子网两者均对应的路由项置为不可达;
和 /或, 所述更新发送模块, 还用于在至少一个路由项的状态因路由 更新被恢复为可达之后, 分别检测内部路由表中与每个目标子网所对应 的所有路由项是否由均为不可达变成至少一个可达, 若检测到一个目标 第二邻居设备的其它邻居设备发送路由更新消息, 以便所述邻居设备将 内部路由表中与所述当前设备和所述目标子网两者均对应的路由项由 不可达恢复为可达。
进一步地, 所述更新发送模块, 还用于向所述邻居设备针对同一路 由项发送路由更新消息的时间间隔不小于预定阈值。
又一发面, 提供了一种网络系统, 包括至少一个如另一方面所述的 交换机, 所述交换机组成两级或者两级以上的交换网络, 每个交换机只 与位于上一级的交换机或者位于下一级的交换机相连。
本发明实施例提供的技术方案带来的有益效果是:
当前设备通过在探测到邻居设备发生故障时, 不计算而直接更新内 部路由表和选择性地通知其他邻居设备更新内部路由表, 解决了现有的 路由更新方法在出现链路故障后会导致部分交换机进行很多无效计算 的问题, 达到了交换机仅需要通过筒单地逻辑判断, 就可以完成路由更 新的效果。 附图简要说明 为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描 述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图 仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出 创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1是现有技术中的一种数据中心网络架构的结构示意图; 图 2是本发明实施例一提供的路由更新方法的示例性流程图; 图 3A是本发明实施例二所涉及的实施环境的结构示意图; 图 3B是本发明实施例二提供的路由更新方法的示例性流程图; 图 3C是本发明实施例二中若干交换机在初始状态下的内部路由表; 图 3D是本发明实施例二中若干交换机在路由更新之后的内部路由 表;
图 4A是本发明实施例三所涉及的实施环境的结构示意图; 图 4B是本发明实施例三提供的路由更新方法的示例性流程图; 图 4C是本发明实施例三中若干交换机在初始状态下的内部路由表; 图 4D是本发明实施例三中若干交换机在路由更新之后的内部路由 表;
图 5是本发明实施例四提供的交换机的结构方框图;
图 6是本发明实施例五提供的交换机的结构方框图;
图 7是本发明实施例六提供的网络系统的结构示意图;
图 8是本发明实施例七提供的交换机的结构方框图;
图 9是本发明实施例八提供的交换机的结构方框图。 实施本发明的方式 为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对 本发明实施方式作进一步地详细描述。 实施例一
请参考图 2, 其示出了本发明实施例一提供的路由更新方法的示例 交换网络, 每个设备只与位于上一级的设备或者位于下一级的设备相 连。 本文中, 将与当前设备相连的且位于当前设备上一级的设备称之为 "上游设备"; 将与当前设备相连的且位于当前设备下一级的设备称之 为 "下游设备"。 该路由更新方法, 具体包括:
步骤 201 , 当前设备探测至少两个邻居设备的链路状态, 该邻居设 备为当前设备一跳可达的上游设备或者下游设备。
步骤 202, 若当前设备探测到第一邻居设备的链路状态为不可达, 则当前设备将内部路由表中与第一邻居设备对应的所有路由项中初始 状态为可达的路由项置为不可达。
步骤 203, 当前设备在至少一个路由项的状态因链路状态改变被置 为不可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路 由项是否变成均为不可达, 若检测到一个目标子网所对应的所有路由项 变成均为不可达, 则向除第一邻居设备之外的其它邻居设备发送路由更 新消息, 以便其它邻居设备将内部路由表中与当前设备和目标子网两者 均对应的路由项置为不可达。
综上所述, 本实施例提供的路由更新方法中, 当前设备在探测到邻 居设备发生故障时, 通过不计算而直接更新内部路由表和选择性地通知 其他邻居设备更新内部路由表, 解决了现有的路由更新方法在出现链路 故障后会导致部分交换机进行^艮多无效计算的问题, 达到了交换机仅需 要通过筒单地逻辑判断, 就可以完成路由更新的效果。
组成的交换网络中来举例说明。
实施例二
请参考图 3Α, 其示出了本发明实施例二所涉及的实施环境的结构 示意图。 该实施环境是一个数据中心中由两级交换机组成的交换网络, 每个交换机只与位于上一级的交换机或者位于下一级的交换机相连。 本 文中, 将与当前交换机相连的且位于当前交换机上一级的交换机称之为
"上游设备"; 将与当前交换机相连的且位于当前交换机下一级的交换 机称之为 "下游设备"。 具体地讲, 该实施环境包括:
位于上一级的 4个核心交换机 Cl、 C2、 C3和 C4。
位于下一级的 n个接入交换机 Al、 A2、 A3、 A4、 A5和 An。 其中, A6至 未具体示出。 每个接入交换机各自都分别与核心交换机相连, 比如, A1分别与 Cl、 C2、 C3和 C4相连; A2分别与 Cl、 C2、 C3和 C4相连; A3分别与 Cl、 C2、 C3和 C4相连, 等等。 每个接入交换机 分别对应一个子网, 比如接入交换机 A1 的子网是数据中心内部具体的 服务器接入网段子网 1 ( subnetl ); 接入交换机 A2的子网是数据中心内 部具体的服务器接入网段子网 2 ( subnet2 ), 等等。
与接入交换机属于同一级的 2个边界交换机 B1和 B2。 边界交换机 属于特殊的接入交换机, 每个边界交换机对应的子网是默认路由 ( default ) , 边界交换机在具有接入交换机的功能的基础上, 同时运行传 统的诸如 OSPF的其它路由协议,以便和数据中心外部的网络互连互通。 也即, 边界交换机会将数据中心的内部路由聚合后发布到外部, 以实现 数据中心和外部互连互通的要求。 每个边界交换机也各自都与核心交换 机相连, 比如, B1分别与 Cl、 C2、 C3和 C4相连; B2分别与 Cl、 C2、 C3和 C4相连。
在上述网络拓朴中, 同一级的设备互相之间并不直接相连。
请参考图 3B,其示出了本发明实施例二提供的路由更新方法的示例 性流程图。 本实施例以该路由更新方法应用于图 3A所示实施环境为例 来举例说明, 在一个交换机被认为是当前设备时, 与其相连的上游设备 或者下游设备被称之为邻居设备。 该路由更新方法, 具体包括:
步骤 301 , 当前设备存储内部路由表, 在当前设备的内部路由表中 以二维坐标标识每个路由项, 二维坐标中的一个坐标为邻居设备, 另一 个坐标为目标子网。
对于每个路由项, 若经过与该路由项的坐标所对应的邻居设备通往 与该路由项的坐标所对应的目标子网的路径并非当前设备通往该目标 子网的所有路径中的最短路径, 则该路由项始终为不可达。
具体地讲, 每个交换机中都事先存储一张内部路由表, 该内部路由 表中的转发路径并非是实时计算的最短路径, 而是以最短路径为基础的 固定路径。请结合参考图 3C,其示出了若干交换机在初始状态下的内部 路由表。 若当前设备为接入交换机 Al , 在 A1的内部路由表中, 以二维坐标 标识每个路由项, 二维坐标中的位于行的坐标为邻居设备 Cl、 C2、 C3 和 C4, 位于列的坐标为目标子网: 子网 l ( subnetl )、 子网 2 ( subnet2 )、 子网 3 ( subnet3 ),、、、, 以及默认路由 ( default )。 对于每个路由项, 路 由项中的数字为 1时,表示可达; 路由项中的数字为 0时,表示不可达; 路由项中为空白时, 表示始终不可达。 比如, 对于目标子网 subnet3 , 当 邻居设备为 Cl、 C2、 C3和 C4时, 均为可达, 而且都是最短的两跳(2 hops )路径; 又比如, 对于目标子网 subnetl , 从当前设备 Al到目标子 网 subnetl 的最短路径就是自身, 所以不论是邻居设备为哪一个, 经过 邻居设备通往 subnetl 的路径均不是最短路径, 所以第一行的路由项始 终为不可达。
对于接入交换机 A2至 An, 与接入交换机 A1类似, 不再赘述。 若当前设备为核心交换机 C1 , 在 C1的内部路由表中, 以二维坐标 标识每个路由项, 二维坐标中的位于行的坐标为邻居设备 Al、 A2、 A3 ,、、、, An、 Bl和 B2, 位于列的坐标为目标子网: 子网 1 ( subnetl )、 子网 2 ( subnet2 )、 子网 3 ( subnet3 ),、、、, 以及默认路由 ( default )。 对 于每个路由项, 路由项中的数字为 1时, 表示可达; 路由项中的数字为 0 时, 表示不可达; 路由项中为空白时, 表示始终不可达。 比如, 对于 目标子网 subnet3 , 当邻居设备为 A3时,经过 A3通往与 subnet3的路径 为最短的 1 hop路径, 所以该路由项为可达, 但是当邻居设备为 A1时, 虽然可以经过 C1-A1-C2-A3之类的路径通往 subnet3 ,但不是从 C1出发 通往 subnet3 的最短路径, 所以该路由项始终为不可达; 又比如, 对于 目标子网 default, 当邻居设备为 Bl或者 B2时, 经过 B1或者 B2通往 与 default的路径为最短的 1 hop路径, 所以该路由项为可达, 但是当邻 居设备为 A1 至 An 时, 虽然可以经过 C1-A1-C2-B1 之类的路径通往 default, 但不是从 C1 出发通往 default的最短路径, 所以对应的路由项 始终为不可达。
对于核心交换机 C2至 C4, 与核心交换机 C1类似, 不再赘述。 若当前设备为边界交换机 B1 , 在 B1的内部路由表中, 以二维坐标 标识每个路由项, 二维坐标中的位于行的坐标为邻居设备 Cl、 C2、 C3 和 C4, 位于列的坐标为目标子网: 子网 l ( subnetl )、 子网 2 ( subnet2 )、 子网 3 ( subnet3 ),、、、, 以及默认路由 ( default )。 对于每个路由项, 路 由项中的数字为 1时,表示可达; 路由项中的数字为 0时,表示不可达; 路由项中为空白时, 表示始终不可达。 比如, 对于目标子网 subnet3, 当 邻居设备为 Cl、 C2、 C3和 C4时, 均为可达, 而且都是最短的 2 hops 路径; 又比如,对于目标子网 default,从当前设备 B1到目标子网 default 的最短路径就是自身, 所以不论是邻居设备为哪一个, 经过邻居设备通 往 default 的路径均不是最短路径, 所以最后一行的路由项始终为不可 达。
对于边界交换机 B2, 与边界交换机 B1类似, 不再赘述。
步骤 302, 当前设备探测至少两个邻居设备的链路状态, 该邻居设 备为当前设备一跳可达的上游设备或者下游设备。
若当前设备为接入交换机 A1 , 其 lhop可达的设备为位于上一级的 核心交换机 Cl、 C2、 C3和 C4, 所以 Al分别探测 Cl、 C2、 C3和 C4 的链路状态。
同理, A2至 An也是分别探测 Cl、 C2、 C3和 C4的链路状态。 若当前设备为核心交换机 C1 , 其 lhop可达的设备为位于下一级的 接入交换机 A1至 An和边界交换机 Bl、 B2, 所以 C1分别探测 A1至
An、 B 1和 B2的链路状态。
同理, C2也是分别探测 A1至 An、 B1和 B2的链路状态。
若当前设备为边界交换机 B1 , 其 lhop可达的设备为位于上一级的 核心交换机 Cl、 C2、 C3和 C4, 所以 B1分别探测 Cl、 C2、 C3和 C4 的链路状态。
同理, B2也是分别探测 Cl、 C2、 C3和 C4的链路状态。
也即, 相邻的两个设备相互探测对方的链路状态。
步骤 303, 若当前设备探测到第一邻居设备的链路状态为不可达, 则当前设备将内部路由表中与第一邻居设备对应的所有路由项中初始 状态为可达的路由项置为不可达。 第一邻居设备是当前设备的至少两个邻居设备中的某一个邻居设 备。 其中, "第一" 仅为了便于区别描述, 并不包含其他特殊含义。
若当前设备为接入交换机 A1 , 假设 A1探测到 C1的链路状态为不 可达,则 A1将内部路由表中与 C1对应的所有路由项中初始状态为可达 的路由项置为不可达, 如图 3D所示。
若当前设备为核心交换机 C1 , 假设 C1探测到 A1的链路状态为不 可达,则 C1将内部路由表中与 A1对应的所有路由项中初始状态为可达 的路由项置为不可达, 如图 3D所示。
步骤 304, 当前设备在至少一个路由项的状态因链路状态改变被置 为不可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路 由项是否变成均为不可达, 若检测到一个目标子网所对应的所有路由项 变成均为不可达, 则向除第一邻居设备之外的其它邻居设备发送路由更 新消息, 以便其它邻居设备将内部路由表中与当前设备和目标子网两者 均对应的路由项置为不可达。
若当前设备为接入交换机 A1 , 继续假设 A1探测到 C1的链路状态 为不可达, A1首先会将内部路由表中与 C1对应的所有路由项中初始状 态为可达的路由项置为不可达; 然后分别检测内部路由表中与每个目标 子网所对应的所有路由项是否变成均为不可达, 检测发现没有哪一个目 标子网所对应的所有路由项变成均为不可达(目标子网 subnet2-default 原来分别对应有四个路由项可达, 现在变为分别对应三个路由项可达), 所以不进行后续处理。
若当前设备为核心交换机 C1 , 继续假设 C1探测到 A1的链路状态 为不可达,则 C1将内部路由表中与 A1对应的所有路由项中初始状态为 可达的路由项置为不可达, 也即将第一行第一列所对应的路由项由 "1" 变为 "0" , 如图 3D所示;
此时, C1分别检测内部路由表中与每个目标子网所对应的所有路由 项是否变成均为不可达, 检测发现与子网 1 ( subnetl )所对应的所有路 由项变成均为不可达(也即, 第一行的路由项全部变成了不可达), 则 C1向除 A1之外的其它邻居设备发送路由更新消息, 以便其它邻居设备 将内部路由表中与 C1和子网 1 ( subnetl ) 两者均对应的路由项置为不 可达, 如图 3D所示, A2至 An、 B1和 B2中与 C1和 subnetl两者均对 应的路由项, 全部由 "1" 变为了 "0"。
步骤 305, 若当前设备探测到第一邻居设备的链路状态由不可达变 为可达, 则当前设备将内部路由表中与第一邻居设备对应的所有路由项 中初始状态为可达的路由项由不可达恢复为可达。
若当前设备为核心交换机 C1 , 假设 C1探测到 A1的链路状态由不 可达恢复为可达,则 C1将内部路由表中与 A1对应的所有路由项中初始 状态为可达的路由项恢复为可达, 也即将第一行第一列所对应的路由项 由 "0" 恢复为 "1" , 如图 3C所示。
步骤 306, 当前设备在至少一个路由项的状态因链路状态改变被恢 复为可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路 由项是否由均为不可达变成至少一个可达, 若检测到一个目标子网所对 应的所有路由项由均为不可达变成至少一个可达, 则向不包括第一邻居 设备的其它邻居设备发送路由更新消息, 以便邻居设备将内部路由表中 与当前设备和目标子网两者均对应的路由项由不可达恢复为可达。
在上一步骤之后, C1还分别检测内部路由表中与每个目标子网所对 应的所有路由项是否由均为不可达变成至少一个可达, 检测发现与 subnetl所对应的所有路由项由均为不可达变成至少一个可达(也即, 第 一行第一列所对应的路由项变成了可达), 则 C1向除 A1之外的其它邻 居设备发送路由更新消息, 以便其它邻居设备将内部路由表中与 C1和 subnetl 两者均对应的路由项由不可达恢复为可达, 如图 3C所示, A2 至 An、 B1和 B2中与 C1和 subnetl两者均对应的路由项, 全部由 "0" 变为了 "1"。
综上所述, 本实施例提供的路由更新方法, 当前设备通过在探测到 邻居设备发生故障时, 不计算而直接更新内部路由表和选择性地通知其 他邻居设备更新内部路由表, 解决了现有的路由更新方法在出现链路故 障后会导致部分交换机进行 4艮多无效计算的问题, 达到了交换机仅需要 通过筒单地逻辑判断, 就可以完成路由更新的效果。 实施例三
请参考图 4A, 其示出了本发明实施例三所涉及的实施环境的结构 示意图。 该实施环境是一个数据中心中由三级交换机组成的交换网络。 具体地讲, 该实施环境包括:
位于最上一级的 2个核心交换机 C1和 C2。
位于中间一级的 2个边界交换机 B1和 B2。 边界交换机属于特殊的 接入交换机, 每个边界交换机对应的子网是 default (默认路由), 边界 交换机在具有接入交换机的功能的基础上, 同时运行传统的诸如 OSPF 的其它路由协议, 以便和数据中心外部的网络互连互通。 也即, 边界交 换机会将数据中心内部路由聚合后发布到外部, 以实现数据中心和外部 互连互通的要求。 每个边界交换机也各自都与核心交换机相连, 比如, B1分别与 C1和 C2相连; B2分别与 C1和 C2相连。
位于中间一级的 4个汇聚点交换机 Gl、 G2、 G3和 G4。 每个汇聚 点交换机各自都与核心交换机相连, 比如, G1分别与 C1和 C2相连; G3分别与 C1和 C2相连, 等等。 每个汇聚点交换机的下一级还设置有 若干个接入交换机, 其中, G1和 G2及下属接入交换机形成第一设备集 群 POD1; G3和 G4及下属接入交换机形成第二设备集群 POD2。
位于最低一级的 8个接入交换机 Al、 A2、 A3、 A4、 A5、 A6、 A7 和 A8。 其中, Al、 A2、 A3和 A4属于 POD1 , 分别与 Gl和 G2相连; A5、 A6、 A7和 A8属于 POD2, 分别与 G3和 G4相连。 每个接入交换 机分别对应一个子网, 比如接入交换机 A1的子网是数据中心内部具体 的服务器接入网段子网 1 ( subnetl ); 接入交换机 A2的子网是数据中心 内部具体的服务器接入网段子网 2 ( subnet2 ), 等等。
在上述网络拓朴中, 同一级的设备互相之间并不直接相连。
请参考图 4B,其示出了本发明实施例三提供的路由更新方法的示例 性流程图。 本实施例以该路由更新方法应用于图 4A所示实施环境为例 来举例说明, 在一个交换机被认为是当前设备时, 与其相连的上游设备 或者下游设备被称之为邻居设备。 该路由更新方法, 具体包括: 步骤 401 , 当前设备存储内部路由表, 在当前设备的内部路由表中 以二维坐标标识每个路由项, 二维坐标中的一个坐标为邻居设备, 另一 个坐标为目标子网。
对于每个路由项, 若经过与该路由项的坐标所对应的邻居设备通往 与该路由项的坐标所对应的目标子网的路径并非当前设备通往该目标 子网的所有路径中的最短路径, 则该路由项始终为不可达。
具体地讲, 每个交换机中都事先存储一张内部路由表, 该内部路由 表中的转发路径并非是实时计算的最短路径, 而是以最短路径为基础的 固定路径。请结合参考图 4C,其示出了若干交换机在初始状态下的内部 路由表。
若当前设备为接入交换机 A1 , 在 A1的内部路由表中, 以二维坐标 标识每个路由项, 二维坐标中的位于行的坐标为邻居设备 G1和 G2, 位 于列的坐标为目标子网: 子网 1 ( subnetl )、 子网 2 ( subnet2 )、 子网 3 ( subnet3 ),、、、, 子网 8 ( subnet 8 ) 以及默认路由 ( default )。 对于每个 路由项, 路由项中的数字为 1时, 表示可达; 路由项中的数字为 0时, 表示不可达; 路由项中为空白时, 表示始终不可达。 比如, 对于目标子 网 subnet3 ,不论邻居设备为 G1和 G2,均为可达,而且都是最短的 2 hops 路径。又比如,对于目标子网 subnetl ,从当前设备 A1到目标子网 subnetl 的最短路径就是自身, 所以不论邻居设备为哪一个, 经过邻居设备通往 subnetl的路径均不是最短路径, 所以第一行的路由项始终为不可达。
对于接入交换机 A2至 A8, 与接入交换机 A1类似, 不再赘述。 若当前设备为汇聚点交换机 G1 , 在 G1的内部路由表中, 以二维坐 标标识每个路由项, 二维坐标中的位于行的坐标为邻居设备 Al、 A2、 A3、 A4、 CI和 C2, 位于列的坐标为目标子网: 子网 1 ( subnetl )、 子 网 2 ( subnet2 )、 子网 3 ( subnet3 ),、、、, 子网 8 ( subnet8 ) 以及默认路 由(default )。 对于每个路由项, 路由项中的数字为 1时, 表示可达; 路 由项中的数字为 0时, 表示不可达; 路由项中为空白时, 表示始终不可 达。 比如, 对于目标子网 subnet3 , 当邻居设备为 A3时, 经过 A3通往 subnet3的路径为最短的 l hop路径, 所以该路由项为可达, 但是当邻居 设备为 Al时, 虽然可以经过 G1-A1-G2-A3之类的路径通往 subnet3 , 但不是从 G1出发通往 subnet3的最短路径,所以该路由项始终为不可达; 又比如, 对于目标子网 default, 当邻居设备为 C1或者 C2时, 经过 C1 或者 C2通往 default的路径为最短的 2 hop路径,所以该路由项为可达, 但是当邻居设备为 A1至 A4时,虽然可以经过 G1-A1-G2-C1-B1之类的 路径通往 default, 但不是从 G1出发通往 default的最短路径, 所以对应 的路由项始终为不可达。
对于汇聚点交换机 G2、 G3和 G4, 与汇聚点交换机 G1类似, 不再 赘述。
若当前设备为核心交换机 C1 , 在 C1的内部路由表中, 以二维坐标 标识每个路由项, 二维坐标中的位于行的坐标为邻居设备 Gl、 G2、 G3、 G4、 Bl 和 B2, 位于列的坐标为目标子网: 子网 1 ( subnetl )、 子网 2 ( subnet2 )、 子网 3 ( subnet3 ),、、、, 子网 8 ( subnet8 ) 以及默认路由 ( default )„ 对于每个路由项, 路由项中的数字为 1时, 表示可达; 路由 项中的数字为 0时,表示不可达; 路由项中为空白时,表示始终不可达。 比如,对于目标子网 subnet3 ,当邻居设备为 G1时,经过 G1通往 subnet3 的路径为最短的 2 hop路径, 所以该路由项为可达, 但是当邻居设备为 G3时, 虽然可以经过 C1-G3-C2-G1-A3之类的路径通往 subnet3 , 但不 是从 C1出发通往 subnet3的最短路径, 所以该路由项始终为不可达。
对于核心交换机 C2, 与核心交换机 C1类似, 不再赘述。
若当前设备为边界交换机 B1 , 在 B1的内部路由表中, 以二维坐标 标识每个路由项, 二维坐标中的位于行的坐标为邻居设备 C1和 C2, 位 于列的坐标为目标子网: 子网 1 ( subnetl )、 子网 2 ( subnet2 )、 子网 3 ( subnet3 ),、、、, 子网 8 ( subnet8 ) 以及默认路由 ( default )。 对于每个 路由项, 路由项中的数字为 1时, 表示可达; 路由项中的数字为 0时, 表示不可达; 路由项中为空白时, 表示始终不可达。 比如, 对于目标子 网 subnet3 ,当邻居设备为 C1和 C2时,均为可达,而且都是最短的 3 hops 路径; 又比如,对于目标子网 default,从当前设备 Bl到目标子网 default 的最短路径就是自身, 所以不论是邻居设备为哪一个, 经过邻居设备通 往 default的路径均不是最短路径, 所以第三行的路由项始终为不可达。 对于边界交换机 B2, 与边界交换机 B1类似, 不再赘述。
步骤 402, 当前设备探测至少两个邻居设备的链路状态, 该邻居设 备为当前设备一跳可达的上游设备或者下游设备。
若当前设备为接入交换机 A1 , 其 lhop可达的设备为位于上一级的 汇聚点交换机 G1和 G2, 所以 A1分别探测 G1和 G2的链路状态。
同理, A2至 A4也是分别探测 Gl、 G2的链路状态。 而 A5至 A8 则分别探测 G3和 G4的链路状态。
若当前设备为汇聚点交换机 G1 ,其 1 hop可达的设备为位于上一级 的汇聚点交换机 C1和 C2, 位于下一级的接入交换机 Al、 A2、 A3和
A4, 所述 G1分别探测 A1至 A4、 C1和 C2的链路状态。
同理, G2也分别探测 A1至 A4、 C1和 C2的链路状态。 而 G3和
G4则分别探测 A5至 A8、 C1和 C2的链路状态。
若当前设备为核心交换机 C1 , 其 lhop可达的设备为位于下一级的 汇聚点交换机 G1至 G4和边界交换机 Bl、 B2, 所以 C1分别探测 G1 至 G4、 B1和 B2的链路状态。
同理, C2也是分别探测 G1至 G4、 B1和 B2的链路状态。
若当前设备为边界交换机 B1 , 其 lhop可达的设备为位于上一级的 核心交换机 C1和 C2, 所以 B1分别探测 C1和 C2的链路状态。
同理, B2也是分别探测 C1和 C2的链路状态。
也即, 相邻的两个设备相互探测对方的链路状态。
步骤 403, 若当前设备探测到第一邻居设备的链路状态为不可达, 则当前设备将内部路由表中与第一邻居设备对应的所有路由项中初始 状态为可达的路由项置为不可达。
第一邻居设备是当前设备的至少两个邻居设备中的某一个邻居设 备。 其中, "第一" 仅为了便于区别描述, 并不包含其他特殊含义。
下述步骤中, 均以 B1和 B1的默认路由4款销来举例说明, 比如, 数 据中心不需要接入外网了, B1和 B2的默认路由撤销。 对于其它路径发 生故障或者撤销的情形, 本领域技术人员可以容易及延伸思及, 不再赘 述。
若当前设备为核心交换机 CI , C1探测到 B1和 B2的链路状态均为 不可达, 则 C1将内部路由表中与 B1和 B2对应的所有路由项中初始状 态为可达的路由项置为不可达, 也即将最后一行的路由项中初始状态为 "1" 的路由项置为 "0" , 如图 4D所示。
同时, 核心交换机 C2, 也会将内部路由表中与 B1和 B2对应的所 有路由项中初始状态为可达的路由项置为不可达, 也即将最后一行的路 由项中初始状态为 "1" 的路由项置为 "0" , 如图 4D所示。
步骤 404, 当前设备在至少一个路由项的状态因链路状态改变被置 为不可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路 由项是否变成均为不可达, 若检测到一个目标子网所对应的所有路由项 变成均为不可达, 则向不包括第一邻居设备的其它邻居设备发送路由更 新消息, 以便其它邻居设备将内部路由表中与当前设备和目标子网两者 均对应的路由项置为不可达。
若当前设备为核心交换机 CI , C1将内部路由表中与 B1和 B2对应 的所有路由项中初始状态为可达的路由项置为不可达之后, 此时, C1 分别检测内部路由表中与每个目标子网所对应的所有路由项是否变成 均为不可达, 检测发现与 default所对应的所有路由项变成均为不可达 (也即, 最后一行的路由项全部变成了不可达), 则 C1 向除 B1和 B2 之外的其它邻居设备发送路由更新消息, 以便其它邻居设备将内部路由 表中与 C1和 default两者均对应的路由项置为不可达, 如图 4D所示, Gl、 G2、 G3和 G4中与 CI和 default两者均对应的路由项, 由 "1" 变 为了 "0"。
同理, 核心交换机 C2在将内部路由表中与 B 1和 B2对应的所有路 由项中初始状态为可达的路由项置为不可达之后, C2也分别检测内部路 由表中与每个目标子网所对应的所有路由项是否变成均为不可达, 检测 发现与 default所对应的所有路由项变成均为不可达(也即, 最后一行的 路由项全部变成了不可达), 则 C2向除 B1和 B2之外的其它邻居设备 发送路由更新消息, 以便其它邻居设备将内部路由表中与 C2和 default 两者均对应的路由项置为不可达, 如图 4D所示, Gl、 G2、 G3 和 G4 中与 C2和 default两者均对应的路由项, 由 "1" 变为了 "0"。
步骤 402至步骤 403是以当前设备通过探测邻居设备的链路状态来 触发路由更新的。 显然, 当前设备也可以通过接收邻居设备的路由更新 消息来触发路由更新。 请参考如下步骤:
步骤 405, 当前设备接收第二邻居设备的路由更新消息, 路由更新 消息携带有所述第二邻居设备的标识、 目标子网的标识和是否可达的标 识。
步骤 406, 当前设备将内部路由表中与第二邻居设备和目标子网两 者均对应的路由项根据是否可达的标识进行更新, 更新包括将路由项的 状态由可达置为不可达, 或者, 由不可达恢复为可达。
步骤 407, 当前设备在至少一个路由项的状态因路由更新被置为不 可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项 是否变成均为不可达, 若检测到一个目标子网所对应的所有路由项均为 不可达, 则向不包括第二邻居设备的其它邻居设备发送路由更新消息, 以便其它邻居设备将内部路由表中与当前设备和目标子网两者均对应 的路由项置为不可达。
步骤 408, 当前设备在至少一个路由项的状态因路由更新被恢复为 可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项 是否由均为不可达变成至少一个可达, 若检测到一个目标子网所对应的 所有路由项由均为不可达变成至少一个可达, 则向不包括第二邻居设备 的其它邻居设备发送路由更新消息, 以便邻居设备将内部路由表中与当 前设备和目标子网两者均对应的路由项由不可达恢复为可达。
具体地讲:
若当前设备为汇聚点交换机 Gl , G1可以接收到来自 C1的路由更 新消息, 该路由更新消息中包括 C1的标识、 default的标识和不可达的 标识; 然后, G1将内部路由表中与 C1和 default两者均对应的路由项由 "1" 更新为 "0"。
同理, G1还会接收到来自 C2的路由更新消息, 该路由更新消息中 包括 C2的标识、 default的标识和不可达的标识; 然后, G1将内部路由 表中与 C2和 default两者均对应的路由项由 "1" 更新为 "0"。
之后, G1 会分别检测内部路由表中与每个目标子网所对应的所有 路由项是否变成均为不可达,检测发现与 default所对应的所有路由项变 成均为不可达(也即, 最后一行的路由项全部变成了不可达), 则 G1向 不包括 C1和 C2的其它邻居设备 A1至 A4发送路由更新消息,以便 A1 至 A4将内部路由表中与 G1和 default两者均对应的路由项由 "1" 更新 为 "0"。
易于思及的, G2、 G3和 G4也会执行如 G1相同的操作, 最终路由 更新后的内部路由表如图 4D所示。
如果数据中心又需要接入外网, 恢复了 B1和 B2的默认路由, 则相 应的路由更新过程基本为上述过程的逆过程, 不再一一赘述。 但是需要 说明的是, 在优选的方案中, 当前设备向邻居设备针对同一路由项发送 路由更新消息的时间间隔不小于预定阈值。 也就是说, 如果当前设备需 要向邻居设备针对同一路由项发送路由更新消息, 则两次路由更新消息 的发送时间之间的时间间隔不小于预定阈值, 这是为了避免产生路由震 荡。 该预定阈值可以是 2秒, 或者其它由设计者指定的数值。
综上所述, 本实施例提供的路由更新方法, 不仅具有上一实施例的 优点, 还通过接收第二邻居设备的路由更新消息, 不计算而直接更新内 部路由表和选择性地向不包含第二邻居设备的其它邻居设备反射路由 更新消息, 解决了现有的路由更新方法在出现链路故障后会导致部分交 换机进行很多无效计算的问题, 达到了交换机仅需要通过筒单地逻辑判 断, 就可以完成路由更新的效果。 下述实施例为本发明装置实施例, 可以用于执行本发明方法实施 例。 对于本发明装置实施例中未披露的技术细节, 请参照本发明方法实 施例。
实施例四
请参考图 5,其示出了本发明实施例四提供的交换机的结构方框图。 该交换机可以是核心交换机、 汇聚点交换机、 接入交换机和边界交换机 中的某一种。 该交换机包括链路探测模块 520、 路由更新模块 540和更 新发送模块 560。
其中, 链路探测模块 520用于探测至少两个邻居设备的链路状态, 所述邻居设备为所述交换机一跳可达的上游设备或者下游设备。
路由更新模块 540用于若所述链路探测模块 520探测到第一邻居设 备的链路状态为不可达, 则将内部路由表中与所述第一邻居设备对应的 所有路由项中初始状态为可达的路由项置为不可达。
更新发送模块 560用于在至少一个路由项的状态因链路状态改变被 所述路由更新模块 540置为不可达之后, 分别检测内部路由表中与每个 目标子网所对应的所有路由项是否变成均为不可达, 若检测到一个目标 子网所对应的所有路由项变成均为不可达, 则向不包括所述第一邻居设 备的其它邻居设备发送路由更新消息, 以便所述其它邻居设备将内部路 由表中与所述交换机和所述目标子网两者均对应的路由项置为不可达。
综上所述, 本实施例提供的交换机, 通过在探测到邻居设备发生故 障时, 不计算而直接更新内部路由表和选择性地通知其他邻居设备更新 内部路由表, 解决了现有的路由更新方法在出现链路故障后会导致部分 交换机进行很多无效计算的问题, 达到了交换机仅需要通过筒单地逻辑 判断, 就可以完成路由更新的效果。 实施例五
请参考图 6,其示出了本发明实施例五提供的交换机的结构方框图。 该交换机可以是核心交换机、 汇聚点交换机、 接入交换机和边界交换机 中的某一种。 该交换机包括路由表存储模块 510、 链路探测模块 520、 消息接收模块 530、 路由更新模块 540和更新发送模块 560
其中, 所述路由表存储模块 510用于存储内部路由表, 在所述内部 路由表中以二维坐标标识每个路由项, 所述二维坐标中的一个坐标为所 述邻居设备, 另一个坐标为所述目标子网; 对于每个路由项, 若经过与 的目标子网的路径并非所述当前设备通往所述目标子网的所有路径中 的最短路径, 则所述路由项始终为不可达。
链路探测模块 520用于探测至少两个邻居设备的链路状态, 所述邻 居设备为所述交换机一跳可达的上游设备或者下游设备。
路由更新模块 540用于若所述链路探测模块 520探测到第一邻居设 备的链路状态为不可达, 则将内部路由表中与所述第一邻居设备对应的 所有路由项中初始状态为可达的路由项置为不可达。
更新发送模块 560用于在至少一个路由项的状态因链路状态改变被 所述路由更新模块 540置为不可达之后, 分别检测内部路由表中与每个 目标子网所对应的所有路由项是否变成均为不可达, 若检测到一个目标 子网所对应的所有路由项变成均为不可达, 则向不包括所述第一邻居设 备的其它邻居设备发送路由更新消息, 以便所述其它邻居设备将内部路 由表中与所述交换机和所述目标子网两者均对应的路由项置为不可达。
所述路由更新模块 540还用于若所述链路探测模块 520探测到所述 第一邻居设备的链路状态由不可达变为可达, 则将内部路由表中与所述 恢复为可达。
所述更新发送模块 560还用于在至少一个路由项的状态因链路状态 改变被所述路由更新模块 540恢复为可达之后, 分别检测内部路由表中 与每个目标子网所对应的所有路由项是否由均为不可达变成至少一个 少一个可达, 则向不包括第一邻居设备的其它邻居设备发送路由更新消 息, 以便所述邻居设备将内部路由表中与所述当前设备和所述目标子网 两者均对应的路由项由不可达恢复为可达。
所述消息接收模块 530用于接收第二邻居设备的路由更新消息, 所 述路由更新消息携带有所述第二邻居设备的标识、 目标子网的标识和是 否可达的标识。
所述路由更新模块 540, 还用于将所述内部路由表中与所述第二邻 居设备和所述目标子网两者均对应的路由项根据所述消息接收模块 530 接收到的是否可达的标识进行更新, 所述更新包括将路由项的状态有可 达置为不可达, 或者, 由不可达恢复为可达。
所述更新发送模块 560还用于在至少一个路由项的状态因路由更新 被所述路由更新模块 540置为不可达之后, 分别检测内部路由表中与每 个目标子网所对应的所有路由项是否变成均为不可达, 若检测到一个目 标子网所对应的所有路由项变成均为不可达, 则向不包括所述第二邻居 设备的其它邻居设备发送路由更新消息, 以便所述其它邻居设备将内部 路由表中与所述当前设备和所述目标子网两者均对应的路由项置为不 可达;
和 /或,所述更新发送模块 560还用于在至少一个路由项的状态因路 由更新被所述路由更新模块 540恢复为可达之后, 分别检测内部路由表 中与每个目标子网所对应的所有路由项是否由均为不可达变成至少一 至少一个可达, 则向不包括第二邻居设备的其它邻居设备发送路由更新 消息, 以便所述邻居设备将内部路由表中与所述当前设备和所述目标子 网两者均对应的路由项由不可达恢复为可达。
所述更新发送模块 560还用于向所述邻居设备针对同一路由项发送 路由更新消息的时间间隔不小于预定阈值。
综上所述, 本实施例提供的交换机, 不仅具有上一实施例的优点, 还通过接收第二邻居设备的路由更新消息, 不计算而直接更新内部路由 表和选择性地向不包含第二邻居设备的其它邻居设备反射路由更新消 息, 解决了现有的路由更新方法在出现链路故障后会导致部分交换机进 行很多无效计算的问题, 达到了交换机仅需要通过筒单地逻辑判断, 就 可以完成路由更新的效果。 实施例六
请参考图 7, 其示出了本发明实施例六提供的网络系统的结构示意 图。 该网络系统包括至少一个如实施例四或者实施例五所提供的交换机 720, 所述交换机 720组成两级或者两级以上的交换网络, 每个交换机 只与位于上一级的交换机或者位于下一级的交换机相连。 上述本发明实施例序号仅仅为了描述, 不代表实施例的优劣。
本领域技术人员可以理解上述实例中的装置中的模块可以按照 实例描述进行分布于实例的装置中,也可以进行相应变化位于不同于 本实例的一个或多个装置中。 上述实例的模块可以合并为一个模块, 也可以进一步拆分成多个子模块。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤 可以通过硬件来完成, 也可以通过程序来指令相关的硬件完成, 所述的 程序可以存储于一种计算机可读存储介质中, 上述提到的存储介质可以 是只读存储器, 磁盘或光盘等。 可选择地, 可以由通信网络从服务器计 算机上下载程序代码。 此外, 可以提供配有存储介质的系统或者装置, 在该存储介质上存储着实现上述实施例中任一实施例的功能的软件程 序代码, 且使该系统或者装置的计算机(或 CPU或 MPU )读出并执行 存储在存储介质中的程序代码。 任何一项实例的功能, 因此程序代码和存储程序代码的存储介质构成了 实现上述映射管理技术方案的一部分。
此外,应该清楚的是,不仅可以通过执行计算机所读出的程序代码, 而且可以通过基于程序代码的指令使计算机上操作的操作系统等来完 成部分或者全部的实际操作, 从而实现上述实例中任意一项实施例的功 h
匕。
例如, 图 8和图 9给出了根据本发明实施方式的交换机的又一结 构示意图。
实施例七
如图 8所示,其示出了本发明实施例七提供的交换机的结构示意 图。 该交换机可包括一存储器 820、 以及与所述存储器 820通信的处理 器 810, 其中所述存储器 820存储有可由所述处理器 810执行的链路探 测指令 821、 路由更新指令 822和更新发送指令 823。 其中, 链路探测指令 821用于指示探测至少两个邻居设备的链路状 态, 所述邻居设备为所述交换机一跳可达的上游设备或者下游设备。
路由更新指令 822用于指示若通过执行所述链路探测指令 821探测 到第一邻居设备的链路状态为不可达, 则将内部路由表中与所述第一邻 更新发送指令 823用于在至少一个路由项的状态因链路状态改变通 过执行所述路由更新指令 822被置为不可达之后, 分别检测内部路由表 中与每个目标子网所对应的所有路由项是否变成均为不可达, 若检测到 一邻居设备的其它邻居设备发送路由更新消息, 以便所述其它邻居设备 将内部路由表中与所述交换机和所述目标子网两者均对应的路由项置 为不可达。
实施例八
如图 9所示,其示出了本发明实施例八提供的交换机的结构示意 图。 该交换机可包括一存储器 920、 以及与所述存储器 920通信的处理 器 910, 其中所述存储器 920存储有可由所述处理器 910执行的链路探 测指令 921、路由更新指令 922、更新发送指令 923和消息接收指令 924。 此外, 存储器 920中还存储有内部路由表。
其中, 在所述内部路由表中以二维坐标标识每个路由项, 所述二维 坐标中的一个坐标为所述邻居设备, 另一个坐标为所述目标子网; 对于 路由项的坐标所对应的目标子网的路径并非所述当前设备通往所述目 标子网的所有路径中的最短路径, 则所述路由项始终为不可达。
链路探测指令 921用于指示探测至少两个邻居设备的链路状态, 所 述邻居设备为所述交换机一跳可达的上游设备或者下游设备。
路由更新指令 922用于指示若通过执行所述链路探测指令 921探测 到第一邻居设备的链路状态为不可达, 则将内部路由表中与所述第一邻 更新发送指令 923用于指示在至少一个路由项的状态因链路状态改 变通过执行所述路由更新指令 922被置为不可达之后, 分别检测内部路 由表中与每个目标子网所对应的所有路由项是否变成均为不可达, 若检 测到一个目标子网所对应的所有路由项变成均为不可达, 则向不包括所 述第一邻居设备的其它邻居设备发送路由更新消息, 以便所述其它邻居 设备将内部路由表中与所述交换机和所述目标子网两者均对应的路由 项置为不可达。
所述路由更新指令 922还用于指示若通过执行所述链路探测指令 921 探测到所述第一邻居设备的链路状态由不可达变为可达, 则将内部 路由项由不可达恢复为可达。
所述更新发送指令 923还用于指示在至少一个路由项的状态因链路 状态改变通过执行所述路由更新指令 922被恢复为可达之后, 分别检测 内部路由表中与每个目标子网所对应的所有路由项是否由均为不可达 变成至少一个可达, 若检测到一个目标子网所对应的所有路由项由均为 不可达变成至少一个可达, 则向不包括第一邻居设备的其它邻居设备发 送路由更新消息, 以便所述邻居设备将内部路由表中与所述当前设备和 所述目标子网两者均对应的路由项由不可达恢复为可达。
所述消息接收指令 924 用于指示接收第二邻居设备的路由更新消 息, 所述路由更新消息携带有所述第二邻居设备的标识、 目标子网的标 识和是否可达的标识。
所述路由更新指令 922, 还用于指示将所述内部路由表中与所述第 息接收指令 924接收到的是否可达的标识进行更新, 所述更新包括将路 由项的状态有可达置为不可达, 或者, 由不可达恢复为可达。
所述更新发送指令 923还用于指示在至少一个路由项的状态因路由 更新通过执行所述路由更新指令 922被置为不可达之后, 分别检测内部 路由表中与每个目标子网所对应的所有路由项是否变成均为不可达, 若 所述第二邻居设备的其它邻居设备发送路由更新消息, 以便所述其它邻 居设备将内部路由表中与所述当前设备和所述目标子网两者均对应的 路由项置为不可达;
和 /或,所述更新发送指令 923还用于指示在至少一个路由项的状态 因路由更新通过执行所述路由更新指令 922被恢复为可达之后, 分别检 测内部路由表中与每个目标子网所对应的所有路由项是否由均为不可 达变成至少一个可达, 若检测到一个目标子网所对应的所有路由项由均 为不可达变成至少一个可达, 则向不包括第二邻居设备的其它邻居设备 发送路由更新消息, 以便所述邻居设备将内部路由表中与所述当前设备 和所述目标子网两者均对应的路由项由不可达恢复为可达。
所述更新发送指令 923还用于指示向所述邻居设备针对同一路由项 发送路由更新消息的时间间隔不小于预定阈值。 以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本 发明的精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包 含在本发明的保护范围之内。

Claims

权利要求书
1、 一种路由更新方法, 其特征在于, 所述方法包括:
当前设备探测至少两个邻居设备的链路状态, 所述邻居设备为所述 当前设备一跳可达的上游设备或者下游设备;
若所述当前设备探测到第一邻居设备的链路状态为不可达, 则所述 当前设备将内部路由表中与所述第一邻居设备对应的所有路由项中初 始状态为可达的路由项置为不可达;
所述当前设备在至少一个路由项的状态因链路状态改变被置为不 可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项 是否变成均为不可达, 若检测到一个目标子网所对应的所有路由项变成 均为不可达, 则向不包括所述第一邻居设备的其它邻居设备发送路由更 新消息, 以便所述其它邻居设备将内部路由表中与所述当前设备和所述 目标子网两者均对应的路由项置为不可达。
2、 根据权利要求 1所述的路由更新方法, 其特征在于, 所述当前 设备探测邻居设备的链路状态之前, 还包括:
所述当前设备存储内部路由表, 在所述内部路由表中以二维坐标标 识每个路由项, 所述二维坐标中的一个坐标为所述邻居设备, 另一个坐 标为所述目标子网; 对于每个路由项, 若经过与所述路由项的坐标所对 所述当前设备通往所述目标子网的所有路径中的最短路径, 则所述路由 项始终为不可达。
3、 根据权利要求 1或 2所述的路由更新方法, 其特征在于, 所述 方法, 还包括:
若所述当前设备探测到所述第一邻居设备的链路状态由不可达变 为可达, 则所述当前设备将内部路由表中与所述第一邻居设备对应的所 所述当前设备在至少一个路由项的状态因链路状态改变被恢复为 可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项 是否由均为不可达变成至少一个可达, 若检测到一个目标子网所对应的 所有路由项由均为不可达变成至少一个可达, 则向不包括第一邻居设备 的其它邻居设备发送路由更新消息, 以便所述邻居设备将内部路由表中
;达。 * '
4、 根据权利要求 1或 2所述的路由更新方法, 其特征在于, 所述 方法, 还包括:
所述当前设备接收第二邻居设备的路由更新消息, 所述路由更新消 息携带有所述第二邻居设备的标识、 目标子网的标识和是否可达的标 识;
所述当前设备将所述内部路由表中与所述第二邻居设备和所述目 标子网两者均对应的路由项根据所述是否可达的标识进行更新, 所述更 新包括将路由项的状态由可达置为不可达,或者, 由不可达恢复为可达; 所述当前设备在至少一个路由项的状态因路由更新被置为不可达 之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项是否 变成均为不可达, 若检测到一个目标子网所对应的所有路由项均为不可 达, 则向不包括所述第二邻居设备的其它邻居设备发送路由更新消息, 以便所述其它邻居设备将内部路由表中与所述当前设备和所述目标子 网两者均对应的路由项置为不可达;
和 /或,所述当前设备在至少一个路由项的状态因路由更新被恢复为 可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路由项 是否由均为不可达变成至少一个可达, 若检测到一个目标子网所对应的 所有路由项由均为不可达变成至少一个可达, 则向不包括第二邻居设备 的其它邻居设备发送路由更新消息, 以便所述邻居设备将内部路由表中
;达。 * '
5、 根据权利要求 4所述的路由更新方法, 其特征在于, 所述方法, 还包括:
所述当前设备向所述邻居设备针对同一路由项发送路由更新消息 的时间间隔不小于预定阈值。
6、 一种交换机, 其特征在于, 包括:
链路探测模块, 用于探测至少两个邻居设备的链路状态, 所述邻居 设备为所述交换机一跳可达的上游设备或者下游设备;
路由更新模块, 用于若所述链路探测模块探测到第一邻居设备的链 路状态为不可达, 则将内部路由表中与所述第一邻居设备对应的所有路 由项中初始状态为可达的路由项置为不可达;
更新发送模块, 用于在至少一个路由项的状态因链路状态改变被置 为不可达之后, 分别检测内部路由表中与每个目标子网所对应的所有路 由项是否变成均为不可达, 若检测到一个目标子网所对应的所有路由项 变成均为不可达, 则向不包括所述第一邻居设备的其它邻居设备发送路 由更新消息, 以便所述其它邻居设备将内部路由表中与所述交换机和所 述目标子网两者均对应的路由项置为不可达。
7、 根据权利要求 6所述的交换机, 其特征在于, 所述交换机, 还 包括:
路由表存储模块;
所述路由表存储模块, 用于存储内部路由表, 在所述内部路由表中 以二维坐标标识每个路由项, 所述二维坐标中的一个坐标为所述邻居设 备, 另一个坐标为所述目标子网; 对于每个路由项, 若经过与所述路由 网的路径并非所述当前设备通往所述目标子网的所有路径中的最短路 径, 则所述路由项始终为不可达。
8、 根据权利要求 6或 7所述的交换机, 其特征在于, 所述路由更新模块, 还用于若所述链路探测模块探测到所述第一邻 一邻
Figure imgf000033_0001
所述更新发送模块, 还用于在至少一个路由项的状态因链路状态改 变被恢复为可达之后, 分别检测内部路由表中与每个目标子网所对应的 所有路由项是否由均为不可达变成至少一个可达, 若检测到一个目标子 网所对应的所有路由项由均为不可达变成至少一个可达, 则向不包括第 一邻居设备的其它邻居设备发送路由更新消息, 以便所述邻居设备将内 部路由表中与所述当前设备和所述目标子网两者均对应的路由项由不 可达恢复为可达。
9、 根据权利要求 6或 7所述的交换机, 其特征在于, 所述交换机, 还包括:
消息接收模块;
所述消息接收模块, 用于接收第二邻居设备的路由更新消息, 所述 路由更新消息携带有所述第二邻居设备的标识、 目标子网的标识和是否 可达的标识;
所述路由更新模块, 还用于将所述内部路由表中与所述第二邻居设 备和所述目标子网两者均对应的路由项根据所述是否可达的标识进行 更新, 所述更新包括将路由项的状态有可达置为不可达, 或者, 由不可 达恢复为可达;
所述更新发送模块, 还用于在至少一个路由项的状态因路由更新被 置为不可达之后, 分别检测内部路由表中与每个目标子网所对应的所有 路由项是否变成均为不可达, 若检测到一个目标子网所对应的所有路由 项变成均为不可达, 则向不包括所述第二邻居设备的其它邻居设备发送 路由更新消息, 以便所述其它邻居设备将内部路由表中与所述当前设备 和所述目标子网两者均对应的路由项置为不可达; 和 /或, 所述更新发送模块, 还用于在至少一个路由项的状态因路由 更新被恢复为可达之后, 分别检测内部路由表中与每个目标子网所对应 的所有路由项是否由均为不可达变成至少一个可达, 若检测到一个目标 第二邻居设备的其它邻居设备发送路由更新消息, 以便所述邻居设备将 内部路由表中与所述当前设备和所述目标子网两者均对应的路由项由 不可达恢复为可达。
10、 根据权利要求 9所述的交换机, 其特征在于, 所述更新发送模 块, 还用于向所述邻居设备针对同一路由项发送路由更新消息的时间间 隔不小于预定阈值。
11、 一种网络系统, 其特征在于, 包括至少一个如权利要求 6至 10 任一所述的交换机, 所述交换机组成两级或者两级以上的交换网络, 每 个交换机只与位于上一级的交换机或者位于下一级的交换机相连。
12、 一种交换机, 其特征在于, 包括: 处理器和与处理器通信连接 的存储器; 所述存储器中存储有可供处理器执行的链路探测指令、 路由 更新指令和更新发送指令; 其中, 所述链路探测指令用于指示探测至少两个邻居设备的链路状态, 所 述邻居设备为所述交换机一跳可达的上游设备或者下游设备;
所述路由更新指令用于指示若通过执行所述链路探测指令探测到第 一邻居设备的链路状态为不可达, 则将内部路由表中与所述第一邻居设 备对应的所有路由项中初始状态为可达的路由项置为不可达;
所述更新发送指令用于指示在至少一个路由项的状态因链路状态改 变被置为不可达之后, 分别检测内部路由表中与每个目标子网所对应的 所有路由项是否变成均为不可达, 若检测到一个目标子网所对应的所有 路由项变成均为不可达, 则向不包括所述第一邻居设备的其它邻居设备 发送路由更新消息, 以便所述其它邻居设备将内部路由表中与所述交换 机和所述目标子网两者均对应的路由项置为不可达。
PCT/CN2013/084279 2012-09-26 2013-09-26 路由更新方法、交换机及系统 Ceased WO2014048339A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/431,594 US20150229560A1 (en) 2012-09-26 2013-09-26 Method, switch and system for updating route

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210362754.2A CN103685035B (zh) 2012-09-26 2012-09-26 路由更新方法、交换机及系统
CN201210362754.2 2012-09-26

Publications (1)

Publication Number Publication Date
WO2014048339A1 true WO2014048339A1 (zh) 2014-04-03

Family

ID=50321392

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/084279 Ceased WO2014048339A1 (zh) 2012-09-26 2013-09-26 路由更新方法、交换机及系统

Country Status (3)

Country Link
US (1) US20150229560A1 (zh)
CN (1) CN103685035B (zh)
WO (1) WO2014048339A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117955895A (zh) * 2023-12-29 2024-04-30 北京东土科技股份有限公司 交换机及其转发表项的更新方法、存储介质及计算设备

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105827524A (zh) * 2016-03-18 2016-08-03 联想(北京)有限公司 一种信息处理方法及电子设备
CN105933252A (zh) * 2016-04-01 2016-09-07 浪潮电子信息产业股份有限公司 一种交换机通信方法及系统、交换机
CN108718252B (zh) * 2018-05-10 2021-08-31 光脚信息科技(南京)有限公司 一种实现内容网络传送的架构
US10693761B2 (en) * 2018-07-02 2020-06-23 Hewlett Packard Enterprise Development Lp Computer system including multilayer switches
CN109005121B (zh) * 2018-08-24 2021-06-29 新华三技术有限公司 一种路由计算方法及装置
CN109587066B (zh) * 2019-01-08 2021-10-15 百度在线网络技术(北京)有限公司 用于生成信息的方法及装置
CN111294278B (zh) * 2020-01-03 2022-02-25 腾讯科技(深圳)有限公司 路由方法、装置、电子设备及计算机可读存储介质
CN113810274B (zh) * 2020-06-16 2025-05-30 华为技术有限公司 一种路由处理方法及相关设备
US11171883B1 (en) * 2020-07-07 2021-11-09 Mellanox Technologies, Ltd. Peering-fabric routing using switches having dynamically configurable forwarding logic
CN114006800B (zh) * 2021-10-11 2023-12-05 中盈优创资讯科技有限公司 一种基于igp-spf算法的设备脱网告警方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1741533A (zh) * 2005-09-15 2006-03-01 杭州华为三康技术有限公司 优化建立pim-dm路由表项的方法
CN101141382A (zh) * 2006-09-07 2008-03-12 华为技术有限公司 路由更新方法和路由器
CN101631130A (zh) * 2009-08-27 2010-01-20 杭州华三通信技术有限公司 直连ebgp邻居间的路由通告方法和设备
CN101800742A (zh) * 2010-01-28 2010-08-11 华为技术有限公司 路由设备上游信息的更新处理方法、路由设备及网络系统
CN101834778A (zh) * 2009-12-18 2010-09-15 中兴通讯股份有限公司 一种邻居发现协议表项处理的方法和三层交换设备
CN101515899B (zh) * 2009-04-01 2012-05-23 中国人民解放军信息工程大学 一种路由生成方法和装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100417110C (zh) * 2004-09-24 2008-09-03 华为技术有限公司 基于汇聚型网络系统的路由更新方法
JP4734539B2 (ja) * 2006-05-15 2011-07-27 学校法人慶應義塾 ネットワークに含まれるノード間の最短経路を探索するためのシステムおよび方法
KR101292076B1 (ko) * 2009-12-21 2013-07-31 한국전자통신연구원 보안등 근거리 무선 통신 라우팅 방법
EP2589188B1 (en) * 2010-06-29 2020-04-22 Huawei Technologies Co., Ltd. Asymmetric network address encapsulation
CN102625345B (zh) * 2011-01-28 2015-08-19 中国移动通信集团公司 一种应用层信令路由保护方法和设备
CN102186221B (zh) * 2011-04-25 2013-11-20 北京星网锐捷网络技术有限公司 一种路由表项的更新方法以及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1741533A (zh) * 2005-09-15 2006-03-01 杭州华为三康技术有限公司 优化建立pim-dm路由表项的方法
CN101141382A (zh) * 2006-09-07 2008-03-12 华为技术有限公司 路由更新方法和路由器
CN101515899B (zh) * 2009-04-01 2012-05-23 中国人民解放军信息工程大学 一种路由生成方法和装置
CN101631130A (zh) * 2009-08-27 2010-01-20 杭州华三通信技术有限公司 直连ebgp邻居间的路由通告方法和设备
CN101834778A (zh) * 2009-12-18 2010-09-15 中兴通讯股份有限公司 一种邻居发现协议表项处理的方法和三层交换设备
CN101800742A (zh) * 2010-01-28 2010-08-11 华为技术有限公司 路由设备上游信息的更新处理方法、路由设备及网络系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117955895A (zh) * 2023-12-29 2024-04-30 北京东土科技股份有限公司 交换机及其转发表项的更新方法、存储介质及计算设备

Also Published As

Publication number Publication date
US20150229560A1 (en) 2015-08-13
CN103685035B (zh) 2018-04-27
CN103685035A (zh) 2014-03-26

Similar Documents

Publication Publication Date Title
WO2014048339A1 (zh) 路由更新方法、交换机及系统
US11411853B2 (en) Link-state advertisement LSA sending method, apparatus, and system
KR102002189B1 (ko) 분할 아키텍처 시스템에서의 제어 트래픽의 탄력적 라우팅을 위한 방법 및 장치
US9264302B2 (en) Methods and systems with enhanced robustness for multi-chassis link aggregation group
EP3122004A1 (en) Traffic switching method, device, and system
US20140146821A1 (en) Method and apparatus for protocol data unit synchronization in an is-is system
WO2008025299A1 (en) A root path computation method in shortest path bridge
CN105871718B (zh) 一种sdn域间路由实现方法
CA2882535A1 (en) Control device discovery in networks having separate control and forwarding devices
CN101860492A (zh) 快速切换的方法、装置和系统
JP2014534776A (ja) 全範囲の保護を提供するip高速リルート方式
JP6570740B2 (ja) クラスター通信
CN101771618A (zh) 一种分组传送网络接入环中主机路由可达的方法及系统
EP2951980A1 (en) Accelerated mac address resolution for ipv6 traffic with is-is protocol
CN105340230A (zh) 虚拟机架拓扑管理
WO2021004213A1 (zh) 融合网络的路径标签确定方法及装置、存储介质及电子装置
WO2020135339A1 (zh) 一种网络路径收敛的方法以及相关设备
CN103634218B (zh) 路由快速收敛的方法及装置
CN107733719B (zh) 一种软件定义抗毁网络无损路径恢复方法
JP5945254B2 (ja) ネットワーク制御システムおよびネットワーク制御方法
WO2017174019A1 (zh) 一种路由信息处理方法、分组交换设备及存储介质
CN101764820B (zh) Gr场景的链路状态数据库信息同步方法、装置及系统
CN105306362B (zh) 基于IPv6的OSPF网络路由信息的被动采集方法及系统
JP5576837B2 (ja) 経路情報更新システム、及び経路情報更新方法
CN119299282B (zh) 网络故障通告方法、装置、网络设备及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13842422

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 14431594

Country of ref document: US

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC OF 100815

122 Ep: pct application non-entry in european phase

Ref document number: 13842422

Country of ref document: EP

Kind code of ref document: A1