CN117675534A - System for switching dual-redundancy network card - Google Patents
System for switching dual-redundancy network card Download PDFInfo
- Publication number
- CN117675534A CN117675534A CN202311716244.5A CN202311716244A CN117675534A CN 117675534 A CN117675534 A CN 117675534A CN 202311716244 A CN202311716244 A CN 202311716244A CN 117675534 A CN117675534 A CN 117675534A
- Authority
- CN
- China
- Prior art keywords
- network card
- network
- physical link
- switching
- link state
- 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
Links
- 238000004891 communication Methods 0.000 claims abstract description 18
- 230000002159 abnormal effect Effects 0.000 claims abstract description 15
- 238000000034 method Methods 0.000 claims description 10
- 235000000421 Lepidium meyenii Nutrition 0.000 claims description 8
- 235000012902 lepidium meyenii Nutrition 0.000 claims description 8
- 230000001960 triggered effect Effects 0.000 claims description 8
- 238000012790 confirmation Methods 0.000 claims description 7
- 230000009977 dual effect Effects 0.000 claims description 6
- 101100328518 Caenorhabditis elegans cnt-1 gene Proteins 0.000 claims description 4
- 238000007689 inspection Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 claims 2
- 230000007547 defect Effects 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/22—Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention relates to a system for switching dual-redundancy network cards, and belongs to the technical field of network communication. The invention not only detects the physical link state of the network card in real time, but also judges the current network pressure state by calculating the delay time of the network message. The system not only solves the defect that when the physical link state is normal and the network communication is abnormal, the network communication cannot be switched to another network card, but also can select the network card with better state for communication, so that the network state is healthier.
Description
Technical Field
The invention belongs to the technical field of network communication, and particularly relates to a system for switching dual-redundancy network cards.
Background
In order to improve the stability and reliability of network communication between devices, in general, either device is provided with two network cards, which are respectively connected to two switching modules that have been cascaded together. Therefore, when one network card of the device fails or one section of network cable fails, the device can be switched to the other network card, and normal communication of the device between the systems is ensured.
In the prior art, a certain network card is firstly enabled, then the IP address of the network card is configured, and the value of the physical link register of the network card is further read periodically to acquire the physical link state of the network card at the moment. And when the physical link state is found to be disconnected, switching to another network card. The following defects are caused by taking the physical link state of the network card as a single criterion of whether to switch or not:
1. because the network card link status only relates to the PHY physical layer, the inter-device network may not be available when the device network card physical link status is normal.
2. When the data volume on the network is large, the health state of the current network can not be known only by judging the link state of the network card, and the resources of the exchange module can not be reasonably allocated.
Disclosure of Invention
First, the technical problem to be solved
The invention aims to solve the technical problems that: the system for switching the dual-redundancy network card solves the defect that when the physical link state is normal and the network communication is abnormal, the switching to the other network card cannot be realized.
(II) technical scheme
In order to solve the above technical problems, the present invention provides a system for switching dual redundant network cards, including:
the initialization module is used for initializing the network card A and the network card B respectively after the equipment is electrified, wherein one of the network card A and the network card B is set as a working network card, and the other network card is set as a standby network card;
the judging module is used for periodically checking the physical link state of the working network card, and switching to the standby network card if the physical link of the standby network card is normal after the physical link of the working network card is abnormal; when the physical link of the work network card is normal, triggering the checking module to work;
the checking module is used for periodically sending heartbeat messages between the devices and judging whether the current working network card works normally or not by judging whether the heartbeat messages are received or not; if the operation state is received, the operation state of the network card is normal, and the switching module is triggered to operate; switching the working network card and the standby network card in a certain period, and stopping switching once a heartbeat message is received;
and the switching module is used for sending UDP messages and feedback receiving confirmation messages between the devices, comparing the difference value of the time stamps of the two messages to judge the current network pressure state, and further determining whether to switch the network card.
The invention also provides a configuration method of the system.
The invention also provides application of the system in the technical field of network communication.
The invention also provides application of the system in the technical field of network security.
(III) beneficial effects
1. The system is not limited to judging whether the network card is required to be switched or not only by taking the physical link state of the network card as a basis, and judging whether the network communication is normal or not according to whether heartbeat messages can be normally received between all devices in the system, so that the defect that the network card is not switched when the physical link is normal but the network is not communicated can be avoided.
2. The system can judge the pressure state of the network where the current network card is located by calculating the delay time of the network message, and then select the network card with better state for communication.
Drawings
FIG. 1 is a schematic diagram of a dual redundant network card connection scheme for devices within a system;
FIG. 2 is a schematic diagram of a dual redundant network card switch of the present invention;
fig. 3 is a detailed flow chart of the dual redundant network card switching of the present invention.
Detailed Description
To make the objects, contents and advantages of the present invention more apparent, the following detailed description of the present invention will be given with reference to the accompanying drawings and examples.
Referring to fig. 2 and 3, the system for switching dual redundant network cards according to the present invention not only can ensure that physical links are normal by detecting network card links in real time, but also can select a proper network card for communication by detecting network communication states and data delay states in real time, including:
the initialization module is used for initializing the network card A and the network card B respectively after the equipment is electrified, wherein one of the network card A and the network card B is set as a working network card, and the other network card is set as a standby network card;
the judging module is used for periodically checking the physical link state of the working network card, and switching to the standby network card if the physical link of the standby network card is normal after the physical link of the working network card is abnormal; when the physical link of the work network card is normal, executing the step to trigger the check module to work;
the checking module is used for periodically sending heartbeat messages between the devices and judging whether the current network card works normally or not by judging whether the heartbeat messages are received or not; if the operation state is received, the operation state of the network card is normal, and the executing step triggers the switching module to operate; switching the working network card and the standby network card in a certain period, and stopping switching once a heartbeat message is received;
and the switching module is used for sending UDP messages and feedback receiving confirmation messages between the devices, comparing the difference value of the time stamps of the two messages to judge the current network pressure state, and further determining whether to switch the network card.
The initialization module specifically comprises:
obtaining the physical address of the network card A through a muxIoctl function and marking the physical address as MACA;
firstly, the network card A is mounted by using an iptach function, then the IP address, the physical address MACA and the gateway information of the network card A are configured by using an ifconfig function, and finally, the network card A is released by using an iptntach function.
Firstly, mounting the network card B by using an iptach function, further configuring the IP address, the physical address MACA and gateway information of the network card B by using an ifconfig function, and finally releasing the network card B by using an iptach function;
setting the same physical address for the network card A and the network card B, wherein the specific method is that the physical address MACA of the network card A is read out through muxIoctl, and then the physical address of the network card B is set as MACA;
and setting the working network card as the network card A by using the ifconfig function, and setting the network card B as the standby network card at the moment.
The reason for using the physical address of the network card a instead of the custom physical address is: when leaving the factory, the network card manufacturer has ensured the uniqueness of the physical address of each network card, so that the physical addresses of the working network cards of all devices in the system can be ensured not to collide.
The advantages of setting the network card A and the network card B to the same IP address and physical address are that: for the upper layer system, the two network cards are the same, and the same network card is externally displayed. If the physical addresses of the network card A and the network card B are different, the update of the ARP table is involved, so that the switching time of the network card is prolonged.
The judging module specifically comprises:
after the initialization is completed, the network card A is a working network card, and the network card B is a standby network card.
Periodically reading a link state value in a physical link register of the network card A to obtain the physical link state of the network card A; if the physical link state of the network card A is normal, the network card switching is not performed, and the inspection module is triggered to work at the moment; if the physical link state of the network card A is abnormal, the physical link state of the network card B is read, and if the physical link state of the network card B is abnormal, a fault is reported to a user; if the physical link state of the network card B is normal, switching to the network card B, and setting the network card B as a working network card.
After the network card B is set as a working network card, periodically reading a link state value in a physical link register of the network card B to obtain a physical link state of the network card B; if the physical link state of the network card B is normal, the network card switching is not performed, and the inspection module is triggered to work at the moment; if the physical link state of the network card B is abnormal, reading the physical link state of the network card A; if the physical link state of the network card A is abnormal, reporting a fault to a user; if the physical link state of the network card A is normal, switching to the A network card, setting the network card A as a working network card, and repeating the process. The specific method for switching the network card comprises the following steps: the fault network card is released by using the ipDetech, then a normal spare network card is mounted by using the ipAttch, and then the IP address and the gateway address are configured by using the ifconfig and the spare network card is enabled.
Therefore, when the physical link state of the network card is abnormal, network communication faults are necessarily caused, and therefore the priority of the judging module is highest.
The checking module is specifically used for realizing:
firstly, the devices in the system are electrified to broadcast heartbeat messages outwards, and if the broadcast heartbeat messages are received to indicate that the working state of the working network card is normal at the moment, the switching module is triggered to work at the moment; if no heartbeat message of any equipment is received, whether the heartbeat message is not sent out due to other equipment faults or the network message cannot be received by the equipment due to network faults cannot be judged at the moment, so that the working network card and the standby network card are switched with the period of 5s, and the switching is stopped once the broadcast heartbeat message is received.
The switching module comprises the following specific steps:
the method comprises the steps that UDP messages needing to be received and confirmed are sent between devices in a system, and a sending end sends a message sequence number cnt1 and a time stamp t1 in sending to a receiving end as message content; after receiving the UDP message with the message sequence number cnt1, the receiving end feeds back a receiving confirmation message with the highest priority, and the fed back receiving confirmation message also comprises a time stamp t 2. the health state of the current network can be represented by t2-t1, and the smaller t2-t1 is, the better the current network state is.
And when t2-t1 exceeds a certain threshold, switching network cards, and selecting the relatively healthier network card from the two network cards as the working network card.
It can be seen that the innovation point of the invention is that not only the physical link state of the network card is detected in real time, but also the current network pressure state is judged by calculating the delay time of the network message. The method not only solves the defect that when the physical link state is normal and the network communication is abnormal, the network communication cannot be switched to another network card, but also can select the network card with better state for communication, so that the network state is healthier.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present invention, and such modifications and variations should also be regarded as being within the scope of the invention.
Claims (10)
1. A system for switching between dual redundant network cards, comprising:
the initialization module is used for initializing the network card A and the network card B respectively after the equipment is electrified, wherein one of the network card A and the network card B is set as a working network card, and the other network card is set as a standby network card;
the judging module is used for periodically checking the physical link state of the working network card, and switching to the standby network card if the physical link of the standby network card is normal after the physical link of the working network card is abnormal; when the physical link of the work network card is normal, triggering the checking module to work;
the checking module is used for periodically sending heartbeat messages between the devices and judging whether the current working network card works normally or not by judging whether the heartbeat messages are received or not; if the operation state is received, the operation state of the network card is normal, and the switching module is triggered to operate; switching the working network card and the standby network card in a certain period, and stopping switching once a heartbeat message is received;
and the switching module is used for sending UDP messages and feedback receiving confirmation messages between the devices, comparing the difference value of the time stamps of the two messages to judge the current network pressure state, and further determining whether to switch the network card.
2. The system of claim 1, wherein the initialization module performs the steps of:
obtaining the physical address of the network card A through a muxIoctl function and marking the physical address as MACA;
firstly, mounting the network card A by using an iptach function, further configuring the IP address, the physical address MACA and gateway information of the network card A by using an ifconfig function, and finally releasing the network card A by using an iptach function;
firstly, mounting the network card B by using an iptach function, further configuring the IP address, the physical address MACA and gateway information of the network card B by using an ifconfig function, and finally releasing the network card B by using an iptach function;
and setting the working network card as the network card A by using the ifconfig function, and setting the network card B as the standby network card at the moment.
3. The system of claim 2, wherein the determination module performs the steps of:
periodically reading a link state value in a physical link register of the network card A to obtain the physical link state of the network card A; if the physical link state of the network card A is normal, the network card switching is not performed, and the inspection module is triggered to work at the moment; if the physical link state of the network card A is abnormal, the physical link state of the network card B is read, and if the physical link state of the network card B is abnormal, a fault is reported to a user; if the physical link state of the network card B is normal, switching to the network card B, and setting the network card B as a working network card.
After the network card B is set as a working network card, periodically reading a link state value in a physical link register of the network card B to obtain a physical link state of the network card B; if the physical link state of the network card B is normal, the network card switching is not performed, and the inspection module is triggered to work at the moment; if the physical link state of the network card B is abnormal, reading the physical link state of the network card A; if the physical link state of the network card A is abnormal, reporting a fault to a user; if the physical link state of the network card A is normal, switching to the A network card, setting the network card A as a working network card, and repeating the process; the specific method for switching the network card comprises the following steps: the fault network card is released by using the ipDetech, then a normal spare network card is mounted by using the ipAttch, and then the IP address and the gateway address are configured by using the ifconfig and the spare network card is enabled.
4. A system as claimed in claim 3, characterized in that the checking module performs the following steps in particular: firstly, the devices in the system are electrified to broadcast heartbeat messages outwards, and if the broadcast heartbeat messages are received to indicate that the working state of the working network card is normal at the moment, the switching module is triggered to work at the moment; if no heartbeat message of any equipment is received, whether the heartbeat message is not sent out due to other equipment faults or the network message cannot be received by the equipment due to network faults cannot be judged at the moment, so that the working network card and the standby network card are switched with a certain time as a period, and the switching is stopped once the broadcast heartbeat message is received.
5. The system of claim 4, wherein the checking module switches the working network card and the standby network card with a period of 5s if no heartbeat message of any device is received during the operation.
6. The system of claim 4, wherein the switching module implements the steps of: the method comprises the steps that UDP messages needing to be received and confirmed are sent between devices in a system, and a sending end sends a message sequence number cnt1 and a time stamp t1 in sending to a receiving end as message content; and after receiving the UDP message with the message sequence number cnt1, the receiving end feeds back a receiving confirmation message with the highest priority, wherein the fed back receiving confirmation message also comprises a time stamp t2, and when t2-t1 exceeds a certain threshold, network card switching is carried out, and the relatively healthier network card of the two network cards is selected as the working network card.
7. The system of claim 6, wherein a smaller t2-t1 indicates a better current network state.
8. A configuration method for implementing a system as claimed in any one of claims 1 to 7.
9. Use of a system according to any one of claims 1 to 7 in the field of network communication technology.
10. Use of the system according to claim 8 in the field of network security technology.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311716244.5A CN117675534A (en) | 2023-12-14 | 2023-12-14 | System for switching dual-redundancy network card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311716244.5A CN117675534A (en) | 2023-12-14 | 2023-12-14 | System for switching dual-redundancy network card |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117675534A true CN117675534A (en) | 2024-03-08 |
Family
ID=90078657
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311716244.5A Pending CN117675534A (en) | 2023-12-14 | 2023-12-14 | System for switching dual-redundancy network card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117675534A (en) |
-
2023
- 2023-12-14 CN CN202311716244.5A patent/CN117675534A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10708132B2 (en) | Technique for handling a status change in an interconnect node | |
CN102984059B (en) | Gigabit Ethernet redundancy network interface card and link switching condition criterion output control method thereof | |
US10003525B2 (en) | Methods and apparatus to provide redundancy in a process control system | |
CN101267360B (en) | Pseudo failure detection method and user boundary device | |
CN101729426B (en) | Method and system for quickly switching between master device and standby device of virtual router redundancy protocol (VRRP) | |
CN101094121B (en) | Method, system and device for detecting Ethernet links among not direct connected devices | |
CN102571492B (en) | Method and device for detecting failure of routing equipment | |
CN103401696A (en) | Dual-network redundant communication system in industrial equipment and communication method thereof | |
CN101895423A (en) | Data transmission method and system in Ethernet | |
CN108804260B (en) | SRIO system switching method and device | |
CN112291116A (en) | Link fault detection method and device and network equipment | |
CN101335657A (en) | Communication device, communication method, communication interface, and program product | |
CN105577444A (en) | Wireless controller management method and wireless controller | |
CN100484044C (en) | Method for detecting operating state of default gateway and apparatus thereof | |
CN102868616B (en) | Method for establishing virtual MAC (Media Access Control) address table item in network as well as router and system | |
CN117675534A (en) | System for switching dual-redundancy network card | |
CN117061327A (en) | Dual-redundancy network card switching method | |
CN101771583B (en) | Method and device for detecting elimination or no elimination of network failure | |
CN207992997U (en) | I2C bus systems | |
CN101399673B (en) | Micro TCA system, Micro TCA system management method | |
CN100376121C (en) | Iub interface business link inspecting device and method | |
CN102217359B (en) | Interface unit for base station control system and detecting method thereof | |
CN111628891B (en) | Dual-Ethernet redundancy realization method based on QNX | |
CN102932172A (en) | Method, equipment and system for detecting Ethernet ring failure node | |
CN100499500C (en) | Method for realizing management for multistage communication device |
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 |