CN112468363A - Method and device for detecting link connectivity - Google Patents

Method and device for detecting link connectivity Download PDF

Info

Publication number
CN112468363A
CN112468363A CN202011321193.2A CN202011321193A CN112468363A CN 112468363 A CN112468363 A CN 112468363A CN 202011321193 A CN202011321193 A CN 202011321193A CN 112468363 A CN112468363 A CN 112468363A
Authority
CN
China
Prior art keywords
vlan interface
link
vlan
interface
local
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
CN202011321193.2A
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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202011321193.2A priority Critical patent/CN112468363A/en
Publication of CN112468363A publication Critical patent/CN112468363A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing packet switching networks
    • H04L43/08Monitoring based on specific metrics
    • H04L43/0805Availability
    • H04L43/0811Connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. local area networks [LAN], wide area networks [WAN]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]

Abstract

The specification discloses a method and apparatus for link connectivity detection. When detecting a plurality of virtual links carried by the same physical link, the local device carries the corresponding local Vlan interface information of the plurality of virtual links in a BFD message, and sends the BFD message to the opposite-end Vlan interface of each virtual link on the opposite-end device in a multicast manner, so that the opposite-end device judges the connectivity of the link from the local Vlan interface to the opposite-end Vlan interface in the direction based on the BFD message. Compared with the scheme of detecting a plurality of virtual links through a plurality of BFD detection messages, in the method and the device, only one BFD message needs to be sent when a plurality of virtual links are detected, and only one BFD message needs to be transmitted by a physical link, so that the bandwidth resource of the physical link can be greatly saved.

Description

