Abstract:
A traffic forwarding method based on a virtual switch cluster is described. The method includes setting an aggregation group member list to store information about all the members of an aggregation group; setting an aggregation group traffic forwarding member list to store information of aggregation group members for forwarding traffic, wherein the list in an initial state only containing information about local members of the aggregation group; and when it is determined that traffic of a physical device exceeds the total bandwidth of the members in the aggregation group traffic forwarding member list or a threshold value related to the total bandwidth, selecting a nonlocal member from the aggregation group member list and adding the same into the aggregation group traffic forwarding member list, and forwarding traffic according to the changed aggregation group traffic forwarding member list. A traffic forwarding system based on a virtual switch cluster is also described. The disclosure can implement traffic forwarding in a virtual switch cluster scene on the premise of occupying limited bandwidth of a stack link as small as possible, thereby ensuring the traffic forwarding performance in the virtual switch cluster scene.

Description:
TECHNICAL FIELD 
       [0001]    The disclosure relates to the field of data communications, and more particularly to a traffic forwarding method and system based on a virtual switch cluster. 
       BACKGROUND 
       [0002]    A Virtual Switch Cluster (VSC) is application of a network virtualization technology, which is generally connecting multiple separately running physical devices to form a virtual united device through stack plates. These physical devices find each other through a topology protocol, and select a master device and slave devices according to a policy. There is only one master device in the VSC scene, and the other devices are slave devices. 
         [0003]    Because multiple physical devices are virtualized to become one device, ports on different physical devices may be aggregated into one logical port. An aggregation port may also be configured through a multi-port link aggregation command in the VSC scene, similar to in a single-device environment. 
         [0004]    However, the aggregation port in the single-device environment performs traffic sharing completely among all the member ports belonging to the aggregation group based on a hash policy set by users, and bandwidth for stack links among devices in a VSC environment is very limited, so the limitation of the bandwidth of stack links among devices should be considered for the traffic sharing of a cross-device aggregation link; if a traffic sharing policy in the single-device environment is applied to the VSC scene, and load sharing is still performed at all the member ports belonging to the aggregation group, the traffic forwarding performance is likely to be influenced due to the limited bandwidth of stack links. 
       SUMMARY 
       [0005]    In view of this, a traffic forwarding method and system based on a virtual switch cluster are provided, which ensure the traffic forwarding performance in a virtual switch cluster scene. 
         [0006]    To this end, a technical solution of the disclosure is implemented as follows. 
         [0007]    A traffic forwarding method based on a virtual switch cluster includes: respectively setting an aggregation group member list and an aggregation group traffic forwarding member list for a physical device in a virtual switch cluster, wherein the aggregation group member list stores information about all the members of an aggregation group, the aggregation group traffic forwarding member list stores information of aggregation group members for forwarding traffic of the physical device, and in an initial state the aggregation group traffic forwarding member list only contains information about local members of the aggregation group; 
         [0008]    the method further includes: when it is determined that the traffic of the physical device exceeds the total bandwidth of the members in the aggregation group traffic forwarding member list corresponding to the physical device or a threshold value related to the total bandwidth of the members in the aggregation group traffic forwarding member list, selecting a nonlocal member from the aggregation group member list and adding the selected nonlocal member into the aggregation group traffic forwarding member list, and forwarding traffic according to the changed aggregation group traffic forwarding member list. 
         [0009]    Selecting a nonlocal member from the aggregation group member list and adding the selected nonlocal member into the aggregation group traffic forwarding member list may include: 
         [0010]    acquiring a difference set between the aggregation group member list and the aggregation group traffic forwarding member list; and 
         [0011]    selecting at least one member of the aggregation group from the difference set and adding the selected at least one member of the aggregation group into the aggregation group traffic forwarding member list, wherein remaining bandwidth of the selected at least one member of the aggregation group is not smaller than that of any remaining member of the aggregation group in the difference set. 
         [0012]    The method further may include: 
         [0013]    when it is determined that the aggregation group traffic forwarding member list corresponding to the physical device contains a nonlocal member of the aggregation group, and the traffic forwarded from the nonlocal member of aggregation group is smaller than the sum of remaining bandwidth of all the members of the aggregation group except the nonlocal member of aggregation group in the aggregation group traffic forwarding member list, removing the nonlocal member of the aggregation group from the aggregation group traffic forwarding member list. 
         [0014]    The method further may include: 
         [0015]    when a failure occurs at a member of aggregation group, removing information of the member of the aggregation group from the aggregation group member list, or from the aggregation group member list and the aggregation group traffic forwarding member list. 
         [0016]    The method further may include: 
         [0017]    after the member of the aggregation group in failure returned to normal, and when it is determined that the member of the aggregation group is a local member of aggregation group of the physical device, adding the information of the member of the aggregation group into the aggregation group member list and the aggregation group traffic forwarding member list corresponding to the physical device; when it is determined that the member of the aggregation group is a nonlocal member of the aggregation group of the physical device, adding the information of the member of the aggregation group into the aggregation group member list corresponding to the physical device. 
         [0018]    A traffic forwarding system based on a virtual switch cluster includes a setting module, a traffic monitoring module, a traffic sharing module and a traffic forwarding module; wherein 
         [0019]    the setting module is configured to set an aggregation group member list and an aggregation group traffic forwarding member list; wherein the aggregation group member list stores information about all the members of an aggregation group, the aggregation group traffic forwarding member list stores information of members of the aggregation group member for forwarding traffic of a physical device, and in an initial state the aggregation group traffic forwarding member list only contains information about local members of the aggregation group; 
         [0020]    the traffic monitoring module is configured to determine the traffic of the physical device in the virtual switch cluster; 
         [0021]    the traffic sharing module is configured to, when the traffic of the physical device exceeds the total bandwidth of the members in the aggregation group traffic forwarding member list corresponding to the physical device or a threshold value related to the total bandwidth of the members in the aggregation group traffic forwarding member list, select a nonlocal member from the aggregation group member list and add the selected nonlocal member into the aggregation group traffic forwarding member list; and 
         [0022]    the traffic forwarding module is configured to forward traffic according to the changed aggregation group traffic forwarding member list. 
         [0023]    The traffic sharing module is configured to acquire a difference set between the aggregation group member list and the aggregation group traffic forwarding member list, and select at least one member of the aggregation group from the difference set and add the selected at least one member of the aggregation group into the aggregation group traffic forwarding member list, wherein remaining bandwidth of the selected at least one member of the aggregation group is not smaller than that of any remaining member of the aggregation group in the difference set. 
         [0024]    The system further may include an optimizing module, wherein the optimizing module is configured to, when it is determined that the aggregation group traffic forwarding member list corresponding to the physical device contains a nonlocal member of the aggregation group, and the traffic forwarded from the nonlocal member of the aggregation group is smaller than the sum of remaining bandwidth of all the members of the aggregation group except the nonlocal member of the aggregation group in the aggregation group traffic forwarding member list, remove the nonlocal member of the aggregation group from the aggregation group traffic forwarding member list. 
         [0025]    The system further may include a failure processing module, wherein the failure processing module is configured to, when a failure occurs at a member of the aggregation group, remove information of the member of the aggregation group from the aggregation group member list, or remove the information of the member of the aggregation group from the aggregation group member list and the aggregation group traffic forwarding member list. 
         [0026]    The failure processing module is further configured to, after the member of the aggregation group in failure returned to normal, and when it is determined that the member of the aggregation group is a local member of aggregation group of the physical device, add the aggregation group member information into the aggregation group member list and the aggregation group traffic forwarding member list corresponding to the physical device; the failure processing module is further configured to, when it is determined that the member of the aggregation group is a nonlocal member of the aggregation group of the physical device, add the information of the member of the aggregation group into the aggregation group member list corresponding to the physical device. 
         [0027]    The traffic forwarding method and system based on a virtual switch cluster according to the embodiments of the disclosure include: respectively setting an aggregation group member list and an aggregation group traffic forwarding member list for a physical device in the virtual switch cluster, wherein the aggregation group member list stores information about all the members of an aggregation group, the aggregation group traffic forwarding member list stores information of aggregation group members for forwarding traffic of the physical device, and the aggregation group traffic forwarding member list in an initial state only contains information about local members of the aggregation group; the traffic forwarding method and system based on a virtual switch cluster of the disclosure further include: when it is determined that the traffic of the physical device exceeds the total bandwidth of the members in the aggregation group traffic forwarding member list corresponding to the physical device or a threshold value related to the total bandwidth of the members in the aggregation group traffic forwarding member list, selecting a nonlocal member from the aggregation group member list and adding the same into the aggregation group traffic forwarding member list, and forwarding traffic according to the changed aggregation group traffic forwarding member list. The disclosure can implement traffic forwarding in a virtual switch cluster scene on the premise of occupying limited bandwidth of a stack link as small as possible, thereby ensuring the traffic forwarding performance in the virtual switch cluster scene. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0028]      FIG. 1  is a flowchart of a traffic forwarding method based on a virtual switch cluster according to an embodiment of the disclosure; 
           [0029]      FIG. 2  is a structure diagram of a traffic forwarding system based on a virtual switch cluster according to an embodiment of the disclosure; 
           [0030]      FIG. 3  is a structure diagram of a traffic forwarding system based on a virtual switch cluster in another embodiment of the disclosure; 
           [0031]      FIG. 4  is a structure diagram of a traffic forwarding system based on a virtual switch cluster in a still another embodiment of the disclosure; 
           [0032]      FIG. 5  is a diagram of a traffic forwarding policy in an initial state and when traffic does not exceed the total bandwidth of local members of an aggregation group in an embodiment of the disclosure; 
           [0033]      FIG. 6  is a diagram of a traffic forwarding policy when traffic of a slave device exceeds the total bandwidth of traffic forwarding members of an aggregation group in an embodiment of the disclosure; and 
           [0034]      FIG. 7  is a diagram of a traffic forwarding policy when a failure occurs at a port of a member of an aggregation group in an embodiment of the disclosure. 
       
    
    
     DETAILED DESCRIPTION 
       [0035]    In the embodiments of the disclosure, an aggregation group member list and an aggregation group traffic forwarding member list are respectively set for a physical device in a virtual switch cluster; in an initial state, a local member is selected from the aggregation group member list, and then added into the aggregation group traffic forwarding member list; when it is determined that the traffic of a physical device is smaller than the total bandwidth of the members in the aggregation group traffic forwarding member list corresponding to the physical device or than a threshold value related to the total bandwidth of the members in the aggregation group traffic forwarding member list, a local member is selected from the aggregation group member list, and then added into the aggregation group traffic forwarding member list. 
         [0036]      FIG. 1  is a flowchart of a traffic forwarding method based on a virtual switch cluster according to an embodiment of the disclosure; as shown in  FIG. 1 , the method includes steps as follows. 
         [0037]    Step  101 : it is determined that the traffic of a physical device exceeds the total bandwidth of the members in the aggregation group traffic forwarding member list corresponding to the physical device or a threshold value related to the total bandwidth of the members in the aggregation group traffic forwarding member list. 
         [0038]    In an embodiment of the disclosure, an aggregation group member list and an aggregation group traffic forwarding member list are respectively set for a physical device in a virtual switch cluster; the aggregation group member list stores information about all the members of the aggregation group, wherein the information generally refers to port information; the aggregation group traffic forwarding member list stores information of aggregation group members for forwarding traffic of the physical device. In other words, the aggregation group traffic forwarding member list is a subset of the aggregation group member list, and only the port/ports in the aggregation group traffic forwarding member list is/are qualified for forwarding traffic. The aggregation group traffic forwarding member list only contains information about local members of the aggregation group in an initial state; the local members of the aggregation group may also be called local device members. 
         [0039]    Note that, the aggregation group member lists of all physical devices in the virtual switch cluster are the same, but different physical devices correspond to different aggregation group traffic forwarding member lists. 
         [0040]    Step  102 : a nonlocal member is selected from the aggregation group member list and added into the aggregation group traffic forwarding member list, and then traffic is forwarded according to the changed aggregation group traffic forwarding member list. 
         [0041]    Optionally, selecting a nonlocal member from the aggregation group member list and adding the selected nonlocal member into the aggregation group traffic forwarding member list includes: acquiring a difference set between the aggregation group member list and the aggregation group traffic forwarding member list, and selecting at least one member of the aggregation group from the difference set and adding the selected member of the aggregation group into the aggregation group traffic forwarding member list, wherein remaining bandwidth of the selected member of aggregation group is not smaller than that of any remaining member of the aggregation group in the difference set. 
         [0042]    Optionally, the method further includes: when it is determined that the aggregation group traffic forwarding member list corresponding to the physical device contains a nonlocal member of the aggregation group, and the traffic forwarded from the nonlocal member of the aggregation group is smaller than the sum of remaining bandwidth of all the members of the aggregation group except the nonlocal member of the aggregation group in the aggregation group traffic forwarding member list, the nonlocal member of aggregation group is removed from the aggregation group traffic forwarding member list. 
         [0043]    Optionally, the method further includes: when a failure occurs at a member of the aggregation group, removing information of the failure member of the aggregation group from the aggregation group member list, or from the aggregation group member list and the aggregation group traffic forwarding member list. 
         [0044]    Specifically, if only the aggregation group member list contains the information of the failure member of the aggregation group, the information of the failure member of the aggregation group is deleted from the aggregation group member list; if both the aggregation group member list and the aggregation group traffic forwarding member list contain the information of the failure member of the aggregation group, the information of the failure member of the aggregation group is deleted from both the aggregation group member list and the aggregation group traffic forwarding member list. 
         [0045]    Optionally, the method further includes: after the failure member of the aggregation group returned to normal, and when it is determined that the aggregation group member recovered is a local member of the aggregation group of the physical device, information of the aggregation group member recovered is then added into the aggregation group member list and the aggregation group traffic forwarding member list corresponding to the physical device; when it is determined that the aggregation group member recovered is a nonlocal member of the aggregation group of the physical device, information of the aggregation group member recovered is then added into the aggregation group member list corresponding to the physical device. 
         [0046]    Correspondingly, an embodiment of the disclosure also provides a traffic forwarding system based on a virtual switch cluster;  FIG. 2  is a structure diagram of a traffic forwarding system based on a virtual switch cluster according to an embodiment of the disclosure; as shown in  FIG. 2 , the system includes a setting module, a traffic monitoring module, a traffic sharing module and a traffic forwarding module; wherein, 
         [0047]    the setting module may be a processor, and configured to set an aggregation group member list and an aggregation group traffic forwarding member list; wherein the aggregation group member list stores information about all the members of the aggregation group, the aggregation group traffic forwarding member list stores information of aggregation group members for forwarding traffic of the physical device, and in an initial state the aggregation group traffic forwarding member list only contains information about local members of the aggregation group; 
         [0048]    the traffic monitoring module may be implemented as a monitor, and configured to determine the traffic of the physical device in the virtual switch cluster; the traffic monitoring module counts traffic at each member port in an aggregation link in real time, wherein the traffic generally refers to traffic sent to the each port by each physical device; 
         [0049]    the traffic sharing module may be implemented as a processor, and configured to reassign the aggregation group traffic forwarding member list according to a result obtained by the traffic monitoring module; specifically, the traffic sharing module is configured to, when the traffic of the physical device exceeds the total bandwidth of the members in the aggregation group traffic forwarding member list corresponding to the physical device or a threshold value related to the total bandwidth of the members in the aggregation group traffic forwarding member list, select a nonlocal member from the aggregation group member list and add the selected nonlocal member into the aggregation group traffic forwarding member list; 
         [0050]    the traffic forwarding module may be implemented as a processor, and configured to forward traffic according to the changed aggregation group traffic forwarding member list. 
         [0051]    Optionally, the traffic sharing module is specifically configured to acquire a difference set between the aggregation group member list and the aggregation group traffic forwarding member list, and select at least one member of the aggregation group from the difference set and add the selected member of the aggregation group into the aggregation group traffic forwarding member list, wherein remaining bandwidth of the selected member of aggregation group is not smaller than that of any remaining member of the aggregation group in the difference set. 
         [0052]      FIG. 3  is a structure diagram of a traffic forwarding system based on a virtual switch cluster in another embodiment of the disclosure; as shown in  FIG. 3 , the system further includes an optimizing module; 
         [0053]    the optimizing module may be implemented as a processor, and configured to, when it is determined that the aggregation group traffic forwarding member list corresponding to the physical device contains a nonlocal member of aggregation group, and the traffic forwarded from the nonlocal member of the aggregation group is smaller than the sum of remaining bandwidth of all the members of aggregation group except the nonlocal member of the aggregation group in the aggregation group traffic forwarding member list, remove the nonlocal member of the aggregation group from the aggregation group traffic forwarding member list. 
         [0054]      FIG. 4  is a structure diagram of a traffic forwarding system based on a virtual switch cluster in still another embodiment of the disclosure; as shown in  FIG. 4 , the system further includes a failure processing module; 
         [0055]    the failure processing module may be implemented as a processor, and configured to, when a failure occurs at a member of the aggregation group, remove information of the failure member of the aggregation group from the aggregation group member list, or from the aggregation group member list and the aggregation group traffic forwarding member list. 
         [0056]    The failure processing module needs to monitor the link state of each port in the aggregation group member list in real time, so as to process a link failure and a failure recovery event at a port of a member of the aggregation group in time. 
         [0057]    Optionally, the failure processing module is further configured to, after the failure member of the aggregation group returned to normal, and when it is determined that the aggregation group member recovered is a local member of aggregation group of the physical device, add the information of the aggregation group member recovered into the aggregation group member list and the aggregation group traffic forwarding member list corresponding to the physical device; the failure processing module is further configured to, when it is determined that the aggregation group member recovered is a nonlocal member of the aggregation group of the physical device, add the information of the aggregation group member recovered into the aggregation group member list corresponding to the physical device. 
         [0058]    Note that, these modules in the traffic forwarding system based on a virtual switch cluster may be all or partly located at the physical device. 
         [0059]    The disclosure is elaborated below in combination with specific embodiments. 
         [0060]    In an embodiment, the VSC includes two physical devices, that is, a master device and a slave device; a link aggregation group member list contains four member ports, which are two ports of the master device plus two ports of the slave device. 
         [0061]      FIG. 5  is a diagram of a traffic forwarding policy in an initial state and when traffic does not exceed the total bandwidth of local members of an aggregation group in an embodiment of the disclosure; as show in  FIG. 5 , the current traffic passing the master device is respectively forwarded by the local members of the aggregation group;  FIG. 6  is a diagram of a traffic forwarding policy when traffic of a slave device exceeds the total bandwidth of traffic forwarding members of the aggregation group in an embodiment of the disclosure; as shown in  FIG. 6 , for the slave device, some nonlocal member ports in the aggregation group member list, such as the port of the master device, are added into the aggregation group traffic forwarding member list, the specific implementation steps are as follows: 
         [0062]    the traffic monitoring module periodically monitors and records the current traffic of all member ports, namely the local ports and the nonlocal ports, in the link aggregation group member list. 
         [0063]    When the traffic monitoring module finds that the traffic needing to be forwarded from the aggregation group exceeds the total bandwidth of the current aggregation group traffic forwarding members, the traffic monitoring module notifies the traffic sharing module of this finding and informs the traffic sharing module of extra bandwidth needed by the aggregation group. 
         [0064]    The traffic sharing module selects a port according to the following policy: 
         [0065]    a) acquiring a difference set between the aggregation group member list and the aggregation group traffic forwarding member list; 
         [0066]    b) selecting a port with the maximum remaining bandwidth in the difference set, removing the selected port from the difference set and adding the selected port into set B; 
         [0067]    c) counting the sum of remaining bandwidth of all the ports in set B, and comparing the sum with the needed extra bandwidth; if it is larger than the needed extra bandwidth, lookup ends; or else, returning to b) to continue looking up; and 
         [0068]    d) adding the ports in set B into the aggregation group traffic forwarding member list. 
         [0069]    If the aggregation group traffic forwarding member list contains a nonlocal member port, and the traffic forwarded from the nonlocal port is smaller than the sum of remaining bandwidth of all the ports except the nonlocal port in the aggregation group traffic forwarding member list, then the nonlocal member port is removed from the aggregation group traffic forwarding member list. When the aggregation group traffic forwarding member list only contains local member ports, the operation ends. There may be one or multiple ports removed each time. 
         [0070]    In the present embodiment, when the failure processing module detects that a failure occurs at a port of a member of the aggregation group, it removes the failure member port from the aggregation group member list and the aggregation group traffic forwarding member list, and updates the aggregation group traffic forwarding member list according to the above policy. When the aggregation group traffic forwarding member list does not contain any local member port, the traffic is completely forwarded by the nonlocal member in the aggregation group member list, the corresponding traffic forwarding policy is shown in  FIG. 7 . After the failure port returned to normal, if the failure processing module determines that the aggregation group member recovered is a local member of the aggregation group of the physical device, the failure processing module adds the information of the aggregation group member recovered into the aggregation group member list and the aggregation group traffic forwarding member list corresponding to the physical device; if the failure processing module determined that the aggregation group member recovered is a nonlocal member of aggregation group of the physical device, the failure processing module adds the information of the aggregation group member recovered into the aggregation group member list corresponding to the physical device. 
         [0071]    The above are only the preferred embodiments of the disclosure, and are not intended to limit the scope of protection of the claims of the disclosure.