CN115580575A - Routing path switching method, device, equipment, medium and router - Google Patents

Routing path switching method, device, equipment, medium and router Download PDF

Info

Publication number
CN115580575A
CN115580575A CN202211553627.0A CN202211553627A CN115580575A CN 115580575 A CN115580575 A CN 115580575A CN 202211553627 A CN202211553627 A CN 202211553627A CN 115580575 A CN115580575 A CN 115580575A
Authority
CN
China
Prior art keywords
forwarding
path
message
current
target
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.)
Pending
Application number
CN202211553627.0A
Other languages
Chinese (zh)
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.)
BEIJING ZHONGKE WANGWEI INFORMATION TECHNOLOGY CO LTD
Original Assignee
BEIJING ZHONGKE WANGWEI INFORMATION TECHNOLOGY 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 BEIJING ZHONGKE WANGWEI INFORMATION TECHNOLOGY CO LTD filed Critical BEIJING ZHONGKE WANGWEI INFORMATION TECHNOLOGY CO LTD
Priority to CN202211553627.0A priority Critical patent/CN115580575A/en
Publication of CN115580575A publication Critical patent/CN115580575A/en
Pending legal-status Critical Current

Links

Images

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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Landscapes

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

Abstract

The invention provides a method, a device, equipment, a medium and a router for switching a routing path, which relate to the technical field of routing, and the method comprises the following steps: receiving a current message, and searching a routing table under the condition of acquiring an indication instruction; determining a target forwarding path of the current message from the routing table under the condition that the current forwarding path of the current message cannot be determined from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path; and the indication instruction is generated after the detection message is sent to the current forwarding path and the response message of the current forwarding path is not received. The invention can find the path fault in real time by detecting the message and switch the route forwarding path in the message forwarding process in time, thereby ensuring the smooth network of route forwarding and improving the user experience.

Description