Method and device for detecting link connectivity
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method and an apparatus for detecting link connectivity.
Background
When the network device corresponds to a plurality of subnets, a plurality of isolated broadcast domains can be formed by dividing the Vlan. If the number of physical ports on the network device is small, one physical port may be divided into a plurality of Vlan interfaces, and different network segments are configured for each Vlan interface, so that the plurality of Vlan interfaces are isolated from each other.
To better maintain network stability, the connectivity of the virtual links between Vlan interfaces may be checked. Among them, BFD (Bidirectional Forwarding Detection) is a common Detection method, and the asynchronous Detection mode of BFD can quickly and efficiently find link failures, and is widely used. Specifically, the network device may configure BFD detection for each Vlan interface, so that the network device sends a BFD detection packet to the peer device through the virtual link, and the peer device determines connectivity of the link in the packet transmission direction according to the receiving condition.
However, the virtual link actually transmits the message through the physical link corresponding to the virtual link, and if the network devices at both ends of the link adopt a method of dividing one physical port into a plurality of Vlan interfaces, a plurality of virtual links may correspond to the same physical link. When detecting the link connectivity, the physical link transmits a plurality of BFD detection messages, so that the bandwidth of the physical link is greatly occupied.
Disclosure of Invention
In view of the above, the present specification provides a method and an apparatus for link connectivity detection.
Specifically, the description is realized by the following technical scheme:
according to a first aspect of the present application, there is provided a method for detecting link connectivity, where the method is applied to a network device, and includes:
determining information of at least one first local Vlan interface corresponding to at least one first link to be detected; a first peer Vlan interface corresponding to the first local Vlan interface belongs to the same multicast group; the first peer Vlan interface belongs to peer equipment;
determining a main Vlan interface in a Vlan interface group to which the first local Vlan interface belongs; the Vlan interfaces in the Vlan interface group all correspond to the same physical port;
sending a first BFD multicast message carrying the information of the at least one first local Vlan interface to each Vlan interface in a multicast group of the opposite-end equipment through the main Vlan interface, so that the opposite-end equipment detects the connectivity of the link to be detected in the first direction based on the first BFD multicast message; the first direction is a direction from the first local Vlan interface towards the first peer Vlan interface.
According to a second aspect of the present application, there is provided an apparatus for detecting link connectivity, where the apparatus is applied to a network device, and the apparatus includes:
a local interface determining unit, configured to determine information of at least one first local Vlan interface corresponding to at least one first link to be detected; a first peer Vlan interface corresponding to the first local Vlan interface belongs to the same multicast group; the first peer Vlan interface belongs to peer equipment;
a main interface determining unit, configured to determine a main Vlan interface in a Vlan interface group to which the first local Vlan interface belongs; the Vlan interfaces in the Vlan interface group all correspond to the same physical port;
a multicast packet sending unit, configured to send, to each Vlan interface in a multicast group of an opposite-end device through the master Vlan interface, a first BFD multicast packet carrying the information of the at least one first local Vlan interface, so that the opposite-end device detects connectivity of the link to be detected in the first direction based on the first BFD multicast packet; the first direction is a direction from the first local Vlan interface towards the first peer Vlan interface.
In the application, when detecting multiple virtual links carried by the same physical link, the local device carries the local Vlan interface information corresponding to the multiple virtual links in a BFD message, and sends the BFD message to the peer Vlan interface of each virtual link on the peer device in a multicast manner, so that the peer device determines connectivity of the link in a direction from the local Vlan interface to the peer Vlan interface based on the BFD message.
Compared with the scheme of detecting a plurality of virtual links through a plurality of BFD detection messages, in the method and the device, only one BFD message needs to be sent when a plurality of virtual links are detected, and only one BFD message needs to be transmitted by a physical link, so that the bandwidth resource of the physical link can be greatly saved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic diagram of an application scenario shown in an exemplary embodiment of the present specification.
Fig. 2 is a flowchart illustrating a method for detecting link connectivity according to an exemplary embodiment of the present disclosure.
Fig. 3 is a schematic structural diagram of a link connectivity detection apparatus according to an exemplary embodiment of the present disclosure.
Fig. 4 is a block diagram illustrating a link connectivity detection apparatus according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The method is used for detecting the connectivity of the link based on the BFD detection technology, and the BFD detection technology and the link to be detected in the method are introduced below respectively.
1. BFD detection technique
BFD is a detection mechanism capable of rapidly detecting bidirectional forwarding links among network devices, and has good universality. The BFD includes a plurality of detection modes, one of which is an asynchronous detection mode, and the application uses the asynchronous detection mode of the BFD to detect the connectivity of the link, so the asynchronous detection mode of the BFD is described below.
The asynchronous detection mode of BFD means that two network devices periodically send BFD messages to each other, and the network devices at both ends detect whether the BFD messages sent by the network device at the opposite end are received within a preset timeout period. Taking the network device 1 and the network device 2 as an example, when the network device 1 sends a BFD message to the network device 2, if the network device 2 receives the BFD message sent by the network device 1 within the timeout period, it is considered that the link is connected in the direction from the network device 1 to the network device 2; on the contrary, if the network device 2 does not receive the BFD packet sent by the network device 1 within the timeout period, it is considered that the link has a failure in the direction from the network device 2 to the network device 1. Similarly, when the network device 2 sends the BFD packet to the network device 1, the network device 1 may detect whether the link is connected in the direction from the network device 2 to the network device 1 according to whether the BFD packet sent by the network device 2 is received, and the specific method is similar to that when the network device 1 sends the BFD packet to the network device 2, and is not described herein again.
In the asynchronous detection mode, any network device can detect a link from an opposite terminal device to the device, and bidirectional detection of the link is realized by mutually sending and detecting BFD messages through the network devices at two ends. Meanwhile, the network equipment does not need to respond to the BFD message, and the detection efficiency of the link is improved.
2. Link detected by the application
The link detected by the method is a virtual link between the Vlan interfaces. The actual cables, physical ports and devices, etc. that carry the virtual link may be referred to as physical links. The message transmitted through the virtual link is transmitted through the physical link corresponding to the virtual link in actual transmission. A physical link may correspond to one or more virtual links.
The network system shown in fig. 1 includes a network device a and a network device B. Network device a and network device B establish an interconnected physical link through forwarding devices such as physical ports, cables, switches, etc. Wherein the physical ports of each network device are divided into a plurality of virtual Vlan interfaces.
For example, physical port a of network device a is divided into Vlan interface a1, Vlan interface a2, and Vlan interface A3; physical port B of network device B is divided into Vlan interface B1, Vlan interface B2, and Vlan interface B3.
The network device A and the network device B establish a corresponding relation between the Vlan interfaces by setting IP addresses for the Vlan interfaces, and form a virtual link between the Vlan interfaces with the corresponding relation. Specifically, network device a sets the IP address IP for Vlan interface a1A1Setting IP address IP for Vlan interface B1B1And IPA1And IPB1Belonging to the same network segment 1, thereby establishing the corresponding relationship between the Vlan interface a1 and the Vlan interface B1, and forming a virtual link (for convenience of description, hereinafter referred to as link 1) between the Vlan interface a1 and the Vlan interface B1. Similarly, IP addresses IP belonging to segment 2 are set for Vlan interface a2 and Vlan interface B2, respectivelyA2And IPB2Establishing a corresponding relation between the two interfaces, and forming a virtual link (simply referred to as link 2) between the Vlan interface A2 and the Vlan interface B2; IP addresses IP belonging to the network segment 3 are respectively set for the Vlan interface A3 and the Vlan interface B3A3And IPB3Establishing the corresponding relation between the two and forming a virtual link (chain for short) between the Vlan interface A3 and the Vlan interface B3Way 3).
For convenience of description, the two Vlan interfaces having the correspondence relationship are hereinafter referred to as a pair of Vlan interfaces, for example, Vlan interface a1 and Vlan interface B1.
Meanwhile, the network segment 1, the network segment 2 and the network segment 3 configured by the network device are not overlapped with each other, so that 3 independent broadcast domains can be formed, and different Vlan interfaces corresponding to the same physical port are isolated from each other.
The links detected by the present application are virtual links between the pair of Vlan interfaces, such as the above-mentioned link 1, link 2, and link 3.
3. Detection of virtual links using BFD detection techniques in correlation techniques
In the related art, when detecting multiple virtual links between multiple pairs of VLAN interfaces, one device needs to send BFD detection packets through each VLAN interface on the local device corresponding to the multiple virtual links, so that each BFD detection packet is transmitted to the VLAN interface of the opposite device by each virtual link.
However, the virtual link actually transmits the message through the physical link corresponding to the virtual link, and when a plurality of virtual links correspond to the same physical link, the physical link transmits a plurality of BFD detection messages, so that the bandwidth of the physical link is greatly occupied.
For example, in fig. 1, 3 Vlan interfaces of network device a all send BFD messages to 3 Vlan interfaces of network device B through respective virtual links (link 1, link 2, and link 3), so that network device B determines link connectivity according to the receiving conditions of each interface. In this case, the physical link between the physical port a and the physical port B transmits the 3 BFD detection packets, so that the bandwidth of the physical link is greatly occupied.
In view of this, the present application provides a method for detecting link connectivity. When detecting a plurality of virtual links carried by the same physical link, the local device carries the corresponding local Vlan interface information of the plurality of virtual links in a BFD message, and sends the BFD message to the opposite-end Vlan interface of each virtual link on the opposite-end device in a multicast manner, so that the opposite-end device judges the connectivity of the link from the local Vlan interface to the opposite-end Vlan interface in the direction based on the BFD message.
Compared with the scheme of detecting a plurality of virtual links through a plurality of BFD detection messages, in the method and the device, only one BFD message needs to be sent when a plurality of virtual links are detected, and only one BFD message needs to be transmitted by a physical link, so that the bandwidth resource of the physical link can be greatly saved.
Referring to fig. 2, fig. 2 illustrates a method for link connectivity detection according to an exemplary embodiment of the present application, which may be applied to a network device.
In the method for detecting link connectivity shown in fig. 2, network devices at two ends of a link send detection messages to each other to an opposite end device, and here, only the network device at one end is taken as an example for description. For convenience of description, in this specification, one end to which the method of the present application is applied is referred to as a local device, a Vlan interface on the local device is referred to as a local Vlan interface, a network device on the other end of the link is referred to as an opposite-end device, and a Vlan interface on the opposite-end device is referred to as an opposite-end Vlan interface. For example, assuming that the method of the present application is applied to the network device a in the network system shown in fig. 1, the network device a is referred to as a local device, and the network device B is referred to as a peer device.
As shown in fig. 2, the method comprises the following steps:
step S201: the local equipment determines information of at least one first local Vlan interface corresponding to at least one first link to be detected; a first peer Vlan interface corresponding to the first local Vlan interface belongs to the same multicast group; the first peer Vlan interface belongs to peer devices.
In this embodiment, the first link to be detected may be one virtual link between a pair of Vlan interfaces, or may be multiple virtual links between multiple pairs of Vlan interfaces with the same physical link.
On the opposite-end equipment, a first opposite-end Vlan interface which is in one-to-one correspondence with a first local Vlan interface on the local equipment exists, and the first opposite-end Vlan interfaces are a first local Vlan interface and a first opposite-end Vlan interface which have a correspondence relationship.
It should be noted that the first local Vlan interface here is a local Vlan interface corresponding to the link to be detected when the local device is used as a message sender, and the first peer Vlan interface here is a Vlan interface on the peer device when the local device is used as a message sender. The "first" and the "second" are only used to distinguish the local device as a message sender and a message receiver, and are not limited in number. The information of the local Vlan interface is an identifier of the local Vlan interface, for example, an IP address of the Vlan interface. In one embodiment, the first local Vlan interface and the first peer Vlan interface whose IP addresses belong to the same network segment may be determined as a pair of Vlan interfaces corresponding to each other.
In this embodiment, the network device may also configure a multicast address for each Vlan interface. In general, if the same multicast address is allocated to the Vlan interface in the same Vlan interface group, the Vlan interfaces in the same Vlan interface group belong to the same multicast group.
Taking the network device a in fig. 1 as an example, assuming that the Vlan interface 3 is in the DOWN state, it may be determined that the links to be detected include link 1 and link 2. Wherein, the local Vlan interface corresponding to the link 1 is Vlan interface a 1; the local Vlan interface corresponding to link 2 is Vlan interface a 2.
Step S202: the local device determines a main Vlan interface in a Vlan interface group to which the first local Vlan interface belongs, and the Vlan interfaces in the Vlan interface group all correspond to the same physical port.
One physical port may be divided into a plurality of Vlan interfaces. In this embodiment, at least one Vlan interface obtained by dividing the same physical port is determined as one Vlan interface group.
The Vlan interfaces in the Vlan interface group may be in an UP state or in a DOWN state. In general, the network device may select one Vlan interface from the Vlan interfaces in the UP state as a primary Vlan interface of the Vlan interface group. In this embodiment, if the local device is a sender of the BFD detection packet, the main Vlan interface is the main transmitting port, and if the local device is a receiver of the BFD detection packet, the main Vlan interface is the main receiving port.
There are various methods for selecting the main Vlan interface, for example, for multiple Vlan interfaces in an UP state, the network device performs sorting according to the interface identifier of the Vlan interface, and then selects the main Vlan interface; or, the network device may also acquire the load conditions of each Vlan interface in the Vlan interface group, and then select one Vlan interface with the smallest performance pressure as the main Vlan interface. Of course, the network device may also use other methods to select the primary Vlan interface, which are only exemplary and not specific limitations herein.
In an alternative embodiment, the network device typically does not make changes after determining the primary Vlan interface. If the main Vlan interface DOWN is determined, the main Vlan interface may be reselected from other Vlan interfaces in the UP state.
Still taking network device a in fig. 1 as an example, physical port a is divided into Vlan interfaces a1-A3, and the three Vlan interfaces belong to the same Vlan interface group, which may be referred to as Vlan interface group a, for example. Assuming that the Vlan interface A3 is in the DOWN state and the other interfaces are in the UP state, the network device a may detect the link 1 and the link 2, and determine that the first local Vlan interface includes a Vlan interface a1 and a Vlan interface a2, and the network device a may select a main Vlan interface from the Vlan interface group a, for example, may select one interface from a Vlan interface a1 and a Vlan interface a2 that are in the UP state as the main Vlan interface.
Step S203: and the local equipment sends a first BFD multicast message carrying the information of the at least one first local Vlan interface to each Vlan interface in the multicast group of the opposite-end equipment through the main Vlan interface, so that the opposite-end equipment detects the connectivity of the link to be detected in the first direction based on the first BFD multicast message. The first direction is a direction from the first local Vlan interface towards the first peer Vlan interface.
The address of the multicast group may be an address of a multicast group to which the first peer-to-peer interface belongs, and may be, for example, an IP address dedicated to multicast, which is negotiated in advance between the local device and the peer-to-peer device.
In this embodiment, the local device may serve as a sender of the BFD detection packet, and the main Vlan interface serves as a main sending port. And sending a BFD multicast message to the opposite terminal equipment by the local equipment through the main Vlan interface, wherein the BFD detection message carries an identifier of the local Vlan interface corresponding to the network link to be detected, and the destination address of the BFD detection message is the address of the multicast group.
And a forwarding device at the end of the physical link, for example, a multicast router closest to the peer device on the physical link, receives the BFD multicast packet, and distributes the BFD multicast packet to each Vlan interface belonging to the multicast group on the peer device. After receiving the BFD multicast packet, the peer device may determine connectivity of the network link according to the identifier of the first local Vlan interface carried in the multicast packet.
The method for detecting link connectivity by the opposite terminal equipment is introduced as follows:
in an optional embodiment, the peer device may determine multiple Vlan interfaces corresponding to the same physical link as a Vlan interface group, and select a primary Vlan interface from the Vlan interfaces as a primary receiving port. The method for determining the main Vlan interface by the peer device is the same as that of the local device, and is not described herein again.
If multiple Vlan interfaces in the same Vlan interface group on the opposite-end device belong to the same multicast group, the multiple Vlan interfaces can all receive the BFD multicast message. The opposite-end equipment can discard the BFD multicast messages received by other Vlan interfaces and detect the link connectivity according to the BFD multicast messages received by the main Vlan interface. Specifically, the opposite-end device first obtains a BFD multicast packet received from the main Vlan interface, and then determines an interface identifier carried in the packet. If the interface identifier can be the IP address of the local device, the opposite terminal device determines whether the IP address in the message and the IP address of the opposite terminal Vlan interface belong to the same network segment. If the network segments belong to the same network segment, determining that the links corresponding to the Vlan interfaces of the opposite end are communicated; and if the network segments do not belong to the same network segment, determining that the link corresponding to the Vlan interface of the opposite end is not communicated. It can be understood that link connectivity here is link connectivity in the transmission direction of the BFD multicast packet, that is, unidirectional link connectivity directed from the local Vlan interface to the Vlan interface at the opposite end.
Still taking fig. 1 as an example, if the local device is the network device a in fig. 1, the opposite device is the network device B, and if the Vlan interface A3 fails, the link to be detected may be determined as link 1 (the corresponding local Vlan interface is Vlan interface a1) and link 2 (the corresponding local Vlan interface is Vlan interface a 2). The IP address of Vlan interface A1 is IPA1The IP address of the Vlan interface A2 is IPA2The IP address of the Vlan interface A3 is IPA3The IP address of the Vlan interface B1 is IPB1The IP address of the Vlan interface B2 is IPB2The IP address of the Vlan interface B3 is IPB3
If the determined main Vlan interface is Vlan interface a1, the network device a sends a BFD multicast packet through the Vlan interface a1, where the packet carries the IP address IP of the Vlan interface a1A1And IP address IP of Vlan interface A2A2And the destination IP address of the multicast message is multicast IP.
In the network device B, assuming that the Vlan interface B1, the Vlan interface B2, and the Vlan interface B3 belong to the same multicast group, and each Vlan interface operates normally, the three Vlan interfaces may all receive a BFD multicast packet. If the Vlan interface B1 is the main Vlan interface, the network device may obtain the multicast packet received by the Vlan interface B1, and analyze the multicast packet to obtain the IP identifier carried by the multicast packet as the IP identifierA1And IPA2. Then, the network device B connects the interface identification with IP respectivelyB1、IPB2And IPB3And (6) carrying out comparison. According to IPA1And IPB1Belonging to the same network segment, determining that the network link of the Vlan interface A1 pointing to the Vlan interface B1 is communicated; according to IPA2And IPB2Belonging to the same network segment, determining that the network link of the Vlan interface A2 pointing to the Vlan interface B2 is communicated; according to absence and IPB3And the interface identifiers belonging to the same network segment determine that the network link of the Vlan interface A3 pointing to the Vlan interface B3 is disconnected.
Thus, a link detection process is completed, wherein the network device A serves as a BFD message sender, and the network device B serves as a BFD message receiver.
In this embodiment, for multiple pairs of Vlan interfaces with the same physical link, the local device may select a main sending port from the multiple local Vlan interfaces, and send a BFD detection packet to the multiple peer Vlan interfaces of the peer device in a multicast manner. Compared with the method of sending the BFD detection messages between each interface pair, the method of this embodiment completes the detection of the virtual links between multiple pairs of Vlan interfaces through one message, and reduces the load of the network device and the occupation of the network bandwidth.
Meanwhile, the present embodiment sends the BFD detection packet by multicast, without stipulating a specific main receiving port in advance, and can make a plurality of peer Vlan interfaces of peer devices receive the detection packet without repeatedly sending the BFD detection packet. Therefore, even if part of the Vlan interfaces of the opposite-end device fail, the local device and the opposite-end device do not need to re-agree on the main Vlan interface, but receive and send the message in a multicast group manner.
Similar to the above method, the opposite terminal device may also be used as a sender of the BFD detection packet. The local device can be used as a receiver of the BFD detection message, and link connectivity is determined according to the received BFD detection message.
It should be noted that the second local Vlan interface is a local Vlan interface corresponding to the link to be detected when the local device serves as a message receiver, and the second peer Vlan interface is a Vlan interface on the peer device when the local device serves as a message receiver. The term "second" is used herein only to distinguish the local device as a message sender and a message receiver, and is not limited to number.
In one embodiment, the first local Vlan interface and the second local Vlan interface may be the same Vlan interface or different Vlan interfaces; similarly, the first-pair-end Vlan interface and the second-pair-end Vlan interface may be the same Vlan interface or different Vlan interfaces, and are not limited herein.
The following describes a link detection method when the local device is used as a receiver of the BFD packet. For convenience of description, the second local Vlan interface is referred to herein as a local Vlan interface, and the second peer Vlan interface is referred to herein as a peer Vlan interface.
Firstly, the opposite-end equipment determines a link to be detected according to the running state of an opposite-end Vlan interface on the equipment, and selects a main Vlan interface from a plurality of opposite-end Vlan interfaces corresponding to the link to be detected.
And then, the opposite terminal equipment sends a BFD multicast message to the multicast group of the local equipment through the main Vlan interface.
And then, the local equipment receives the BFD multicast message from the plurality of local Vlan interfaces and acquires the message received by the main Vlan interface.
And then, the local equipment analyzes the BFD multicast message, acquires an interface identifier carried in the message, and determines the connectivity of the network link according to the comparison result of the interface identifier and the local Vlan interface identifier.
Still referring to fig. 1, a specific embodiment is described below, where the local device is a network device a and the peer device is a network device B.
The network device B first queries the operating state of its Vlan interface, determines that all of the Vlan interface B1, the Vlan interface B2, and the Vlan interface B3 are in an UP state, may select one Vlan interface (for example, Vlan interface B1) as a main Vlan interface, and determines that the links to be detected are link 1, link 2, and link 3.
Then, the network device B sends a BFD multicast packet through the main Vlan interface (i.e., Vlan interface B1), where a destination address of the multicast packet may be an IP address of a local device multicast group, and the multicast packet carries interface identifiers of the Vlan interface B1, the Vlan interface B2, and the Vlan interface B3. In one embodiment, the interface identification may be an IP address, i.e., IP, of each Vlan interfaceB1、IPB2And IPB3
Then, the network device a may receive the BFD multicast packet from the plurality of Vlan interfaces. Assuming that, in the network device a, the Vlan interface a1, the Vlan interface a2, and the Vlan interface A3 all belong to the same multicast group, and only the Vlan interface A3 is in the DOWN state, the network device may receive the multicast packet from the Vlan interface a1 and the Vlan interface a 2. If the Vlan interface a1 is the main Vlan interface, the network device a acquires the BFD multicast packet received by the Vlan interface a 1.
Then, network device A solvesAnalyzing the BFD multicast message, obtaining the interface identification therein, and according to IPB1And IPA1Belong to the same network segment, can confirm that points to the link connection of Vlan interface A1 from Vlan interface B1; according to IPB2And IPA2Belonging to the same network segment, it may be determined that the link from Vlan interface B2 points to Vlan interface a 2. Since the network device a can know that the Vlan interface a3 is in the DOWN state, it is not necessary to determine the link condition corresponding to the Vlan interface a 3.
Thus, a link detection process in which the network device a serves as a BFD message receiver and the network device B serves as a BFD message sender is completed.
In an optional embodiment, the receiver of the BFD packet may further authenticate the packet after receiving the BFD multicast packet. A sender of the BFD message carries configured authentication information, such as a user name and a password, in a BFD multicast message, and then a receiver of the BFD message firstly checks whether the authentication information is correct or not, and if the authentication information is correct, link connectivity detection is carried out based on the message; if not, the message is discarded.
Corresponding to the foregoing embodiments of the link connectivity detection method, the present specification also provides embodiments of a link connectivity detection apparatus.
The embodiments of the link connectivity detection apparatus in the present specification can be applied to network devices. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the network device where the software implementation is located as a logical means. From a hardware aspect, as shown in fig. 3, the hardware structure diagram of the network device where the link connectivity detection apparatus is located in this specification is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 3, the network device where the apparatus is located in the embodiment may also include other hardware according to the actual function of the server, which is not described again.
Fig. 4 is a block diagram illustrating a link connectivity detection apparatus according to an exemplary embodiment of the present disclosure.
Referring to fig. 4, the link connectivity detecting apparatus 400 may be applied in the network device shown in fig. 3, and includes:
a local interface determining unit 401, configured to determine information of at least one first local Vlan interface corresponding to at least one first link to be detected; a first peer Vlan interface corresponding to the first local Vlan interface belongs to the same multicast group; the first peer Vlan interface belongs to peer equipment;
a main interface determining unit 402, configured to determine a main Vlan interface in a Vlan interface group to which the first local Vlan interface belongs; the Vlan interfaces in the Vlan interface group all correspond to the same physical port;
a multicast packet sending unit 403, configured to send, to each Vlan interface in a multicast group of an peer device through the master Vlan interface, a first BFD multicast packet carrying the at least one first local Vlan interface information, so that the peer device detects connectivity of the link to be detected in the first direction based on the first BFD multicast packet; the first direction is a direction from the first local Vlan interface towards the first peer Vlan interface.
Optionally, the apparatus further comprises:
a multicast packet receiving unit 404, configured to receive a second BFD multicast packet through a second local Vlan interface; the second BFD multicast message carries information of at least one second opposite-end Vlan interface; the information of the at least one second opposite-end Vlan interface is information of a Vlan interface corresponding to the at least one second link to be detected on the opposite-end device;
a connectivity determining unit 405, configured to determine, according to information of a second opposite-end Vlan interface carried in the second BFD multicast packet, connectivity of the second link to be detected in a second direction, where the second direction is a direction from the second opposite-end Vlan interface to a second local Vlan interface.
Optionally, the determining connectivity of the second link to be detected in the second direction according to the information of the second peer Vlan interface carried in the second BFD multicast packet includes:
and when the second local Vlan interface is determined to be the main receiving port, determining connectivity of the second link to be detected in the second direction according to information of the second opposite-end Vlan interface carried in the second BFD multicast message.
Optionally, the information of the second peer Vlan interface is an IP address of the second peer Vlan interface;
determining connectivity of the second link to be detected in the second direction according to the information of the second end-to-end Vlan interface carried in the second BFD multicast packet, including:
aiming at the IP address of each second local Vlan interface corresponding to a second link to be detected, if the IP address of the second local Vlan interface and the IP address of the second opposite-end Vlan interface belong to the same network segment, determining that the second link to be detected is communicated;
and if the IP addresses of all the second local Vlan interfaces corresponding to the second link to be detected and the IP addresses of the second opposite-end Vlan interfaces do not belong to the same network segment, determining that the second link to be detected is not communicated.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. 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 can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In correspondence with the foregoing embodiments of the link connectivity detection method, the present specification also provides a network device, characterized by comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to perform:
determining information of at least one first local Vlan interface corresponding to at least one first link to be detected; a first peer Vlan interface corresponding to the first local Vlan interface belongs to the same multicast group; the first peer Vlan interface belongs to peer equipment;
determining a main Vlan interface in a Vlan interface group to which the first local Vlan interface belongs; the Vlan interfaces in the Vlan interface group all correspond to the same physical port;
sending a first BFD multicast message carrying the information of the at least one first local Vlan interface to each Vlan interface in a multicast group of the opposite-end equipment through the main Vlan interface, so that the opposite-end equipment detects the connectivity of the link to be detected in the first direction based on the first BFD multicast message; the first direction is a direction from the first local Vlan interface towards the first peer Vlan interface.
Optionally, the method further includes:
receiving a second BFD multicast message through a second local Vlan interface; the second BFD multicast message carries information of at least one second opposite-end Vlan interface; the information of the at least one second opposite-end Vlan interface is information of a Vlan interface corresponding to the at least one second link to be detected on the opposite-end device;
and determining connectivity of the second link to be detected in a second direction according to information of a second opposite-end Vlan interface carried in the second BFD multicast message, where the second direction is a direction from the second opposite-end Vlan interface to a second local Vlan interface.
Optionally, the determining connectivity of the second link to be detected in the second direction according to the information of the second peer Vlan interface carried in the second BFD multicast packet includes:
and when the second local Vlan interface is determined to be the main receiving port, determining connectivity of the second link to be detected in the second direction according to information of the second opposite-end Vlan interface carried in the second BFD multicast message.
Optionally, the information of the second peer Vlan interface is an IP address of the second peer Vlan interface;
determining connectivity of the second link to be detected in the second direction according to the information of the second end-to-end Vlan interface carried in the second BFD multicast packet, including:
aiming at the IP address of each second local Vlan interface corresponding to a second link to be detected, if the IP address of the second local Vlan interface and the IP address of the second opposite-end Vlan interface belong to the same network segment, determining that the second link to be detected is communicated;
and if the IP addresses of all the second local Vlan interfaces corresponding to the second link to be detected and the IP addresses of the second opposite-end Vlan interfaces do not belong to the same network segment, determining that the second link to be detected is not communicated.
In correspondence with the foregoing embodiments of the link connectivity detection method, the present specification also provides a machine-readable storage medium, characterized in that the machine-readable storage medium stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to perform:
determining information of at least one first local Vlan interface corresponding to at least one first link to be detected; a first peer Vlan interface corresponding to the first local Vlan interface belongs to the same multicast group; the first peer Vlan interface belongs to peer equipment;
determining a main Vlan interface in a Vlan interface group to which the first local Vlan interface belongs; the Vlan interfaces in the Vlan interface group all correspond to the same physical port;
sending a first BFD multicast message carrying the information of the at least one first local Vlan interface to each Vlan interface in a multicast group of the opposite-end equipment through the main Vlan interface, so that the opposite-end equipment detects the connectivity of the link to be detected in the first direction based on the first BFD multicast message; the first direction is a direction from the first local Vlan interface towards the first peer Vlan interface.
Optionally, the method further includes:
receiving a second BFD multicast message through a second local Vlan interface; the second BFD multicast message carries information of at least one second opposite-end Vlan interface; the information of the at least one second opposite-end Vlan interface is information of a Vlan interface corresponding to the at least one second link to be detected on the opposite-end device;
and determining connectivity of the second link to be detected in a second direction according to information of a second opposite-end Vlan interface carried in the second BFD multicast message, where the second direction is a direction from the second opposite-end Vlan interface to a second local Vlan interface.
Optionally, the determining connectivity of the second link to be detected in the second direction according to the information of the second peer Vlan interface carried in the second BFD multicast packet includes:
and when the second local Vlan interface is determined to be the main receiving port, determining connectivity of the second link to be detected in the second direction according to information of the second opposite-end Vlan interface carried in the second BFD multicast message.
Optionally, the information of the second peer Vlan interface is an IP address of the second peer Vlan interface;
determining connectivity of the second link to be detected in the second direction according to the information of the second end-to-end Vlan interface carried in the second BFD multicast packet, including:
aiming at the IP address of each second local Vlan interface corresponding to a second link to be detected, if the IP address of the second local Vlan interface and the IP address of the second opposite-end Vlan interface belong to the same network segment, determining that the second link to be detected is communicated;
and if the IP addresses of all the second local Vlan interfaces corresponding to the second link to be detected and the IP addresses of the second opposite-end Vlan interfaces do not belong to the same network segment, determining that the second link to be detected is not communicated.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (10)

1. A method for link connectivity detection, the method being applied to a network device and comprising:
determining information of at least one first local Vlan interface corresponding to at least one first link to be detected; a first peer Vlan interface corresponding to the first local Vlan interface belongs to the same multicast group; the first peer Vlan interface belongs to peer equipment;
determining a main Vlan interface in a Vlan interface group to which the first local Vlan interface belongs; the Vlan interfaces in the Vlan interface group all correspond to the same physical port;
sending a first BFD multicast message carrying the information of the at least one first local Vlan interface to each Vlan interface in a multicast group of the opposite-end equipment through the main Vlan interface, so that the opposite-end equipment detects the connectivity of the link to be detected in the first direction based on the first BFD multicast message; the first direction is a direction from the first local Vlan interface towards the first peer Vlan interface.
2. The method of claim 1, further comprising:
receiving a second BFD multicast message through a second local Vlan interface; the second BFD multicast message carries information of at least one second opposite-end Vlan interface; the information of the at least one second opposite-end Vlan interface is information of a Vlan interface corresponding to the at least one second link to be detected on the opposite-end device;
and determining connectivity of the second link to be detected in a second direction according to information of a second opposite-end Vlan interface carried in the second BFD multicast message, where the second direction is a direction from the second opposite-end Vlan interface to a second local Vlan interface.
3. The method according to claim 2, wherein the determining connectivity of the second link to be detected in the second direction according to information of the second peer Vlan interface carried in the second BFD multicast packet includes:
and when the second local Vlan interface is determined to be the main receiving port, determining connectivity of the second link to be detected in the second direction according to information of the second opposite-end Vlan interface carried in the second BFD multicast message.
4. A method according to any of claims 2-3, wherein said information of the second peer Vlan interface is the IP address of the second peer Vlan interface;
determining connectivity of the second link to be detected in the second direction according to the information of the second end-to-end Vlan interface carried in the second BFD multicast packet, including:
aiming at the IP address of each second local Vlan interface corresponding to a second link to be detected, if the IP address of the second local Vlan interface and the IP address of the second opposite-end Vlan interface belong to the same network segment, determining that the second link to be detected is communicated;
and if the IP addresses of all the second local Vlan interfaces corresponding to the second link to be detected and the IP addresses of the second opposite-end Vlan interfaces do not belong to the same network segment, determining that the second link to be detected is not communicated.
5. An apparatus for link connectivity detection, the apparatus being applied to a network device, and comprising:
a local interface determining unit, configured to determine information of at least one first local Vlan interface corresponding to at least one first link to be detected; a first peer Vlan interface corresponding to the first local Vlan interface belongs to the same multicast group; the first peer Vlan interface belongs to peer equipment;
a main interface determining unit, configured to determine a main Vlan interface in a Vlan interface group to which the first local Vlan interface belongs; the Vlan interfaces in the Vlan interface group all correspond to the same physical port;
a multicast packet sending unit, configured to send, to each Vlan interface in a multicast group of an opposite-end device through the master Vlan interface, a first BFD multicast packet carrying the information of the at least one first local Vlan interface, so that the opposite-end device detects connectivity of the link to be detected in the first direction based on the first BFD multicast packet; the first direction is a direction from the first local Vlan interface towards the first peer Vlan interface.
6. The apparatus of claim 5, further comprising:
the multicast message receiving unit is used for receiving a second BFD multicast message through a second local Vlan interface; the second BFD multicast message carries information of at least one second opposite-end Vlan interface; the information of the at least one second opposite-end Vlan interface is information of a Vlan interface corresponding to the at least one second link to be detected on the opposite-end device;
and a connectivity determining unit, configured to determine, according to information of a second opposite-end Vlan interface carried in the second BFD multicast packet, connectivity of the second link to be detected in a second direction, where the second direction is a direction from the second opposite-end Vlan interface to a second local Vlan interface.
7. The apparatus according to claim 5, wherein the connectivity determining unit is specifically configured to:
and when the second local Vlan interface is determined to be the main receiving port, determining connectivity of the second link to be detected in the second direction according to information of the second opposite-end Vlan interface carried in the second BFD multicast message.
8. The apparatus according to any of claims 6-7, wherein the information of the second peer Vlan interface is an IP address of the second peer Vlan interface;
determining connectivity of the second link to be detected in the second direction according to the information of the second end-to-end Vlan interface carried in the second BFD multicast packet, including:
aiming at the IP address of each second local Vlan interface corresponding to a second link to be detected, if the IP address of the second local Vlan interface and the IP address of the second opposite-end Vlan interface belong to the same network segment, determining that the second link to be detected is communicated;
and if the IP addresses of all the second local Vlan interfaces corresponding to the second link to be detected and the IP addresses of the second opposite-end Vlan interfaces do not belong to the same network segment, determining that the second link to be detected is not communicated.
9. A network device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to perform the method of any one of claims 1 to 4.
10. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to perform the method of any of claims 1 to 4.
CN202011321193.2A 2020-11-23 2020-11-23 Method and device for detecting link connectivity Pending CN112468363A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011321193.2A CN112468363A (en) 2020-11-23 2020-11-23 Method and device for detecting link connectivity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011321193.2A CN112468363A (en) 2020-11-23 2020-11-23 Method and device for detecting link connectivity

