CN119892659A - Bandwidth prediction method and route forwarding equipment - Google Patents
Bandwidth prediction method and route forwarding equipment Download PDFInfo
- Publication number
- CN119892659A CN119892659A CN202311345868.0A CN202311345868A CN119892659A CN 119892659 A CN119892659 A CN 119892659A CN 202311345868 A CN202311345868 A CN 202311345868A CN 119892659 A CN119892659 A CN 119892659A
- Authority
- CN
- China
- Prior art keywords
- bandwidth
- data
- tcp
- period
- message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/147—Network analysis or design for predicting network behaviour
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
- H04L43/0894—Packet rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/08—Testing, supervising or monitoring using real traffic
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application provides a bandwidth prediction method and routing forwarding equipment, relates to the technical field of communication, and can solve the problem that the actual use condition of a network is different due to the fact that the network condition is reflected through traffic. The method is applied to routing forwarding equipment and comprises the steps that the routing forwarding equipment transmits N data streams in a first period, the message lengths of a plurality of messages included in the data streams are obtained for each data stream in the N data streams, the first bandwidth when the data streams are transmitted is determined according to the message lengths, the routing forwarding equipment determines the first bandwidth sum when the N data streams are transmitted in the first period based on the first bandwidth corresponding to each data stream in the N data streams, and the routing forwarding equipment determines the target bandwidth at least according to the first bandwidth sum.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a bandwidth prediction method and a route forwarding device.
Background
With the development of wireless communication technology, routers are widely used, and terminal devices can perform data transmission through routers in a wireless communication system. In the related art, in the process of data transmission with a router, the router can feed back the current internet surfing flow, and the network condition is reflected through the flow.
The traffic refers to a certain time point, and the traffic size (i.e. the sum of data) of a certain terminal device sending data and receiving data to the outside cannot represent the actual use situation of the current network. In addition, under the scenes of network interference, abnormal network coverage environment and the like, the problems of packet loss and retransmission exist in the process of data transmission of the terminal equipment through the router, and based on the scenes, the network condition is reflected through traffic, and the network condition may be different from the actual use condition of the network.
Disclosure of Invention
The embodiment of the application provides a bandwidth prediction method and routing forwarding equipment, which are used for solving the problem that the actual use condition of a network is different due to the fact that the network condition is reflected through traffic in the related technology.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical scheme:
The method comprises the steps that the routing forwarding device transmits N data streams in a first period, the message length of a plurality of messages contained in the data streams is acquired for each data stream in the N data streams, the first bandwidth when the data streams are transmitted is determined according to the message length, then the routing forwarding device determines the first bandwidth sum when the N data streams are transmitted in the first period based on the first bandwidth corresponding to each data stream in the N data streams, and finally the routing forwarding device determines a target bandwidth at least according to the first bandwidth sum, namely the maximum bandwidth when the routing forwarding device transmits the N data streams.
Based on the first aspect, in the case that the routing forwarding device transmits N data streams in the first period, since the routing forwarding device determines, for each of the N data streams, a first bandwidth corresponding to each data stream, a first bandwidth sum when the N data streams are transmitted in the first period is determined, and a maximum bandwidth when the routing forwarding device transmits the N data streams is determined according to the first bandwidth sum. Therefore, the maximum bandwidth when the data stream is transmitted currently is predicted by the route forwarding device, so that the current network condition can be reflected more accurately, namely, the actual use condition of the network can be reflected.
In one possible implementation manner of the first aspect, the method includes that the routing forwarding device transmits M data streams in a second period, the routing forwarding device obtains message lengths of a plurality of messages included in the data streams for each of the M data streams and determines a second bandwidth corresponding to the data streams according to the message lengths, then the routing forwarding device determines a second bandwidth sum when transmitting the M data streams in the second period based on the second bandwidth corresponding to each of the M data streams, and finally the routing forwarding device determines a target bandwidth according to the first bandwidth sum and the second bandwidth sum.
In this implementation, the route forwarding device may continue to predict a second bandwidth when transmitting the M data streams in the second period, thereby determining the target bandwidth based on the first bandwidth sum and the second bandwidth sum. That is, the route forwarding device can periodically predict the bandwidth of the current transmission data stream, so that the condition of the current network, that is, the actual use condition of the network, can be reflected more accurately by periodically predicting the bandwidth.
Optionally, the second period is a period next to the first period.
In one possible implementation manner of the first aspect, determining the target bandwidth according to the first bandwidth sum and the second bandwidth sum includes determining that the target bandwidth is the second bandwidth sum if the second bandwidth sum is greater than the first bandwidth sum, or determining that the target bandwidth is the second bandwidth sum if the second bandwidth sum is less than the first bandwidth sum and the bandwidth increase ratio is greater than the retransmission ratio, or reserving that the target bandwidth is the first bandwidth sum if the second bandwidth sum is less than the first bandwidth sum and the bandwidth increase ratio is less than the retransmission ratio. The bandwidth increase rate is used for indicating the bandwidth increase rate of the second period compared with the first period, and the retransmission rate is used for indicating the rate of occurrence of retransmission in the first period.
In the implementation manner, considering the influence of retransmission on the bandwidth, in the application, the route forwarding device periodically determines the sum of bandwidths of all data streams transmitted in each period, and dynamically adjusts the target bandwidth based on the bandwidth increasing ratio and the retransmission ratio, so that the predicted bandwidth when the data stream is currently transmitted is more accurate, and further the current network condition, namely the actual use condition of the network, can be reflected more accurately.
Alternatively, the bandwidth increase ratio satisfies the following expression:
ΔB=(Bt2-Bt1)/Bt1;
Where Δb represents the bandwidth increase ratio, bt 2 represents the second bandwidth sum, and Bt 1 represents the first bandwidth sum.
Optionally, the retransmission ratio satisfies the following expression:
wherein Rt represents a retransmission ratio, Representing the data amount of the retransmission message transmitted in the first period,And the data quantity of all the messages transmitted in the first period is represented.
In one possible implementation manner of the first aspect, determining the first bandwidth of the data flow comparison according to the message lengths includes determining, by the routing forwarding device, a data amount of the data flow transmitted in a first period according to the message lengths of the plurality of messages, and determining, by the routing forwarding device, the first bandwidth corresponding to the data flow according to the data amount of the data flow transmitted in the first period and the first period.
Optionally, if the data stream does not include the retransmission message, the first bandwidth is a ratio of a data amount of the data stream transmitted in the first period to the first period.
In one possible implementation manner of the first aspect, the first period includes a first period and a second period of the pre-device, the second period is related to a retransmission timeout period RTO, the first period is a difference between the first period and the second period, the routing forwarding device determines a first bandwidth corresponding to the data stream according to a data volume of the data stream transmitted in the first period and the first period, the routing forwarding device determines a data volume of a normal message transmitted in the first period, a data volume of a retransmission message transmitted in the second period and a data volume of all messages transmitted in the second period, and the routing forwarding device determines the first bandwidth corresponding to the data stream according to the data volume of the normal message transmitted in the first period, the data volume of the retransmission message transmitted in the second period, the data volume of all messages transmitted in the second period, the first period and the second period.
In this implementation, the first bandwidth is a ratio of a data amount of the normal packet transmitted to time in the first period. The time is related to the time included in the detection of the transmission in the first time period and the proportion of the retransmission messages transmitted in the second time period, so that the determined first bandwidth can be more accurate by taking the proportion of the retransmission messages transmitted in the first period into consideration by adopting the scheme of the application.
Optionally, the first bandwidth corresponding to the data stream satisfies the following expression:
Wherein Bi represents a first bandwidth corresponding to the data stream, Indicating the data quantity of the normal message transmitted in the first time period,The data volume of the retransmission message transmitted in the second duration; And the data quantity of all the messages transmitted in the second time period is represented by t 1, the first time period is represented by t 2, and the second time period is represented by t.
In a possible implementation manner of the first aspect, the method further includes displaying, by the routing forwarding device, the target bandwidth, or sending, by the routing forwarding device, indication information to the terminal device, where the indication information includes the target bandwidth, and the indication information is used to instruct the terminal device to display the target bandwidth.
In the implementation manner, the route forwarding device displays the target bandwidth, or the terminal device displays the target bandwidth, so that a user can more accurately measure the network condition, and whether the bandwidth is overloaded or whether the bandwidth package purchased by the user meets the actual requirement is confirmed. Further, for the problem of slow network speed caused by network congestion possibly caused by home environments (such as excessive number of terminal devices accessing a communication network through a route forwarding device, etc.), the target bandwidth is displayed through the route forwarding device, or the target bandwidth is displayed by the terminal device, so that a user can conveniently confirm whether the target bandwidth is caused by too small bandwidth or too limited bandwidth, the user can conveniently perform fault elimination, and the user experience is improved.
In a possible implementation manner of the first aspect, the method further includes the route forwarding device allocating the target bandwidth to the terminal device based on an application scenario of the terminal device.
In the implementation manner, the routing forwarding device allocates different bandwidths to the terminal devices in different application scenes based on the predicted target bandwidths, so that the network rate of the terminal devices in the application scenes can be improved, and the user experience is improved.
Optionally, if the application scenario of the terminal device is a first application scenario, the routing forwarding device allocates a first target bandwidth to the terminal device, and if the application scenario of the terminal device is a second application scenario, the routing forwarding device allocates a second target bandwidth to the terminal device, wherein the bandwidth required by the first application scenario is greater than the bandwidth required by the second application scenario, and the first target bandwidth is greater than the second target bandwidth.
In a second aspect, a routing forwarding device is provided, where the routing forwarding device has a function for implementing any of the above first aspects, and the function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions described above.
In a third aspect, there is provided a route forwarding device comprising a memory and one or more processors, wherein the memory is configured to store computer instructions that, when executed by the route forwarding device, cause the route forwarding device to perform the method of any of the first aspects.
In a fourth aspect, a chip system is provided, the chip system comprising at least one processor and an interface for receiving instructions and transmitting to the at least one processor, the at least one processor executing instructions to cause a route forwarding device to perform the method of any of the first aspects described above.
In a fifth aspect, there is provided a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of any of the first aspects above.
In a sixth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any of the first aspects above.
The technical effects caused by any implementation manner of the second aspect to the sixth aspect may refer to the technical effects caused by different implementation manners of the first aspect, which are not described herein.
Drawings
Fig. 1 is a schematic structural diagram of a communication system according to an embodiment of the present application;
fig. 2 is a schematic diagram of a communication device according to an embodiment of the present application;
Fig. 3 is a schematic flow chart of a three-way handshake process according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a TCP transmission according to an embodiment of the present application;
fig. 5 is a schematic diagram of timeout retransmission according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a netfilter framework according to an embodiment of the present application;
fig. 7 is a schematic flow chart of bandwidth prediction according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a data stream according to an embodiment of the present application;
FIG. 9 is a schematic flow chart of another bandwidth prediction according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a chip system according to an embodiment of the present application.
Detailed Description
For convenience of understanding, first, technical terms and related technologies related to the embodiments of the present application are described.
The transmission control protocol (transmission control protocol, TCP) is a connection-oriented, reliable, byte stream based transport layer communication protocol, defined by IETF RFC 793. Connection-oriented means that both parties, such as clients and servers, that communicate using the TCP protocol must first establish a TCP connection before using the TCP protocol to transmit TCP messages over a data stream.
Each data stream transmitted by the client and the server includes a plurality of TCP messages, and after the client and the server establish a connection, the client and the server may transmit the data stream, that is, transmit the TCP messages, through a data stream channel. Among a plurality of TCP messages transmitted by the client and the server, TCP messages with the same source port number, the same destination port number and the same protocol type are called a data stream. That is, in the same data stream, the port numbers of the TCP messages transmitted by the client and the server are the same, and the protocol types are the same.
It should be noted that, among the multiple TCP messages transmitted by the client and the server, each TCP message includes a header and data. The header may include a source port (source port) number, a destination port (destination port) number, a sequence number (sequence number), a TCP flag bit (or message control flag), an acknowledgement number (acknowledgment number, ACK number), and the like.
The source port number is used for searching the application process of the transmitting end. The destination port number is used for finding the application process of the receiving end. Sequence numbers (or called message sequence numbers) are used to identify the order of data portions in a TCP message in a data stream sent from a sender to a receiver. In the process of transmitting data stream by adopting TCP protocol, data parts in a plurality of TCP messages transmitted by a transmitting end are numbered according to sequence, and a receiving end can correctly reorganize data according to the sequence number, so that the data order is ensured. The acknowledgement number indicates that the receiving end acknowledges the received data. Where acknowledgement number = sequence number +1 in the last TCP message.
Of course, the header may also include other contents, for example, the header may also include a header length, a reserved bit, a window size, an option, etc., and the detailed explanation will be referred to the related art and will not be repeated herein.
The TCP flag bit may include an Acknowledgement (ACK), a Reset (RST), a Synchronization (SYN), a Finish (FIN), and the like.
Wherein, ACK is used to indicate whether the acknowledgement number is valid. In the TCP protocol, it is specified that after the client and the server establish a TCP connection, the ACK must be 1, that is, when ack=1, it indicates that the acknowledgement number is valid.
RST is used to indicate whether the client and server reset the connection. For example, if rst=1, it indicates that a serious error occurs in the TCP connection between the client and the server (e.g., the host crashes), and then the previous TCP connection needs to be released, and then the TCP connection is re-established, i.e., rst=1 indicates that the client and the server need to reset the connection.
And SYN, a handshake signal used when the client and the server establish TCP connection is used for requesting synchronization.
The FIN is used for marking whether the data is sent completely. If fin=1, indicating that the data has been sent, the TCP connection may be released.
Of course, other flag bits may be included, for example, a random Number Sum (NS), a congestion window reduction flag (congestion window reduce, CWR), ENC echo (ECN echo), urgent (URG), push (PSH), and the like, and the detailed explanation thereof will be omitted herein with reference to the related art.
Typically, the router may provide a traffic statistics function, and display the traffic statistics result to the user through a user interface, so as to reflect the current network condition to the user. In some scenarios, reflecting the current network conditions through traffic may be different from the actual bandwidth used by the network.
For example, after a terminal device (such as a mobile phone, a tablet computer, etc.) accesses a communication network through a wireless fidelity (WIRELESS FIDELITY, wi-Fi) network provided by a router, the traffic cannot reflect the actual condition of the current network due to the influence of network environment factors. The network environment factors include signal interference to reduce signal-to-noise ratio, signal coverage difference to prolong data transmission time, roaming switching to cause data packet loss or retransmission, wi-Fi link instability, and external environment instability to cause data packet loss or retransmission.
The external environment instability can include uplink network abnormality (such as between a light cat and a router), access network abnormality, backbone network abnormality, server abnormality and the like.
In order to solve the technical problems described above, an embodiment of the present application provides a bandwidth prediction method, which is applied to a route forwarding device, where the route forwarding device establishes a communication connection with a terminal device, and is used for forwarding a data stream sent by the terminal device or forwarding a data stream received by the terminal device. Under the condition that the route forwarding equipment transmits N data streams in a first period, aiming at each data stream in the N data streams, acquiring the message lengths of a plurality of messages included in the data streams, and determining a first bandwidth when the data streams are transmitted according to the message lengths. And then, the route forwarding device determines a first bandwidth sum when N data streams are transmitted in a first period based on the first bandwidth corresponding to each data stream, and determines the maximum bandwidth when the route forwarding device transmits the N data streams according to the first bandwidth sum. Therefore, the maximum bandwidth when the data stream is transmitted currently is predicted by the route forwarding device, so that the current network condition can be reflected more accurately, namely, the actual use condition of the network can be reflected.
The following describes in detail the technical solution provided by the embodiments of the present application with reference to the drawings of the specification.
The method provided by the embodiment of the application is applied to the communication system shown in fig. 1. Illustratively, as shown in fig. 1, the communication system includes a terminal device 101, a route forwarding device 102, and a core network device 103. The terminal device 101 may be a wireless internet device or a wired internet device, where the wireless internet device may access the route forwarding device 102 in a wireless manner (e.g., wi-Fi), and the wired internet device may access the route forwarding device 102 in a wired manner (e.g., data transmission line). The route forwarding device 102 is configured to transmit a data stream sent by the terminal device 101.
Optionally, as shown in fig. 1, the communication system may also include a modem (e.g., a light cat). The optical modem is used for realizing the conversion of the photoelectric signal and the conversion of the interface protocol in the communication network, and is connected with the core network device 103 and the route forwarding device 102. The route forwarding device 102 connects the terminal device 101 with the optical modem for the purpose of connecting the terminal device 101 into the communication network. For example, the communication network may be an internet network (internet).
Alternatively, the above-described communication system may further include a broadband access server, a core router, or the like, which connects the terminal device 101 to the communication network. For example, the route forwarding device 102 connects the terminal device 101 with an optical modem, and the optical modem connects the terminal device 101 with the core network device 103 through a broadband access server, a core router, or the like, thereby realizing the need for accessing the terminal device 101 to a communication network.
For example, the terminal device 101 may be a determining machine, a tablet computer, a desktop, a laptop, a notebook, an ultra-mobile personal determining machine (ultra-mobile personal computer, UMPC), a handheld determining machine, a netbook, a Personal Digital Assistant (PDA), a mobile phone, a set top box, a smart television, a smart wearable device, or the like, or a user device that can be networked, or an internet of things node in the internet of things, or an in-vehicle communication apparatus in the internet of things, or an entertainment device, a game device or system, a global positioning system device, or the like, and the terminal device 101 may also be a chip or a processing system in these devices. The terminal device 101 may also be a wireless communication chip, a wireless sensor, a wireless communication terminal, or the like.
For example, the route forwarding device 102 may be a device having route and forwarding functions. For example, the route forwarding device 102 may be a router, a three-layer switch (LAYER THREE SWITCH), or the like. The route forwarding device 102 may also be a chip or processing system among the devices described above.
In a specific implementation, as shown in fig. 1, the terminal device 101 and the route forwarding device 102 may adopt the composition structure shown in fig. 2, or include the components shown in fig. 2. Fig. 2 is a schematic diagram of a communication device 200 according to an embodiment of the application. As shown in fig. 2, the communication device 200 may include a processor 201, a transceiver 202, and a communication line 203.
Further, the communication device 200 may also include a memory 204. The processor 201, the memory 204, and the transceiver 202 may be connected by a communication line 203.
The processor 201 is a central processing unit (central processing unit, CPU), a general purpose processor network processor (network processor, NP), a digital signal processor (DIGITAL SIGNAL processing, DSP), a microprocessor, a microcontroller, a programmable logic device (programmable logic device, PLD), or any combination thereof. The processor 201 may also be other devices with processing functions, such as, without limitation, circuits, devices, or software modules.
A transceiver 202 for communicating with other devices or other communication networks. The other communication network may be an ethernet, a radio access network (radio access network, RAN), a wireless local area network (wireless local area networks, WLAN), etc. The transceiver 202 may be a module, circuitry, transceiver, or any device capable of enabling communications.
Communication line 203 for transmitting information between the components included in communication device 200.
Memory 204 for storing instructions. Wherein the instructions may be a deterministic machine program.
The memory 204 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device capable of storing static information and/or instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device capable of storing information and/or instructions, an EEPROM, a CD-ROM (compact disc read-only memory) or other optical disk storage, an optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, etc.
It should be noted that the memory 204 may exist separately from the processor 201 or may be integrated with the processor 201. Memory 204 may be used to store instructions or program code or some data, etc. The memory 204 may be located inside the communication device 200 or outside the communication device 200, and is not limited. Processor 201 is configured to execute instructions stored in memory 204 to implement methods provided by embodiments of the present application described below.
In one example, processor 201 may include one or more CPUs, such as CPU0 and CPU1 in fig. 2.
As an alternative implementation, the communication device 200 includes multiple processors, e.g., in addition to the processor 201 in fig. 2, a processor 207 may be included.
As an alternative implementation, the communication apparatus 200 further comprises an output device 205 and an input device 206. Illustratively, the input device 206 is a keyboard, mouse, microphone, or joystick, and the output device 205 is a display, speaker (speaker), or the like.
It should be noted that the constituent structure shown in fig. 2 does not constitute a limitation of the communication apparatus, and the communication apparatus may include more or less components than those shown in fig. 2, or may combine some components, or may be arranged in different components.
In the embodiment of the application, the chip system can be composed of chips, and can also comprise chips and other discrete devices.
Further, actions, terms, and the like, which are referred to between embodiments of the present application, are not limited thereto. The message names of interactions between the devices or parameter names in the messages in the embodiments of the present application are just an example, and other names may be used in specific implementations without limitation.
In connection with the communication system shown in fig. 1, the terminal device 101 may establish a connection with other apparatuses (such as other terminal devices) through the route forwarding device 102, the core network device 103, and the like using a communication protocol. The communication protocol may be a TCP protocol or a user datagram protocol (user datagram protocol, UDP). In the following embodiments, a technical solution of the embodiments of the present application is described by taking a communication protocol as a TCP protocol as an example.
In general, when the terminal device 101 establishes a TCP connection with other apparatuses, a device that actively initiates the TCP connection establishment may be referred to as a TCP client (client) end, and a device that passively waits for the TCP connection establishment may be referred to as a TCP service (server) end. Illustratively, the TCP client and the TCP server may establish a TCP connection through a three-way handshake.
Fig. 3 shows a schematic diagram of a TCP connection being established by a three-way handshake, as shown in fig. 3, the handshake flow for establishing a TCP connection comprising the following steps.
Step 301, the TCP client sends a TCP connection request packet to the TCP server. The TCP connection request message may be a first handshake message for establishing a TCP connection.
The SYN flag bit in the header of the TCP connection request packet is set to 1 (i.e., syn=1). Syn=1 indicates that the message is used to establish a TCP connection. The sequence number in the header of the TCP connection request message is set to an initial value x (i.e., sequence number=x), which is randomly generated by the TCP client as the initial sequence number selected by the TCP client.
Step 302, after receiving the TCP connection request message, if the TCP server agrees to establish a connection, the TCP server sends a TCP connection request acknowledgement message to the TCP client. The TCP connection request acknowledgement message may be a second handshake message for establishing a TCP connection.
Wherein, the SYN flag bit and the ACK flag bit in the header of the TCP connection request acknowledgement message are both set to 1 (i.e. syn=1, ack=1). Syn=1 indicates that the message is used to establish a TCP connection, and ack=1 indicates that the TCP connection request message sent by the TCP client in step 301 is acknowledged. The sequence number in the header of the TCP connection request acknowledgement message is set to an initial value y (i.e., sequence number=y), which is randomly generated by the TCP server as the initial sequence number selected by the TCP server. The acknowledgement number in the TCP connection request acknowledgement message header is set to x+1 (i.e., acknowledgement number = x+1), indicating an acknowledgement of the initial sequence number selected by the TCP client.
After receiving the TCP connection request acknowledgement message (i.e., the second handshake message), the TCP client may enter a connection established (established) state.
Step 303, after receiving the TCP connection request acknowledgement message, the TCP client may further send a TCP acknowledgement message to the TCP server. The TCP acknowledgement message may be a third handshake message for establishing a TCP connection.
Wherein the ACK flag bit in the header of the TCP acknowledgement message is set to 1 (i.e., ack=1), indicating that this is a TCP acknowledgement message. The sequence number in the TCP acknowledgement header is set to x+1 (i.e., sequence number = x+1). This is because the sequence number of the last TCP message (i.e., TCP connection request message) sent by the TCP client is x, and thus the sequence number of the TCP acknowledgement message is x+1 (i.e., sequence number=x+1). The acknowledgement number in the TCP acknowledgement packet header is set to y+1 (i.e., acknowledgement number=y+1), which is an acknowledgement of the initial sequence number selected by the TCP server process.
The TCP server also enters a connection established state after receiving a TCP acknowledgement message (third handshake message).
Optionally, in the above handshake process, the TCP client mainly completes the task that the TCP client reports the sending capability to the TCP server, and the TCP client confirms the receiving capability of the TCP server. In the above handshake process, the TCP server mainly completes the work that the TCP server reports the sending capability to the TCP client, and the TCP server confirms the receiving capability of the TCP client. After both parties acknowledge the sending capability and the receiving capability to each other, the TCP client and the TCP server may negotiate to determine the maximum amount of data to be transmitted by the TCP client and the TCP server.
Based on the handshake procedure shown in fig. 3, both the TCP client and the TCP server enter a connection established state, and after the TCP client and the TCP server negotiate to determine the maximum data amount to be transmitted, data stream transmission can be performed based on the established TCP connection.
Fig. 4 is a schematic diagram of communication between a TCP client and a TCP server according to an embodiment of the present application. By way of example, as shown in FIG. 4, the process of communication between a TCP client and a TCP server may include a three-way handshake process, a TCP data transfer process, and a four-way waving process. The TCP data transmission process in fig. 4 is a process of normally transmitting data.
In conjunction with fig. 4, the TCP data transmission process and the four-time waving process are illustrated herein, and the three-time handshake process may be illustrated by referring to the above embodiments, which are not repeated herein.
Taking a TCP client as a transmitting end and a TCP server as a receiving end as an example, after the TCP client and the TCP server enter a connection established state, the TCP client and the TCP server can transmit data. For example, the TCP client may send a first set of data to the TCP server. After the TCP server receives the first data sent by the TCP client, the TCP server returns an acknowledgement (i.e., ACK) to the TCP client, indicating that the second data is expected to be received. For example, as shown in fig. 4, the TCP client sends a TCP packet 1 to the TCP server, where the TCP packet 1 carries data corresponding to a sequence number (e.g., seq=1), and seq=1 represents data with a sequence number of 1. When the TCP server receives the data corresponding to seq=1, the TCP server returns a TCP acknowledgement message to the TCP client, where the TCP acknowledgement message carries an acknowledgement (e.g., ack=2), and ack=2 indicates that the second data is expected to be received.
Correspondingly, after receiving the TCP acknowledgement message, the TCP client sends a TCP message 2 to the TCP server, where the TCP message 2 carries data corresponding to the sequence number (e.g., seq=2), and seq=2 represents the data with the sequence number of 2. When the TCP server receives the data corresponding to seq=2, the TCP server returns a TCP acknowledgement message to the TCP client, where the TCP acknowledgement message carries an acknowledgement (e.g., ack=3), and ack=3 indicates that the third data is expected to be received. And so on, as shown in fig. 4, until the TCP client finishes sending all data, such as the sixth data (seq=6), and seq=6 indicates the data with sequence number 6.
It will be appreciated that after the TCP client and the TCP server establish a TCP connection through a three-way handshake procedure, the TCP client and the TCP server negotiate to determine the maximum amount of data for this transmission. For example, the maximum data amount of the transmission is negotiated by the TCP client and the TCP server to be 6, so after the TCP client sends the sixth data to the TCP server, the data transmission is finished. And then, the TCP client and the TCP server disconnect the TCP connection through four waving processes.
For example, as shown in FIG. 4, the four hand waving process may include the TCP client sending a disconnect TCP connection request message to the TCP server. For example, the FIN field in the request for disconnection message is set to 1 (which may be denoted as fin=1), indicating that the TCP connection needs to be disconnected. The seq field in the disconnect TCP request message is set to x (which may be denoted as seq=x), which is randomly generated by the TCP client.
The TCP server may reply to the TCP disconnect request message sent by the TCP client. For example, FIN field in the message is set to 1 (which may be denoted as fin=1) to indicate that the TCP connection needs to be disconnected, ACK field in the message is set to x+1 (which may be denoted as ack=x+1) to indicate that the TCP connection disconnection request sent by the TCP client has been verified, and seq field in the message is set to y (which may be denoted as seq=y) which is randomly generated by the TCP server.
After the TCP server replies the TCP disconnection request message sent by the TCP client, the TCP server cannot disconnect TCP immediately, and the TCP server can confirm whether the data to be transmitted is transmitted or not, so as to ensure that the data transmission is completed before disconnection. After confirming that the data to be transmitted is transmitted, the TCP server sends a TCP disconnection request message to the TCP client. For example, the FIN field in the TCP disconnect request message is set to 1 (which may be denoted as fin=1), indicating that the TCP connection needs to be disconnected. The ACK field in the TCP disconnect request message is set to y+1 (may be denoted as ack=y+1) to indicate that the disconnected TCP connection request sent by the TCP client has been authenticated, and the seq field in the TCP disconnect request message is set to z (may be denoted as seq=z) which is randomly generated by the TCP client.
After receiving the TCP disconnection request message sent by the TCP server, the TCP client can reply to the TCP disconnection request message sent by the TCP server. For example, FIN field in the message is set to 1 (which may be denoted as fin=1) to indicate that the TCP connection needs to be disconnected, ACK field in the message is set to z+1 (which may be denoted as ack=z+1) to indicate that the TCP connection disconnection request sent by the TCP client has been verified, and seq field in the message is set to h (which may be denoted as seq=h) which is randomly generated by the TCP server. So far, four waving processes of the TCP client and the TCP server are completed, and the TCP client and the TCP server disconnect the TCP connection.
Based on the embodiments shown in fig. 3 and 4, it can be understood that the SYN flag is a message field for identifying three hand swings, and the FIN flag is a message field for identifying four hand swings.
Fig. 5 is a schematic diagram of communication between another TCP client and a TCP server according to an embodiment of the present application. By way of example, as shown in FIG. 5, the process of communication between a TCP client and a TCP server may include a three-way handshake process, a TCP data transfer process, and a four-way waving process. The TCP data transmission process in fig. 5 includes a retransmission mechanism.
In conjunction with fig. 5, the TCP data transmission process (including the retransmission mechanism) is illustrated herein, and the above-described embodiments may be referred to for the three-way handshake process and the four-way waving process, which are not described herein.
The retransmission mechanism may include, among others, timeout retransmission, fast retransmission, selective acknowledgement (SELECTIVE ACKNOWLEDGMENT, SACK), etc. The timeout retransmission refers to setting a timer when the sending end sends a message, and when the duration of the timer exceeds the timeout retransmission time (retransmission timeout, RTO), if the sending end does not receive an Acknowledgement (ACK) of the receiving end, retransmitting the data by the sending end. In general, the retransmission is performed over time when data is lost and acknowledgement is lost.
Fast retransmission refers to retransmitting a lost message when the sender receives three identical ACKs. The SACK means that the header of the TCP message sent by the receiving end comprises a SACK flag bit, and the lost data can be determined after the sending end receives the TCP message comprising the SACK flag bit, so that the lost data is retransmitted. It should be noted that fig. 5 illustrates a TCP data transmission process by taking a retransmission mechanism as a timeout retransmission as an example.
Still take a TCP client as a transmitting end and a TCP server as a receiving end as an example. For example, as shown in fig. 5, after the TCP client sends a message to the TCP server (for example, send message 1, where the seq field in the message 1 is set to 1 and indicates data with sequence number 1), when the duration of the timer exceeds RTO, if the TCP client does not receive an acknowledgement from the TCP server (where the ACK field in the acknowledgement is set to 2 and indicates that the second data is expected to be received), the TCP client retransmits the message 1.
Wherein, TCP can occur timeout retransmission in case of packet loss or acknowledgement loss. For example, in the case of a packet loss, as shown in fig. 5, a packet 1 (the seq field in the packet 1 is set to 1 and may be expressed as seq=1) sent by the TCP client to the TCP server is lost, that is, the TCP server does not receive the packet 1, so the TCP server does not return an acknowledgement to the TCP client. Then, when the duration of the timer exceeds RTO, if the TCP client does not receive the acknowledgement of the TCP server, the TCP client retransmits the message 1. After the TCP server receives the message 1, the TCP server returns an acknowledgement to the TCP client. The ACK field in the acknowledgement is set to 2 indicating that the second data is expected to be received.
Also for example, in the case that the acknowledgement is lost, as shown in fig. 5, the TCP client sends a message 1 to the TCP server, and after receiving the message 1, the TCP server returns an acknowledgement to the TCP client. As shown in fig. 5, the acknowledgement returned by the TCP server to the TCP client is lost, i.e., the TCP client does not receive the acknowledgement. Thus, when the duration of the timer exceeds RTO, if the TCP client does not receive the acknowledgement of the TCP server, the TCP client retransmits the message 1. After the TCP server receives the message 1, the TCP server returns an acknowledgement to the TCP client. The ACK field in the acknowledgement is set to 2 indicating that the second data is expected to be received.
The above embodiments mainly describe the procedure from the establishment of a TCP connection to the disconnection of the TCP connection by the TCP client and the TCP server. The TCP client and the TCP server mainly establish TCP connection, transmit data and disconnect TCP connection by transmitting TCP messages. In addition, in the related art, the TCP client is used as a transmitting end, and the TCP server is used as a receiving end to transmit the TCP message, and the TCP message is realized through a router, that is, the router is used as an intermediate forwarding device and is mainly used for forwarding the TCP message transmitted between the TCP client and the TCP server.
Wherein, a plurality of TCP packets transmitted through the same port may be referred to as one data stream. That is, the router may forward the data stream transmitted between the TCP client and the TCP server. Based on the above, in the embodiment of the application, the bandwidth of the current transmission data stream can be predicted by the router, so that the current network condition, that is, the actual use condition of the network can be reflected more accurately.
In addition, since the router in the related art is used as an intermediate forwarding device and has the function of forwarding the TCP packet, the bandwidth when the data stream is currently transmitted can be predicted by the router, and the bandwidth when the data stream is currently transmitted can be predicted without affecting the network performances of the TCP client and the TCP server.
The following embodiments illustrate specific implementations of routers predicting bandwidth when currently transmitting data streams.
Illustratively, in the operating system kernel (Linux) scenario, the router transmits TCP packets at a protocol layer (e.g., network layer, link layer, physical layer, forwarding layer, transport layer). Fig. 6 provides a schematic structural diagram of netfilter framework of the router in Linux scenario. The IP protocol stack of Linux is a four-layer or more protocol stack (also referred to as a top-layer protocol stack). As shown in fig. 6, six key hook points (which may also be referred to as detection points, key points, or hook points) are included in the netfilter framework, including a pre-routing node (pre-routing), a routing decision node (forward), a post-routing node (post-routing), an ingress node (local_in), and an egress node (local_out). The pre-route processing node mainly processes destination address conversion and adds specific marks to each TCP message in the data stream. The routing decision node is used for deciding whether the data flow is forwarded or not. The route post-processing node is mainly used for completing source address conversion.
Illustratively, each TCP packet in the data stream forwarded by the router passes through three hook points, namely a pre-route processing node, a key node and a post-route processing node. In the embodiment of the application, the hook interface can be registered in the key node. Alternatively, the hook interface may be expressed as an atp_static_ netband _process.
Illustratively, as shown in fig. 6, each TCP packet in the data stream arrives at the routing decision node after passing through the preprocessing node. If the routing decision node decides that each TCP message in the data stream is forwarding, calling a hook interface at a key node to identify the message length of each TCP message in the data stream, the serial number of each TCP message in the data stream and the flag bit of each TCP message in the data stream for each TCP message in the data stream to be forwarded.
The method comprises the steps of identifying the message length of each TCP message in a data stream, and determining the data quantity of the data stream transmitted in unit time so as to predict the bandwidth. And identifying the sequence number of each TCP message in the data stream, and determining whether retransmission data exists. And identifying the flag bit of each TCP message in the data stream, and determining whether the transmission of the data stream is finished.
Illustratively, a full length (total length) field in a TCP message includes a message length. Taking packet grabbing by network packet analysis software (wireshark) as an example, the full-length field is _be16 tot_len, which indicates that the message length is 16 bits.
For another example, the protocol field of each TCP packet in the data stream includes a protocol type. For example, the protocol field is protocol: TCP (6), and the protocol type corresponding to the data stream is TCP protocol.
As another example, a header field (or referred to as a head field) included in the TCP message includes a sequence number, and a flag bit. For example, the header field includes sequence number 4342 (relative sequence number) and the sequence number 4342 indicating the TCP message. For example, the header field includes fin=1, indicating that the data stream has been transmitted.
As an example, the router may look up the message length, sequence number, flag bit, etc. of each TCP message in the data stream in a stored Hash (Hash) table based on the five-tuple information. Optionally, when forwarding the data stream, the router may parse out the IP information of each TCP packet in the data stream, and convert the IP information into quintuple information.
The five-tuple information includes a source IP address, a destination IP address, a source port number, a destination port number, and a protocol type (such as TCP protocol, UDP protocol, etc.). The Hash table includes the corresponding relation between the five-tuple information of the data stream and the data information (i.e. the message length, the sequence number, the flag bit, etc. of each TCP message in the data stream). It should be noted that the five-tuple information of the data stream is unique, that is, the data stream and the five-tuple information are in one-to-one correspondence.
In some embodiments, the router may store five-tuple information and data information of the data stream in the form of key-value in a Hash table, where the five-tuple information may be considered a key and the data information may be considered a value. After the information is stored in the Hash table, the router has the information required for predicting the bandwidth.
In some embodiments, after the router obtains the quintuple information corresponding to the data stream, the router may use the quintuple information as a key to search the Hash table for the corresponding data information. If the router does not find the corresponding data information in the Hash table, the router identifies the data information corresponding to the data flow, stores the identified data information in the Hash table, and predicts the bandwidth based on the data information. If the router searches the corresponding data information in the Hash table, the router acquires the data information and predicts the bandwidth based on the data information.
In connection with the foregoing embodiments, a description will be given of a bandwidth prediction method provided by an embodiment of the present application with reference to fig. 7 below, where a route forwarding device may be a router, a three-layer switch, or the like. The route forwarding device may be provided with the components shown in fig. 2. The processing performed by a single execution body (route forwarding device) shown in the embodiments of the present application may also be divided into execution by a plurality of execution bodies, which may be logically and/or physically separated, without limitation.
Fig. 7 is a flowchart of a bandwidth prediction method according to an embodiment of the present application, where, as shown in fig. 7, the method may include the following steps.
In step 401, the route forwarding device transmits N data streams in a first period, where N is a positive integer.
The first period may be preset by the routing forwarding device, and is not specifically limited, and is set in practice. By way of example, the first period may be 5s, 10s, or other suitable period.
In connection with the communication system shown in fig. 1, the route forwarding device may establish communication connection with a plurality of terminal devices (such as a mobile phone, a tablet computer, a notebook computer, etc.). For example, the N data flows may be data flows sent by a plurality of terminal devices forwarded by the route forwarding device in the first period, or forwarded data flows received by a plurality of terminal devices. Or the N data streams may also be data streams sent by one terminal device forwarded by the route forwarding device in the first period, or forwarded data streams received by one terminal device.
Wherein, each data flow in the N data flows corresponds to the messages of different ports. That is, the ports of the TCP messages in one data stream are the same (e.g., the source port number is the same, the destination port number is the same), and the protocol types are the same (e.g., all TCP protocols).
Step 402, for each data stream in the N data streams, the routing forwarding device obtains message lengths of a plurality of messages included in the data stream, and determines a first bandwidth corresponding to the data stream according to the message lengths.
Where bandwidth refers to the rate of data transmission per unit time (in bits per second (bps)), bandwidth may be determined by the ratio of traffic to time. And traffic refers to the amount of data (i.e., the data length) transmitted per unit time. Thus, in the embodiment of the present application, the data amount of the transmitted data stream may be determined based on the message length (i.e. the traffic is determined), and then the first bandwidth is determined based on the traffic.
The routing forwarding device first determines the data amount (i.e., determines the traffic) of the data stream transmitted in the first period according to the message length of the data stream including the plurality of messages, and then uses the ratio of the traffic to the first period as the first bandwidth.
It should be noted that, if the data stream does not include the retransmission packet, the routing forwarding device may use the determined ratio of the flow to the first period as the first bandwidth. If the data stream includes retransmission messages, the influence of retransmission on bandwidth needs to be considered.
Illustratively, as shown in fig. 8, it is assumed that one data stream transmitted by the routing forwarding device in the first period includes a plurality of messages as shown in fig. 8. On the basis, the routing forwarding device can determine the first bandwidth based on a preset timeout retransmission interval, a retransmission message transmitted in the sampling timeout retransmission interval and a normal message transmitted outside the timeout retransmission interval.
Wherein the timeout retransmission interval may be set based on the duration of the retransmission timer. Illustratively, the time-out retransmission interval is an integer multiple of the retransmission timer duration (or weight-out time RTO). For example, the time out retransmission interval is not limited to two, three, four, or the like times the retransmission timer duration.
It will be appreciated that TCP monitors the lost state of a message by setting a retransmission timer when sending a message. If the retransmission timer is overtime, the sender does not receive the acknowledgement, and the sender retransmits the message. Based on this, in the embodiment of the present application, the timeout retransmission interval is set based on the duration of the retransmission timer, so that the retransmission packet can be sampled to the greatest possible extent within the timeout retransmission interval.
Illustratively, as shown in fig. 8, the timeout retransmission interval preset by the router is T 2 (or referred to as the second duration), and then the remaining time interval in the first period is T-T 2 (or referred to as the first duration, denoted as T 1). Wherein T represents the first period.
Illustratively, as shown in fig. 8, during the first period T, the data stream transmitted by the route forwarding device includes a plurality of packets. For example, in the first time period t 1, the routing forwarding device transmits n messages, such as message seq1, message seq2, message seq3, and message seqn, where the message lengths are L1, L2, L3, and Ln.
The routing forwarding device transmits a message seq (n+1), a message seq (n+2), a message seq (a), a message seq (b), a message seq (m), a message seq (2 n) within a second time period t 2, wherein the message lengths are Ln+1, ln+2, la, lb, ln, lm, and L2n respectively.
It should be noted that, the retransmission message transmitted in the second duration may be a retransmission message of a part of the n messages (the message seq1, the message seq2, the message seq3, the message seqn), or may be a retransmission message of all the n messages, or may not be a retransmission message of the n messages, for example, a retransmission message of other messages. And are not limited.
Based on the data flow shown in fig. 8, the routing forwarding device may determine the data amount of the normal packet transmitted in the first time period, and determine the data amount of the retransmission packet transmitted in the second time period. And then, the route forwarding device determines the first bandwidth according to the data volume of the normal message transmitted in the first time period, the data volume of the retransmission message transmitted in the second time period, the data volumes of all messages transmitted in the second time period, and the first time period and the second time period.
It should be noted that, in the embodiment of the present application, a normal message refers to a message that is sent once by the sending end and is successfully sent.
Alternatively, the first bandwidth may satisfy the following expression:
wherein Bi represents a first bandwidth, Representing the data volume of the normal message transmitted during the first time period,Representing the data quantity of the retransmission message transmitted in the second time period; The data amount of all the messages transmitted in the second time period is represented by t 1, the first time period is represented by t 2, and the second time period is represented by t.
In the above expression, the first bandwidth is the ratio of the data volume of the normal packet transmitted to the time in the first period. The time is related to the time of the normal message transmitted in the first time period and the proportion of the retransmission message transmitted in the second time period. Therefore, when the expression is adopted to determine the bandwidth, the proportion of the retransmission messages transmitted in the first period is taken into consideration, so that the determined first bandwidth is more accurate.
It should be noted that, in actual implementation, the message transmitted in the first duration may not include a retransmission message, or may also include a part of retransmission messages, or all of retransmission messages. Correspondingly, the message transmitted in the second time period may not include the retransmission message, or may also include a part of the retransmission message, or all of the retransmission message. The first bandwidths determined using the above expression will also be different based on the different cases. The various cases of determining the first bandwidth using the above expression are illustrated below.
In the first case, the message transmitted in the first time period does not include a retransmission message, and the message transmitted in the second time period includes a partial retransmission message.
By way of example, in connection with fig. 8 and the above expression, n first messages are normally transmitted in a first duration, and b messages are normally transmitted in a second duration, including a retransmission messages. Then, the first bandwidth is the ratio of the data volume of the first message transmitted in the first duration to the sum of the time of the retransmission message transmitted in the second duration and the first duration.
And in the second case, all the messages transmitted in the first time period are retransmission messages, and all the messages transmitted in the second time period are retransmission messages. Thus, in combination with the above expression, due toThe data amount of the first message which is normally transmitted in the first time period is represented, so that when the messages transmitted in the first time period are all retransmission messages,If the value of the first bandwidth is 0, which indicates that the current network of the route forwarding device is abnormal, and the terminal device does not send the data stream through the route forwarding device, i.e. does not generate traffic.
And in the third case, the message transmitted in the first time period comprises a part of retransmission message, and the message transmitted in the second time period does not comprise retransmission message. And when the actual determination is carried out, the routing forwarding equipment adopts the message normally transmitted in the first time length, and ignores the retransmission message transmitted in the first time length. In this way,The value of (2) is 0, and the first bandwidth is the ratio of the data volume of the message normally transmitted in the first time period to the first time period.
It should be noted that, in the step 402, a data stream is taken as an example, the specific implementation process of determining the first bandwidth is exemplarily described, and the specific implementation process of the first bandwidth corresponding to other data streams may refer to the above embodiment, which is not described herein in detail.
Step 403, the routing forwarding device determines, based on the first bandwidths corresponding to each data stream, a first bandwidth sum when N data streams are transmitted in the first period.
Illustratively, the first bandwidth sum satisfies the following expression:
where Bt 1 represents the first bandwidth sum and Bi represents the first bandwidth corresponding to each data stream.
And 404, the route forwarding device determines a target bandwidth according to at least the first bandwidth sum, wherein the target bandwidth is the maximum bandwidth when N data streams are transmitted.
Optionally, the route forwarding device takes the first bandwidth sum as the target bandwidth. For example, target bandwidth b=bt 1. The first bandwidth sum is used as the target bandwidth, namely the maximum bandwidth when N data streams are transmitted, and the first bandwidth sum is determined in real time in the embodiment of the application, namely the currently determined first bandwidth sum is the latest bandwidth of the current route forwarding equipment, so that the current network condition can be more accurately reflected, namely the actual use condition of the current network is reflected by using the first bandwidth sum as the target bandwidth.
Optionally, the route forwarding device may also use the sum of the first bandwidths determined in the previous period as the target bandwidth. Or the route forwarding device may also take the sum of the first bandwidths determined in the next period as the target bandwidth. Or the route forwarding device takes the average value of the first bandwidth sum of two adjacent periods as a target bandwidth.
In summary, with the scheme of the embodiment of the present application, when the routing forwarding device transmits N data streams in the first period, since the routing forwarding device determines, for each data stream in the N data streams, a first bandwidth corresponding to each data stream, thereby determining a first bandwidth sum when the N data streams are transmitted in the first period, and determining a maximum bandwidth when the routing forwarding device transmits the N data streams according to the first bandwidth sum. Therefore, the maximum bandwidth when the data stream is transmitted currently is predicted by the route forwarding device, so that the current network condition can be reflected more accurately, namely, the actual use condition of the network can be reflected.
As an example, over time, the route forwarding device may also determine the sum of bandwidths at which all data streams are transmitted in the next period and update the target bandwidth. That is, the route forwarding device may periodically determine the bandwidth sum of all data streams transmitted during the period and update the target bandwidth in real time. Illustratively, as shown in FIG. 9, the method may further comprise the steps of:
in step 501, the routing forwarding device transmits M data streams in the second period, where M is a positive integer.
Step 502, for each data stream in the M data streams, the routing forwarding device obtains message lengths of a plurality of messages included in the data stream, and determines a second bandwidth corresponding to the data stream according to the message lengths.
In step 503, the routing forwarding device determines a second bandwidth sum of M data streams transmitted in the second period based on the second bandwidth corresponding to each data stream.
For the illustration of step 501 to step 503, reference may be made to step 401 to step 403 in the above embodiments, which will not be described in detail here.
Step 504, the route forwarding device determines a target bandwidth according to the first bandwidth sum and the second bandwidth sum.
In the embodiment of the application, the routing forwarding equipment can periodically predict the bandwidth of the current transmission data stream, so that the condition of the current network, namely the actual use condition of the network, can be reflected more accurately through the periodically predicted bandwidth.
The second bandwidth sum may be denoted as Bt 2. Optionally, if the second bandwidth sum is greater than the first bandwidth sum, the routing forwarding device updates the second bandwidth sum to the target bandwidth. That is, if Bt 2>Bt1, b=bt 2 is updated.
Optionally, if the second bandwidth sum is smaller than the first bandwidth sum and the bandwidth increase ratio is greater than the retransmission ratio, the routing forwarding device updates the target bandwidth to the second bandwidth sum. That is, if Bt 2<Bt1 and Δb > Rt, then b=bt 2 is updated. Wherein the bandwidth increase ratio Δb is used to indicate the bandwidth increase ratio of the second period compared with the first period, and the retransmission ratio Rt is used to indicate the ratio of occurrence of retransmission in the first period.
Optionally, if the second bandwidth sum is smaller than the first bandwidth sum and the bandwidth increase ratio is smaller than the retransmission ratio, the target bandwidth is reserved as the first bandwidth sum. That is, if Bt 2<Bt1, and Δb < Rt, b=bt 1 remains.
Illustratively, the bandwidth increase ratio satisfies the expression Δb= (Bt 1-Bt2)/Bt2; where Δb represents the bandwidth increase ratio, bt 2 represents the second bandwidth sum, and Bt 1 represents the first bandwidth sum.
Illustratively, the retransmission ratio satisfies the following expression: wherein Rt represents a retransmission ratio, Representing the amount of data in the first period of transmission of the retransmission message,Representing the amount of data that is transmitted for all messages in the first period.
In the embodiment of the present application, if Δb > Rt, it is stated that the bandwidth increase rate is larger than the retransmission ratio, so that it can be considered that in the case of the retransmission mechanism, the retransmission is less vulnerable to bandwidth increase than the bandwidth increase, and thus the maximum bandwidth B is updated to the second bandwidth and Bt 2, i.e., b=bt 2. Accordingly, if Δb < Rt, it indicates that the retransmission ratio is larger than the bandwidth increase ratio, so that it can be considered that in the case of the retransmission scheme, retransmission is strongly vulnerable to bandwidth, and the retransmission is considered to be vulnerable to bandwidth, so that the maximum bandwidth B is reserved as the first bandwidth and Bt 1, i.e., b=bt 1.
Based on this, considering the influence of retransmission on bandwidth, in the embodiment of the application, the routing forwarding device periodically determines the sum of bandwidths of all data streams transmitted in each period, dynamically adjusts the target bandwidth based on the bandwidth increasing ratio and the retransmission ratio, so that the predicted maximum bandwidth when the data stream is currently transmitted is more accurate, and further the current network condition, that is, the actual use condition of the network, can be reflected more accurately.
In some embodiments, the method may further include displaying the target bandwidth by the routing forwarding device, or sending, by the routing forwarding device, indication information to the terminal device, where the indication information includes the target bandwidth, and the indication information is used to instruct the terminal device to display the target bandwidth.
In this embodiment, the route forwarding device displays the target bandwidth, or the terminal device displays the target bandwidth, so that the user can more accurately measure the network condition, and confirm whether the bandwidth is overloaded or whether the bandwidth package purchased by the user meets the actual requirement. Further, for the problem of slow network speed caused by network congestion possibly caused by home environments (such as excessive number of terminal devices accessing a communication network through a route forwarding device, etc.), the target bandwidth is displayed through the route forwarding device, or the target bandwidth is displayed by the terminal device, so that a user can conveniently confirm whether the target bandwidth is caused by too small bandwidth or too limited bandwidth, the user can conveniently perform fault elimination, and the user experience is improved.
In some embodiments, the method may further include the route forwarding device allocating the target bandwidth to the terminal device based on an application scenario of the terminal device.
Optionally, the route forwarding device may obtain a media access address (MEDIA ACCESS control address, MAC) of the terminal device, and determine an application scenario of the terminal device according to the media access address of the terminal device. Optionally, the route forwarding device may further allocate a corresponding bandwidth to the terminal device based on the internet protocol address (inter protocol address, IP) corresponding to the terminal device.
The routing forwarding device allocates a first target bandwidth to the terminal device if the application scenario of the terminal device is a first application scenario, and allocates a second target bandwidth to the terminal device if the application scenario of the terminal device is a second application scenario, wherein the bandwidth required by the first application scenario is greater than the bandwidth required by the second application scenario, and the first target bandwidth is greater than the second target bandwidth.
Assuming that the target bandwidth is 10bps, for example, if the application scenario of the terminal device is a game scenario, the route forwarding device allocates a first target bandwidth (for example, 8 bps) to the terminal device. If the application scene of the terminal device is a video scene, the route forwarding device allocates a second target bandwidth (for example, 2 bps) to the terminal device.
In this embodiment, the routing forwarding device allocates different bandwidths to the terminal devices in different application scenarios based on the predicted target bandwidths, so that the network rate of the terminal devices in the application scenarios can be improved, and the user experience is improved.
The content described in each embodiment of the present application can explain and describe the technical solutions in other embodiments of the present application, and the technical features described in each embodiment can also be applied in other embodiments, and form new solutions in combination with the technical features in other embodiments, and the present application is only described by way of example and not by way of limitation.
The embodiment of the application also provides a communication device which comprises a processor and is used for realizing the method in any method embodiment.
Optionally, the communication device further comprises a memory. The memory is used to hold the necessary program instructions and data, and the processor may invoke the program code and instructions stored in the memory to cause the communication device to perform the method of any of the method embodiments described above. Of course, the memory may not be in the communication device.
Optionally, the communication device further comprises an interface circuit, which is a code/data read/write circuit, for receiving the determiner execution instructions (the determiner execution instructions being stored in a memory, possibly read directly from the memory, or possibly via other means) and transmitting to the processor.
Optionally, the communication device further comprises a communication interface for communicating with a module external to the communication device.
It will be appreciated that the communication device may be a chip or a chip system, and when the communication device is a chip system, the communication device may be formed by a chip, or may include a chip and other discrete devices, which is not specifically limited in the embodiments of the present application.
The embodiment of the application also provides route forwarding equipment, which comprises a memory and one or more processors. The processor executes the determiner instructions of the memory to cause the route forwarding device to perform the functions or steps performed by the station device.
The embodiment of the application also provides a chip system which is applied to the communication device. As shown in fig. 10, the chip system 1100 includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 may be the processor 201 shown in fig. 2 in the above embodiment. The interface circuit 1102 may be, for example, an interface circuit between the processor 1101 and other devices, such as the transceiver 102.
The processor 1101 and interface circuit 1102 may be interconnected by wires. For example, the interface circuit 1102 may be used to receive signals from other devices (e.g., the processor 1101). For another example, the interface circuit 1102 may be used to send signals to other devices (e.g., the processor 1101). The interface circuit 1102 may, for example, read instructions stored in a memory and send the instructions to the processor 1101. The instructions, when executed by the processor 1101, may cause the station apparatus to perform the various functions or steps performed by the station apparatus in the above embodiments. Of course, the system-on-chip may also include other discrete devices, which are not particularly limited in accordance with embodiments of the present application.
The embodiment of the application also provides a determining machine-readable storage medium, which comprises determining machine instructions, which when run on a station device, cause the station device to perform any of the above-described method embodiments.
The embodiment of the application also provides a determining machine program product which, when run on a determining machine, causes the determining machine to perform any of the method embodiments described above.
It should be noted that the terms "first" and "second" and the like in the description, the claims and the drawings of the present application are used for distinguishing between different objects and not for describing a particular sequential order. The terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.
Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one (item)" means one or more. "plurality" means two or more. "at least two (items)" means two or three and more. And/or, for describing the association relationship of the association object, means that three relationships may exist. For example, "A and/or B" may mean that only A, only B, and both A and B are present, where A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one of a, b or c may represent a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural. ". the terms" in "and" if "are used to refer to a process that is performed under an objective condition, and are not intended to limit the time, nor are any determination made when implemented, nor are any other limitations intended.
In embodiments of the application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion that may be readily understood.
It will be apparent to those skilled in the art from this description that the above-described functional modules are merely illustrated in terms of division for convenience and brevity, and in practical applications, the above-described functional modules may be allocated to different functional modules according to the system, that is, the internal structure of the apparatus may be divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the method described in the embodiments of the present application. The storage medium includes a U disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (14)
1. The bandwidth prediction method is characterized by being applied to a route forwarding device, wherein the route forwarding device establishes communication connection with a terminal device and is used for forwarding a data stream sent by the terminal device or forwarding a data stream received by the terminal device, and the method comprises the following steps:
transmitting N data streams in a first period, wherein N is a positive integer;
For each data stream in the N data streams, acquiring message lengths of a plurality of messages included in the data streams, and determining a first bandwidth corresponding to the data streams according to the message lengths;
Determining a first bandwidth sum when the N data streams are transmitted in the first period based on the first bandwidth corresponding to each of the N data streams;
and determining a target bandwidth according to at least the first bandwidth sum, wherein the target bandwidth is the maximum bandwidth when the N data streams are transmitted.
2. The method according to claim 1, wherein the method further comprises:
Transmitting M data streams in a second period, wherein M is a positive integer;
For each data stream in the M data streams, acquiring message lengths of a plurality of messages included in the data stream, and determining a second bandwidth corresponding to the data stream according to the message lengths;
Determining a second bandwidth sum of the M data streams transmitted in the second period based on the second bandwidth corresponding to each of the M data streams;
Wherein the determining the target bandwidth at least according to the first bandwidth sum includes:
and determining the target bandwidth according to the first bandwidth sum and the second bandwidth sum.
3. The method of claim 2, wherein said determining said target bandwidth from said first bandwidth sum and said second bandwidth sum comprises:
If the second bandwidth sum is larger than the first bandwidth sum, determining that the target bandwidth is the second bandwidth sum;
Or alternatively
If the second bandwidth sum is smaller than the first bandwidth sum and the bandwidth increase ratio is larger than the retransmission ratio, determining the target bandwidth as the second bandwidth sum, wherein the bandwidth increase ratio is used for indicating the bandwidth increase ratio of the second period compared with the first period;
Or alternatively
And if the second bandwidth sum is smaller than the first bandwidth sum and the bandwidth increasing ratio is smaller than the retransmission ratio, reserving the target bandwidth as the first bandwidth sum.
4. A method according to any one of claims 1-3, wherein said determining, according to the message length, a first bandwidth corresponding to the data stream comprises:
Determining the data quantity of the data stream transmitted in a first period according to the message lengths of the messages;
and determining a first bandwidth corresponding to the data stream according to the data quantity of the data stream transmitted in the first period and the first period.
5. The method of claim 4, wherein the first period includes a first duration and a second duration that are preset, the second duration is related to a retransmission timeout RTO, the first duration is a difference between the first period and the second duration, the determining the first bandwidth corresponding to the data stream according to the data amount of the data stream transmitted in the first period and the first period includes:
Determining the data quantity of normal messages transmitted in the first time period, the data quantity of retransmission messages transmitted in the second time period and the data quantity of all messages transmitted in the second time period;
And determining a first bandwidth corresponding to the data flow according to the data quantity of the normal message transmitted in the first time period, the data quantity of the retransmission message transmitted in the second time period, the data quantity of all messages transmitted in the second time period, the first time period and the second time period.
6. The method of claim 5, wherein determining the first bandwidth corresponding to the data stream comprises:
the first bandwidth corresponding to the data stream satisfies the following expression:
Wherein Bi represents a first bandwidth corresponding to the data stream, Indicating the data quantity of the normal message transmitted in the first time period,The data volume of the retransmission message transmitted in the second duration; And the data quantity of all the messages transmitted in the second time period is represented by t 1, the first time period is represented by t 2, and the second time period is represented by t.
7. The method according to any one of claims 3 to 6, wherein,
The bandwidth increase ratio satisfies the following expression:
ΔB=(Bt2-Bt1)/Bt1;
Where Δb represents the bandwidth increase ratio, bt 2 represents the second bandwidth sum, and Bt 1 represents the first bandwidth sum.
8. The method according to any one of claims 3 to 7, wherein,
The retransmission ratio satisfies the following expression:
wherein Rt represents a retransmission ratio, Representing the data amount of the retransmission message transmitted in the first period,And the data quantity of all the messages transmitted in the first period is represented.
9. The method according to any one of claims 1-8, further comprising:
the route forwarding device displays the target bandwidth, or
The routing forwarding device sends indication information to the terminal device, wherein the indication information comprises the target bandwidth and is used for indicating the terminal device to display the target bandwidth.
10. The method according to any one of claims 1-9, further comprising:
The route forwarding device allocates the target bandwidth to the terminal device based on an application scenario of the terminal device.
11. The method of claim 10, wherein the routing forwarding device allocates the target bandwidth to the terminal device based on an application scenario of the terminal device, comprising:
If the application scene of the terminal equipment is a first application scene, the routing forwarding equipment allocates a first target bandwidth to the terminal equipment;
if the application scene of the terminal equipment is a second application scene, the routing forwarding equipment allocates a second target bandwidth to the terminal equipment;
the bandwidth required by the first application scene is larger than the bandwidth required by the second application scene, and the first target bandwidth is larger than the second target bandwidth.
12. A route forwarding device comprises a memory and one or more processors;
The memory has stored therein a determiner program code comprising determiner instructions which, when executed by the processor, cause the method of any of claims 1-11 to be performed.
13. A chip system, characterized in that the chip system comprises at least one processor and an interface;
The interface for receiving instructions and transmitting to the at least one processor, the at least one processor executing the instructions such that the method of any of claims 1-11 is performed.
14. A deterministic machine readable storage medium comprising deterministic machine instructions which, when run on a route forwarding device, cause a method according to any of claims 1-11 to be performed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311345868.0A CN119892659A (en) | 2023-10-16 | 2023-10-16 | Bandwidth prediction method and route forwarding equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311345868.0A CN119892659A (en) | 2023-10-16 | 2023-10-16 | Bandwidth prediction method and route forwarding equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN119892659A true CN119892659A (en) | 2025-04-25 |
Family
ID=95423042
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311345868.0A Pending CN119892659A (en) | 2023-10-16 | 2023-10-16 | Bandwidth prediction method and route forwarding equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN119892659A (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6493316B1 (en) * | 1998-09-30 | 2002-12-10 | Nortel Networks Limited | Apparatus for and method of managing bandwidth for a packet based connection |
| US20100150171A1 (en) * | 2008-12-11 | 2010-06-17 | Skype Limited | Controlling packet transmission |
| KR20110016749A (en) * | 2009-08-12 | 2011-02-18 | 주식회사 케이티 | Multi-link data distribution / central device for bandwidth expansion in multi-access wireless network |
| US20220109717A1 (en) * | 2019-03-15 | 2022-04-07 | Koninklijke Kpn N.V. | Facilitating real-time transport of data streams |
| WO2023158863A1 (en) * | 2022-02-18 | 2023-08-24 | Vonage Business Inc. | Method and apparatus for rate control of single quality media streams in selective forwarding units |
-
2023
- 2023-10-16 CN CN202311345868.0A patent/CN119892659A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6493316B1 (en) * | 1998-09-30 | 2002-12-10 | Nortel Networks Limited | Apparatus for and method of managing bandwidth for a packet based connection |
| US20100150171A1 (en) * | 2008-12-11 | 2010-06-17 | Skype Limited | Controlling packet transmission |
| KR20110016749A (en) * | 2009-08-12 | 2011-02-18 | 주식회사 케이티 | Multi-link data distribution / central device for bandwidth expansion in multi-access wireless network |
| US20220109717A1 (en) * | 2019-03-15 | 2022-04-07 | Koninklijke Kpn N.V. | Facilitating real-time transport of data streams |
| WO2023158863A1 (en) * | 2022-02-18 | 2023-08-24 | Vonage Business Inc. | Method and apparatus for rate control of single quality media streams in selective forwarding units |
| CA3244333A1 (en) * | 2022-02-18 | 2023-08-24 | Vonage Business Inc. | Method and apparatus for rate control of single quality media streams in selective forwarding units |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR101021566B1 (en) | Mechanisms to provide quality of service to the network using priority and reserved bandwidth protocols | |
| CN108881008B (en) | A method, device and system for data transmission | |
| US8943206B2 (en) | Network bandwidth detection and distribution | |
| JP4000331B2 (en) | Network port mapping system | |
| CN111866956B (en) | A data transmission method and corresponding equipment | |
| CN106953797B (en) | A method and device for RDMA data transmission based on dynamic connection | |
| US8953631B2 (en) | Interruption, at least in part, of frame transmission | |
| EP2661029B1 (en) | Avoiding Delayed Data | |
| WO2018090666A1 (en) | Multipath data transmission method and device | |
| EP3100420A2 (en) | Buffer sizing for multi-hop networks | |
| WO2006023361A2 (en) | Method for providing rapid delayed frame acknowledgement in a wireless transceiver | |
| CN112822120B (en) | Method, device and system for realizing congestion control | |
| CN111131017B (en) | A kind of MPTCP cross-layer optimization method and system based on multi-cellular wireless access gateway | |
| CN113950099B (en) | A network congestion control method and device | |
| Halepoto et al. | Management of buffer space for the concurrent multipath transfer over dissimilar paths | |
| CN119892659A (en) | Bandwidth prediction method and route forwarding equipment | |
| JP5662779B2 (en) | Communication system and node device | |
| Kumar et al. | Device‐centric data reordering and buffer management for mobile Internet using Multipath Transmission Control Protocol | |
| JP2006519544A (en) | Method and system for avoiding TCP packet retransmission during mobile device handoff | |
| JP2018046404A (en) | Relay device, relay system, relay program, and relay method | |
| Mondal et al. | A reliable, multi-path, connection oriented and independent transport protocol for IoT networks | |
| US20080091841A1 (en) | Communication method, communication system, communication apparatus, and recording medium | |
| JP7482098B2 (en) | COMMUNICATIONS DEVICE AND PROGRAM FOR TRANSMITTING AND RECEIVING DATA USING MULTIPLE STREAMS | |
| CN109474693B (en) | Data transmission method and related device | |
| JP2012134907A (en) | Tcp transfer apparatus and program thereof |
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 |