CN111447101B - Link detection method, device, computer equipment and storage medium - Google Patents

Link detection method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN111447101B
CN111447101B CN202010122314.4A CN202010122314A CN111447101B CN 111447101 B CN111447101 B CN 111447101B CN 202010122314 A CN202010122314 A CN 202010122314A CN 111447101 B CN111447101 B CN 111447101B
Authority
CN
China
Prior art keywords
virtual
link
state information
forwarding instance
detection
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.)
Active
Application number
CN202010122314.4A
Other languages
Chinese (zh)
Other versions
CN111447101A (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010122314.4A priority Critical patent/CN111447101B/en
Publication of CN111447101A publication Critical patent/CN111447101A/en
Priority to PCT/CN2020/118064 priority patent/WO2021169276A1/en
Application granted granted Critical
Publication of CN111447101B publication Critical patent/CN111447101B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/0823Errors, e.g. transmission errors
    • 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/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • 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/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/586Association of routers of virtual routers

Landscapes

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

Abstract

The invention discloses a link detection method, a link detection device, computer equipment and a storage medium. The method comprises the following steps: selecting M virtual local area network sub-interfaces from K virtual local area network sub-interfaces of a specific physical network interface according to a preset selection mode, establishing a detection protocol session in virtual route forwarding instances of the selected M virtual local area network sub-interfaces, taking the virtual route forwarding instance with the established detection protocol session as a detection virtual route forwarding instance, and taking the virtual route forwarding instances of the unselected K-M virtual local area network sub-interfaces as subscription virtual route forwarding instances; acquiring link state information detected by a detected virtual routing forwarding instance; and indicating the subscribed virtual routing forwarding instance to perform routing change processing according to the link state information. The technical scheme of the invention can reduce the occupation of equipment resources such as CPU, memory and the like of the network equipment, thereby improving the performance of the network equipment and the network transmission performance.

Description

Link detection method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a link detection method, a device, a computer device, and a storage medium.
Background
With the development of network communication technology, in order to ensure data transmission quality and speed, requirements on network equipment are increasing. If the network link fails, the failure point needs to be detected as soon as possible, so that measures can be taken in time, and the network equipment is required to be capable of rapidly detecting the failure and switching the flow to the backup link so as to accelerate the network convergence speed. The detection of link failure is typically done by the BFD (Bidirectional Forwarding Detection ) protocol as a fast detection mechanism.
BFD session is created on each VRF (Virtual Routing Forwarding, virtual route forwarding) instance, both sides of BFD session periodically send BFD control message to the opposite side on the link, and simultaneously periodically detect BFD control message sent by the opposite side on the link so as to detect whether the control message of the opposite side is received under a certain condition for fault detection. Based on the IEEE 802.1q standard specification, in a router or a three-layer switch supporting multiple VRFs, the same physical network interface can support up to 4096 VLAN (Virtual Local Area Network ) subinterfaces, so 4096 VRF instances can be established. To achieve fast route convergence in each VRF instance, a BFD session is opened to confirm connectivity to the next hop. Assuming that each BFD session detection time is configured to be 100 milliseconds, one data packet will be sent and received every 100 milliseconds, with 40960 BFD data packets being sent and received every second for 4096 BFD sessions. If the detection time is configured shorter, a larger number of packets need to be transmitted and received per second. This adds excessive overhead to the CPU (Central Processing Unit ), memory and network of a resource-constrained network device.
Disclosure of Invention
The embodiment of the invention provides a link detection method, a device, computer equipment and a storage medium, which are used for solving the problem that network equipment performance and network transmission performance are reduced due to occupation of network equipment resources and network transmission resources by link fault detection in a link communication network.
A link detection method, comprising:
selecting M virtual local area network sub-interfaces from K virtual local area network sub-interfaces of a specific physical network interface according to a preset selection mode, establishing a detection protocol session in virtual route forwarding instances of the selected M virtual local area network sub-interfaces, taking the virtual route forwarding instance with the established detection protocol session as a detection virtual route forwarding instance, and taking the virtual route forwarding instances of the unselected K-M virtual local area network sub-interfaces as subscription virtual route forwarding instances, wherein K and M are positive integers, and M is less than K;
acquiring the link state information detected by the detected virtual routing forwarding instance;
and forwarding the link state information to the subscription virtual routing forwarding instance, and indicating the subscription virtual routing forwarding instance to perform routing change processing according to the link state information.
A link detection apparatus comprising:
an instance object selection module, configured to select M virtual lan sub-interfaces from K virtual lan sub-interfaces of a specific physical network interface according to a preset selection manner, establish a detection protocol session in virtual route forwarding instances of the selected M virtual lan sub-interfaces, use the virtual route forwarding instance in which the detection protocol session is established as a detection virtual route forwarding instance, and use the virtual route forwarding instances of the unselected K-M virtual lan sub-interfaces as subscription virtual route forwarding instances, where K and M are positive integers, and M < K;
the information acquisition module is used for acquiring the link state information detected by the detected virtual routing forwarding instance;
and the information processing module is used for forwarding the link state information to the subscription virtual routing forwarding instance and indicating the subscription virtual routing forwarding instance to perform routing change processing according to the link state information.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above-described link detection method when the computer program is executed.
A computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above-described link detection method.
In the link detection method, the device, the computer equipment and the storage medium, the specific virtual local area network sub-interface is selected as the detection virtual routing forwarding instance according to the preset mode in the virtual local area network sub-interfaces of the specific physical network interface, and the detection protocol session is established in the detection virtual routing forwarding instance to detect the link state information, the unselected virtual local area network sub-interfaces are used as the subscription virtual routing forwarding instance, the link state information is acquired by utilizing the subscription mode, and the detection protocol session is not required to be established in each virtual local area network sub-interface to detect the link state information, so that the occupation of equipment resources such as a CPU (central processing unit) and a memory of the network equipment, the occupation of network transmission resources and the like can be further reduced, the forwarding capacity and the response capacity of the network equipment are improved, and the network equipment performance and the network transmission performance are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a link detection method according to an embodiment of the invention;
FIG. 2 is a flowchart of step S2 in a link detection method according to an embodiment of the present invention;
FIG. 3 is a flowchart of step S5 in a link detection method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a link detection apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a computer device in accordance with an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The link detection method provided by the application can be applied to network equipment, wherein the network equipment can be specifically various computers, hubs, switches, bridges, routers, gateways, network interface cards, wireless access points, printers, modems, portable wearable equipment and the like. The network equipment selects a detection virtual route forwarding instance and a subscription virtual route forwarding instance according to a preset mode, acquires the link state information detected by the detection virtual route forwarding instance, and indicates the subscription virtual route forwarding instance to carry out route change processing according to the link state information.
In an embodiment, as shown in fig. 1, a link detection method is provided, and the method is applied to a network device for example and specifically includes steps S1 to S3, which are described in detail as follows:
s1: selecting M virtual local area network sub-interfaces from K virtual local area network sub-interfaces of a specific physical network interface according to a preset selection mode, establishing a detection protocol session in virtual route forwarding instances of the selected M virtual local area network sub-interfaces, taking the virtual route forwarding instance with the established detection protocol session as a detection virtual route forwarding instance, and taking the virtual route forwarding instances of the unselected K-M virtual local area network sub-interfaces as subscription virtual route forwarding instances, wherein K and M are positive integers, and M is less than K.
Specifically, based on the IEEE 802.1q standard specification, one physical network interface of the network device can support 4096 virtual local area network subinterfaces at maximum, so that 4096 virtual route forwarding instances can be established at maximum. Wherein the virtual router forwarding instance is a VRF instance, and is specifically a virtual router in a virtual local area network subinterface, and the virtual router includes: a separate routing table, a separate address space, a collection of network interfaces belonging to the virtual router, and a set of routing protocols for the virtual router only. The network devices communicate with each other by accessing a routing table stored in an address space in the virtual routing forwarding instance through a routing protocol of the virtual routing forwarding instance.
And selecting M virtual local area network subinterfaces from K virtual local area network subinterfaces of a specific physical network interface according to a preset selection mode, wherein K is smaller than or equal to the maximum virtual local area network subinterface number 4096, M is smaller than K, and K and M are positive integers. The preset selection mode may be a random selection mode.
And establishing a detection protocol session in the selected virtual route forwarding instance in each virtual local area network subinterface. The detection protocol session, i.e. the BFD session, is a communication session established by the link detection protocol during the process of detecting link state information.
Specifically, in this embodiment, the link detection protocol for establishing a detection protocol session is specifically a bidirectional forwarding detection protocol, i.e. BFD protocol, which is an intermediate system protocol that can establish a connection with a link, interface, tunnel, route, or other network forwarding component; the bidirectional forwarding detection protocol is capable of establishing a peer-to-peer relationship with neighboring systems, each system monitoring the bidirectional forwarding detection protocol rate from the other systems at a negotiated rate, the monitored rate being capable of being set in millisecond increments. When the peer-to-peer system does not receive a predetermined number of data packets, it concludes that the software or hardware infrastructure protected by the bidirectional forwarding detection protocol is malfunctioning, whether the infrastructure is a label switched path, other types of tunnels, or switched ethernet networks. The bidirectional forwarding detection protocol is deployed on the control plane of routers and other systems. Network failures detected by the bidirectional forwarding detection protocol may be recovered by the forwarding plane or by the control plane.
It should be noted that, the network device uses the virtual routing forwarding protocol with the session of the bidirectional forwarding detection protocol as a detection virtual routing forwarding instance, and the virtual routing forwarding instances of the unselected K-M virtual local area network subinterfaces are used as subscription virtual routing forwarding instances, so that it is not necessary to establish the session of the bidirectional forwarding detection protocol on each virtual routing forwarding instance to detect link state information, and only needs to detect the link state by detecting the virtual routing forwarding instance, and the subscription virtual routing forwarding instance obtains the link state information by subscribing, so as to reduce occupation of resources of devices such as CPU and memory of the network device, and reduce occupation of network transmission resources, thereby improving forwarding capability and response capability of the network device, and improving performance and network transmission performance of the network device.
S2: and acquiring the link state information detected by the detected virtual routing forwarding instance.
Specifically, the link state is detected by detecting a bidirectional forwarding detection protocol session established in the virtual routing forwarding instance, and the link state information is acquired through the gateway address of the target link in the bidirectional forwarding detection protocol session.
Specifically, the main working process of the bidirectional forwarding detection protocol for establishing the bidirectional forwarding detection protocol session is as follows:
1. a bi-directional forwarding detection protocol session is established on a link between two endpoints using a bi-directional forwarding detection protocol, and the neighbor information is signaled to the bi-directional forwarding detection protocol upon upper layer protocol establishment, e.g., open shortest path first neighbor establishment. The bidirectional forwarding detection protocol re-establishes bidirectional forwarding detection protocol session neighbors based on this information, and if there are multiple links between the two endpoints, one bidirectional forwarding detection protocol session can be established for each link. Wherein the open shortest path is preferably an interior gateway protocol for deciding routing within a single autonomous system. Is an implementation of the link state routing protocol, belonging to the interior gateway protocol.
2. Bidirectional forwarding detection protocol session detection is performed between two network nodes that establish a session. If the link failure is found, the session neighbor of the bidirectional forwarding detection protocol is removed, and the upper layer protocol is immediately informed, so that the upper layer protocol can immediately perform corresponding switching.
When a session of the bidirectional forwarding detection protocol is established, there are two establishment modes: active mode and passive mode.
Active mode: and before the bidirectional forwarding detection protocol session is established, whether the bidirectional forwarding detection protocol control message sent by the target link gateway address end is received or not, the bidirectional forwarding detection protocol control message is actively sent to the target link gateway address end.
Passive mode: and the bidirectional detection protocol control message is not actively sent before the session is established until the bidirectional forwarding detection protocol control message sent by the target link gateway address end is received.
In the session initialization process, at least one of the two communication parties can successfully establish the session only by operating in the active mode.
The bidirectional forwarding detection protocol has two modes of operation after session establishment: asynchronous mode and query mode.
Asynchronous mode: in this mode, both link network nodes will periodically send bidirectional forwarding detection protocol control messages, and if no bidirectional forwarding detection protocol control message of the target link gateway address is received within the detection time, the corresponding link network node is considered to have a fault.
Query mode: each system is assumed to have a separate method of confirming its connection to the other system. Thus, whenever a bidirectional forwarding detection protocol session is established, the system stops sending bidirectional forwarding detection protocol control messages unless a system needs to explicitly verify connectivity. If the connectivity is to be explicitly verified, the system sends a short series of bidirectional forwarding detection protocol control packets, and if no returned message is received within the detection time, the session state is declared to be Down; if a response message of the target link gateway address end is received, the protocol remains silent again. The session state Down is a message state in the session process of the bidirectional forwarding detection protocol, and the session state of the bidirectional forwarding detection protocol includes: 0-admindlown; 1-Down; 2-Init; 3-Up.
And after the echo function is started, one end of the session periodically transmits the echo message of the bidirectional forwarding detection protocol, and the target link gateway address end does not process the echo message and only forwards the message back to the transmitting end. The transmitting end detects the session state according to whether the bidirectional detection protocol message can be received. The bidirectional forwarding detection protocol echo message is only used for detecting the link state information of the direct network segment, and the bidirectional forwarding detection protocol control message can also detect the link state information of the non-direct network segment.
Further, the obtained link state information may be a link failure or a link unblocked.
It should be noted that, the bidirectional forwarding detection protocol adopted in this embodiment provides a universal standardized protocol that is independent of media and protocol, and can perform link fault detection on any type of bidirectional forwarding paths between network devices, so as to provide consistent fast fault detection time and microsecond link detection precision for different upper layer application services, reduce application interruption time, and improve reliability of the network.
S3: and forwarding the link state information to the subscription virtual routing forwarding instance, and indicating the subscription virtual routing forwarding instance to perform routing change processing according to the link state information.
Specifically, after the network device obtains the link state information detected by the detected virtual routing forwarding instance, the unselected virtual routing forwarding instance serving as the subscribed virtual routing forwarding instance performs routing change processing according to the link state information detected by the detected virtual routing forwarding instance.
And storing the detected link state information in a preset database, and informing a subscription virtual routing forwarding instance focusing on the link state information through a subscription mechanism. The subscription mechanism is that when an event occurs, a party detecting or generating the event is used as an active party to inform a subscriber as a passive party through a notification function, the notification function is a notification linked list of a mode that the party is a notification party and the party is a receiving party, and the notification linked list can be a function linked list.
The subscribed virtual route forwarding instance performs different route changing processes according to different link state information. The link state information may include: link failure and link clear. When the link state information is link failure, route convergence is carried out; and when the link state information is that the link is unblocked, performing route recovery.
It should be noted that, in this embodiment, there may be two ways to forward the link state information to the subscribed virtual routing forwarding instance: one is that link state information is directly obtained by a subscription mechanism; and the other is that the detected link state information is stored in a preset database, and then the link state information is acquired from the preset database. When one mode fails, the other mode can be used as a standby mode, and the two modes can exist simultaneously in the link detection process in the active-standby mode, so that the efficiency of forwarding the link state information can be improved, the forwarding capacity and the response capacity of the network equipment are improved, and the performance of the network equipment and the network transmission performance are improved.
In this embodiment, the network device first divides the virtual routing forwarding instance in the virtual local area network subinterface into a detection virtual routing forwarding instance and a subscription virtual routing forwarding instance according to a preset manner, establishes a bidirectional forwarding detection protocol session in the detection virtual routing forwarding instance, and instructs the subscription virtual routing forwarding instance to perform routing change processing according to the acquired link state information. The virtual route forwarding instance in the virtual local area network subinterface is divided into a detection virtual route forwarding instance and a subscription virtual route forwarding instance according to a preset mode, a bidirectional detection protocol session is established only in the detection virtual route forwarding instance, and the bidirectional forwarding detection protocol session is not required to be established in each virtual route forwarding instance to detect link state information, so that occupation of equipment resources such as a CPU (central processing unit) and a memory of the network equipment can be further reduced, occupation of network transmission resources is reduced, forwarding capacity and response capacity of the network equipment are improved, and network equipment performance and network transmission performance are improved.
In one embodiment, as shown in fig. 2, in step S2, the link state information detected by the detected virtual routing forwarding instance is obtained, which specifically includes steps S21 to S22, which are described in detail below:
s21: and the indication detection virtual routing forwarding instance sends a detection protocol control message to the target link gateway address and receives a response message of the target link gateway address.
Specifically, the detection message sent by the bidirectional forwarding detection protocol session is a user datagram protocol message, and a method for sending an encapsulated IP datagram without establishing a connection is provided, two types of messages are defined: control messages and echo messages.
Control message: the session at two ends of the link monitor the link state through the interaction of control messages.
Echo message: and one end of the link forwards back from the other end through sending the echo message, so that bidirectional monitoring of the link is realized.
The session establishment process of the bidirectional forwarding detection protocol is a three-way handshake process, after the process, the session at two ends becomes an Up state, corresponding parameters are negotiated in the process, and the subsequent state change is performed according to the detection result of the defect and is processed correspondingly.
The four states of the session establishment procedure of the bidirectional forwarding detection protocol are respectively expressed as:
down: indicating that a session is to be started;
init: indicating that communication is in progress with the peer system;
up: indicating that the session is successfully established and that the connection between the systems works normally;
adminducewn: indicating that the session is forced to the Down state, this will cause the peer to enter and remain in the Down state.
Specifically, one end for establishing the session of the bidirectional forwarding detection protocol is A, and the address end of the target link gateway is B.
The session establishment procedure of the bidirectional forwarding detection protocol is detailed as follows:
1. a, B starts the bidirectional forwarding detection protocol, the initial state of each bidirectional forwarding detection protocol is Down, and the session message carrying state of the bidirectional forwarding detection protocol is Down.
2. And B, receiving a bidirectional forwarding detection protocol session message with the Down state, switching the local state to Init, and sending the bidirectional forwarding detection protocol session message with the Init carrying state.
3. And after the session state of the local bidirectional forwarding detection protocol of the B end is Init, the message with the Down state is received and is not processed.
4. The session state change process of the A-side bidirectional forwarding detection protocol is the same as that described above.
5. And B, receiving a bidirectional forwarding detection protocol session message with the state of Init, and switching the local state to Up.
6. The session state change process of the A end in the bidirectional forwarding detection protocol is the same as that of the A end.
7. A, B after the change from the Down state to the Init state, a timeout timer is started, which is used to prevent the local state from blocking in the Init state, and if the bi-directional forwarding detection protocol session message with the state of Init or Up is not received yet within a specified time, the state is automatically switched back to Down.
8. The local state Up marks the success of the session establishment.
If in step 2, the a end does not receive the control message sent by the B end in the Down state within the specified time, the a end considers that the B end fails.
S22: and determining the link state information according to a response message of the target link gateway address to the detection protocol control message.
Specifically, a control message sent to a target link gateway address end actively through a bidirectional forwarding detection protocol, and the target link gateway address sends out a corresponding response message, so that the link state information is link failure; if the target link gateway address does not send out the corresponding response message, the link state information is link unblocked. In the process of detecting the link state information, when the bidirectional forwarding detection protocol session is established, whether the bidirectional forwarding detection protocol control message sent by the target link gateway address end is received or not, the bidirectional forwarding detection protocol control message is actively sent to the target link gateway address end periodically, and if the bidirectional forwarding detection protocol response message of the target link gateway address end is not received in the detection time, the corresponding target link gateway address end is considered to have a link fault. Otherwise, the link is considered to be clear.
In this embodiment, the detection protocol control message is sent to the target link gateway address by detecting the virtual routing forwarding instance, and the link state information is determined to be the link failure or the link is unblocked by the response message of the target link gateway address to the detection protocol control message, so that the link state information can be detected more accurately and stably, the response capability of the network device is improved, and the performance of the network device is further improved.
In one embodiment, in step S3, the link state information is forwarded to the subscription virtual route forwarding instance, specifically including step S31, which is described in detail below:
s31: and the subscribing virtual route forwarding instance is instructed to take the link state information as a parameter of a preset callback function, and the subscribing virtual route forwarding instance is instructed to execute the preset callback function to acquire the link state information, wherein the preset callback function is a callback function of the subscribing virtual route forwarding instance registered in a notification linked list of the detecting virtual route forwarding instance in advance.
Specifically, the link state information is forwarded to the subscription virtual routing forwarding instance by means of a subscription mechanism, wherein the subscription mechanism is implemented by using a party as a notification party and a party as a notification linked list mode of a receiver, the notification linked list is a function linked list, a time processing function registered by the receiver is operated when an event is notified, and the function registered by the receiver is executed when the event occurs.
The main elements of the notification linked list include:
the recipient: a party interested in a certain event. When an event occurs, a corresponding processing function, i.e., a callback function, is defined. But it needs to be registered in advance in the notification linked list.
Notifier: notifiers of events. When an event is detected, or itself generated, all parties interested in the event are notified of the occurrence of the event. The notifier defines a notification chain in which each recipient's callback function for the event is saved. The process of notification is to traverse each item in the notification chain and then call the callback function of the corresponding event.
The main process for notifying the operation of the linked list comprises the following steps:
1. the notifier defines a notification linked list.
2. The recipient registers the callback function in the notification linked list.
3. When an event occurs, a notifier issues a notification and executes callback functions of all elements in the notification chain table.
Further, when the detected virtual routing forwarding instance detects the link state information, triggering a callback function, and indicating the subscribed virtual routing forwarding instance to take the detected link state information as a parameter of the callback function, wherein the subscribed virtual routing forwarding instance substitutes the link state information into the callback function to operate, so that the link state information is obtained.
In this embodiment, the subscribed virtual route forwarding instance is registered in the notification linked list in advance, and when the link state information is detected, the subscribed virtual route forwarding instance subscribed to the link failure information can be quickly and accurately found in the notification linked list, without searching in each virtual route forwarding instance, thereby reducing occupation of network transmission resources.
In one embodiment, in step S4, the link state information is forwarded to the subscription virtual route forwarding instance, and specifically further includes step S41, which is described in detail below:
s41: and storing the link state information into a preset database, and indicating the subscribed virtual routing forwarding instance to acquire the link state information from the preset database.
Specifically, the preset database is a specified database in a memory of the network device, and is used for storing the link state information detected by the session of the bidirectional forwarding detection protocol.
The subscribing virtual routing forwarding instance is instructed to retrieve the detected link state information from the specified database. The subscribed virtual route forwarding instance that obtains the link state information will know that the physical network interface where the subscribed virtual route forwarding instance is located is faulty, and then the local route related to the physical network interface is cleared.
In this embodiment, the manner of acquiring the detected link state information from the specified database does not affect the acquisition of the link state information by the subscription mechanism.
Further, there may be two ways to forward link state information to the subscribed virtual routing forwarding instance: one is that link state information is directly obtained by a subscription mechanism; and the other is that the detected link state information is stored in a preset database, and then the link state information is acquired from the preset database. When one mode fails, the other mode can be used as a standby mode, and the mode of forwarding the link state information by using the master and slave simultaneously can improve the capability of the network equipment for detecting the link state information and the forwarding capability and the response capability of the network equipment, thereby improving the performance of the network equipment and the network transmission performance.
In one embodiment, as shown in fig. 3, in step S5, the subscription virtual routing forwarding instance is instructed to perform a routing change process according to the link state information, specifically including steps S51 to S52, which are described in detail below:
s51: and if the link state information is a link fault, indicating to subscribe the virtual route forwarding instance to perform route convergence.
Specifically, when the link state information in the link is detected to be the link fault, the subscription virtual route forwarding instance is indicated to perform route convergence.
After the topology structure of the network changes, the routing table is re-established, sent and learned until stable, and all relevant routers in the network are informed of the change, namely the behavior of finding the alternative route by recalculating the route caused by the network topology change.
S52: and if the link state information is that the link is unblocked, indicating to subscribe the virtual routing forwarding instance to perform routing recovery.
Specifically, when the link state information in the link is detected to be link unblocked, the subscription virtual route forwarding instance is indicated to perform route recovery.
The route recovery refers to the process of recovering the normal network by all relevant routers in the network after the route table is re-stabilized after route convergence.
In this embodiment, the subscribed virtual routing forwarding instance performs different routing change processing according to different link state information: when a link fails, route convergence is carried out; and the link is unblocked, and route recovery is carried out. The method of subscribing the virtual routing forwarding instance to obtain the link state information and solve the link problem can further reduce the occupation of equipment resources such as CPU and memory of the network equipment, reduce the occupation of network transmission resources and improve the forwarding capacity and response capacity of the network equipment.
In one embodiment, in step S6, after the virtual routing forwarding instances of the unselected K-M virtual local area network subinterfaces are taken as subscription virtual routing forwarding instances, and before the link state information detected by the detection virtual routing forwarding instances is obtained, the link detection method specifically includes step S61, which is described in detail below:
s61: when M is greater than 1, dividing the subscription virtual route forwarding instance into M subscription groups, and setting a corresponding relation between each subscription group and each detection virtual route forwarding instance, so that the subscription virtual route forwarding instance in each subscription group is used for receiving the link state information detected by one detection virtual route forwarding instance.
Specifically, when M is 1, only one virtual route forwarding instance is selected from the virtual local area network subinterfaces in the physical network interface as a detection virtual route forwarding instance, and the rest unselected virtual route forwarding instances are used as subscription virtual route forwarding instances for link detection; when M is greater than 1, M virtual route forwarding instances are selected from a virtual local area network subinterface in a physical network interface as detection virtual route forwarding instances, the rest of the virtual route forwarding instances which are not selected are used as subscription virtual route forwarding instances and are divided into M subscription packets, and the corresponding relation between each subscription packet in the M subscription packets and each detection virtual route forwarding instance in the M detection virtual route forwarding instances is set. Wherein each of the M subscription packets accepts only one link state information detected by the detecting virtual routing forwarding instance.
In this embodiment, when the number of physical network interfaces to be detected is large, the subscription virtual routing forwarding instance may be used to perform the subscription packet manner, and multiple detection virtual routing forwarding instances corresponding to the subscription packet may be used to perform link detection. When the physical network interfaces to be detected are numerous, the method can also further reduce the occupation of equipment resources such as CPU and memory of the network equipment, reduce the occupation of network transmission resources, and improve the forwarding capacity and the response capacity of the network equipment, thereby improving the performance of the network equipment and the network transmission performance.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In an embodiment, a link detection device is provided, where the link detection device corresponds to the link detection method in the above embodiment one by one. As shown in fig. 4, the link detection apparatus includes: an instance object selection module 10, an information acquisition module 20 and an information processing module 30. The functional modules are described in detail as follows:
the instance object selection module 10 is configured to select M virtual lan sub-interfaces from K virtual lan sub-interfaces of a specific physical network interface according to a preset selection manner, establish a detection protocol session in virtual route forwarding instances of the selected M virtual lan sub-interfaces, use the virtual route forwarding instance with the established detection protocol session as a detection virtual route forwarding instance, and use virtual route forwarding instances of unselected K-M virtual lan sub-interfaces as subscription virtual route forwarding instances, where K and M are positive integers, and M < K;
an information obtaining module 20, configured to obtain link state information detected by the detecting virtual routing forwarding instance;
the information processing module 30 is configured to forward the link status information to the subscription virtual routing forwarding instance, and instruct the subscription virtual routing forwarding instance to perform routing change processing according to the link status information.
Further, the information acquisition module 20 includes:
the message detection sub-module 21 is configured to instruct the detection virtual routing forwarding instance to send a detection protocol control message to the target link gateway address, and receive a response message of the target link gateway address;
the information confirmation sub-module 22 is configured to determine the link state information according to a response message of the target link gateway address to the detection protocol control message.
Further, the information processing module 30 includes:
the notification linked list sub-module 31 is configured to instruct the subscribed virtual route forwarding instance to use the link state information as a parameter of a preset callback function, and instruct the subscribed virtual route forwarding instance to execute the preset callback function to obtain the link state information, where the preset callback function is a callback function of the subscribed virtual route forwarding instance registered in advance in the notification linked list of the detected virtual route forwarding instance.
Further, the information processing module 30 further includes:
the database submodule 32 is configured to store link state information into a preset database, and instruct a subscription virtual routing forwarding instance to acquire the link state information from the preset database.
Further, the information processing module 30 further includes:
a route convergence sub-module 33, configured to instruct to subscribe to the virtual route forwarding instance for route convergence if the link state information is a link failure;
the route restoration sub-module 34 is configured to instruct to subscribe to the virtual route forwarding instance for route restoration if the link state information is link clear.
Further, the link detection device further includes:
the subscription grouping module 41 is configured to divide the subscription virtual routing forwarding instance into M subscription groupings and set a correspondence between each subscription grouping and each detection virtual routing forwarding instance when M is greater than 1, so that the subscription virtual routing forwarding instance in each subscription grouping is configured to receive link state information detected by one detection virtual routing forwarding instance.
For specific limitations of the link detection device, reference may be made to the above limitations of the link detection method, and no further description is given here. The respective modules in the above-described link detection apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a network device, and the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a link detection method.
In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the link detection method in the above embodiment, such as steps S1 to S3 shown in fig. 1. Alternatively, the processor may implement the functions of the modules/units of the link detection apparatus in the above embodiments when executing the computer program, for example, the functions of the modules 10 to 30 shown in fig. 4. To avoid repetition, no further description is provided here.
In an embodiment, a computer readable storage medium is provided, on which a computer program is stored, where the computer program is executed by a processor to implement the link detection method in the above method embodiment, or where the computer program is executed by the processor to implement the functions of each module/unit in the link detection device in the above device embodiment. To avoid repetition, no further description is provided here.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (10)

1. A link detection method, the link detection method comprising:
selecting M virtual local area network sub-interfaces from K virtual local area network sub-interfaces of a specific physical network interface according to a preset selection mode, establishing a detection protocol session in virtual route forwarding instances of the selected M virtual local area network sub-interfaces, taking the virtual route forwarding instance with the established detection protocol session as a detection virtual route forwarding instance, and taking the virtual route forwarding instances of the unselected K-M virtual local area network sub-interfaces as subscription virtual route forwarding instances, wherein K and M are positive integers, and M is less than K;
acquiring the link state information detected by the detected virtual routing forwarding instance;
and forwarding the link state information to the subscription virtual routing forwarding instance, and indicating the subscription virtual routing forwarding instance to perform routing change processing according to the link state information.
2. The link detection method according to claim 1, wherein the acquiring the link state information detected by the detecting virtual routing forwarding instance includes:
the detection virtual routing forwarding instance is instructed to send a detection protocol control message to a target link gateway address, and a response message of the target link gateway address is received;
and determining the link state information according to the response message of the target link gateway address to the detection protocol control message.
3. The link detection method of claim 1, wherein said forwarding the link state information to the subscribed virtual routing forwarding instance comprises:
and the subscribing virtual routing forwarding instance is instructed to take the link state information as a parameter of a preset callback function, and the subscribing virtual routing forwarding instance is instructed to execute the preset callback function to acquire the link state information, wherein the preset callback function is a callback function of the subscribing virtual routing forwarding instance registered in advance in a notification linked list of the detecting virtual routing forwarding instance.
4. The link detection method of claim 1, wherein forwarding the link state information to the subscribed virtual routing forwarding instance further comprises:
and storing the link state information into a preset database, and indicating the subscribed virtual routing forwarding instance to acquire the link state information from the preset database.
5. The link detection method according to claim 1, wherein the instructing the subscribed virtual routing forwarding instance to perform a routing change process according to the link state information includes:
if the link state information is a link fault, indicating the subscribed virtual route forwarding instance to perform route convergence;
and if the link state information is that the link is unblocked, indicating the subscribed virtual routing forwarding instance to perform routing recovery.
6. The link detection method according to any one of claims 1 to 5, wherein after said subscribing virtual routing forwarding instances of said unselected K-M virtual local area network subinterfaces, and before said acquiring the link state information detected by said detecting virtual routing forwarding instances, said link detection method further comprises:
and when M is greater than 1, dividing the subscription virtual routing forwarding instance into M subscription packets, and setting the corresponding relation between each subscription packet and each detection virtual routing forwarding instance, so that the subscription virtual routing forwarding instance in each subscription packet is used for receiving the link state information detected by one detection virtual routing forwarding instance.
7. A link detection apparatus, characterized in that the link detection apparatus comprises:
an instance object selection module, configured to select M virtual lan sub-interfaces from K virtual lan sub-interfaces of a specific physical network interface according to a preset selection manner, establish a detection protocol session in virtual route forwarding instances of the selected M virtual lan sub-interfaces, use the virtual route forwarding instance in which the detection protocol session is established as a detection virtual route forwarding instance, and use the virtual route forwarding instances of the unselected K-M virtual lan sub-interfaces as subscription virtual route forwarding instances, where K and M are positive integers, and M < K;
the information acquisition module is used for acquiring the link state information detected by the detected virtual routing forwarding instance;
and the information processing module is used for forwarding the link state information to the subscription virtual routing forwarding instance and indicating the subscription virtual routing forwarding instance to perform routing change processing according to the link state information.
8. The link detection apparatus according to claim 7, wherein the information processing module includes:
and the notification linked list sub-module instructs the subscribed virtual routing forwarding instance to take the link state information as a parameter of a preset callback function and instructs the subscribed virtual routing forwarding instance to execute the preset callback function to acquire the link state information, wherein the preset callback function is a callback function of the subscribed virtual routing forwarding instance registered in a notification linked list of the detected virtual routing forwarding instance in advance.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the link detection method according to any of claims 1 to 6 when executing the computer program.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the link detection method according to any one of claims 1 to 6.
CN202010122314.4A 2020-02-27 2020-02-27 Link detection method, device, computer equipment and storage medium Active CN111447101B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010122314.4A CN111447101B (en) 2020-02-27 2020-02-27 Link detection method, device, computer equipment and storage medium
PCT/CN2020/118064 WO2021169276A1 (en) 2020-02-27 2020-09-27 Link detection method and apparatus, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010122314.4A CN111447101B (en) 2020-02-27 2020-02-27 Link detection method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111447101A CN111447101A (en) 2020-07-24
CN111447101B true CN111447101B (en) 2023-05-02

Family

ID=71653917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010122314.4A Active CN111447101B (en) 2020-02-27 2020-02-27 Link detection method, device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN111447101B (en)
WO (1) WO2021169276A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111447101B (en) * 2020-02-27 2023-05-02 平安科技(深圳)有限公司 Link detection method, device, computer equipment and storage medium
CN111984376B (en) * 2020-09-23 2023-06-27 杭州迪普科技股份有限公司 Protocol processing method, device, equipment and computer readable storage medium
CN114024898B (en) * 2021-11-09 2023-06-30 湖北天融信网络安全技术有限公司 Message transmission method, device, equipment and storage medium
CN114585039B (en) * 2022-02-24 2022-11-22 中国人民解放军国防科技大学 Switching method and device for ten-gigabit network data transmission link in fault state

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101395853A (en) * 2006-03-02 2009-03-25 思科技术公司 A technique for efficiently and dynamically maintaining bidirectional forwarding detection on a bundle of links
CN101753464A (en) * 2010-01-22 2010-06-23 中兴通讯股份有限公司 Routing convergence method, provider edge devices and virtual private network system
CN104468385A (en) * 2013-09-12 2015-03-25 杭州华三通信技术有限公司 A forwarding table item processing method and device
WO2019047740A1 (en) * 2017-09-06 2019-03-14 ***股份有限公司 Interconnected region controller, interconnected region control method, and computer storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895437B (en) * 2010-06-23 2015-04-15 迈普通信技术股份有限公司 Method and equipment of distributed bidirectional forwarding detection (BFD)
CN104702478B (en) * 2013-12-10 2019-06-11 中兴通讯股份有限公司 Virtual flow-line forwarding instance processing method and processing device
WO2017171743A1 (en) * 2016-03-30 2017-10-05 Ale Usa Inc. Edge network node and method for configuring a service therein
US10237176B2 (en) * 2016-06-30 2019-03-19 Juniper Networks, Inc. Auto discovery and auto scaling of services in software-defined network environment
CN111447101B (en) * 2020-02-27 2023-05-02 平安科技(深圳)有限公司 Link detection method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101395853A (en) * 2006-03-02 2009-03-25 思科技术公司 A technique for efficiently and dynamically maintaining bidirectional forwarding detection on a bundle of links
CN101753464A (en) * 2010-01-22 2010-06-23 中兴通讯股份有限公司 Routing convergence method, provider edge devices and virtual private network system
CN104468385A (en) * 2013-09-12 2015-03-25 杭州华三通信技术有限公司 A forwarding table item processing method and device
WO2019047740A1 (en) * 2017-09-06 2019-03-14 ***股份有限公司 Interconnected region controller, interconnected region control method, and computer storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘刚,张德运,李胜磊,张晓.一种虚拟路由器的体系结构及实现.计算机工程.2004,(11),全文. *

Also Published As

Publication number Publication date
WO2021169276A1 (en) 2021-09-02
CN111447101A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
CN111447101B (en) Link detection method, device, computer equipment and storage medium
Sharma et al. OpenFlow: Meeting carrier-grade recovery requirements
JP5913635B2 (en) Redundant network connection
EP2364539B1 (en) A system and method of implementing lightweight not-via ip fast reroutes in a telecommunications network
JP2006229967A (en) High-speed multicast path switching
CN101483592B (en) Method and apparatus for inhibiting bidirectional forwarding detection link oscillation
CN112104557B (en) Method and device for detecting link
CN106878072B (en) Message transmission method and device
CN104869057A (en) OpeFlow switch graceful restart processing method, device and OpeFlow controller
CN109873719B (en) Fault detection method and device
WO2011157145A2 (en) Main/backup switching method between communication device, communication device, system and service request device
EP3029883B1 (en) Network protection method and apparatus, next-ring node, and system
CN101197733A (en) Automatic detection method and device for network connectivity
US11245615B2 (en) Method for determining link state, and device
JP2009303092A (en) Network equipment and line switching method
CN113141268A (en) Method and device for realizing redundancy backup of link aggregation group of manual aggregation
JP2021534669A (en) Packet processing method and gateway device
US8218433B2 (en) Monitoring connectivity in ring networks
WO2011157146A2 (en) Main/backup switching method between communication devices, communication device, system and service request device
CN108289044B (en) Data forwarding method, link state method for determining static route and network equipment
EP2523401B1 (en) Virtual networks within a physical network
CN113132223A (en) Fault detection method and equipment
EP3537671B1 (en) Protection switching method and system, and nodes
CN113098709B (en) Network recovery method and device based on distributed networking system and computer equipment
CN112838982B (en) Message transmission path switching method, device and system

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
GR01 Patent grant
GR01 Patent grant