Routing path switching method, device, equipment, medium and router
Technical Field
The present invention relates to the field of routing technologies, and in particular, to a method, an apparatus, a device, a medium, and a router for switching a routing path.
Background
At present, in the process of forwarding a message according to a forwarding path, once the forwarding path fails, a current forwarding node cannot sense that the current forwarding path is unreachable, so that network forwarding can be continuously performed according to the failed path, which causes network unsmooth and seriously affects user experience.
Disclosure of Invention
The invention provides a routing path switching method, a routing path switching device, routing path switching equipment, a routing path switching medium and a router, which are used for solving the technical problem that the prior art cannot sense the fault state of a routing path in real time and providing a technical scheme for switching a forwarding path of a message under the condition that the current routing fails.
In a first aspect, the present invention provides a method for switching a routing path, including:
receiving a current message, and searching a routing table under the condition of acquiring an indication instruction;
determining a target forwarding path of the current message from the routing table under the condition that the current forwarding path of the current message cannot be determined from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path;
and the indication instruction is generated after the detection message is sent to the current forwarding path and the response message of the current forwarding path is not received.
According to the method for switching the routing path provided by the present invention, after forwarding the current packet to the first next hop address according to the target forwarding path, the method further comprises:
storing the target forwarding path to a session library;
and receiving a next message, and forwarding the next message to the first next hop address according to the target forwarding path in the session library.
According to the routing path switching method provided by the invention, before receiving the current message, the method further comprises the following steps:
configuring all forwarding paths in a routing table;
each forwarding path is a communication path which takes a multi-exit route as a path starting point, takes network interface addresses of all same network segments distributed by the multi-exit route as hop points and takes the same destination address as a path terminal point in the network communication process of the client and the server.
The method for switching the routing path provided by the invention further comprises the following steps:
periodically sending detection messages to all forwarding paths to receive response messages of each forwarding path;
under the condition that the response message of a target forwarding path in all the forwarding paths is not received, the connected state of the target forwarding path is modified to the disconnected state in the routing table;
and modifying the disconnected state to the connected state of the target forwarding path in the routing table under the condition of receiving the response message of the target forwarding path.
According to the routing path switching method provided by the invention, after the detection messages are sent to all forwarding paths, the method further comprises the following steps:
and under the condition that all response messages of all forwarding paths are not received, generating a restarting instruction, wherein the restarting instruction is used for indicating the router to restart.
According to the routing path switching method provided by the present invention, the receiving a next packet and forwarding the next packet to the first next hop address according to the target forwarding path in the session library includes:
receiving the next message, and analyzing a target quintuple from the next message;
determining a target forwarding path from the session library according to the target quintuple;
acquiring a first next hop address in the target forwarding path, and forwarding the next message to the first next hop address;
the target quintuple analyzed by the current message is the same as the target quintuple analyzed by the next message;
the target five-tuple comprises a next hop address, a next hop port, a target address, a target port and a forwarding protocol.
In a second aspect, a router is provided, which includes a router body, where the router body includes a session module, a detection module, and a central processing unit;
the session module is used for storing and forwarding paths in a session library;
the detection module is used for periodically sending detection messages to all forwarding paths so as to receive response messages of each forwarding path;
the routing path switching method further comprises a memory and a program or an instruction which is stored on the memory and can run on the central processing unit, and when the program or the instruction is executed by the central processing unit, the routing path switching method is executed, and the routing path switching method comprises the following steps: receiving a current message, and searching a routing table under the condition of acquiring an indication instruction; determining a target forwarding path of the current message from the routing table under the condition that the current forwarding path of the current message cannot be determined from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path; the indication instruction is generated by not receiving a response message of the current forwarding path after sending the detection message to the current forwarding path.
In a third aspect, the present invention provides a routing path switching apparatus, including:
a searching unit: receiving a current message, and searching a routing table under the condition of acquiring an indication instruction;
a determination unit: determining a target forwarding path of the current message from the routing table under the condition that the current forwarding path of the current message cannot be determined from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path;
the indication instruction is generated by not receiving a response message of the current forwarding path after sending the detection message to the current forwarding path.
In a fourth aspect, the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-mentioned routing path switching methods.
In a fifth aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the routing path switching method as described in any of the above.
Has the beneficial effects that: the invention provides a routing path switching method, a device, equipment, a medium and a router, which are used for periodically detecting whether all forwarding paths have faults according to a detection message and searching a routing table under the condition of determining the path faults so that the router can forward a current message to a next hop address according to a target forwarding path determined in the routing table, thereby realizing the routing path switching of the current message.
Drawings
In order to more clearly illustrate the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flow chart of a routing path switching method provided in the present invention;
fig. 2 is a second schematic flow chart of the routing path switching method provided in the present invention;
fig. 3 is a third schematic flow chart of the routing path switching method provided in the present invention;
fig. 4 is a schematic flow chart of forwarding a next packet to a first next hop address according to the present invention;
FIG. 5 is a schematic diagram of the routing path provided by the present invention;
FIG. 6 is a fourth flowchart illustrating a method for switching routing paths according to the present invention;
FIG. 7 is a schematic diagram of a probing process provided by the present invention;
FIG. 8 is a schematic diagram of a module connection of a router provided by the present invention;
fig. 9 is a schematic structural diagram of a routing path switching device provided in the present invention;
fig. 10 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The multi-exit route is a network technology that the network forwarding equipment can reach a destination address by adopting a plurality of route ways aiming at the same destination or a destination network segment, different route ways can achieve the purposes of load balancing and bandwidth expansion according to algorithms such as strategy or weight, session fast-forwarding is that the network forwarding equipment analyzes a message after receiving the message, establishes a quintuple session after obtaining the message quintuple, determines an exit interface of the session through searching a routing table, does not need to search the route again after subsequently receiving the message of the same quintuple, and directly carries out fast-forwarding according to the session. However, in the actual network application process, the multi-outlet route cannot sense the state of the route path in real time, and when one forwarding path fails, the current forwarding node continues to forward according to the failed path, which may cause network failure and further affect the use of the network by the user. In order to solve the above technical problem, the present invention provides a method for switching a routing path, and fig. 1 is a schematic flow diagram of the method for switching a routing path provided by the present invention, where the method for switching a routing path includes:
receiving a current message, and searching a routing table under the condition of acquiring an indication instruction;
determining a target forwarding path of the current message from the routing table under the condition that the current forwarding path of the current message cannot be determined from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path;
and the indication instruction is generated after the detection message is sent to the current forwarding path and the response message of the current forwarding path is not received.
In step 101, the current packet is a packet at an intermediate stage in a packet transmission process in a process of continuously implementing traffic interaction after network communication between a client and a server is established, the packet at this time is directly and rapidly forwarded according to a session library without being searched by a routing table, and a forwarding path corresponding to the packet exists in the session library, however, in step 101, the current packet is received in real time, and in a case of obtaining an instruction, it is considered that the forwarding path in the session library corresponding to the current packet at this time is invalid, and the packet forwarding of the forwarding path cannot be implemented, at this time, the routing table needs to be searched again, that is, the instruction has a purpose of initiating an instruction for searching the routing table.
In step 102, it is determined that the current forwarding path of the current packet has failed through detection of the detection packet, and then the indication instruction is generated, and meanwhile, the current forwarding path of the current packet is set as an invalid path in the routing table, so that when the routing table is searched again according to the current packet, the current forwarding path of the current packet cannot be determined from the routing table.
Optionally, the target forwarding path of the current packet is determined according to the detection packet, and since all unreachable paths in the routing table are set as invalid paths, an effective path in the routing table is determined.
The invention determines whether the route path is normally reachable according to the real-time detection of the network exit on the target address, if a certain path is found to be unreachable through the detection, the invention informs the routing table to mark the route exit corresponding to the path as invalid, and informs the routing table to carry out path selection again to switch to the reachable path for network forwarding.
The invention provides a routing path switching method, a device, equipment, a medium and a router, which are used for periodically detecting whether all forwarding paths have faults or not according to a detection message, searching a routing table under the condition of determining the path faults so that the router can forward a current message to a next hop address according to a target forwarding path determined in the routing table, thereby realizing the routing path switching of the current message.
Fig. 2 is a second schematic flow chart of the routing path switching method provided in the present invention, and after forwarding the current packet to the first next hop address according to the target forwarding path, the method further includes:
storing the target forwarding path to a session library;
and receiving a next message, and forwarding the next message to the first next hop address according to the target forwarding path in the session library.
In step 201, the target forwarding path is stored in a session library, and in an optional embodiment, a mapping relationship between the target forwarding path and the current packet may also be stored in the session library, although in step 201, the current packet is forwarded to a first next hop address according to the target forwarding path, in a next packet, fast forwarding according to the target forwarding path cannot be achieved, and invalid route forwarding is still performed according to the current forwarding path, so that the invention needs to implement fast forwarding according to the target forwarding path through the session library, and further in an optional embodiment, a mapping relationship between the target forwarding path and the current packet is first established, so that subsequent packets related to the current packet can all implement fast forwarding of the target forwarding path according to the mapping relationship, and then the mapping relationship between the target forwarding path and the current packet is stored in the session library.
In step 202, a next message is received, and the next message is forwarded to the first next hop address according to the target forwarding path in the session library, and in an optional embodiment, the next message is received, the target forwarding path is matched from the session library, and the next message is forwarded to the first next hop address.
The invention periodically detects whether all forwarding paths have faults according to the detection message, searches the routing table under the condition of determining the path faults so that the router can forward the current message to the next hop address according to the target forwarding path determined in the routing table, and stores the mapping relation between the target forwarding path and the current message to the session library, thereby enabling the subsequent continuously forwarded messages to realize message forwarding through the target forwarding path.
Optionally, before receiving the current packet, the method further includes:
receiving an initial message, determining the current forwarding path of the initial message from a routing table, and forwarding the initial message to a second next hop address according to the current forwarding path;
storing the mapping relation between the current forwarding path and the initial message to a session library;
and receiving a last message, and forwarding the last message to the second next hop address according to the current forwarding path in the session library.
Firstly, before receiving a current message, processing the initial message to construct a mapping relationship between a fast forwarding path of the initial message and the initial message in a session library, specifically, after receiving the initial message, determining the current forwarding path of the initial message from a routing table, forwarding the initial message to a second next hop address according to the current forwarding path, where the current forwarding path of the initial message may be preset in the routing table or may be a forwarding path determined randomly from the routing table, and then forwarding the initial message to the second next hop address according to the current forwarding path, where the target forwarding path corresponds to a first next hop address and the current forwarding path corresponds to a second next hop address.
And then, storing the mapping relation between the current forwarding path and the initial message to a session library, wherein the mapping relation between the current forwarding path and the initial message is stored to the session library because a routing table does not need to be searched again when the next message of the initial message is received after the current forwarding path of the initial message is determined, and the fast forwarding can be directly carried out according to the forwarding path in the session library.
And finally, receiving a previous message, and forwarding the previous message to the second next hop address according to a current forwarding path in the session library.
Optionally, before receiving the current packet, the method further includes:
configuring all forwarding paths in a routing table;
each forwarding path is a communication path which takes a multi-exit route as a path starting point, takes network interface addresses of all same network segments distributed by the multi-exit route as jumping points and takes the same target address as a path end point in the network communication process of the client and the server.
In the present invention, a network environment and a corresponding configuration are firstly established, fig. 5 is a schematic diagram of a routing path provided by the present invention, the present invention aims to realize data interaction between a client and a server, in the data interaction process, a left-side router is a multi-exit router, which passes through a path 1 and a path 2 to reach a destination address, if an address corresponding to an upper-side router is a first next hop address, an address corresponding to a lower-side router is a second next hop address, if an address corresponding to an upper-side router is a second next hop address, an address corresponding to a lower-side router is a first next hop address, and after passing through different hop points, the same destination address is used as a path end point, so in the present invention, each forwarding path is a communication path in which a multi-exit route is used as a path start point, network interface addresses of all same network segments allocated according to the multi-exit route are used as hop points, and the same destination address is used as a path end point.
Fig. 3 is a third schematic flow chart of the routing path switching method provided in the present invention, further including:
periodically sending detection messages to all forwarding paths to receive response messages of each forwarding path;
modifying the connection state of the target forwarding path to a disconnection state in the routing table under the condition that the response message of the target forwarding path in all the forwarding paths is not received;
and modifying the disconnected state to the connected state of the target forwarding path in the routing table under the condition of receiving the response message of the target forwarding path.
Optionally, the method includes periodically sending a probe packet to all forwarding paths to receive a response packet of each forwarding path, modifying a connected state of the forwarding path to a disconnected state in the routing table when no response packet of any forwarding path is received, and modifying a disconnected state of the forwarding path to a connected state in the routing table when a response packet of the forwarding path is received.
In step 301, before searching the routing table, the present invention needs to detect all forwarding paths, and if and only if it is determined that the current forwarding path is a failure path, the route is searched again, but the present invention adopts a mode that does not periodically detect a certain forwarding path or some forwarding paths, but periodically sends a detection packet to all forwarding paths so as to receive a response packet of each forwarding path.
Optionally, there are two forwarding paths in the present invention, and with reference to fig. 5, the router uses the next hop address of path 1 as the upper route corresponding address, uses the next hop address of path 2 as the lower route corresponding address, and the server address is the detection target address.
In step 302, under the condition that the response message of the target forwarding path in all the forwarding paths is not received, the connected state of the target forwarding path is modified to the disconnected state in the routing table, and for the target forwarding path which does not receive the response message, the connected state of the target forwarding path is modified to the disconnected state in the routing table.
In step 303, under the condition that the response packet of the target forwarding path is received, the disconnected state to the connected state of the target forwarding path is modified in the routing table, and for the target forwarding path in the disconnected state, if the response packet of the target forwarding path is received in the periodic detection process, the disconnected state to the connected state of the target forwarding path is modified in the routing table.
Optionally, before determining the target forwarding path of the current packet from the routing table, the method further includes: and under the condition that the response message of the current forwarding path is not received, modifying the connected state of the current forwarding path to the disconnected state in the routing table so as to ensure that the current forwarding path of the current message cannot be determined from the routing table.
Optionally, after sending the probe packet to all forwarding paths, the method further includes:
and under the condition that all response messages of all forwarding paths are not received, generating a restarting instruction, wherein the restarting instruction is used for indicating the router to restart.
Under the condition that all response messages of all forwarding paths are not responded, the situation that a detection module fails or other functions of the router fail possibly exists, so that the router can be automatically restarted in order to timely restore the smoothness of the router, the problem that detection responses cannot be obtained is solved in a restarting mode, the process does not need to be carried out in the using process of user data interaction, the operation of restarting after detection can also be carried out in the non-using state of a user, and smooth use of the user in the actual using process is further ensured, and therefore user experience is improved.
In the present invention, before determining the target forwarding path of the current packet from the routing table, it is necessary to make the router unable to determine the current forwarding path of the current packet from the routing table, and when the response packet of the current forwarding path is not received, the current forwarding path is considered to be in a failure state, so that the connected state of the current forwarding path is modified to a disconnected state in the routing table, and at this time, if the forwarding path of the current packet is determined from the routing table, the state of the current forwarding path can be definitely determined to be in the disconnected state.
Fig. 4 is a schematic flow chart of forwarding a next packet to a first next hop address provided in the present invention, where the receiving a next packet and forwarding the next packet to the first next hop address according to the target forwarding path in the session library includes:
receiving the next message, and analyzing a target quintuple from the next message;
determining a target forwarding path from the session library according to the target quintuple;
acquiring a first next hop address in the target forwarding path, and forwarding the next message to the first next hop address;
the target quintuple analyzed by the current message is the same as the target quintuple analyzed by the next message;
the target five-tuple comprises a next hop address, a next hop port, a target address, a target port and a forwarding protocol.
In step 2021, the next packet is received, and a target five-tuple is parsed from the next packet, where the target five-tuple includes a next hop address, a next hop port, a target address, a target port, and a forwarding protocol, that is, the target five-tuple is used as a basis for determining a forwarding path according to the present invention.
In step 2022, a target forwarding path is determined from the session library according to the target quintuple, and since the target quintuple parsed from the current packet is the same as the target quintuple parsed from the next packet, and a mapping relationship between the target forwarding path and the target quintuple parsed from the current packet exists in the session library, the present invention can match the target forwarding path from the session library according to the target quintuple.
In step 2023, a first next hop address in the target forwarding path is obtained, and the next packet is forwarded to the first next hop address, where the target forwarding path at least includes a communication path that takes a multi-egress route as a path starting point, a target network interface address allocated according to the multi-egress route as a hop point, and a target address as a path ending point, and further forwards the next packet to the first next hop address according to the target forwarding path, and forwards the next packet from the first next hop address to the target address according to the target forwarding path.
Fig. 6 is a fourth schematic flow chart of the routing path switching method provided by the present invention, after configuring the multi-egress route, the present invention adds the gateway address to the detection module, and configures the host address of the destination network segment as the detection target, the detection module sends out the Message request of Internet Control Message Protocol (ICMP) with the gateway address and the network interface address of the same network segment as the source address and the detection target as the destination address, the detection module waits to receive the ICMP reply with the source address as the detection target address and the destination address as the gateway and the network segment interface address, that is, the reply Message of the ICMP request, if the detection module receives the reply Message required, it indicates that the forwarding path is reachable, and if the detection module does not receive the reply Message required, it indicates that the forwarding path is failed but not reachable.
Optionally, the detection module is further configured to set validity of a route in the routing table according to the detection result, and after finding that the forwarding path is unreachable, the detection module sends a signal to the routing table to set the corresponding routing outlet as invalid, and when performing subsequent routing query, the routing outlet set as invalid will not be used, but other normal routing outlets are used, the session module will forward a message according to the normal network outlet, and the detection module simultaneously notifies the session module that the existing forwarding information is invalid, and it is necessary to perform routing lookup again, and update the network outlet of the session.
Optionally, the detection module periodically sends out a detection message request to detect the state of the forwarding path in real time, however, when the failed forwarding path can receive a response message of the request again, it indicates that the path is recovered to be normal, the detection module notifies the routing management to reset the invalid routing exit to be in a normal state, and at this time, the forwarding path reset to be in the normal state can participate in subsequent network forwarding.
Fig. 7 is a schematic diagram of a detection flow provided by the present invention, in which a detection task is added to a detection module according to a route configuration, a detection thread is started, a detection message is continuously sent, a detection target response is waited for, in a case that the target response is received, a next round of detection task is executed, in a case that the target response cannot be received, a forwarding path related to the target response is set in a routing table to be invalid, a session module is notified to search for a route again, and the next round of detection task is continued.
Optionally, in an actual message forwarding process, it is assumed that a flow a is a flow in network communication from a client to a server, a session is established when a first network message of the flow a reaches a router, and a next hop address of the message is determined through route lookup, that is, forwarding is performed from the path 1, a subsequent message of the flow a is quickly forwarded through a session module, and no route is searched, at this time, when the detection module executes a detection task, it is detected that the path 1 is unreachable, and the detection task 2 detects that the path 2 is normal, and further sets a route exit of the path 1 as invalid, and notifies the session module, the current flow a needs to re-lookup a route table, and re-lookup a route after the message of the flow a reaches the router again, because the route exit of the path 1 is invalid, the route exit of another next hop address continues to be looked up, that the path 2 is used for forwarding, and the exit of the session is updated to be a network exit where the path 2 is located, so that the subsequent message of the flow a reaches the router and is forwarded according to the exit of the session, the path 2.
The invention can sense the reachable state of the network forwarding path in real time, can dynamically switch to other reachable paths when determining that the forwarding path has a fault, and can not interrupt the network flow when switching the path, thereby ensuring the smooth network forwarding by the route and improving the use experience of a user.
Fig. 8 is a schematic diagram of module connection of a router provided by the present invention, and the present invention further discloses a router, which includes a router body 1, where the router body includes a session module 11, a detection module 12, and a central processing unit 13, where the session module 11 is configured to store forwarding paths in a session library, the detection module 12 is configured to periodically send a detection packet to all forwarding paths to receive a response packet of each forwarding path, and further includes a memory 14 and a program or instruction stored in the memory 14 and executable on the central processing unit 13, where the program or instruction is executed by the central processing unit 13 to implement the routing path switching method, and the method includes: receiving a current message, and searching a routing table under the condition of acquiring an indication instruction; determining a target forwarding path of the current message from the routing table under the condition that the current forwarding path of the current message cannot be determined from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path; and the indication instruction is generated after the detection message is sent to the current forwarding path and the response message of the current forwarding path is not received.
The invention provides a routing path switching method, a device, equipment, a medium and a router, which are used for periodically detecting whether all forwarding paths have faults according to a detection message and searching a routing table under the condition of determining the path faults so that the router can forward a current message to a next hop address according to a target forwarding path determined in the routing table, thereby realizing the routing path switching of the current message.
Fig. 9 is a schematic structural diagram of a routing path switching apparatus provided in the present invention, and the present invention provides a routing path switching apparatus, which includes a searching unit 21: receiving the current packet, and searching for the routing table in the case of obtaining the instruction, the working principle of the searching unit 21 may refer to the foregoing step 101, which is not described herein again.
The routing path switching apparatus further includes a determining unit 22: in a case that the current forwarding path of the current packet cannot be determined from the routing table, a target forwarding path of the current packet is determined from the routing table, and the current packet is forwarded to the first next hop address according to the target forwarding path, and the operation principle of the determining unit 22 may refer to the step 102, which is not described herein again.
And the indication instruction is generated after the detection message is sent to the current forwarding path and the response message of the current forwarding path is not received.
The invention provides a routing path switching method, a device, equipment, a medium and a router, which are used for periodically detecting whether all forwarding paths have faults according to a detection message and searching a routing table under the condition of determining the path faults so that the router can forward a current message to a next hop address according to a target forwarding path determined in the routing table, thereby realizing the routing path switching of the current message.
Fig. 10 is a schematic structural diagram of an electronic device provided by the present invention. As shown in fig. 10, the electronic device may include: a processor (processor) 110, a communication Interface (communication Interface) 120, a memory (memory) 130 and a communication bus 140, wherein the processor 110, the communication Interface 120 and the memory 130 are communicated with each other via the communication bus 140. Processor 110 may invoke logic instructions in memory 130 to perform a routing path switching method comprising: receiving a current message, and searching a routing table under the condition of acquiring an instruction; under the condition that the current forwarding path of the current message cannot be determined from the routing table, determining a target forwarding path of the current message from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path; the indication instruction is generated by not receiving a response message of the current forwarding path after sending the detection message to the current forwarding path.
In addition, the logic instructions in the memory 130 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, when the computer program is executed by a processor, a computer can execute a routing path switching method provided by the above methods, the method includes: receiving a current message, and searching a routing table under the condition of acquiring an instruction; determining a target forwarding path of the current message from the routing table under the condition that the current forwarding path of the current message cannot be determined from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path; and the indication instruction is generated after the detection message is sent to the current forwarding path and the response message of the current forwarding path is not received.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the routing path switching method provided by the above methods, the method including: receiving a current message, and searching a routing table under the condition of acquiring an indication instruction; under the condition that the current forwarding path of the current message cannot be determined from the routing table, determining a target forwarding path of the current message from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path; the indication instruction is generated by not receiving a response message of the current forwarding path after sending the detection message to the current forwarding path.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for switching a routing path, comprising:
receiving a current message, and searching a routing table under the condition of acquiring an instruction;
under the condition that the current forwarding path of the current message cannot be determined from the routing table, determining a target forwarding path of the current message from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path;
the indication instruction is generated by not receiving a response message of the current forwarding path after sending the detection message to the current forwarding path.
2. The method according to claim 1, further comprising, after forwarding the current packet to a first next hop address according to the target forwarding path:
storing the target forwarding path to a session library;
and receiving a next message, and forwarding the next message to the first next hop address according to the target forwarding path in the session library.
3. The routing path switching method according to claim 1, further comprising, before receiving the current packet:
configuring all forwarding paths in a routing table;
each forwarding path is a communication path which takes a multi-exit route as a path starting point, takes network interface addresses of all same network segments distributed by the multi-exit route as jumping points and takes the same target address as a path end point in the network communication process of the client and the server.
4. The routing path switching method according to claim 1, further comprising:
periodically sending detection messages to all forwarding paths to receive response messages of each forwarding path;
under the condition that the response message of a target forwarding path in all the forwarding paths is not received, the connected state of the target forwarding path is modified to the disconnected state in the routing table;
and modifying the disconnected state to the connected state of the target forwarding path in the routing table under the condition of receiving the response message of the target forwarding path.
5. The method according to claim 4, further comprising, after sending the probe message to all forwarding paths:
and under the condition that all response messages of all forwarding paths are not received, generating a restarting instruction, wherein the restarting instruction is used for indicating the router to restart.
6. The method according to claim 2, wherein the receiving a next packet and forwarding the next packet to the first next hop address according to the target forwarding path in the session library comprises:
receiving the next message, and analyzing a target quintuple from the next message;
determining a target forwarding path from the session library according to the target quintuple;
acquiring a first next hop address in the target forwarding path, and forwarding the next message to the first next hop address;
the target quintuple analyzed by the current message is the same as the target quintuple analyzed by the next message;
the destination five-tuple includes a next hop address, a next hop port, a destination address, a destination port, and a forwarding protocol.
7. A router is characterized by comprising a router body, wherein the router body comprises a session module, a detection module and a central processing unit;
the session module is used for storing and forwarding paths in a session library;
the detection module is used for periodically sending detection messages to all forwarding paths so as to receive response messages of each forwarding path;
the router also comprises a memory and a program or an instruction which is stored on the memory and can run on the central processing unit, and the program or the instruction is executed by the central processing unit to execute the router path switching method according to any one of claims 1 to 6.
8. A routing path switching apparatus, comprising:
a search unit: receiving a current message, and searching a routing table under the condition of acquiring an indication instruction;
a determination unit: under the condition that the current forwarding path of the current message cannot be determined from the routing table, determining a target forwarding path of the current message from the routing table, and forwarding the current message to a first next hop address according to the target forwarding path;
the indication instruction is generated by not receiving a response message of the current forwarding path after sending the detection message to the current forwarding path.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the routing path switching method according to any one of claims 1 to 6 when executing the program.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the routing path switching method according to any one of claims 1 to 6.
CN202211553627.0A 2022-12-06 2022-12-06 Routing path switching method, device, equipment, medium and router Pending CN115580575A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211553627.0A CN115580575A (en) 2022-12-06 2022-12-06 Routing path switching method, device, equipment, medium and router

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211553627.0A CN115580575A (en) 2022-12-06 2022-12-06 Routing path switching method, device, equipment, medium and router

Publications (1)

Publication Number Publication Date
CN115580575A true CN115580575A (en) 2023-01-06

Family

ID=84590678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211553627.0A Pending CN115580575A (en) 2022-12-06 2022-12-06 Routing path switching method, device, equipment, medium and router

Country Status (1)

Country Link
CN (1) CN115580575A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585377A (en) * 2003-08-22 2005-02-23 华为技术有限公司 Method for realizing message retransmission under routing device
CN101009661A (en) * 2007-01-25 2007-08-01 华为技术有限公司 Method and device for updating stream forward table content based on the stream forward
US20150372902A1 (en) * 2013-02-26 2015-12-24 Telefonaktiebolaget L M Ericsson (Publ) Traffic Recovery in Openflow Networks
CN110677340A (en) * 2019-10-16 2020-01-10 杭州迪普科技股份有限公司 Message forwarding method and device
CN114500366A (en) * 2022-01-28 2022-05-13 武汉烽火技术服务有限公司 Method and device for preventing route loop between main and standby nodes

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585377A (en) * 2003-08-22 2005-02-23 华为技术有限公司 Method for realizing message retransmission under routing device
CN101009661A (en) * 2007-01-25 2007-08-01 华为技术有限公司 Method and device for updating stream forward table content based on the stream forward
US20150372902A1 (en) * 2013-02-26 2015-12-24 Telefonaktiebolaget L M Ericsson (Publ) Traffic Recovery in Openflow Networks
CN110677340A (en) * 2019-10-16 2020-01-10 杭州迪普科技股份有限公司 Message forwarding method and device
CN114500366A (en) * 2022-01-28 2022-05-13 武汉烽火技术服务有限公司 Method and device for preventing route loop between main and standby nodes

Similar Documents

Publication Publication Date Title
CN111917643B (en) Seamless bidirectional forwarding detection method and device for segmented routing tunnel
CN107454155B (en) Fault processing method, device and system based on load balancing cluster
US9479432B2 (en) DHT-based control network implementation method and system, and network controller
CN110113259B (en) Path state notification method, path switching method, forwarding equipment and system
US20210119906A1 (en) Loop Avoidance Communications Method, Device, and System
US9270558B2 (en) Method, local gateway, and system for local voice survivability
CN111698164B (en) Network routing method and device of virtual machine and management server
US20190007288A1 (en) System and method of handling a fault detection mechanism with link aggregation groups
CN109698767A (en) A kind of main/standby switching method and device
CN107241208B (en) Message forwarding method, first switch and related system
CN113630312A (en) Path detection method, device, network equipment and computer readable storage medium
US20230116548A1 (en) Route Processing Method and Related Device
CN102136947A (en) Method and device for processing link faults
KR20110063328A (en) Remote procedure call(rpc) bind service with physical interface query and selection
US9246796B2 (en) Transmitting and forwarding data
CN112383414B (en) Dual-machine hot backup quick switching method and device
US10616046B2 (en) System and method of handling a fault detection mechanism during a control plane failover
WO2001022550A9 (en) Identyfying a failed device in a network
EP2736204B1 (en) Rendezvous Point Convergence Method and Apparatus
CN110011921B (en) Route synchronization method, device, network equipment and storage medium
WO2011124178A2 (en) Fault detection method, route node and system
CN115580575A (en) Routing path switching method, device, equipment, medium and router
US20230179566A1 (en) Method and Device for Switching Internet Access mode of Gateway Device
CN108616423B (en) Offline device monitoring method and device
US9294376B2 (en) Apparatus for searching route in layer 2 network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20230106

RJ01 Rejection of invention patent application after publication