CN109889411B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN109889411B
CN109889411B CN201910222615.1A CN201910222615A CN109889411B CN 109889411 B CN109889411 B CN 109889411B CN 201910222615 A CN201910222615 A CN 201910222615A CN 109889411 B CN109889411 B CN 109889411B
Authority
CN
China
Prior art keywords
interface
network device
state
group
states
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
CN201910222615.1A
Other languages
Chinese (zh)
Other versions
CN109889411A (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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201910222615.1A priority Critical patent/CN109889411B/en
Publication of CN109889411A publication Critical patent/CN109889411A/en
Application granted granted Critical
Publication of CN109889411B publication Critical patent/CN109889411B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the application provides a method and a device for data transmission, which relate to the technical field of communication, the method is applied to first network equipment, the first network equipment is connected with a plurality of switches, each switch is connected with a first interface group of second network equipment, and the method comprises the following steps: receiving a first Bidirectional Forwarding Detection (BFD) message sent by second network equipment, wherein the first BFD message carries interface states of a plurality of first interface groups; if the interface state of the first interface group corresponding to the current transmission path between the first network device and the second network device is the off state in the interface states of the plurality of first interface groups, determining a target transmission path according to other first interface groups of which the interface states are the on states in the plurality of first interface groups, and transmitting data to the second network device through the target transmission path. By adopting the method and the device, data loss can be prevented, and network communication is ensured.

Description

Data transmission method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for data transmission.
Background
At present, Network Function Virtualization (NFV) technology is more and more widely applied. Under the software architecture of NFV, a plurality of virtual network devices (such as virtual firewalls, virtual routers, etc.) and virtual switches can be virtualized in a server. The virtual network equipment virtualized in the server communicates with the physical switch through the virtual switch.
Generally, a virtual network device detects an interface state of a virtual interface connected to a virtual switch, and when the virtual network device detects that the interface state of the virtual interface is a shutdown state (i.e., a Down state), the virtual network device may send data to a physical switch through another link. For example, a certain stacked device includes a first virtual network device and a second virtual network device. The first virtual network equipment is communicated with the physical switch through the first virtual switch, the second virtual network equipment is communicated with the physical switch through the second virtual switch, and the first virtual network equipment is a main stacking equipment. When the interface state of the virtual interface, which is connected between the first virtual network device and the first virtual switch, is the closed state, the stack device may switch the traffic from the first virtual network device to the second virtual network device, that is, send data to the physical switch through the second virtual network device and the second virtual switch.
However, when the link between the server and the physical switch fails, the interface states of the physical interfaces of the server and the physical switch are both in the off state (i.e., Down state), and at this time, the interface states of the virtual interfaces of the virtual network device and the virtual switch are still in the on state (i.e., UP state). The virtual network device may continue to send data to the physical switch through the current transmission path (i.e., the virtual network device continues to pass through the virtual switch), thereby causing data loss and affecting network communication.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for data transmission, which can prevent data loss and ensure network communication. The specific technical scheme is as follows:
in a first aspect, a method for data transmission is provided, where the method is applied to a first network device, the first network device is respectively connected to a plurality of switches, and each switch is connected to a first interface group of a second network device, and the method includes:
receiving a first Bidirectional Forwarding Detection (BFD) message sent by the second network device, where the first BFD message carries interface states of the plurality of first interface groups;
if the interface state of the first interface group corresponding to the current transmission path between the first network device and the second network device is the off state in the interface states of the plurality of first interface groups, determining a target transmission path according to other first interface groups of which the interface states are the on states in the plurality of first interface groups, and sending data to the second network device through the target transmission path.
Optionally, the first network device is connected to the switches through a plurality of second interface groups, respectively, and the method further includes:
for each second interface group, acquiring the interface state of a physical interface contained in the second interface group;
determining the interface state of the second interface group according to the interface state of the physical interface contained in the second interface group;
and sending a second BFD message to the second network device, wherein the second BFD message carries the interface states of the plurality of second interface groups, so that the second network device determines a transmission path according to the interface states of the plurality of second interface groups.
Optionally, the determining the interface state of the second interface group according to the interface state of the physical interface included in the second interface group includes:
if the interface states of the physical interfaces included in the second interface group are all closed states, determining that the interface state of the second interface group is a closed state;
and if the interface state of at least one physical interface in the physical interfaces contained in the second interface group is the opening state, determining that the interface state of the second interface group is the opening state.
Optionally, the determining a target transmission path according to another first interface group of which the interface state is the open state in the plurality of first interface groups includes:
determining a target first interface group with an interface state being an open state in the plurality of first interface groups, and determining a target second interface group with an interface state being an open state in the plurality of second interface groups;
and determining a transmission path comprising the target first interface group and the target second interface group, and taking the transmission path as a target transmission path.
In a second aspect, an apparatus for data transmission is provided, where the apparatus is applied to a first network device, the first network device is respectively connected to a plurality of switches, and each switch is connected to a first interface group of a second network device, and the apparatus includes:
a receiving module, configured to receive a first Bidirectional Forwarding Detection (BFD) packet sent by the second network device, where the first BFD packet carries interface states of the plurality of first interface groups;
a first sending module, configured to determine a target transmission path according to another first interface group of the plurality of first interface groups whose interface states are in an on state if, in the interface states of the plurality of first interface groups, an interface state of a first interface group corresponding to a current transmission path between the first network device and the second network device is in an off state, and send data to the second network device through the target transmission path.
Optionally, the first network device is connected to the plurality of switches through a plurality of second interface groups, respectively, and the apparatus further includes:
the acquisition module is used for acquiring the interface state of the physical interface contained in each second interface group;
the determining module is used for determining the interface state of the second interface group according to the interface state of the physical interface contained in the second interface group;
a second sending module, configured to send a second BFD packet to the second network device, where the second BFD packet carries the interface states of the multiple second interface groups, so that the second network device determines a transmission path according to the interface states of the multiple second interface groups.
Optionally, the determining module is specifically configured to:
if the interface states of the physical interfaces included in the second interface group are all closed states, determining that the interface state of the second interface group is a closed state;
and if the interface state of at least one physical interface in the physical interfaces contained in the second interface group is the opening state, determining that the interface state of the second interface group is the opening state.
Optionally, the first sending module is specifically configured to:
determining a target first interface group with an interface state being an open state in the plurality of first interface groups, and determining a target second interface group with an interface state being an open state in the plurality of second interface groups;
and determining a transmission path comprising the target first interface group and the target second interface group, and taking the transmission path as a target transmission path.
In a third aspect, a network device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of the first aspect when executing the program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when being executed by a processor, carries out the method steps of the first aspect.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method steps of the first aspect described above.
The embodiment of the application provides a method and a device for data transmission, wherein a first network device can receive a BFD message sent by a second network device, and if the interface state of a first interface group corresponding to a current transmission path between the first network device and the second network device is a closed state in the interface states of a plurality of first interface groups, a target transmission path is determined according to other first interface groups of which the interface states are open states in the plurality of first interface groups, and data is sent to the second network device through the target transmission path. In this way, the first network device may determine, according to the BFD packet sent by the second network device, that the first interface group of the second network device on the current transmission path between the first network device and the second network device has failed, and send data to the second network device through other transmission paths, thereby preventing data loss and improving reliability of network communication.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings 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 of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1A is a schematic diagram of a network system according to an embodiment of the present application;
fig. 1B is a schematic diagram of another network system provided in the embodiment of the present application;
fig. 2 is a flowchart of a method for data transmission according to an embodiment of the present application;
fig. 3A is a format diagram of a BFD packet provided in the embodiment of the present application;
fig. 3B is a format diagram of an authentication field of a BFD packet provided in the embodiment of the present application;
fig. 4 is a flowchart of an example of a method for data transmission according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a network device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a data transmission method, which can be applied to network equipment in a network system, such as a router, a firewall and the like. The network system includes a first network device, a second network device, and a plurality of switches. The first network device is connected with the plurality of switches through the plurality of second interface groups respectively, and each switch is connected with the first interface group of the second network device. The first interface group corresponds to the switch one by one, and the second interface group corresponds to the switch one by one.
Fig. 1A is a schematic diagram of a network system according to an embodiment of the present application. As shown in fig. 1A, the network system includes a first network device, a second network device, a first switch, and a second switch. The first network device is connected with the first switch through an interface group 1, and the interface group 1 comprises an interface 1 and an interface 2. The first network device is also connected to the second switch via an interface group 2, where the interface group 2 includes an interface 3 and an interface 4. The second network device is connected to the first switch via an interface group 3, the interface group 3 comprising an interface 5 and an interface 6. The second network device is also connected to the second switch via an interface group 4, the interface group 4 comprising an interface 7 and an interface 8.
Fig. 1B is a schematic diagram of another network system according to an embodiment of the present application. In the network system, the first network device may be a network device formed by a plurality of virtual network devices through an Intelligent Resilient Framework (IRF) technology. As shown in fig. 1B, the server 1 virtualizes a first virtual network device and a first virtual switch by the NFV technology. In order to prevent the virtual network device from causing network oscillation due to a single point of failure, a first virtual network device and a second virtual network device are stacked through an IRF technology to obtain a stacked device, where the first virtual network device may be a master stacked device, and the second virtual network device may be a standby stacked device. The first virtual network device is connected to the first virtual switch via the interface group 1. The interface group 1 includes an interface 1 and an interface 2. Similarly, the server 2 virtualizes a second virtual network device and a second virtual switch through the NFV technology. The second virtual network device is connected to the second virtual switch via the interface group 2. The interface group 2 includes an interface 3 and an interface 4. Accordingly, the physical switch is connected to the first virtual switch via the interface group 3. The interface group 3 includes an interface 5 and an interface 6. Similarly, the physical switch is also connected to the second virtual switch through the interface group 4. The interface group 4 includes an interface 7 and an interface 8. In addition, the virtual interfaces of the first virtual network device and the second virtual network device may also be set as Ethernet Redundant interfaces (hereinafter referred to as "redundancy Ethernet"). The interface states of the virtual interfaces (i.e. interface 1 and interface 2) of the first virtual network device (i.e. the master stack device) are active states (i.e. active states), and the interface states of the virtual interfaces (i.e. interface 3 and interface 4) of the second virtual network device (i.e. the standby stack device) are inactive states (i.e. inactive states). At this time, the first virtual network device (i.e., the master stack device) may send data to the physical switch through the transmission path corresponding to the interface group 1.
The following describes a method for data transmission provided in the embodiments of the present application in detail with reference to specific embodiments, as shown in fig. 2, the specific steps are as follows.
Step 201, receiving a first BFD packet sent by a second network device.
The first BFD message carries interface states of a plurality of first interface groups.
In this embodiment, referring to fig. 1A, a second network device may periodically send a first Bidirectional Forwarding Detection (BFD) packet to a first network device. The first BFD packet carries interface states of a plurality of first interface groups (for example, interface group 3 and interface group 4). For each first interface group, the second network device may determine the interface state of the first interface group according to the interface states of the physical interfaces included in the first interface group. The interface state may be an on state or an off state. The on state may represent an UP state or an active state, and the off state may represent a down state or an inactive state.
The process of determining the interface status of the interface group by the network device will be described in detail later.
After receiving the first BFD packet, the first network device may parse the first BFD packet to obtain the interface states of the plurality of first interface groups carried in the first BFD packet.
For example, when the links between the second network device and the first switch and the second switch are normal, the interface state of the interface group 3 carried in the first BFD packet is an open state, and the interface state of the interface group 4 is an open state. When the link between the second network device and the first switch fails and the link between the second network device and the second switch is normal, the interface state of the interface group 3 carried in the first BFD message is a closed state, and the interface state of the interface group 4 is an open state.
Step 202, if the interface state of the first interface group corresponding to the current transmission path between the first network device and the second network device is the off state in the interface states of the plurality of first interface groups, determining a target transmission path according to the other first interface groups of which the interface states are the on states in the plurality of first interface groups, and transmitting data to the second network device through the target transmission path.
In this embodiment of the application, after obtaining the interface states of the plurality of first interface groups carried in the first BFD packet, the first network device may first determine the first interface group corresponding to the current transmission path between the first network device and the second network device, and then obtain the interface state of the first interface group corresponding to the current transmission path from the interface states of the plurality of first interface groups. If the interface state of the first interface group corresponding to the current transmission path is the closed state, determining that the interface group of the second network device on the current transmission path has a fault, that is, the current transmission path has a fault. Then, the first network device may determine, in the plurality of first interface groups, other first interface groups whose interface states are the open states, and further determine the target transmission path according to the determined other first interfaces. The first network device can send data to the second network device through the target transmission path, so that data loss is prevented, and reliability of network communication is improved. If the interface state of the first interface group corresponding to the current transmission path between the first network device and the second network device is the open state, it is determined that the interface group on the current transmission path is normal, that is, the current transmission path is normal. The first network device may continue to transmit data to the second network device over the current transmission path.
For example, referring to fig. 1A, the current transmission path between the first network device and the second network device is the first network device → the first switch → the second network device. When the link between the second network device and the first switch fails and the link between the second network device and the second switch is normal, the interface state of the interface group 3 carried in the first BFD message is a closed state, and the interface state of the interface group 4 is an open state. After the second network device obtains the interface state of the interface group 3 and the interface state of the interface group 4 carried in the first BFD packet, because the interface state of the interface group 3 is the off state, the first network device may determine that the interface group 3 of the second network device has a fault, that is, that the current transmission path between the first network device and the second network device has a fault. Then, the first network device may determine a target transmission path, i.e., the first network device → the second switch → the second network device, according to the interface state of the interface group 4, and transmit data to the second network device through the target transmission path.
Optionally, the first network device may further determine the target transmission path according to the interface state of the second interface group and the interface state of the first interface group. The specific treatment process comprises the following steps: and determining a target first interface group with an interface state of an open state in the plurality of first interface groups, and determining a target second interface group with an interface state of an open state in the plurality of second interface groups. Then, a transmission path including the target first interface group and the target second interface group is determined, and the transmission path is taken as a target transmission path.
In this embodiment, the first network device may determine, in the plurality of first interface groups, a target first interface group whose interface state is an open state, and determine, in the plurality of second interface groups, a target second interface group whose interface state is an open state. Then, the first network device determines that a transmission path of the target first interface group and the target second interface group on the same transmission path is a target transmission path. If the determined target transmission paths are multiple, the first network device may further determine a unique target transmission path from the multiple target transmission paths according to other conditions such as overhead and time delay.
Optionally, the first network device may pre-mark a correspondence between a first interface group and a second interface group belonging to the same transmission path. For example, a technician may set the identifiers of the first interface group and the second interface group on the same transmission path as the identifier of the same interface group, that is, both interface group 1 and interface group 3 in fig. 1A are set as interface group a, and both interface group 2 and interface group 4 are set as interface group B. Correspondingly, when determining the target transmission path, the first network device may directly determine whether the interface states of the first interface group and the second interface group having the same interface group identifier are both the open state. And if the interface states of the first interface group and the second interface group with the same interface group identification are both in an opening state, determining that the transmission paths corresponding to the first interface group and the second interface group are target transmission paths.
Optionally, the first network device may further periodically obtain interface states of the second interface groups (for example, interface group 1 and interface group 2), and send a BFD packet to the second network device, so that the second network device determines the transmission path according to the interface states of the plurality of second interface groups. The specific treatment process is as follows:
step one, aiming at each second interface group, acquiring the interface state of a physical interface contained in the second interface group.
In this embodiment of the application, a technician may configure, in advance, an interface group and interfaces included in each interface group in the first network device. For each second interface group, the first network device may periodically detect an interface state of a physical interface included in the second interface group.
And step two, determining the interface state of the second interface group according to the interface state of the physical interface contained in the second interface group.
In this embodiment, after obtaining the interface states of the physical interfaces included in the second interface group, the first network device may determine the interface states of the second interface group according to the interface states of the physical interfaces included in the second interface group.
Optionally, the processing procedure of determining, by the first network device, the interface state of the second interface group according to the interface state of the physical interface included in the second interface group may be: and if the interface states of the physical interfaces included in the second interface group are all closed states, determining that the interface state of the second interface group is a closed state. And if the interface state of at least one physical interface in the physical interfaces contained in the second interface group is the opening state, determining that the interface state of the second interface group is the opening state.
In this embodiment, after obtaining the interface states of the physical interfaces included in the second interface group, the first network device may further determine whether the interface states of the physical interfaces included in the second interface group are all closed states. And if the interface states of the physical interfaces included in the second interface group are all closed states, determining that the second interface group has a fault, and determining that the interface state of the second interface group is a closed state. And if the interface state of at least one physical interface in the physical interfaces contained in the second interface group is the opening state, determining that the second interface group is normal, and determining that the interface state of the second interface group is the opening state.
For example, if the interface state of the interface 1 in the interface group 1 is the off state and the interface state of the interface 2 is the off state, the interface state of the interface group 1 is the off state. If the interface state of the interface 3 in the interface group 2 is the off state and the interface state of the interface 4 is the on state, the interface state of the interface group 2 is the on state.
And step three, sending a second BFD message to second network equipment.
The second BFD packet carries interface states of the plurality of second interface groups, so that the second network device determines a transmission path according to the interface states of the plurality of second interface groups.
The process of determining the transmission path by the second network device according to the interface states of the plurality of second interface groups is similar to step 202, and is not described here again.
Optionally, the network device may carry the interface state of the interface group in the authentication field of the BFD packet.
In this embodiment of the present application, fig. 3A is a format diagram of a BFD packet provided in this embodiment of the present application. As shown in fig. 3A, the first network device may set an Authentication identifier (Authentication Present) field in the BFD message to 1, which is used to indicate that the BFD message carries the Authentication field. Fig. 3B is a format diagram of an authentication field of a BFD packet according to the embodiment of the present application. As shown in fig. 3B, the Authentication field includes an Authentication Type (Authentication Type) field, an Authentication field Length (Authentication Length) field, and an Authentication Data (Authentication Data) field. The first network device may set the authentication type to any value of 6 to 255, where the authentication type is used to represent an interface state where the authentication data carries an interface group, so that the second network device receives the second BFD packet and then uploads the second BFD packet to a Central Processing Unit (CPU) for processing. Meanwhile, the first network device may add the interface status of each second interface group in the authentication data field. For example, the first network device sets the authentication type field in the second BFD message to 100, and carries the interface state of interface group 1 and the interface state of interface group 2 in the authentication data field.
Fig. 4 is an example of a method for data transmission according to an embodiment of the present application, and reference is made to a network system shown in fig. 1B, where a stack device in this example includes a first virtual network device and a second virtual network device. The first virtual network device is a master stacking device, the second virtual network device is a standby stacking device, the interface states of the interface 1 and the interface 2 included in the interface group 1 are active states, and the interface states of the interface 3 and the interface 4 included in the interface group 2 are inactive states. The current transmission path between the first network device and the second network device is the first virtual network device → the first virtual switch → the physical switch, that is, when the link between the physical switch and the first virtual switch is normal, the first virtual network device sends data to the physical switch through the first virtual switch. When a link between the physical switch and the first virtual switch fails. The specific treatment process is as follows:
in step 401, the physical switch obtains the interface states of the interface 5 and the interface 6, and the interface states of the interface 7 and the interface 8.
The interface states of the interface 5 and the interface 6 are both off states, and the interface states of the interface 7 and the interface 8 are both on states.
Step 402, the physical switch determines that the interface state of the interface group 3 is a closed state according to the interface states of the interface 5 and the interface 6, and determines that the interface state of the interface group 4 is an open state according to the interface states of the interface 7 and the interface 8.
In step 403, the physical switch sends a BFD packet to the stacking device.
The BFD packet carries the interface state of the interface group 3 and the interface state of the interface group 4.
In step 404, the stacking apparatus determines whether the interface state of the interface group 3 corresponding to the current transmission path between the first network device and the second network device is a closed state.
If the interface state of the interface group 3 corresponding to the current transmission path between the first network device and the second network device is the off state, step 405 is executed.
Step 405, the stacking device switches the first virtual network device to a standby stacking device, and switches the second virtual network device to a master stacking device.
In one embodiment, the stacking apparatus may also switch the interface states of the interface 1 and the interface 2 to the inactive state, and switch the interface states of the interface 3 and the interface 4 to the active state.
The specific processing procedure of steps 401 to 405 is similar to that of steps 201 to 202.
In this embodiment of the application, a first network device may receive a BFD packet sent by a second network device, and if, in interface states of a plurality of first interface groups, an interface state of a first interface group corresponding to a current transmission path between the first network device and the second network device is an off state, determine a target transmission path according to other first interface groups in the plurality of first interface groups whose interface states are on states, and send data to the second network device through the target transmission path. In this way, the first network device may determine, according to the BFD packet sent by the second network device, that the first interface group of the second network device on the current transmission path between the first network device and the second network device has failed, and send data to the second network device through other transmission paths, thereby preventing data loss and improving reliability of network communication.
Based on the same technical concept, as shown in fig. 5, an embodiment of the present application further provides a device for fault detection, where the device is applied to a first network device, the first network device is respectively connected to a plurality of switches, and each switch is connected to a first interface group of a second network device, and the device includes:
a receiving module 510, configured to receive a first Bidirectional Forwarding Detection (BFD) packet sent by a second network device, where the first BFD packet carries interface states of multiple first interface groups;
a first sending module 520, configured to determine, if, in the interface states of the multiple first interface groups, the interface state of the first interface group corresponding to the current transmission path between the first network device and the second network device is the off state, a target transmission path according to another first interface group in the multiple first interface groups whose interface state is the on state, and send data to the second network device through the target transmission path.
Optionally, the first network device is connected to the plurality of switches through the plurality of second interface groups, as shown in fig. 6, the apparatus further includes:
an obtaining module 530, configured to obtain, for each second interface group, an interface state of a physical interface included in the second interface group;
a determining module 540, configured to determine an interface state of the second interface group according to an interface state of a physical interface included in the second interface group;
the second sending module 550 is configured to send a second BFD packet to the second network device, where the second BFD packet carries interface states of multiple second interface groups, so that the second network device determines a transmission path according to the interface states of the multiple second interface groups.
Optionally, the determining module 540 is specifically configured to:
if the interface states of the physical interfaces included in the second interface group are all closed states, determining that the interface state of the second interface group is a closed state;
and if the interface state of at least one physical interface in the physical interfaces contained in the second interface group is the opening state, determining that the interface state of the second interface group is the opening state.
Optionally, the first sending module 520 is specifically configured to:
determining a target first interface group with an interface state of an open state in the plurality of first interface groups, and determining a target second interface group with an interface state of an open state in the plurality of second interface groups;
and determining a transmission path comprising the target first interface group and the target second interface group, and taking the transmission path as a target transmission path.
In this embodiment of the application, a first network device may receive a BFD packet sent by a second network device, and if, in interface states of a plurality of first interface groups, an interface state of a first interface group corresponding to a current transmission path between the first network device and the second network device is an off state, determine a target transmission path according to other first interface groups in the plurality of first interface groups whose interface states are on states, and send data to the second network device through the target transmission path. In this way, the first network device may determine, according to the BFD packet sent by the second network device, that the first interface group of the second network device on the current transmission path between the first network device and the second network device has failed, and send data to the second network device through other transmission paths, thereby preventing data loss and improving reliability of network communication.
Based on the same technical concept, the embodiment of the present application further provides a network device (hereinafter, referred to as a first network device), as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following method steps when executing the program stored in the memory 703:
receiving a first Bidirectional Forwarding Detection (BFD) message sent by the second network device, where the first BFD message carries interface states of the plurality of first interface groups;
if the interface state of the first interface group corresponding to the current transmission path between the first network device and the second network device is the off state in the interface states of the plurality of first interface groups, determining a target transmission path according to other first interface groups of which the interface states are the on states in the plurality of first interface groups, and sending data to the second network device through the target transmission path.
Optionally, the first network device is connected to the switches through a plurality of second interface groups, respectively, and the method further includes:
for each second interface group, acquiring the interface state of a physical interface contained in the second interface group;
determining the interface state of the second interface group according to the interface state of the physical interface contained in the second interface group;
and sending a second BFD message to the second network device, wherein the second BFD message carries the interface states of the plurality of second interface groups, so that the second network device determines a transmission path according to the interface states of the plurality of second interface groups.
Optionally, the determining the interface state of the second interface group according to the interface state of the physical interface included in the second interface group includes:
if the interface states of the physical interfaces included in the second interface group are all closed states, determining that the interface state of the second interface group is a closed state;
and if the interface state of at least one physical interface in the physical interfaces contained in the second interface group is the opening state, determining that the interface state of the second interface group is the opening state.
Optionally, the determining a target transmission path according to another first interface group of which the interface state is the open state in the plurality of first interface groups includes:
determining a target first interface group with an interface state being an open state in the plurality of first interface groups, and determining a target second interface group with an interface state being an open state in the plurality of second interface groups;
and determining a transmission path comprising the target first interface group and the target second interface group, and taking the transmission path as a target transmission path.
The communication bus mentioned in the network device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the network device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, or discrete hardware components.
Based on the same technical concept, the embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the above-mentioned data transmission method.
Based on the same technical concept, the embodiment of the present application also provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the above-mentioned data transmission method.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (10)

1. A method for data transmission, the method being applied to a first network device, the first network device being respectively connected to a plurality of switches, each switch being connected to a first interface group of a second network device, the method comprising:
receiving a first Bidirectional Forwarding Detection (BFD) message sent by the second network device, where the first BFD message carries interface states of all first interface groups of the second network device;
if the interface state of the first interface group corresponding to the transmission path for transmitting data between the first network device and the second network device is the off state in the interface states of all the first interface groups, determining a target transmission path according to other first interface groups of which the interface states are the on states in all the first interface groups, and transmitting data to the second network device through the target transmission path.
2. The method of claim 1, wherein the first network device is connected to each switch via a respective second interface group, the method further comprising:
for each second interface group, acquiring the interface state of a physical interface contained in the second interface group;
determining the interface state of the second interface group according to the interface state of the physical interface contained in the second interface group;
and sending a second BFD message to the second network device, where the second BFD message carries interface states of all second interface groups of the first network device, so that the second network device determines a transmission path according to the interface states of all second interface groups.
3. The method according to claim 2, wherein determining the interface status of the second interface group according to the interface status of the physical interface included in the second interface group comprises:
if the interface states of the physical interfaces included in the second interface group are all closed states, determining that the interface state of the second interface group is a closed state;
and if the interface state of at least one physical interface in the physical interfaces contained in the second interface group is the opening state, determining that the interface state of the second interface group is the opening state.
4. The method according to claim 2, wherein the determining a target transmission path according to the other first interface groups of which the interface states are on states comprises:
determining a target first interface group with an interface state being an open state in all the first interface groups, and determining a target second interface group with an interface state being an open state in all the second interface groups;
and determining a transmission path comprising the target first interface group and the target second interface group, and taking the transmission path as a target transmission path.
5. An apparatus for data transmission, the apparatus being applied to a first network device, the first network device being respectively connected to a plurality of switches, each switch being connected to a first interface group of a second network device, the apparatus comprising:
a receiving module, configured to receive a first Bidirectional Forwarding Detection (BFD) packet sent by the second network device, where the first BFD packet carries interface states of all first interface groups of the second network device;
a first sending module, configured to determine a target transmission path according to another first interface group of which the interface states are in an open state in all the first interface groups if, in the interface states of all the first interface groups, an interface state of a first interface group corresponding to a transmission path through which data is transmitted between the first network device and the second network device is in the closed state, and send data to the second network device through the target transmission path.
6. The apparatus of claim 5, wherein the first network device is connected to the plurality of switches via a plurality of second interface groups, respectively, the apparatus further comprising:
the acquisition module is used for acquiring the interface state of the physical interface contained in each second interface group;
the determining module is used for determining the interface state of the second interface group according to the interface state of the physical interface contained in the second interface group;
a second sending module, configured to send a second BFD packet to the second network device, where the second BFD packet carries the interface states of the multiple second interface groups, so that the second network device determines a transmission path according to the interface states of the multiple second interface groups.
7. The apparatus of claim 6, wherein the determining module is specifically configured to:
if the interface states of the physical interfaces included in the second interface group are all closed states, determining that the interface state of the second interface group is a closed state;
and if the interface state of at least one physical interface in the physical interfaces contained in the second interface group is the opening state, determining that the interface state of the second interface group is the opening state.
8. The apparatus of claim 6, wherein the first sending module is specifically configured to:
determining a target first interface group with an interface state being an open state in the plurality of first interface groups, and determining a target second interface group with an interface state being an open state in the plurality of second interface groups;
and determining a transmission path comprising the target first interface group and the target second interface group, and taking the transmission path as a target transmission path.
9. The network equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN201910222615.1A 2019-03-22 2019-03-22 Data transmission method and device Active CN109889411B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910222615.1A CN109889411B (en) 2019-03-22 2019-03-22 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910222615.1A CN109889411B (en) 2019-03-22 2019-03-22 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN109889411A CN109889411A (en) 2019-06-14
CN109889411B true CN109889411B (en) 2020-09-11

Family

ID=66933713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910222615.1A Active CN109889411B (en) 2019-03-22 2019-03-22 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN109889411B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112564931B (en) * 2019-09-25 2022-08-19 华为技术有限公司 Fault processing method, device and storage medium
CN114531375A (en) * 2020-11-03 2022-05-24 中兴通讯股份有限公司 Message forwarding method and device and computer readable storage medium
CN113347166B (en) * 2021-05-24 2023-05-16 广西电网有限责任公司 Method, device and system for preventing safety risk of power grid optical transmission equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6751191B1 (en) * 1999-06-29 2004-06-15 Cisco Technology, Inc. Load sharing and redundancy scheme
CN101442484A (en) * 2008-12-05 2009-05-27 杭州华三通信技术有限公司 Method, system and equipment for detecting stacking multi-Active
CN101888333A (en) * 2009-05-13 2010-11-17 阿瓦亚公司 Be used in the Forwarding plane of network element, keeping the method and apparatus of Port State Table
CN102447639A (en) * 2012-01-17 2012-05-09 华为技术有限公司 Strategy routing method and device
CN103401754A (en) * 2013-07-30 2013-11-20 杭州华三通信技术有限公司 Stack link establishing method, equipment and system
CN103501250A (en) * 2013-09-30 2014-01-08 杭州华三通信技术有限公司 Data flow processing method and device in distribution type link aggregation network
CN104125153A (en) * 2014-08-12 2014-10-29 华为技术有限公司 Network topology discovery method and device
CN106559280A (en) * 2015-09-28 2017-04-05 中兴通讯股份有限公司 Bidirectional forwarding detection (BFD) method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079759B (en) * 2007-07-24 2010-07-21 杭州华三通信技术有限公司 Distributed bidirectional forwarding detection method and device
CN106130821B (en) * 2016-07-14 2020-05-15 新华三技术有限公司 Method and device for sending detection message
CN107277058B (en) * 2017-08-07 2020-03-20 南京南瑞集团公司 Interface authentication method and system based on BFD protocol
CN108616426B (en) * 2018-05-10 2020-04-10 瑞斯康达科技发展股份有限公司 Ring network and service data forwarding method
CN109194547B (en) * 2018-09-29 2020-06-16 新华三技术有限公司 Message transmission method and device, home terminal equipment and readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6751191B1 (en) * 1999-06-29 2004-06-15 Cisco Technology, Inc. Load sharing and redundancy scheme
CN101442484A (en) * 2008-12-05 2009-05-27 杭州华三通信技术有限公司 Method, system and equipment for detecting stacking multi-Active
CN101888333A (en) * 2009-05-13 2010-11-17 阿瓦亚公司 Be used in the Forwarding plane of network element, keeping the method and apparatus of Port State Table
CN102447639A (en) * 2012-01-17 2012-05-09 华为技术有限公司 Strategy routing method and device
CN103401754A (en) * 2013-07-30 2013-11-20 杭州华三通信技术有限公司 Stack link establishing method, equipment and system
CN103501250A (en) * 2013-09-30 2014-01-08 杭州华三通信技术有限公司 Data flow processing method and device in distribution type link aggregation network
CN104125153A (en) * 2014-08-12 2014-10-29 华为技术有限公司 Network topology discovery method and device
CN106559280A (en) * 2015-09-28 2017-04-05 中兴通讯股份有限公司 Bidirectional forwarding detection (BFD) method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"BFD技术***";华为,;《www.doc88.com/p-5485991396407.html》;20120817;全文 *

Also Published As

Publication number Publication date
CN109889411A (en) 2019-06-14

Similar Documents

Publication Publication Date Title
CN103621027B (en) Communication route control system and communication route control method
US10860311B2 (en) Method and apparatus for drift management in clustered environments
CN109889411B (en) Data transmission method and device
CN109088818B (en) Equipment linkage switching method and device
US10680893B2 (en) Communication device, system, and method
CN112217658B (en) Stacking and splitting processing method and device
CN109474495B (en) Tunnel detection method and device
CN112491700B (en) Network path adjustment method, system, device, electronic equipment and storage medium
CN111614505B (en) Message processing method and gateway equipment
US11258666B2 (en) Method, device, and system for implementing MUX machine
CN110022236B (en) Message forwarding method and device
US8971176B2 (en) Fibre channel over Ethernet switch implicit logout
Muthumanikandan et al. Switch failure detection in software-defined networks
US11800262B2 (en) Service path switching method and related device
EP3627766B1 (en) Method and system for switching between active bng and standby bng
CN114401218A (en) Bypass forwarding method and device for data message
US10644989B2 (en) Method for running a computer network
CN112217718A (en) Service processing method, device, equipment and storage medium
CN107104837B (en) Method and control device for path detection
CN115086219B (en) Virtual router determining method, device and computer readable storage medium
WO2015120581A1 (en) Traffic loop detection in a communication network
CN113992566B (en) Message broadcasting method and device
KR102221018B1 (en) Relay system and method for deling with fault of secure session for DB connection
CN109391507B (en) Network configuration method, computer readable storage medium and network device
CN117376243A (en) Network element switching method, device, cross-equipment link aggregation group and storage medium

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