CN101436963B - Method for switching veneer network card, distributed system and veneer - Google Patents

Method for switching veneer network card, distributed system and veneer Download PDF

Info

Publication number
CN101436963B
CN101436963B CN 200810238922 CN200810238922A CN101436963B CN 101436963 B CN101436963 B CN 101436963B CN 200810238922 CN200810238922 CN 200810238922 CN 200810238922 A CN200810238922 A CN 200810238922A CN 101436963 B CN101436963 B CN 101436963B
Authority
CN
China
Prior art keywords
network interface
interface card
data
link
global pointer
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.)
Active
Application number
CN 200810238922
Other languages
Chinese (zh)
Other versions
CN101436963A (en
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN 200810238922 priority Critical patent/CN101436963B/en
Publication of CN101436963A publication Critical patent/CN101436963A/en
Application granted granted Critical
Publication of CN101436963B publication Critical patent/CN101436963B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method for switching network cards of single boards, a distribution type system and the single boards. The method for switching the network cards of the single boards comprises a first network card and a second network card with the same media access control address on the single board, wherein the first network card is bound with an internet protocol address. The method comprises a transmitting step and a receiving step, wherein the transmitting step comprises the following steps: carrying out data transmission on a transmission function by the first network card; and switching to the second network card when a switching condition comes into existence, and carrying out data transmission by the second network card; and the receiving step comprises the following step: returning the received data to an internet protocol layer of the first network card by a data receiving function. In the method, a line card is subjected to network backup unilaterally, when a network card of the line card has a failure, the other network card is automatically switched, thereby improving the stability and robustness of communication among boards, and realizing switching among network cards cleared to top level application without affecting the top level application. The method has the advantages of low cost, easy realization and maintenance.

Description

A kind of changing method of network interface card of veneer, distributed system and veneer
Technical field
The present invention relates to the network communications technology, relate in particular to a kind of changing method, distributed system and veneer of network interface card of veneer.
Background technology
Along with the fast development of internet, APPLICATION OF A DISTRIBUTED SYSTEM also more and more widely.In general, distributed system is made up of 3 major parts: master control borad, backboard and business board.Carry out communication between plate through backboard with Ethernet between master control borad and business board.With the distribution switch is example, comprises in the system: master control borad, backboard and ply-yarn drill, all be equipped with network interface card and be used for communication between plate on master control borad and the ply-yarn drill.
Because the sharp increase of message volume now; Be difficult to avoid because network interface card fault on the ply-yarn drill or the link failure between network interface card and main control board; And cause the communication between plates link occurs fault and interrupt; Serious meeting causes the message interaction between master control and the ply-yarn drill to be prevented from, and ply-yarn drill breaks away from the control of master control, causes communication service to be affected.
Summary of the invention
The changing method, distributed system and the veneer that the purpose of this invention is to provide a kind of network interface card of veneer are to solve owing to network interface card fault or the link failure between network interface card and main control board on the veneer cause the affected problem of communication service.The changing method of the network interface card of veneer of the present invention comprises: comprise first network interface card and second network interface card with identical Media Access Control Address on the said veneer; Said first network interface card is by the bonding network internet protocol address; Said method comprises forwarding step and receiving step, wherein:
Forwarding step comprises:
Sending function utilizes said first network interface card to carry out the data transmission;
When switching condition is set up, switch to said second network interface card, utilize said second network interface card to carry out data and send;
Receiving step comprises:
Receive the internet protocol layer that data function returns the data that receive said first network interface card.
First global pointer and second global pointer point to the control data structure of said first network interface card and second network interface card respectively, and said forwarding step is specially:
Send function and use said first global pointer, utilize said first network interface card to carry out data and send as suction parameter;
When switching condition is set up, the suction parameter of said transmission function is replaced with said second global pointer, utilize said second network interface card to carry out data and send.
In said receiving step; When receiving the interruption generating of data; Said reception data function is called; Parameter when calling is filled to said first global pointer or second global pointer by operating system according to the network interface card of actual reception datagram, after said reception data function gets access to data from said first global pointer or the corresponding network interface card of second global pointer, without exception data is returned to internet protocol layer through said first global pointer.
Said operating system is vxworks operating system.
The present invention also provides a kind of distributed system, comprising: main control board, slave control board, veneer;
Said veneer comprises: have first network interface card and second network interface card of identical Media Access Control Address, said first network interface card is by the bonding network internet protocol address;
Has first link between said first network interface card and the said main control board;
Has second link between said second network interface card and the said slave control board;
Said veneer also comprises:
The Link State detection module is used to detect the availability of said first link and second link;
The link switchover module is used between between said first network interface card and second network interface card, switching.
First global pointer and second global pointer point to the control data structure of said first network interface card and second network interface card respectively; Said Link State detection module detects said first link when unavailable; The suction parameter that said link switchover module will be sent function replaces with said second global pointer, utilizes said second network interface card to carry out data and sends;
But said Link State detection module detects the said first link time spent, and still said first global pointer through said transmission function acquiescence sends data.
The present invention also provides a kind of veneer, comprising:
Have first network interface card and second network interface card of identical Media Access Control Address, said first network interface card is by the bonding network internet protocol address;
Said first network interface card and main control board are set up first link;
Said second network interface card and slave control board are set up second link;
Said veneer also comprises:
The Link State detection module is used to detect the availability of said first link and second link;
The link switchover module is used between between said first network interface card and second network interface card, switching.
First global pointer and second global pointer point to the control data structure of said first network interface card and second network interface card respectively; Said Link State detection module detects said first link when unavailable; The suction parameter that said link switchover module will be sent function replaces with said second global pointer, utilizes said second network interface card to carry out data and sends;
But said Link State detection module detects the said first link time spent, and still said first global pointer through said transmission function acquiescence sends data.
Compared with prior art, the present invention has following beneficial effect:
1, among the present invention ply-yarn drill is unilaterally carried out network port backup, when a network interface card of ply-yarn drill breaks down, automatically switch to another network interface card, thereby improve the stability and the robustness of communication between plate.
2, the MAC Address through two network interface cards on the ply-yarn drill is set to identically, and its IP address also is set to identical, realizes transparent switching between the network interface card of upper layer application.Changing method between network interface card of the present invention is realized in data link layer, can not exert an influence to upper layer application.
3, cost low, be easy to realize and safeguard.
Description of drawings
Fig. 1 is the structural representation of distributed system of the present invention;
Fig. 2 is the switching device shifter sketch map in the ply-yarn drill of the present invention;
The method flow diagram of Fig. 3 for realizing that data link layer is switched;
Fig. 4 is for to see sketch map of the present invention from application point.
Embodiment
The invention provides a kind of transparent changing method between the network interface card of upper layer application, this network interface card is the network interface card that is used for communication between plates on the ply-yarn drill.Changing method of the present invention realizes that at link layer the active and standby network interface on the ply-yarn drill can be realized switching automatically according to the link quality.The present invention is to be the explanation that example is carried out with the distribution switch, can certainly be router, and on router, ply-yarn drill is called as business board, all is to belong to veneer.
Below in conjunction with accompanying drawing distributed system of the present invention and changing method are described.The present invention describes with the switching under vxworks operating system.Under vxworks operating system; The network interface card of same type uses identical driver; The handle that is provided by driver between the network interface card is distinguished, and MUX (multiplex layer, composite bed) is when calling the UDI of network interface card; Can import the handle of network interface card in the function into, this realizes the possibility that is switching to of network interface card for Drive Layer.
With reference to figure 1, Fig. 1 is a distributed system architecture sketch map of the present invention (having shown the connected mode between ply-yarn drill and master control borad among the figure), comprising:
Main control board 3, slave control board 4, ply-yarn drill 5.Wherein include two network interface cards on the ply-yarn drill 5, be respectively: through backboard 10 main communication network interface card 1 that is connected with the Switch (switch) 8 of main control board 3 and the communication network interface card 2 fully that is connected with the Switch9 of slave control board 4 through backboard 10.Network interface card 1 and network interface card 2 1:1 backup.Network interface card 1 forms the master with communication channel 6 with main control board 3, and network interface card 2 forms subsequent use communication channel 7 with slave control board 4.
Under the default situations, ply-yarn drill 5 uses main communication network interface card 1, and via Switch8 on the main control board 3 and main control board 3 communications, slave control board 4 is via Switch8 on the main control board 3 and network interface card 1 communication.
When main communication network interface card 1 fault or main communication network interface card 1 and 3 link failures of main control board; Switching device shifter in the ply-yarn drill 5 switches to network interface card 2 with the network interface card of current use from network interface card 1; Make communication network interface card 2 fully via and the Switch9 of slave control board 4 between passage 7 (shown in the dotted line); And via the link between the Switch8 of the Switch9 of slave control board 4 and main control board 3, with main control board 3 communications.
Switching device shifter in the ply-yarn drill 5 is with reference to shown in Figure 2.Fig. 2 comprises: initialization module, IP (InternetProtocol, Internet protocol) address binding module, calling module, Link State detection module and link switchover module.
After distributed system starts; By initialization module to network interface card 1 and 2 initialization; Make these 2 network interface cards that identical MAC (Media Access Control, media interviews control) address arranged, and point to the control data structure of 2 network interface cards respectively with 2 global pointer p1, p2.
After initialization was accomplished, IP address binding module was network interface card 1 binding IP address, and network interface card 1 is started working.
Then, send function and wait for the module invokes that is called with the reception data function, the transmission function in the present embodiment is called by MUX.Receiver function is the Interrupt Process function, and in the time of interruption generating, operating system is just called receiver function.Sending function and receiving data function and wait for when being called; The Link State detection module detects main availability with communication channel and subsequent use communication channel; If link satisfies predefined switching condition; Then the value of flag being composed is 1, if do not satisfy switching condition, then the value of flag being composed is 0.
Be called with the reception data function in case send function, then how carry out handover operation according to the function decision of calling by the link switchover module.
When the MUX layer sends data; The transmission function of network interface card is called; If the Link State detection module is judged current flag=1, the suction parameter that the link switchover module just will be sent function replaces with p2, sends data then; If the Link State detection module is judged current flag=0, then link switchover module still uses the suction parameter p1 that sends the function acquiescence to send data.
When receiving the interruption generating of data, Interrupt Process function (the reception data function of network interface card) is called.Parameter when calling is filled to p1 or p2 by operating system according to the network interface card of actual reception datagram; Receive in the data function; No matter parameter value is p1 or p2, after the network interface card from p1 or p2 correspondence gets access to data, without exception data are returned to the IP layer through p1.
In the process of above-mentioned transceive data, application program is only seen network interface card 1 from start to finish, and its IP address is the IP address of binding in advance.Communicating by letter between ply-yarn drill 5 and the main control board 3 is not affected because of the variation of Link State.
In the system of the present invention, though two network interface cards on the ply-yarn drill 5 have used two passages, because these two network interface cards have identical physical address and IP address; Therefore; For higher layer applications, still present the characteristics of Single NIC, can not exert an influence to higher layer applications.
With reference to figure 3, Fig. 3 is the method flow diagram that realization data link layer of the present invention is switched, and may further comprise the steps:
After the system start-up, initialization network interface card 1 and 2 makes 2 network interface cards that identical MAC (Media AccessControl, media interviews control) address arranged, and points to the control data structure of 2 network interface cards with 2 global pointer p1, p2;
Through defining this 2 pointers, make when MUX calls the interface of NIC driver, just can select the data structure of corresponding network interface card as required, to realize the switching between network interface card.
Be network interface card 1 binding IP address, network interface card 1 is started working;
Detect Link State, and according to Link State to flag (mark) assignment;
When supposing to satisfy switching condition, make flag=1, when not satisfying switching condition, make flag=0.
In the process that detects Link State, the transmission function of network interface card is waited for the reception data function and being called, and sends and receives routine and in a single day be called, with entering into following concrete handoff procedure.
For sending routine, if judge current flag=1, the suction parameter that just will send function replaces with p2, sends data then, if judge current flag=0, then still uses the suction parameter p1 that sends the function acquiescence to send data.
For receiving routine, has only the data of receiving with the high-rise network interface card of binding 1 transmission that could make progress.That is to say, at the driver that two network interface cards are used for backing up, be not handle p2 by the network interface card 2 of the MUX appointment Data transmission (even data are received by network interface card 2) that makes progress, but according to the network interface card of binding with the IP layer 1 Data transmission upwards.
In the present embodiment, the data of receiving return to the IP layer through p1 without exception, and application program is only seen network interface card 1 from start to finish, and its IP address is the IP address of binding in advance.Ply-yarn drill is not affected because of the variation of Link State with communicating by letter of main control board.
According to the network model of layering, also can system of the present invention be described with the notion of layering.With reference to figure 4, Fig. 4 is for to see sketch map of the present invention from application point.Among Fig. 4, all be the relation of calling between layer and the layer.Application program can be used the TCP/IP protocol suite communication through Socket (cover) interface; The call relation of TCP/IP protocol suite and MUX layer is encapsulated by VxWorks; The standard interface that MUX has used the Vxworks network interface card to drive to calling of network port driving program, network interface card drives 802.3 standards is followed in the operation of Ethernet card.
The above only is a preferred implementation of the present invention; Should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; Can also make some improvement and retouching, these improvement and retouching also should be regarded as protection scope of the present invention.

Claims (7)

1. the changing method of the network interface card of a veneer; It is characterized in that comprise first network interface card and second network interface card with identical Media Access Control Address on the said veneer, said first network interface card is by the bonding network internet protocol address; Said method comprises forwarding step and receiving step, wherein:
Forwarding step comprises:
Sending function utilizes said first network interface card to carry out the data transmission;
When switching condition is set up, switch to said second network interface card, utilize said second network interface card to carry out data and send;
Receiving step comprises:
Receive the internet protocol layer that data function returns the data that receive said first network interface card;
Wherein, In said receiving step; When receiving the interruption generating of data, said reception data function is called, and the parameter when calling is filled to first global pointer or second global pointer by operating system according to the network interface card of actual reception datagram; After said reception data function gets access to data from the corresponding network interface card of said first global pointer or second global pointer, without exception data are returned to internet protocol layer through said first global pointer;
Wherein, said first global pointer and said second global pointer point to the control data structure of said first network interface card and second network interface card respectively.
2. the changing method of the network interface card of veneer as claimed in claim 1 is characterized in that, said forwarding step is specially:
Send function and use said first global pointer, utilize said first network interface card to carry out data and send as suction parameter;
When switching condition is set up, the suction parameter of said transmission function is replaced with said second global pointer, utilize said second network interface card to carry out data and send.
3. the changing method of the network interface card of veneer as claimed in claim 1 is characterized in that, said operating system is vxworks operating system.
4. a distributed system comprises: main control board, slave control board, veneer;
It is characterized in that,
Said veneer comprises: have first network interface card and second network interface card of identical Media Access Control Address, said first network interface card is by the bonding network internet protocol address;
Has first link between said first network interface card and the said main control board;
Has second link between said second network interface card and the said slave control board;
Said veneer also comprises:
The Link State detection module is used to detect the availability of said first link and second link;
The link switchover module; Be used between between said first network interface card and second network interface card, switching; Wherein, When receiving the interruption generating of data, receive data function and be called, the parameter when calling is filled to first global pointer or second global pointer by said link switchover module according to the network interface card of actual reception datagram; After said reception data function gets access to data from the corresponding network interface card of said first global pointer or second global pointer, without exception data are returned to internet protocol layer through said first global pointer;
Wherein, said first global pointer and said second global pointer point to the control data structure of said first network interface card and second network interface card respectively.
5. distributed system as claimed in claim 4; It is characterized in that; Said Link State detection module detects said first link when unavailable, and the suction parameter that said link switchover module will be sent function replaces with said second global pointer, utilizes said second network interface card to carry out data and sends;
But said Link State detection module detects the said first link time spent, and still said first global pointer through said transmission function acquiescence sends data.
6. a veneer is characterized in that, comprising:
Have first network interface card and second network interface card of identical Media Access Control Address, said first network interface card is by the bonding network internet protocol address;
Said first network interface card and main control board are set up first link;
Said second network interface card and slave control board are set up second link;
Said veneer also comprises:
The Link State detection module is used to detect the availability of said first link and second link;
The link switchover module; Be used between between said first network interface card and second network interface card, switching; Wherein, When receiving the interruption generating of data, receive data function and be called, the parameter when calling is filled to first global pointer or second global pointer by said link switchover module according to the network interface card of actual reception datagram; After said reception data function gets access to data from the corresponding network interface card of said first global pointer or second global pointer, without exception data are returned to internet protocol layer through said first global pointer;
Wherein, said first global pointer and said second global pointer point to the control data structure of said first network interface card and second network interface card respectively.
7. veneer as claimed in claim 6; It is characterized in that; Said Link State detection module detects said first link when unavailable, and the suction parameter that said link switchover module will be sent function replaces with said second global pointer, utilizes said second network interface card to carry out data and sends;
But said Link State detection module detects the said first link time spent, and still said first global pointer through said transmission function acquiescence sends data.
CN 200810238922 2008-12-04 2008-12-04 Method for switching veneer network card, distributed system and veneer Active CN101436963B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810238922 CN101436963B (en) 2008-12-04 2008-12-04 Method for switching veneer network card, distributed system and veneer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810238922 CN101436963B (en) 2008-12-04 2008-12-04 Method for switching veneer network card, distributed system and veneer

Publications (2)

Publication Number Publication Date
CN101436963A CN101436963A (en) 2009-05-20
CN101436963B true CN101436963B (en) 2012-12-19

Family

ID=40711195

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810238922 Active CN101436963B (en) 2008-12-04 2008-12-04 Method for switching veneer network card, distributed system and veneer

Country Status (1)

Country Link
CN (1) CN101436963B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964719B (en) * 2009-07-23 2015-11-25 中兴通讯股份有限公司 Based on the data processing method of master control board switching, line card and master control borad
CN101877631A (en) * 2010-06-28 2010-11-03 中兴通讯股份有限公司 Server and business switching method thereof
CN102263660A (en) * 2011-07-19 2011-11-30 中国舰船研究设计中心 Dual-network card redundancy switching method and device
CN103176885A (en) * 2011-12-22 2013-06-26 鸿富锦精密工业(深圳)有限公司 Network card stoppage prompting system
CN102736585B (en) * 2012-05-14 2014-02-19 国家电网公司 Master/slave communication judging/switching system of local control unit based on pulse
CN104239251B (en) * 2013-06-07 2018-09-28 鼎点视讯科技有限公司 The transmission method and distributed apparatus of backboard data
CN104796276B (en) * 2014-01-21 2018-11-23 中国移动通信集团河南有限公司 A kind of link switch-over method and system
CN105337757A (en) * 2014-08-15 2016-02-17 中兴通讯股份有限公司 Line card management method and system
CN105577419A (en) * 2014-11-07 2016-05-11 中兴通讯股份有限公司 Data transmission method, device and system
CN104468238A (en) * 2014-12-22 2015-03-25 上海斐讯数据通信技术有限公司 Double-network-card redundancy switching method based on vxworks system
CN107306235A (en) * 2016-04-21 2017-10-31 中兴通讯股份有限公司 Link extended method and device between a kind of dual master control equipment master control
CN106445865A (en) * 2016-10-14 2017-02-22 上海泓戟信息科技有限公司 Connecting method for backplane bus of redundancy computer
CN113300821B (en) * 2021-05-21 2022-11-08 中国兵器装备集团自动化研究所有限公司 Dual-network-card network hot standby method and system based on sniffing technology
CN114338457B (en) * 2021-12-23 2023-12-01 绿盟科技集团股份有限公司 Test system, method, device, equipment and medium for network card switching effectiveness

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2715432Y (en) * 2004-06-15 2005-08-03 尹理根 Physical isolation device for network safety
CN1710966A (en) * 2005-07-08 2005-12-21 北京邮电大学 Intelligent external system based on control and use separation and having business generation ability
CN1960272A (en) * 2005-10-31 2007-05-09 环达电脑(上海)有限公司 Network security protection device for server, and implementation method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2715432Y (en) * 2004-06-15 2005-08-03 尹理根 Physical isolation device for network safety
CN1710966A (en) * 2005-07-08 2005-12-21 北京邮电大学 Intelligent external system based on control and use separation and having business generation ability
CN1960272A (en) * 2005-10-31 2007-05-09 环达电脑(上海)有限公司 Network security protection device for server, and implementation method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
韩礼红、王晓明、田玉河、李健.VxWorks下双网卡冗余备份及智能切换技术.《单片机与嵌入式系统应用》.2008, *

Also Published As

Publication number Publication date
CN101436963A (en) 2009-05-20

Similar Documents

Publication Publication Date Title
CN101436963B (en) Method for switching veneer network card, distributed system and veneer
CN102209024B (en) The moving method of virtual machine and system
CN100527716C (en) Method and gateway equipment for resuming service after switching status of main/standby gateway device
CN102075343B (en) An out-of-band management realization method, a system for the same and an out-of-band management switch
EP1895724A1 (en) A method for implementing active/standby gateway device in the network and a system thereof
CN101257405B (en) Method for implementing double chain circuits among master-salve equipments
CN102388570B (en) Single board running method and system under active-standby mode
CN101227319B (en) Redundancy switching method
CN100461697C (en) Service take-over method based on device disaster tolerance, service switching device and backup machine
CN102098201A (en) Method for realizing L2TP user access backup and network system
CN1848841A (en) Route equipment backup method
CN101355515B (en) Method for restarting link aggregation control protocol with elegance
CN101106443A (en) A system and method for controlling switch of primary and backup board
CN102055950B (en) MCU backup method and equipment in video conference
CN103095505A (en) Method and system for controlling power supply of power over Ethernet (POE) exchanger port
WO2012122768A1 (en) Method and device for communication of dual-network dual-standby terminal
CN102511146B (en) Implementation method for session board controller pool and session board controller
CN103036716A (en) Method and system for link switchover
WO2012106856A1 (en) Communication method for dual network dual standby terminal and apparatus thereof
CN100442791C (en) Method for improving data communication reliability using floating IP address
CN1533100A (en) Method for protecting coupling based on flow control transfer protocol
CN103514121B (en) A kind of network card redundancy switching method under WindowsXp operating system
CN103428682A (en) Auxiliary information sending method, user equipment, network side configuration method and network side
CN101217293B (en) Media operation trusteeship switching system and method
CN101674171B (en) Port configuration management method, single board and port configuration management system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant