CN114039907A - Method for improving link stability based on network card binding - Google Patents

Method for improving link stability based on network card binding Download PDF

Info

Publication number
CN114039907A
CN114039907A CN202111231027.8A CN202111231027A CN114039907A CN 114039907 A CN114039907 A CN 114039907A CN 202111231027 A CN202111231027 A CN 202111231027A CN 114039907 A CN114039907 A CN 114039907A
Authority
CN
China
Prior art keywords
link
network card
improving
stability based
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111231027.8A
Other languages
Chinese (zh)
Inventor
高霄霄
韩德亮
李德国
马晓光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian Chaoyue Shentai Information Technology Co Ltd
Original Assignee
Xian Chaoyue Shentai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xian Chaoyue Shentai Information Technology Co Ltd filed Critical Xian Chaoyue Shentai Information Technology Co Ltd
Priority to CN202111231027.8A priority Critical patent/CN114039907A/en
Publication of CN114039907A publication Critical patent/CN114039907A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/123Evaluation of link metrics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery

Abstract

The invention particularly relates to a method for improving link stability based on network card binding. The method for improving the link stability based on network card binding comprises the following steps of firstly, carrying out network card binding on a server network card, and setting a binding mode as a main-standby mode; then executing a system command to view the current main link; and monitoring the packet loss rate of the binding port, judging whether the packet loss rate is greater than a set threshold value, and executing a command to switch the link to a standby link after the packet loss rate is greater than the set threshold value. The method for improving the link stability based on network card binding can switch the link to the standby link in time under the condition that packet loss occurs in the main link, thereby ensuring normal communication of the network and improving the link stability.

Description

