CN109194547B - Message transmission method and device, home terminal equipment and readable storage medium - Google Patents

Message transmission method and device, home terminal equipment and readable storage medium Download PDF

Info

Publication number
CN109194547B
CN109194547B CN201811152358.0A CN201811152358A CN109194547B CN 109194547 B CN109194547 B CN 109194547B CN 201811152358 A CN201811152358 A CN 201811152358A CN 109194547 B CN109194547 B CN 109194547B
Authority
CN
China
Prior art keywords
terminal equipment
bfd echo
bfd
port
session
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
CN201811152358.0A
Other languages
Chinese (zh)
Other versions
CN109194547A (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.)
New H3C Information 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 CN201811152358.0A priority Critical patent/CN109194547B/en
Publication of CN109194547A publication Critical patent/CN109194547A/en
Application granted granted Critical
Publication of CN109194547B publication Critical patent/CN109194547B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity

Landscapes

  • Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the disclosure provides a message transmission method, a message transmission device, a local terminal device and a readable storage medium, and relates to the technical field of communication, wherein the method comprises the following steps: sending BFD Echo session messages including different source IP addresses to different member ports in an aggregation port respectively according to a preset time interval; so that each member port sends the BFD Echo session message to the opposite terminal equipment; the local terminal equipment detects whether a communication link between the local terminal equipment and the opposite terminal equipment is available according to whether different member ports receive BFD Echo session messages returned by the opposite terminal equipment. The home terminal equipment respectively sends BFD Echo session messages to a plurality of member ports of the aggregation port, and when one member port is unavailable, other member ports are adopted to carry out the BFD Echo session messages. The BFD session oscillation caused by the failure of the member port for sending the BFD session message in the prior art can be avoided.

Description

