Communication method and device
By dynamically adjusting the LACP protocol message sending cycle to a short period during transceiver state and reverting to a long cycle post-handshake, the method effectively reduces packet loss times and CPU load in Ethernet link aggregation.
Patent Information
- Application Number
- CN202211415595.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-11-11
AI Technical Summary
The existing LACP protocol message is discarded, leading to prolonged packet loss times due to its slow sending cycle, especially in cases of oscillation or CPU limitations.
Adjust the sending cycle of LACP protocol messages to a short cycle when a port enters a transceiver state, using a peer reception confirmation parameter or a timer to ensure timely synchronization, and revert to a long cycle after handshake completion to reduce CPU load.
This approach significantly shortens packet loss times and reduces CPU load by temporarily adjusting the LACP protocol message sending cycle, addressing the inefficiencies of the standard protocol.
Smart Images

Figure CN115733798B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a communication method and device. Background Art
[0002] At present, Ethernet link aggregation specifically bundles multiple Ethernet physical links together to form an Ethernet logical link, thereby achieving the purpose of increasing link bandwidth. At the same time, the bundled links can also dynamically back up each other, effectively improving the reliability of the link.
[0003] like Figure 1 As shown, Figure 1 Figure 1 is a schematic diagram of existing link aggregation. Network device A and network device B are connected via three Ethernet physical links. The three links are bundled together to generate a logical link, which is called link aggregation1. The maximum bandwidth of this logical link can be equal to the sum of the bandwidths of the three Ethernet physical links, which increases the bandwidth of the link; the three Ethernet physical links back up each other. When one of the physical links fails, the message can be forwarded through the other two physical links.
[0004] After multiple physical links generate link aggregation, the ports at both ends of the physical links will join the aggregation group and are called member ports in the aggregation group. Member ports have the following two states: Selected state: member ports in this state can participate in data forwarding, and member ports in this state are called "selected ports"; Unselected state: member ports in this state cannot participate in data forwarding, and member ports in this state are called "unselected ports".
[0005] Link Aggregation Control Protocol (LACP) is a protocol based on IEEE802.3ad standard for dynamic link aggregation and deaggregation. It is a commonly used protocol in link aggregation. LACP supports two modes of port receiving and sending messages: independent mode means that the port can independently control the state of receiving and sending packets, and can independently release the state of receiving packets and block the state of sending packets; associated mode means that the port cannot independently control the state of receiving and sending packets; for example, port release means that the state of receiving and sending packets is released at the same time; port blocking means that the port cannot receive or send packets.
[0006] The lacp protocol message includes multiple status bits (for example, LACP_Activity, Short_Timeout, Aggregation, Synchronization, Collecting, Distributing, Defaulted, and Expired), among which the Sync bit is used to indicate whether the port is in a synchronized state. During the process of exchanging lacp protocol messages between the two ends, when both the local port and the opposite port set the Sync bit to TRUE, the ports at both ends can enter the transceiver state and transmit and receive traffic.
[0007] At the same time, the IEEE802.3ad standard protocol also stipulates the state machine of the port sending and receiving messages: After the independent state machine enters the Attached state, the local port receives the Sync bit sent by the opposite end as TRUE, and the local port first enters the receiving (Collecting) state. After receiving the Collecting state sent by the opposite end again, the local port enters the sending (Distributing) state. In the above process, both ports first turn on the receiving function, and then turn on the sending function after the receiving functions of both ends are turned on, to ensure that there is no packet loss in the whole process; after the associated state machine enters the Attached state, the local port receives the Sync bit sent by the opposite end as TRUE, and the local port directly enters the Collecting_Distributing state, that is, the sending and receiving functions are released at the same time. In the above process, there must be a time difference between the two ports releasing the sending and receiving functions, resulting in packet loss.
[0008] In the association mode, after the ports at both ends are up, the network devices will exchange lac protocol messages (also called handshake messages). Under normal circumstances, the handshake at both ends will quickly stabilize, and the packet loss time is at most the time of a handshake message exchange (after the local port receives the Sync bit sent by the other end as TRUE, it selects the port and releases the port's transceiver function, and at the same time sends the local Sync bit to the other end as TRUE, and the other end releases the port's transceiver function after receiving it).
[0009] However, since the lacp protocol is a slow protocol (the lacp protocol is limited when it is enabled at the same time as other protocols, and no more than 10 messages can be sent per second), and in the case of oscillation, protocol messages including those whose Sync bit is TRUE on the local port may be discarded by the other end, resulting in the other end not receiving and releasing the port's transceiver function in time. The local end needs to wait until the next lacp protocol message sending cycle message before sending the lacp protocol message again. If the sending cycle of the lacp protocol message is a long cycle, the packet loss time will be close to 30S, which is too long. Summary of the invention
[0010] In view of this, the present application provides a communication method and device to solve the problem that after the existing LACP protocol message is discarded, the packet loss time is too long due to the long period of sending the LACP protocol message.
[0011] In a first aspect, the present application provides a communication method, the method being applied to a first network device, the first network device comprising a first port, the first port being a member port in an aggregation group, the method comprising:
[0012] If the first port enters the transceiver state, setting the peer reception confirmation parameter to the first mark;
[0013] According to the first mark, setting the sending period of the first port to a short period;
[0014] In the short cycle, a first LACP protocol message is sent to the second network device, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state.
[0015] In a second aspect, the present application provides a communication method, the method being applied to a first network device, the first network device comprising a first port, the first port being a member port in an aggregation group, the method comprising:
[0016] If the first port enters the transceiver state, a timer is started, and the timer has been configured with a timing time;
[0017] Within the timing time, a first LACP protocol message is sent to the second network device, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state.
[0018] In a third aspect, the present application provides a communication device, the device is applied to a first network device, the first network device includes a first port, the first port is a member port in an aggregation group, and the device includes:
[0019] A first setting unit, configured to set a peer reception confirmation parameter to a first mark if the first port enters a transceiver state;
[0020] a second setting unit, configured to set a sending period of the first port to a short period according to the first mark;
[0021] The sending unit is used to send a first LACP protocol message to the second network device within the short cycle, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver mark indicating that the first port enters a transceiver state.
[0022] In a fourth aspect, the present application provides a communication device, the device is applied to a first network device, the first network device includes a first port, the first port is a member port in an aggregation group, and the device includes:
[0023] A starting unit, configured to start a timer if the first port enters a transceiver state, the timer being configured with a timing time;
[0024] The sending unit is used to send a first LACP protocol message to the second network device within the timing time, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver mark indicating that the first port enters a transceiver state.
[0025] In a fifth aspect, the present application provides a network device, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the first aspect of the present application.
[0026] In a sixth aspect, the present application provides a network device, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the second aspect of the present application.
[0027] Therefore, using the communication method and device provided by the present application, if the first port enters the transceiver state, the first network device sets the opposite end reception confirmation parameter to a first mark; according to the first mark, the first network device sets the sending period of the first port to a short period; within the short period, the first network device sends a first LACP protocol message to the second network device, and the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver mark indicating that the first port enters the transceiver state.
[0028] In this way, under the pre-configured long cycle, the sending cycle of the LACP protocol message is temporarily adjusted to a short cycle, thereby greatly shortening the packet loss time. This solves the problem that after the existing LACP protocol message is discarded, the packet loss time is too long due to the long sending cycle of the LACP protocol message. At the same time, after the handshake between the two ends is completed, the local end can automatically adjust the sending cycle of the LACP protocol message to a long cycle again to reduce the CPU load. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of existing link aggregation;
[0030] Figure 2 A flow chart of a communication method provided in an embodiment of the present application;
[0031] Figure 3 A flowchart of another communication method provided in an embodiment of the present application;
[0032] Figure 4 A structural diagram of a communication device provided in an embodiment of the present application;
[0033] Figure 5 A structural diagram of another communication device provided in an embodiment of the present application;
[0034] Figure 6 The network device hardware structure provided in the embodiment of the present application. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0036] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more corresponding listed items.
[0037] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0038] A communication method provided in an embodiment of the present application is described in detail below. Figure 2 , Figure 2A flow chart of a communication method provided in an embodiment of the present application. The method is applied to a first network device. The communication method provided in an embodiment of the present application may include the following steps.
[0039] Step 210: If the first port enters the transceiver state, the peer reception confirmation parameter is set to a first mark;
[0040] Specifically, the first network device includes a first port, and the first port may be a member port added to the aggregation group. The administrator (or user) may first configure the mode of receiving and sending messages of the first port to be an association mode.
[0041] It is understandable that the second port included in the second network device is also added to the aggregation group. The administrator (or user) can first configure the mode of receiving and sending messages of the second port to be an independent mode or an associated mode.
[0042] After the first port and the second port are both up, the network devices will exchange LACP protocol messages (also called handshake messages). The network devices exchange LACP-activity protocol messages with each other, and the LACP-activity protocol messages include the Aggregation bit of each port, which identifies whether the link where the port is located can be aggregated. If the Aggregation bits of the ports at both ends are set to the first mark, the ports at both ends enter the ready state and are ready to be selected.
[0043] Optionally, before executing this step, the process also includes a process in which the first network device receives a second LACP protocol message sent by the second network device, so that the first port enters a transceiver state.
[0044] Further, the second port enters a ready state and is ready to be selected, and the administrator (or user) selects the second port to participate in the sending and receiving of the message. The second network device generates and sends a second LACP protocol message to the first network device. The second LACP protocol message includes a second Sync bit indicating that the second port included in the second network device is in a synchronized state. The second Sync bit is set to the first mark.
[0045] After receiving the second LACP protocol message, the first network device obtains the second Sync bit therefrom. The first network device identifies the second Sync bit as a first mark. According to the first mark, the first network device sets the first port to enter the transceiver state. According to the preconfigured long period, the first network device generates and sends a third LACP protocol message to the second network device. The third LACP protocol message includes the first Sync bit and the first transceiver mark.
[0046] The first Sync bit is used to indicate that the first port is in a synchronous state, and the first transceiver flag is used to indicate that the first port enters a transceiver (Collecting_Distributing) state.
[0047] In the embodiment of the present application, the preconfigured long period may be specifically 30 seconds, that is, after the first port enters the transceiver state, the first network device sends the third LACP protocol message to the second network device every 30 seconds.
[0048] In this step, after the first port enters the transceiver state, the first network device sets a partner receiving confirmation (partner_collecting_confirm) parameter to the first mark.
[0049] In the embodiment of the present application, the value of the first mark is specifically TRUE.
[0050] The first port has a MUX state machine, and when the first port enters the transceiver state, the MUX state machine sets the opposite end reception confirmation parameter to the first mark.
[0051] It should be noted that after the first port enters the transceiver state, the first network device generates and sends the third LACP protocol message to the second network device and the first network device sets the opposite end reception confirmation parameter to the first mark, which can be executed in parallel.
[0052] It is understandable that when the first network device sends the third LACP protocol message to the second network device according to the long cycle, the third LACP protocol message may be discarded by the CPU of the second network device. The reason is that the software system generally sets up protocol message anti-attack processing, and a certain type of message sent to the CPU will also be limited in speed. In the case of oscillation, the CPU may discard the last protocol message.
[0053] Optionally, if the first port exits the transceiver state; or the first port is not selected; or the second port is not selected, the MUX state machine sets the opposite end reception confirmation parameter to the second mark.
[0054] In the embodiment of the present application, the value of the second flag is specifically FALSE.
[0055] Step 220: according to the first mark, set the sending period of the first port to a short period;
[0056] Specifically, according to the description of step 210, after the first network device sets the opposite end reception confirmation parameter to the first mark, the first network device sets the sending period of the first port to a short period according to the first mark.
[0057] In the embodiment of the present application, the short period may specifically be 1 second.
[0058] The first port has a TX state machine, and according to the first mark, the TX state machine sets the transmission cycle of the first port to a short cycle.
[0059] It should be noted that when the first network device sets the transmission period of the first port to a short period, the first network device still sends the third LACP protocol message to the second network device according to the long period. It is understandable that the third LACP protocol message may be discarded by the CPU of the second network device.
[0060] Step 230: Send a first LACP protocol message to the second network device within the short cycle, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state.
[0061] Specifically, according to the description of step 220, after the first network device sets the transmission period of the first port to a short period, the first network device generates and sends a first LACP protocol message to the second network device within the short period. The first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state.
[0062] In this way, under the pre-configured long cycle, the sending cycle of the LACP protocol message is temporarily adjusted to a short cycle, thereby greatly shortening the packet loss time. This solves the problem that after the existing LACP protocol message is discarded, the packet loss time is too long due to the long sending cycle of the LACP protocol message. At the same time, after the handshake between the two ends is completed, the local end can automatically adjust the sending cycle of the LACP protocol message to a long cycle again to reduce the CPU load.
[0063] Optionally, in the embodiment of the present application, the process further includes the first network device restoring the sending cycle setting of the first port to a long cycle.
[0064] Specifically, in one implementation, if the first network device receives a fourth LACP protocol message sent by the second network device and the fourth LACP protocol message includes a second transceiver flag indicating that the second port enters a transceiver state, the first network device sets the opposite end reception confirmation parameter to the second flag; according to the second flag, the second network device sets the sending period of the first port to a long period.
[0065] In another implementation, if the first network device receives a fourth LACP protocol message sent by the second network device and the fourth LACP protocol message includes a receiving mark indicating that the second port enters a receiving (Collecting) state, the first network device sets the opposite end reception confirmation parameter to the second mark; according to the second mark, the first network device sets the sending period of the first port to a long period.
[0066] In the embodiment of the present application, the value of the second flag is specifically FALSE.
[0067] The first port has an RX state machine, and according to the second mark, the RX state machine sets the sending cycle of the first port to a long cycle.
[0068] In this way, after the first network device determines that the second port enters the transceiver state or the receiving state, the short cycle can be restored to the long cycle to reduce the CPU load.
[0069] Another communication method provided by the embodiment of the present application is described in detail below. Figure 3 , Figure 3 A flowchart of another communication method provided in an embodiment of the present application. The method is applied to a first network device. The communication method provided in an embodiment of the present application may include the following steps.
[0070] Step 310: If the first port enters the transceiver state, start a timer, and the timer has been configured with a timing time;
[0071] Specifically, the first network device includes a first port, and the first port may be a member port added to the aggregation group. The administrator (or user) may first configure the mode of receiving and sending messages of the first port to be an association mode.
[0072] It is understandable that the second port included in the second network device is also added to the aggregation group. The administrator (or user) can first configure the mode of receiving and sending messages of the second port to be an independent mode or an associated mode.
[0073] After the first port and the second port are both up, the network devices will exchange LACP protocol messages (also called handshake messages). The network devices exchange LACP-activity protocol messages with each other, and the LACP-activity protocol messages include the Aggregation bit of each port, which identifies whether the link where the port is located can be aggregated. If the Aggregation bits of the ports at both ends are set to the first mark, the ports at both ends enter the ready state and are ready to be selected.
[0074] Optionally, before executing this step, the process also includes a process in which the first network device receives a second LACP protocol message sent by the second network device, so that the first port enters a transceiver state.
[0075] Further, the second port enters a ready state and is ready to be selected, and the administrator (or user) selects the second port to participate in the sending and receiving of the message. The second network device generates and sends a second LACP protocol message to the first network device. The second LACP protocol message includes a second Sync bit indicating that the second port included in the second network device is in a synchronized state. The second Sync bit is set to the first mark.
[0076] After receiving the second LACP protocol message, the first network device obtains the second Sync bit therefrom. The first network device identifies the second Sync bit as a first mark. According to the first mark, the first network device sets the first port to enter the transceiver state. According to the preconfigured long period, the first network device generates and sends a third LACP protocol message to the second network device. The third LACP protocol message includes the first Sync bit and the first transceiver mark.
[0077] The first Sync bit is used to indicate that the first port is in a synchronous state, and the first transceiver flag is used to indicate that the first port enters a transceiver (Collecting_Distributing) state.
[0078] In the embodiment of the present application, the preconfigured long period may be specifically 30 seconds, that is, after the first port enters the transceiver state, the first network device sends the third LACP protocol message to the second network device every 30 seconds.
[0079] In this step, after the first port enters the transceiver state, the first network device starts a timer, and the timer is configured with a timing time.
[0080] In the embodiment of the present application, the value of the first mark is specifically TRUE. The timing time is 1 second.
[0081] It should be noted that after the first port enters the transceiver state, the first network device generates and sends the third LACP protocol message to the second network device and the first network device starts the timer, which can be executed in parallel.
[0082] It is understandable that when the first network device sends the third LACP protocol message to the second network device according to the long cycle, the third LACP protocol message may be discarded by the CPU of the second network device. The reason is that the software system generally sets up protocol message anti-attack processing, and a certain type of message sent to the CPU will also be limited in speed. In the case of oscillation, the CPU may discard the last protocol message.
[0083] In the embodiment of the present application, the value of a certain parameter is no longer modified by the state machine in the first port, but the first network device shortens the sending cycle of the LACP protocol message by starting a timer, thereby shortening the packet loss time.
[0084] Step 320: Send a first LACP protocol message to the second network device within the timing time, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state.
[0085] Specifically, according to the description of step 310, within the timing time, the first network device generates and sends a first LACP protocol message to the second network device. The first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state.
[0086] In the embodiment of the present application, the number of the first LACP protocol messages sent within the timing time can also be pre-configured, for example, 10. That is, 10 first LACP protocol messages are sent within 1 second.
[0087] In this way, under the pre-configured long cycle, the sending cycle of the LACP protocol message is temporarily adjusted to the scheduled time, thereby greatly shortening the packet loss time. This solves the problem that after the existing LACP protocol message is discarded, the packet loss time is too long due to the long sending cycle of the LACP protocol message. At the same time, after the handshake between the two ends is completed, the local end can automatically adjust the sending cycle of the LACP protocol message to a long cycle again to reduce the CPU load.
[0088] Optionally, in the embodiment of the present application, the process further includes the first network device restoring the sending cycle setting of the first port to a long cycle.
[0089] Specifically, in one implementation, if the first network device receives a fourth LACP protocol message sent by the second network device and the fourth LACP protocol message includes a second transceiver flag indicating that the second port enters a transceiver state, the first network device sets the opposite end reception confirmation parameter to the second flag; according to the second flag, the second network device sets the sending period of the first port to a long period.
[0090] In another implementation, if the first network device receives a fourth LACP protocol message sent by the second network device and the fourth LACP protocol message includes a receiving mark indicating that the second port enters a receiving (Collecting) state, the first network device sets the opposite end reception confirmation parameter to the second mark; according to the second mark, the first network device sets the sending period of the first port to a long period.
[0091] In the embodiment of the present application, the value of the second flag is specifically FALSE.
[0092] In this way, after the first network device determines that the second port enters the transceiver state or the receiving state, the short cycle can be restored to the long cycle to reduce the CPU load.
[0093] Based on the same inventive concept, the present application embodiment also provides a communication device corresponding to the communication method. Figure 4 , Figure 4 A communication device is provided in an embodiment of the present application, the device is applied to a first network device, the first network device includes a first port, the first port is a member port in an aggregation group, and the device includes:
[0094] A first setting unit 410 is configured to set a peer reception confirmation parameter to a first mark if the first port enters a transceiver state;
[0095] A second setting unit 420, configured to set a sending period of the first port to a short period according to the first mark;
[0096] The sending unit 430 is used to send a first LACP protocol message to the second network device within the short cycle, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state.
[0097] Optionally, the device further includes: a receiving unit (not shown in the figure), configured to receive a second LACP protocol message sent by the second network device, wherein the second LACP protocol message includes a second Sync bit indicating that the second port included in the second network device is in a synchronization state;
[0098] A third setting unit (not shown in the figure), configured to set the first port to enter a transceiver state according to the second Sync bit;
[0099] The sending unit 430 is further configured to send a third LACP protocol message to the second network device according to a preconfigured long cycle, where the third LACP protocol message includes the first Sync bit and the first transceiver flag.
[0100] Optionally, the first setting unit 410 is further configured to set the peer reception confirmation parameter to a second identifier if the receiving unit receives a fourth LACP protocol message sent by the second network device and the fourth LACP protocol message includes a second transceiver flag that identifies that the second port enters a transceiver state;
[0101] The second setting unit 420 is further configured to set the sending period of the first port to a long period according to the second flag.
[0102] Optionally, the first setting unit 410 is further configured to set the peer reception confirmation parameter to a second identifier if the receiving unit receives a fourth LACP protocol message sent by the second network device and the fourth LACP protocol message includes a reception flag indicating that the second port enters a receiving state;
[0103] The second setting unit 420 is further configured to set the sending period of the first port to a long period according to the second flag.
[0104] Based on the same inventive concept, the present application embodiment also provides a communication device corresponding to the communication method. Figure 5 , Figure 5 Another communication device provided in an embodiment of the present application is applied to a first network device, the first network device includes a first port, the first port is a member port in an aggregation group, and the device includes:
[0105] A starting unit 510, configured to start a timer if the first port enters a transceiver state, the timer being configured with a timing time;
[0106] The sending unit 520 is used to send a first LACP protocol message to the second network device within the timing time, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state.
[0107] Optionally, the device further includes: a receiving unit (not shown in the figure), configured to receive a second LACP protocol message sent by the second network device, wherein the second LACP protocol message includes a second Sync bit indicating that the second port included in the second network device is in a synchronization state;
[0108] A first setting unit (not shown in the figure), configured to set the first port to enter a transceiver state according to the second Sync bit;
[0109] The sending unit 520 is further configured to send a third LACP protocol message to the second network device according to a preconfigured long cycle, where the third LACP protocol message includes the first Sync bit and the first transceiver flag.
[0110] Optionally, the device further includes: a closing unit (not shown in the figure), configured to close the timer if the receiving unit receives a fourth LACP protocol message sent by the second network device and the fourth LACP protocol message includes a second transceiver flag indicating that the second port enters a transceiver state;
[0111] The second setting unit (not shown in the figure) is used to set the sending period of the first port to the long period.
[0112] Optionally, the device further includes: a closing unit (not shown in the figure), configured to close the timer if the receiving unit receives a fourth LACP protocol message sent by the second network device and the fourth LACP protocol message includes a receiving mark indicating that the second port enters a receiving state;
[0113] The second setting unit (not shown in the figure) is used to set the sending period of the first port to the long period.
[0114] Therefore, using the communication device provided by the present application, if the first port enters the transceiver state, the first network device sets the opposite end reception confirmation parameter to the first mark; according to the first mark, the first network device sets the sending period of the first port to a short period; within the short period, the first network device sends a first LACP protocol message to the second network device, and the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver mark indicating that the first port enters the transceiver state.
[0115] In this way, under the pre-configured long cycle, the sending cycle of the LACP protocol message is temporarily adjusted to a short cycle, thereby greatly shortening the packet loss time. This solves the problem that after the existing LACP protocol message is discarded, the packet loss time is too long due to the long sending cycle of the LACP protocol message. At the same time, after the handshake between the two ends is completed, the local end can automatically adjust the sending cycle of the LACP protocol message to a long cycle again to reduce the CPU load.
[0116] Based on the same inventive concept, the embodiment of the present application also provides a network device, such as Figure 6 As shown, it includes a processor 610, a transceiver 620 and a machine-readable storage medium 630, the machine-readable storage medium 630 stores machine-executable instructions that can be executed by the processor 610, and the processor 610 is prompted by the machine-executable instructions to execute the communication method provided in the embodiment of the present application. Figure 4 , Figure 5 The communication device shown can be used as Figure 6 The network device hardware structure shown is implemented.
[0117] The computer-readable storage medium 630 may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the computer-readable storage medium 630 may also be at least one storage device located away from the processor 610.
[0118] The processor 610 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it 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 gates or transistor logic devices, or discrete hardware components.
[0119] In the embodiment of the present application, the processor 610 reads the machine executable instructions stored in the machine readable storage medium 630, and the machine executable instructions enable the processor 610 itself and call the transceiver 620 to execute the communication method described in the aforementioned embodiment of the present application.
[0120] In addition, an embodiment of the present application provides a machine-readable storage medium 630, which stores machine-executable instructions. When called and executed by the processor 610, the machine-executable instructions prompt the processor 610 itself and the calling transceiver 620 to execute the communication method described in the aforementioned embodiment of the present application.
[0121] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0122] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0123] As for the communication device and machine-readable storage medium embodiments, since the method contents involved are basically similar to the aforementioned method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0124] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A communication method, characterized in that: The method is applied to a first network device, the first network device includes a first port, the first port is a member port in an aggregation group, and the method includes: If the first port enters the transceiver state, setting the peer reception confirmation parameter to the first mark; According to the first mark, setting the sending period of the first port to a short period; In the short cycle, a first LACP protocol message is sent to the second network device, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state; If the first port enters the transceiver state, the opposite end reception confirmation parameter is set to before the first mark, and the method further includes: receiving a second LACP protocol message sent by the second network device, wherein the second LACP protocol message includes a second Sync bit indicating that a second port included in the second network device is in a synchronization state; According to the second Sync bit, setting the first port to enter a transceiver state; According to a preconfigured long cycle, a third LACP protocol message is sent to the second network device, where the third LACP protocol message includes the first Sync bit and the first transceiver flag.
2. The method according to claim 1, characterized in that: The method further comprises: If a fourth LACP protocol message sent by the second network device is received and the fourth LACP protocol message includes a second transceiver flag indicating that the second port enters a transceiver state, setting the opposite end reception confirmation parameter to a second flag; According to the second mark, the sending period of the first port is set to a long period.
3. The method according to claim 1, characterized in that The method further comprises: If a fourth LACP protocol message sent by the second network device is received and the fourth LACP protocol message includes a receiving mark indicating that the second port enters a receiving state, setting the opposite end reception confirmation parameter to a second mark; According to the second mark, the sending period of the first port is set to a long period.
4. A communication method, characterized in that: The method is applied to a first network device, the first network device includes a first port, the first port is a member port in an aggregation group, and the method includes: If the first port enters the transceiver state, a timer is started, and the timer has been configured with a timing time; Sending a first LACP protocol message to the second network device within the timing time, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state; If the first port enters the transceiver state, before starting the timer, the method further includes: receiving a second LACP protocol message sent by the second network device, wherein the second LACP protocol message includes a second Sync bit indicating that a second port included in the second network device is in a synchronization state; According to the second Sync bit, setting the first port to enter a transceiver state; According to a preconfigured long cycle, a third LACP protocol message is sent to the second network device, where the third LACP protocol message includes the first Sync bit and the first transceiver flag.
5. The method according to claim 4, characterized in that The method further comprises: If a fourth LACP protocol message sent by the second network device is received and the fourth LACP protocol message includes a second transceiver flag indicating that the second port enters a transceiver state, then turning off the timer; The sending period of the first port is set to the long period.
6. The method according to claim 4, characterized in that The method further comprises: If a fourth LACP protocol message sent by the second network device is received and the fourth LACP protocol message includes a receiving flag indicating that the second port enters a receiving state, then turning off the timer; The sending period of the first port is set to the long period.
7. A communication device, characterized in that: The apparatus is applied to a first network device, the first network device includes a first port, the first port is a member port in an aggregation group, and the apparatus includes: A first setting unit, configured to set a peer reception confirmation parameter to a first mark if the first port enters a transceiver state; a second setting unit, configured to set a sending period of the first port to a short period according to the first mark; A sending unit, configured to send a first LACP protocol message to the second network device within the short cycle, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state; The device further includes: a receiving unit, configured to receive a second LACP protocol message sent by the second network device, wherein the second LACP protocol message includes a second Sync bit indicating that a second port included in the second network device is in a synchronization state; a third setting unit, configured to set the first port to enter a transceiver state according to the second Sync bit; The sending unit is further configured to send a third LACP protocol message to the second network device according to a preconfigured long cycle, wherein the third LACP protocol message includes the first Sync bit and the first transceiver flag.
8. A communication device, characterized in that: The apparatus is applied to a first network device, the first network device includes a first port, the first port is a member port in an aggregation group, and the apparatus includes: A starting unit, configured to start a timer if the first port enters a transceiver state, the timer being configured with a timing time; A sending unit, configured to send a first LACP protocol message to the second network device within the timing time, wherein the first LACP protocol message includes a first Sync bit indicating that the first port is in a synchronization state and a first transceiver flag indicating that the first port enters a transceiver state; A receiving unit, configured to receive a second LACP protocol message sent by the second network device, wherein the second LACP protocol message includes a second Sync bit indicating that a second port included in the second network device is in a synchronization state; A first setting unit, configured to set the first port to enter a transceiver state according to the second Sync bit; The sending unit is further configured to send a third LACP protocol message to the second network device according to a preconfigured long cycle, wherein the third LACP protocol message includes the first Sync bit and the first transceiver flag.