Publications (1)

Publication Number Publication Date
CN112468363A true CN112468363A (en) 2021-03-09

Family

ID=74798498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011321193.2A Pending CN112468363A (en) 2020-11-23 2020-11-23 Method and device for detecting link connectivity

Country Status (1)

Country Link
CN (1) CN112468363A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111372144A (en) * 2020-03-23 2020-07-03 北京小鸟科技股份有限公司 Link backup system and method for multicast video code stream

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111372144A (en) * 2020-03-23 2020-07-03 北京小鸟科技股份有限公司 Link backup system and method for multicast video code stream

Similar Documents

Publication Publication Date Title
US8493839B2 (en) Method and system of teamed network adapters with offloaded connections
US7580373B2 (en) Identifying nodes in a ring network
US8867375B2 (en) Failback to a primary communications adapter
US8599683B2 (en) System and method for changing a delivery path of multicast traffic
US9455916B2 (en) Method and system for changing path and controller thereof
CN112468363A (en) Method and device for detecting link connectivity
US20190166042A1 (en) Method for data transmitting, centralized controller, forwarding plane device and communication apparatus
CN106559246B (en) Cluster implementation method and server
US20130227022A1 (en) Peer discovery and secure communication in failover schemes
WO2010037318A1 (en) Data transmission system and data transmission method
CN109474495B (en) Tunnel detection method and device
US8149842B2 (en) Automated discovery of network devices supporting particular transport layer protocols
Sobeih et al. Vring: A case for building application-layer multicast rings (rather than trees)
CN107078924B (en) Method, equipment and system for carrying out bidirectional forwarding detection on aggregation link
CN107872368B (en) Method and device for detecting accessibility of gateway in network node cluster and terminal
WO2021135448A1 (en) Service invocation method, apparatus, device, and medium
KR20030035734A (en) Apparatus and method for resetting remote atm-based equipment
CN106992878B (en) Multicast detection method and device
CN110086689B (en) Double-stack BFD detection method and system
US7561512B1 (en) Method and system for enhancing crankback handling in multi-peer group networks
CN108418709B (en) Port aggregation method and device
JP2016015676A (en) Monitoring device, monitoring system, and monitoring method
KR20040011861A (en) Method and apparatus for receivability test and reachability test of explicit multicast
CN107786386B (en) Selective transmission of Bidirectional Forwarding Detection (BFD) messages for authenticating multicast connections
CN106375355B (en) Load balancing processing method and device

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