Message transmission method and device, home terminal equipment and readable storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for packet transmission, a home device, and a readable storage medium.
Background
The network equipment requires rapid detection of communication faults between adjacent systems, and can establish a substitute channel or switch to other links more rapidly when the faults occur. When a network device fails, a large amount of service flow is lost, however, the convergence performance of a protocol is generally limited, and under the background, a Bidirectional Forwarding Detection (BFD) service is generated at the right moment, and the BFD service can reduce the influence of a communication device failure on the service, improve the reliability of the network, so that the network device can detect the communication failure with an adjacent communication device as soon as possible, take measures in time, and ensure that the service continues.
Disclosure of Invention
The embodiment of the disclosure describes a message transmission method, a message transmission device, a local device and a readable storage medium, which are used for avoiding BFD session oscillation caused by a failure of a member port for sending a BFD session message and ensuring stability of a BFD session.
In a first aspect, an embodiment of the present disclosure provides a packet transmission method, which is applied to a processor of a home device, where the processor is configured to process a Bidirectional Forwarding Detection (BFD) session packet, the home device further includes aggregation ports corresponding to multiple member ports, and the method includes:
sending BFD Echo session messages including different source IP addresses to different member ports of the aggregation port respectively according to a preset time interval so that each member port sends the BFD Echo session messages to opposite-end equipment respectively, wherein the different source IP addresses and the IP address of the local-end equipment belong to the same network segment;
and detecting whether each member port receives a BFD Echo session message returned by the opposite terminal equipment, and if so, determining that a communication link between the local terminal equipment and the opposite terminal equipment is available.
Optionally, in this embodiment, before the BFDEcho session packets including different source IP addresses are respectively sent to different member ports of the aggregation port according to a preset time interval, the method includes:
polling the network segment to which the IP address of the local terminal equipment belongs, and generating the BFD Echo session message by taking the network segment address obtained by polling as a source IP address, wherein the source IP addresses contained in the BFD Echo messages generated in two adjacent times are different from each other.
Optionally, in this embodiment, the sending, according to a preset time interval, BFD Echo session packets including different source IP addresses to different member ports of the aggregation port respectively includes:
polling different member ports in the aggregation port according to a preset time interval, and sending the generated BFD Echo session message to the opposite terminal equipment through the polled member ports.
Optionally, in this embodiment, a polling period for polling different member ports is equal to a product of the number of polling ports and the preset time interval.
Optionally, in this embodiment, the detecting whether each member port receives the BFD Echo session packet returned by the peer device, and if so, determining that a communication link between the local device and the peer device is available includes:
detecting whether a BFD Echo session message returned by the opposite terminal equipment is received in the polling period;
and if the BFD Echo session message returned by the opposite terminal equipment is received, determining that a communication link between the local terminal equipment and the opposite terminal equipment is available.
In a second aspect, an embodiment of the present disclosure further provides a packet transmission device, which is applied to a processor of a home device, where the processor is configured to process a bidirectional forwarding detection BFD session packet, the home device further includes aggregation ports corresponding to a plurality of member ports, and the device includes:
a sending module, configured to send BFD Echo session packets including different source IP addresses to different member ports of the aggregation port according to a preset time interval, so that each member port sends the BFD Echo session packet to an opposite-end device, where the different source IP addresses and the IP address of the local-end device belong to the same network segment;
and the processing module is used for determining that a communication link between the local terminal equipment and the opposite terminal equipment is available if the BFD Echo session message returned by the opposite terminal equipment is received by the different member ports.
Optionally, in an embodiment of the present disclosure, the apparatus further includes:
and the message generation module is used for polling the network segment to which the IP address of the local terminal equipment belongs, generating the BFD Echo session message by taking the network segment address obtained by polling as a source IP address, wherein the source IP addresses contained in the BFD Echo messages generated in two adjacent times are different from each other.
Optionally, in this embodiment of the present disclosure, the sending module is specifically configured to:
polling different member ports in the aggregation port according to the preset time interval, and sending the generated BFD Echo session message to the opposite terminal equipment through the polled member ports.
Optionally, in this embodiment of the present disclosure, a polling period for polling different member ports is equal to a product of the number of polling ports and the preset time interval.
Optionally, in an embodiment of the present disclosure, the processing module is specifically configured to:
detecting whether a BFD Echo session message returned by the opposite terminal equipment is received in the polling period;
and if the BFD Echo session message returned by the opposite terminal equipment is received, determining that a communication link between the local terminal equipment and the opposite terminal equipment is available.
In a third aspect, an embodiment of the present disclosure further provides a readable storage medium, where the readable storage medium includes a computer program, and the computer program controls, when running, the local device where the readable storage medium is located to execute the message transmission method in the first aspect.
In a fourth aspect, an embodiment of the present disclosure further provides a home device, where the home device includes a processor configured to process a bidirectional forwarding detection BFD session packet, aggregation ports corresponding to multiple member ports, and a nonvolatile memory in which computer instructions are stored, and when the computer instructions are executed by the processor, the packet transmission method according to the first aspect is implemented.
Compared with the prior art, the method has the following beneficial effects:
the embodiment of the disclosure provides a message transmission method, a device, a local device and a readable storage medium, which respectively send a BFD Echo session message to a plurality of member ports of an aggregation port, and determine whether a communication link between the local device and an opposite device is available by detecting whether the BFD Echo session message returned by the opposite device is received, and when one of the member ports is unavailable, transmit the BFD Echo session message by using communication links corresponding to other member ports. The BFD session oscillation caused by the failure of the member port for sending the BFD session message in the prior art can be avoided.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present disclosure and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings may be obtained from the drawings without inventive effort.
Fig. 1 is a schematic view of an application scenario provided by an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a method for transmitting a message according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a message transmission apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of another packet transmission apparatus according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present disclosure, it should also be noted that, unless otherwise explicitly specified or limited, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present disclosure can be understood in specific instances by those of ordinary skill in the art.
In the prior art, when network devices communicate with each other through an aggregation port, only one member port in the aggregation port is used for sending a BFD session packet, and when the member port fails (a failure of the member port itself or a failure of a communication link where the member port is located), the port sending the BFD session packet is switched to another member port in the aggregation port. The above-mentioned process of port switching takes a long time, and BFD session oscillation may be caused.
BFD supports two session types: one is a Control session mode and the other is an Echo session mode. The Control session is that the two ends of the communication link establish BFD session by periodically sending Control messages, and the communication link is detected; the Echo session is that one end establishes a BFD Echo session message, the opposite end does not process the message, but only forwards the message back, and detects a communication link according to whether a sending end can receive the BFD Echo session message or not.
For the BFD Echo session packet, if the detected communication link is an aggregation link and has multiple member ports, when the BFD Echo session packet is switched back from the opposite end, because the source IP addresses of the BFD Echo session packet are the same, the BFD Echo session packet cannot be shared to different member ports, only one member port can transmit the BFD Echo session packet, when the member port fails, the BFD session may oscillate, thereby resulting in a blocked forwarding path and finally a large amount of service packets are lost.
In order to solve the technical problem of BFD session oscillation caused by member port failure in the prior art, a processing mode is to configure a BFD session for an aggregation port, specifically, at least two member ports can be selected from the aggregation port to send BFD messages in turn by using a polling packet sending mode. However, the sent BFD Echo session messages have the same information of five tuples (source IP address, source port number, destination IP address, destination port number, protocol number), so the BFD Echo session messages forwarded back from the opposite end cannot be shared by different member ports, and when the ports are switched due to failure, the BFD oscillation problem still exists.
Based on this, the applicant provides the following solutions for solving the above technical problems.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario provided in the present disclosure. In this application scenario, the home device 1 communicates with the peer device 2. The home terminal device 1 includes a main control board 11, a forwarding chip 12 and a service board. The number of the service boards may be arbitrarily set according to needs, and in this embodiment, the scheme provided by the embodiment of the present disclosure is described by taking the number of the service boards as 3 as an example, in this example, the three service boards are the service board 1, the service board 2, and the service board 3, respectively. The port a of the service board 1, the port B of the service board 2, and the port C of the service board 3 are member ports of the same aggregation port. The aggregation port is also called port aggregation, also called ethernet Channel (ethernet Channel), and is mainly used for connection between switches, and the aggregation port is a logical port formed by binding a plurality of member ports together, and the aggregation port can be regarded as one port for use. In this embodiment, the aggregation port may further include a binding port and an MP (Multi-Link PPP) port.
The main control board 11 includes a processor 110, in this embodiment, the processor 110 may be an Operation Administration and Maintenance Central Processing Unit (OAMCPU), and the processor 110 is configured to select one service board from a plurality of service boards corresponding to an aggregation port, and send a BFD Echo session packet to the selected service board at regular time. For example, if the service board currently selected by the processor 110 is the service board 1, the processor 110 will send the BFD Echo session message to the service board 1 at regular time (for example, every 100ms), and the service board 1 sends the BFD Echo session message to the peer device 2 through the port on the service board.
The forwarding chip 12 of the local device 1 includes a port X, where the port X is a port between the forwarding chip 12 and the processor 110, and the forwarding chip 12 is configured to send a BFD Echo session packet received from the port on the service board to the processor 110, and the processor 110 processes the BFD Echo session packet.
The main control board 11 may further include a memory 120, the memory 120 may store the message transmission device 30, and the message transmission device 30 includes at least one software function module that may be stored in the memory 120 in a form of software or firmware (firmware) or solidified in an Operating System (OS) of the local device 1. The processor 110 is used to execute executable modules stored in the memory 120, such as software functional modules and computer programs included in the message transmission device 30.
The peer device 2 and the home device 1 may have the same structure, and only the hardware structure of the peer device 2 related to the present disclosure will be briefly described below. For example, the opposite end device 2 includes a service board and a forwarding chip 22, and corresponding to the local end device 1, the service board in the opposite end device 2 may also include 3 service boards, which are the service board 4, the service board 5, and the service board 6, respectively, but not limited thereto. The port a of the service board 4, the port b of the service board 5, and the port c of the service board 6 are also member ports of the same aggregation port.
The forwarding chip 22 of the opposite terminal device 2 receives the BFD Echo session packet received by the port a, the port b, and the port c, and forwards the BFD Echo session packet from the port receiving the session packet back to the local terminal device 1 by redirection.
It should be understood that the structure shown in fig. 1 is only an illustration, and the local device 1 or the peer device 2 may also include more or less components than those shown in the figure, or have a different configuration than that shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
Referring to fig. 2, fig. 2 is a flowchart of a message transmission method according to an embodiment of the disclosure. The various steps involved in the process are set forth in greater detail below.
Step S210, the processor 110 of the local device 1 sends the BFDEcho session packets including different source IP addresses to the member ports of the aggregation port respectively according to a preset time interval.
In this embodiment, the processor 110 uses a port transmission manner to periodically transmit the BFD Echo session packet at a preset time interval, and since the aggregation port includes a plurality of member ports, the processor 110 will transmit the BFD Echo session packet to the service board where the corresponding member port is located, and the service board where each member port is located transmits the BFD Echo session packet to the opposite terminal device 2 through each corresponding member port.
Specifically, referring again to fig. 1, the processor 110 sends a BFD Echo session message through the member port a, the member port B, and the member port C in the aggregation port. The processor 110 first needs to send BFD Echo session packets to the service board 1, the service board 2, and the service board 3 respectively according to a preset time interval, and then the port a on the service board 1 sends the BFD Echo session packets to the service board 4 of the peer device 2, the port B on the service board 2 sends the BFD Echo session packets to the service board 5 of the peer device 2, and the port C on the service board 3 sends the BFD Echo session packets to the service board 6 of the peer device 2. In this embodiment, assuming that the time when the processor 110 sends the BFD Echo session packet through the member port a is t and the preset time interval is 100ms, the time when the processor 110 sends the BFD Echo session packet to the member port B is t +100ms, the time when the processor 110 sends the BFD Echo session packet to the member port C is t +200ms, the time when the processor 110 sends the BFDEcho session packet to the member port a again is t +300ms, the time when the processor 110 sends the BFD Echo session packet to the member port B again is t +400ms, the time when the processor 110 sends the BFD Echo session packet to the member port C again is t +500ms, and so on, the BFD Echo session packet is sent in round-flow circulation on the member port A, B, C.
Of course, it is understood that, in the embodiment of the present disclosure, the processor 110 may also send the BFD Echo session message in other manners according to the preset time interval. For example, the processor 110 randomly selects a sending port from the port a, the port B, and the port C to send the BFD Echo session packet, and only needs to ensure that the sending ports of two adjacent sending ports are not consistent. The time when the processor 110 sends the BFD Echo session packet through the member port a is t, the time when the processor 110 sends the BFD Echo session packet to the member port C is t +100ms, the time when the processor 110 sends the BFD Echo session packet to the member port B is t +200ms, and the time when the processor 110 sends the BFD Echo session packet to the member port C again is t +300 ms.
In this embodiment, to ensure that the BFD Echo session messages can be sent through different member ports, the BFDEcho session messages are returned through the reverse channel. And adjusting the message structure of the BFD Echo session message, and specifically, changing the source IP address of the BFD Echo session message. So that the BFD Echo session messages sent twice adjacently have different source IP addresses.
Since the BFD Echo session packet can only detect the failure of the direct connection network segment, in this embodiment, the network segment address may be selected as the source IP address of the BFD Echo session packet in the same network segment (e.g., 2.1.0.0-2.1.255.255) as the home device 1 and the peer device 2.
Before step S210, the method further includes generating a BFD Echo session message. As described above, it can be known that the BFD Echo session packet can be generated by using the network segment addresses in the same network segment as the home terminal apparatus 1 and the peer terminal apparatus 2 as the source IP addresses. Specifically, the generation of the BFD Echo session packet may be implemented by:
in the first embodiment, the processor 110 obtains a network segment IP address from the same network segment as the home device 1 in a polling manner, and configures the network segment IP address as a source IP address to generate a BFD Echo session packet. When the method is used for configuring the source IP address to generate the BFD Echo session packet, 256 × 256 (65536 network segment addresses) can be obtained by polling the primary network segment, and if only the local device 1 and the peer device 2 respectively occupy only 1 network segment address, 65534 network segment addresses can be available for configuring the source IP address by polling the primary network segment, that is, the processor 110 can generate the BFD Echo session packet with completely different 65534 source IP addresses by polling the primary network segment. Specifically, when the BFD Echo session packet is generated by using this method, a polling counter (assuming that the initial count of the counter is 0) may be set, and 1 is added to the counter every time the processor 110 polls once, and when the count of the counter reaches 65533, it indicates that the network segment has been polled, the counter is cleared, the processor 110 polls the network segment again to obtain the source IP address, and generates different BFD Echo session packets according to the source IP address.
In a second embodiment, the processor 110 may obtain, from the same network segment as the home device 1, a plurality of different network segment IP addresses with the same number of ports as the source IP address to generate a BFD Echo session packet. Referring to fig. 1, where fig. 1 includes 3 member ports, the processor 110 may obtain 3 different network segment addresses, for example, 2.1.128.1, 2.1.128.2, and 2.1.128.3, and establish a corresponding relationship between the BFD Echo session packet and the port of the different source IP addresses. For example, a BFDEcho session message with a source IP of 2.1.128.1 corresponds to port a, and the BFD Echo session message can only be sent from port a; a BFD Echo session message with the source IP of 2.1.128.2 corresponds to the port B, and the BFD Echo session message can only be sent from the port B; a BFD Echo session message with source IP of 2.1.128.3 corresponds to port C, which can only be sent from port C. Therefore, the generated BFD Echo session message can be distributed to different member ports to be sent through different source IP addresses.
It is understood that, in addition to the above-mentioned manner for generating the BFD Echo session packet, the processor 110 may also include other manners as long as the BFD Echo session packet is sent to the peer device 2 through different ports and returned from the peer device 2.
Step S220, when receiving the BFD Echo session packet sent by the local device 1, the opposite device 2 forwards the BFD Echo session packet back to the local device 1.
The forwarding chip 22 in the peer device 2 receives, at its port a, the BFDEcho session packet sent by the home device 1 through the port a, and specifically, the BFD Echo session packet is sent to the service board 4 of the peer device 2 through the service board 1 of the home device 1 through the port a, and the service board 4 forwards the BFD Echo session packet to the forwarding chip 22. Similarly, the forwarding chip 22 in the opposite-end device 2 receives, at its port B, the BFDEcho session packet sent by the local-end device 1 through the port B; the forwarding chip 22 in the peer device 2 receives, at its port C, the BFD Echo session packet sent by the local device 1 through the port C.
Since the destination IP address of the BFD Echo session packet is the IP address of the sending port, the forwarding chip 22 forwards the BFD Echo session packet back to the local device 1 in the reverse direction through the communication link receiving the BFD Echo session packet after receiving the BFD Echo session packet. Taking the BFD Echo session message sent from port a as an example, after receiving the BFD Echo session message, the forwarding chip 22 of the peer device 2 forwards the BFD Echo session message back from port a of the service board 4 according to the destination IP address of the BFD Echo session message, and receives the BFD Echo session message from port a of the service board 1 in the home device 1.
In step S230, when the forwarding chip 12 of the local device 1 receives the BFD Echo session packet forwarded back from the peer device 2, it sends the BFD Echo session packet to the processor 110.
The forwarding chip 12 of the local device 1 redirects the received BFD Echo session packet to the port X of the forwarding chip 12, and sends the BFD Echo session packet to the processor 110 through the port X.
Step S240, the processor 110 of the local device 1 determines whether the communication link between the local device 1 and the opposite device 2 is available according to whether each member port receives the BFD Echo session packet returned by the opposite device 2.
In this embodiment, the processor 110 detects whether a returned BFD Echo session message is received within a preset time period.
Specifically, the preset time period may be a polling period when the processor 110 transmits the BFD Echo session packet between the ports of the local device 1 in a polling manner, where the polling period is equal to a product of the number of polling ports and the preset time interval.
If receiving a BFD Echo session message returned by the opposite terminal device 2, determining that a communication link between the local terminal device 1 and the opposite terminal device 2 is available, and determining a member port corresponding to the available communication link according to a source address of the returned BFD Echo session message, so that the local terminal device 1 sends the BFD Echo session message through the member port corresponding to the available communication link; and if the BFD Echo session message returned by the opposite terminal equipment 2 is not received, determining that the communication link between the local terminal equipment 1 and the opposite terminal equipment 2 is unavailable.
Specifically, the processor 110 may determine the communication state between the local device 1 and the opposite device 2 according to the number of the BFD Echo session messages sent in the polling cycle and the number of the returned bfdechio session messages, and may determine an available member port or a corresponding communication link according to a source address of the returned BFD Echo session message when a communication link where a certain member port or a member port is located fails. And the service message is sent through the available member port, so that the problems of BFD session oscillation caused by port failure and a large amount of message loss caused by the BFD session oscillation are solved.
In the method, the plurality of member ports of the aggregation port respectively send the BFD Echo session message, and whether the communication link between the local terminal device 1 and the opposite terminal device 2 is available is determined by detecting whether the BFD Echo session message returned by the opposite terminal device 2 is received. And when one member port is unavailable, the communication links corresponding to other member ports are adopted to transmit the BFD Echo session message. The method can avoid BFD session oscillation possibly caused by the failure of a member port for sending the BFD session message in the prior art.
Referring to fig. 3, an embodiment of the present disclosure further provides a message transmission device 30, which is applied to a processor 110 of a home device 1, where the processor 110 is configured to process a BFD session message, the home device 1 further includes aggregation ports corresponding to a plurality of member ports, and the message transmission device 30 includes a sending module 301 and a processing module 302.
The sending module 301 is configured to send BFD Echo session packets including different source IP addresses to different member ports of the aggregation port according to a preset time interval, so that each member port sends the BFD Echo session packet to the peer device 2, where the different source IP addresses and the IP address of the peer device 1 belong to the same network segment.
In this embodiment, the sending module 301 sends the BFDEcho session packet at regular time intervals in a port sending manner, and since the aggregation port includes a plurality of member ports, the processor 110 will send the BFD Echo session packet to the service board where the corresponding member port is located, and the service board where each member port is located sends the BFD Echo session packet to the opposite terminal device 2 through each corresponding member port.
The sending module 301 may specifically poll different member ports in the aggregation port according to a preset time interval, and send the generated BFD Echo session packet to the peer device 2 through the polled member ports.
In this embodiment, the polling period for polling the different member ports is equal to the product of the number of polling ports and the preset time interval.
The processing module 302 is configured to detect whether each member port receives a BFD Echo session packet returned by the peer device 2, and if so, consider that a communication link between the local device 1 and the peer device 2 is available.
Referring to fig. 4, the message transmission apparatus 30 may further include a message generation module 303, configured to poll a network segment to which the IP address of the local device 1 belongs, and generate the BFD Echo session message by using the network segment address obtained through polling as a source IP address, where source IP addresses included in two adjacent generated BFD Echo messages are different from each other.
In this embodiment, the processing module 302 is further configured to detect whether a BFD Echo session packet returned by the peer device 2 is received in the polling period; if the BFD Echo session message returned by the opposite terminal equipment 2 is detected, judging that a communication link between the local terminal equipment 1 and the opposite terminal equipment 2 is available; if the BFDEcho session packet returned by the opposite terminal device 2 is not detected, it is determined that the communication link between the local terminal device 1 and the opposite terminal device 2 is unavailable.
Specifically, the processing module 302 may determine the communication state between the local device 1 and the opposite device 2 according to the number of the BFD Echo session messages sent and the number of the BFD Echo session messages returned in the polling cycle, and when a communication link where a certain member port or a member port is located fails, may determine an available member port or a corresponding communication link according to a source address of the returned BFD Echo session message. And the service message is sent through the available member port, so that the problems of BFD session oscillation caused by port failure and a large amount of message loss caused by the BFD session oscillation are solved.
If the above functions are implemented in the form of software functional modules and sold or used as a separate product, they may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a corresponding device to perform all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
To sum up, the embodiments of the present disclosure provide a method and an apparatus for transmitting a packet, a home device, and a readable storage medium, where BFD Echo session packets are respectively sent to a plurality of member ports of an aggregation port, and whether a communication link between the home device and an opposite device is available is determined by detecting whether a BFD Echo session packet returned by the opposite device is received, and when one of the member ports is unavailable, the communication link corresponding to another member port is used to transmit the BFD Echo session packet. The BFD session oscillation caused by the failure of the member port for sending the BFD session message in the prior art can be avoided.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (12)

1. A message transmission method is characterized in that the message transmission method is applied to a processor of a local terminal device, the processor is used for processing Bidirectional Forwarding Detection (BFD) session messages, the local terminal device further comprises aggregation ports corresponding to a plurality of member ports, and the method comprises the following steps:
sending BFD Echo session messages including different source IP addresses to different member ports of the aggregation port respectively according to a preset time interval so that each member port sends the BFD Echo session messages to opposite-end equipment respectively, wherein the different source IP addresses and the IP address of the local-end equipment belong to the same network segment;
and detecting whether each member port receives a BFD Echo session message returned by the opposite terminal equipment, and if so, determining that a communication link between the local terminal equipment and the opposite terminal equipment is available.
2. The method according to claim 1, wherein before the BFD Echo session messages including different source IP addresses are respectively sent to different member ports of the aggregation port at preset time intervals, the method comprises:
polling the network segment to which the IP address of the local terminal equipment belongs, and generating the BFD Echo session message by taking the network segment address obtained by polling as a source IP address, wherein the source IP addresses contained in the BFD Echo messages generated in two adjacent times are different from each other.
3. The method according to claim 2, wherein the sending the BFD Echo session messages including different source IP addresses to different member ports of the aggregation port according to a preset time interval comprises:
polling different member ports in the aggregation port according to a preset time interval, and sending the generated BFD Echo session message to the opposite terminal equipment through the polled member ports.
4. The method of claim 3, wherein a polling period for polling different member ports is equal to a product of a number of polling ports and the preset time interval.
5. The method according to claim 4, wherein the detecting whether each member port receives the BFD Echo session packet returned by the opposite end device, and if so, considering that the communication link between the local end device and the opposite end device is available includes:
detecting whether a BFD Echo session message returned by the opposite terminal equipment is received in the polling period;
and if the BFD Echo session message returned by the opposite terminal equipment is received, determining that a communication link between the local terminal equipment and the opposite terminal equipment is available.
6. A message transmission device is characterized in that the device is applied to a processor of a home terminal device, the processor is used for processing Bidirectional Forwarding Detection (BFD) session messages, the home terminal device further comprises aggregation ports corresponding to a plurality of member ports, and the device comprises:
a sending module, configured to send BFD Echo session packets including different source IP addresses to different member ports of the aggregation port according to a preset time interval, so that each member port sends the BFD Echo session packet to an opposite-end device, where the different source IP addresses and the IP address of the local-end device belong to the same network segment;
and the processing module is used for detecting whether each member port receives the BFD Echo session message returned by the opposite terminal equipment, and if so, determining that a communication link between the local terminal equipment and the opposite terminal equipment is available.
7. The apparatus of claim 6, wherein the apparatus further comprises:
and the message generation module is used for polling the network segment to which the IP address of the local terminal equipment belongs, generating the BFD Echo session message by taking the network segment address obtained by polling as a source IP address, wherein the source IP addresses contained in the BFD Echo messages generated in two adjacent times are different from each other.
8. The apparatus of claim 7, wherein the sending module is specifically configured to:
polling different member ports in the aggregation port according to the preset time interval, and sending the generated BFD Echo session message to the opposite terminal equipment through the polled member ports.
9. The apparatus of claim 8, wherein a polling period for polling different member ports is equal to a product of a number of polling ports and the preset time interval.
10. The apparatus of claim 9, wherein the processing module is specifically configured to:
detecting whether a BFD Echo session message returned by the opposite terminal equipment is received in the polling period;
and if the BFD Echo session message returned by the opposite terminal equipment is received, determining that a communication link between the local terminal equipment and the opposite terminal equipment is available.
11. A local device, characterized in that the local device includes a processor for processing Bidirectional Forwarding Detection (BFD) session packets, an aggregation port corresponding to a plurality of member ports, and a nonvolatile memory storing computer instructions, and when the computer instructions are executed by the processor, the message transmission method according to any one of claims 1 to 5 is implemented.
12. A readable storage medium, comprising a computer program, which, when executed, controls a processor of a local device in which the readable storage medium is located to execute the message transmission method according to any one of claims 1 to 5.
CN201811152358.0A 2018-09-29 2018-09-29 Message transmission method and device, home terminal equipment and readable storage medium Active CN109194547B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811152358.0A CN109194547B (en) 2018-09-29 2018-09-29 Message transmission method and device, home terminal equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811152358.0A CN109194547B (en) 2018-09-29 2018-09-29 Message transmission method and device, home terminal equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN109194547A CN109194547A (en) 2019-01-11
CN109194547B true CN109194547B (en) 2020-06-16

Family

ID=64908064

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811152358.0A Active CN109194547B (en) 2018-09-29 2018-09-29 Message transmission method and device, home terminal equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN109194547B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109889411B (en) * 2019-03-22 2020-09-11 新华三技术有限公司 Data transmission method and device
CN110086690B (en) * 2019-04-30 2021-06-15 新华三技术有限公司 Bidirectional forwarding detection method and device, electronic equipment and readable storage medium
CN110620739B (en) * 2019-07-25 2021-09-21 新华三技术有限公司成都分公司 BFD message sending method and device
CN111654406B (en) * 2020-02-29 2022-08-30 新华三信息安全技术有限公司 Bidirectional forwarding detection method and device
CN113840016A (en) * 2020-06-23 2021-12-24 中兴通讯股份有限公司 Message processing method and device and computer readable storage medium
CN112804116B (en) * 2020-06-30 2023-02-17 中兴通讯股份有限公司 Link detection method, electronic device and computer readable medium
CN114285765A (en) * 2020-09-18 2022-04-05 中兴通讯股份有限公司 Link failure detection method, device and computer readable storage medium
CN113225252B (en) * 2021-07-09 2022-02-15 腾讯科技(深圳)有限公司 Establishment method, processing method and related equipment for Bidirectional Forwarding Detection (BFD) session
CN115065626A (en) * 2022-05-07 2022-09-16 苏州盛科通信股份有限公司 Source port checking method and device in Micro-BFD, electronic equipment and storage medium
CN115277509B (en) * 2022-06-15 2023-07-11 深圳市楠菲微电子有限公司 Method and system for rapidly detecting faults of link aggregation group

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103248567B (en) * 2013-04-26 2016-12-28 杭州华三通信技术有限公司 A kind of BFD session message transmitting method and equipment
CN107306193B (en) * 2016-04-18 2020-11-27 中兴通讯股份有限公司 Switch port information sensing method and device based on SDN network and terminal equipment

Also Published As

Publication number Publication date
CN109194547A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
CN109194547B (en) Message transmission method and device, home terminal equipment and readable storage medium
US9270524B2 (en) Method and device for LACP link switching and data transmission
US7027406B1 (en) Distributed port-blocking method
CN109344014B (en) Main/standby switching method and device and communication equipment
CN107070689B (en) Method and apparatus for reducing false alarms when using network keep-alive messages
KR101591102B1 (en) Method for router of virtual router redundancy protocol and communication system therefor
US8804486B2 (en) Base stations routing traffic over a packet backhaul network to multiple routing elements
CN108632099B (en) Fault detection method and device for link aggregation
CN105453487A (en) Extending virtual station interface discovery protocol (VDP) and VDP-like protocols for dual-homed deployments in data center environments
EP2698948A1 (en) Method and device for determining failure elimination based on oam protocol
US10122618B2 (en) Path switching method and device
US20170214609A1 (en) Forwarding method and forwarding device
CN106603261B (en) Hot backup method, first main device, standby device and communication system
CN103227725A (en) Method and device for dual-server backup of firewall
CN109873719B (en) Fault detection method and device
CN101420381A (en) Method and apparatus for enhancing forwarding reliability in VRRP load balance
CN103607293A (en) Flow protection method and equipment thereof
CN113746733A (en) Table item synchronization method, gateway equipment, networking system and storage medium
CN106817267B (en) Fault detection method and equipment
KR20110046897A (en) Method to elect master nodes from nodes of a subnet
US10924341B2 (en) Communication device, communication method and communication system
CN112073270B (en) Link fault detection method and device
CN108206748B (en) Core network backup method applied to TD-LTE (time division-Long term evolution) Internet of things service isolation environment
CN111934939B (en) Network node fault detection method, device and system
CN112838982B (en) Message transmission path switching method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230627

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466

Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right