CN109921962A - Bandwidth Measurement Method, device, computer readable storage medium and computer equipment - Google Patents

Bandwidth Measurement Method, device, computer readable storage medium and computer equipment Download PDF

Info

Publication number
CN109921962A
CN109921962A CN201910301810.3A CN201910301810A CN109921962A CN 109921962 A CN109921962 A CN 109921962A CN 201910301810 A CN201910301810 A CN 201910301810A CN 109921962 A CN109921962 A CN 109921962A
Authority
CN
China
Prior art keywords
link
network
internet protocol
protocol address
broadband rate
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
Application number
CN201910301810.3A
Other languages
Chinese (zh)
Other versions
CN109921962B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910301810.3A priority Critical patent/CN109921962B/en
Publication of CN109921962A publication Critical patent/CN109921962A/en
Application granted granted Critical
Publication of CN109921962B publication Critical patent/CN109921962B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

This application involves a kind of Bandwidth Measurement Method, device, computer readable storage medium and computer equipments, which comprises obtains Internet protocol address corresponding with object identity to be detected;User Datagram Protocol UDP message is sent to the corresponding user terminal of Internet protocol address with adjustable broadband rate, wherein, the corresponding UDP message of adjustable broadband rate is used to make the link between destination network device corresponding to object identity to be detected that network congestion occurs;When detect link from first network state change be the second network state when, it obtains link and is in corresponding maximum broadband rate when network available status, one of them in first network state and the second network state is network available status, another is network congestion condition;Corresponding maximum broadband rate processing obtains the link maximum available bandwidth between destination network device when being in network available status according to link.The accuracy of bandwidth measurement can be improved in scheme provided by the present application.

Description

Bandwidth Measurement Method, device, computer readable storage medium and computer equipment
Technical field
This application involves field of computer technology, more particularly to a kind of Bandwidth Measurement Method, device, computer-readable deposit Storage media and computer equipment.
Background technique
The available bandwidth of server-side to operator can be by computer room first line of a couplet load balancing, first line of a couplet operator speed limit, intermediate path Usually there is the construction bandwidth of operator's link and the inconsistent situation of true available bandwidth in the influence of the factors such as bandwidth short slab. So, the available bandwidth needs of server-side to operator are re-measured.Traditional Bandwidth Measurement Method is that operator needs thing The network equipment of maximum bandwidth is first disposed, server-side sends message to the network equipment of operator, and the network equipment receives message, Back message is returned to server, server-side calculates maximum available bandwidth further according to received information.However, conventional method is deposited In the problem of bandwidth measurement inaccuracy.
Summary of the invention
Based on this, it is necessary to which for conventional method, there are the technical problems of bandwidth measurement inaccuracy, provide a kind of bandwidth survey Measure method, apparatus, computer readable storage medium and computer equipment.
A kind of Bandwidth Measurement Method, comprising: obtain Internet protocol address corresponding with object identity to be detected;With adjustable The broadband rate of section sends User Datagram Protocol UDP message to the corresponding user terminal of Internet protocol address, wherein adjustable The corresponding UDP message of the broadband rate of section is used to make the link between destination network device corresponding to object identity to be detected Network congestion occurs;When detect link from first network state change be the second network state when, obtain link be in network Corresponding maximum broadband rate when available mode, one of them in first network state and the second network state are available for network State, another is network congestion condition;Corresponding maximum broadband rate processing obtains when being in network available status according to link To the link maximum available bandwidth between destination network device.
A kind of bandwidth measuring apparatus, comprising: module is obtained, for obtaining internet protocol corresponding with object identity to be detected Discuss address;Sending module, for sending user to the corresponding user terminal of Internet protocol address with adjustable broadband rate Datagram protocol UDP message, wherein the corresponding UDP message of adjustable broadband rate is for making and object identity institute to be detected Network congestion occurs for the link between corresponding destination network device;Detection module detects link from first network for working as State change is the second network state, obtains link and is in corresponding maximum broadband rate, first network state when available mode It is network available status with one of them in the second network state, another is network congestion condition;Processing module is used for root Corresponding maximum broadband rate processing obtains the link between destination network device most when being in network available status according to link Available bandwidth.
A kind of computer readable storage medium is stored with computer program, when the computer program is executed by processor, So that the processor executes following steps: obtaining Internet protocol address corresponding with object identity to be detected;With adjustable Broadband rate send User Datagram Protocol UDP message to the corresponding user terminal of Internet protocol address, wherein it is adjustable The corresponding UDP message of broadband rate for sending out the link between destination network device corresponding to object identity to be detected Raw network congestion;When detect link from first network state change be the second network state when, obtain link be in network can Corresponding maximum broadband rate when with state, one of them in first network state and the second network state can use shape for network State, another is network congestion condition;Corresponding maximum broadband rate processing obtains when being in network available status according to link Link maximum available bandwidth between destination network device.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the calculating When machine program is executed by the processor, so that the processor executes following steps: obtaining corresponding with object identity to be detected Internet protocol address;User data is sent to the corresponding user terminal of Internet protocol address with adjustable broadband rate Datagram protocol UDP message, wherein the corresponding UDP message of adjustable broadband rate for make with corresponding to object identity to be detected Destination network device between link occur network congestion;When detect link from first network state change be the second network When state, obtains link and be in corresponding maximum broadband rate when network available status, first network state and second network-like One of them in state is network available status, another is network congestion condition;When being in network available status according to link Corresponding maximum broadband rate processing obtains the link maximum available bandwidth between destination network device.
Above-mentioned Bandwidth Measurement Method, device, computer readable storage medium and computer equipment obtain and object to be detected Corresponding Internet protocol address is identified, UDP is sent to the corresponding terminal of Internet protocol address with adjustable broadband rate Message has the characteristics that resource consumption is small, processing speed is fast, therefore be not required to since UDP message is one kind towards connectionless protocol Prior deploying network devices are wanted, user terminal is not needed and online state is kept to interact, also do not need all user terminals All receive UDP message, it is at low cost, operability is high and versatility is good;When detecting that link is from first network state change When the second network state, corresponding maximum broadband rate, processing obtain maximum available bandwidth when obtaining in available mode, can User terminal uses the process of flow in simulating actual conditions, makes to measure scene close to the scene of actual use, improves bandwidth The accuracy of measurement.
Detailed description of the invention
Fig. 1 is the applied environment figure of Bandwidth Measurement Method in one embodiment;
Fig. 2 is the flow diagram of Bandwidth Measurement Method in one embodiment;
Fig. 3 is the flow diagram that the packet loss of link is obtained in one embodiment;
Fig. 4 is the flow diagram that the packet loss of link is obtained in another embodiment;
Fig. 5 is the flow diagram of Bandwidth Measurement Method in another embodiment;
Fig. 6 is the process signal for sending UDP message in one embodiment to the corresponding user terminal of Internet protocol address Figure;
Fig. 7 is to obtain the flow diagram of the corresponding Internet protocol address of object identity to be detected in one embodiment;
Fig. 8 is the structural block diagram of bandwidth measuring apparatus in one embodiment;
Fig. 9 is the structural block diagram of bandwidth measuring apparatus in another embodiment;
Figure 10 is the structural block diagram of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, and It is not used in restriction the application.
Fig. 1 is the applied environment figure of Bandwidth Measurement Method in one embodiment.The Bandwidth Measurement Method is surveyed applied to bandwidth Amount system.The bandwidth measurement system includes computer equipment 110, destination network device 120 and user terminal 130.Computer is set Standby 110, destination network device 120 and user terminal 130 pass through network connection.Network specifically can be computer equipment 110 can To be realized with the independent server either server cluster that forms of multiple servers.Computer equipment 110 for example can be with It is CDN (Content Delivery Network, content distributing network) server, is also possible to other servers, it can be with It is terminal.Destination network device 120 can be the corresponding network equipment of object identity to be detected, such as object identity pair to be detected Interchanger, server, routing device, gateway or unlimited access point for answering etc..User terminal 130 specifically can be terminal console or Mobile terminal, mobile terminal specifically can be at least one of mobile phone, tablet computer, laptops etc..Wherein, computer is set Standby 110, the quantity of destination network device 120 and user terminal 130 is unlimited.Bandwidth measurement program can be applied to computer equipment 110。
As shown in Fig. 2, in one embodiment, providing a kind of Bandwidth Measurement Method.The present embodiment is mainly in this way It is illustrated applied to the computer equipment 110 in above-mentioned Fig. 1.Referring to Fig. 2, which specifically includes following step It is rapid:
Step 202, Internet protocol address corresponding with object identity to be detected is obtained.
Wherein, object to be detected specifically can be operator or enterprise etc..Operator such as movement, connection, telecommunications or Broadcasting and TV etc..Object to be detected specifically can also distinguish between nationality, such as distinguish China, the U.S. or Europe etc..Object mark to be detected Knowledge is the unique identification for distinguishing object to be detected.Object identity to be detected specifically can be by text, number or symbol At least one composition.Internet protocol address refers to IP address (Internet Protocol Address), in network One computer of middle label.The quantity of Internet protocol address is unlimited, is specifically as follows the Internet protocol address of arbitrarily large number.
Specifically, when bandwidth measurement program receives bandwidth measurement instruction, business access day for being stored from server In will, or from Internet protocol address database with obtaining a large amount of Internet protocol corresponding with object identity to be detected Location.For example, bandwidth measurement program obtains a large amount of Internet protocol address corresponding with mobile operator.
Step 204, user data is sent to the corresponding user terminal of Internet protocol address with adjustable broadband rate Datagram protocol UDP message, wherein the corresponding UDP message of adjustable broadband rate for make with corresponding to object identity to be detected Destination network device between link occur network congestion.
Wherein, adjustable broadband rate refers to broadband rate-compatible, such as broadband rate can be default in server Broadband rate 5GB/s (Gigabyte per second, hundred billion bytes-per-seconds), 6GB/s etc. it is without being limited thereto.Broadband rate tool Body can also be according to network congestion adjusting.Broadband rate specifically can be with the value of broadband rate, can also be with rank Mode is presented.Such as level-one broadband rate corresponds to 5GB/s, it is without being limited thereto that two-stage wideband rate corresponds to 6GB/s etc..In UDP message It may include header and arbitrary message data.After UDP message is sent, the corresponding server of bandwidth measurement program can not be obtained Know the whether safe and complete arrival of UDP message.The size of message data can according between destination network device and user bandwidth or The setting of person broadband rate.Network congestion is a kind of network state of overload.When network congestion user terminal to Internet resources for example The demand of link bandwidth has been more than intrinsic bandwidth capacity.
Specifically, bandwidth measurement program user terminal corresponding with destination network device and Internet protocol address is established Network connection.When bandwidth measurement program is located in a server, bandwidth measurement program passes through target with the first broadband rate The network equipment serially sends UDP message to the corresponding user terminal of Internet protocol address.Bandwidth measurement program can also be with Two broadband rates, third broadband rate etc. are without being limited thereto serially to send UDP to the corresponding user terminal of Internet protocol address Message.Wherein, each broadband rate is corresponding sends UDP message at least once.The corresponding UDP message of adjustable broadband rate Network congestion occurs for the link that can be used for making between server destination network device corresponding with object identity to be detected.It is adjustable The corresponding UDP message of broadband rate can also be used to make between server destination network device corresponding with object identity to be detected Link present network available status.
In the present embodiment, the regulative mode of broadband rate, comprising: the transmission frequency by controlling UDP message adjusts broadband Rate.Specifically, bandwidth measurement program passes through the transmission frequency for increasing UDP message, to increase broadband rate.Alternatively, bandwidth Process of measurement passes through the transmission frequency for reducing UDP message, to reduce broadband rate.Such as bandwidth measurement program can control The transmission frequency of UDP message sends 1,000 times, i.e. 0.001GB/ms to the corresponding user terminal of Internet protocol address to be per second, So broadband rate is 1GB/s.Bandwidth measurement program can increase UDP message transmission frequency be it is per second to Internet protocol The corresponding terminal in location sends 2,000 times, i.e. 0.002GB/s, then broadband rate is 2GB/s.
In the present embodiment, the regulative mode of broadband rate, comprising: pass through the big ditty of message data in control UDP message Pitch width tape speed.Specifically, bandwidth measurement program increases broadband speed by increasing the message data size in UDP message Rate.Or bandwidth measurement program reduces broadband rate by reducing the message data size in UDP message.For example, bandwidth Process of measurement can be by the 4M that is dimensioned to of UDP message, then the UDP message that 256 sizes are 4M is sent in 1 second to expire Foot breadth tape speed is 1GB/s.Bandwidth measurement program can set UDP message size to 8M, then send in 1 second 256 big It is 2GB/s that the small UDP message for being 8M, which can meet broadband rate,.
In the present embodiment, when each server in multiple servers runs bandwidth measurement program, multiple service Bandwidth measurement program parallelization in device sends UDP message to the corresponding terminal of Internet protocol address.
Step 206, when detect link from first network state change be the second network state when, obtain link be in can Corresponding maximum broadband rate when with state, one of them in first network state and the second network state can use shape for network State, another is network congestion condition.
Specifically, when by packet drop or delay situation detect the link between server and destination network device From network available status variation be network congestion condition when, bandwidth measurement program obtain link be in when available mode it is corresponding most Big broadband rate.Alternatively, when detecting the chain between server and destination network device by packet drop or delay situation Road from network congestion condition variation be network available status when, bandwidth measurement program obtain link be in corresponding when available mode Maximum broadband rate.Wherein, packet drop refers to corresponding packet loss when the total number of packet loss or transmission data packet is identical Number etc..Such as 1000 data packets of fixed transmission, the data packet for receiving return is 900, then packet loss number is 100, packet loss Rate is 10%, then bandwidth measurement program can obtain packet drop by received data packet number or packet loss.
Step 208, corresponding maximum broadband rate processing obtains and target network when being in network available status according to link Link maximum available bandwidth between network equipment.
Wherein, maximum available bandwidth refers to that the unit time can be by the maximum amount of data of link.
Specifically, link can be used in network according to the conversion relation between tape speed and bandwidth for bandwidth measurement program Corresponding maximum broadband rate processing obtains and the link maximum available bandwidth before destination network device when state.For example, wide Tape speed is that the corresponding bandwidth of 256KB/s is 2M/s.
Above-mentioned Bandwidth Measurement Method obtains Internet protocol address corresponding with object identity to be detected, with adjustable Broadband rate sends UDP message to the corresponding terminal of Internet protocol address, since UDP message is one kind towards connectionless association View, has the characteristics that resource consumption is small, processing speed is fast, therefore do not need prior deploying network devices, does not need user terminal It keeps online state to interact, does not also need all user terminals and all receive UDP message, it is at low cost, operability is high And versatility is good;When detect link from first network state change be the second network state when, when obtaining in available mode Corresponding maximum broadband rate, processing obtain maximum available bandwidth, can use flow by user terminal in simulating actual conditions Process makes to measure scene close to the scene of actual use, improves the accuracy of bandwidth measurement.
In one embodiment, when each server in multiple servers runs bandwidth measurement program, and one to When the corresponding destination network device of test object mark is multiple, bandwidth measurement program is by each server to each target network The link maximum available bandwidth that device measuring obtains is added to obtain the link between Servers-all and all destination network devices Maximum available bandwidth.Above-mentioned Bandwidth Measurement Method, the link that can apply between server and destination network device are a plurality of Situation, operability is high and calculates simple.
In one embodiment, the detection mode of congestion state, comprising: obtain the packet loss of link;When the packet loss of link When rate is greater than packet loss threshold value, it is determined that link is in network congestion condition.
Wherein, packet loss refers to that lost data packet number accounts for the ratio of transmitted data packet.The data packet specifically can be with It is ICMP (Internet Control Message Protocol, Internet Control Message agreement) packet or TCP (Transmission Control Protocol, transmission control protocol) packet etc..The specific manifestation of packet loss can be percentage Than, decimal or score etc..Packet loss threshold value can refer to the upper limit value of packet loss.
Specifically, bandwidth measurement program can obtain the packet loss of link by ping order.Ping order refers to An order under Windows, Unix or linux system.Ping also belongs to communication protocol, utilizes " ping " order that can examine Look into whether network is connected to.When the packet loss for detecting link is greater than packet loss threshold value, then bandwidth measurement program determines at link In network congestion condition.Such as packet loss threshold value is 5%, then when the packet loss of link is greater than 5%, bandwidth measurement program is determined Link is in network congestion condition.
In the present embodiment, when the packet loss of link is less than or equal to packet loss threshold value, it is determined that link is in network can Use state.Such as packet loss threshold value is 5%, then when the packet loss of link is less than or equal to 5%, bandwidth measurement program determines chain Road is in network available status.
Above-mentioned Bandwidth Measurement Method obtains the packet loss of link, when the packet loss of link is greater than packet loss threshold value, determines Link is in congestion state, can check whether network is in congestion state, can also be kept away to a certain extent by packet loss threshold value Exempt from the packet loss error generated due in addition to network congestion, improves the accuracy of bandwidth measurement.
In one embodiment, as shown in figure 3, obtaining the packet loss of link, comprising:
Step 302, at least one destination network device into destination network device sends Internet Control Message agreement Icmp packet.
Wherein, an object identity to be detected can correspond to multiple destination network devices.Icmp packet is mainly used in user Transmitting control information between terminal and the network equipment, including packet loss etc..It include that destination network device is corresponding in icmp packet IP address and icmp header.The quantity of icmp packet is unlimited.
Specifically, bandwidth measurement program obtains the corresponding IP address of destination network device.When bandwidth measurement program is with adjustable While the broadband rate of section sends UDP message to the corresponding user terminal of Internet protocol address, also by Ping order with And IP address sends the icmp packet of preset quantity at least one destination network device.
Step 304, the icmp echo message that destination network device returns is received.
Specifically, it after which receives the icmp packet that bandwidth measurement program is sent, is set to target network It is standby to return to icmp echo message.Bandwidth measurement program receives the icmp echo message that destination network device returns.
Step 306, according to the quantity of the icmp packet of transmission and the determination of the quantity of the icmp echo message of return and target The packet loss of link between the network equipment.
Specifically, bandwidth measurement program obtains the quantity of the icmp packet sent.Bandwidth measurement program counts target network The quantity for the icmp echo message that equipment returns.Bandwidth measurement program is according to the quantity of the icmp packet of transmission and the ICMP of return The quantity of message determines the packet loss of the link between server and destination network device.Calculation method is specifically as follows packet loss Quantity × 100% of=(quantity of quantity-return icmp packet of the icmp packet of transmission)/transmission icmp packet.
Above-mentioned Bandwidth Measurement Method, at least one destination network device into destination network device send icmp packet, The icmp echo message that destination network device returns is received, packet loss is determined according to the quantity of the message of transmission and back message, As soon as minimum only need to send an icmp packet to destination network device, network state can be detected, strong operability and at low cost.
In one embodiment, as shown in figure 4, obtaining the packet loss of link, comprising:
Step 402, from the corresponding user terminal of Internet protocol address, icmp packet can be responded by choosing at least one User terminal as target terminal user.
Wherein, the user terminal that can respond icmp packet also refers to respond the user terminal of ping order.
Specifically, before obtaining corresponding with object identity to be detected Internet protocol address, or obtain and to After test object identifies corresponding Internet protocol address, bandwidth measurement program can be instructed by Ping to object mark to be detected Know the corresponding user terminal of corresponding IP address and sends icmp packet.The user terminal receives icmp packet, and surveys to bandwidth Range sequence returns to icmp echo message.So bandwidth measurement program determines that the IP address is the IP address of survival (alive).When this When the corresponding user terminal of IP address returns to icmp echo message without normal direction server, then bandwidth measurement program determines the IP address It is not the IP address of survival, therefore bandwidth measurement program will not be to the IP that can not return to icmp echo message when detecting network state The corresponding user terminal in address sends icmp packet.
Bandwidth measurement program receives the icmp echo message, then the user of icmp packet can be responded by choosing at least one Terminal is as target terminal user.
Step 404, icmp packet is sent to target terminal user.
Specifically, when bandwidth measurement program with adjustable broadband rate to the corresponding user terminal of Internet protocol address While sending UDP message, icmp packet is sent at least one target terminal user also by destination network device.
Step 406, the icmp echo message that target terminal user returns is received.
Specifically, after the icmp packet that target terminal user reception bandwidth process of measurement is sent, to bandwidth measurement program institute Server return icmp echo message.Bandwidth measurement program receives the icmp echo message that target terminal user returns.
Step 408, according to the quantity of the icmp packet of transmission and the determination of the quantity of the icmp echo message of return and target The packet loss of link between the network equipment.
Specifically, bandwidth measurement program obtains the quantity of the icmp packet sent.Bandwidth measurement program counts target user The quantity for the icmp echo message that terminal returns.Bandwidth measurement program is according to the quantity of the icmp packet of transmission and the ICMP of return The quantity of message determines the packet loss of the link between server and destination network device.Calculation method is specifically as follows packet loss Quantity × 100% of=(quantity of quantity-return icmp packet of the icmp packet of transmission)/transmission icmp packet.
Above-mentioned Bandwidth Measurement Method, from the corresponding user terminal of Internet protocol address, choosing at least one can be returned It answers the user terminal of icmp packet as target terminal user, can guarantee that the target terminal is in survival (alive) state, then It at least only needs to send icmp packet to an online user terminal, receives the icmp echo report that target terminal user returns Text, it is determining between destination network device according to the quantity of the icmp packet of transmission and the quantity of the icmp echo message of return The packet loss of link, moreover it is possible to which the packet loss of the link between determining and user terminal can detect network state, strong operability And it is at low cost.
In one embodiment, the packet loss of link is obtained, comprising: receive the icmp packet that user terminal is sent;Xiang Yong Family terminal sends icmp echo message;Receive the value for the packet loss that user terminal returns, wherein the value of packet loss is user terminal It is determined according to the quantity of the icmp packet of transmission and the quantity of icmp echo message.
Specifically, user terminal sends icmp packet by the server where Ping order to bandwidth measurement program.Band Wide process of measurement receives the icmp packet that user terminal is sent.Bandwidth measurement program returns to icmp echo message to user terminal. User terminal obtains the value of packet loss according to the quantity of the icmp packet of transmission and the quantity of received icmp echo message.User Server where from terminal to bandwidth measurement program sends the value of packet loss.Bandwidth measurement program receives losing for user terminal return The value of packet rate.
Above-mentioned Bandwidth Measurement Method, the icmp packet sent by receiving user terminal return to ICMP to user terminal and return Message is answered, the value of the packet loss of transmission is received, can not only determine the packet loss of the link between destination network device, moreover it is possible to The determining packet loss the link between user terminal, can detect network state, strong operability and at low cost.
In one embodiment, the detection mode of network state, comprising: obtain the delay time of link;When prolonging for link When the slow time is greater than delay time threshold value, determine that the link is in network congestion condition;When the delay time of link is less than or waits When delay time threshold value, determine that the link is in network available status.
Specifically, such as delay time threshold value is that 100ms determines that link is in net then when delay time being greater than 100ms Network congestion state;When delay time is 0~100ms, determine that link is in network available status.
Above-mentioned Bandwidth Measurement Method, by obtaining the delay time of link, when delay time being greater than delay time threshold value, It determines and is in network congestion condition, when delay time being less than delay time threshold value, determine and be in network available status, it can basis Delay time is detected to obtain network state, to obtain link bandwidth.
In one embodiment, the detection mode of congestion state, comprising: obtain packet loss and the delay time of link;When The packet loss of link determines that the link is in network congestion greater than packet loss threshold value and when delay time is greater than delay time threshold value State.Above-mentioned Bandwidth Measurement Method can more accurately judge the congestion shape of network by detecting packet loss and delay time simultaneously State improves the accuracy of bandwidth measurement.
In one embodiment, the delay time of link is obtained, comprising: at least one target into destination network device The network equipment sends icmp packet at least one target terminal user that can respond icmp packet, and obtains corresponding Sending time;When receiving the icmp echo message of destination network device or target terminal user return, acquisition is received The receiving time of icmp echo message;The delay time of link is obtained according to sending time and receiving time.
Wherein, sending time and receiving time specifically can be as accurate as millisecond or even microsecond.
Specifically, bandwidth measurement program obtains at least one network equipment into destination network device and sends icmp packet Sending time.When receiving the icmp echo message of destination network device return, acquisition receives icmp echo message Receiving time.Then bandwidth measurement program obtains the delay time of link according to sending time and receiving time.Alternatively, bandwidth is surveyed Range sequence obtains the sending time that icmp packet is sent at least one target terminal user that can respond icmp packet.When connecing When receiving the icmp echo message of target terminal user return, the receiving time for receiving icmp echo message is obtained.Then band Wide process of measurement obtains the delay time of link according to sending time and receiving time.
Above-mentioned Bandwidth Measurement Method obtains the delay time of link, is avoided that by obtaining sending time and receiving time Icmp packet data volume is bigger than normal caused by timestamp is added in icmp packet, and icmp packet data volume can be made small, be not easy to increase Add network congestion, improves the accuracy of bandwidth measurement.
In one embodiment, it is sent and is used to the corresponding user terminal of Internet protocol address with adjustable broadband rate User data datagram protocol UDP message, comprising: sent out with the broadband rate being sequentially increased to the corresponding user terminal of Internet protocol address Send User Datagram Protocol UDP message;First network state is network available status;Second network state is network congestion shape State.
Specifically, bandwidth measurement program is with the broadband rate that is sequentially increased to the corresponding user terminal of Internet protocol address Send UDP message.Such as bandwidth measurement program is with 1GB/s, 2GB/s, 3GB/s ... waits broadband rate without being limited thereto to internet The corresponding user terminal of protocol address sends UDP message.When detecting the link between server and destination network device from net When the variation of network available mode is network congestion condition, obtains last time and is in corresponding broadband rate when network available status, It obtains link and is in corresponding maximum broadband rate when network available status.
Above-mentioned Bandwidth Measurement Method is sent out with the broadband rate being sequentially increased to the corresponding user terminal of Internet protocol address UDP message is sent, UDP message can be sent in sequence, and rate is adjustable, can obtain accurate broadband rate, mention The accuracy of high bandwidth measurement.
In one embodiment, as shown in figure 5, being the flow diagram of Bandwidth Measurement Method in another embodiment, packet It includes:
Step 502, IP address list corresponding with object identity to be detected is obtained.
Specifically, IP address can be stored with list mode.
Step 504, UDP report is sent with the corresponding any user terminal of IP address of the broadband rate S into IP address list Text.
Wherein, initial broadband rate S specifically can be prediction broadband rate value.
Step 506, the link between detection service device and destination network device whether packet loss.
Specifically, whether server can be occurred by the link between congestion information detection service device and destination network device Packet loss.At least one of congestion information such as packet loss, delay time.
Step 508, when packet loss does not occur for the link between server and destination network device, increase broadband rate S.
Specifically, after increasing broadband rate S, obtaining broadband rate is S+1, then server is with the broadband rate of S+1 The corresponding any user terminal of IP address into IP address list sends UDP message.
Step 510, maximum available bandwidth is obtained according to the broadband rate processing of non-packet loss for the last time.
Specifically, such as when broadband rate is S+5, bandwidth measurement Programmable detection to the chain between destination network device Packet loss occurs for road, then obtains the broadband rate S+4 of the non-packet loss of last time, link is calculated most according to broadband rate S+4 Available bandwidth.
In the present embodiment, judge whether the principle for reaching maximum available bandwidth by congestion information: when chain road datagram Literary transmission rate is less than network link maximum available bandwidth, then congestion will not occur for the message transmitted, the delay of message it is steady and Without packet loss;If the transmission rate at certain end is greater than network link maximum available bandwidth, link can occur congestion, transmit report on link Literary delay time increases, packet loss rises, thus can with by message delay time and the congestion informations such as packet loss judge Whether link current bandwidth reaches maximum available bandwidth.
Above-mentioned Bandwidth Measurement Method, by obtaining the corresponding IP address list of object identity to be detected, with adjustable width The corresponding any user terminal of IP address of the tape speed S into IP address list sends UDP message, and detects whether link is lost Packet increases broadband rate and sends UDP message again when packet loss does not occur, obtains the broadband rate of the non-packet loss of last time, and Processing obtains maximum available bandwidth, does not need prior deploying network devices, does not need user terminal and online state is kept to carry out Interaction does not need all user terminals yet and all receives UDP message, at low cost, operability is high and versatility is good, can simulate User terminal uses the process of flow in actual conditions, makes to measure scene close to the scene of actual use, improves bandwidth measurement Accuracy.
In one embodiment, it is sent and is used to the corresponding user terminal of Internet protocol address with adjustable broadband rate User data datagram protocol UDP message, comprising: sent out with the broadband rate successively successively decreased to the corresponding user terminal of Internet protocol address Send User Datagram Protocol UDP message;First network state is network congestion condition;Second network state is that network can use shape State.
Specifically, bandwidth measurement program is with the broadband rate that is sequentially reduced to the corresponding user terminal of Internet protocol address Send UDP message.Such as bandwidth measurement program is with 20GB/s, 19GB/s, 18GB/s ... waits broadband rate without being limited thereto to mutual The corresponding user terminal in networking protocol address sends UDP message.When detecting the link between server and destination network device When from network congestion condition variation being network available status, corresponding broadband speed when being in network available status for the first time is obtained Rate, i.e. acquisition link are in corresponding maximum broadband rate when network available status.
Above-mentioned Bandwidth Measurement Method is sent out with the broadband rate successively successively decreased to the corresponding user terminal of Internet protocol address UDP message is sent, UDP message can be sent in sequence, and rate is adjustable, can obtain accurate broadband rate, mention The accuracy of high bandwidth measurement.
In one embodiment, as shown in fig. 6, with adjustable broadband rate to the corresponding user of Internet protocol address Terminal sends UDP message, comprising:
Step 602, random number mark is generated.
Specifically, before obtaining Internet protocol address corresponding with object identity to be detected, bandwidth measurement program will The corresponding Internet protocol address full dose of object identity to be detected imports in memory array, and stores.Corresponding one of every number is mutually Networking protocol address.Bandwidth measurement program generates random number mark at random.
Step 604, it obtains random number and identifies corresponding Internet protocol address.
Specifically, bandwidth measurement program obtains Internet protocol address corresponding with random number mark.For example, random number 5 are identified as, corresponding IP address is 123.123.1.1, then the IP address that bandwidth measurement program obtains is 123.123.1.1.
Step 606, the corresponding user of corresponding Internet protocol address is identified to random number with adjustable broadband rate Terminal sends UDP message.
Specifically, bandwidth measurement program is identified corresponding with broadband that is incremented by successively or successively successively decreasing rate to random number The corresponding user terminal of IP address serially sends UDP message.Such as the corresponding server of bandwidth measurement program generates at random Number mark, for example, generate it is 10,8,11,19,5 ... etc. without being limited thereto, when broadband rate is 5GB/s, bandwidth measurement program with The broadband multirate serial of 5GB/s is to 10, the corresponding user terminal of 8,11,19,5 corresponding IP address sends UDP message.
In the present embodiment, when there is bandwidth measurement program in multiple servers, the corresponding IP of the object identity to be detected Address can be the shared IP address of multiple servers.So multiple bandwidth measurement program generates random number mark, obtains Random number identifies corresponding IP address, sends UDP message to the corresponding user terminal of the corresponding IP address of random number mark, thus UDP message can be sent to the same IP address to avoid multiple machines same time.
In the present embodiment, Internet protocol address corresponding with object identity to be detected is obtained, comprising: generate random number mark Know, obtains the corresponding random number of object identity to be detected and identify corresponding Internet protocol address;With adjustable broadband rate UDP message is sent to the corresponding user terminal of Internet protocol address, comprising: is identified with adjustable broadband rate to random number The corresponding user terminal of corresponding IP address sends UDP message.
Above-mentioned Bandwidth Measurement Method generates random number mark, obtains random number and identifies corresponding Internet protocol address, with Adjustable broadband rate sends UDP message, Neng Gouli to the corresponding terminal of the corresponding Internet protocol address of random number mark With the randomness of random number come balanced transmission UDP message, avoid the multiple equipment same time to same Internet protocol address pair The user terminal answered sends UDP message, improves the accuracy that UDP message is sent.
In one embodiment, the Bandwidth Measurement Method further include: when broadband rate is greater than default broadband rate, according to The corresponding first transmission duration of broadband rate and the corresponding second transmission duration of default broadband rate obtain sleep time;When obtaining Start suspend mode after sleep time, when timing reaches sleep time, re-executes with adjustable broadband rate to Internet protocol The step of corresponding user terminal in address sends UDP message.
Wherein, in sleep time, bandwidth measurement program does not send UDP to the corresponding user terminal of Internet protocol address Message.Default broadband rate can be the default broadband rate value of any one stored in server.Broadband rate corresponding One transmission duration refers to the duration spent according to the timing of broadband rate or a certain number of UDP packets of transmission.Default broadband rate Corresponding second transmission duration, which refers to, sends the duration that a certain number of UDP packets are spent according to default broadband rate.
Specifically, such as the byte number of UDP packet is K1, and broadband rate is S1, corresponding first a length of T1=K1/ when sending S1.Default broadband rate is S2, corresponding second a length of T2 when sending.When broadband rate is greater than default broadband rate, bandwidth Process of measurement is obtained according to the corresponding first transmission duration T1 of broadband rate and the corresponding second transmission duration T2 of default broadband rate To sleep time | T1-T2 |.Start suspend mode and timing after bandwidth measurement program obtains sleep time, when timing reaches suspend mode When long, the step of UDP message is sent to the corresponding user terminal of IP address with adjustable broadband rate is executed.
Above-mentioned Bandwidth Measurement Method, when broadband rate is greater than default broadband rate, according to broadband rate corresponding first It sends duration and the corresponding second transmission duration of default broadband rate obtains sleep time, start to stop after obtaining sleep time It sleeps, when timing reaches sleep time, re-executes whole to the corresponding user of Internet protocol address with adjustable broadband rate End sends the step of UDP message, can control broadband rate, improves the accuracy of bandwidth measurement.
In one embodiment, as shown in fig. 7, before obtaining the corresponding Internet protocol address of destination network device, The Bandwidth Measurement Method further include:
Step 702, business access log is obtained.
Wherein, business access log refers to the log information generated when user terminal access server.Business access log In include Internet protocol address and corresponding object identity to be detected.
Specifically, bandwidth measurement program obtains business access log from server.
Step 704, Internet protocol address is obtained from business access log.
Specifically, bandwidth measurement program obtains IP address from business access log.Wherein the quantity of IP address is unlimited, example It such as can be a large amount of IP address.
Step 706, object identity to be detected corresponding to Internet protocol address is obtained.
Specifically, bandwidth measurement program obtains object identity to be detected corresponding to each Internet protocol address.Such as The corresponding object identity to be detected of IP address A is China Mobile, and the corresponding object identity to be detected of B is China Unicom, and C is corresponding Object identity to be detected is China Telecom, and the corresponding object identity to be detected of D is that China Mobile ... etc. is without being limited thereto.
Step 708, Internet protocol address is classified according to object identity to be detected, it is corresponding obtains object identity to be detected Internet protocol address.
Specifically, bandwidth measurement program classifies IP address according to object identity to be detected, with object identity phase to be detected Same IP address is one kind, then obtains the corresponding Internet protocol address of object identity to be detected.Such as IP address A and IP address D belongs to China Mobile, then is classified as one kind.Object identity to be detected is in the corresponding IP address of China Mobile comprising A, D, F ... Etc. it is without being limited thereto.
In the present embodiment, bandwidth measurement program will be in the corresponding Internet protocol address full dose importing of object identity to be detected It deposits in array.Such as object identity to be detected is that the corresponding IP address full dose of China Mobile imports memory number by bandwidth measurement program In group A.Object identity to be detected will be that the corresponding IP address full dose of China Unicom imports memory array B by bandwidth measurement program In.Object identity to be detected is that the corresponding IP address full dose of China Telecom imports in memory array C by bandwidth measurement program.
Above-mentioned Bandwidth Measurement Method obtains Internet protocol address from business access log, with obtaining Internet protocol Internet protocol address is classified according to object identity to be detected, obtains object to be detected by the corresponding object identity to be detected in location Corresponding Internet protocol address is identified, can be classified on demand, sends UDP packet to the corresponding user terminal of the IP address, thus The bandwidth of link is obtained, the accuracy of bandwidth measurement is improved.
In one embodiment, Internet protocol address corresponding with object identity to be detected is obtained, comprising: from internet Internet protocol address corresponding with object identity to be detected is obtained in protocol address database.
Specifically, Internet protocol address database includes Internet protocol address and corresponding object mark to be detected Know.It can also include the corresponding nationality of Internet protocol address in Internet protocol address database.Bandwidth measurement program is from IP Internet protocol address corresponding with object identity to be detected is obtained in database.Bandwidth measurement program can also be from IP database It is middle to obtain nationality corresponding with Internet protocol address.
Above-mentioned Bandwidth Measurement Method obtains corresponding with object identity to be detected mutual from Internet protocol address database Networking protocol address can obtain a large amount of Internet protocol address and send UDP message, improve the accuracy of bandwidth measurement.
In one embodiment, a kind of Bandwidth Measurement Method, comprising:
Step (a1) obtains business access log.
Step (a2), obtains Internet protocol address from business access log.
Step (a3) obtains object identity to be detected corresponding to Internet protocol address.
Internet protocol address is classified according to object identity to be detected, obtains object identity pair to be detected by step (a4) The Internet protocol address answered.
Step (a5) obtains Internet protocol address corresponding with object identity to be detected.
Step (a6) generates random number mark.
Step (a7) obtains random number and identifies corresponding Internet protocol address.
Step (a8) identifies the corresponding user of corresponding Internet protocol address to random number with adjustable broadband rate Terminal sends User Datagram Protocol UDP message, wherein the corresponding UDP message of adjustable broadband rate for make with it is to be checked Network congestion occurs for the link surveyed between destination network device corresponding to object identity.
Step (a9) sends duration according to broadband rate corresponding first when broadband rate is greater than default broadband rate The second transmission duration corresponding with default broadband rate obtains sleep time.
Step (a10), starts suspend mode after obtaining sleep time, when timing reaches sleep time, re-executes with successively The broadband rate of increase identifies the step that the corresponding user terminal of corresponding Internet protocol address sends UDP message to random number Suddenly.
Step (a11), at least one destination network device into destination network device send Internet Control Message association Discuss icmp packet.
Step (a12) receives the icmp echo message that destination network device returns.
Step (a13), according to the quantity of the icmp packet of transmission and the determination of the quantity of the icmp echo message of return and mesh Mark the packet loss of the link between the network equipment.
Step (a14), when the packet loss of link is greater than packet loss threshold value, it is determined that link is in network congestion condition.
Step (a15) obtains link and is in corresponding maximum broadband rate when network available status.
Step (a16), corresponding maximum broadband rate processing obtains and target when being in network available status according to link Link maximum available bandwidth between the network equipment.
Although above-mentioned steps (a1) successively show that these steps are not according to the instruction of number to step (a16) It is inevitable successively to be executed according to the sequence of digital indication.Unless expressly stating otherwise herein, there is no tight for the execution of these steps The sequence of lattice limits, these steps can execute in other order.
Above-mentioned Bandwidth Measurement Method obtains Internet protocol address corresponding with object identity to be detected, with adjustable Broadband rate sends UDP message to the corresponding terminal of Internet protocol address, since UDP message is one kind towards connectionless association View, has the characteristics that resource consumption is small, processing speed is fast, therefore do not need prior deploying network devices, does not need user terminal Online state is kept, all user terminals is not needed yet and all receives UDP message, at low cost, operability is high and versatility It is good;Using the randomness of random number come balanced transmission UDP message, the multiple equipment same time is avoided to same Internet protocol The corresponding user terminal in location sends UDP message, improves the accuracy that UDP message is sent;When detection link is from first network state It is minimum only to send icmp packet to a destination network device when variation is the second network state, it obtains and is in available mode When corresponding maximum broadband rate, processing obtains maximum available bandwidth, can use flow by user terminal in simulating actual conditions Process, make measure scene close to the scene of actual use, improve the accuracy of bandwidth measurement.
In one embodiment, a kind of Bandwidth Measurement Method, comprising:
Step (b1) obtains business access log.
Step (b2), obtains Internet protocol address from business access log.
Step (b3) obtains object identity to be detected corresponding to Internet protocol address.
Internet protocol address is classified according to object identity to be detected, obtains object identity pair to be detected by step (b4) The Internet protocol address answered.
Step (b5) obtains Internet protocol address corresponding with object identity to be detected.
Step (b6) generates random number mark.
Step (b7) obtains random number and identifies corresponding Internet protocol address.
Step (b8) identifies the corresponding user of corresponding Internet protocol address to random number with adjustable broadband rate Terminal sends User Datagram Protocol UDP message, wherein the corresponding UDP message of adjustable broadband rate for make with it is to be checked Network congestion occurs for the link surveyed between destination network device corresponding to object identity.
Step (b9) sends duration according to broadband rate corresponding first when broadband rate is greater than default broadband rate The second transmission duration corresponding with default broadband rate obtains sleep time.
Step (b10), starts suspend mode after obtaining sleep time, when timing reaches sleep time, re-executes with successively The broadband rate of increase identifies the step that the corresponding user terminal of corresponding Internet protocol address sends UDP message to random number Suddenly.
Step (b11), from the corresponding user terminal of the Internet protocol address, choosing at least one can be responded The user terminal of icmp packet is as target terminal user.
Step (b12), Xiang Suoshu target terminal user send icmp packet.
Step (b13) receives the icmp echo message that the target terminal user returns.
Step (b14) is determined according to the quantity of the icmp packet of transmission and the quantity of the icmp echo message of return The packet loss of link between the destination network device.
Step (b15), when the packet loss of link is greater than packet loss threshold value, it is determined that link is in network congestion condition.
Step (b16) obtains link and is in corresponding maximum broadband rate when network available status.
Step (b17), corresponding maximum broadband rate processing obtains and target when being in network available status according to link Link maximum available bandwidth between the network equipment.
Although above-mentioned steps (b1) successively show that these steps are not according to the instruction of number to step (b17) It is inevitable successively to be executed according to the sequence of digital indication.Unless expressly stating otherwise herein, there is no tight for the execution of these steps The sequence of lattice limits, these steps can execute in other order.
Above-mentioned Bandwidth Measurement Method obtains Internet protocol address corresponding with object identity to be detected, with adjustable Broadband rate sends UDP message to the corresponding terminal of Internet protocol address, since UDP message is one kind towards connectionless association View, has the characteristics that resource consumption is small, processing speed is fast, therefore do not need prior deploying network devices, does not need user terminal Online state is kept, all user terminals is not needed yet and all receives UDP message, at low cost, operability is high and versatility It is good;Using the randomness of random number come balanced transmission UDP message, the multiple equipment same time is avoided to same Internet protocol The corresponding user terminal in location sends UDP message, improves the accuracy that UDP message is sent;ICMP report is sent to target terminal user Text at least only needs to send icmp packet to an online user terminal, moreover it is possible to determine the link between user terminal Packet loss;Then when detect link from first network state change be the second network state when, when obtaining in available mode pair The maximum broadband rate answered, processing obtain maximum available bandwidth, can use the mistake of flow by user terminal in simulating actual conditions Journey makes to measure scene close to the scene of actual use, improves the accuracy of bandwidth measurement.
It should be understood that although each step in the flow chart of Fig. 2 to Fig. 7 is successively shown according to the instruction of arrow, But these steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly state otherwise herein, these There is no stringent sequences to limit for the execution of step, these steps can execute in other order.Moreover, Fig. 2 is into Fig. 7 At least part step may include that perhaps these sub-steps of multiple stages or stage are not necessarily same to multiple sub-steps One moment executed completion, but can execute at different times, and the execution in these sub-steps or stage sequence is also not necessarily Be successively carry out, but can at least part of the sub-step or stage of other steps or other steps in turn or Alternately execute.
In one embodiment, as shown in figure 8, being the structural block diagram of bandwidth measuring apparatus in one embodiment.A kind of band Wide measuring device, the device include obtaining module 802, sending module 804, detection module 806 and processing module 808, in which:
Module 802 is obtained, for obtaining Internet protocol address corresponding with object identity to be detected.
Sending module 804, for being sent with adjustable broadband rate to the corresponding user terminal of Internet protocol address User Datagram Protocol UDP message, wherein the corresponding UDP message of adjustable broadband rate is for making and object mark to be detected Network congestion occurs for the link known between corresponding destination network device.
Detection module 806 obtains link for being the second network state when detecting link from first network state change Corresponding maximum broadband rate when in available mode, one of them in first network state and the second network state is network Available mode, another is network congestion condition.
Processing module 808, corresponding maximum broadband rate processing obtains when for being in network available status according to link Link maximum available bandwidth between destination network device.
Above-mentioned bandwidth measuring apparatus obtains Internet protocol address corresponding with object identity to be detected, with adjustable Broadband rate sends UDP message to the corresponding terminal of Internet protocol address, since UDP message is one kind towards connectionless association View, has the characteristics that resource consumption is small, processing speed is fast, therefore do not need prior deploying network devices, does not need user terminal Online state is kept, all user terminals is not needed yet and all receives UDP message, at low cost, operability is high and versatility It is good;When detect link from first network state change be the second network state when, when obtaining in available mode it is corresponding most Big broadband rate, processing obtain maximum available bandwidth, can use the process of flow by user terminal in simulating actual conditions, make to survey Scene is measured close to the scene of actual use, improves the accuracy of bandwidth measurement.
In one embodiment, detection module 806 is used to obtain the packet loss of link;When the packet loss of link is greater than packet loss When rate threshold value, it is determined that link is in network congestion condition.
Above-mentioned bandwidth measuring apparatus obtains the packet loss of link, when the packet loss of link is greater than packet loss threshold value, determines Link is in congestion state, can check whether network is in congestion state, can also be kept away to a certain extent by packet loss threshold value Exempt from the packet loss error generated due in addition to network congestion, improves the accuracy of bandwidth measurement.
In one embodiment, detection module 806 is at least one destination network device into destination network device Send Internet Control Message agreement icmp packet;Receive the icmp echo message that destination network device returns;According to transmission The packet loss of the determining link between destination network device of the quantity of the icmp echo message of the quantity and return of icmp packet.
Above-mentioned bandwidth measuring apparatus, at least one destination network device into destination network device send icmp packet, The icmp echo message that destination network device returns is received, packet loss is determined according to the quantity of the message of transmission and back message, As soon as minimum only need to send an icmp packet to destination network device, network state can be detected, strong operability and at low cost.
In one embodiment, detection module 806 is used for from the corresponding user terminal of Internet protocol address, is chosen extremely Few one can respond the user terminal of icmp packet as target terminal user;Icmp packet is sent to target terminal user; Receive the icmp echo message that target terminal user returns;According to the icmp echo report of the quantity of the icmp packet of transmission and return The packet loss of the determining link between destination network device of the quantity of text.
Above-mentioned bandwidth measuring apparatus, from the corresponding user terminal of Internet protocol address, choosing at least one can be returned It answers the user terminal of icmp packet as target terminal user, can guarantee that the target terminal is in survival (alive) state, then It at least only needs to send icmp packet to an online user terminal, receives the icmp echo report that target terminal user returns Text, it is determining between destination network device according to the quantity of the icmp packet of transmission and the quantity of the icmp echo message of return The packet loss of link, moreover it is possible to which the packet loss of the link between determining and user terminal can detect network state, strong operability And it is at low cost.
In one embodiment, the icmp packet that module 802 is used to receive user terminal transmission is obtained;It is sent out to user terminal Send icmp echo message;Receive the value for the packet loss that user terminal returns, wherein the value of packet loss is user terminal according to transmission Icmp packet quantity and icmp echo message quantity determine.
Above-mentioned bandwidth measuring apparatus, the icmp packet sent by receiving user terminal return to ICMP to user terminal and return Message is answered, the value of the packet loss of transmission is received, can not only determine the packet loss of the link between destination network device, moreover it is possible to The determining packet loss the link between user terminal, can detect network state, strong operability and at low cost.
In one embodiment, the delay time that module 802 is used to obtain the link is obtained.Detection module 806 is used for When the delay time of the link being greater than delay time threshold value, determine that the link is in network congestion condition;When the chain When the delay time on road is less than or equal to the delay time threshold value, determine that the link is in network available status.
Above-mentioned bandwidth measuring apparatus, by obtaining the delay time of link, when delay time being greater than delay time threshold value, It determines and is in network congestion condition, when delay time being less than delay time threshold value, determine and be in network available status, it can basis Delay time is detected to obtain network state, to obtain link bandwidth.
In one embodiment, module 802 is obtained for obtaining at least one target network into destination network device Equipment or the sending time that icmp packet is sent at least one target terminal user that can respond icmp packet;Work as reception When the icmp echo message returned to destination network device or target terminal user, acquisition receives connecing for icmp echo message Between time receiving;The delay time of link is obtained according to sending time and receiving time.
Above-mentioned bandwidth measuring apparatus obtains the delay time of link, is avoided that by obtaining sending time and receiving time Icmp packet data volume is big caused by timestamp is added in icmp packet, and icmp packet data volume can be made small, do not easily led to Network congestion improves the accuracy of bandwidth measurement.
In one embodiment, sending module 804 is used for the broadband rate to be sequentially increased to Internet protocol address pair The user terminal answered sends User Datagram Protocol UDP message;First network state is network available status;Second network state For network congestion condition.
Above-mentioned bandwidth measuring apparatus is sent out with the broadband rate being sequentially increased to the corresponding user terminal of Internet protocol address UDP message is sent, UDP message can be sent in sequence, and rate is adjustable, can obtain accurate broadband rate, mention The accuracy of high bandwidth measurement.
In one embodiment, sending module 804 is used for the broadband rate successively to successively decrease to Internet protocol address pair The user terminal answered sends User Datagram Protocol UDP message;First network state is network congestion condition;Second network state For network available status.
Above-mentioned bandwidth measuring apparatus is sent out with the broadband rate successively successively decreased to the corresponding user terminal of Internet protocol address UDP message is sent, UDP message can be sent in sequence, and rate is adjustable, can obtain accurate broadband rate, mention The accuracy of high bandwidth measurement.
In one embodiment, as shown in figure 9, being the structural block diagram of bandwidth measuring apparatus in another embodiment.The band Wide measuring device further includes generation module 810.Generation module 810 is for generating random number mark.Module 802 is obtained for obtaining Random number identifies corresponding Internet protocol address.Sending module 804 is used to identify with adjustable broadband rate to random number The corresponding user terminal of corresponding Internet protocol address sends UDP message.
Above-mentioned bandwidth measuring apparatus generates random number mark, obtains random number and identifies corresponding Internet protocol address, with Adjustable broadband rate sends UDP message, Neng Gouli to the corresponding terminal of the corresponding Internet protocol address of random number mark With the randomness of random number come balanced transmission UDP message, avoid the multiple equipment same time to same Internet protocol address pair The user terminal answered sends UDP message, improves the accuracy that UDP message is sent.
In one embodiment, as shown in figure 9, the bandwidth measuring apparatus further includes sleep block 812.Sleep block 812 For sending duration and default broadband rate according to broadband rate corresponding first when broadband rate is greater than default broadband rate Corresponding second transmission duration obtains sleep time;Start suspend mode after obtaining sleep time, when timing reaches sleep time, hair Send module 804 for sending UDP message to the corresponding user terminal of Internet protocol address with adjustable broadband rate.
Above-mentioned bandwidth measuring apparatus, when broadband rate is greater than default broadband rate, according to broadband rate corresponding first It sends duration and the corresponding second transmission duration of default broadband rate obtains sleep time, start to stop after obtaining sleep time It sleeps, when timing reaches sleep time, re-executes whole to the corresponding user of Internet protocol address with adjustable broadband rate End sends the step of UDP message, can control broadband rate, improves the accuracy of bandwidth measurement.
In one embodiment, it obtains module 802 and is also used to obtain business access log;It is obtained from business access log Internet protocol address;Obtain object identity to be detected corresponding to Internet protocol address;It will according to object identity to be detected Internet protocol address classification, obtains the corresponding Internet protocol address of object identity to be detected.
Above-mentioned bandwidth measuring apparatus obtains Internet protocol address from business access log, with obtaining Internet protocol Internet protocol address is classified according to object identity to be detected, obtains object to be detected by the corresponding object identity to be detected in location Corresponding Internet protocol address is identified, can be classified on demand, sends UDP packet to the corresponding user terminal of the IP address, thus The bandwidth of link is obtained, the accuracy of bandwidth measurement is improved.
In one embodiment, obtain module 802 be used for from Internet protocol address database obtain with it is to be detected right As identifying corresponding Internet protocol address.
Above-mentioned bandwidth measuring apparatus obtains corresponding with object identity to be detected mutual from Internet protocol address database Networking protocol address can obtain a large amount of Internet protocol address and send UDP message, improve the accuracy of bandwidth measurement.
Figure 10 shows the internal structure chart of computer equipment in one embodiment.The computer equipment specifically can be figure Computer equipment 110 in 1.As shown in Figure 10, it includes being connected by system bus which, which includes the computer equipment, Processor, memory and the network interface connect.Wherein, memory includes non-volatile memory medium and built-in storage.The calculating The non-volatile memory medium of machine equipment is stored with operating system, can also be stored with computer program, which is located When managing device execution, processor may make to realize Bandwidth Measurement Method.Computer program can also be stored in the built-in storage, the meter When calculation machine program is executed by processor, processor may make to execute Bandwidth Measurement Method.
It will be understood by those skilled in the art that structure shown in Figure 10, only part relevant to application scheme The block diagram of structure, does not constitute the restriction for the computer equipment being applied thereon to application scheme, and specific computer is set Standby may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, bandwidth measuring apparatus provided by the present application can be implemented as a kind of shape of computer program Formula, computer program can be run in computer equipment as shown in Figure 10.Composition can be stored in the memory of computer equipment Each program module of the bandwidth measuring apparatus, for example, acquisition module shown in Fig. 8, sending module, detection module and processing mould Block.The computer program that each program module is constituted makes processor execute each embodiment of the application described in this specification Bandwidth Measurement Method in step.For example, computer equipment shown in Fig. 10 can be filled by bandwidth measurement as shown in Figure 8 Acquisition module in setting, which executes, obtains Internet protocol address corresponding with object identity to be detected.Computer equipment can pass through hair It send module to execute and User Datagram Protocol is sent to the corresponding user terminal of Internet protocol address with adjustable broadband rate UDP message, wherein the corresponding UDP message of adjustable broadband rate is for making and target corresponding to object identity to be detected Network congestion occurs for the link between the network equipment.Computer equipment, which can execute to work as by detection module, detects link from first Network state variation is the second network state, obtains link and is in corresponding maximum broadband rate, first network when available mode One of them in state and the second network state is network available status, another is network congestion condition.Computer equipment Corresponding maximum broadband rate processing when be in network available status according to link can be executed by processing module to obtain and target Link maximum available bandwidth between the network equipment.
In one embodiment, a kind of computer equipment, including memory and processor are provided, memory is stored with meter Calculation machine program, when computer program is executed by processor, so that the step of processor executes above-mentioned Bandwidth Measurement Method.Band herein The step of wide measurement method, can be the step in the Bandwidth Measurement Method of above-mentioned each embodiment.
In one embodiment, a kind of computer readable storage medium is provided, computer program, computer journey are stored with When sequence is executed by processor, so that the step of processor executes above-mentioned Bandwidth Measurement Method.The step of Bandwidth Measurement Method herein It can be the step in the Bandwidth Measurement Method of above-mentioned each embodiment.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read In storage medium, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, provided herein Each embodiment used in any reference to memory, storage, database or other media, may each comprise non-volatile And/or volatile memory.Nonvolatile memory may include that read-only memory (ROM), programming ROM (PROM), electricity can be compiled Journey ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) directly RAM (RDRAM), straight Connect memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously The limitation to the application the scope of the patents therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art For, without departing from the concept of this application, various modifications and improvements can be made, these belong to the guarantor of the application Protect range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (14)

1. a kind of Bandwidth Measurement Method, comprising:
Obtain Internet protocol address corresponding with object identity to be detected;
User Datagram Protocol UDP is sent to the corresponding user terminal of the Internet protocol address with adjustable broadband rate Message, wherein the corresponding UDP message of the adjustable broadband rate for make with corresponding to the object identity to be detected Network congestion occurs for the link between destination network device;
When detect the link from first network state change be the second network state when, obtain the link be in network can Corresponding maximum broadband rate when with state, one of them in the first network state and the second network state can for network With state, another is network congestion condition;
Corresponding maximum broadband rate processing obtains setting with the target network when being in network available status according to the link Link maximum available bandwidth between standby.
2. the method according to claim 1, wherein the detection mode of the congestion state, comprising:
Obtain the packet loss of the link;
When the packet loss of the link is greater than packet loss threshold value, it is determined that the link is in network congestion condition.
3. according to the method described in claim 2, it is characterized in that, the packet loss for obtaining the link, comprising:
At least one destination network device into the destination network device sends Internet Control Message agreement icmp packet;
Receive the icmp echo message that the destination network device returns;
According to the quantity of the icmp packet of transmission and the determination of the quantity of the icmp echo message of return and the target network The packet loss of link between equipment.
4. according to the method described in claim 2, it is characterized in that, the packet loss for obtaining the link, comprising:
From the corresponding user terminal of the Internet protocol address, it is whole to choose the user that at least one can respond icmp packet End is used as target terminal user;
Icmp packet is sent to the target terminal user;
Receive the icmp echo message that the target terminal user returns;
According to the quantity of the icmp packet of transmission and the determination of the quantity of the icmp echo message of return and the target network The packet loss of link between equipment.
5. according to the method described in claim 2, it is characterized in that, the packet loss for obtaining the link, comprising:
Receive the icmp packet that the user terminal is sent;
Icmp echo message is sent to the user terminal;
Receive the value for the packet loss that user terminal returns, wherein the value of the packet loss is the user terminal according to the hair What the quantity of the icmp packet sent and the quantity of the icmp echo message determined.
6. the method according to claim 1, wherein the detection mode of the network state, comprising:
Obtain the delay time of the link;
When the delay time of the link being greater than delay time threshold value, determine that the link is in network congestion condition;
When the delay time of the link being less than or equal to the delay time threshold value, determine that the link is available in network State.
7. according to the method described in claim 6, it is characterized in that, the delay time for obtaining the link, comprising:
At least one destination network device into the destination network device or at least the one of icmp packet can be responded A target terminal user sends icmp packet, and obtains corresponding sending time;
When receiving the icmp echo message of the destination network device or target terminal user return, obtains and receive To the receiving time of icmp echo message;
The delay time of link is obtained according to the sending time and the receiving time.
8. method according to any one of claims 1 to 7, which is characterized in that it is described with adjustable broadband rate to institute It states the corresponding terminal of Internet protocol address and sends UDP message, comprising:
Generate random number mark;
It obtains the random number and identifies corresponding Internet protocol address;
It is sent with adjustable broadband rate to the corresponding user terminal of the corresponding Internet protocol address of random number mark UDP message.
9. method according to any one of claims 1 to 7, which is characterized in that the method also includes:
When the broadband rate is greater than default broadband rate, duration and described is sent according to the broadband rate corresponding first Default broadband rate corresponding second sends duration and obtains sleep time;
Start suspend mode after obtaining sleep time, when timing reaches the sleep time, re-executes with adjustable broadband speed The step of rate sends UDP message to the corresponding user terminal of the Internet protocol address.
10. method according to any one of claims 1 to 7, which is characterized in that corresponding in the acquisition destination network device Internet protocol address before, further includes:
Obtain business access log;
Internet protocol address is obtained from the business access log;
Obtain object identity to be detected corresponding to the Internet protocol address;
The Internet protocol address is classified according to the object identity to be detected, it is corresponding to obtain the object identity to be detected Internet protocol address.
11. method according to any one of claims 1 to 7, which is characterized in that the acquisition and object identity pair to be detected The Internet protocol address answered, comprising:
Internet protocol address corresponding with object identity to be detected is obtained from Internet protocol address database.
12. a kind of bandwidth measuring apparatus, which is characterized in that described device includes:
Module is obtained, for obtaining Internet protocol address corresponding with object identity to be detected;
Sending module, for sending user to the corresponding user terminal of the Internet protocol address with adjustable broadband rate Datagram protocol UDP message, wherein the corresponding UDP message of the adjustable broadband rate for make with it is described to be detected right As network congestion occurs for the link identified between corresponding destination network device;
Detection module obtains the chain for being the second network state when detecting the link from first network state change Road is in corresponding maximum broadband rate when available mode, one of them in the first network state and the second network state For network available status, another is network congestion condition;
Processing module, corresponding maximum broadband rate processing obtains and institute when for being in network available status according to the link State the link maximum available bandwidth between destination network device.
13. a kind of computer readable storage medium is stored with computer program, when the computer program is executed by processor, So that the processor is executed such as the step of any one of claims 1 to 11 the method.
14. a kind of computer equipment, including memory and processor, the memory is stored with computer program, the calculating When machine program is executed by the processor, so that the processor is executed such as any one of claims 1 to 11 the method Step.
CN201910301810.3A 2019-04-16 2019-04-16 Bandwidth measuring method, device, computer readable storage medium and computer equipment Active CN109921962B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910301810.3A CN109921962B (en) 2019-04-16 2019-04-16 Bandwidth measuring method, device, computer readable storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910301810.3A CN109921962B (en) 2019-04-16 2019-04-16 Bandwidth measuring method, device, computer readable storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN109921962A true CN109921962A (en) 2019-06-21
CN109921962B CN109921962B (en) 2021-03-23

Family

ID=66977348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910301810.3A Active CN109921962B (en) 2019-04-16 2019-04-16 Bandwidth measuring method, device, computer readable storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN109921962B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572440A (en) * 2019-08-16 2019-12-13 海尔优家智能科技(北京)有限公司 Method and device for data transmission, household appliance and storage medium
CN110932997A (en) * 2019-12-09 2020-03-27 苏州浪潮智能科技有限公司 Method, device and medium for reducing network traffic packet loss
CN111092791A (en) * 2019-12-31 2020-05-01 上海掌门科技有限公司 Method and equipment for determining available network bandwidth from application to server
CN111404783A (en) * 2020-03-20 2020-07-10 南京大学 Network state data acquisition method and system
CN111988196A (en) * 2020-07-21 2020-11-24 中国长城科技集团股份有限公司 Bandwidth detection method and device, electronic equipment and storage medium
CN112073128A (en) * 2020-08-18 2020-12-11 江苏创通电子股份有限公司 Communication equipment performance test method and device
CN112787879A (en) * 2019-11-08 2021-05-11 西安诺瓦星云科技股份有限公司 Gigabit Ethernet packet loss detection method and device thereof
CN114338473A (en) * 2021-12-20 2022-04-12 广州市柏特科技有限公司 Multi-element cooperative broadband speed measurement method, speed measurement system, terminal and medium
WO2022082871A1 (en) * 2020-10-23 2022-04-28 苏州聚慧邦信息科技有限公司 Remote interaction method and apparatus for office equipments and online office interaction platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242318A (en) * 2008-03-14 2008-08-13 华为技术有限公司 Method and device for getting network connection quality information of network node
US20090234996A1 (en) * 2008-03-12 2009-09-17 Embarq Holdings Company, Llc System and method for dynamic bandwidth determinations
CN106487613A (en) * 2016-11-16 2017-03-08 北京华为数字技术有限公司 A kind of bandwidth test methods, devices and systems
CN106612238A (en) * 2015-10-21 2017-05-03 阿里巴巴集团控股有限公司 Flow control method, device and system
CN108011771A (en) * 2016-11-01 2018-05-08 阿里巴巴集团控股有限公司 Detection method, device and the equipment of network link available bandwidth

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090234996A1 (en) * 2008-03-12 2009-09-17 Embarq Holdings Company, Llc System and method for dynamic bandwidth determinations
CN101242318A (en) * 2008-03-14 2008-08-13 华为技术有限公司 Method and device for getting network connection quality information of network node
CN106612238A (en) * 2015-10-21 2017-05-03 阿里巴巴集团控股有限公司 Flow control method, device and system
CN108011771A (en) * 2016-11-01 2018-05-08 阿里巴巴集团控股有限公司 Detection method, device and the equipment of network link available bandwidth
CN106487613A (en) * 2016-11-16 2017-03-08 北京华为数字技术有限公司 A kind of bandwidth test methods, devices and systems

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572440A (en) * 2019-08-16 2019-12-13 海尔优家智能科技(北京)有限公司 Method and device for data transmission, household appliance and storage medium
CN110572440B (en) * 2019-08-16 2022-03-25 海尔优家智能科技(北京)有限公司 Method and device for data transmission, household appliance and storage medium
CN112787879A (en) * 2019-11-08 2021-05-11 西安诺瓦星云科技股份有限公司 Gigabit Ethernet packet loss detection method and device thereof
CN110932997A (en) * 2019-12-09 2020-03-27 苏州浪潮智能科技有限公司 Method, device and medium for reducing network traffic packet loss
CN110932997B (en) * 2019-12-09 2022-06-21 苏州浪潮智能科技有限公司 Method, device and medium for reducing network traffic packet loss
CN111092791A (en) * 2019-12-31 2020-05-01 上海掌门科技有限公司 Method and equipment for determining available network bandwidth from application to server
CN111092791B (en) * 2019-12-31 2023-01-31 上海掌门科技有限公司 Method and equipment for determining available network bandwidth from application to server
CN111404783A (en) * 2020-03-20 2020-07-10 南京大学 Network state data acquisition method and system
CN111988196A (en) * 2020-07-21 2020-11-24 中国长城科技集团股份有限公司 Bandwidth detection method and device, electronic equipment and storage medium
CN112073128A (en) * 2020-08-18 2020-12-11 江苏创通电子股份有限公司 Communication equipment performance test method and device
WO2022082871A1 (en) * 2020-10-23 2022-04-28 苏州聚慧邦信息科技有限公司 Remote interaction method and apparatus for office equipments and online office interaction platform
CN114338473A (en) * 2021-12-20 2022-04-12 广州市柏特科技有限公司 Multi-element cooperative broadband speed measurement method, speed measurement system, terminal and medium

Also Published As

Publication number Publication date
CN109921962B (en) 2021-03-23

Similar Documents

Publication Publication Date Title
CN109921962A (en) Bandwidth Measurement Method, device, computer readable storage medium and computer equipment
CN102045222B (en) Real-time overall test method of network system
CN105515915B (en) Node detecting method and device, path selecting method and device and network system
US9282012B2 (en) Cognitive data delivery optimizing system
US9674057B2 (en) Method and system to monitor a network
CN111327471B (en) Network quality analysis method, device, computer equipment and storage medium
CN111181798B (en) Network delay measuring method, device, electronic equipment and storage medium
US20110170433A1 (en) Methods and apparatus for monitoring network link quality
CN113472900B (en) Message processing method, device, storage medium and computer program product
CN107534587B (en) Time delay measuring system and method
CN109660422B (en) Network card bandwidth testing method, device, terminal and storage medium based on multiple processes
CN115002008B (en) Method, device, equipment and storage medium for measuring network delay
CN107992416B (en) Method and device for determining webpage time delay
CN108259207A (en) Flow statistical method, client, server and system
Łubkowski et al. Test of the multimedia services implementation in information and communication networks
Pedersen et al. Using latency as a QoS indicator for global cloud computing services
US20140200041A1 (en) Evaluation of overall performance of interactive application service
De Silva et al. Throughput estimation for short lived TCP cubic flows
US11677651B2 (en) UDPING—continuous one-way monitoring of multiple network links
US20100246422A1 (en) Network device and method of measuring upstream bandwidth employed thereby
CN105611406B (en) One kind access net service provider monitors user to video server lag characteristic method
US20070133432A1 (en) Methods and system for measuring the round trip time in packet switching telecommunication networks
Rafika et al. Time-stamping accuracy in virtualized environments
CN105939208B (en) The transmission method and device of sampled data
CN114629826A (en) Network maximum bandwidth estimation method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant