The disclosed embodiments relate to network communication, and in particular, to a method and apparatus for reducing service impairment in a Link Aggregation Group (LAG).
Link aggregation refers to aggregating multiple ports together to form a LAG.
Once the port state changes, the ports in the LAG increase or decrease accordingly, and the packet may reselect a sending port. When the packet reselects the sending port, no selection algorithm is defined clearly in the prior art, and the implementation method varies between manufacturers. Generally, the service packets are redistributed according to the current quantity of ports. Consequently, the services on all the ports are disrupted or the service packets are disordered. Some services originally not vulnerable to impact may also change the bearer port, and the services are affected excessively.
In order to relieve impairment of the services in link aggregation in the prior art in the case of adding or deleting physical ports, a method and apparatus for reducing service impairment in a LAG are provided consistent with some embodiments.
A method for reducing service impairment in a LAG includes:
An apparatus for reducing service impairment in a LAG is provided. The apparatus may include:
The technical solution under the embodiments brings the following benefits:
The disclosed embodiments are hereinafter described in detail with reference to exemplary embodiments and accompanying drawings, but the disclosed embodiments are not limited to the following embodiments.
In the disclosed embodiments, a service packet is divided into multiple service sub-flows, the service sub-flows are allocated to different physical ports averagely, and the service packet is sent out through the physical port corresponding to the service sub-flow. If the state of the physical port changes, namely, if a physical port needs to be added into or deleted from a LAG, the corresponding relation between the affected service sub-flow and the physical port may be modified.
A service packet corresponds to multiple service sub-flows according to the distribution algorithm. The distribution algorithm distributes the service sub-flows according to the destination MAC address field, source MAC address field or combination thereof in the Ethernet packet, or in other modes. The disclosed embodiments do not deal with the specific distribution algorithm.
In the initialization, one physical port is set in the LAG, and all service sub-flows are correlated with the physical port. After more physical ports are added, the corresponding relation between the physical port and the service sub-flow is shown in Table 1. If the total number of physical ports is n−(m % n), each port corresponds to m/n service sub-flows, where m % n means m modulus divided by n, and the result of m % n is the remainder of m divided by n. Moreover, among the m % n physical ports, each port corresponds to (m/n)+1 service sub-flows. In order to allocate the service packets among the ports evenly, the quantity of service sub-flows corresponding to one group of ports is one more or less than the quantity of service sub-flows corresponding to the other group of ports in this embodiment, which also applies to adding or deleting a physical port subsequently. However, such an allocation relation is not necessary, and it is also possible that the quantity of service sub-flows corresponding to one group of ports is over one more or less than the quantity of service sub-flows corresponding to the other group of ports.
Example: As shown in
Therefore, the corresponding relation between the service sub-flow and the physical port is as follows:
Each physical port has two service sub-flows. That is, service sub-flows D1 and D2 shown in
After one port is added (only one port can be added at a time), the corresponding relation between each port and each service sub-flow is shown in Table 2:
When a physical port is added in the LAG, the change of the existing corresponding relation between the physical port and the service sub-flow may be the minimum. The allocation begins with the port which contains many service sub-flows.
Step 101: The quantity of service sub-flows in the existing physical port is checked.
Step 102: A port is selected consecutively in a group of ports which contain many service sub-flows; a service sub-flow on the selected port is allocated to a newly added port; it is checked whether the quantity of service sub-flows in the newly added port reaches m/(n+1) every time after a service sub-flow is added; if the quantity of service sub-flows in the newly added port reaches m/(n+1) every time after a service sub-flow is added, the process is ended; otherwise, the process proceeds to step 103.
Step 103: It is judged whether the group of ports is traversed; and if the group of ports is traversed, the process proceeds to step 104; otherwise, the process returns to step 102.
Step 104: A service sub-flow is selected consecutively in a group of ports which have few service sub-flows, and the service sub-flow is allocated to the newly added port; if the quantity of the service sub-flows in the newly added port reaches m/(n+1), the process is ended; otherwise, the process proceeds to step 105.
Step 105: It is judged whether the group of ports is traversed; if the group of ports is traversed, the process proceeds to step 102; otherwise, the process returns to step 104.
After the service sub-flows are allocated, the service packet finds the corresponding forwarding physical port according to the service sub-flow so as to forward the packet.
Example: Taking the LAG in
As shown in
After multiple service sub-flows are allocated to the physical ports averagely, the maximum difference between the quantity of service sub-flows on one physical port and the quantity of service sub-flows on another physical port is 1.
If the total number of service sub-flows is m and the total number of physical ports is n+1, the preset quantity in a newly added port processing module may be an integer value equal to m divided by n+1.
After one port is deleted (only one port can be deleted at a time), the corresponding relation between each physical port and each service sub-flow is shown in Table 3:
The quantity of service sub-flows released by deleting a port may be m/n or (m/n)+1. As shown in
Step 201: The quantity of service sub-flows in the remaining physical port after a physical port is deleted is checked.
Step 202: A group of physical ports with few service sub-flows are selected, and the service sub-flows on the deleted physical port are allocated to the selected group of physical ports consecutively, where one service sub-flow is allocated to each physical port.
Step 203: It is checked whether the quantity of service sub-flows on the deleted physical port is 0: if the quantity of service sub-flows on the deleted physical port is 0, the process is ended; otherwise, the process proceeds to step 204.
Step 204: A group of physical ports with many service sub-flows are selected in the remaining physical ports after a physical port is deleted.
Step 205: The service sub-flows on the deleted physical port are allocated to a newly selected group of physical ports consecutively, where one service sub-flow is allocated to each physical port.
Step 206: It is checked whether the quantity of service sub-flows on the deleted physical port is 0; the quantity of service sub-flows on the deleted physical port is 0, the process is ended; otherwise, the process proceeds to step 202.
After the service sub-flows are allocated, the service packet finds the corresponding forwarding physical port according to the service sub-flow so as to forward the packet.
Example: Taking the LAG shown in
As shown in
After multiple service sub-flows are allocated by the initializing module to the physical ports averagely, the maximum difference between the quantity of service sub-flows on one physical port and the quantity of service sub-flows on another physical port is 1.
In the foregoing embodiments, a service packet is divided into multiple service sub-flows, and all the service sub-flows are allocated to all physical ports in a LAG averagely. Once a physical port is added or deleted, the affected service sub-flows may be operated, and the service packet searches for the port of forwarding the packet according to the service sub-flow, thus minimizing the impact on the service.
The traffic remains balanced in the operation process. If the quantity of service sub-flows is higher, the traffic corresponding to each service sub-flow is lower, fewer services are affected in the case of modifying the corresponding relation between the service sub-flow and the port, and the equilibrium is better.
Although the embodiments have been described through several preferred embodiments, the disclosed embodiments are not limited to such embodiments. It is apparent that those skilled in the art can make various modifications and variations to the disclosed embodiments without departing from the spirit and scope of the disclosure. The disclosed embodiments are intended to cover the modifications and variations provided that they fall in the scope of protection defined by the following claims or their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2007 1 0001192 | Jan 2007 | CN | national |
This application is a continuation of International Application No. PCT/CN2008/000155 filed Jan. 22, 2008, entitled “Method and Apparatus for Reducing Service Loss in a Link Aggregation Group,” which claims priority to the Chinese Patent Application No. 200710001192.8 entitled “Method and Apparatus for Reducing Service Impairment in Link Aggregation Group” filed with the Chinese Patent Office on Jan. 22, 2007, the entire content of both of which are incorporated herein by reference in their entirety.
Number | Name | Date | Kind |
---|---|---|---|
6646991 | Drottar et al. | Nov 2003 | B1 |
6934293 | DeJager et al. | Aug 2005 | B1 |
20040042502 | Drottar et al. | Mar 2004 | A1 |
20050160171 | Rabie et al. | Jul 2005 | A1 |
20060039384 | Sitaram et al. | Feb 2006 | A1 |
20060098573 | Beer et al. | May 2006 | A1 |
20070206501 | Alesi et al. | Sep 2007 | A1 |
20080151890 | Zelig et al. | Jun 2008 | A1 |
Number | Date | Country |
---|---|---|
1366402 | Aug 2002 | CN |
1553654 | Dec 2004 | CN |
1571354 | Jan 2005 | CN |
1725761 | Jan 2006 | CN |
101014005 | Aug 2007 | CN |
101014005 | Aug 2007 | CN |
1 713 213 | Oct 2006 | EP |
Number | Date | Country | |
---|---|---|---|
20090279564 A1 | Nov 2009 | US |
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2008/000155 | Jan 2008 | US |
Child | 12506580 | US |