A processing method for realizing dual-port activation
By binding a virtual network interface card to the Infiniband network card to form an aggregated network interface card, the problem of insufficient network bandwidth in the existing technology is solved, dual-port activation and high-availability switching are realized, and network bandwidth utilization and transmission speed are improved.
Patent Information
- Application Number
- CN202310625652.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-05-29
AI Technical Summary
Existing Linux bonding technology cannot effectively utilize the bandwidth of the two ports of the Infiniband network card, resulting in insufficient network bandwidth and the inability to achieve high availability and load balancing with dual-port activation.
By obtaining the list of physical network interface cards (NICs), virtual NICs, and aggregated NICs on the server, and using SR-IOV and bonding technologies to bind the virtual NICs to form aggregated NICs, the virtual NICs on different physical NICs are activated under fault-free conditions, thus achieving dual-port activation.
When a physical network interface card (NIC) port fails, the network continues to operate normally by switching the active virtual NIC interface, which increases network bandwidth utilization, achieves high availability switching, and allows the business network and data network to use different physical NIC ports to improve transmission speed.
Smart Images

Figure CN116633706B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital information transmission technology, and in particular to a processing method for realizing dual-port activation. Background Technology
[0002] Linux bonding technology is a native Linux solution for providing high availability and load balancing for network devices. While it offers numerous high availability and load balancing options for traditional Ethernet networks, for Infiniband networks, current Linux bonding only supports an active-standby configuration. For dual-port Infiniband network cards, this active-standby configuration can only utilize the bandwidth of one port, failing to leverage the bandwidth of both ports and resulting in limited network bandwidth. Therefore, implementing an active-active configuration for Infiniband networks to increase bandwidth is a pressing issue that needs to be addressed. Summary of the Invention
[0003] The purpose of this invention is to provide a method for implementing dual-port activation to increase the provided network bandwidth.
[0004] According to the present invention, a processing method for implementing dual-port activation is provided, comprising the following steps:
[0005] S100, Get the server list A = (a1, a2, ..., a... n ,…,a N ), a n Let n be the nth server in A, where n ranges from 1 to N, and N is the number of servers.
[0006] S200, obtain the list of physical network interface ports of the server B = (b1, b2, ..., b n ,…,b N ), b n for a n The two physical network interface ports of the Infiniband network card, b n =(b n,1 ,b n,2 ), b n,1 For b n The first physical network card port, b n,2 For b n The second physical network card port.
[0007] S300, retrieve the server's virtual network interface card list BX = (bx1, bx2, ..., bx...). n ,…,bx N ), bx n for a n virtual network adapter interface, bx n =(bx 1 n,1 ,bx 2 n,1 ,bx 1 n,2 ,bx 2 n,2 ), bx 1 n,1 For b n,1 The first virtual network interface card, bx 2 n,1 For b n,1 The second virtual network interface card, bx 1 n,2 For b n,2 The first virtual network interface card, bx 2 n,2 For b n,2 The second virtual network interface card.
[0008] S400, obtain the server's aggregated network interface card list C = (c1, c2, ..., c n ,…,c N ), c n for a n The aggregated network interface card, c n =(c n,1 ,c n,2 ), c n,1 for a n The first aggregated network interface card, c n,1 By bx 1 n,1 and bx 2 n,1 One of the virtual network adapter interfaces and bx 1 n,2 and bx 2 n,2 One of the virtual network interface cards is bound to it; c n,2 for a n The second converged network interface card, c n,2 By bx n Except for c n,1 Obtained by binding to other virtual network interface cards besides the corresponding virtual network interface card interface; in b n In the absence of a fault, c n,1 and c n,2The corresponding active virtual network interface comes from b n Different physical network card ports.
[0009] S500, iterate through C, and then... n,1 Used as a business network interface, c n,2 Used as a data network interface.
[0010] Compared with the prior art, the present invention has at least the following beneficial effects:
[0011] In this invention, each server includes two physical network interface card (NIC) ports, which are the two ports of an Infiniband NIC on the server. For each physical NIC port, two virtual NIC interfaces are created, thus one server corresponds to four virtual NIC interfaces. For the four virtual NIC interfaces of a server, two virtual NIC interfaces belonging to different physical NIC interfaces are bound to a single aggregated NIC interface. When the two physical NIC ports of the server are functioning correctly, the active virtual NIC interface in the two aggregated NIC interfaces for each server originates from different physical NIC ports of the server. Therefore, when one physical NIC port of the server fails, causing one aggregated NIC interface to become unusable, switching the active virtual NIC interface in the unusable aggregated NIC interface allows the unusable aggregated NIC interface to continue functioning normally, achieving high availability switching. Furthermore, this invention uses the two aggregated NIC interfaces corresponding to the server as interfaces for different networks, allowing the business network and data network to correspond to different physical NIC ports, fully utilizing the server's physical NIC ports and increasing the provided network bandwidth. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart illustrating a method for implementing dual-port activation as provided in an embodiment of the present invention. Detailed Implementation
[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0015] According to the present invention, such as Figure 1 As shown, a method for implementing dual-port activation is provided, including the following steps:
[0016] S100, Get the server list A = (a1, a2, ..., a... n ,…,a N ), a n Let n be the nth server in A, where n ranges from 1 to N, and N is the number of servers.
[0017] S200, obtain the list of physical network interface ports of the server B = (b1, b2, ..., b n ,…,b N ), b n for a n The two physical network interface ports of the Infiniband network card, b n =(b n,1 ,b n,2 ), b n,1 For b n The first physical network card port, b n,2 For b n The second physical network card port.
[0018] According to the present invention, each server is equipped with a dual-port Infiniband network card, wherein a n The two ports of the dual-port Infiniband network card configured above are b n,1 and b n,2 .
[0019] S300, retrieve the server's virtual network interface card list BX = (bx1, bx2, ..., bx...). n ,…,bx N ), bx n for a n virtual network adapter interface, bx n =(bx 1 n,1 ,bx 2 n,1 ,bx 1 n,2 ,bx 2 n,2 ), bx1 n,1 For b n,1 The first virtual network interface card, bx 2 n,1 For b n,1 The second virtual network interface card, bx 1 n,2 For b n,2 The first virtual network interface card, bx 2 n,2 For b n,2 The second virtual network interface card.
[0020] Optionally, SR-IOV technology can be used to separately target b n,1 and b n,2 Two virtual interfaces are created at the IP layer, with SR-IOV technology used for b. n,1 The two virtual interfaces created are bx 1 n,1 and bx 2 n,1 Using SR-IOV technology for b n,2 The two virtual interfaces created are bx 1 n,2 and bx 2 n,2 .
[0021] S400, obtain the server's aggregated network interface card list C = (c1, c2, ..., c n ,…,c N ), c n for a n The aggregated network interface card, c n =(c n,1 ,c n,2 ), c n,1 for a n The first aggregated network interface card, c n,1 By bx 1 n,1 and bx 2 n,1 One of the virtual network adapter interfaces and bx 1 n,2 and bx 2 n,2 One of the virtual network interface cards is bound to it; c n,2 for a n The second converged network interface card, c n,2 By bx n Except for c n,1 Obtained by binding to other virtual network interface cards besides the corresponding virtual network interface card interface; in b n In the absence of a fault, cn,1 and c n,2 The corresponding active virtual network interface comes from b n Different physical network card ports.
[0022] Optionally, bonding technology can be used to bind two virtual network interface cards.
[0023] According to the present invention, a n First aggregated network interface c n,1 The two corresponding virtual network interface cards come from different physical network interface card ports, c n,2 The two corresponding virtual network interface cards come from different physical network interface card ports and are not C. n,1 The corresponding two virtual network interface cards; optional, c n,1 and c n,2 The method for obtaining it includes the following steps:
[0024] S401, obtain a n Virtual network interface card (NIC) ID list PortID n =(portid) 1 n ,portid 2 n ,portid 3 n ,portid 4 n ), portid 1 n For bx 1 n,1 ID, portid 1 n =0; portid 2 n For bx 2 n,1 ID, portid 2 n =1; portid 3 n For bx 1 n,2 ID, portid 3 n =2; portid 4 n For bx 2 n,2 ID, portid 4 n =3.
[0025] S402, Traverse PortID n If portidi n If %2 = 0, then portid will be... i n The corresponding virtual network interface card is used as c n,1 The corresponding virtual network interface; otherwise, the portid. i n The corresponding virtual network interface card is used as c n,2 The corresponding virtual network interface; % is the modulo operation, i = 1, 2, 3, 4.
[0026] It should be understood that portid 1 n %2 = portid 3 n =0, portid 2 n %2 = portid 4 n =1, therefore, c n,1 The corresponding virtual network interface is b n,1 The first virtual network interface bx 1 n,1 and b n,2 The first virtual network interface bx 1 n,2 c n,2 The corresponding virtual network interface is b n,1 The second virtual network interface bx 2 n,1 and b n,2 The second virtual network interface bx 2 n,2 .
[0027] S403, c n,1 Bind the corresponding virtual network interface to obtain c n,1 .
[0028] According to the present invention, c n,1 To use bonding technology for b n,1 The first virtual network interface bx 1 n,1 and b n,2 The first virtual network interface bx 1 n,2 Obtained through binding.
[0029] S404, c n,2 Bind the corresponding virtual network interface to obtain c n,2 .
[0030] According to the present invention, c n,2 To use bonding technology for bn,1 The second virtual network interface bx 2 n,1 and b n,2 The second virtual network interface bx 2 n,2 Obtained through binding.
[0031] According to the present invention, when neither port of the Infiniband network card is faulty, c n,1 and c n,2 The corresponding active virtual network interface cards (NICs) come from different physical NIC ports. Therefore, two ports of the Infiniband NIC can be used to increase network bandwidth. Optionally, in b... n In the absence of a fault, c n,1 and c n,2 The method for determining the corresponding active virtual network interface includes the following steps:
[0032] S410, randomly select c n,1 One of the corresponding virtual network interface cards is used as c n,1 The initial activation interface.
[0033] S420, randomly select c n,2 One of the corresponding virtual network interface interfaces is c. n,2 The initial activation interface.
[0034] S430, Get ID n,1 id n,1 For c n,1 The initial activation interface ID; when c n,1 The initial activation interface is bx 1 n,1 At that time, id n,1 =0; when c n,1 The initial activation interface is bx 2 n,1 At that time, id n,1 =1; when c n,1 The initial activation interface is bx 1 n,2 At that time, id n,1 =2; when c n,1 The initial activation interface is bx 2 n,2 At that time, id n,1 =3.
[0035] S440, Get ID n,2 id n,2 For c n,2The initial activation interface ID; when c n,2 The initial activation interface is bx 1 n,1 At that time, id n,2 =0; when c n,2 The initial activation interface is bx 2 n,1 At that time, id n,2 =1; when c n,2 The initial activation interface is bx 1 n,2 At that time, id n,2 =2; when c n,2 The initial activation interface is bx 2 n,2 At that time, id n,2 =3.
[0036] S450, if int(id) n,1 / 2)≠int(id n,2 / 2), then c n,1 The initial activation interface is used as a function in b n c in the absence of a fault n,1 The corresponding virtual network interface that is in an active state will have c n,2 The initial activation interface is used as a function in b n c in the absence of a fault n,2 The corresponding virtual network interface that is currently active; int() is for rounding.
[0037] According to the present invention, if int(id) n,1 / 2)=int(id n,2 / 2), then c n,1 The initial activation interface is used as a function in b n c in the absence of a fault n,1 The corresponding virtual network interface that is in an active state, and c n,2 In the corresponding virtual network interface, another virtual network interface that is not the initially activated interface is used as the virtual network interface in b. n c in the absence of a fault n,2 The corresponding virtual network interface card that is in an active state.
[0038] It should be understood that if S410 randomly selects c n,1 The initial activation interface is bx 1 n,1 S420 randomly selects c n,2 The initial activation interface is bx 2 n,1 At that time, id n,1 =0, id n,2=1, then int(id) n,1 / 2)=int(id n,2 / 2)=0, in this case, the present invention maintains c n,1 The corresponding active virtual network interface remains unchanged, and c n,2 Switching the corresponding active virtual network interface card allows for the achievement of c. n,1 and c n,2 The corresponding virtual network interface cards that are active come from different physical network interface card ports.
[0039] If S410 randomly selects c n,1 The initial activation interface is bx 1 n,1 And S420 randomly selects c n,2 The initial activation interface is bx 2 n,2 At that time, id n,1 =0, id n,2 =3, then int(id) n,1 / 2)≠int(id n,2 / 2), has reached c n,1 and c n,2 The corresponding active virtual network interface cards (NICs) originate from different physical NIC ports, maintaining c n,1 and c n,2 The corresponding virtual network interface that is in an active state can remain unchanged.
[0040] S500, iterate through C, and then... n,1 Used as a business network interface, c n,2 Used as a data network interface.
[0041] According to the present invention, the first aggregated network interface card (NIC) interface of each server in A is used for the service network, and the second aggregated NIC interface of each server in A is used for the data network. Thus, the service network can use the network bandwidth of one port of the Infiniband NIC of each server in A for transmission, and the data network can use the network bandwidth of the other port of the Infiniband NIC of each server in A for transmission. The ports of the Infiniband NICs corresponding to the service network and the data network are different, and the service network and the data network do not share bandwidth, thereby improving the transmission speed of the service network and the data network respectively.
[0042] In this invention, each server includes two physical network interface card (NIC) ports, which are the two ports of an Infiniband NIC on the server. For each physical NIC port, two virtual NIC interfaces are created, thus one server corresponds to four virtual NIC interfaces. For the four virtual NIC interfaces of a server, two virtual NIC interfaces belonging to different physical NIC interfaces are bound to a single aggregated NIC interface. When the two physical NIC ports of the server are functioning correctly, the active virtual NIC interface in the two aggregated NIC interfaces for each server originates from different physical NIC ports of the server. Therefore, when one physical NIC port of the server fails, causing one aggregated NIC interface to become unusable, switching the active virtual NIC interface in the unusable aggregated NIC interface allows the unusable aggregated NIC interface to continue functioning normally, achieving high availability switching. Furthermore, this invention uses the two aggregated NIC interfaces corresponding to the server as interfaces for different networks, allowing the business network and data network to correspond to different physical NIC ports, fully utilizing the server's physical NIC ports and increasing the provided network bandwidth.
[0043] To achieve global consistency in the layout of server interfaces in A and facilitate operation and maintenance, the preferred method for implementing dual-port activation further includes the following steps:
[0044] S600: Select a server in A as the target server, and select the other servers in A besides the target server as the associated servers of the target server.
[0045] S700, the first information of each associated server is sent to the target server so that the target server adjusts the virtual network interface card that is in the active state according to the first information of the associated server; the first information includes the associated server ID and the virtual network interface card ID that is in the active state.
[0046] According to the present invention, the purpose of adjusting the virtual network interface card (NIC) of the target server in the active state in S700 is to make the virtual NIC of the target server in the active state consistent with the virtual NIC of the associated server in the active state, thereby achieving global consistency in the server interface layout; optionally, the step of adjusting the virtual NIC of the target server in the active state according to the first information of the associated server includes the following steps:
[0047] S701, Obtain the first information list E = (e1, e2, ..., e) of the associated server. j ,…e n-1 ), e j For the j-th associated server a' j The first information, ej =(nodeid) j activeid j ), nodeid j For a' j ID, activeid j For a' j The active virtual network interface ID; activeid j =(activeid) j,1 activeid j,2 ), activeid j,1 For a' j First aggregated network interface c' j,1 The corresponding virtual network interface that is in an active state is 'activeport' j,1 ID, activeid j,2 For a' j Second aggregated network interface c' j,2 The corresponding virtual network interface that is in an active state is 'activeport' j,2 ID; when activeport' j,1 For the first physical network card port b' j,1 When using the first virtual network interface, activeid j,1 =0; when activeport' j,1 For b' j,1 When using the second virtual network interface, activeid j,1 =1; when activeport' j,1 For the second physical network card port b' j,2 When using the first virtual network interface, activeid j,1 =2; when activeport' j,1 For b' j,2 When using the second virtual network interface, activeid j,1 =3; when activeport' j,2 For the first physical network card port b' j,1 When using the first virtual network interface, activeid j,2 =0; when activeport' j,2 For b' j,1 When using the second virtual network interface, activeid j,2 =1; when activeport' j,2 For the second physical network card port b' j,2 When using the first virtual network interface, activeid j,2=2; when activeport' j,2 For b' j,2 When using the second virtual network interface, activeid j,2 =3; the value of j ranges from 1 to N-1.
[0048] S702, Get activeid max activeid max The ID that appears most frequently among the virtual network interface IDs that are active on the target server and N-1 associated servers.
[0049] According to the present invention, the first virtual network interface card (NIC) ID of the first physical port of the target server and each associated server is 0, the second virtual NIC ID of the first physical port of the target server and each associated server is 1, the first virtual NIC ID of the second physical port of the target server and each associated server is 2, and the second virtual NIC ID of the second physical port of the target server and each associated server is 3.
[0050] Therefore, when activeid max When activeid = (0,3), it indicates that the virtual network interface card (NIC) ID of the target server and most of the associated servers is active when it is (0,3). Specifically, the virtual NIC interfaces of the target server and most of the associated servers are the first virtual NIC interface on the first physical port and the second virtual NIC interface on the second physical port. max When =(2,1), it means that the virtual network interface ID of the target server and most of the associated servers is in an active state. That is, the virtual network interface of the target server and most of the associated servers is in an active state. The virtual network interface is the first virtual network interface of the second physical port and the second virtual network interface of the first physical port.
[0051] S703, if Pmax > P'max, then proceed to S704; Pmax is the activeid. max The number of times the virtual network interface ID appears in the active state of the target server and N-1 associated servers, Pmax is the number of times 'activeid' appears. max The number of times 'activeid' appears in the virtual network interface IDs that are active on the target server and N-1 associated servers. max The ID that appears most frequently among the virtual network interface IDs that are active on the target server and N-1 associated servers.
[0052] S704, if the target server's virtual network interface card ID is not activeid.max Then, the virtual network interface card (NIC) of the target server that is in an active state will be adjusted so that the ID of the virtual NIC of the target server that is in an active state is activeid. max .
[0053] S705, activeid max Send to the association server so that the association server can use the activeid max Adjust the virtual network adapter interface that is in the active state.
[0054] According to S703, the activeid can be determined. max The most frequently occurring unique ID among the active virtual network interface card IDs of the target server and N-1 associated servers; according to S704 and S705, it can be determined by activeid. max Adjust the virtual network interface cards (NICs) that are active on the target server and associated servers so that the ID of the active NICs on both servers is now activeid. max Due to activeid max The ID that appears most frequently among the active virtual network interface card IDs of the target server and N-1 associated servers is the one that is unique. Therefore, the number of servers that need to be adjusted is relatively small.
[0055] Preferably, if Pmax = P'max in S703, then proceed to S706.
[0056] S706, Obtain the sum of traffic s1 of the first server during the test period; the first server is the target server and the virtual network interface card with active ID activeid among N-1 associated servers. max The server.
[0057] Optionally, the length of the test period can be set by the user based on experience.
[0058] S707, Obtain the sum of traffic s2 of the second server during the test period; the second server is the virtual network interface ID activeid' among the target server and N-1 associated servers. max The server.
[0059] S708, if s1>s2, then proceed to S709.
[0060] S709, if the target server's virtual network interface card ID is not activeid. max, the virtual network card interfaces of the target server in the active state are adjusted so that the ID of the virtual network card interface of the target server in the active state is activeid max .
[0061] S710, send activeid max to the associated server so that the associated server adjusts the virtual network card interfaces in the active state according to activeid max .
[0062] According to the present invention, in S708, if s1 < s2, then enter S711.
[0063] S711, if the ID of the virtual network card interface of the target server in the active state is not activeid’ max , the virtual network card interfaces of the target server in the active state are adjusted so that the ID of the virtual network card interface of the target server in the active state is activeid’ max .
[0064] S712, send activeid’ max to the associated server so that the associated server adjusts the virtual network card interfaces in the active state according to activeid’ max .
[0065] According to the present invention, if Pmax = P’max, it means that there are 2 IDs that appear the most frequently among the IDs of the virtual network card interfaces of the target server and N - 1 associated servers in the active state. In this case, the present invention determines a relatively optimal interface layout method by obtaining the network traffic sizes corresponding to these two IDs that appear the most frequently, and adjusts the virtual network card interfaces of the target server and the associated servers in the active state so that the IDs of the virtual network card interfaces of the adjusted target server and associated servers in the active state are all the IDs corresponding to the above relatively optimal interface layout method, achieving global consistency in the interface layout of each server, facilitating operation and maintenance; and the network traffic corresponding to the above relatively optimal interface layout method is larger, and adjusting the interface layout of each server according to the above relatively optimal interface layout method is beneficial to improving the transmission speed.
[0066] Although some specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are only for the purpose of illustration and not for the purpose of limiting the scope of the present invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A processing method for implementing dual-port activation, characterized in that, including the following steps: S100, Get the server list A=(a1,a2,…,a…) n ,…,a N ), a n Let n be the nth server in A, where n ranges from 1 to N, and N is the number of servers. S200, retrieve the list of physical network interface ports of the server B=(b1,b2,…,b n ,…,b N ), b n for a n The two physical network interface ports of the Infiniband network card, b n =(b n,1 ,b n,2 ), b n,1 For b n The first physical network card port, b n,2 For b n The second physical network interface card port; S300, retrieve the server's virtual network interface list BX=(bx1,bx2,…,bx n ,…,bx N ), bx n for a n virtual network adapter interface, bx n =(bx 1 n,1 ,bx 2 n,1 ,bx 1 n,2 ,bx 2 n,2 ), bx 1 n,1 For b n,1 The first virtual network interface card, bx 2 n,1 For b n,1 The second virtual network interface card, bx 1 n,2 For b n,2 The first virtual network interface card, bx 2 n,2 For b n,2 The second virtual network interface card; S400, retrieve the server's aggregated network interface card list C=(c1,c2,…,c n ,…,c N ), c n for a n The aggregated network interface card, c n =(c n,1 ,c n,2 ), c n,1 for a n The first aggregated network interface card, c n,1 By bx 1 n,1 and bx 2 n,1 One of the virtual network adapter interfaces and bx 1 n,2 and bx 2 n,2 One of the virtual network interface cards is bound to it; c n,2 for a n The second converged network interface card, c n,2 By bx n Except for c n,1 Obtained by binding to other virtual network interface cards besides the corresponding virtual network interface card interface; in b n In the absence of a fault, c n,1 and c n,2 The corresponding active virtual network interface comes from b n Different physical network card ports; S500, iterate through C, and then... n,1 Used as a business network interface, c n,2 Used as a data network interface; The processing method for implementing dual-port activation further includes the following steps: S600, designating a certain server in A as the target server and designating the other servers in A except the target server as the associated servers of the target server; S700, sending the first information of each associated server to the target server so that the target server adjusts the virtual network card interfaces in the active state according to the first information of the associated servers; the first information includes the associated server ID and the virtual network card interface ID in the active state; The step of adjusting the virtual network card interfaces in the active state of the target server according to the first information of the associated servers includes the following steps: S701, Obtain the first information list E=(e1,e2,…,e...) of the associated server. j ,…e n-1 ), e j For the j-th associated server a' j The first information, e j =(nodeid j activeid j ), nodeid j For a' j ID, activeid j For a' j The active virtual network interface ID; activeid j =(activeid j,1 activeid j,2 ), activeid j,1 For a' j First aggregated network interface c' j,1 The corresponding virtual network interface that is in an active state is 'activeport' j,1 ID, activeid j,2 For a' j Second aggregated network interface c' j,2 The corresponding virtual network interface that is in an active state is 'activeport' j,2 ID; when activeport' j,1 For the first physical network card port b' j,1 When using the first virtual network interface, activeid j,1 =0; when activeport' j,1 For b' j,1 When using the second virtual network interface, activeid j,1 =1; when activeport' j,1 For the second physical network card port b' j,2 When using the first virtual network interface, activeid j,1 =2; when activeport' j,1 For b' j,2 When using the second virtual network interface, activeid j,1 =3; when activeport' j,2 For the first physical network card port b' j,1 When using the first virtual network interface, activeid j,2 =0; when activeport' j,2 For b' j,1 When using the second virtual network interface, activeid j,2 =1; when activeport' j,2 For the second physical network card port b' j,2 When using the first virtual network interface, activeid j,2 =2; when activeport' j,2 For b' j,2 When using the second virtual network interface, activeid j,2 =3; the value of j ranges from 1 to N-1; S702, Get activeid max activeid max The ID that appears most frequently among the virtual network interface IDs that are active on the target server and N-1 associated servers; S703, if Pmax > P'max, then proceed to S704; Pmax is the activeid. max The number of times the virtual network interface ID appears in the active state of the target server and N-1 associated servers, Pmax is the number of times 'activeid' appears. max The number of times 'activeid' appears in the virtual network interface IDs that are active on the target server and N-1 associated servers. max The ID that appears most frequently among the active virtual network interface IDs of the target server and N-1 associated servers; S704, if the target server's virtual network interface card ID is not activeid. max Then, the virtual network interface card (NIC) of the target server that is in an active state will be adjusted so that the ID of the virtual NIC of the target server that is in an active state is activeid. max ; S705, activeid max Send to the association server so that the association server can use the activeid max Adjust the virtual network adapter interface that is in the active state; S703 further includes: if Pmax = P'max, then proceed to S706; S706, Obtain the sum of traffic s1 of the first server during the test period; the first server is the target server and the virtual network interface card with active ID activeid among N-1 associated servers. max The server; S707, Obtain the sum of traffic s2 of the second server during the test period; the second server is the virtual network interface ID activeid' among the target server and N-1 associated servers. max The server; S708, if s1 > s2, then proceed to S709; S709, if the target server's virtual network interface card ID is not activeid. max Then, the virtual network interface card (NIC) of the target server that is in an active state will be adjusted so that the ID of the virtual NIC of the target server that is in an active state is activeid. max ; S710, activeid max Send to the association server so that the association server can use the activeid max Adjust the virtual network adapter interface that is in the active state.
2. The processing method for implementing dual-port activation according to claim 1, characterized in that, c n,1 and c n,2 The method for obtaining it includes the following steps: S401, obtain a n Virtual network interface card (NIC) ID list PortID n =(portid 1 n ,portid 2 n ,portid 3 n ,portid 4 n ), portid 1 n For bx 1 n,1 ID, portid 1 n =0; portid 2 n For bx 2 n,1 ID, portid 2 n =1; portid 3 n For bx 1 n,2 ID, portid 3 n =2; portid 4 n For bx 2 n,2 ID, portid 4 n =3; S402, Traverse PortID n If portid i n If %2=0, then portid will be... i n The corresponding virtual network interface card is used as c n,1 The corresponding virtual network interface; otherwise, the portid. i n The corresponding virtual network interface card is used as c n,2 The corresponding virtual network interface; % is the modulo operation, i=1,2,3,4; S403, c n,1 Bind the corresponding virtual network interface to obtain c n,1 ; S404, c n,2 Bind the corresponding virtual network interface to obtain c n,2 .
3. The processing method for implementing dual-port activation according to claim 1, characterized in that, In b n In the absence of a fault, c n,1 and c n,2 The method for determining the corresponding active virtual network interface includes the following steps: S410, randomly select c n,1 One of the corresponding virtual network interface cards is used as c n,1 The initial activation interface; S420, randomly select c n,2 One of the corresponding virtual network interface interfaces is c. n,2 The initial activation interface; S430, Get ID n,1 id n,1 For c n,1 The initial activation interface ID; when c n,1 The initial activation interface is bx 1 n,1 At that time, id n,1 =0; when c n,1 The initial activation interface is bx 2 n,1 At that time, id n,1 =1; when c n,1 The initial activation interface is bx 1 n,2 At that time, id n,1 =2; when c n,1 The initial activation interface is bx 2 n,2 At that time, id n,1 =3; S440, Get ID n,2 id n,2 For c n,2 The initial activation interface ID; when c n,2 The initial activation interface is bx 1 n,1 At that time, id n,2 =0; when c n,2 The initial activation interface is bx 2 n,1 At that time, id n,2 =1; when c n,2 The initial activation interface is bx 1 n,2 At that time, id n,2 =2; when c n,2 The initial activation interface is bx 2 n,2 At that time, id n,2 =3; S450, if int(id) n,1 / 2)≠int(id n,2 / 2), then c n,1 The initial activation interface is used as a function in b n c in the absence of a fault n,1 The corresponding virtual network interface that is in an active state will have c n,2 The initial activation interface is used as a function in b n c in the absence of a fault n,2 The corresponding virtual network interface that is active; int() is for rounding.
4. The processing method for implementing dual-port activation according to claim 3, characterized in that, S450 further includes: If int(id) n,1 / 2)=int(id n,2 / 2), then c n,1 The initial activation interface is used as a function in b n c in the absence of a fault n,1 The corresponding virtual network interface that is in an active state, and c n,2 In the corresponding virtual network interface, another virtual network interface that is not the initially activated interface is used as the virtual network interface in b. n c in the absence of a fault n,2 The corresponding virtual network interface card that is in an active state.
5. The processing method for implementing dual-port activation according to claim 1, characterized in that, S708 further includes: if s1 < s2, then proceed to S711; S711, if the target server's virtual network interface card ID is not activeid max Then, the virtual network interface card (NIC) of the target server that is in an active state will be adjusted so that the ID of the virtual NIC of the target server that is in an active state is 'activeid'. max ; S712, activeid' max Send to the associated server so that the associated server can use the activeid. max Adjust the virtual network adapter interface that is in the active state.
Citation Information
Patent Citations
Redundancy protection method and system for realizing dual-port Active-Active
CN113472635A