Link processing method, electronic device, storage medium and computer program product
By logically dividing the network ports of the network card, subnet ports and subports are formed, and molecular links are divided into the communication links, the accuracy of link establishment and maintenance between multi-host network cards and switches is solved, and the accurate link establishment and maintenance is achieved.
Patent Information
- Application Number
- CN202510333104.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-20
AI Technical Summary
When establishing a communication link between a multi-host network card and a switch, the switch cannot accurately distinguish the hosts corresponding to multiple protocol messages, 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 the sublinks of each host are divided in the communication link, so that the switch can accurately identify and process the packets of each host.
It realizes the accurate establishment and maintenance of links between multi-host network cards and switches, avoiding link establishment failure or state maintenance errors caused by packet resolution errors.
Smart Images

Figure CN119854242A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a link processing method, electronic equipment, storage medium and computer program product. Background Art
[0002] In the process of network communication, the reliability and performance of network connection are crucial. For high availability and high reliability application scenarios, the network card binding technology can be used to bind the network ports of the network card, so that the network card can establish a communication link with the switch through the bound network ports, and the communication link between the bound network ports and the switch is an aggregated link, realizing load balancing and redundant backup of the communication link between the network card and the switch.
[0003] In the related art, after the network card binds the network port through the network card binding technology, it will send a protocol message to the switch. The protocol message is the protocol message corresponding to the host connected to the network card. After receiving the protocol message 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 will periodically send protocol messages to the switch to maintain the status of the communication link.
[0004] However, since the 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 messages corresponding to each of the multiple hosts to the switch. After receiving multiple protocol messages sent by the multi-host network card, the switch may determine multiple protocol messages as different link requests because it cannot distinguish whether the received multiple protocol messages are from different hosts of the same multi-host network card and the hosts corresponding to the multiple protocol messages, thereby making it impossible to accurately establish or maintain a communication link. Therefore, a link processing method for a multi-host network card is urgently needed. Summary of the invention
[0005] The present application provides a link processing method, electronic device, storage medium and computer program product for accurately establishing links between multiple host network cards and switches.
[0006] The present application provides a link processing method, including:
[0007] According to the multiple hosts connected to the network card, the network port on the network card is divided to obtain multiple sub-network ports corresponding to the network port; wherein a communication link is established between the network card and the switch through the network port and the port on the switch;
[0008] Send the identifiers of multiple subnet ports to the client;
[0009] Receive first indication information sent by the client, where the first indication information is used to indicate subnet ports associated with multiple hosts in multiple subnet ports, and to indicate subports associated with multiple hosts in multiple subports; wherein the multiple subports are obtained by dividing ports on the switch;
[0010] According to the sub-network ports and sub-ports respectively associated with the multiple hosts, the communication links are divided to obtain the sub-links corresponding to the network ports of the multiple hosts.
[0011] The present application also provides a link processing method, including:
[0012] Receiving the identifiers of the multiple subnet ports sent by the server, where the multiple subnet 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 port and the port on the switch;
[0013] Determine the subnet ports associated with the multiple hosts and the subports associated with the multiple hosts according to the respective identifiers of the multiple subnet ports and the respective identifiers of the multiple subports; wherein the multiple hosts are hosts connected to the network cards;
[0014] Send a first indication message to the server, the first indication message is used to indicate the subnet ports associated with multiple hosts in multiple subnet ports, and to indicate the subports associated with multiple hosts in multiple subports; the first indication message is used to establish a sub-link corresponding to the host at the network port.
[0015] The present application also provides a link processing method, including:
[0016] receiving second indication information sent by the client, where the second indication information is used to indicate the number of the plurality of sub-network ports, where the plurality of 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] According to the number of multiple sub-network ports, the port is divided to obtain multiple sub-ports;
[0018] Sending a second response message to the client, wherein the second response message includes the identifiers of the plurality of sub-ports.
[0019] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any one of the above-mentioned link processing methods when executing the computer program.
[0020] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned 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] The link processing method, electronic device, storage medium and computer program product provided in the embodiment of the present application divide the network port on the network card at the logical level according to the number of multiple hosts connected to the network card, and obtain multiple sub-network ports corresponding to the network port. For each of 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 message corresponding to the host to the switch through the sub-link corresponding to the host on each network port. After receiving multiple messages sent by the network card, the switch can distinguish whether each message comes from different hosts on a network card, and distinguish the hosts corresponding to each of the multiple messages, so that the communication link can be accurately established or maintained. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 A schematic diagram of establishing a communication link between a single host network card and a switch provided in an embodiment of the present application;
[0025] Figure 2 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0026] Figure 3 A flowchart of a link processing method provided in an embodiment of the present application;
[0027] Figure 4 A signaling diagram of a link processing method provided in an embodiment of the present application;
[0028] Figure 5 A schematic diagram of network port division provided in an embodiment of the present application;
[0029] Figure 6 A schematic diagram of creating a sub-link group provided in an embodiment of the present application;
[0030] Figure 7 A schematic diagram of a link processing device provided in an embodiment of the present application Figure 1 ;
[0031] Figure 8 A schematic diagram of a link processing device provided in an embodiment of the present application Figure 2 ;
[0032] Fig. 9 A schematic diagram of a link processing device provided in an embodiment of the present application Figure 3 ;
[0033] Fig.10 A schematic diagram of the structure of the electronic device provided in this application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0035] It should be noted that, in the description of this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0036] First, the terms involved in this application are explained:
[0037] The network card binding technology refers to binding multiple network cards together to form a logical network card, so that the bandwidth of the network card can be improved and the link redundancy can be achieved. In some embodiments, the network card binding technology can realize the binding between multiple network interfaces, so that multiple network interfaces can be used as a logical interface. Therefore, for a multi-port network card, the network card binding technology can be used to bind multiple network ports of the network card to achieve link aggregation between the network card and the switch. The binding mode of the network card binding technology can be, for example, IEEE 802.3ad dynamic link aggregation (802.3ad Dynamic Link Aggregation). Taking the network card binding technology with the binding mode of IEEE 802.3ad dynamic link aggregation as an example, the multiple network ports of the network card are bound. The Link Aggregation Control Protocol (LACP) is enabled for the bound multiple network ports, and the status of each network port is maintained according to the LACP message. After the multiple network ports of the multi-port network card are bound by the network card binding technology, the links of the multiple network ports are aggregated links. In this way, the load balancing of the network card and the 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 a host connected to a single-host network card, a 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 server, a virtual machine, or other devices.
[0039] A multi-host network card can provide network connection services for multiple hosts at the same time. For multiple hosts connected to the multi-host network card, the multi-host network card can enable multiple hosts to access the local area network or wide area network through the multi-host network card. The multi-host network card has multiple interfaces, which are used to connect to multiple hosts. For example, the multiple hosts can be multiple servers or multiple virtual machines.
[0040] In the related art, for a single-host network card including multiple network ports, taking the binding mode of IEEE 802.3ad dynamic link aggregation as an example, after the multiple network ports of the single-host network card are bound by using the network card binding technology, the way to establish a communication link between the network card and the switch can be: after the single-host network card starts the network card binding, the single-host network card sends an LACP message to the switch through the network port of the single-host network card, and the LACP message is the LACP message corresponding to the host connected to the single-host network card. After receiving the protocol message sent by the single-host network card, the switch 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, the LACP message will be sent to the switch regularly to maintain the status of the communication link with the switch. It should be noted that both the switch and the single-host network card support the LACP protocol.
[0041] For example, a dual-port network card is used as a single host network card. Figure 1 To understand, Figure 1 For a schematic diagram of establishing a communication link between a single host network card and a switch provided in an embodiment of the present application, see 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 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 single-host network card 11 respectively establishes communication links with the first switch 14 and the second switch 15 in the following manner: the single-host network card 11 sends an LACP message corresponding to the host 16 to the first switch 14 through the first network port 12. After receiving the LACP message, the first switch 14 establishes a communication link with the single-host network card 11 according to the LACP message, 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 an LACP message 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 message corresponding to the host 16 to the second switch 15 through the second network port 13. After receiving the LACP message, the second switch 15 establishes a communication link with the single-host network card 11 according to the LACP message, 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 messages to the second switch 15 through the second network port 13 to maintain the status 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 messages to the switch, and the multiple LACP messages are LACP messages corresponding to the multiple hosts respectively, and the multiple hosts are the multiple hosts connected to the multi-host network card. After receiving the multiple LACP messages, the switch cannot distinguish whether the received multiple LACP messages are from multiple hosts of the same multi-host network card, resulting in an incorrect judgment of the state of the link between the multi-host network card, and may determine the LACP messages corresponding to the multiple hosts as different link requests, resulting in the inability to accurately establish or maintain the communication link.
[0043] The embodiment of the present application provides a link processing method, which divides the network port on the network card at the logical level to obtain multiple sub-network ports corresponding to the network port, and determines the sub-network ports associated with each of the multiple hosts, and the sub-ports associated with each of the multiple hosts in the switch. Then, 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, the sub-links corresponding to the host on each network port are divided in the communication link between the network card and the switch. In this way, the network card can send the LACP message corresponding to the host to the switch through the sub-link corresponding to each host, and the switch can receive the LACP message corresponding to each host through the sub-link corresponding to each host, thereby distinguishing whether each LACP message comes from different hosts on the same network card, and distinguishing the hosts corresponding to multiple LACP messages, thereby accurately establishing or maintaining the communication link.
[0044] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0045] In conjunction with the specific application environment architecture or the specific hardware architecture on which the execution of the link processing method depends, the specific application environment architecture or the specific hardware architecture is described herein. Figure 2 , Figure 2 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 2 As shown, it includes a multi-host network card 21, a third switch 22 and a fourth switch 23, a first host 24 and a second host 25, wherein the multi-host network card 21 is connected to the first host 24 and the second host 25 respectively, and the first host 24 and the second host 25 are connected to the local area network or the wide area network through the multi-host network card 21, and the first host 24 and the second host 25 can be servers, or network devices such as virtual machines.
[0046] In actual application, the multi-host network card 21 includes a third network port 26 and a fourth network port 27, and the multi-host network card 21 can establish a communication link with the third switch 22 through the third network port 26, and communicate with the third switch 22 through the communication link; the multi-host network card 21 can establish a communication link with the fourth switch 23 through the fourth network port 27, and communicate with the fourth switch 23 through the communication link. Exemplarily, assuming that the multi-host network card 21 establishes a communication link A with the third switch 22 through the third network port 26, the multi-host network card 21 communicates with the third switch 22 through the communication link A; assuming that the multi-host network card 21 establishes a communication link B with the fourth switch 23 through the fourth network port 27, the multi-host network card 21 communicates with the fourth switch 23 through the communication link B.
[0047] It should be noted that Figure 2This is just an example to illustrate an application scenario, and is not intended to limit the application scenario.
[0048] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following 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 in conjunction with the accompanying drawings.
[0049] Figure 3 A flowchart of a link processing method provided in an embodiment of the present application is shown as follows: Figure 3 As 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 port on the network card according to the multiple hosts connected to the network card to obtain multiple sub-network ports corresponding to the network port; wherein a communication link is established between the network card and the switch through the network port and the port on the switch.
[0051] The execution subject of the present application may be a server, and the server includes a mainboard and a multi-host network card, or it may be a link processing device set in the server, and the link processing device may be implemented by software, or by a combination of software and hardware.
[0052] The network card refers to a multi-host network card, which 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 multiple interfaces of the network card, and the multiple hosts connected to the network card can be multiple servers, multiple virtual machines or other network devices. Exemplarily, it is assumed 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, which is used to establish a communication link with the port on the switch, that is, the network card and the switch can establish a communication link through the network port and the port on the switch. For each network port on the network port, after the network card and the switch establish a communication link through the network port and the port on the switch, the network port is divided through the network card firmware, and the network port is divided into multiple sub-network ports at the logical level. Therefore, multiple sub-network ports refer to dividing at least one network port of the network card respectively, and obtaining multiple sub-network ports corresponding to each network port at the logical level. Exemplarily, assuming that the network card includes network port M and network port N, after the network card and the switch establish a communication link through network port M and the port on the switch, network port M is divided, and multiple sub-network ports corresponding to network port M at the logical level are sub-network port x and sub-network port y; after the network card and the switch establish a communication link through network port N and the port on the switch, network port N is divided, and multiple sub-network ports corresponding to network port N at the logical level are sub-network port z and sub-network port o.
[0054] In some embodiments, the network card is inserted on the mainboard. After the network card is inserted on the mainboard, the mainboard will detect the connection status between the host and the network card by sending a detection signal to the network card. When the mainboard detects that the network card is a multi-host network card, it sends an indication message to the server to instruct the network ports on the network card to be divided. After receiving the indication message, the server divides the network ports on the network card.
[0055] S302: Sending the identifiers of the multiple subnet ports to the client.
[0056] The client may be a client of the link processing system, the link processing system may be a software or hardware system of the link processing method provided in the present application, and the client of the link processing system may be, for example, a front-end page of the link processing system. The client may 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, the network port is divided to obtain multiple sub-network ports corresponding to the network port, and the server sends the identifiers of the multiple sub-network ports to the client.
[0058] Exemplarily, for each network port of the network card, assuming that after the network port is divided, 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, 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 first indication information sent by the client, where the first indication information is used to indicate subnet ports associated with multiple hosts in multiple subnet ports, and to indicate subports associated with multiple hosts in multiple subports; wherein the multiple subports are obtained by dividing ports on the switch.
[0060] The subnet ports associated with each of the multiple hosts refer to that, for each host, the network card sends the LACP message corresponding to the host to the switch through the subnet port associated with the host. For example, assume that the multiple hosts are host 1 and host 2, wherein 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 message corresponding to host 1 to the switch through subnet port x, and the network card sends the LACP message corresponding to host 2 to the switch through subnet port y.
[0061] The subports associated with each of the multiple hosts refer to that, for each host, the switch receives the LACP message corresponding to the host sent by the network card through the subport associated with the host. For example, assume that the multiple hosts are host 1 and host 2, wherein the subport associated with host 1 is subport r, and the subport associated with host 2 is subport s. Then the switch receives the LACP message corresponding to host 1 sent by the network card through subport r, and the switch receives the LACP message corresponding to host 2 sent by the network card through subport s.
[0062] In some embodiments, the first indication information is also 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 sub-network ports and sub-ports associated with the multiple hosts, and obtain the sub-links corresponding to the network ports of the multiple hosts.
[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 the network port is divided, the communication link between the network card and the switch can be divided at a logical level according to the sub-network ports associated with each of the multiple hosts and the sub-ports associated with each of the multiple hosts, and the sub-link corresponding to each host in the communication link is obtained. The sub-link corresponding to each network port of the multiple hosts refers to the sub-link obtained by dividing the communication link at a logical level according to the sub-network ports and sub-ports associated with each of the multiple hosts.
[0065] Among the multiple hosts connected to the network card, each host has a corresponding sub-link on each network port, and the sub-link corresponding to each host on each network port is independent. For each host, the network card can send the LACP message corresponding to the host to the switch through the sub-link corresponding to the host. In this way, after receiving the LACP message transmitted by any sub-link, the switch can distinguish that the LACP message is the LACP message corresponding to the host corresponding to the sub-link, so that the communication link can be accurately established and maintained.
[0066] In addition, during the communication between the network card and the switch through the sub-link corresponding to the host, the transmitted data is the data related to the host, for example, the transmitted data may be the service data of the host, the protocol message related to the host, etc. In this way, after receiving the data transmitted by any sub-link, the switch can distinguish that the data comes from the host corresponding to the sub-link, thereby realizing that each host can communicate with the switch independently through the network card of the server.
[0067] exist Figure 3 In the embodiment shown, the network ports on the network card are divided at the logical level to obtain multiple sub-network ports corresponding to the network card, and then, according to the first indication information, the sub-network ports associated with each host and the sub-ports associated with each host are determined among the multiple hosts connected to the network card, and according to the sub-network ports associated with each host and the sub-ports associated with each host, the links between the sub-network ports associated with each host and the sub-ports associated with each host are determined in the communication link, and in the communication link, the links between the sub-network ports associated with each host and the sub-ports associated with each host are divided to obtain the sub-links corresponding to each host. Through the above link processing method, after the network ports on the network card are divided to obtain multiple sub-network ports, according to the sub-network ports associated with each host and the sub-ports associated with each host, the sub-links corresponding to the host are divided in the communication link, and the sub-links corresponding to each host obtained are independent, so that the network card can send the LACP message corresponding to the host to the switch through the sub-link corresponding to the host. After receiving multiple LACP messages sent by the network card, the switch can distinguish whether each LACP message comes from different hosts of one network card, and distinguish the hosts corresponding to each of the multiple LACP messages, so that the communication link can be accurately established or maintained.
[0068] exist Figure 3 Based on the embodiment shown below, combined with Figure 4 The link processing method provided in the embodiment of the present application is further explained.
[0069] Figure 4 A signaling diagram of a link processing method provided in an embodiment of the present application, such as Figure 3 As shown, the process may include the following steps:
[0070] S401: The server divides the network port on the network card to obtain multiple sub-network ports corresponding to the network port.
[0071] In some embodiments, the server may divide the network ports on the network card as follows: determine the number of multiple hosts; divide the network ports according to the number of multiple hosts to obtain multiple sub-network ports corresponding to the network ports; wherein the number of multiple hosts is equal to the number of multiple sub-network ports corresponding to the network ports.
[0072] Can be combined Figure 5 To understand, Figure 5 For a schematic diagram of network port division provided in an embodiment of the present application, please refer to Figure 5 , including a network card 51, wherein the network card 51 is connected to the third host 52, the fourth host 53 and the fifth host 54 respectively, and the network card 51 includes a fifth network port 55 and a sixth network port 56. Since the network card 51 is connected to the third host 52, the fourth host 53 and the fifth host 54 respectively, it is determined that the number of multiple hosts connected to the network card 51 is 3, and according to the number of multiple hosts, the fifth network port 55 is divided into sub-network port x, sub-network port y and sub-network port z, and the multiple sub-network ports corresponding to the fifth network port 55 are sub-network port x, sub-network port y and sub-network port z respectively; according to the number of multiple hosts, the sixth network port 56 is divided into sub-network port o, sub-network port p and sub-network port q, and the multiple sub-network ports corresponding to the sixth network port 56 are sub-network port o, sub-network port p and sub-network port q respectively.
[0073] S402: The server sends the identifiers of the multiple subnet ports to the client.
[0074] For details on how the server sends multiple subnet port identifiers to the client, see Figure 3 S302 in the illustrated embodiment will not be described in detail here.
[0075] S403: The client sends second indication information to the switch, where the second indication information is used to indicate the number of the multiple subnet ports.
[0076] After receiving the identifiers of the multiple subnet ports sent by the server, the client sends the second indication information to the switch, indicating the number of the multiple subnet ports obtained by dividing the network ports on the network card. Exemplarily, it is assumed that after receiving the identifiers of the multiple subnet ports sent by the server, which are: the identifier P0 of the subnet port x, the identifier P1 of the subnet port y, the identifier P2 of the subnet port z, and the identifier P3 of the subnet port o, the client sends the second indication information to the switch, and the second indication information is used to indicate that the number of the multiple subnet ports is 4.
[0077] S404: The switch divides the port according to the number of the multiple sub-network ports to obtain multiple sub-ports.
[0078] After receiving the second indication information sent by the client, the switch divides the port for establishing a communication link between the switch and the network card according to the number of multiple sub-network ports indicated by the second indication information to obtain 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 the multiple sub-network ports is 4, the switch divides the port for establishing a communication link with the network card, and obtains that the number of the multiple sub-ports is 4.
[0080] In some embodiments, the port for establishing a communication link between the switch and the network card may be divided by, for example, using a virtual local area network (vLAN), a port splitting (Port Split) technology, or the like.
[0081] S405: The switch sends a second response message to the client, where the second response message includes identifiers of the multiple sub-ports.
[0082] For each sub-port, the identifier of the sub-port is used to identify the sub-port.
[0083] Exemplarily, assuming that the multiple subports are subport r, subport s and subport t, wherein the identifier of subport r is D0, the identifier of subport s is D1, and the identifier of subport t is D2, then the second response information sent by the switch to the client includes: the identifier D0 of subport r, the identifier D1 of subport s, and the identifier D2 of subport t.
[0084] S406: The client determines subnet ports associated with each of the multiple hosts and subports associated with each of the multiple hosts according to respective identifiers of the multiple subnet ports and respective identifiers of the multiple subports; wherein the multiple hosts are hosts connected to the network cards.
[0085] After receiving the second response information sent by the switch, the client determines the subports associated with each of the multiple hosts according to the respective identifiers of the multiple subports in the second response information. The method of determining the subports associated with each of the multiple hosts can be as follows: select a first host from the multiple hosts, randomly determine a subport from the multiple subports as the subport associated with the first host, and then associate the first host with the subport according to the identifier of the subport; select a second host from the multiple hosts, randomly determine a subport from at least one subport among the multiple subports except the subport associated with the first host as the subport associated with the second host, and then associate the second host with the subport according to the identifier of the subport; and so on, until the subport associated with the last host from the multiple hosts is determined, and the last host is associated with the subport according to the identifier of the subport.
[0086] Similarly, the method for determining the subnet ports associated with each of the multiple hosts based on the respective identifiers of the multiple subnet ports sent by the server can be as follows: select a first host from the multiple hosts, randomly determine a subnet port from the multiple subnet ports as the subnet port associated with the first host, and then associate the first host with the subnet port based on the identifier of the subnet port; select a second host from the multiple hosts, randomly determine a subnet port from at least one subnet port among the multiple subnet ports except the subnet port associated with the first host as the subnet port associated with the second host, and then associate the second host with the subnet port based on the identifier of the subnet port; and so on, until the subnet port associated with the last host from the multiple hosts is determined, and the last host is associated with the subnet port based on the identifier of the subnet port.
[0087] S407: The client sends first indication information to the server, where the first indication information is used to establish a sub-link corresponding to the network port of the host.
[0088] The first indication information is used to indicate the subnet ports associated with multiple hosts in multiple subnet ports, and to indicate the subports associated with multiple hosts in multiple subports. After receiving the first indication information, the server can divide the communication links according to the subnet ports associated with multiple hosts and the subports associated with multiple hosts indicated by the first indication information, and obtain the sub-links corresponding to the multiple hosts at the network ports. Therefore, the first indication information can be used to establish the sub-links corresponding to the hosts at the network ports.
[0089] In some embodiments, after receiving the first indication information, the server can determine the bandwidth of the subnet ports associated with the multiple hosts based on the load flow of the multiple hosts within a historical period. The method can be as follows: obtain the load flow of the multiple hosts within the historical period; determine the bandwidth of the subnet ports associated with the multiple hosts based on the load flow of the multiple hosts within the historical period; wherein the bandwidth of the subnet port associated with the host is positively correlated with the size of the load flow of the host.
[0090] For each host among the multiple hosts, the load flow of the host during the historical period is used to express: the amount of data transmitted by the host through the network link or the data transmission rate. The larger the amount of data transmitted by the host through the network link or the data transmission rate during the historical period, the larger the bandwidth of the subnet port associated with the host; the smaller the amount of data transmitted by the host through the network port link or the data transmission rate during the historical period, the smaller the bandwidth of the subnet port associated with the host, that is, the larger the load flow of the host during the historical period, the larger the bandwidth of the subnet port associated with the host; the smaller the load flow of the host during the historical period, the smaller the bandwidth of the subnet port associated with the host.
[0091] In some embodiments, the subnet ports associated with the multiple hosts can be adjusted according to the current load flow of the multiple hosts, and the method can be as follows: obtain the current load flow of the multiple hosts; adjust the bandwidth of the subnet ports associated with the multiple hosts according to the current load flow of the multiple hosts, and obtain the updated bandwidth of the subnet ports associated with the multiple hosts.
[0092] For each host among the multiple hosts, the current load flow of the host refers to the load flow of the host at the current moment. If the load flow of the host at the current moment is large, the bandwidth of the subnet port associated with the host is increased. At this time, the updated bandwidth of the subnet port associated with the host is obtained, which is the bandwidth after the bandwidth of the subnet port associated with the host is increased. If the load flow of the host at the current moment is small, the bandwidth of the subnet port associated with the host is reduced. At this time, the updated bandwidth of the subnet port associated with the host is obtained, which is the bandwidth after the bandwidth of the subnet port associated with the host is reduced. Therefore, in the case where the current load flow of the host is large, the bandwidth of the subnet port associated with the host is increased, and in the case where the current load flow of the host is small, the bandwidth of the subnet port associated with the host is reduced. 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 sub-network ports and sub-ports associated with the multiple hosts, and obtains the sub-links corresponding to the network ports of the multiple hosts.
[0094] The server divides the communication links according to the sub-network ports and sub-ports associated with each of the multiple hosts. For a detailed introduction to the sub-links corresponding to the network ports of the multiple hosts, see Figure 3 S304 in the illustrated embodiment will not be described in detail here.
[0095] exist Figure 4 In the embodiment shown, after dividing the network ports on the network card, the server obtains multiple sub-network ports corresponding to the network card, and then sends the identifiers of the multiple sub-network ports to the client. After receiving the identifiers of the multiple sub-network ports sent by the server, the client sends the number of the multiple sub-network ports to the switch. The switch divides the port connected to the network card of the server according to the number of the multiple sub-network ports to obtain multiple sub-ports. Then, the client determines the sub-network ports associated with each of the multiple hosts and the sub-ports associated with each of the multiple hosts according to the identifiers of the multiple sub-network ports and the identifiers of the multiple sub-ports, and sends the sub-network ports associated with each of the multiple hosts and the sub-ports associated with each of the multiple hosts to the server through the first indication information. The server divides the communication link according to the sub-network ports associated with each of the multiple hosts indicated in the first indication information and the sub-ports associated with each of the multiple hosts, and obtains the sub-links corresponding to the network ports of the multiple hosts. 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 sub-network ports. Then, the client determines the sub-ports associated with each of the multiple hosts and the sub-network ports associated with each of the multiple hosts. Finally, the server divides the communication link according to the sub-ports associated with each of the multiple hosts and the sub-network ports associated with each of the multiple hosts, and obtains the sub-links corresponding to the network ports of the multiple hosts, thereby dividing the sub-links corresponding to each host in the communication link. In this way, after receiving multiple LACP messages, the switch can determine that the LACP messages are LACP messages corresponding to different hosts on the same network card, and determine the hosts of the multiple LACP messages through the transmission sub-links of the multiple LACP messages, so as to accurately establish links or maintain links.
[0096] In the above embodiment, a link processing method provided by the embodiment of the present application is introduced. Since the network card binds the network port of the network card through the network card binding technology, after obtaining the sub-links corresponding to each of the multiple hosts, the sub-links corresponding to each of the multiple network ports of each host can be associated. The process of associating the sub-links corresponding to each of the multiple network ports of each host provided by the embodiment of the present application is further described below in combination with specific embodiments.
[0097] For each of the multiple hosts, an association operation is performed on the sub-links corresponding to each of the multiple network ports of the host 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.
[0098] For each of the multiple hosts, the sub-link group corresponding to the host includes the sub-links corresponding to the host on multiple network ports. Figure 6 To understand, Figure 6 A schematic diagram of creating a sub-link group is provided in an embodiment of the present application. Figure 6 As shown, the network card 51 includes a fifth network port 55 and a sixth network port 56, and the network card 51 is connected to the third host 52 and the fourth host 53, through Figure 3 The embodiment shown or Figure 4 In the link processing method in the illustrated embodiment, the fifth network port 55 is divided into sub-network port x and sub-network port y, the sixth network port 56 is divided into sub-network port z and sub-network port o, the port of the fifth switch 61 is divided into sub-port r and sub-port s, and the port of the sixth switch 62 is divided into sub-port t and sub-port u, wherein the sub-network port associated with the third host 52 is sub-network port x and sub-network port z, and the sub-port associated with the third host 52 is sub-port r and sub-port t; the sub-network port associated with the fourth host 53 is sub-network port y and sub-network port o, and the sub-port associated with the fourth host 53 is sub-port s and sub-port u. According to the sub-network port associated with the third host 52 and the sub-port associated with the third host 52, it is determined that the sub-link corresponding to the third host 52 on the fifth network port 55 is sub-link A, and the sub-link corresponding to the third host 52 on the sixth network port 56 is sub-link B; according to the sub-network port associated with the fourth host 53 and the sub-port associated with the fourth host 53, it is determined that the sub-link corresponding to the fourth host 53 on the fifth network port 55 is sub-link C, and the sub-link corresponding to the fourth host 53 on the sixth network port 56 is sub-link D. Then, the sub-link A and the sub-link B are associated to obtain sub-link group 1, wherein sub-link group 1 includes sub-link A and sub-link B; the sub-link C and the sub-link D are associated to obtain sub-link group 2, wherein sub-link group 2 includes sub-link C and sub-link D.
[0099] It should be noted that load balancing or redundant backup can be performed between the sub-links in the sub-link group.
[0100] In some embodiments, the method of load balancing between sub-links in a sub-link group can be as follows: determine the load flow 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 flow is greater than or equal to a preset load flow, determine a second sub-link in the sub-link group based on the load flow of each sub-link in the sub-link group, and the load flow of the second sub-link is less than the preset load flow; send first service data to the switch through the second sub-link, and the first service data is initially the service data transmitted through the first sub-link.
[0101] For each sub-link, the load flow of the sub-link refers to the amount of data or data rate transmitted through the sub-link during network communication. The load flow of the sub-link is used to measure the workload borne by the sub-link. That is, the larger the load flow of the sub-link, the greater the workload borne by the sub-link; the smaller the load flow of the sub-link, the smaller the workload borne by the sub-link.
[0102] The first sublink is a sublink whose load flow is greater than or equal to the preset load flow. The second sublink is a sublink whose load flow is less than the preset load flow. For example, assuming that the sublink group includes sublink A and sublink B, where the load flow of sublink A is 10 Mbps, the load flow of sublink B is 25 Mbps, and the preset load flow is 20 Mbps, then the first sublink is sublink B, and the second sublink is sublink A.
[0103] The first service data refers to a portion of service data initially transmitted by the first sub-link.
[0104] When the first sub-link exists in the sub-link group, the first service data is sent to the switch through the second sub-link. In this way, the workload of the first sub-link can be reduced, and the bandwidth resources of the first sub-link and the second sub-link can be reasonably used to avoid problems with the first sub-link due to excessive workload.
[0105] In some embodiments, the method of performing redundant backup between sub-links in a sub-link group can be as follows: detecting the status of each sub-link in the sub-link group corresponding to the host, the status is normal or abnormal; in the case that there is a third sub-link in an abnormal state in the sub-link group, sending second service data to the switch through at least one fourth sub-link, 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 is initially service data transmitted through the third sub-link.
[0106] In some embodiments, a method for detecting the status of each sub-link in the sub-link group corresponding to the host can 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 a first response information corresponding to the heartbeat packet is received within a first time period, the status of the sub-link is determined to be a normal state; when a first response information corresponding to the heartbeat packet is not received within the first time period, the status of the sub-link is determined to be an abnormal state.
[0107] A heartbeat packet is a special data packet used to detect the link status in network communication. The server can periodically send a heartbeat packet to the switch through a 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 a 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, the status of the sub-link is determined to be normal. If the first response information corresponding to the heartbeat packet is not received within the first time period, the status of the sub-link is determined to be abnormal.
[0108] In some embodiments, when the state of the sub-link is abnormal, the server sends a prompt message to the client, and the prompt message is used to prompt the host that the sub-link corresponding to the network port is in an abnormal state. Exemplarily, assuming that the sub-link corresponding to the network port M of the host a is sub-link A, when the server detects that the state of the sub-link A is abnormal, it sends a prompt message to the client, and the prompt message is used to prompt the host a that the sub-link A corresponding to the network port M is in an abnormal state.
[0109] The third sub-link is a sub-link in the sub-link group that is in an abnormal state; at least one fourth sub-link is a sub-link in the sub-link group other than the third sub-link. For example, assuming that the sub-link group includes sub-link A, sub-link B and sub-link C, wherein the state of sub-link A is a normal state, the state of sub-link B is an abnormal state, and sub-link C is in a normal state, 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 service data initially transmitted by the third sub-link.
[0111] In the case that there is a third sub-link in an abnormal state in the sub-link group, the second service data initially transmitted by the third sub-link is transmitted through at least one fourth sub-link. In this way, the normal transmission of the 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 state of the third sub-link is avoided.
[0112] In the above specific embodiment, the sub-links corresponding to each host at multiple network ports are associated 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, thereby expanding the network bandwidth and improving the network throughput. In addition, each sub-link in the sub-link group has the ability of load balancing and redundant backup, thereby improving the availability and reliability of the network.
[0113] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0114] Figure 7 A schematic diagram of a link processing device provided in an embodiment of the present application Figure 1 .like Figure 7 As shown, the embodiment of the present application further provides a link processing device 70, which includes a first division module 71, a first sending module 72, a first receiving module 73 and a second division module 74, wherein:
[0115] The first division module 71 is used to divide the network port on the network card according to the multiple hosts connected to the network card to obtain multiple sub-network ports corresponding to the network port; wherein a communication link is established between the network card and the switch through the network port and the port on the switch;
[0116] A first sending module 72, used for sending the identifiers of the multiple sub-network ports to the client;
[0117] The first receiving module 73 is used to receive first indication information sent by the client, where the first indication information is used to indicate subnet ports associated with multiple hosts in multiple subnet ports, and to indicate subports associated with multiple hosts in multiple subports; wherein the multiple subports are obtained by dividing the ports on the switch;
[0118] The second division module 74 is used to divide the communication link according to the sub-network ports and sub-ports associated with each of the multiple hosts, so as to obtain the sub-links corresponding to each of the network ports of the multiple hosts.
[0119] In a possible implementation manner, the first division module 71 is specifically configured to:
[0120] Determine the number of multiple hosts;
[0121] According to the number of multiple hosts, the network port is divided to obtain multiple sub-network ports corresponding to the network port;
[0122] The number of the multiple hosts is equal to the number of the multiple sub-network ports corresponding to the network port.
[0123] In a possible implementation manner, the link processing device 70 further includes a processing module, and the processing module is specifically configured to:
[0124] For each of the multiple hosts, an association operation is performed on the sub-links corresponding to the multiple network ports of the host to obtain a sub-link group corresponding to the host;
[0125] Each sub-link in the sub-link group is used for the host to communicate with the corresponding switch.
[0126] In a possible implementation manner, the processing module is further configured to:
[0127] Determine the load flow of each sub-link in the sub-link group corresponding to the host;
[0128] In the case that there is a first sublink in the sublink group whose load flow is greater than or equal to a preset load flow, determining a second sublink in the sublink group according to the load flow of each sublink in the sublink group, wherein the load flow of the second sublink is less than the preset load flow;
[0129] The first service data is sent to the switch through the second sub-link, where the first service data is initially service data transmitted through the first sub-link.
[0130] In a possible implementation manner, 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 normal or abnormal;
[0132] In the case that there is a third sub-link in an abnormal state in the sub-link group, the second service data is sent to the switch through at least one fourth sub-link, and 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 is initially service data transmitted through the third sub-link.
[0133] In a possible implementation manner, the processing module is further configured to:
[0134] For each sub-link in the sub-link group, a heartbeat packet is sent to the switch through the sub-link;
[0135] When first response information corresponding to the heartbeat packet is received within the first time period, determining that the state of the sub-link is a normal state;
[0136] When the first response information corresponding to the heartbeat packet is not received within the first time period, it is determined that the state of the sub-link is an abnormal state.
[0137] In a possible implementation manner, the processing module is further configured to:
[0138] When the state of the sub-link is abnormal, a prompt message is sent to the client, and the prompt message is used to prompt the host that the sub-link corresponding to the network port is in an abnormal state.
[0139] In a possible implementation manner, the link processing device 70 further includes a first determining module, and the first determining module is specifically configured to:
[0140] Get the load flow of multiple hosts in the historical period;
[0141] According to the load flows of the multiple hosts in a historical period, the bandwidths of the subnet ports associated with the multiple hosts are determined; wherein the bandwidths of the subnet ports associated with the hosts are positively correlated with the load flows of the hosts.
[0142] In a possible implementation manner, the first determining module is further configured to:
[0143] Get the current load flow of multiple hosts;
[0144] According to the current load flows of the multiple hosts, the bandwidths of the subnet ports associated with the multiple hosts are adjusted to obtain updated bandwidths of the subnet ports associated with 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 of the embodiment corresponding to the link processing method, which will not be described in detail here.
[0146] Figure 8 A schematic diagram of a link processing device provided in an embodiment of the present application Figure 2 , see Figure 8 The embodiment of the present application further provides a link processing device 80, which includes a second receiving module 81, a second determining module 82, and a second sending module 83, wherein:
[0147] The second receiving module 81 is used to receive the identifiers of the multiple sub-network ports sent by the server, where 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;
[0148] A second determination module 82 is used to determine the subnet ports associated with the plurality of hosts and the subports associated with the plurality of hosts according to the respective identifiers of the plurality of subnet ports and the respective identifiers of the plurality of subports; wherein the plurality of hosts are hosts connected to the network cards;
[0149] The second sending module 83 is used to send a first indication message to the server, where the first indication message is used to indicate the sub-network ports associated with multiple hosts in multiple sub-network ports, and to indicate the sub-ports associated with multiple hosts in multiple sub-ports; the first indication message is used to establish a sub-link corresponding to the host at the network port.
[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] Sending second indication information to the switch, where the second indication information is used to indicate the number of the multiple subnet ports;
[0152] The second response information sent by the switch is received, where the second response information includes respective identifiers of the plurality of sub-ports, where the plurality of sub-ports are obtained by dividing the port.
[0153] For the description of the features in the embodiment corresponding to the link processing device 80, reference can be made to the relevant description of the embodiment corresponding to the link processing method, which will not be described in detail here.
[0154] Fig. 9 A schematic diagram of a link processing device provided in an embodiment of the present application Figure 3 , see Fig. 9 The embodiment of the present application further provides a link processing device 90, which includes: a third receiving module 91, a third dividing module 92 and a third sending module 93, wherein:
[0155] The third receiving module 91 is used to receive second indication information sent by the client, where the second indication information is used to indicate the number of multiple sub-network ports, where 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 port and the port on the switch;
[0156] A third division module 92, configured to divide the port according to the number of the plurality of sub-network ports to obtain a plurality of sub-ports;
[0157] The third sending module 93 is used to send second response information to the client, where the second response information includes the identifiers of the multiple sub-ports.
[0158] For the description of the features in the embodiment corresponding to the link processing device 90, reference can be made to the relevant description of the embodiment corresponding to the link processing method, which will not be described in detail here.
[0159] Fig.10 This is a schematic diagram of the structure of the electronic device provided in this application. Fig.10As shown, the electronic device 100 provided in this embodiment includes: at least one processor 101 and a memory 102. Optionally, the device 100 also includes a communication component 103. The processor 101, the memory 102 and the communication component 103 are connected via a bus.
[0160] In a specific implementation process, at least one processor 101 executes the computer execution instructions stored in the memory 102, so that at least one processor 101 executes the above-mentioned link processing method embodiment.
[0161] The specific implementation process of the processor 101 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0162] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the application may be directly implemented as being executed by a hardware processor, or may be 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 (NVM), such as at least one disk storage.
[0164] The bus can 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 ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0165] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned link processing method embodiments when running.
[0166] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0167] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above link processing method embodiments are implemented.
[0168] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned link processing method embodiments are implemented.
[0169] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0170] The above is a detailed introduction to a link processing method, electronic device, storage medium and computer program product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A link processing method, characterized in that: The method comprises: According to the multiple hosts connected to the network card, the network port on the network card is divided to obtain multiple sub-network ports corresponding to the network port; wherein a communication link is established between the network card and the switch through the network port and the port on the switch; Sending the identifiers of the multiple subnet ports to the client; Receive first indication information sent by the client, where the first indication information is used to indicate the subnet ports associated with the multiple hosts in the multiple subnet ports, and to indicate the subports associated with the multiple hosts in the multiple subports; wherein the multiple subports are obtained by dividing the ports on the switch; The communication link is divided according to the sub-network ports and the sub-ports associated with each of the multiple hosts to obtain the sub-links corresponding to each of the multiple hosts at the network ports.
2. The method according to claim 1, characterized in that The method of dividing the network port on the network card according to the multiple hosts connected to the network card to obtain multiple sub-network ports corresponding to the network port includes: determining a number of the plurality of hosts; Dividing the network port according to the number of the multiple hosts to obtain multiple sub-network ports corresponding to the network port; The number of the plurality of hosts is equal to the number of the plurality of sub-network ports corresponding to the network port.
3. The method according to claim 1 or 2, characterized in that: The number of network ports on the network card is multiple, and the method further includes: For each of the multiple hosts, an association operation is performed on the sub-links corresponding to the multiple network ports of the host to obtain a sub-link group corresponding to the host; 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, characterized in that For each host among the multiple hosts, the method further includes: Determine the load flow of each sub-link in the sub-link group corresponding to the host; In the case that there is a first sublink in the sublink group whose load flow is greater than or equal to a preset load flow, determining a second sublink in the sublink group according to the load flow of each sublink in the sublink group, wherein the load flow of the second sublink is less than the preset load flow; First service data is sent to the switch through the second sub-link, where the first service data is 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 state of each sub-link in the sub-link group corresponding to the host, wherein the state is a normal state or an abnormal state; In the case that there is a third sub-link in the abnormal state in the sub-link group, second service data is sent to the switch through at least one fourth sub-link, and the at least one fourth sub-link is a sub-link in the sub-link group except the third sub-link, and the second service data is initially service data transmitted through the third sub-link.
6. The method according to claim 5, characterized in that 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 first response information corresponding to the heartbeat packet is received within a first time period, determining that the state of the sub-link is a normal state; When the first response information corresponding to the heartbeat packet is not received within the first time period, it is determined that the state of the sub-link is an abnormal state.
7. The method according to claim 6, characterized in that The method further comprises: When the state of the sub-link is the abnormal state, a prompt message is sent to the client, where the prompt message is used to prompt the host that the sub-link corresponding to the network port is in the abnormal state.
8. The method according to claim 1 or 2, characterized in that: The method further comprises: Obtaining the load flow of each of the plurality of hosts within a historical period; The bandwidth of the subnet ports associated with each of the multiple hosts is determined according to the load flows of each of the multiple hosts in the historical period; wherein the bandwidth of the subnet port associated with the host is positively correlated with the load flow of the host.
9. The method according to claim 8, characterized in that The method further comprises: Obtaining the current load flow of each of the multiple hosts; According to the current load flows of the multiple hosts respectively, the bandwidths of the sub-network ports associated with the multiple hosts respectively are adjusted to obtain updated bandwidths of the sub-network ports associated with the multiple hosts respectively.
10. A link processing method, characterized in that: The method comprises: Receiving identifications of respective sub-network ports sent by a server, wherein the 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; Determine, according to the respective identifiers of the plurality of sub-network ports and the respective identifiers of the plurality of sub-ports, the sub-network ports associated with the plurality of hosts respectively and the sub-ports associated with the plurality of hosts respectively; wherein the plurality of hosts are hosts connected to the network card; A first indication message is sent to the server, wherein the first indication message is used to indicate the sub-network ports associated with each of the multiple hosts among the multiple sub-network ports, and to indicate the sub-ports associated with each of the multiple hosts among the multiple sub-ports; the first indication message is used to establish a sub-link corresponding to the host at the network port.
11. The method according to claim 10, characterized in that The method further comprises: Sending second indication information to the switch, where the second indication information is used to indicate the number of the multiple subnet ports; A second response message sent by the switch is received, wherein the second response message includes identifiers of the multiple sub-ports, respectively, and the multiple sub-ports are obtained by dividing the port.
12. A link processing method, characterized in that: The method comprises: Receive second indication information sent by the client, where the second indication information is used to indicate the number of multiple sub-network ports, where 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; Dividing the port according to the number of the multiple sub-network ports to obtain multiple sub-ports; Sending second response information to the client, wherein the second response information includes identifiers of the multiple sub-ports.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement 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: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, 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.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, 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.
Citation Information
Patent Citations
Method and device of multilink load balancing based on Linux system
CN106982170A
Method and system for configuring multi-network cards in online transcoding system
CN106998269A
Tandem proxy system based on multi-link load balancing network
CN116527586A
Server network port flow control method and device
CN118740754A
Method and device for identifying bait host under link flooding attack
CN119276638A