Business flow transmission method, system, computer device and storage medium
Patent Information
- Application Number
- CN202310432566.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-04-21
AI Technical Summary
[0003]目前二层转发中的负载均衡技术为链路聚合,对于链路聚合实现的负载分担技术,需要将以太网接口加入聚合组,以太网接口加入聚合组后,转发行为取决于聚合组,而不是以太网接口本身,使得以太网接口灵活性很低,导致使用不便
[0046] The aforementioned service flow transmission methods, systems, computer equipment, and storage media no longer use link aggregation to achieve load distribution. Instead, they use a virtual local area network (VLAN) via Ethernet interfaces to achieve load distribution. The VLAN is bound to the Ethernet interface that performs load distribution. During load distribution, the Ethernet interface bound to the VLAN is obtained through traffic tags, and the target interface is determined. The traffic distribution and transmission of the target service flow are performed through the target interface. This improves the flexibility of the Ethernet interface, balances the transmission load of the VLAN, and improves transmission efficiency.
Smart Images

Figure CN116405438B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a service flow transmission method, system, computer device, and storage medium. Background Technology
[0002] With the rapid development of the internet and the continuous growth of business volume, network data access traffic has increased dramatically, especially for access to some well-known websites and data centers, where the access volume has reached a relatively high level. In addition, with the continuous development of e-commerce, consumers have increasingly higher demands for e-commerce to provide 24-hour uninterrupted service. Therefore, load balancing of network traffic is particularly important.
[0003] Currently, the load balancing technology in Layer 2 forwarding is link aggregation. For the load sharing technology implemented by link aggregation, the Ethernet interface needs to be added to the aggregation group. After the Ethernet interface is added to the aggregation group, the forwarding behavior depends on the aggregation group, rather than the Ethernet interface itself, which makes the Ethernet interface very inflexible and inconvenient to use. Summary of the Invention
[0004] Based on this, this application provides a service flow transmission method, system, computer device, and storage medium to improve the flexibility of using Ethernet interfaces.
[0005] On the one hand, a service flow transmission method is provided, the method comprising:
[0006] Receive the target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow based on the traffic tag;
[0007] In response to the virtual LAN enabling load balancing, multiple Ethernet interfaces corresponding to the target service flow are obtained from the configuration table based on the traffic tags, and the interface status of the multiple Ethernet interfaces is obtained.
[0008] In response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two, the Ethernet interface with a normal interface status is determined as the target interface.
[0009] The target service flow is allocated and transmitted through the link corresponding to the target interface.
[0010] In one embodiment, before receiving the target service stream, the method further includes:
[0011] Create a virtual LAN on the switch, obtain an Ethernet interface, and add the Ethernet interface to the corresponding virtual LAN.
[0012] Identify the virtual local area networks (VLANs) that require load balancing and configure load balancing attributes for those VLANs.
[0013] The load balancing attribute indicates whether the virtual local area network is configured with load balancing functionality.
[0014] In one embodiment, before receiving the target service stream, the method further includes:
[0015] The load distribution attribute is determined to be a virtual local area network with load distribution function configured and its corresponding Ethernet interface;
[0016] Establish a binding relationship between the virtual LAN configured with load distribution attribute and its corresponding Ethernet interface, and store the binding relationship in the configuration table.
[0017] In one embodiment, the step of responding to the virtual local area network enabling load balancing by retrieving multiple Ethernet interfaces corresponding to the target service flow from a configuration table based on the traffic tags includes:
[0018] In response to the virtual LAN enabling load balancing, determine whether the service flow tag belongs to the load balancing tag to be executed;
[0019] In response to the fact that the service flow label belongs to the load balancing label to be executed, it is determined whether the virtual LAN corresponding to the service flow label has a binding interface;
[0020] In response to the existence of a binding interface in the virtual LAN corresponding to the service flow label, multiple Ethernet interfaces corresponding to the target service flow are obtained from the configuration table based on the traffic label.
[0021] In one embodiment, the method further includes:
[0022] In response to the fact that the service flow label does not belong to the load distribution label to be executed, or the virtual LAN corresponding to the service flow label does not have a bound interface, or the number of Ethernet interfaces with a normal interface status is less than two;
[0023] The Ethernet interface connected to the virtual local area network corresponding to the target service flow is identified as the target interface, and the target service flow is transmitted through the target interface in a polling manner.
[0024] In one embodiment, the method further includes:
[0025] In response to the fact that the target service flow is a service flow from the switch and the number of Ethernet interfaces with a normal interface status is greater than or equal to two, the Ethernet interface with a normal interface status is determined as the target interface.
[0026] The traffic of the target service flow is transmitted through an Ethernet interface other than the target interface.
[0027] In one embodiment, the step of performing traffic allocation and transmission of the target service flow through the link corresponding to the target interface includes:
[0028] The traffic of the target service flow is split into sub-traffic based on the number of target interfaces, and each sub-traffic corresponds one-to-one with the target interface;
[0029] The sub-traffic is transmitted through its corresponding target interface.
[0030] On the other hand, a service flow transmission system is provided, the system comprising:
[0031] The service flow matching module is used to receive a target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow according to the traffic tag;
[0032] The interface acquisition module is used to respond to the virtual local area network enabling the load balancing function, acquire multiple Ethernet interfaces corresponding to the target service flow from the configuration table according to the traffic tag, and acquire the interface status of the multiple Ethernet interfaces;
[0033] The target interface module is used to determine the Ethernet interface with a normal interface status as the target interface in response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two.
[0034] The traffic allocation and transmission module is used to perform traffic allocation and transmission of the target service flow through the link corresponding to the target interface.
[0035] In another aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0036] Receive the target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow based on the traffic tag;
[0037] In response to the virtual LAN enabling load balancing, multiple Ethernet interfaces corresponding to the target service flow are obtained from the configuration table based on the traffic tags, and the interface status of the multiple Ethernet interfaces is obtained.
[0038] In response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two, the Ethernet interface with a normal interface status is determined as the target interface.
[0039] The target service flow is allocated and transmitted through the link corresponding to the target interface.
[0040] In another aspect, a computer-readable storage medium is provided, the computer-readable storage medium storing a program that, when executed by a processor, causes the processor to perform the following steps:
[0041] Receive the target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow based on the traffic tag;
[0042] In response to the virtual LAN enabling load balancing, multiple Ethernet interfaces corresponding to the target service flow are obtained from the configuration table based on the traffic tags, and the interface status of the multiple Ethernet interfaces is obtained.
[0043] In response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two, the Ethernet interface with a normal interface status is determined as the target interface.
[0044] The target service flow is allocated and transmitted through the link corresponding to the target interface.
[0045] The technical solution described in this application has the following advantages over the prior art:
[0046] The aforementioned service flow transmission methods, systems, computer equipment, and storage media no longer use link aggregation to achieve load distribution. Instead, they use a virtual local area network (VLAN) via Ethernet interfaces to achieve load distribution. The VLAN is bound to the Ethernet interface that performs load distribution. During load distribution, the Ethernet interface bound to the VLAN is obtained through traffic tags, and the target interface is determined. The traffic distribution and transmission of the target service flow are performed through the target interface. This improves the flexibility of the Ethernet interface, balances the transmission load of the VLAN, and improves transmission efficiency. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1This is a flowchart of the first method of the service flow transmission method provided in the embodiments of this application;
[0049] Figure 2 This is a flowchart of the second method of the service flow transmission method provided in the embodiments of this application;
[0050] Figure 3 This is a flowchart of the third method of the service flow transmission method provided in the embodiments of this application;
[0051] Figure 4 This is a system architecture diagram of the service flow transmission system provided in the embodiments of this application;
[0052] Figure 5 This is a device structure diagram of the computer device provided in the embodiments of this application;
[0053] Figure 6 This is a business flow topology diagram provided in the embodiments of this application. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0055] Example 1
[0056] Reference Figure 1 As shown, Figure 1 A flowchart of the first method for a service flow transmission method provided in an embodiment of this application.
[0057] The method includes the following steps:
[0058] Receive the target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow based on the traffic tag;
[0059] Currently, the transmission of service flows between different nodes can only be achieved through link aggregation. However, the forwarding (transmission) of traffic on an Ethernet interface after link aggregation depends on the aggregation group, not the Ethernet interface itself, which reduces the flexibility of the Ethernet interface. Therefore, this application proposes a service flow transmission method. When transmitting service flows between nodes, the first step is to receive the target service flow. The target service flow is tagged with traffic tags, so the traffic tag of the target service flow can be obtained based on the traffic tag. After obtaining the traffic tag, a corresponding Virtual Local Area Network (VLAN) can be matched for the target service flow based on the traffic tag, so as to realize the forwarding of the target service flow through the VLAN. The name of the VLAN corresponds to the traffic tag. For example, if the service flow is service flow 100, the corresponding VLAN is VLAN 100; if the service flow is service flow 200, the corresponding VLAN is VLAN 200.
[0060] In response to the virtual LAN enabling load balancing, multiple Ethernet interfaces corresponding to the target service flow are obtained from the configuration table based on the traffic tags, and the interface status of the multiple Ethernet interfaces is obtained.
[0061] After matching the corresponding VLAN to the target service flow, it is determined whether the VLAN has load balancing enabled. If the VLAN corresponding to the target service flow has load balancing enabled, it means that the target service flow forwarding through this VLAN has a large amount of data, requiring load balancing through multiple Ethernet interfaces. This is the traffic distribution of the target service flow to balance the transmission load of the VLAN and improve transmission efficiency. The VLAN that needs to perform load balancing must be bound to the corresponding Ethernet interface. Based on the traffic tag, the Ethernet interface bound to the VLAN for load balancing can be obtained from the configuration table. Then, the interface status of the Ethernet interface is obtained. There are two Ethernet interface statuses: normal (up) and abnormal (down). The Ethernet interface for load balancing must be in the up state, so an Ethernet interface in the normal state must be selected from the Ethernet interfaces. The configuration table stores the Ethernet interfaces bound to different VLANs for load balancing.
[0062] In response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two, the Ethernet interface with a normal interface status is determined as the target interface.
[0063] After obtaining multiple Ethernet interfaces corresponding to the target service flow, that is, after obtaining the Ethernet interfaces bound to the virtual LAN, it is necessary to determine the interface status of the Ethernet interfaces. Therefore, it is necessary to select the Ethernet interfaces that are in a normal state from the Ethernet interfaces. If the target service flow is a service flow from the terminal, such as... Figure 6 As shown in the DUT1 diagram, the target service flow enters the DUT1 and is then forwarded by the DUT1. At this time, relative to the DUT1, the service flow that needs to be load-balanced is the outbound service flow. In this case, the number of Ethernet interfaces in normal state must be greater than or equal to two in order to achieve load balancing. Therefore, the Ethernet interfaces in normal state must be identified as the target interfaces, and the number of target interfaces must be greater than or equal to two.
[0064] The target service flow is allocated and transmitted through the link corresponding to the target interface.
[0065] Once the target interface is determined, the traffic of the target service flow is allocated through the target interface so that the traffic of the target service flow is distributed across multiple target interfaces and transmitted through multiple target interfaces.
[0066] The service flow transmission method of this application no longer uses link aggregation to achieve load distribution, but instead uses a virtual local area network (VLAN) to achieve load distribution through an Ethernet interface. It binds the VLAN to the Ethernet interface that performs load distribution. When performing load distribution, it obtains the Ethernet interface bound to the VLAN through traffic tags and determines the target interface. The traffic distribution and transmission of the target service flow are performed through the target interface, which improves the flexibility of the Ethernet interface, balances the transmission load of the VLAN, and improves transmission efficiency.
[0067] Example 2
[0068] Reference Figure 2 As shown, Figure 2 This is a flowchart of the second method of the service flow transmission method provided in the embodiments of this application. The service flow is an outgoing service flow, that is, a service flow from the terminal ( Figure 6 The target service flows of PC1, PC2, and PC3 in the DUT are forwarded. The service flows that perform load balancing from the DUT's perspective are outbound service flows, such as... Figure 6 The service flow forwarding path is PC1-DUT1-DUT2-PC2, and the service flow is the outgoing flow from the right side of DUT1. Figure 2 In the method shown, with Figure 1 For content that is the same or similar to the method shown, please refer to... Figure 1 The method description will not be repeated here.
[0069] S201: Create a virtual LAN on the switch, obtain an Ethernet interface, and add the Ethernet interface to the corresponding virtual LAN;
[0070] To enable traffic transmission of service flows between different nodes, multiple virtual local area networks (VLANs) need to be established on the device under test (DUT) to achieve this. Figure 6 Taking the illustrated topology diagram as an example, it includes three switches: DUT1, DUT2, and DUT3. Virtual LANs VLAN 100, VLAN 200, and VLAN 300 are created on DUT1 and DUT2, respectively. VLAN 300 is created on DUT3. Ethernet interface 1 (Eth1) is added to VLAN 100, VLAN 200, and VLAN 300 respectively; Ethernet interface 2 (Eth2) is added to VLAN 100 and VLAN 200 respectively; Ethernet interface 3 (Eth3) is added to VLAN 100 and VLAN 300 respectively; and Ethernet interface 4 (Eth4) is added to VLAN 100 and VLAN 300. Virtual LANs with the same label in different DUTs can communicate with each other. For example, VLAN 100 in DUT1 can communicate with VLAN 100 in DUT2, and so on.
[0071] S202, determine the virtual local area network (VLAN) that needs to perform load balancing, and configure load balancing attributes for the VLAN that needs to perform load balancing;
[0072] The load balancing attribute indicates whether the virtual local area network is configured with load balancing functionality.
[0073] like Figure 6As shown, the service flows are service flow 100, service flow 200, and service flow 300. 100, 200, and 300 are the traffic labels for the service flows. After entering the switch, the service flow with label 100 is transmitted through VLAN 100, the service flow with label 200 is transmitted through VLAN 200, and the service flow with label 300 is transmitted through VLAN 300. To determine which VLANs require load balancing, taking service flows 100 and 300 as examples where load balancing is required, but service flow 300 does not, the VLAN 100 corresponding to service flow 100 performs load balancing through its bound Ethernet interface, and the VLAN 300 corresponding to service flow 300 performs load balancing through its bound Ethernet interface. Configure load balancing attributes for VLANs that require load balancing. If the load balancing attribute of a VLAN is configured to perform load balancing, it means that the VLAN needs to perform load balancing, such as VLAN 100 corresponding to service flow 100 and VLAN 300 corresponding to service flow 300. If the load balancing attribute of a VLAN is not configured to perform load balancing, it means that the VLAN does not need to perform load balancing, such as VLAN 200 corresponding to service flow 200.
[0074] S203, determine that the load distribution attribute is a virtual local area network with load distribution function configured and its corresponding Ethernet interface;
[0075] Filter out all VLANs that have the load balancing attribute configured for load balancing, which are the VLANs that need to perform load balancing. Then determine the corresponding Ethernet interface for the VLAN that performs load balancing.
[0076] S204, Establish a binding relationship between the virtual local area network with the load distribution attribute configured with load distribution function and its corresponding Ethernet interface, and store the binding relationship in the configuration table;
[0077] Establish a binding relationship between the virtual LAN with the load distribution attribute configured for load distribution and its corresponding Ethernet interface, and then store the binding relationship in the configuration table. Establish the association relationship through traffic tags. For example, if service flow 100 corresponds to virtual LAN VLAN 100 with the load distribution attribute configured for load distribution, then bind the virtual LAN of VLAN 100 and the corresponding Ethernet interface of the virtual LAN of VLAN 100 and store them in the configuration table.
[0078] S205, receive the target service flow, obtain the traffic label of the target service flow, and match the corresponding virtual local area network for the target service flow according to the traffic label;
[0079] After configuring the virtual LAN and the Ethernet interface, when it is necessary to perform service flow forwarding, the first step is to receive the service flow, then obtain the traffic tag of the service flow, and match the service flow to the corresponding virtual LAN based on the service flow tag. For example, the virtual LAN matched to service flow 100 is VLAN 100.
[0080] S206, Determine whether the virtual LAN has the load balancing function enabled;
[0081] If the virtual LAN has the load balancing function enabled, then step S207 is executed: determine whether the service flow label belongs to the load balancing label to be executed;
[0082] If the virtual LAN does not have load balancing enabled, then step S213 is executed: determine the Ethernet interface connected to the virtual LAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a round-robin manner;
[0083] To determine whether the virtual local area network (VLAN) has load balancing enabled, the load balancing attribute of the VLAN is used as the basis for judgment. If the VLAN has load balancing enabled, step S207 is executed: determine whether the service flow label belongs to the load balancing label to be executed; if the VLAN has not enabled load balancing, step S213 is executed: determine the Ethernet interface connected to the VLAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a round-robin manner; that is, the target interface is determined in a conventional manner, and the target interface at this time is the VLAN corresponding to the target service flow. All available Ethernet interfaces are connected, so the service flow will be broadcast in a round-robin manner through all Ethernet interfaces connected to the VLAN. The amount of data transmitted is relatively large. For example, service flow 100 has a data volume of 100M, the corresponding VLAN is VLAN100, and the Ethernet interfaces connected to it are Ethernet interface 2 and Ethernet interface 3. In the conventional way, VLAN100 will broadcast 100M of data through Ethernet interface 2 and VLAN100 will broadcast 100M of data through Ethernet interface 3, doubling the data volume to 200M, resulting in a large load.
[0084] S207, determine whether the service flow label belongs to the load allocation label to be executed;
[0085] If the service flow label belongs to the load balancing label to be executed, then the following steps are performed: determine whether the virtual LAN corresponding to the service flow label has a bound interface;
[0086] If the service flow label does not belong to the load allocation label to be executed, then the following steps are executed:
[0087] Determine whether the service flow label belongs to the load balancing label to be executed. If the service flow label belongs to the load balancing label to be executed, then execute step S208: determine whether the virtual LAN corresponding to the service flow label has a binding interface; if the service flow label does not belong to the load balancing label to be executed, then execute step S213: determine the Ethernet interface connected to the virtual LAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a round-robin manner; that is, determine the target interface in a conventional manner.
[0088] S208, determine whether the virtual LAN corresponding to the service flow label has a binding interface;
[0089] If the virtual LAN corresponding to the service flow label has a binding interface, then step S209 is executed: obtain multiple Ethernet interfaces corresponding to the target service flow from the configuration table according to the traffic label;
[0090] If the virtual local area network corresponding to the service flow tag does not have a binding interface, then step S213 is executed: determine the Ethernet interface connected to the virtual local area network corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a polling manner; that is, determine the target interface in a conventional manner.
[0091] Determine if a bound interface exists in the virtual local area network (VLAN) corresponding to the service flow tag. If a bound interface exists in the VLAN corresponding to the service flow tag, proceed to step S209: Obtain multiple Ethernet interfaces corresponding to the target service flow from the configuration table based on the traffic tag, such as service flow 100. Match the VLAN 100 according to the tag, and then query the configuration table for the Ethernet interface bound to VLAN 100. If no bound interface exists in the VLAN corresponding to the service flow tag, proceed to step S213: Determine the Ethernet interface connected to the VLAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a round-robin manner; that is, determine the target interface in a conventional manner.
[0092] S209: Obtain multiple Ethernet interfaces corresponding to the target service flow from the configuration table based on the traffic label, and obtain the interface status of the multiple Ethernet interfaces;
[0093] After matching the corresponding virtual LAN for the target service flow based on the traffic tag, the multiple Ethernet interfaces bound to the virtual LAN can be obtained from the configuration table based on the traffic tag, which are the multiple Ethernet interfaces corresponding to the target service flow. Then, the interface status of the multiple Ethernet interfaces can be obtained.
[0094] S210, in response to the target service flow being a service flow from the terminal, determine whether the number of Ethernet interfaces with normal interface status is greater than or equal to two.
[0095] If the number of Ethernet interfaces in normal state is greater than or equal to two, then execute step S211: split the traffic of the target service flow into sub-traffic according to the number of target interfaces, and the sub-traffic corresponds one-to-one with the target interface;
[0096] If the number of Ethernet interfaces in normal state is less than two, then proceed to step S213: determine the Ethernet interface connected to the virtual LAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a polling manner;
[0097] Determine if the number of Ethernet interfaces in normal state is greater than or equal to two. If the number of Ethernet interfaces in normal state is greater than or equal to two, load balancing can be performed on the target service flow. Step S211 is required: the target service flow is split into sub-flows according to the number of target interfaces, and each sub-flow corresponds one-to-one with a target interface. If the number of Ethernet interfaces in normal state is less than two, load balancing cannot be performed, and step S213 is required: the Ethernet interface connected to the virtual LAN corresponding to the target service flow is determined as the target interface, and the target service flow is transmitted through the target interface in a round-robin manner; that is, the target interface is determined in a conventional manner.
[0098] S211, the traffic of the target service flow is split into sub-traffic according to the number of target interfaces, and the sub-traffic corresponds one-to-one with the target interface;
[0099] The traffic of the target service flow is split into sub-flows according to the number of target interfaces. Each sub-flow corresponds to a target interface. For example, target service flow 100 corresponds to VLAN 100. The interfaces bound to VLAN 100 are Ethernet interface 2 and Ethernet interface 3. The status of Ethernet interface 2 and Ethernet interface 3 is normal. The data volume of target service flow 100 is 100M. The data is split into two sub-flows, one sub-flow corresponds to Ethernet interface 2 and the other sub-flow corresponds to Ethernet interface 3.
[0100] S212, the sub-traffic is transmitted through its corresponding target interface;
[0101] The target service flow 100 has a data volume of 100M. The data is split into two sub-flows, each with 50M of data. One sub-flow's 50M data is forwarded through Ethernet interface 2, and the other sub-flow's 50M data is forwarded through Ethernet interface 3. The load is distributed using a round-robin method, which reduces the amount of data transmitted, improves efficiency, and reduces the load.
[0102] S213, determine the Ethernet interface connected to the virtual local area network corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a polling manner.
[0103] The target interface is determined in the conventional way. At this time, the target interface is all the Ethernet interfaces that can be connected to the virtual local area network corresponding to the target service flow. Therefore, the service flow will be broadcast through all the Ethernet interfaces connected to the virtual local area network, and the amount of data transmitted is relatively large.
[0104] by Figure 6 Taking PC1-DUT1-DUT2-PC2 as an example, with service flow 100, the traffic of service flow 100 is flooded from PC1 into DUT1. On DUT1, service flow 100 can be matched with virtual LAN VLAN 100. The load balancing attribute of VLAN 100 is configured with load balancing function, and the virtual LAN VLAN 100 is bound to Ethernet interface 2 and Ethernet interface 3 (both Ethernet interface 2 and Ethernet interface 3 are in normal state). The traffic of service flow 100 is split into two sub-traffic flows, and the sub-traffic flows will be load-balanced and forwarded between Ethernet interface 2 and Ethernet interface 3 through round-robin.
[0105] by Figure 6 Taking PC1-DUT1-DUT2-PC2 and service flow 200 as an example, the traffic of service flow 200 is flooded from PC1 into DUT1. No VLAN for load balancing of service flow 200 is found on DUT1. Therefore, service flow 200 determines the target interface in the conventional way and forwards the traffic through that interface. Figure 6 In the middle traffic flow 200, it can only be forwarded to DUT2 via Ethernet interface 2 without any load distribution. Similarly, on DUT2, it is forwarded to PC2 via Ethernet interface 1 without any load distribution.
[0106] by Figure 6Taking PC1-DUT1-DUT2-PC2 and PC1-DUT1-DUT3-PC3 as examples, with service flow 300, the traffic of service flow 300 is flooded from PC1 into DUT1. On DUT1, service flow 300 can be matched to VLAN 300. The load balancing attribute of VLAN 300 is configured with load balancing function, and the VLAN 300 is bound to Ethernet interface 3 and Ethernet interface 4 (both Ethernet interface 3 and Ethernet interface 4 are in normal status). Traffic flow 300 is split into two sub-flows, which are then load-balanced and forwarded between Ethernet interfaces 3 and 4 using a round-robin method. When traffic flow 300 reaches DUT2 and DUT3 via Ethernet interfaces 3 and 4 respectively, and no matching Ethernet interface is available for traffic flow 300 on DUT2 and DUT3, traffic flow 300 can only be forwarded to PC2 via Ethernet interface 1 on DUT2, and to PC3 via Ethernet interface 1 on DUT3. Compared to DUT1, Ethernet interfaces 3 and 4 handle the outbound traffic of DUT1.
[0107] Example 3
[0108] Reference Figure 3 As shown, Figure 3 This is a flowchart of the third method of the service flow transmission method provided in this application embodiment. The service flow is the inbound service flow, that is, the service flow from the DUT is forwarded, such as... Figure 6 The service flow forwarding path is PC1-DUT1-DUT2-PC2, with service flow entering from the left side of DUT2; the service flow forwarding path is PC2-DUT2-DUT1-PC1, with service flow entering from the right side of DUT1. Among these, Figure 3 In the method shown, with Figure 1 and Figure 2 For content that is the same or similar to the method shown, please refer to... Figure 1 and Figure 2 The method description will not be repeated here.
[0109] S301 creates a virtual LAN on the switch, obtains an Ethernet interface, and adds the Ethernet interface to the corresponding virtual LAN;
[0110] To enable traffic transmission of service flows between different nodes, multiple virtual local area networks (VLANs) need to be established on the switch.
[0111] S302, determine the virtual local area network (VLAN) that needs to perform load balancing, and configure load balancing attributes for the VLAN that needs to perform load balancing;
[0112] Identify the virtual LANs that need load balancing and configure load balancing properties for them. If the load balancing property of a virtual LAN is configured to perform load balancing, it means that the virtual LAN needs to perform load balancing.
[0113] S303, determine that the load distribution attribute is a virtual local area network configured with load distribution function and its corresponding Ethernet interface;
[0114] Filter out all VLANs that have the load balancing attribute configured for load balancing, which are the VLANs that need to perform load balancing. Then determine the corresponding Ethernet interface for the VLAN that performs load balancing.
[0115] S304, Establish a binding relationship between the virtual local area network with the load distribution attribute configured with load distribution function and its corresponding Ethernet interface, and store the binding relationship in the configuration table;
[0116] Establish a binding relationship between the virtual LAN with the load distribution attribute configured for load distribution and its corresponding Ethernet interface, and then store the binding relationship in the configuration table. Establish the association relationship through traffic tags. For example, if service flow 100 corresponds to virtual LAN VLAN 100 with the load distribution attribute configured for load distribution, then bind the virtual LAN of VLAN 100 and the corresponding Ethernet interface of the virtual LAN of VLAN 100 and store them in the configuration table.
[0117] S305, receive the target service flow, obtain the traffic label of the target service flow, and match the corresponding virtual local area network for the target service flow according to the traffic label;
[0118] After configuring the virtual LAN and the Ethernet interface, when it is necessary to perform service flow forwarding, the first step is to receive the service flow, then obtain the traffic tag of the service flow, and match the service flow to the corresponding virtual LAN based on the service flow tag. For example, the virtual LAN matched to service flow 100 is VLAN 100.
[0119] S306, Determine whether the virtual LAN has enabled load balancing function;
[0120] If the virtual LAN enables load balancing, then step S307 is executed: determine whether the service flow label belongs to the load balancing label to be executed;
[0121] If the virtual LAN does not have load balancing enabled, then step S312 is executed: determine the Ethernet interface connected to the virtual LAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a round-robin manner;
[0122] To determine whether the virtual LAN (VLAN) has load balancing enabled, the load balancing attribute of the VLAN is used as the basis for judgment. If the VLAN has load balancing enabled, step S307 is executed: determine whether the service flow label belongs to the load balancing label to be executed. If the VLAN does not have load balancing enabled, step S312 is executed: determine the Ethernet interface connected to the VLAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a round-robin manner. That is, the target interface is determined in a conventional way. At this time, the target interface is all the Ethernet interfaces that can be connected to the VLAN corresponding to the target service flow. Therefore, the service flow will be broadcast through all the Ethernet interfaces connected to the VLAN, and the amount of data transmitted is relatively large.
[0123] S307, determine whether the service flow label belongs to the load allocation label to be executed;
[0124] If the service flow label belongs to the load balancing label to be executed, then the following steps are performed: determine whether the virtual LAN corresponding to the service flow label has a bound interface;
[0125] If the service flow label does not belong to the load allocation label to be executed, then the following steps are executed:
[0126] Determine whether the service flow label belongs to the load balancing label to be executed. If the service flow label belongs to the load balancing label to be executed, then execute step S308: determine whether the virtual LAN corresponding to the service flow label has a binding interface; if the service flow label does not belong to the load balancing label to be executed, then execute step S312: determine the Ethernet interface connected to the virtual LAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a round-robin manner; that is, determine the target interface in a conventional manner.
[0127] S308, determine whether the virtual LAN corresponding to the service flow label has a binding interface;
[0128] If the virtual LAN corresponding to the service flow label has a binding interface, then step S309 is executed: obtain multiple Ethernet interfaces corresponding to the target service flow from the configuration table according to the traffic label;
[0129] If the virtual LAN corresponding to the service flow tag does not have a bound interface, then proceed with the following steps:
[0130] Determine whether the virtual local area network (VLAN) corresponding to the service flow label has a bound interface; if the VLAN corresponding to the service flow label has a bound interface, then execute step S309: obtain multiple Ethernet interfaces corresponding to the target service flow from the configuration table according to the traffic label; if the VLAN corresponding to the service flow label does not have a bound interface, then execute step S312: determine the Ethernet interface connected to the VLAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a round-robin manner; that is, determine the target interface in a conventional manner.
[0131] S309: Obtain multiple Ethernet interfaces corresponding to the target service flow from the configuration table based on the traffic label, and obtain the interface status of the multiple Ethernet interfaces;
[0132] After matching the corresponding virtual LAN for the target service flow based on the traffic tag, the multiple Ethernet interfaces bound to the virtual LAN can be obtained from the configuration table based on the traffic tag, which are the multiple Ethernet interfaces corresponding to the target service flow, and the interface status of the multiple Ethernet interfaces can be obtained.
[0133] S310, in response to the target service flow being a service flow from the switch, determine whether the number of Ethernet interfaces with normal interface status is greater than or equal to two.
[0134] If the number of Ethernet interfaces in normal state is greater than or equal to two, then step S311 is executed: the traffic of the target service flow is transmitted through interfaces other than the target interface.
[0135] If the number of Ethernet interfaces in normal state is less than two, then proceed to step S312: determine the Ethernet interface connected to the virtual LAN corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a polling manner;
[0136] In response to the target service flow being a service flow from a switch, it is determined whether the number of Ethernet interfaces in normal state is greater than or equal to two. If the number of Ethernet interfaces in normal state is greater than or equal to two, then step S311 is executed: the traffic of the target service flow is transmitted through interfaces other than the target interface; if the number of Ethernet interfaces in normal state is less than two, load balancing cannot be performed, and step S312 is executed: the Ethernet interface connected to the virtual LAN corresponding to the target service flow is determined as the target interface, and the target service flow is transmitted through the target interface in a round-robin manner; that is, the target interface is determined in a conventional manner.
[0137] S311, the traffic of the target service flow is transmitted through an Ethernet interface other than the target interface;
[0138] If there are two or more Ethernet interfaces in a normal state, the traffic of the target service flow will be transmitted through interfaces other than the target interface. Figure 6 Taking PC1-DUT1-DUT2-PC2 and service flow 100 as an example, when service flow 100 arrives at DUT2, it is inbound traffic from DUT2's perspective. DUT2 needs to match service flow 100 to VLAN 100, and VLAN 100 is bound to Ethernet interface 2 and Ethernet interface 3 (both Ethernet interface 2 and Ethernet interface 3 are in normal status). At this point, the target service flow's traffic needs to be transmitted through an Ethernet interface other than the target interface, that is, through an interface other than Ethernet interface 2 and Ethernet interface 3. Therefore, it can only be transmitted from Ethernet interface 1. Furthermore, this ensures that traffic coming from Ethernet interface 2 cannot be forwarded out from Ethernet interface 3, and traffic coming from Ethernet interface 3 cannot be forwarded out from Ethernet interface 2, thus avoiding traffic looping issues.
[0139] S312, determine the Ethernet interface connected to the virtual local area network corresponding to the target service flow as the target interface, and transmit the target service flow through the target interface in a polling manner.
[0140] The target interface is determined in the conventional way. At this time, the target interface is all the Ethernet interfaces that can be connected to the virtual local area network corresponding to the target service flow. Therefore, the service flow will be broadcast through all the Ethernet interfaces connected to the virtual local area network, and the amount of data transmitted is relatively large.
[0141] It should be understood that, although Figures 1-3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 1-3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0142] Example 4
[0143] Reference Figure 4 As shown, Figure 4 This is a system architecture diagram of the service flow transmission system provided in the embodiments of this application.
[0144] The service flow transmission system of this embodiment includes:
[0145] The service flow matching module is used to receive a target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow according to the traffic tag;
[0146] Currently, the transmission of service flows between different nodes can only be achieved through link aggregation. However, the forwarding (transmission) of traffic on an Ethernet interface after link aggregation depends on the aggregation group, not the Ethernet interface itself, which reduces the flexibility of the Ethernet interface. Therefore, this application proposes a service flow transmission method. When transmitting service flows between nodes, the target service flow is first received through a service flow matching module. The target service flow is tagged with traffic tags, so the traffic tags of the target service flow can be obtained based on the traffic tags. After obtaining the traffic tags of the target service flow, a corresponding virtual LAN can be matched for the target service flow to facilitate the forwarding of the target service flow through the virtual LAN.
[0147] The interface acquisition module is used to respond to the virtual local area network enabling the load balancing function, acquire multiple Ethernet interfaces corresponding to the target service flow from the configuration table according to the traffic tag, and acquire the interface status of the multiple Ethernet interfaces;
[0148] After matching the corresponding VLAN to the target service flow, it is determined whether the VLAN has load balancing enabled. If the VLAN corresponding to the target service flow has load balancing enabled, it means that the target service flow forwarding through this VLAN has a large amount of data, requiring load balancing through multiple Ethernet interfaces. This is the traffic distribution of the target service flow to balance the transmission load of the VLAN and improve transmission efficiency. The VLAN that needs to perform load balancing must be bound to the corresponding Ethernet interface. Based on the traffic tag, the interface acquisition module can obtain the Ethernet interface bound to the VLAN for load balancing from the configuration table. Then, the interface status of the Ethernet interface is obtained. There are two Ethernet interface statuses: normal (up) and abnormal (down). The Ethernet interface that needs to perform load balancing must be in the up state. Therefore, an Ethernet interface in the normal state must be selected from the Ethernet interfaces.
[0149] The target interface module is used to determine the Ethernet interface with a normal interface status as the target interface in response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two.
[0150] After obtaining multiple Ethernet interfaces corresponding to the target service flow, that is, after obtaining the Ethernet interfaces bound to the virtual LAN, the interface status of the Ethernet interfaces needs to be determined through the target interface module. Therefore, in response to the target service flow being a service flow from the terminal, Ethernet interfaces in a normal state need to be selected from the Ethernet interfaces, and the number of Ethernet interfaces in a normal state must be greater than or equal to two in order to achieve load balancing. Therefore, the Ethernet interfaces in a normal state need to be determined as target interfaces, and the number of target interfaces must be greater than or equal to two.
[0151] The traffic allocation and transmission module is used to perform traffic allocation and transmission of the target service flow through the link corresponding to the target interface.
[0152] After the target interface is determined, the traffic of the target service flow is allocated through the traffic allocation and transmission module so that the traffic of the target service flow is distributed to multiple target interfaces and transmitted through multiple target interfaces.
[0153] Specific limitations regarding the service flow transmission system can be found in the method limitations section above, and will not be repeated here. Each module in the aforementioned service flow transmission system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0154] Example 5
[0155] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of a service flow transmission method.
[0156] This computer device can be a terminal, and its internal structure diagram can be as follows: Figure 5As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a business flow transmission method. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse, etc.
[0157] Those skilled in the art should understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0158] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0159] Receive the target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow based on the traffic tag;
[0160] In response to the virtual LAN enabling load balancing, multiple Ethernet interfaces corresponding to the target service flow are obtained from the configuration table based on the traffic tags, and the interface status of the multiple Ethernet interfaces is obtained.
[0161] In response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two, the Ethernet interface with a normal interface status is determined as the target interface.
[0162] The target service flow is allocated and transmitted through the link corresponding to the target interface.
[0163] Example 6
[0164] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps:
[0165] Receive the target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow based on the traffic tag;
[0166] In response to the virtual LAN enabling load balancing, multiple Ethernet interfaces corresponding to the target service flow are obtained from the configuration table based on the traffic tags, and the interface status of the multiple Ethernet interfaces is obtained.
[0167] In response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two, the Ethernet interface with a normal interface status is determined as the target interface.
[0168] The target service flow is allocated and transmitted through the link corresponding to the target interface.
[0169] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0170] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0171] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A service flow transmission method, characterized in that, The method includes: Receive the target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow based on the traffic tag; In response to the virtual LAN enabling load balancing, multiple Ethernet interfaces corresponding to the target service flow are obtained from the configuration table based on the traffic tags, and the interface status of the multiple Ethernet interfaces is obtained. In response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two, the Ethernet interface with a normal interface status is determined as the target interface. The target service flow is allocated and transmitted through the link corresponding to the target interface; The step of responding to the virtual local area network enabling load balancing by retrieving multiple Ethernet interfaces corresponding to the target service flow from the configuration table based on the traffic tags includes: In response to the virtual LAN enabling load balancing, determine whether the service flow tag belongs to the load balancing tag to be executed; In response to the fact that the service flow label belongs to the load balancing label to be executed, it is determined whether the virtual LAN corresponding to the service flow label has a binding interface; In response to the existence of a binding interface in the virtual LAN corresponding to the service flow label, multiple Ethernet interfaces corresponding to the target service flow are obtained from the configuration table based on the traffic label.
2. The service flow transmission method according to claim 1, characterized in that, Before receiving the target service stream, the method further includes: Create a virtual LAN on the switch, obtain an Ethernet interface, and add the Ethernet interface to the corresponding virtual LAN. Identify the virtual local area networks (VLANs) that require load balancing and configure load balancing attributes for those VLANs. The load balancing attribute indicates whether the virtual local area network is configured with load balancing functionality.
3. The service flow transmission method according to claim 2, characterized in that, Before receiving the target service stream, the method further includes: The load distribution attribute is determined to be a virtual local area network with load distribution function configured and its corresponding Ethernet interface; Establish a binding relationship between the virtual LAN configured with load distribution attribute and its corresponding Ethernet interface, and store the binding relationship in the configuration table.
4. The service flow transmission method according to claim 1, characterized in that, The method further includes: In response to the fact that the service flow label does not belong to the load distribution label to be executed, or the virtual LAN corresponding to the service flow label does not have a bound interface, or the number of Ethernet interfaces with a normal interface status is less than two; The Ethernet interface connected to the virtual local area network corresponding to the target service flow is identified as the target interface, and the target service flow is transmitted through the target interface in a polling manner.
5. The service flow transmission method according to claim 1, characterized in that, The method further includes: In response to the fact that the target service flow is a service flow from the switch and the number of Ethernet interfaces with a normal interface status is greater than or equal to two, the Ethernet interface with a normal interface status is determined as the target interface. The traffic of the target service flow is transmitted through an Ethernet interface other than the target interface.
6. The service flow transmission method according to claim 1, characterized in that, The step of performing traffic allocation and transmission of the target service flow through the link corresponding to the target interface includes: The traffic of the target service flow is split into sub-traffic based on the number of target interfaces, and each sub-traffic corresponds one-to-one with the target interface; The sub-traffic is transmitted through its corresponding target interface.
7. A service flow transmission system for implementing the service flow transmission method as described in any one of claims 1-6, characterized in that, The system includes: The service flow matching module is used to receive a target service flow, obtain the traffic tag of the target service flow, and match the corresponding virtual local area network for the target service flow according to the traffic tag; The interface acquisition module is used to respond to the virtual local area network enabling the load balancing function, acquire multiple Ethernet interfaces corresponding to the target service flow from the configuration table according to the traffic tag, and acquire the interface status of the multiple Ethernet interfaces; The target interface module is used to determine the Ethernet interface with a normal interface status as the target interface in response to the fact that the target service flow is a service flow from the terminal and the number of Ethernet interfaces with a normal interface status is greater than or equal to two. The traffic allocation and transmission module is used to perform traffic allocation and transmission of the target service flow through the link corresponding to the target interface.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program that, when executed by a processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Flow load sharing method and device based on link aggregation
CN103763210A