CN107707422A - The network speed-measuring method replied based on the quick ACK of ONU driving layers - Google Patents

The network speed-measuring method replied based on the quick ACK of ONU driving layers Download PDF

Info

Publication number
CN107707422A
CN107707422A CN201710734381.XA CN201710734381A CN107707422A CN 107707422 A CN107707422 A CN 107707422A CN 201710734381 A CN201710734381 A CN 201710734381A CN 107707422 A CN107707422 A CN 107707422A
Authority
CN
China
Prior art keywords
speed
data
layer
onu
driving
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
CN201710734381.XA
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.)
Sichuan Tianyi Comheart Telecom Co Ltd
Original Assignee
Sichuan Tianyi Comheart Telecom 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 Sichuan Tianyi Comheart Telecom Co Ltd filed Critical Sichuan Tianyi Comheart Telecom Co Ltd
Priority to CN201710734381.XA priority Critical patent/CN107707422A/en
Publication of CN107707422A publication Critical patent/CN107707422A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Abstract

The invention discloses a kind of network speed-measuring method replied based on the quick ACK of ONU driving layers, CPU processing is no longer forwarded the data to when driving layer to receive measurement data when testing the speed, but how many measurement data are have received in driving layer record, then read the record each second and can be obtained by speed size;Because what the content for being not relevant for receiving data when testing the speed is, be only concerned it is per second have received how many data so that measurement data avoid the need for by CPU handle after be transmitted to application layer, upper layer application only needs the measurement data size that reading bottom per second records to obtain speed, so as to realize efficient test the speed.

Description

The network speed-measuring method replied based on the quick ACK of ONU driving layers
Technical field
Tested the speed field the present invention relates to network, and in particular to a kind of network replied based on the quick ACK of ONU driving layers is tested the speed Method.
Background technology
Tested the speed under normal circumstances on PC to confirm network bandwidth, be by under the software that tests the speed by the way of on PC Speed is carried to calculate bandwidth.The software that tests the speed downloads a big file by HTTP, removes the downloading rate during carrying and is averaged Value, this process are realized by Transmission Control Protocol.The data that PC ends receive can walk complete Transmission Control Protocol flow, and data are passed through Physical layer, data link layer, Internet, transport layer complete the reception of data.Often receive a data, the software that tests the speed on PC A Transmission Control Protocol can completely be parsed.Because the PC cpu performances used are very powerful(Compared to making on average family gateway CPU), it is whole to receive and bottleneck is not present in parsing TCP speed, so gigabit bandwidth tests the speed all without asking on PC Topic.The flow of this data forwarding is:Gateway hardware receives data and then is forwarded directly to PC, and intermediate data is by gateway Hardware forwarding, final data is handled on PC, so all without there is bottleneck in gigabit bandwidth.
The conventional data flow that carries out testing the speed on gateway is:Gateway hardware receives data and is then forwarded to gateway CPU, net Close the complete ICP/IP protocol of CPU parsings and finally pass the data to application program again;CPU parses the effect of complete Transmission Control Protocol Rate just need to see CPU performance how, so how tested the speed based on the routine on gateway just needs the performance for seeing CPU;So exist Tested the speed in the case of cpu performance in general based on average family gateway, the Transmission Control Protocol by routine to realize is to expire Sufficient bandwidth demand, also it is unable to reach result identical with what is tested the speed on PC.
The content of the invention
Drive what the quick ACK of layer was replied based on ONU it is an object of the invention to overcome the deficiencies of the prior art and provide a kind of Network speed-measuring method, tested the speed based on the quick ACK of the average family gateway driving layer high efficiency replied, TCP is assisted by reducing CPU The process of analysis and data forwarding paths of view efficiently test the speed to realize, caused by can so solving gateway cpu performance deficiency Test the speed the problem of can not reaching bandwidth demand.
The purpose of the present invention is achieved through the following technical solutions:
The network speed-measuring method replied based on the quick ACK of ONU driving layers, is comprised the following steps:
S01:The Socket connections that TCP tests the speed are established in application layer;
S02:Setting is tested the speed purpose IP, destination interface, source IP, source port corresponding to Socket;
S03:Purpose IP, destination interface, source IP, the relevant information of source port are delivered to system kernel and start to test the speed;
S04:The server that tests the speed passes data to network driver layer, and network driver layer receives data and judged corresponding to the data IP and port whether be test the speed Socket settings IP and port;It is not that then data continue to forward;It is then to enter in next step;
S05:The data length that driving layer record receives;
S06:Algorithm to be replied according to ACK and directly replys ACK in driving layer, data no longer forward, and according to the length computation of data Go out network rate.
Further, the step S05 is comprised the concrete steps that:
S11:Driving layer persistently records the cumulative length of the measurement data length, i.e. data that receive;
S12:Application layer read the measurement data length of driving layer record every one second by api interfaces;
S13:With the data length when the previous second subtract previous second data length be data in the unit interval transfer rate.
Further, the data length in the step S05 refers to the byte number of data, is obtained in the step S13 It is the speed in the unit interval in units of byte.
Further, the rate value in units of byte divided by 1024 be can obtain into downloading rate, its unit is Kb/s.
Further, the application layer according to test the speed the time or read data length come control test the speed it is when complete Into.
Further, the api interfaces that the application layer accesses network driver layer are the shared drive work(using Linux system It can realize.
Further, by encapsulating general purpose function copy_to_user and the copy_from_user interface of Linux system It can be achieved to copy data to kernel spacing from user's space and copy data to user's space from kernel spacing, so as to Complete the function that upper layer application arrange parameter obtains data length to network driver layer and from network driver layer.
Further, layer is driven in the step S04 then according to purpose IP, destination interface, source IP, source port to receiving All data are matched.
Further, the number that receives just is recorded when matching test purpose IP used, destination interface, source IP, source port ACK is replied according to length and according to acknowledgement character response mechanism.
The beneficial effects of the invention are as follows:No longer data are turned when driving layer to receive measurement data when testing the speed CPU processing is issued, but how many measurement data have received in driving layer record, then reads the record can each second Obtain speed size;Because what the content for being not relevant for receiving data when testing the speed is, it is only concerned per second have received how many Data cause measurement data to avoid the need for being transmitted to application layer after handling by CPU, and upper layer application only needs reading bottom per second The measurement data size of layer record obtains speed, so as to realizing efficient test the speed.
Brief description of the drawings
Fig. 1 is the flow chart of the present invention.
Embodiment
Technical scheme is described in further detail below in conjunction with the accompanying drawings, but protection scope of the present invention is not limited to It is as described below.
As shown in figure 1,
The network speed-measuring method replied based on the quick ACK of ONU driving layers, is comprised the following steps:
S01:The Socket connections that TCP tests the speed are established in application layer;
S02:Setting is tested the speed purpose IP, destination interface, source IP, source port corresponding to Socket;
S03:Purpose IP, destination interface, source IP, the relevant information of source port are delivered to system kernel and start to test the speed;
S04:The server that tests the speed passes data to network driver layer, and network driver layer receives data and judged corresponding to the data IP and port whether be test the speed Socket settings IP and port;It is not that then data continue to forward;It is then to enter in next step;
S05:The data length that driving layer record receives;
S06:Algorithm to be replied according to ACK and directly replys ACK in driving layer, data no longer forward, and according to the length computation of data Go out network rate.
It is that TCP acknowledgement character response is realized in driving layer to realize the mode key point that tests the speed.The number that tests the speed based on TCP connections According to needing ACK responses to ensure that connection is normal in TCP transmission, and in the case where measurement data is not transmitted to upper layer application Upper layer application there will not be ACK responses, so just needing to realize that ACK responses so just can guarantee that the server that tests the speed is held in driving layer Continuous transmission data.Therefore realize an easy acknowledgement character response mechanism in driving layer and realize TCP quick acknowledgement character response to protect Demonstrate,proving measurement data in a network can normal transmission.
Another emphasis for realizing the mode that tests the speed is exactly how to judge and record measurement data in driving layer.On gateway The socket connections first established and test the speed when being tested the speed between server, then by the related mesh of the socket connections IP, destination interface, source IP, source port parameter configuration to driving layer, driving layer then according to purpose IP, destination interface, source IP, source Port is matched to all data received, and purpose IP used, destination interface, source IP, source port are tested just when matching Record the data length received and ACK is replied according to acknowledgement character response mechanism.
TCP test the speed beginning when, test the speed after address establishes socket successful connections with TCP, this tested the speed by api interfaces The relevant informations such as the purpose IP of connection, destination interface, source IP, source port are delivered to network driver layer.
After the parameter for setting connection of testing the speed, the server that tests the speed can come data transfer, can be received in driving layer The corresponding ACK messages of TCP are replied to the data for server return of testing the speed, and in driving layer.Layer can statistics is so driven to survey The data that fast server passes over until measurement data be transmitted or application layer actively stop download.Now application layer can To obtain the size of data received every for a period of time by api interfaces, tested the speed so as to realize.
Further, the step S05 is comprised the concrete steps that:
S11:Driving layer persistently records the cumulative length of the measurement data length, i.e. data that receive;
S12:Application layer read the measurement data length of driving layer record every one second by api interfaces;
S13:With the data length when the previous second subtract previous second data length be data in the unit interval transfer rate.
Further, the data length in the step S05 refers to the byte number of data, is obtained in the step S13 It is the speed in the unit interval in units of byte.
Further, the rate value in units of byte divided by 1024 be can obtain into downloading rate, its unit is Kb/s.
Because driving layer can persistently record the measurement data length received, i.e. data word joint number, so application layer is every one Second by api interfaces read driving layer record measurement data length.What it is due to driving layer record is to receive adding up for data Length, so speed should be that the data length that goes one second can be obtained by a unit and be before the data length of previous second The speed of bytes-per-second, this value divided by 1024 can be obtained by downloading rate is how many Kb/s.Application layer is according to the time of testing the speed Or when the data length read is completed to control to test the speed.
Further, the api interfaces that the application layer accesses network driver layer are the shared drive work(using Linux system It can realize.
Further, by encapsulating general purpose function copy_to_user and the copy_from_user interface of Linux system It can be achieved to copy data to kernel spacing from user's space and copy data to user's space from kernel spacing, so as to Complete the function that upper layer application arrange parameter obtains data length to network driver layer and from network driver layer.
Realize that upper layer application arrange parameter obtains the api interfaces of data length to network driver layer and from network driver layer According to different platform(System)There is different implementations, due to the Linux system platform that ONU gateways are, so application layer The api interfaces for accessing network driver layer are realized using the shared drive function of Linux system.Therefore encapsulation is passed through General purpose function copy_to_user and the copy_from_user interface of Linux system can be achieved to copy data from user's space Shellfish copies the function of user's space to kernel spacing and by data from kernel spacing, so as to complete upper layer application arrange parameter The function of data length is obtained to network driver layer and from network driver layer.
Described above is only the preferred embodiment of the present invention, it should be understood that the present invention is not limited to described herein Form, the exclusion to other embodiment is not to be taken as, and can be used for various other combinations, modification and environment, and can be at this In the text contemplated scope, it is modified by the technology or knowledge of above-mentioned teaching or association area.And those skilled in the art are entered Capable change and change does not depart from the spirit and scope of the present invention, then all should be in the protection domain of appended claims of the present invention It is interior.

Claims (9)

1. the network speed-measuring method replied based on the quick ACK of ONU driving layers, it is characterised in that comprise the following steps:
S01:The Socket connections that TCP tests the speed are established in application layer;
S02:Setting is tested the speed purpose IP, destination interface, source IP, source port corresponding to Socket;
S03:Purpose IP, destination interface, source IP, the relevant information of source port are delivered to system kernel and start to test the speed;
S04:The server that tests the speed passes data to network driver layer, and network driver layer receives data and judged corresponding to the data IP and port whether be test the speed Socket settings IP and port;It is not that then data continue to forward;It is then to enter in next step;
S05:The data length that driving layer record receives;
S06:Algorithm to be replied according to ACK and directly replys ACK in driving layer, data no longer forward, and according to the length computation of data Go out network rate.
2. the network speed-measuring method according to claim 1 replied based on the quick ACK of ONU driving layers, it is characterised in that:Institute State comprising the concrete steps that for step S05:
S11:Driving layer persistently records the cumulative length of the measurement data length, i.e. data that receive;
S12:Application layer read the measurement data length of driving layer record every one second by api interfaces;
S13:With the data length when the previous second subtract previous second data length be data in the unit interval transfer rate.
3. the network speed-measuring method according to claim 2 replied based on the quick ACK of ONU driving layers, it is characterised in that:Institute State the byte number that the data length in step S05 refers to data, obtained in the step S13 be in the unit interval using byte as The speed of unit.
4. the network speed-measuring method according to claim 3 replied based on the quick ACK of ONU driving layers, it is characterised in that:Will Rate value divided by 1024 in units of byte can obtain downloading rate, and its unit is Kb/s.
5. the network speed-measuring method according to claim 1 replied based on the quick ACK of ONU driving layers, it is characterised in that:Institute State application layer and the time or read when data length is completed to control to test the speed according to testing the speed.
6. the network speed-measuring method replied based on the quick ACK of ONU driving layers according to any one of claim 1-5, its It is characterised by:The api interfaces that the application layer accesses network driver layer are realized using the shared drive function of Linux system 's.
7. the network speed-measuring method according to claim 6 replied based on the quick ACK of ONU driving layers, it is characterised in that:It is logical Cross encapsulation Linux system general purpose function copy_to_user and copy_from_user interface it is i.e. achievable by data from user Space copies kernel spacing to and copies data to user's space from kernel spacing, so as to complete upper layer application arrange parameter The function of data length is obtained to network driver layer and from network driver layer.
8. the network speed-measuring method according to claim 1 replied based on the quick ACK of ONU driving layers, it is characterised in that:Institute Stating in step S04 drives layer then to be matched according to purpose IP, destination interface, source IP, source port to all data received.
9. the network speed-measuring method according to claim 8 replied based on the quick ACK of ONU driving layers, it is characterised in that:When Match test purpose IP used, destination interface, source IP, source port and advance to the data length for, that is, recording receive in next step Spend and ACK is replied according to acknowledgement character response mechanism.
CN201710734381.XA 2017-08-24 2017-08-24 The network speed-measuring method replied based on the quick ACK of ONU driving layers Pending CN107707422A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710734381.XA CN107707422A (en) 2017-08-24 2017-08-24 The network speed-measuring method replied based on the quick ACK of ONU driving layers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710734381.XA CN107707422A (en) 2017-08-24 2017-08-24 The network speed-measuring method replied based on the quick ACK of ONU driving layers

Publications (1)

Publication Number Publication Date
CN107707422A true CN107707422A (en) 2018-02-16

Family

ID=61170305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710734381.XA Pending CN107707422A (en) 2017-08-24 2017-08-24 The network speed-measuring method replied based on the quick ACK of ONU driving layers

Country Status (1)

Country Link
CN (1) CN107707422A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385368A (en) * 2018-12-27 2020-07-07 创发信息科技(苏州)有限公司 Hardware-assisted speed measurement system
CN113676378A (en) * 2021-08-24 2021-11-19 芯河半导体科技(无锡)有限公司 Network bandwidth speed measurement application for simplifying Linux TCP protocol stack
CN116708247A (en) * 2022-09-24 2023-09-05 荣耀终端有限公司 Router speed measuring method and router
CN116708247B (en) * 2022-09-24 2024-05-17 荣耀终端有限公司 Router speed measuring method and router

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003105004A1 (en) * 2002-06-06 2003-12-18 Crescendo Networks Ltd. System and method for connecting multiple slow connections to multiple fast connections
CN101753456A (en) * 2009-12-25 2010-06-23 苏州大学 Method and system for detecting flow of peer-to-peer network
CN103763154A (en) * 2014-01-11 2014-04-30 浪潮电子信息产业股份有限公司 Network flow detection method
CN105827588A (en) * 2015-12-23 2016-08-03 广东亿迅科技有限公司 Network driver layer-based streaming media data distribution system
CN106878107A (en) * 2017-02-28 2017-06-20 无锡研勤信息科技有限公司 Based on the network bandwidth speed-measuring method that linux kernel drives

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003105004A1 (en) * 2002-06-06 2003-12-18 Crescendo Networks Ltd. System and method for connecting multiple slow connections to multiple fast connections
CN101753456A (en) * 2009-12-25 2010-06-23 苏州大学 Method and system for detecting flow of peer-to-peer network
CN103763154A (en) * 2014-01-11 2014-04-30 浪潮电子信息产业股份有限公司 Network flow detection method
CN105827588A (en) * 2015-12-23 2016-08-03 广东亿迅科技有限公司 Network driver layer-based streaming media data distribution system
CN106878107A (en) * 2017-02-28 2017-06-20 无锡研勤信息科技有限公司 Based on the network bandwidth speed-measuring method that linux kernel drives

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385368A (en) * 2018-12-27 2020-07-07 创发信息科技(苏州)有限公司 Hardware-assisted speed measurement system
CN111385368B (en) * 2018-12-27 2023-09-12 达发科技(苏州)有限公司 Hardware auxiliary speed measuring system
CN113676378A (en) * 2021-08-24 2021-11-19 芯河半导体科技(无锡)有限公司 Network bandwidth speed measurement application for simplifying Linux TCP protocol stack
CN116708247A (en) * 2022-09-24 2023-09-05 荣耀终端有限公司 Router speed measuring method and router
CN116708247B (en) * 2022-09-24 2024-05-17 荣耀终端有限公司 Router speed measuring method and router

Similar Documents

Publication Publication Date Title
US9749407B2 (en) Methods and devices for processing incomplete data packets
US9094230B1 (en) Network transfer protocol
US9742879B2 (en) Hardware-based packet editor
CN105939297B (en) A kind of TCP message recombination method and device
US20130198266A1 (en) Facilitating communication between web-enabled devices
US20030152036A1 (en) Apparatus and method of splitting a data stream over multiple transport control protocol/internet protocol (TCP/IP) connections
US10129722B2 (en) Service processing method and network device
US9197556B2 (en) Communications over multiple protocol interfaces in a computing environment
CN108881425B (en) Data packet processing method and system
WO2016015511A1 (en) Method, apparatus and computer storage medium for simulating data packet in network management test event
CN105389120A (en) Supporting RMA API over active message
CN104618365B (en) protocol message processing method, device and terminal
CN107707422A (en) The network speed-measuring method replied based on the quick ACK of ONU driving layers
US20040236802A1 (en) Method, apparatus, and program for informing a client when a server is busy in the transfer control protocol
WO2017000572A1 (en) Internet content adaptation protocol-based communication method, client and server
WO2016196486A1 (en) Systems and methods for improved trivial file transfer protocol
JP2015164295A (en) Information transmission system, information communication apparatus, information transmission apparatus, and program
CN105610639A (en) Total log grabbing method and device
CN111865884B (en) Message processing method, device and equipment
CN111200588B (en) Data transmission method based on protocol architecture of transmission layer and electronic equipment
WO2021255585A1 (en) Online application layer processing of network layer timestamps
EP3176986A1 (en) Method, device and system for remote desktop protocol gateway to conduct routing and switching
KR20120042745A (en) System and method for establishing reliable communication in a connection-less environment
US20070083922A1 (en) Network session re-construction
CN109150726A (en) A kind of message processing method and 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180216