Link Processing Method, Electronic Device, Storage Medium, and Computer Program Product
By dividing the network ports at the logical level and determining the subnet ports and subports, the accuracy of the communication link between the multi-host network card and the switch is solved, and the reliability and performance of the network connection are improved.
Patent Information
- Application Number
- CN202510333104.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-03-20
AI Technical Summary
When a multi-host network card establishes a communication link with a switch, the prior art cannot accurately distinguish whether multiple protocol messages received come from different hosts of the same multi-host network card, resulting in the inability to accurately establish or maintain the communication link.
By dividing the network ports on the network card at the logical level, multiple subnet ports are obtained, and the subnet ports and subports associated with each host are determined, and then the molecular links are divided into the communication link to ensure that the switch can accurately identify messages from different hosts.
It realizes the establishment and maintenance of accurate communication links between multi-host network cards and switches, and improves the reliability and performance of network connections.
Smart Images

Figure CN119854242B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a link processing method, an electronic device, a storage medium, and a computer program product. Background Art
[0002] In the process of network communication, the reliability and performance of network connections are crucial. For application scenarios with high availability and high reliability, the network interface card binding technology can be used to bind the network interfaces of the network card, so that the network card establishes communication links with the switch through the bound network interfaces, and the communication links between the bound network interfaces and the switch are aggregated links, realizing load balancing and redundant backup of the communication links between the network card and the switch.
[0003] In the related art, after the network card binds the network interfaces through the network card binding technology, it sends a protocol packet to the switch. The protocol packet is a protocol packet corresponding to the host connected to the network card. After receiving the protocol packet sent by the network card, the switch starts to establish a communication link with the network card. After the network card establishes a communication link with the switch, it regularly sends protocol packets to the switch to maintain the state of the communication link.
[0004] However, since a multi-host network card is connected to multiple hosts, in the process of establishing a communication link between the multi-host network card and the switch through the above method, the multi-host network card sends protocol packets corresponding to each of the multiple hosts to the switch. After receiving the multiple protocol packets sent by the multi-host network card, the switch may determine the multiple protocol packets as different link requests because it cannot distinguish whether the received multiple protocol packets are from different hosts of the same multi-host network card and the hosts corresponding to the multiple protocol packets respectively, resulting in the inability to accurately establish or maintain the communication link. Therefore, there is an urgent need for a link processing method for multi-host network cards. Summary of the Invention
[0005] This application provides a link processing method, an electronic device, a storage medium, and a computer program product for accurately establishing a link between a multi-host network card and a switch.
[0006] This application provides a link processing method, including:
[0007] Dividing the network interfaces on the network card according to the multiple hosts connected to the network card to obtain multiple sub-network interfaces corresponding to the network interfaces; wherein, a communication link is established between the network card and the switch through the network interfaces and the ports on the switch;
[0008] Sending the identifiers of the multiple sub-network interfaces to the client;
[0009] Receive the first indication information sent by the client. The first indication information is used to indicate, among multiple sub-network ports, the sub-network ports respectively associated with multiple hosts, and to indicate, among multiple sub-ports, the sub-ports respectively associated with multiple hosts; wherein, the multiple sub-ports are obtained by dividing the ports on the switch.
[0010] Divide the communication link according to the sub-network ports respectively associated with multiple hosts and the sub-ports respectively associated with them, to obtain the sub-links corresponding to the network ports of multiple hosts respectively.
[0011] This application also provides a link processing method, including:
[0012] Receive the identifiers of multiple sub-network ports respectively sent by the server. The multiple sub-network ports are obtained by dividing the network ports on the network card; wherein, a communication link is established between the network card and the switch through the network ports and the ports on the switch.
[0013] Determine the sub-network ports respectively associated with multiple hosts and the sub-ports respectively associated with multiple hosts according to the identifiers of multiple sub-network ports respectively and the identifiers of multiple sub-ports respectively; wherein, the multiple hosts are the hosts connected to the network card.
[0014] Send the first indication information to the server. The first indication information is used to indicate, among multiple sub-network ports, the sub-network ports respectively associated with multiple hosts, and to indicate, among multiple sub-ports, the sub-ports respectively associated with multiple hosts; the first indication information is used to establish the sub-link corresponding to the network port of the host.
[0015] This application also provides a link processing method, including:
[0016] Receive the second indication information sent by the client. The second indication information is used to indicate the quantity of multiple sub-network ports. The multiple sub-network ports are obtained by dividing the network ports on the network card; wherein, a communication link is established between the network card and the switch through the network ports and the ports on the switch.
[0017] Divide the ports according to the quantity of multiple sub-network ports, to obtain multiple sub-ports.
[0018] Send the second response information to the client. The second response information includes the identifiers of multiple sub-ports respectively.
[0019] This application also provides an electronic device, including: a memory, used for storing a computer program; a processor, used for implementing the steps of any of the above link processing methods when executing the computer program.
[0020] This application also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. Wherein, when the computer program is executed by the processor, the steps of any of the above link processing methods are implemented.
[0021] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above link processing methods when executed by a processor.
[0022] For the link processing method, electronic device, storage medium and computer program product provided by the embodiments of the present application, according to the number of multiple hosts connected to the network card, the network ports on the network card are divided at the logical level to obtain multiple sub-network ports corresponding to the network ports. For each host among the multiple hosts, determine the sub-network port associated with the host in the network card and the sub-port associated with the host in the switch, and then divide the sub-links corresponding to the host on each network port in the communication link between the network card and the switch according to the sub-network port associated with the host in the network card and the sub-port associated with the host in the switch. In this way, the network card can send the packets corresponding to the host to the switch through the sub-links corresponding to the host on each network port. After the switch receives multiple packets sent by the network card, it can distinguish that each packet comes from different hosts of a network card and distinguish the hosts corresponding to multiple packets respectively, so as to accurately establish or maintain the communication link. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0024] Figure 1 Schematic diagram of establishing a communication link between a single-host network card and a switch provided by an embodiment of the present application;
[0025] Figure 2 Schematic diagram of an application scenario provided by an embodiment of the present application;
[0026] Figure 3 Schematic flowchart of a link processing method provided by an embodiment of the present application;
[0027] Figure 4 Schematic signaling diagram of a link processing method provided by an embodiment of the present application;
[0028] Figure 5 Schematic diagram of network port division provided by an embodiment of the present application;
[0029] Figure 6 Schematic diagram of creating a sub-link group provided by an embodiment of the present application;
[0030] Figure 7 Schematic structure of a link processing device provided by an embodiment of the present applicationFigure 1 ;
[0031] Figure 8 The structural schematic diagram of a link processing device provided by an embodiment of the present application Figure 2 ;
[0032] Figure 9 The structural schematic diagram of a link processing device provided by an embodiment of the present application Figure 3 ;
[0033] Figure 10 The structural schematic diagram of the electronic device provided by the present application. Detailed implementation manners
[0034] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0035] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0036] First, the terms involved in the present application are explained:
[0037] Network card bonding technology refers to bonding multiple network cards together to form a logical network card. In this way, the bandwidth of the network card can be increased, and at the same time, link redundancy can be achieved. In some embodiments, network card bonding technology can implement bonding between multiple network interfaces, enabling multiple network interfaces to be used as a logical interface. Therefore, for a multi-port network card, network card bonding technology can be used to bond multiple ports of the network card to achieve link aggregation between the network card and the switch. The bonding mode of network card bonding technology can be, for example, IEEE 802.3ad Dynamic Link Aggregation. Taking the network card bonding technology with the bonding mode of IEEE 802.3ad Dynamic Link Aggregation to bond multiple ports of the network card as an example, the multiple bonded ports enable the Link Aggregation Control Protocol (LACP) and maintain the status of each port according to the LACP packets. After using network card bonding technology to bond multiple ports of a multi-port network card, the links of the multiple ports are aggregated links. In this way, load balancing of the network card and redundant backup of the communication link between the network card and the switch can be achieved.
[0038] A single-host network card provides network connection services specifically for a single host. For the host connected by the single-host network card, the single-host network card can enable the host to access a local area network or a wide area network to achieve Internet access, data transmission, etc. A single host can be, for example, a device such as a server or a virtual machine.
[0039] A multi-host network card can provide network connection services for multiple hosts at the same time. For the multiple hosts connected by the multi-host network card, the multi-host network card can enable the multiple hosts to access a local area network or a wide area network through the multi-host network card. The multi-host network card has multiple interfaces respectively used to connect multiple hosts. The multiple hosts can be, for example, multiple servers or multiple virtual machines, etc.
[0040] In the related art, taking the bonding mode of IEEE 802.3ad Dynamic Link Aggregation as an example for a single-host network card including multiple ports, after using network card bonding technology to bond multiple ports of the single-host network card, the way to establish a communication link between the network card and the switch can be: after the single-host network card starts network card bonding, it sends LACP packets to the switch through the ports of the single-host network card. The LACP packets are the LACP packets corresponding to the host connected by the single-host network card. After the switch receives the protocol packets sent by the single-host network card, it starts to establish a communication link with the single-host network card. After the single-host network card and the switch establish a communication link, they will regularly send LACP packets to the switch to maintain the status of the communication link between them. It should be noted that both the switch and the single-host network card support the LACP protocol.
[0041] Exemplarily, taking a single-host network card as a dual-port network card as an example for illustration, it can be understood in combination with Figure 1 For understanding. Figure 1 The following is a schematic diagram of a single-host network card establishing a communication link with a switch provided by an embodiment of the present application. Please refer to Figure 1 , the single-host network card 11 includes a first network port 12 and a second network port 13. The single-host network card 11 is connected to the first switch 14 through the first network port 12 and connected to the second switch 15 through the second network port 13. The host connected to the single-host network card 11 is the host 16. The method for the single-host network card 11 to establish communication links with the first switch 14 and the second switch 15 respectively is as follows: The single-host network card 11 sends the LACP packet corresponding to the host 16 to the first switch 14 through the first network port 12. After receiving the LACP packet, the first switch 14 establishes a communication link with the single-host network card 11 according to the LACP packet, and the communication link between the first switch 14 and the single-host network card 11 is the communication link A. Then, the single-host network card 11 periodically sends LACP packets to the first switch 14 through the first network port 12 to maintain the state of the communication link A. The single-host network card 11 sends the LACP packet corresponding to the host 16 to the second switch 15 through the second network port 13. After receiving the LACP packet, the second switch 15 establishes a communication link with the single-host network card 11 according to the LACP packet, and the communication link between the second switch 15 and the single-host network card 11 is the communication link B. The single-host network card 11 periodically sends LACP packets to the second switch 15 through the second network port 13 to maintain the state of the communication link B.
[0042] However, when establishing a communication link between a multi-host network card and a switch through the above method, since the multi-host network card is connected to multiple hosts, the multi-host network card sends multiple LACP packets to the switch. The multiple LACP packets are respectively the LACP packets corresponding to the multiple hosts, and the multiple hosts are the multiple hosts connected to the multi-host network card. After receiving the multiple LACP packets, the switch cannot distinguish whether the received multiple LACP packets are from the multiple hosts of the same multi-host network card, resulting in an incorrect judgment of the state of the link with the multi-host network card. It may determine the LACP packets corresponding to the multiple hosts respectively as different link requests, resulting in an inability to accurately establish or maintain the communication link.
[0043] An embodiment of the present application provides a link processing method. By dividing the network interfaces on a network card at the logical level, a plurality of sub-network interfaces corresponding to the network interfaces are obtained, and the sub-network interfaces associated with each of the plurality of hosts and the sub-ports associated with each of the plurality of hosts in a switch are determined. Then, according to the sub-network interface associated with the host in the network card and the sub-port associated with the host in the switch, in the communication link between the network card and the switch, the sub-links corresponding to the host on each network interface are divided. In this way, the network card can send the LACP packets corresponding to the host to the switch through the sub-links corresponding to each host, and the switch can receive the LACP packets corresponding to each host through the sub-links corresponding to each host, so as to distinguish that each LACP packet comes from different hosts on the same network card and distinguish the hosts corresponding to each of the plurality of LACP packets, and further accurately establish or maintain the communication link.
[0044] To enable those skilled in the art of this technology to better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0045] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the link processing method depends, the specific application environment architecture or specific hardware architecture is described herein. Refer to Figure 2 , Figure 2 is a schematic diagram of the application scenario provided by the embodiment of the present application. As Figure 2 shown, it includes a multi-host network card 21, a third switch 22, a fourth switch 23, a first host 24, and a second host 25. Among them, the multi-host network card 21 is respectively connected to the first host 24 and the second host 25, and the first host 24 and the second host 25 access a local area network or a wide area network through the multi-host network card 21. The first host 24 and the second host 25 can be network devices such as servers or virtual machines.
[0046] In the actual application process, the multi-host network card 21 includes a third network interface 26 and a fourth network interface 27, and the multi-host network card 21 can establish a communication link with the third switch 22 through the third network interface 26 and communicate with the third switch 22 through this communication link; the multi-host network card 21 can establish a communication link with the fourth switch 23 through the fourth network interface 27 and communicate with the fourth switch 23 through this communication link. Exemplarily, assume that the multi-host network card 21 establishes a communication link A with the third switch 22 through the third network interface 26, then the multi-host network card 21 communicates with the third switch 22 through the communication link A; assume that the multi-host network card 21 establishes a communication link B with the fourth switch 23 through the fourth network interface 27, then the multi-host network card 21 communicates with the fourth switch 23 through the communication link B.
[0047] It should be noted that, Figure 2It is only an example to illustrate an application scenario, and does not limit the application scenario.
[0048] The following uses specific embodiments to describe in detail the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems. These several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0049] Figure 3 It is a schematic flowchart of a link processing method provided by an embodiment of the present application. As Figure 3 shown, an embodiment of the present application provides a link processing method, and the method is described in detail as follows:
[0050] S301: Divide the network interfaces on the network card according to multiple hosts connected to the network card to obtain multiple sub-network interfaces corresponding to the network interfaces; wherein, a communication link is established between the network card and the switch through the network interfaces and the ports on the switch.
[0051] The execution subject of the present application can be a server, and the server includes a main board and a multi-host network card, or can be a link processing device set in the server. The link processing device can be implemented by software, or by a combination of software and hardware.
[0052] The network card refers to a multi-host network card, and the multi-host network card includes multiple interfaces for connecting multiple hosts. Therefore, the multiple hosts connected to the network card refer to multiple different hosts connected to the network card through the multiple interfaces of the network card. The multiple hosts connected to the network card can be multiple servers, multiple virtual machines or other network devices. Exemplarily, assume that the network card includes interface 1, interface 2, and interface 3, and host a is connected to the network card through interface 1, host b is connected to the network card through interface 2, and host c is connected to the network card through interface 3. Therefore, the multiple hosts connected to the network card are host a, host b, and host c respectively.
[0053] The network card also includes at least one network port for establishing a communication link with the port on the switch, that is, a communication link can be established between the network card and the switch through the network port and the port on the switch. For each network port on the network card, after a communication link is established between the network card and the switch through the network port and the port on the switch, the network card firmware divides the network port, and logically divides the network port into multiple sub-network ports. Therefore, multiple sub-network ports refer to dividing at least one network port of the network card respectively to obtain multiple sub-network ports corresponding to each network port at the logical level. Exemplarily, assume that the network card includes network port M and network port N. After a communication link is established between the network card and the switch through network port M and the port on the switch, network port M is divided to obtain multiple sub-network ports corresponding to network port M at the logical level as sub-network port x and sub-network port y; after a communication link is established between the network card and the switch through network port N and the port on the switch, network port N is divided to obtain multiple sub-network ports corresponding to network port N at the logical level as sub-network port z and sub-network port o.
[0054] In some embodiments, the network card is inserted on the motherboard. After the network card is inserted on the motherboard, the motherboard detects the connection status between the host and the network card by sending a detection signal to the network card. When the motherboard detects that the network card is a multi-host network card, it sends an indication message to the server to indicate to divide the network ports on the network card. After receiving the indication message, the server divides the network ports on the network card.
[0055] S302: Send the identifiers of the multiple sub-network ports to the client.
[0056] The client can be the client of the link processing system. The link processing system can be the software or hardware system of the link processing method provided in this application. The client of the link processing system can be, for example, the front-end page of the link processing system. The client can display information such as the connection relationship between the network card and the host, the communication link established between the network card and the switch, and the status of each communication link.
[0057] For each network port of the network card, after dividing the network port to obtain multiple sub-network ports corresponding to the network port, the server sends the identifiers of the multiple sub-network ports to the client.
[0058] Exemplarily, for each network port of the network card, assume that after dividing the network port, the multiple sub-network ports corresponding to the network port are sub-network port x, sub-network port y, sub-network port z, and sub-network port o respectively, where the identifier of sub-network port x is P0, the identifier of sub-network port y is P1, the identifier of sub-network port z is P2, and the identifier of sub-network port o is P3. Then the server sends the identifier P0 of sub-network port x, the identifier P1 of sub-network port y, the identifier P2 of sub-network port z, and the identifier P3 of sub-network port o to the client.
[0059] S303: Receive the first indication information sent by the client. The first indication information is used to indicate, among multiple subnet ports, the subnet ports respectively associated with multiple hosts, and, among multiple sub-ports, the sub-ports respectively associated with multiple hosts; wherein the multiple sub-ports are obtained by dividing the ports on the switch.
[0060] The subnet ports respectively associated with multiple hosts means that, for each host, the network card sends the LACP packet corresponding to the host to the switch through the subnet port associated with the host. Exemplarily, assume the multiple hosts are host 1 and host 2 respectively. Among them, the subnet port associated with host 1 is subnet port x, and the subnet port associated with host 2 is subnet port y. Then the network card sends the LACP packet corresponding to host 1 to the switch through subnet port x, and the network card sends the LACP packet corresponding to host 2 to the switch through subnet port y.
[0061] The sub-ports respectively associated with multiple hosts means that, for each host, the switch receives the LACP packet corresponding to the host sent by the network card through the sub-port associated with the host. Exemplarily, assume the multiple hosts are host 1 and host 2 respectively. Among them, the sub-port associated with host 1 is sub-port r, and the sub-port associated with host 2 is sub-port s. Then the switch receives the LACP packet corresponding to host 1 sent by the network card through sub-port r, and the switch receives the LACP packet corresponding to host 2 sent by the network card through sub-port s.
[0062] In some embodiments, the first indication information is further used to indicate information such as the Internet Protocol Address (IP address), subnet mask, network address, broadcast address, etc. of each of the multiple subnet ports.
[0063] S304: Divide the communication link according to the subnet ports respectively associated with multiple hosts and the sub-ports respectively associated with them, to obtain the sub-links corresponding to each host at the network port.
[0064] Since a communication link is established between the network card and the switch through the network port of the network card and the port of the switch, after dividing the network port, the communication link between the network card and the switch can be divided logically according to the subnet ports respectively associated with multiple hosts and the sub-ports respectively associated with multiple hosts, to obtain the sub-link corresponding to each host in the communication link. The sub-links corresponding to each host at the network port mean the sub-links obtained by logically dividing the communication link according to the subnet ports respectively associated with multiple hosts and the sub-ports respectively associated with them.
[0065] Among multiple hosts connected to a network card, each host has a corresponding sub-link on each network interface, and the sub-links corresponding to each host on each network interface are independent. For each host, the network card can send the LACP packet corresponding to the host to the switch through the sub-link corresponding to the host. In this way, after receiving the LACP packet transmitted by any sub-link, the switch can identify that the LACP packet is the LACP packet corresponding to the host corresponding to the sub-link, so as to accurately establish and maintain a communication link.
[0066] In addition, during the process of the network card communicating with the switch through the sub-link corresponding to the host, the transmitted data is the relevant data of the host. For example, the transmitted data can be the service data of the host, protocol packets related to the host, etc. In this way, after receiving the data transmitted by any sub-link, the switch can identify that the data comes from the host corresponding to the sub-link, so as to enable each host to communicate with the switch independently through the network card of the server.
[0067] In Figure 3 In the shown embodiment, at the logical level, the network interfaces on the network card are divided to obtain multiple sub-network interfaces corresponding to the network card. Then, according to the first indication information, among the multiple hosts connected to the network card, the sub-network interfaces associated with each host and the sub-ports associated with each host are determined. And according to the sub-network interfaces associated with each host and the sub-ports associated with each host, the link between the sub-network interface associated with each host and the sub-port associated with each host is determined in the communication link, and in the communication link, the link between the sub-network interface associated with each host and the sub-port associated with each host is divided to obtain the sub-link corresponding to each host. Through the above link processing method, after dividing the network interfaces on the network card to obtain multiple sub-network interfaces, according to the sub-network interfaces associated with each host and the sub-ports associated with each host, the sub-link corresponding to the host is divided in the communication link, and each obtained sub-link corresponding to each host is independent. In this way, the network card can send the LACP packet corresponding to the host to the switch through the sub-link corresponding to the host. So that after receiving multiple LACP packets sent by the network card, the switch can identify that each LACP packet comes from different hosts on one network card and identify the host corresponding to each of the multiple LACP packets, so as to accurately establish or maintain a communication link.
[0068] In Figure 3 Based on the shown embodiment, below, in combination with Figure 4 A further description of the link processing method provided in the embodiments of the present application is given.
[0069] Figure 4 The signaling diagram of a link processing method provided in the embodiments of the present application is as Figure 3 shown, and this process may include the following steps:
[0070] S401: The server divides the network interfaces on the network card to obtain multiple sub-network interfaces corresponding to the network interfaces.
[0071] In some embodiments, the way for the server to divide the network interfaces on the network card may be as follows: determine the number of multiple hosts; according to the number of multiple hosts, divide the network interfaces to obtain multiple sub-network interfaces corresponding to the network interfaces; wherein, the number of multiple hosts is equal to the number of multiple sub-network interfaces corresponding to the network interfaces.
[0072] It can be understood in combination with Figure 5 For understanding, Figure 5 A schematic diagram of network interface division provided by an embodiment of the present application is shown in Figure 5 , including a network card 51, where the network card 51 is respectively connected to a third host 52, a fourth host 53, and a fifth host 54, and the network card 51 includes a fifth network interface 55 and a sixth network interface 56. Since the network card 51 is respectively connected to the third host 52, the fourth host 53, and the fifth host 54, it is determined that the number of multiple hosts connected to the network card 51 is 3. According to the number of multiple hosts, the fifth network interface 55 is divided to obtain sub-network interfaces x, y, and z, then the multiple sub-network interfaces corresponding to the fifth network interface 55 are respectively sub-network interfaces x, y, and z; according to the number of multiple hosts, the sixth network interface 56 is divided to obtain sub-network interfaces o, p, and q, then the multiple sub-network interfaces corresponding to the sixth network interface 56 are respectively sub-network interfaces o, p, and q.
[0073] S402: The server sends the identifiers of multiple sub-network interfaces to the client.
[0074] For the specific introduction of the server sending the identifiers of multiple sub-network interfaces to the client, please refer to Figure 3 S302 in the shown embodiment, which will not be elaborated here.
[0075] S403: The client sends second indication information to the switch, and the second indication information is used to indicate the number of multiple sub-network interfaces.
[0076] After receiving the identifiers of multiple sub-network interfaces sent by the server, the client sends second indication information to the switch to indicate the number of multiple sub-network interfaces obtained by dividing the network interfaces on the network card. Exemplarily, assume that after the client receives the identifiers of multiple sub-network interfaces sent by the server as: the identifier P0 of sub-network interface x, the identifier P1 of sub-network interface y, the identifier P2 of sub-network interface z, and the identifier P3 of sub-network interface o, the client sends second indication information, and the second indication information is used to indicate that the number of multiple sub-network interfaces is 4.
[0077] S404: The switch divides the ports according to the number of multiple sub-network interfaces to obtain multiple sub-ports.
[0078] After receiving the second indication information sent by the client, the switch divides the ports for establishing a communication link with the network card according to the number of multiple sub-network ports indicated by the second indication information, obtaining multiple sub-ports, and the number of the obtained multiple sub-ports is the same as the number of the multiple sub-network ports.
[0079] Exemplarily, assuming that the second indication information indicates that the number of multiple sub-network ports is 4, the switch divides the ports for establishing a communication link with the network card, and the number of the obtained multiple sub-ports is 4.
[0080] In some embodiments, the method for dividing the ports for establishing a communication link between the switch and the network card may be, for example, through a Virtual Local Area Network (VLAN), Port Split technology, etc.
[0081] S405: The switch sends second response information to the client, and the second response information includes the identifiers of the multiple sub-ports respectively.
[0082] For each sub-port, the identifier of the sub-port is used to identify the sub-port.
[0083] Exemplarily, assuming that the multiple sub-ports are sub-port r, sub-port s, and sub-port t respectively, where the identifier of sub-port r is D0, the identifier of sub-port s is D1, and the identifier of sub-port t is D2, the second response information sent by the switch to the client includes: the identifier D0 of sub-port r, the identifier D1 of sub-port s, and the identifier D2 of sub-port t.
[0084] S406: The client determines the sub-network ports respectively associated with the multiple hosts and the sub-ports respectively associated with the multiple hosts according to the identifiers of the multiple sub-network ports respectively and the identifiers of the multiple sub-ports respectively; wherein, the multiple hosts are the hosts connected by the network card.
[0085] After the client receives the second response information sent by the switch, it determines the sub-ports associated with each of the multiple hosts according to the identifiers of the multiple sub-ports in the second response information. The method for determining the sub-ports associated with each of the multiple hosts can be as follows: Select the first host among the multiple hosts, randomly determine a sub-port among the multiple sub-ports as the sub-port associated with the first host, and then, according to the identifier of this sub-port, perform an association process between the first host and this sub-port; Select the second host among the multiple hosts, randomly determine a sub-port among at least one of the multiple sub-ports other than the sub-port associated with the first host as the sub-port associated with the second host, and then, according to the identifier of this sub-port, perform an association process between the second host and this sub-port; And so on, until the sub-port associated with the last host among the multiple hosts is determined, and according to the identifier of this sub-port, perform an association process between the last host and this sub-port.
[0086] Similarly, the method for determining the sub-network ports associated with each of the multiple hosts according to the identifiers of the multiple sub-network ports sent by the server can be as follows: Select the first host among the multiple hosts, randomly determine a sub-network port among the multiple sub-network ports as the sub-network port associated with the first host, and then, according to the identifier of this sub-network port, perform an association process between the first host and this sub-network port; Select the second host among the multiple hosts, randomly determine a sub-network port among at least one of the multiple sub-network ports other than the sub-network port associated with the first host as the sub-network port associated with the second host, and then, according to the identifier of this sub-network port, perform an association process between the second host and this sub-network port; And so on, until the sub-network port associated with the last host among the multiple hosts is determined, and according to the identifier of this sub-network port, perform an association process between the last host and this sub-network port.
[0087] S407: The client sends first indication information to the server, and the first indication information is used to establish a sub-link corresponding to a host at a network port.
[0088] The first indication information is used to indicate, among the multiple sub-network ports, the sub-network ports associated with each of the multiple hosts, and to indicate, among the multiple sub-ports, the sub-ports associated with each of the multiple hosts. After receiving the first indication information, the server can divide the communication link according to the sub-network ports associated with each of the multiple hosts and the sub-ports associated with each of the multiple hosts indicated by the first indication information, so as to obtain the sub-links corresponding to each of the multiple hosts at the network port. Therefore, the first indication information can be used to establish a sub-link corresponding to a host at a network port.
[0089] In some embodiments, after receiving the first indication information, the server may determine the bandwidths of the subnet interfaces associated with multiple hosts respectively according to the load traffic of each host in a historical period, and the method may be as follows: Obtain the load traffic of each host in the historical period; Determine the bandwidths of the subnet interfaces associated with multiple hosts respectively according to the load traffic of each host in the historical period; wherein, the bandwidth of the subnet interface associated with a host is positively correlated with the magnitude of the load traffic of the host.
[0090] For each host among the multiple hosts, the load traffic of the host in the historical period is used to represent: the amount of data or the data transmission rate transmitted by the host through the network link. The larger the amount of data or the data transmission rate transmitted by the host through the network link in the historical period, the larger the bandwidth of the subnet interface associated with the host; the smaller the amount of data or the data transmission rate transmitted by the host through the network interface link in the historical period, the smaller the bandwidth of the subnet interface associated with the host, that is, the larger the load traffic of the host in the historical period, the larger the bandwidth of the subnet interface associated with the host; the smaller the load traffic of the host in the historical period, the smaller the bandwidth of the subnet interface associated with the host.
[0091] In some embodiments, the subnet interfaces associated with multiple hosts may be adjusted according to the current load traffic of each host, and the method may be as follows: Obtain the current load traffic of each host; Adjust the bandwidths of the subnet interfaces associated with multiple hosts respectively according to the current load traffic of each host to obtain the updated bandwidths of the subnet interfaces associated with multiple hosts respectively.
[0092] For each host among the multiple hosts, the current load traffic of the host refers to the load traffic of the host at the current moment. If the load traffic of the host at the current moment is large, increase the bandwidth of the subnet interface associated with the host. At this time, the updated bandwidth of the subnet interface associated with the host obtained is the increased bandwidth of the subnet interface associated with the host. If the load traffic of the host at the current moment is small, decrease the bandwidth of the subnet interface associated with the host. At this time, the updated bandwidth of the subnet interface associated with the host obtained is the decreased bandwidth of the subnet interface associated with the host. Therefore, when the current load traffic of the host is large, increase the bandwidth of the subnet interface associated with the host; when the current load traffic of the host is small, decrease the bandwidth of the subnet interface associated with the host. In this way, the utilization rate of bandwidth resources can be improved and the waste of bandwidth resources can be avoided.
[0093] S408: The server divides the communication link according to the subnet interfaces and sub-ports respectively associated with multiple hosts to obtain the sub-links corresponding to each host at the network interface.
[0094] The server divides the communication link according to the subnet ports and sub - ports respectively associated with multiple hosts. For the specific introduction of the sub - links corresponding to the network ports of multiple hosts respectively, reference can be made to Figure 3 S304 in the illustrated embodiment, which will not be elaborated here.
[0095] In Figure 4 In the illustrated embodiment, after the server divides the network ports on the network card, multiple subnet ports corresponding to the network card are obtained, and then the server sends the identifiers of the multiple subnet ports to the client. After receiving the identifiers of the multiple subnet ports sent by the server, the client sends the number of the multiple subnet ports to the switch. The switch divides the ports connected to the network card of the server according to the number of the multiple subnet ports, obtaining multiple sub - ports. Then, the client determines the subnet ports respectively associated with multiple hosts and the sub - ports respectively associated with multiple hosts according to the identifiers of the multiple subnet ports and the identifiers of the multiple sub - ports, and sends the subnet ports respectively associated with multiple hosts and the sub - ports respectively associated with multiple hosts to the server through the first indication information. The server divides the communication link according to the subnet ports respectively associated with multiple hosts and the sub - ports respectively associated with multiple hosts indicated in the first indication information, obtaining the sub - links corresponding to the network ports of multiple hosts respectively. In the above implementation, after the server divides the network ports on the network card, the switch divides the ports of the switch accordingly according to the number of the multiple subnet ports. Then, the client determines the sub - ports respectively associated with multiple hosts and the subnet ports respectively associated with multiple hosts. Finally, the server divides the communication link according to the sub - ports respectively associated with multiple hosts and the subnet ports respectively associated with multiple hosts, obtaining the sub - links corresponding to the network ports of multiple hosts respectively, so as to realize dividing the sub - links corresponding to each host in the communication link. In this way, after the switch receives multiple LACP packets, it can determine, through the transmission sub - links of the multiple LACP packets, that the LACP packets are the LACP packets corresponding to different hosts on the same network card and determine the hosts corresponding to the multiple LACP packets respectively, so as to accurately establish or maintain the link.
[0096] In the above - mentioned embodiment, a link processing method provided by an embodiment of the present application is introduced. Since the network ports of the network card are bound through the network card bonding technology, after obtaining the sub - links corresponding to multiple hosts respectively, the association operation can be performed on the sub - links corresponding to the network ports of each host on multiple network cards. The following further describes the process of performing the association operation on the sub - links corresponding to the network ports of each host on multiple network cards provided by the embodiment of the present application in combination with specific embodiments.
[0097] For each of multiple hosts, an association operation is performed on the sub-links corresponding to each of the multiple network interfaces of the host to obtain a sub-link group corresponding to the host. Among them, each sub-link in the sub-link group is used for the host to communicate with the corresponding switch.
[0098] For each of multiple hosts, the sub-link group corresponding to the host includes the sub-links corresponding to each of the multiple network interfaces of the host. It can be understood in combination with Figure 6 this. Figure 6 This is a schematic diagram of creating a sub-link group provided by an embodiment of the present application. As Figure 6 shown, it includes a network card 51. The network card 51 includes a fifth network interface 55 and a sixth network interface 56, and the network card 51 is connected to a third host 52 and a fourth host 53. Through Figure 3 the link processing method in the embodiment shown or Figure 4 the embodiment shown, the fifth network interface 55 is divided into a sub-network interface x and a sub-network interface y, the sixth network interface 56 is divided into a sub-network interface z and a sub-network interface o, the port of the fifth switch 61 is divided into a sub-port r and a sub-port s, and the port of the sixth switch 62 is divided into a sub-port t and a sub-port u. Among them, the sub-network interfaces associated with the third host 52 are the sub-network interface x and the sub-network interface z, and the sub-ports associated with the third host 52 are the sub-port r and the sub-port t; the sub-network interfaces associated with the fourth host 53 are the sub-network interface y and the sub-network interface o, and the sub-ports associated with the fourth host 53 are the sub-port s and the sub-port u. According to the sub-network interfaces associated with the third host 52 and the sub-ports associated with the third host 52, it is determined that the sub-link corresponding to the third host 52 on the fifth network interface 55 is sub-link A, and the sub-link corresponding to the third host 52 on the sixth network interface 56 is sub-link B; according to the sub-network interfaces associated with the fourth host 53 and the sub-ports associated with the fourth host 53, it is determined that the sub-link corresponding to the fourth host 53 on the fifth network interface 55 is sub-link C, and the sub-link corresponding to the fourth host 53 on the sixth network interface 56 is sub-link D. Then, an association operation is performed on sub-link A and sub-link B to obtain sub-link group 1, where sub-link group 1 includes sub-link A and sub-link B; an association operation is performed on sub-link C and sub-link D to obtain sub-link group 2, where sub-link group 2 includes sub-link C and sub-link D.
[0099] It should be noted that load balancing or redundancy backup can be performed between the sub-links in the sub-link group.
[0100] In some embodiments, the way to perform load balancing among sub-links in a sub-link group can be as follows: Determine the load traffic of each sub-link in the sub-link group corresponding to the host; When there is a first sub-link in the sub-link group whose load traffic is greater than or equal to the preset load traffic, determine a second sub-link in the sub-link group according to the load traffic of each sub-link in the sub-link group, and the load traffic of the second sub-link is less than the preset load traffic; Send first service data to the switch through the second sub-link, and the first service data was initially service data transmitted through the first sub-link.
[0101] For each sub-link, the load traffic of the sub-link refers to the amount of data or data rate transmitted through the sub-link during network communication. The load traffic of the sub-link is used to measure the degree of workload borne by the sub-link. That is, the greater the load traffic of the sub-link, the greater the workload borne by the sub-link; the smaller the load traffic of the sub-link, the smaller the workload borne by the sub-link.
[0102] The first sub-link is a sub-link whose load traffic is greater than or equal to the preset load traffic. The second sub-link is a sub-link whose load traffic is less than the preset load traffic. Exemplarily, assume that the sub-link group includes sub-link A and sub-link B, where the load traffic of sub-link A is 10 Mbps, the load traffic of sub-link B is 25 Mbps, and the preset load traffic is 20 Mbps. Then the first sub-link is sub-link B, and the second sub-link is sub-link A.
[0103] The first service data refers to part of the service data initially transmitted through the first sub-link.
[0104] When there is a first sub-link in the sub-link group, send the first service data to the switch through the second sub-link. In this way, the workload of the first sub-link can be reduced, the bandwidth resources of the first sub-link and the second sub-link can be reasonably utilized, and it can be avoided that the first sub-link has problems due to excessive workload.
[0105] In some embodiments, the way to perform redundant backup among sub-links in a sub-link group can be as follows: Detect the status of each sub-link in the sub-link group corresponding to the host, and the status is a normal status or an abnormal status; When there is a third sub-link in the sub-link group in an abnormal status, send second service data to the switch through at least one fourth sub-link, and at least one fourth sub-link is a sub-link in the sub-link group other than the third sub-link, and the second service data was initially service data transmitted through the third sub-link.
[0106] In some embodiments, the method for detecting the status of each sub-link in the sub-link group corresponding to the detection host may be as follows: for each sub-link in the sub-link group, a heartbeat packet is sent to the switch through the sub-link; when the first response information corresponding to the heartbeat packet is received within the first time period, it is determined that the status of the sub-link is the normal status; when the first response information corresponding to the heartbeat packet is not received within the first time period, it is determined that the status of the sub-link is the abnormal status.
[0107] A heartbeat packet is a special data packet used to detect the link status in network communication. The server can periodically send heartbeat packets to the switch through the sub-link, and determine the status of the sub-link by judging whether the first response information corresponding to the heartbeat packet is received within the first time period. Exemplarily, for each sub-link, the server sends a heartbeat packet to the switch through the sub-link. If the first response information corresponding to the heartbeat packet is received within the first time period, it is determined that the status of the sub-link is the normal status; if the first response information corresponding to the heartbeat packet is not received within the first time period, it is determined that the status of the sub-link is the abnormal status.
[0108] In some embodiments, when the status of the sub-link is the abnormal status, the server sends a prompt message to the client, and the prompt message is used to prompt that the sub-link corresponding to the network port of the host is in the abnormal status. Exemplarily, assume that the sub-link corresponding to the network port M of the host a is sub-link A. When the server detects that the status of sub-link A is the abnormal status, it sends a prompt message to the client, and the prompt message is used to prompt that the sub-link A corresponding to the network port M of the host a is in the abnormal status.
[0109] The third sub-link is the sub-link in the sub-link group that is in the abnormal status; at least one fourth sub-link is the sub-link in the sub-link group other than the third sub-link. Exemplarily, assume that the sub-link group includes sub-link A, sub-link B, and sub-link C, where the status of sub-link A is the normal status, the status of sub-link B is the abnormal status, and the status of sub-link C is the normal status. Then the third sub-link is sub-link B, and at least one fourth sub-link is sub-link A and sub-link C.
[0110] The second service data is all the service data initially transmitted by the third sub-link.
[0111] When there is a third sub-link in the sub-link group that is in the abnormal status, the second service data initially transmitted by the third sub-link is transmitted through at least one fourth sub-link respectively. In this way, the normal transmission of service data can be guaranteed, and the situation that part of the service data of the host is lost or the transmission fails due to the abnormal status of the third sub-link can be avoided.
[0112] In the above specific embodiments, an association operation is performed on the sub-links corresponding to each network interface of each host to obtain a sub-link group corresponding to the host. Each sub-link in the sub-link group is used for communication between the host and the switch, realizing the expansion of network bandwidth and improving the network throughput. In addition, each sub-link in the sub-link group has the capabilities of load balancing and redundancy backup, improving the availability and reliability of the network.
[0113] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0114] Figure 7 The structural schematic of a link processing device provided by an embodiment of the present application Figure 1 As Figure 7 shown, an embodiment of the present application further provides a link processing device 70. The device includes a first partitioning module 71, a first sending module 72, a first receiving module 73, and a second partitioning module 74, where:
[0115] The first partitioning module 71 is configured to partition the network interfaces on the network card according to multiple hosts connected to the network card to obtain multiple sub-network interfaces corresponding to the network interfaces; where a communication link is established between the network card and the switch through the network interfaces and the ports on the switch.
[0116] The first sending module 72 is configured to send the identifiers of the multiple sub-network interfaces to the client.
[0117] The first receiving module 73 is configured to receive first indication information sent by the client. The first indication information is used to indicate the sub-network interfaces associated with the multiple hosts among the multiple sub-network interfaces, and to indicate the sub-ports associated with the multiple hosts among the multiple sub-ports; where the multiple sub-ports are obtained by partitioning the ports on the switch.
[0118] The second partitioning module 74 is configured to partition the communication link according to the sub-network interfaces and sub-ports respectively associated with the multiple hosts to obtain sub-links corresponding to each host on the network interface.
[0119] In a possible implementation manner, the first partitioning module 71 is specifically configured to:
[0120] Determine the number of multiple hosts;
[0121] Partition the network interfaces according to the number of multiple hosts to obtain multiple sub-network interfaces corresponding to the network interfaces;
[0122] Where the number of multiple hosts is equal to the number of multiple sub-network interfaces corresponding to the network interfaces.
[0123] In a possible implementation, the link processing device 70 further includes a processing module, and the processing module is specifically configured to:
[0124] For each host among multiple hosts, perform an association operation on the sub-links corresponding to each network interface of the host to obtain a sub-link group corresponding to the host;
[0125] Among them, each sub-link in the sub-link group is used for the host to communicate with the corresponding switch.
[0126] In a possible implementation, the processing module is further configured to:
[0127] Determine the load traffic of each sub-link in the sub-link group corresponding to the host;
[0128] When there is a first sub-link in the sub-link group whose load traffic is greater than or equal to the preset load traffic, determine a second sub-link in the sub-link group according to the load traffic of each sub-link in the sub-link group, and the load traffic of the second sub-link is less than the preset load traffic;
[0129] Send first service data to the switch through the second sub-link, and the first service data was initially service data transmitted through the first sub-link.
[0130] In a possible implementation, the processing module is further configured to:
[0131] Detect the status of each sub-link in the sub-link group corresponding to the host, and the status is a normal status or an abnormal status;
[0132] When there is a third sub-link in the sub-link group in an abnormal state, send second service data to the switch through at least one fourth sub-link, where the at least one fourth sub-link is a sub-link in the sub-link group other than the third sub-link, and the second service data was initially service data transmitted through the third sub-link.
[0133] In a possible implementation, the processing module is further configured to:
[0134] For each sub-link in the sub-link group, send a heartbeat packet to the switch through the sub-link;
[0135] When the first response information corresponding to the heartbeat packet is received within the first time period, determine that the status of the sub-link is a normal status;
[0136] When the first response information corresponding to the heartbeat packet is not received within the first time period, determine that the status of the sub-link is an abnormal status.
[0137] In a possible implementation, the processing module is further configured to:
[0138] When the status of the sub-link is an abnormal status, a prompt message is sent to the client, and the prompt message is used to prompt that the sub-link corresponding to the network interface of the host is in an abnormal status.
[0139] In a possible implementation manner, the link processing device 70 further includes a first determination module, and the first determination module is specifically configured to:
[0140] Obtain the load traffic of each of multiple hosts within a historical period;
[0141] Determine the bandwidths of the sub-network interfaces associated with each of the multiple hosts according to the load traffic of each of the multiple hosts within the historical period; wherein, the bandwidth of the sub-network interface associated with a host is positively correlated with the magnitude of the load traffic of the host.
[0142] In a possible implementation manner, the first determination module is further configured to:
[0143] Obtain the current load traffic of each of the multiple hosts;
[0144] Adjust the bandwidths of the sub-network interfaces associated with each of the multiple hosts according to the current load traffic of each of the multiple hosts to obtain the updated bandwidths of the sub-network interfaces associated with each of the multiple hosts.
[0145] For the description of the features in the embodiment corresponding to the link processing device 70, reference can be made to the relevant description in the embodiment corresponding to the link processing method, which will not be elaborated here one by one.
[0146] Figure 8 The structural schematic of a link processing device provided by an embodiment of the present application Figure 2 , please refer to Figure 8 , an embodiment of the present application further provides a link processing device 80, and the device includes a second receiving module 81, a second determination module 82, and a second sending module 83, wherein:
[0147] The second receiving module 81 is configured to receive the identifiers of each of multiple sub-network interfaces sent by a server, and the multiple sub-network interfaces are obtained by dividing the network interfaces on a network card; wherein, a communication link is established between the network card and a switch through the network interfaces and the ports on the switch;
[0148] The second determination module 82 is configured to determine the sub-network interfaces associated with each of multiple hosts and the sub-ports associated with each of the multiple hosts according to the identifiers of each of the multiple sub-network interfaces and the identifiers of each of multiple sub-ports; wherein, the multiple hosts are the hosts connected to the network card;
[0149] The second sending module 83 is configured to send first indication information to the server. The first indication information is used to indicate, among multiple sub-network interfaces, the sub-network interfaces respectively associated with multiple hosts, and to indicate, among multiple sub-ports, the sub-ports respectively associated with multiple hosts; the first indication information is used to establish a sub-link corresponding to the host at the network interface.
[0150] In a possible implementation manner, the link processing device 80 further includes a transceiver module, and the transceiver module is specifically configured to:
[0151] Send second indication information to the switch, where the second indication information is used to indicate the number of multiple sub-network interfaces;
[0152] Receive second response information sent by the switch, where the second response information includes the identifiers of multiple sub-ports respectively, and the multiple sub-ports are obtained by partitioning a port.
[0153] For the description of the features in the embodiment corresponding to the link processing device 80, reference may be made to the relevant description of the embodiment corresponding to the link processing method, which will not be elaborated here one by one.
[0154] Figure 9 The structural schematic diagram of a link processing device provided by an embodiment of the present application Figure 3 , please refer to Figure 9 , an embodiment of the present application further provides a link processing device 90, and the device includes: a third receiving module 91, a third partitioning module 92, and a third sending module 93, where:
[0155] The third receiving module 91 is configured to receive second indication information sent by the client, where the second indication information is used to indicate the number of multiple sub-network interfaces, and the multiple sub-network interfaces are obtained by partitioning the network interfaces on the network card; wherein, a communication link is established between the network card and the switch through the network interfaces and the ports on the switch;
[0156] The third partitioning module 92 is configured to partition the port according to the number of multiple sub-network interfaces to obtain multiple sub-ports;
[0157] The third sending module 93 is configured to send second response information to the client, where the second response information includes the identifiers of multiple sub-ports respectively.
[0158] For the description of the features in the embodiment corresponding to the link processing device 90, reference may be made to the relevant description of the embodiment corresponding to the link processing method, which will not be elaborated here one by one.
[0159] Figure 10 The structural schematic diagram of the electronic device provided by the present application. As Figure 10As shown in the figure, the electronic device 100 provided in this embodiment includes: at least one processor 101 and a memory 102. Optionally, the device 100 further includes a communication component 103. Among them, the processor 101, the memory 102, and the communication component 103 are connected through a bus.
[0160] In the specific implementation process, at least one processor 101 executes the computer-executable instructions stored in the memory 102, so that at least one processor 101 executes the above-mentioned link processing method embodiment.
[0161] For the specific implementation process of the processor 101, reference can be made to the above method embodiment, and its implementation principle and technical effect are similar, so they will not be elaborated here in this embodiment.
[0162] In the above embodiment, it should be understood that the processor may be a central processing unit (Central Processing Unit, abbreviated as: CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, abbreviated as: DSP), application-specific integrated circuits (Application Specific Integrated Circuit, abbreviated as: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0163] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0164] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, the bus in the attached drawings of this application is not limited to only one bus or one type of bus.
[0165] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is set to execute the steps in any of the above link processing method embodiments when running.
[0166] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs such as USB flash drives, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disks, magnetic disks, or optical discs.
[0167] An embodiment of the present application further provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the link processing method.
[0168] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-described embodiments of the link processing method.
[0169] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0170] The above has introduced in detail a link processing method, an electronic device, a storage medium, and a computer program product provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A link processing method, characterized in that, The method includes: Dividing the network interfaces on the network card at a logical level according to the number of multiple hosts connected to the network card, to obtain multiple sub-network interfaces corresponding to the network interfaces; wherein, a communication link is established between the network card and the switch through the network interfaces and the ports on the switch, and the number of the multiple hosts is equal to the number of the multiple sub-network interfaces corresponding to the network interfaces; Sending the identifiers of the multiple sub-network interfaces to the client; Receiving first indication information sent by the client, where the first indication information is used to indicate the sub-network interfaces associated with the multiple hosts respectively among the multiple sub-network interfaces, and to indicate the sub-ports associated with the multiple hosts respectively among multiple sub-ports; wherein, the multiple sub-ports are obtained by the switch dividing the ports on the switch according to the number of the multiple sub-network interfaces; Dividing the communication link according to the sub-network interfaces and the sub-ports associated with the multiple hosts respectively, to obtain sub-links corresponding to the multiple hosts on the network interface.
2. The method according to claim 1, characterized in that The dividing the network interfaces on the network card at a logical level according to the number of multiple hosts connected to the network card, to obtain multiple sub-network interfaces corresponding to the network interfaces, includes: Determining the number of the multiple hosts; Dividing the network interfaces according to the number of the multiple hosts, to obtain multiple sub-network interfaces corresponding to the network interfaces.
3. The method according to claim 1 or 2, characterized in that, The number of the network interfaces on the network card is multiple, and the method further includes: Performing an association operation on the sub-links corresponding to the multiple network interfaces of each host among the multiple hosts, to obtain a sub-link group corresponding to the host; Wherein, each sub-link in the sub-link group is used for the host to communicate with the corresponding switch.
4. The method according to claim 3, wherein For each host among the multiple hosts, the method further includes: Determining the load traffic of each sub-link in the sub-link group corresponding to the host; When there is a first sub-link in the sub-link group whose load traffic is greater than or equal to a preset load traffic, determining a second sub-link in the sub-link group according to the load traffic of each sub-link in the sub-link group, where the load traffic of the second sub-link is less than the preset load traffic; Sending first service data to the switch through the second sub-link, where the first service data was initially service data transmitted through the first sub-link.
5. The method according to claim 3, characterized in that, For each host among the multiple hosts, the method further includes: Detecting the status of each sub-link in the sub-link group corresponding to the host, where the status is a normal status or an abnormal status; When there is a third sub-link in the sub-link group in the abnormal status, sending second service data to the switch through at least one fourth sub-link, where the at least one fourth sub-link is a sub-link other than the third sub-link in the sub-link group, and the second service data was initially service data transmitted through the third sub-link.
6. The method according to claim 5, wherein The detecting the status of each sub-link in the sub-link group corresponding to the host includes: For each sub-link in the sub-link group, sending a heartbeat packet to the switch through the sub-link; When the first response information corresponding to the heartbeat packet is received within the first time period, determine that the status of the sub-link is the normal status; When the first response information corresponding to the heartbeat packet is not received within the first time period, determine that the status of the sub-link is the abnormal status.
7. The method according to claim 6, wherein The method further includes: When the status of the sub-link is the abnormal status, send a prompt message to the client, where the prompt message is used to prompt that the sub-link corresponding to the network interface of the host is in the abnormal status.
8. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the load traffic of each of the multiple hosts within the historical time period; According to the load traffic of each of the multiple hosts within the historical time period, determine the bandwidth of the sub-network interfaces associated with each of the multiple hosts; wherein, the bandwidth of the sub-network interface associated with a host is positively correlated with the magnitude of the load traffic of the host.
9. The method according to claim 8, wherein The method further includes: Obtain the current load traffic of each of the multiple hosts; According to the current load traffic of each of the multiple hosts, adjust the bandwidth of the sub-network interfaces associated with each of the multiple hosts to obtain the updated bandwidth of the sub-network interfaces associated with each of the multiple hosts.
10. A link processing method, characterized in that, The method includes: Receive the identifiers of the multiple sub-network interfaces sent by the server, where the multiple sub-network interfaces are obtained by the server dividing the network interfaces on the network card at the logical level according to the number of multiple hosts connected to the network card; wherein, a communication link is established between the network card and the switch through the network interfaces and the ports on the switch, and the number of the multiple hosts is equal to the number of the multiple sub-network interfaces corresponding to the network interfaces; According to the identifiers of the multiple sub-network interfaces and the identifiers of the multiple sub-ports, determine the sub-network interfaces associated with each of the multiple hosts and the sub-ports associated with each of the multiple hosts; wherein, the multiple hosts are the hosts connected to the network card; Send a first indication message to the server, where the first indication message is used to indicate the sub-network interfaces associated with each of the multiple hosts among the multiple sub-network interfaces and the sub-ports associated with each of the multiple hosts among the multiple sub-ports; the first indication message is used to establish the sub-link corresponding to the network interface of the host, where the multiple sub-ports are obtained by the switch dividing the ports on the switch according to the number of the multiple sub-network interfaces.
11. The method according to claim 10, wherein The method further includes: Send a second indication message to the switch, where the second indication message is used to indicate the number of the multiple sub-network interfaces; Receive the second response message sent by the switch, where the second response message includes the identifiers of the multiple sub-ports, and the multiple sub-ports are obtained by dividing the ports.
12. A link processing method, characterized in that, The method includes: Receive the second indication message sent by the client, where the second indication message is used to indicate the number of the multiple sub-network interfaces, and the multiple sub-network interfaces are obtained by the server dividing the network interfaces on the network card at the logical level according to the number of multiple hosts connected to the network card; wherein, a communication link is established between the network card and the switch through the network interfaces and the ports on the switch, and the number of the multiple hosts is equal to the number of the multiple sub-network interfaces corresponding to the network interfaces; Divide the port according to the number of the multiple sub-network ports to obtain a plurality of sub-ports; Send second response information to the client, where the second response information includes identifiers of the plurality of sub-ports respectively.
13. An electronic device, characterized in that, Comprising: A memory for storing a computer program; A processor for implementing the steps of the link processing method according to any one of claims 1 to 9, or the steps of the link processing method according to any one of claims 10 - 11, or the steps of the link processing method according to claim 12 when executing the computer program.
14. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the link processing method according to any one of claims 1 to 9, or the steps of the link processing method according to any one of claims 10 - 11, or the steps of the link processing method according to claim 12 when being executed by a processor.
15. A computer program product, comprising a computer program, characterized in that, The computer program implements the steps of the link processing method according to any one of claims 1 to 9, or the steps of the link processing method according to any one of claims 10 - 11, or the steps of the link processing method according to claim 12 when being executed by a processor.
Citation Information
Patent Citations
Method and device of multilink load balancing based on Linux system
CN106982170A
Port binding method and related device
CN119276834A