CN105162650A - Method for monitoring switching time of redundancy network card - Google Patents
Method for monitoring switching time of redundancy network card Download PDFInfo
- Publication number
- CN105162650A CN105162650A CN201510475090.4A CN201510475090A CN105162650A CN 105162650 A CN105162650 A CN 105162650A CN 201510475090 A CN201510475090 A CN 201510475090A CN 105162650 A CN105162650 A CN 105162650A
- Authority
- CN
- China
- Prior art keywords
- switching time
- socket
- time
- tsub
- monitoring
- 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.)
- Granted
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a method for monitoring a switching time of a redundancy network card, and belongs to the technical field of software monitoring. The method provided by the invention is a software monitoring technology high in precision, small in error and low in network flow stability requirement. According to the technical scheme, a stream socket is adopted, namely TCP communication is completed based on the socket program socket, and an operation environment is a platform supporting socket communication. The method comprises the steps that (1), a host sends a plurality of data packets to a tested machine; (2), for all the data packets, the tested machine calculates receiving time sequences which are respectively a time difference between each front-and-back two data packets, a maximum value is found in all of the time differences, and the maximum value is an effective switching time; (3), the steps (1) and (2) are performed twice for testing, and a plurality of effective switching times are obtained; and (4), the maximum value is selected from the plurality of effective switching times, and the maximum value is a final test result.
Description
Technical field
The present invention relates to a kind of software monitors technical field, specifically a kind of method of monitoring redundancy network interface card switching time.
Background technology
Along with the high speed development of network technology and the progressively improvement of Ethernet stability, anti-interference and bandwidth problem, in the communication system higher to reliability requirement, in order to improve reliability and the survivability of control system, Redundancy Design is usually adopted to be used as a kind of method of raising equipment and system reliability.According to the requirement of Double redundancy backup, each node can only have an IP address, for the user program of application layer, still presents the feature of Single NIC.
Wherein, network redundancy is weigh the core standard of this grid switching time.Existing multiple monitoring method in the industry, is listed below representative monitoring method:
(1), monitor by network performance tester;
Advantage: do not need development monitoring software separately; Precision is high;
Shortcoming: need carry instrument, convenience is inadequate.
(2), monitor by network performance Software Testing Tool;
Advantage: need not development monitoring software separately;
Shortcoming: third party software, limitation is too strong, as restricted to network interface card model; The running environment that third party software is supported need be provided.
(3), monitoring of software 1 is certainly ground;
Scheme is sketched: 1ms sends out a network packet, sends the packet of some, draws switching time by statistics packet loss;
Advantage: software development difficulty is little; Thinking easy to understand; Most of running environment can be supported;
Shortcoming: error is larger.
(4), monitoring of software 2 is certainly ground;
Scheme is sketched:
First add up and receive and dispatch NUM packet time T1 used under normal circumstances;
Then, again receive and dispatch NUM packet, occur N time altogether at communication process plug netting twine and switch, statistics call duration time T2;
Calculate switching time=(T2-T1)/N;
Advantage: most of running environment can be supported.
Shortcoming: error is comparatively large, because network service itself exists unsteadiness, sometimes even there will be the situation of T2<T1.
In sum, the monitoring technology of main flow is existing a lot, but a kind of precision is not high, error is little, the software monitors technology low to network traffics stability requirement.
Summary of the invention
Technical assignment of the present invention is for above weak point, provides a kind of method of monitoring redundancy network interface card switching time.The present invention is that a kind of precision is high, error is little, the software monitors technology low to network traffics stability requirement.
The technical solution adopted for the present invention to solve the technical problems is:
Monitor the method for redundancy network interface card switching time, have employed stream socket, namely complete TCP communication based on socket program socket, running environment is support the platform of socket communication; Described method flow is:
(1), main frame sends multiple packet to tested machine;
(2), tested machine adds up in all packets, and time of receipt (T of R) order be the time difference between former and later two packets, in all time differences, add up maximum, i.e. once effective switching time;
(3), to major general's step (1), (2) repeat to test for twice, obtain multiple effective switching time;
(4), in multiple effective switching time, get maximum, be final testing result.
Main frame is server end, and tested machine is client.
Running environment is WindowsXP operating system, then select timeGetTime interface.
In step (2), obtain once effective switching time, statistics codes section is as follows:
DWORDt1,t2,tsub,tmax=0;
while(i<N)
{
t1=timeGetTime();
ret=recv(sClient,(char*)sendMessage,512*1024*sizeof(char),0);
if(ret==SOCKET_ERROR)
{
printf("%d-send()failed!\n",i);
break;
}
t2=timeGetTime();
tsub=t2-t1;
if(tsub>tmax)
Tmax=tsub; // statistics largest interval the time
}。
Socket is curstomer-oriented/server model design, need provide different Socket system calls for client and server program.
Compared to the prior art a kind of method of monitoring redundancy network interface card switching time of the present invention, has the following advantages:
1, can accurately to the time that user feedback network switching process spends;
When 2, being applied to non-real time operating system (as WindowsXP), also monitoring facilities priority can being improved, improve monitoring accuracy further;
3, precision is high, error is little, low to network traffics stability requirement.
Embodiment
Below in conjunction with specific embodiment, the invention will be further described.
A kind of method of monitoring redundancy network interface card switching time of the present invention, have employed stream socket, namely completes TCP communication based on socket program socket, and running environment is support the platform of socket communication; Described method flow is:
(1), main frame sends multiple packet to tested machine;
(2), tested machine adds up in all packets, and time of receipt (T of R) order be the time difference between former and later two packets, in all time differences, add up maximum, i.e. once effective switching time;
(3), to major general's step (1), (2) repeat to test for twice, obtain multiple effective switching time;
(4), in multiple effective switching time, get maximum, be final testing result.
Main frame is server end, and tested machine is client.
Running environment is WindowsXP operating system, then select timeGetTime interface.
In step (2), obtain once effective switching time, statistics codes section is as follows:
DWORDt1,t2,tsub,tmax=0;
while(i<N)
{
t1=timeGetTime();
ret=recv(sClient,(char*)sendMessage,512*1024*sizeof(char),0);
if(ret==SOCKET_ERROR)
{
printf("%d-send()failed!\n",i);
break;
}
t2=timeGetTime();
tsub=t2-t1;
if(tsub>tmax)
Tmax=tsub; // statistics largest interval the time
}。
The communication process of server end and client does not describe in detail at this.
Above-mentioned embodiment is only concrete case of the present invention; scope of patent protection of the present invention includes but not limited to above-mentioned embodiment; any according to the invention a kind of monitor claims of the method for redundancy network interface card switching time and any person of an ordinary skill in the technical field to its suitable change done or replacement, all should fall into scope of patent protection of the present invention.
Except the technical characteristic described in specification, be the known technology of those skilled in the art.
Claims (4)
1. monitor the method for redundancy network interface card switching time, it is characterized in that have employed stream socket, namely complete TCP communication based on socket program socket, running environment is support the platform of socket communication; Described method flow is:
(1), main frame sends multiple packet to tested machine;
(2), tested machine adds up in all packets, and time of receipt (T of R) order be the time difference between former and later two packets, in all time differences, add up maximum, i.e. once effective switching time;
(3), to major general's step (1), (2) repeat to test for twice, obtain multiple effective switching time;
(4), in multiple effective switching time, get maximum, be final testing result.
2. a kind of method of monitoring redundancy network interface card switching time according to claim 1, it is characterized in that main frame is server end, tested machine is client.
3. a kind of method of monitoring redundancy network interface card switching time according to claim 1, is characterized in that running environment is WindowsXP operating system, then select timeGetTime interface.
4. a kind of method of monitoring redundancy network interface card switching time according to claim 1, is characterized in that in step (2), and obtain once effective switching time, statistics codes section is as follows:
DWORDt1,t2,tsub,tmax=0;
while(i<N)
{
t1=timeGetTime();
ret=recv(sClient,(char*)sendMessage,512*1024*sizeof(char),0);
if(ret==SOCKET_ERROR)
{
printf("%d-send()failed!\n",i);
break;
}
t2=timeGetTime();
tsub=t2-t1;
if(tsub>tmax)
Tmax=tsub; // statistics largest interval the time
}。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510475090.4A CN105162650B (en) | 2015-08-05 | 2015-08-05 | A method of monitoring redundancy network interface card switching time |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510475090.4A CN105162650B (en) | 2015-08-05 | 2015-08-05 | A method of monitoring redundancy network interface card switching time |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105162650A true CN105162650A (en) | 2015-12-16 |
CN105162650B CN105162650B (en) | 2018-08-31 |
Family
ID=54803411
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510475090.4A Active CN105162650B (en) | 2015-08-05 | 2015-08-05 | A method of monitoring redundancy network interface card switching time |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105162650B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113612621A (en) * | 2021-06-21 | 2021-11-05 | 天津津航计算技术研究所 | Method for accurately calculating switching time of dual-redundancy network card under VxWorks |
CN116915670A (en) * | 2023-09-14 | 2023-10-20 | 浙江国利信安科技有限公司 | Method, apparatus and medium for determining network recovery time |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101175196A (en) * | 2006-10-31 | 2008-05-07 | 信息产业部电信传输研究所 | System and method for testing telecast demanding system based on IPv6 technology |
CN102684946A (en) * | 2012-05-25 | 2012-09-19 | 中国舰船研究设计中心 | Dual-network-interface-card switching performance testing method for information integration system |
CN103686813A (en) * | 2013-12-20 | 2014-03-26 | 上海斐讯数据通信技术有限公司 | Device and method for testing automatic switching stability of wireless AP (access point) channels |
-
2015
- 2015-08-05 CN CN201510475090.4A patent/CN105162650B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101175196A (en) * | 2006-10-31 | 2008-05-07 | 信息产业部电信传输研究所 | System and method for testing telecast demanding system based on IPv6 technology |
CN102684946A (en) * | 2012-05-25 | 2012-09-19 | 中国舰船研究设计中心 | Dual-network-interface-card switching performance testing method for information integration system |
CN103686813A (en) * | 2013-12-20 | 2014-03-26 | 上海斐讯数据通信技术有限公司 | Device and method for testing automatic switching stability of wireless AP (access point) channels |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113612621A (en) * | 2021-06-21 | 2021-11-05 | 天津津航计算技术研究所 | Method for accurately calculating switching time of dual-redundancy network card under VxWorks |
CN116915670A (en) * | 2023-09-14 | 2023-10-20 | 浙江国利信安科技有限公司 | Method, apparatus and medium for determining network recovery time |
CN116915670B (en) * | 2023-09-14 | 2023-12-05 | 浙江国利信安科技有限公司 | Method, apparatus and medium for determining network recovery time |
Also Published As
Publication number | Publication date |
---|---|
CN105162650B (en) | 2018-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100366005C (en) | Test method for throughput capacity of IP equipment | |
CN112291075B (en) | Network fault positioning method and device, computer equipment and storage medium | |
CN101145977B (en) | A QoS monitoring system and its measuring method of IP data network | |
CN104539483A (en) | Network testing system | |
CN105516292A (en) | Hot standby method of cloud platform of intelligent substation | |
CN107094091A (en) | A kind of intelligent substation station level network configuration method of calibration and system | |
CN109639534A (en) | A kind of method, apparatus and computer storage medium of test network transmission performance | |
CN111181800A (en) | Test data processing method and device, electronic equipment and storage medium | |
CN103023815A (en) | Aggregation link load sharing method and device | |
CN105162650A (en) | Method for monitoring switching time of redundancy network card | |
CN111385166A (en) | Network switch testing method, device, equipment and storage medium | |
EP2858302A1 (en) | Connectivity check method of service stream link, related apparatus and system | |
CN106161052B (en) | Network line selection method and network speed-measuring method | |
Phung et al. | An open dataset for beyond-5g data-driven network automation experiments | |
CN102238048B (en) | Protocol consistency testing method and system | |
CN103117880A (en) | Web technology based network topological generation method | |
US20200252125A1 (en) | Fronthaul remote access and monitoring systems and methods to test fiber optic infrastructure and RF spectrum | |
CN106230658B (en) | A kind of method and apparatus monitoring the network equipment | |
JP2020521395A (en) | Method, apparatus and system for monitoring data traffic | |
CN110519107A (en) | Metropolitan Area Network (MAN) circuit expansion method and device | |
CN114221882A (en) | Method, device, equipment and storage medium for detecting fault link | |
CN104408262A (en) | Online evaluation method and system for power grid relay protection constant value | |
CN104243314A (en) | Optical network end-to-end path establishment method and system based on energy efficiency diagram | |
CN107018518B (en) | Method and system for acquiring link detection information | |
CN105281970B (en) | Communicate disturbed test method, apparatus, electronic equipment and 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |