CN102891772A - Method and system for testing performance of network card - Google Patents

Method and system for testing performance of network card Download PDF

Info

Publication number
CN102891772A
CN102891772A CN2011102003091A CN201110200309A CN102891772A CN 102891772 A CN102891772 A CN 102891772A CN 2011102003091 A CN2011102003091 A CN 2011102003091A CN 201110200309 A CN201110200309 A CN 201110200309A CN 102891772 A CN102891772 A CN 102891772A
Authority
CN
China
Prior art keywords
package
packet loss
layer
network card
mtu value
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
CN2011102003091A
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.)
Zhongshan Yunchuang Intellectual Property Service Co ltd
Scienbizip Consulting Shenzhen Co Ltd
Original Assignee
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry 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 Hongfujin Precision Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co Ltd filed Critical Hongfujin Precision Industry Shenzhen Co Ltd
Priority to CN2011102003091A priority Critical patent/CN102891772A/en
Priority to TW100126162A priority patent/TWI479845B/en
Publication of CN102891772A publication Critical patent/CN102891772A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to a method for testing the performance of a network card. The method comprises the following steps of: segmenting files on an application layer by referencing an MTU (maximum transmission unit) value, and transmitting packets acquired by segmenting to a data link layer one by one; writing the packets into a writing buffer zone on the data link layer; acquiring a BAR address of the network card, and writing the packets in the writing buffer zone into the network card for caching according to the BAR address; delivering the packets in the writing buffer zone in a network card drive program of a physical layer, receiving the delivery results of the packets, and calculating a packet loss probability according to the delivery results; and modifying the MTU value in configuration files according to the packet loss probability. The invention also provides a system for testing the performance of the network card. According to the method and the system, the segmented files can be directly delivered, and the high-efficiency tests of the performance of the network card can be ensured.

Description

The network card performance testing method and system
Technical field
The present invention relates to a kind of network card performance testing method and system.
Background technology
MTU, full name are Maximum Transmission Unit, and MTU refers to certain maximum data packet size that can pass through above one deck (take byte as unit) of a kind of communication protocol.Great majority use the local area network (LAN) of Ethernet now, and the value of MTU is 1500 bytes, and this value is set by operating system when start.
When general diagnosis network card performance testing, when having file to transmit, the cutting apart of advanced style of writing part, call socket in application layer again and transmit file after cutting apart.In the transport process of file, the size of file can be subject to the restriction of MTU value.When file transfer during to network layer, can carry out again IP fragmentation to the file after cutting apart, packet size is to obtain with reference to the MTU value that grouping is sent to the network interface of data link layer in the IP fragmentation.File is down finished Internet Transmission again behind IP fragmentation.File after application layer is cut apart, also with carrying out IP fragmentation, process is complicated, affects the performance test of network interface card in network layer.
Summary of the invention
In view of above content, be necessary to provide a kind of network card performance testing method, can realize cutting apart the direct transmission of rear file, can guarantee the efficient test of network interface card performance.
In view of above content, also be necessary to provide a kind of network card performance testing system, can realize cutting apart the direct transmission of rear file, can guarantee the efficient test of network interface card performance.
Described network card performance testing method, the method may further comprise the steps: cut apart transmitting step: with reference to MTU value divided file, and the package that will obtain after will cutting apart transfers to data link layer one by one in application layer; Constitution step: package is write compose buffer in data link layer; Data write step: obtain the BAR address of network interface card, and according to this BAR address package in the compose buffer is write the network interface card buffer memory; Receiving record step: in the driver delivery compose buffer of physical layer network interface card, after the package, receive the delivery result of package, and calculate packet loss according to delivering the result; Modify steps: according to the MTU value in the packet loss modification configuration file.
Described network card performance testing system, this system comprises: cut apart transport module, be used in application layer with reference to MTU value divided file, and the package that will obtain after will cutting apart transfers to data link layer one by one; Constructing module is used in data link layer package being write compose buffer; The data writing module is used for obtaining the BAR address of network interface card, and according to this BAR address package in the compose buffer is write the network interface card buffer memory; The receiving record module is used for receiving the delivery result of package after the driver of physical layer network interface card is delivered the compose buffer package, and calculates packet loss according to delivering the result; Modified module is used for the MTU value according to packet loss modification configuration file.
Compared to prior art, described network card performance testing method and system can realize cutting apart the direct transmission of rear file, need not further to carry out IP fragmentation, thereby can realize the efficient test of network interface card performance.
Description of drawings
Fig. 1 is the Organization Chart of network card performance testing system preferred embodiment of the present invention.
Fig. 2 is the functional block diagram of network card performance testing system preferred embodiment of the present invention.
Fig. 3 is the flow chart of network card performance testing method of the present invention preferred embodiment.
Fig. 4 is the package that obtains after cutting apart among the present invention is transferred to data link layer by application layer exemplary plot.
The main element symbol description
Computer 1
Network card performance testing system 10
Network interface card 11
Database 12
Cut apart transport module 100
Constructing module 101
The data writing module 102
The receiving record module 103
Modified module 104
Following embodiment further specifies the present invention in connection with above-mentioned accompanying drawing.
Embodiment
As shown in Figure 1, be the Organization Chart of network card performance testing system preferred embodiment of the present invention.
Network card performance testing system 10 runs in the computer 1, also comprises network interface card 11 and database 12 in this computer 1.Database 12 is used for the delivery result of record package.
As shown in Figure 2, be the functional block diagram of network card performance testing system preferred embodiment of the present invention.
Described network card performance testing system 10 comprises cuts apart transport module 100, constructing module 101, data writing module 102, receiving record module 103, modified module 104.
The described transport module 100 cut apart is used in application layer with reference to MTU value divided file, and the package that will obtain after will cutting apart transfers to data link layer one by one.
The described transport module 100 of cutting apart is that the MTU value is deducted 40 bytes as the division foundation of divided file, and described MTU value is stored in the configuration file of computer system.
The exemplary plot that the package that obtains after cutting apart transfers to data link layer by application layer as shown in Figure 4.
The described transport module 100 cut apart is cut apart file in application layer, is divided into several user data, and will cut apart the one by one down transmission of user data that obtains.Each user data can add that the Appl stem transfers to transport layer in application layer when transmission, Appl stem and user data consist of application data.Each application data adds that in transport layer the TCP stem transfers to network layer, and TCP stem and application data add that in network layer the IP stem transfers to data link layer.The package that obtains after described cutting apart is application data, and the package that obtains after namely cutting apart is to be made of Appl stem and user data.
Described constructing module 101 is used in data link layer package being configured to write_buffer.Described write_buffer is called compose buffer.
Described write_buffer is one section internal memory of computer 1, described package is configured to write_buffer, is about to the internal memory that application data writes computer 1.
Described data writing module 102 is used for obtaining the BAR address of network interface card 11, and according to this BAR address package among the write_buffer is write network interface card 11 buffer memorys.
BAR, full name are base address registers, are that the operating system of computer 1 is to a kind of addressing system of peripheral hardware device access, the base address of namely usually saying.When described data writing module 102 after application data writes network interface card 11 buffer memorys in write_buffer, will deliver package at the driver of physical layer network interface card 11.
Described receiving record module 103 is used for receiving the delivery result of package, and record is delivered the result to database 12.
Described receiving record module 103 receives the delivery result of packages, delivers the result and be successfully or unsuccessfully.Described delivery outcome record is in a table of database 12.Show as follows:
The time interval (dividing) Number of success The frequency of failure Packet loss (%)
0~1 16 3 15.8
1~2 20 1 4.76
2~3 15 6 28.6
Comprise four hurdles in the upper table: the time interval, number of success, the frequency of failure and packet loss.Wherein, the time that 0 in the time interval begins to deliver for package, in one minute that time interval 0 ~ 1 expression package begins to deliver, this time interval can arrange according to user's needs; Number of success is the accumulation result that package is delivered number of success, the frequency of failure is the accumulation result that package is delivered the frequency of failure, delivering the result when package is successfully the time, number of success within the corresponding time interval adds 1, delivering the result when package is unsuccessfully the time, and the frequency of failure within the corresponding time interval adds 1; Packet loss is for calculating according to delivering the result, packet loss be the frequency of failure divided by the result of total degree, total degree is the summation of number of success and the frequency of failure.
Described modified module 104 is used for revising according to packet loss the MTU value of configuration file.
When packet loss is not more than 5%, revise MTU value in the configuration file and be original 3/2; When packet loss greater than 5% and less than 20% the time, the MTU value in the configuration file is constant; When packet loss is not less than 20%, revise MTU value in the configuration file and be original 3/4.
As shown in Figure 3, be the flow chart of network card performance testing method of the present invention preferred embodiment.
Step S100, described cut apart transport module 100 in application layer with reference to MTU value divided file, and the package that will obtain after will cutting apart transfers to data link layer one by one.
Described transport module 100 divided files of cutting apart are that the MTU value is deducted 40 bytes as the division foundation of file.
The described transport module 100 cut apart is cut apart file in application layer, is divided into several user data, and will cut apart the one by one down transmission of user data that obtains.User data adds that in application layer the Appl stem transfers to transport layer, and Appl stem and user data consist of application data.The package that obtains after described cutting apart is application data, and the package that obtains after namely cutting apart is to be made of Appl stem and user data.Application data adds that in transport layer the TCP stem transfers to network layer, and TCP stem and application data add that in network layer the IP stem transfers to data link layer.
Step S101, described constructing module 101 are configured to write_buffer in data link layer with package.
Described write_buffer is one section internal memory of computer 1, described package is configured to write_buffer, is about to the internal memory that application data writes computer 1.
Step S102, described data writing module 102 is obtained the BAR address of network interface card 11, and according to this BAR address package among the write_buffer is write network interface card 11 buffer memorys.
When described data writing module 102 after application data writes network interface card 11 buffer memorys in write_buffer, will deliver package at the driver of physical layer network interface card 11.
Step S103, described receiving record module 103 receives the delivery result of package, and record is delivered the result to database 12.
Described receiving record module 103 receives the delivery result of package, and will deliver outcome record in a table of database 12.Comprise four hurdles in the described table: the time interval, number of success, the frequency of failure and packet loss.Delivering the result when package be successfully the time, and the number of success within the corresponding time interval adds 1, and when package delivery result is unsuccessfully the time, the frequency of failure within the corresponding time interval adds 1; Packet loss is for calculating according to delivering the result.
Step S104, described modified module 104 is according to the MTU value in the packet loss modification configuration file.
When packet loss is not more than 5%, revise MTU value in the configuration file and be original 3/2; When packet loss greater than 5% and less than 20% the time, the MTU value in the configuration file is constant; When packet loss is not less than 20%, revise MTU value in the configuration file and be original 3/4.
Compared to prior art, by above-mentioned steps, can realize cutting apart the direct transmission of rear file, need not further to carry out IP fragmentation, thereby can realize the efficient test of network interface card performance.
Above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although with reference to preferred embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.

Claims (10)

1. a network card performance testing method is characterized in that, the method comprising the steps of:
Cut apart transmitting step: with reference to MTU value divided file, and the package that will obtain after will cutting apart transfers to data link layer one by one in application layer;
Constitution step: package is write compose buffer in data link layer;
Data write step: obtain the BAR address of network interface card, and according to this BAR address package in the compose buffer is write the network interface card buffer memory;
Receiving record step: in the driver delivery compose buffer of physical layer network interface card, after the package, receive the delivery result of package, and calculate packet loss according to delivering the result;
Modify steps: according to the MTU value in the packet loss modification configuration file.
2. network card performance testing method as claimed in claim 1 is characterized in that, described cutting apart in the transmitting step, deducts 40 bytes as the division foundation of divided file with the MTU value.
3. network card performance testing method as claimed in claim 1 is characterized in that, the described transmitting step of cutting apart comprises:
Be a plurality of user data with described file division;
Transfer to transport layer after each user data added the Appl stem, Appl stem and user data consist of application data, and the package that obtains after described cutting apart is made of Appl stem and user data;
In transport layer, transfer to network layer after this application data added the TCP stem;
In network layer, transfer to data link layer after TCP stem and application data added the IP stem.
4. network card performance testing method as claimed in claim 1 is characterized in that, described receiving record step comprises:
Create a table in database, this table comprises the time interval, number of success, the frequency of failure, four fields of packet loss;
Delivering the result when package is successfully the time, and the number of success within the corresponding time interval adds 1; Delivering the result when package is unsuccessfully the time, and the frequency of failure within the corresponding time interval adds 1; Calculate packet loss according to delivering the result.
5. network card performance testing method as claimed in claim 1 is characterized in that, described modify steps comprises:
When packet loss is not more than 5%, revise MTU value in the configuration file and be original 3/2;
When packet loss greater than 5% and less than 20% the time, the MTU value in the configuration file is constant;
When packet loss is not less than 20%, revise MTU value in the configuration file and be original 3/4.
6. a network card performance testing system is characterized in that, this system comprises:
Cut apart transport module, be used in application layer with reference to MTU value divided file, and the package that will obtain after will cutting apart transfers to data link layer one by one;
Constructing module is used in data link layer package being write compose buffer;
The data writing module is used for obtaining the BAR address of network interface card, and according to this BAR address package in the compose buffer is write the network interface card buffer memory;
The receiving record module is used for receiving the delivery result of package after the driver of physical layer network interface card is delivered the compose buffer package, and calculates packet loss according to delivering the result;
Modified module is used for the MTU value according to packet loss modification configuration file.
7. network card performance testing system as claimed in claim 6 is characterized in that, the described transport module of cutting apart is to deduct 40 bytes as the division foundation of divided file with the MTU value.
8. network card performance testing system as claimed in claim 6 is characterized in that, describedly cuts apart transport module carries out file by following step the transmission of cutting apart:
Be a plurality of user data with described file division;
Transfer to transport layer after each user data added the Appl stem, Appl stem and user data consist of application data, and the package that obtains after described cutting apart is made of Appl stem and user data;
In transport layer, transfer to network layer after this application data added the TCP stem;
In network layer, transfer to data link layer after this TCP stem and application data added the IP stem.
9. network card performance testing system as claimed in claim 6 is characterized in that, the receiving record module is finished the record of delivering the result by following step:
Create a table in database, this table comprises the time interval, number of success, the frequency of failure, four fields of packet loss;
Delivering the result when package is successfully the time, and the number of success within the corresponding time interval adds 1;
Delivering the result when package is unsuccessfully the time, and the frequency of failure within the corresponding time interval adds 1;
Calculate packet loss according to delivering the result.
10. network card performance testing system as claimed in claim 6 is characterized in that, described modified module is finished the modification of MTU value by following step:
When packet loss is not more than 5%, revise MTU value in the configuration file and be original 3/2;
When packet loss greater than 5% and less than 20% the time, the MTU value in the configuration file is constant;
When packet loss is not less than 20%, revise MTU value in the configuration file and be original 3/4.
CN2011102003091A 2011-07-18 2011-07-18 Method and system for testing performance of network card Pending CN102891772A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN2011102003091A CN102891772A (en) 2011-07-18 2011-07-18 Method and system for testing performance of network card
TW100126162A TWI479845B (en) 2011-07-18 2011-07-25 Method and system for testing nic performance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011102003091A CN102891772A (en) 2011-07-18 2011-07-18 Method and system for testing performance of network card

Publications (1)

Publication Number Publication Date
CN102891772A true CN102891772A (en) 2013-01-23

Family

ID=47535147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011102003091A Pending CN102891772A (en) 2011-07-18 2011-07-18 Method and system for testing performance of network card

Country Status (2)

Country Link
CN (1) CN102891772A (en)
TW (1) TWI479845B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI583212B (en) * 2015-06-29 2017-05-11 Zhi-An Huang Mobile communication available bandwidth measurement method
CN111147330A (en) * 2019-12-28 2020-05-12 国铁吉讯科技有限公司 Network quality evaluation method and device, storage medium and processor
CN111327645A (en) * 2018-11-28 2020-06-23 鸿合科技股份有限公司 Network sharing method and device and electronic equipment
CN112118594A (en) * 2020-08-07 2020-12-22 深圳市圣麾科技有限公司 Data uploading method, data downloading method, electronic equipment and storage medium
CN113973070A (en) * 2020-07-22 2022-01-25 中国移动通信有限公司研究院 Information acquisition method and device and test equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109510740A (en) * 2019-01-02 2019-03-22 郑州云海信息技术有限公司 A kind of method, apparatus, terminal and the storage medium of automatic monitoring network interface card MTU value

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1716964A (en) * 2004-06-30 2006-01-04 微软公司 Sustaining session connections
CN101677292A (en) * 2008-09-16 2010-03-24 中兴通讯股份有限公司 Method for fragmenting data in stream control transmission protocol
CN101741819A (en) * 2008-11-21 2010-06-16 上海电机学院 Protocol conversion gateway

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI313116B (en) * 2006-07-21 2009-08-01 A method for testing network interface card (nic)
US7715321B2 (en) * 2007-01-30 2010-05-11 International Business Machines Corporation Network interface card transmission control protocol acceleration offload failure detection and recovery mechanism
TW201117580A (en) * 2009-11-13 2011-05-16 Inventec Corp A pressure test method for network interface card

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1716964A (en) * 2004-06-30 2006-01-04 微软公司 Sustaining session connections
EP1613019A1 (en) * 2004-06-30 2006-01-04 Microsoft Corporation Sustaining session connections
US20060020707A1 (en) * 2004-06-30 2006-01-26 Microsoft Corpotation Sustaining session connections
CN101677292A (en) * 2008-09-16 2010-03-24 中兴通讯股份有限公司 Method for fragmenting data in stream control transmission protocol
CN101741819A (en) * 2008-11-21 2010-06-16 上海电机学院 Protocol conversion gateway

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI583212B (en) * 2015-06-29 2017-05-11 Zhi-An Huang Mobile communication available bandwidth measurement method
CN111327645A (en) * 2018-11-28 2020-06-23 鸿合科技股份有限公司 Network sharing method and device and electronic equipment
CN111327645B (en) * 2018-11-28 2023-11-21 鸿合科技股份有限公司 Network sharing method and device and electronic equipment
CN111147330A (en) * 2019-12-28 2020-05-12 国铁吉讯科技有限公司 Network quality evaluation method and device, storage medium and processor
CN113973070A (en) * 2020-07-22 2022-01-25 中国移动通信有限公司研究院 Information acquisition method and device and test equipment
CN112118594A (en) * 2020-08-07 2020-12-22 深圳市圣麾科技有限公司 Data uploading method, data downloading method, electronic equipment and storage medium

Also Published As

Publication number Publication date
TWI479845B (en) 2015-04-01
TW201306522A (en) 2013-02-01

Similar Documents

Publication Publication Date Title
CN102891772A (en) Method and system for testing performance of network card
CN104025690B (en) It is a kind of to adjust the method and user equipment for sending the time
CN110300115A (en) A kind of data transmission method and relevant apparatus based on multichannel
CN102737065A (en) Method and device for acquiring data
CN103414714B (en) Method, device and equipment for processing messages
CN107623646A (en) Data flow transmission method, send equipment and receiving device
CN109246705A (en) A kind of Data Radio Bearer integrity protection configuration method, terminal and the network equipment
CN109639768A (en) A kind of distribution blocked file transmission method and system
US20050135395A1 (en) Method and system for pre-pending layer 2 (L2) frame descriptors
CN107885539A (en) A kind of middleware management method and server
CN104753980A (en) Data transmission method and relevant device and communication system
CN105939324A (en) Message forwarding method and device
CN104866339A (en) Distributed persistent management method, system and device of FOTA data
CN104426794B (en) A kind of message forwarding method and device
CN103577469B (en) Database connection multiplexing method and apparatus
CN106331106B (en) Information issuing method and system
CN107171966A (en) A kind of VXLAN file transmitting methods, VTEP and VXLAN systems
CN106936852B (en) Data sending and receiving method, equipment and data transmission system
CN104038550B (en) Data communications method and its device, storage system
CN106936630A (en) A kind of whole bag upgrade method of many card insert type equipment and upgrade-system
CN108650306A (en) A kind of game video caching method, device and computer storage media
CN102629927A (en) Receiving and transmitting method and device as well as processing system for RTP (Real-time Transport Protocol) media data
CN104378217B (en) Determine the method and device of multicast group data
CN106658444A (en) Short message channel provider selection method and terminal
CN106357728A (en) Message processing method, system and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20151223

Address after: 528437 Guangdong province Zhongshan Torch Development Zone, Cheung Hing Road 6 No. 222 north wing trade building room

Applicant after: Zhongshan yunchuang Intellectual Property Service Co.,Ltd.

Address before: 518109 Guangdong province Shenzhen city Longhua District Dragon Road No. 83 wing group building 11 floor

Applicant before: SCIENBIZIP CONSULTING (SHEN ZHEN) Co.,Ltd.

Effective date of registration: 20151223

Address after: 518109 Guangdong province Shenzhen city Longhua District Dragon Road No. 83 wing group building 11 floor

Applicant after: SCIENBIZIP CONSULTING (SHEN ZHEN) Co.,Ltd.

Address before: 518109 Guangdong city of Shenzhen province Baoan District Longhua Town Industrial Zone tabulaeformis tenth East Ring Road No. 2 two

Applicant before: HONG FU JIN PRECISION INDUSTRY (SHENZHEN) Co.,Ltd.

Applicant before: HON HAI PRECISION INDUSTRY Co.,Ltd.

C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20130123