Method for improving link stability based on network card binding
Technical Field
The invention relates to the technical field of communication network management, in particular to a method for improving link stability based on network card binding.
Background
In networking, the connection of a single link is easy to implement, but a simple failure can cause network disruption. Therefore, in the process of actual network establishment, in order to ensure the stability of the network, some backup connections are usually used to improve the robustness and stability of the network, and such backup connections are also called backup links or redundant links.
With the development of the technology, a plurality of ethernet cards are configured for a server, and in a production environment, two network cards of the server are bound to realize hot standby of the network cards in order to ensure the network stability of the server. The network card binding has 7 modes, namely a balanced polling mode, a main standby mode, an exclusive or balanced mode, a broadcast mode, a dynamic link aggregation mode, an adapter transmission load balanced mode and an adapter load balanced mode.
One port of the main/standby mode is in a main state, one port of the main/standby mode is in a slave state, all flows are processed on the main link, and no flow exists. The method has the fault tolerance function, the resource utilization rate is 1/N, and the data packets are transmitted based on the designated HASH transmission strategy.
In the active/standby mode, there are two links on the network, which are the main link and the standby link, respectively. The main and standby links adopt a priority mode, and the main and standby switching lines cannot be completed under the condition that a routing interface is not disconnected (down) through testing. When the main port is disconnected, the standby port can take over the main state from the port.
For the stability of server networking, a multi-network card binding is usually set. However, the network card binding in the active/standby mode only performs active/standby switching when the main port is disconnected, and no action is performed after the link is in a packet loss state. Based on the situation, the invention provides a method for improving the link stability based on network card binding.
Disclosure of Invention
In order to make up for the defects of the prior art, the invention provides a simple and efficient method for improving the link stability based on network card binding.
The invention is realized by the following technical scheme:
a method for improving link stability based on network card binding is characterized in that: the method comprises the following steps:
1) network card binding is carried out on the network card of the server, and the binding mode is set as a main-standby mode;
2) executing a system command to check a current main link;
3) and monitoring the packet loss rate of the bound port, judging whether the packet loss rate is greater than a set threshold value, and executing a command to switch the link to a standby link after the packet loss rate is greater than the set threshold value.
In the step 1), the server has at least two network cards connected to the switch to communicate with other server devices, and at least two links are primary and standby links.
In the step 2), network card link states of the server are obtained first, and if the link states of at least two network cards are yes, ping packet operation is performed on the IP connected with the server, and the fact that the network card is bound with the current main link is determined.
In the step 2), an ethtool command is adopted to obtain the link state of the network card of the server.
In the step 2), ping packet operation is carried out on the IP of the connection server by adopting a ping packet command and an-i-c command.
In the step 2), the network card is determined to bind the current main link by looking up the system file/proc/net/binding 0.
In the step 3), a/usr/sbin/ifenslave-c command is adopted to switch the link.
In the step 3), the packet loss rate threshold is set to be 7%, 9%, 10% or 12%.
The invention has the beneficial effects that: the method for improving the link stability based on network card binding can switch the link to the standby link in time under the condition that packet loss occurs in the main link, thereby ensuring normal communication of the network and improving the link stability.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a method for improving link stability based on network card binding according to the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the embodiment of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The network structure is divided into an access layer, a convergence layer and a core layer:
the access layer is responsible for connecting the terminals; the convergence layer is responsible for processing data communication of the access layer switch; the core layer is responsible for handling the convergence layer (typically a three-layer switch) and routing.
The access layer, the convergence layer and the core layer adopt some protocols (such as Spanning Tree Protocol (STP)) to form a plurality of redundant links for backup.
A network link is a routed path that selects which gateway or router to traverse. The link structure refers to two-layer and three-layer equipment used in the network and what network protocol is used to achieve network intercommunication.
The method for improving the link stability based on network card binding comprises the following steps:
1) network card binding is carried out on the network card of the server, and the binding mode is set as a main-standby mode;
2) executing a system command to check a current main link;
3) and monitoring the packet loss rate of the bound port, judging whether the packet loss rate is greater than a set threshold value, and executing a command to switch the link to a standby link after the packet loss rate is greater than the set threshold value.
In the step 1), the server has at least two network cards connected to the switch to communicate with other server devices, and at least two links are primary and standby links.
In the step 2), network card link states of the server are obtained first, and if the link states of at least two network cards are yes, ping packet operation is performed on the IP connected with the server, and the fact that the network card is bound with the current main link is determined.
In the step 2), an ethtool command is adopted to obtain the link state of the network card of the server.
The ethatools command is a command for querying and setting network card parameters,
in the step 2), ping packet operation is carried out on the IP of the connection server by adopting a ping packet command and an-i-c command.
In the step 2), the network card is determined to bind the current main link by looking up the system file/proc/net/binding 0.
In the step 3), a/usr/sbin/ifenslave-c command is adopted to switch the link.
In practical application, a user can set a packet loss rate threshold according to actual requirements. The lower the packet loss rate threshold, the more frequent the switching of the main link and the standby link. If the packet loss rate threshold is set to be too high, the main link and the standby link are not switched in time, and network congestion cannot be relieved in time; however, if the packet loss threshold is set too low, frequent switching between the main link and the standby link may also cause network connection delay. Therefore, when setting the packet loss rate threshold, the network requirements of the server and the software and hardware conditions of the server should be considered comprehensively.
In the step 3), the packet loss rate threshold is set to be 7%, 9%, 10% or 12%. If the requirement of the application software on the network connection of the server is not high, the set value of the packet loss rate can be further relaxed, and specifically, any value which is greater than 0 and less than 100% can be set.
An example of network security control script code based on access control is as follows:
Figure BDA0003315933960000041
the method for improving the link stability based on network card binding in the embodiment of the present invention is described in detail above. While the present invention has been described with reference to specific examples, which are provided to assist in understanding the core concepts of the present invention, it is intended that all other embodiments that can be obtained by those skilled in the art without departing from the spirit of the present invention shall fall within the scope of the present invention.

Claims (8)

1. A method for improving link stability based on network card binding is characterized in that: the method comprises the following steps:
1) network card binding is carried out on the network card of the server, and the binding mode is set as a main-standby mode;
2) executing a system command to check a current main link;
3) and monitoring the packet loss rate of the bound port, judging whether the packet loss rate is greater than a set threshold value, and executing a command to switch the link to a standby link after the packet loss rate is greater than the set threshold value.
2. The method for improving link stability based on network card binding of claim 1, wherein: in the step 1), the server has at least two network cards connected to the switch to communicate with other server devices, and at least two links are primary and standby links.
3. The method for improving link stability based on network card binding according to claim 1, wherein: in the step 2), network card link states of the server are obtained first, and if the link states of at least two network cards are yes, ping packet operation is performed on the IP connected with the server, and the fact that the network card is bound with the current main link is determined.
4. The method for improving link stability based on network card binding according to claim 3, wherein: in the step 2), an ethtool command is adopted to obtain the link state of the network card of the server.
5. The method for improving link stability based on network card binding according to claim 3, wherein: in the step 2), ping packet operation is carried out on the IP of the connection server by adopting a ping packet command and an-i-c command.
6. The method for improving link stability based on network card binding according to claim 3, wherein: in the step 2), the network card is determined to bind the current main link by looking up the system file/proc/net/binding 0.
7. The method for improving link stability based on network card binding according to claim 1, wherein: in the step 3), a/usr/sbin/ifenslave-c command is adopted to switch the link.
8. The method for improving link stability based on network card binding according to claim 1, wherein: in the step 3), the packet loss rate threshold is set to be 7%, 9%, 10% or 12%.
CN202111231027.8A 2021-10-22 2021-10-22 Method for improving link stability based on network card binding Pending CN114039907A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111231027.8A CN114039907A (en) 2021-10-22 2021-10-22 Method for improving link stability based on network card binding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111231027.8A CN114039907A (en) 2021-10-22 2021-10-22 Method for improving link stability based on network card binding

Publications (1)

Publication Number Publication Date
CN114039907A true CN114039907A (en) 2022-02-11

Family

ID=80135166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111231027.8A Pending CN114039907A (en) 2021-10-22 2021-10-22 Method for improving link stability based on network card binding

Country Status (1)

Country Link
CN (1) CN114039907A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114793211A (en) * 2022-06-21 2022-07-26 新华三信息技术有限公司 Service multilink backup method and device based on blade service

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105049284A (en) * 2015-07-09 2015-11-11 浪潮电子信息产业股份有限公司 Linux system-based network redundancy testing method and device
CN111726246A (en) * 2020-05-29 2020-09-29 苏州浪潮智能科技有限公司 Main/standby network card switching method and device in network card binding mode and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105049284A (en) * 2015-07-09 2015-11-11 浪潮电子信息产业股份有限公司 Linux system-based network redundancy testing method and device
CN111726246A (en) * 2020-05-29 2020-09-29 苏州浪潮智能科技有限公司 Main/standby network card switching method and device in network card binding mode and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114793211A (en) * 2022-06-21 2022-07-26 新华三信息技术有限公司 Service multilink backup method and device based on blade service

Similar Documents

Publication Publication Date Title
US20110016243A1 (en) Method and device of load-sharing in irf stack
US7639605B2 (en) System and method for detecting and recovering from virtual switch link failures
CN102984057B (en) A kind of Multi-service integration dual-redundancy network system
CN101325497B (en) Autonegotiation over an interface for which no autonegotiation standard exists
EP2961112B1 (en) Message forwarding system, method and device
CN101588304A (en) Implementation method of VRRP
CN102014019B (en) Aggregated link switching method and device
CN112491700B (en) Network path adjustment method, system, device, electronic equipment and storage medium
CN105656645A (en) Decision making method and device for fault processing of stacking system
CN102821050A (en) Processing method for applying rapid spanning tree protocol to monocyclic network topology
CN109327386B (en) Link aggregation method, device, equipment and readable storage medium
AU2011229566B2 (en) Load sharing method and apparatus
CN103731303A (en) Method and device of vertical converged framework for achieving multi-active detection
CN107154896B (en) Data transmission method and forwarding equipment
CN111800336A (en) Routing transmission implementation method based on multi-channel network link aggregation
CN112822102A (en) Link switching method, device, equipment, system and storage medium
WO2017000096A1 (en) Link recovery method and network device
CN114039907A (en) Method for improving link stability based on network card binding
EP2426855B1 (en) Address refresh method and system
CN112995002B (en) Switch ring network design method, switch and storage medium
WO2009152700A1 (en) Method, system and transfer device for managing the network device port status
CN110677339A (en) Method and device for protecting redundancy between gateway nodes, gateway equipment and storage medium
CN103840965B (en) Method for enhancing quick fault convergence in RSTP
CN110995581B (en) Method and device for preventing black hole in route, electronic equipment and storage medium
CN112532500A (en) Ethernet loop protection CS-RING

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination