CN115297064B - Elastic bandwidth regulation and control method, storage medium and terminal - Google Patents

Elastic bandwidth regulation and control method, storage medium and terminal Download PDF

Info

Publication number
CN115297064B
CN115297064B CN202211188389.8A CN202211188389A CN115297064B CN 115297064 B CN115297064 B CN 115297064B CN 202211188389 A CN202211188389 A CN 202211188389A CN 115297064 B CN115297064 B CN 115297064B
Authority
CN
China
Prior art keywords
bandwidth
address
network segment
tokens
token
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.)
Active
Application number
CN202211188389.8A
Other languages
Chinese (zh)
Other versions
CN115297064A (en
Inventor
吴梦非
杨涛
郭立
彭琮
赵品富
肖雯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Cetron Yikong Technology Co ltd
Original Assignee
Wuhan Cetron Yikong Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Cetron Yikong Technology Co ltd filed Critical Wuhan Cetron Yikong Technology Co ltd
Priority to CN202211188389.8A priority Critical patent/CN115297064B/en
Publication of CN115297064A publication Critical patent/CN115297064A/en
Application granted granted Critical
Publication of CN115297064B publication Critical patent/CN115297064B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/52Queue scheduling by attributing bandwidth to queues
    • H04L47/527Quantum based scheduling, e.g. credit or deficit based scheduling or token bank
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an elastic bandwidth regulation and control method, a storage medium and a terminal, belonging to the technical field of bandwidth control and comprising the steps of: and when the number of tokens of the current network segment is greater than zero, the number of tokens of each IP address under the current network segment is less than zero, and the number of tokens of the IP addresses ensures that the use bandwidth of the terminal equipment under the IP addresses reaches the upper limit of the preemptible bandwidth and is established, increasing the number of tokens of the IP addresses. Further comprising a step of idle bandwidth utilization: and when the number of tokens of the current network segment is less than zero, the terminal equipment with the IP address in the current network segment discards the data packet in the guaranteed bandwidth and the number of tokens of the IP address ensures that the used bandwidth of the terminal equipment with the IP address exceeds the guaranteed bandwidth and is simultaneously established, reducing the number of tokens of the IP address. The data transmission of the invention is based on whether a token is available, the whole data transmission process has no queue scheduling overhead, the consumption of the processing capacity of the system is low, and the effective flexible bandwidth regulation and control can be realized on the basis of not increasing the processing overhead of the system.

Description

Elastic bandwidth regulation and control method, storage medium and terminal
Technical Field
The present invention relates to the field of bandwidth control technologies, and in particular, to an elastic bandwidth control method, a storage medium, and a terminal.
Background
When the communication network is applied to an actual use scene, due to the limitation of network bandwidth and the preemption of bandwidth by some applications, the bandwidth occupation between terminal users is easy to be unreasonable. Some terminals occupy small bandwidth, and some terminals occupy large bandwidth, so that the bandwidth occupation between the terminals is unbalanced, and the customer experience is influenced. Especially, at present, WIF6 enters large-scale deployment, an AC (including a router function) + a thin AP (supporting WIFI 6), and a wireless terminal is connected to the AP at a higher rate and performs data transmission at higher uplink and downlink rates, so that a larger uplink and downlink data volume is formed at an internet outlet of the AC. Therefore, in the network model of AC + AP, it is necessary to provide control of uplink and downlink bandwidth occupation of the terminal. The uplink and downlink bandwidths of the terminals of the access network are controlled, namely a guarantee bandwidth is set for each terminal of the access network, so that the terminals can obtain the guarantee bandwidth at any time, meanwhile, any terminal cannot occupy the bandwidth and cannot release the bandwidth when no data flow exists, and the bandwidth among the terminals is equal. The bandwidth obtained by each terminal is elastic, the bottom line guarantee is provided, more bandwidths can be occupied, and meanwhile, the bandwidth is not reserved when no data exists.
Routers used by current household and small micro-enterprise mostly adopt linux system as operating system, and the linux system itself provides TC (traffic control) mechanism for performing bandwidth limitation on terminals and services in the network. The router developed by the linux system is used for realizing the bandwidth limitation of the terminal by using the TC mechanism provided by the linux, such as being capable of limiting the bandwidth of a single IP address, more specifically, limiting the download speed of 192.168.1.2 to 30Mbit and 60Mbit at most. The TC mechanism provided by the Linux system can also realize the speed limit of the network segment and realize the bandwidth sharing of the IP address in the network segment.
However, the TC mechanism is complex and consumes a large amount of processing power for the system. If the bandwidth of the 192.168.8.0 network segment 300Mbit is limited based on the MTK7621 mainboard, 500M downlink traffic (simulating internet data, entering from the WAN port and exiting from the LAN port) is input from the WAN port, 200M downlink traffic is discarded by the device according to the bandwidth limitation configuration, and the bandwidth of the 192.168.8.0 network segment is further limited to 300Mbit, and the CPU occupancy rate of the MTK7621 reaches 90% in the whole test process. This is because the TC mechanism is a universal mechanism designed to meet various QOS service requirements, and the basic building block has three parts: the queue specifies qdisc (queueing disc IP address line), class (class), and classifier (Classifilters).
Wherein, the queue (queuing discIP address line) is used for realizing the control of the transceiving speed of the network. The linux may buffer network packets through queues and then smooth network traffic based on user settings, while minimizing disruption to connections (e.g., TCP). It should be noted that linux does not have good enough control over the receive queue, so we generally use only the send queue, i.e. "control send and not control receive". It encapsulates the other two main TC components (classes and classifiers). If the kernel needs to send a data packet through a certain network interface, it needs to add the data packet into a queue according to qdisc (queuing rule) configured for the interface. Then, the kernel will take out the packets from the qdisc as much as possible and give them to the network adapter driver module. The queue rules include: FIFO (first in first out), RED (random early detection), SFQ (random fair queuing) and Token Bucket (Token Bucket), class Base Queuing (CBQ). A CBQ is a super queue that can contain other queues (even other CBQs); it is easy to understand that by analogy with one tree, CBQ is the trunk and can be grafted with other new branches or trunks, but also can directly grow the leaves (final rule), and FIFO only can act as the leaves, under which no classification can be added.
Class is used to denote the control strategy. In the practical application process, different flow control strategies need to be implemented for different IP addresses, and at this time, different classes need to be used to represent different control strategies.
Filter is used to program the user into a specific control strategy (i.e., different class). For example, different control policies (a, B) are now applied to 192.168.1.33 and 192.168.1.34 IP addresses, and 192.168.1.33 is marked into control policy a and 192.168.1.34 is marked into control policy B by using a filter, and the flag bit of the filter division can be implemented by a u32 marking function or a set-mark function of an IP address tables.
In summary, after each IP address packet is received, in addition to normal NAT processing and routing processing, a filter is used to receive the IP address packet into different classes, and then enqueue the IP address packet into a corresponding queue, and a kernel schedules each queue for transmission, so it can be seen that the TC mechanism is established on a complex queue management, scheduling, and classification strategy, and therefore, the processing capacity of the system is consumed greatly.
Disclosure of Invention
The invention aims to overcome the problem that the prior art can not realize flexible bandwidth regulation without increasing system processing overhead, and provides a flexible bandwidth regulation method, a storage medium and a terminal.
The purpose of the invention is realized by the following technical scheme: a method for flexible bandwidth regulation, the method comprising a control strategy for idle bandwidth utilization: judging whether the token number of the current network segment is exhausted, if not, judging whether the token number of each IP address under the current network segment is exhausted, if so, judging whether the token number of the first IP address enables the practical bandwidth of the terminal equipment under the first IP address to reach the upper limit of the preemptible bandwidth during data transmission, and if not, increasing the token number of the first IP address;
the method also comprises a bandwidth control step of preempting the bandwidth to exceed the upper limit IP address:
and when the number of tokens of the current network segment is less than zero, the terminal equipment with the IP address in the current network segment discards the data packet in the guaranteed bandwidth and the number of tokens of the IP address ensures that the used bandwidth of the terminal equipment with the IP address exceeds the guaranteed bandwidth and is simultaneously established, reducing the number of tokens of the IP address. The token corresponds to the byte number, the IP address corresponds to the network terminal, the token number of each IP corresponds to the byte number of the packet that can be sent by the IP address in the current cycle, and the token number of the network segment corresponds to the total byte number of the packets that can be sent by all the IPs located in the network segment in the current cycle. The bandwidth is in bit unit, and correspondingly, when the token is compared with the bandwidth, the token is converted into bit unit from byte unit.
As an optional technical solution, when the bandwidth utilization step is performed: determining the number of tokens of the IP address so that the bandwidth used by the terminal device under the IP address reaches the upper limit of the preemptible bandwidth specifically includes: acquiring uplink and downlink flow under the token number based on the current IP address so as to acquire the use bandwidth of the IP address, and further judging whether the use bandwidth of the terminal equipment under the IP address reaches the upper limit of the bandwidth capable of being preempted;
when the broadband control step is carried out: determining the token number of the IP address so that the bandwidth used by the terminal device under the IP address exceeds the guaranteed bandwidth specifically includes: obtaining uplink and downlink flow under the token number based on the current IP address so as to obtain the use bandwidth of the IP address, and further judging whether the use bandwidth of the terminal equipment under the IP address exceeds the guaranteed bandwidth
As an optional technical solution, when the bandwidth utilization step or the bandwidth control step is performed, the token number of each IP address is adjusted in real time by triggering at intervals of a timer period and/or by external request.
As an optional technical solution, the method further includes a data buffering processing step:
and re-enqueuing the unsent data packet in the last period to the queue head of the kernel queue for buffering.
As an optional technical solution, the method further includes a data transmission monitoring and warning step:
judging whether the total token number of the current network segment is less than zero, and if so, executing a first alarm action; otherwise, judging whether the token number of the IP address under the current network segment is less than zero, and if so, executing a second alarm action; and otherwise, continuously counting the number of bytes of the data packet sent in the current period.
As an optional technical solution, the method further includes a kernel component establishing step, including:
establishing an IP address sending counter for counting the byte number of a sent data packet of the IP address so as to determine whether the token number of the IP address enables the use bandwidth of the terminal equipment under the IP address to reach the upper limit of the preemptible bandwidth;
establishing a token pool for generating tokens of all network segments and all IP addresses;
and establishing a bandwidth configuration table for storing bandwidth configuration information, and further acquiring the upper limit information of the preemptible bandwidth.
As an optional technical solution, the kernel component establishing step further includes:
and establishing a core timer for updating the token, and generating a timer period.
It should be further noted that the technical features corresponding to the above examples can be combined with each other or replaced to form a new technical solution.
The present invention further includes a storage medium having stored thereon computer instructions which, when executed, perform the steps of any one or a combination of the above-mentioned examples to form the method for flexible bandwidth regulation.
The present invention further includes a terminal, including a memory and a processor, where the memory stores computer instructions executable on the processor, and the processor executes the computer instructions to perform the steps of the method for flexible bandwidth regulation according to any one or a combination of the above examples.
Compared with the prior art, the invention has the beneficial effects that:
(1) In an example, the present invention determines the current usage of the network bandwidth based on the number of tokens in the network segment and the IP address, and further increases the network bandwidth of the IP address terminal that loses packets to realize effective data transmission when the bandwidth in the network segment is not fully occupied, and the data transmission is based on whether a token is available, and there is no queue scheduling overhead in the whole data transmission process, and the consumption of the processing capacity of the system is small, that is, the present invention can realize effective flexible bandwidth regulation and control without increasing the processing overhead of the system.
(2) In an example, the present invention determines the use condition of the current network bandwidth based on the number of tokens of the network segment and the IP address, and further limits the IP address terminals which seize too much bandwidth on the basis that the network segment bandwidth is completely used, so as to ensure effective data transmission, and the data transmission is based on whether the tokens are available, and the whole data transmission process has no queue scheduling overhead, and the consumption of the processing capacity of the system is small, that is, the present invention can realize effective flexible bandwidth regulation and control on the basis of not increasing the processing overhead of the system.
(3) In one example, the invention adjusts the number of tokens by introducing a timer period to adapt to a changing data transmission scenario.
(4) In an example, the invention can ensure that the sequence of the buffered data packets is not disturbed by the way of queue head enqueuing, thereby reducing the error probability of data transmission.
(5) In an example, the invention carries out alarm prompt on the use condition of the current bandwidth through the token number of the network segment and the IP address, and can more intuitively acquire the use condition of the bandwidth of the current network.
(6) In an example, the invention can count the real-time traffic use condition of each network segment and each IP address by establishing an IP address sending counter and a network segment sending counter, thereby determining the network bandwidth occupation condition.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention.
FIG. 1 is a flow chart of a method for idle bandwidth utilization according to an exemplary embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for bandwidth control with bandwidth preemption of an IP address with an upper bound according to an example of the present invention;
FIG. 3 is a flow chart of a method for controlling elastic bandwidth optimization according to an exemplary embodiment of the present invention;
fig. 4 is a flowchart of an uplink data regulating method according to an example of the present invention;
fig. 5 is a flowchart of a downlink data adjusting and controlling method according to an example of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that directions or positional relationships indicated by "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", and the like are directions or positional relationships described based on the drawings, and are only for convenience of description and simplification of description, but do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly stated or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
The invention aims to solve the problem of large system processing performance occupancy rate caused by the complexity of the existing bandwidth control technology, namely TC mechanism queue management and scheduling and classification strategies, provides a bandwidth control method, and takes a network scene applied to home decoration and small and micro enterprises as an example to explain the method.
In an example, an elastic bandwidth regulation and control method specifically includes a control strategy of idle bandwidth utilization, judging whether the number of tokens in a current network segment is exhausted, if not, judging whether the number of tokens in each IP address in the current network segment is exhausted, if so, judging whether the number of tokens in a first IP address enables a practical bandwidth of a terminal device in a first IP address during data transmission to reach an upper limit of a preemptible bandwidth, and if not, increasing the number of tokens in the first IP address. As shown in fig. 1, as a preferred embodiment, the implementation steps of the control strategy specifically include:
judging whether the token number of the current network segment is exhausted, if not, judging whether the token number of each IP address under the current network segment is exhausted, if so, judging whether the token number of the first IP address enables the practical bandwidth of the terminal equipment under the first IP address to reach the upper limit of the preemptible bandwidth during data transmission, and if not, increasing the token number of the first IP address. Wherein the first IP address represents an IP address where the token count is exhausted (the token count is zero); the number of tokens of the IP address is the number of tokens allocated to the IP address, and one IP address corresponds to a plurality of terminal devices, such as a mobile phone, a tablet, a computer, a smart television and the like which are accessed to the same WIFI; whether the terminal equipment under the same IP address can receive and transmit data depends on whether the terminal equipment uses the number of usable tokens or not, namely, the number of the tokens of the IP address corresponds to the number of data packets, and the data packets can be sent to have corresponding tokens for authorization; the larger the number of bytes of the data packet is, the larger the number of the data packet is, and correspondingly, the larger the bandwidth is required for data transmission and reception. Specifically, the preemptible bandwidth upper limit represents a maximum bandwidth usable by the terminal device at the IP address, and is default 32 times of the guaranteed bandwidth. The guaranteed bandwidth represents the minimum bandwidth which can meet normal communication of the terminal equipment under the IP address, the guaranteed bandwidth of the terminal equipment can use default setting, and the default setting can calculate the guaranteed bandwidth according to the number of the terminals on line in the network segment.
More specifically, when the number of tokens in the current network segment is not exhausted, it is indicated that the bandwidth of the current network segment is not completely used, and redundancy is still provided, at this time, it is further determined whether a situation that a terminal device corresponding to an IP address loses packets (token exhaustion) occurs by determining the number of tokens in the IP address in the network segment, if the network segment token is not exhausted, the token of the terminal device corresponding to the IP address is exhausted, and as long as the number of tokens in the IP address does not exceed the upper limit of the bandwidth that can be preempted at this time, the number of tokens in the IP address corresponding to the terminal device is increased to expand the bandwidth of the IP address, and under the situation that data transmission of other IP addresses is not affected, the terminal device corresponding to each IP address in the whole network segment can realize normal data transmission, and the situations of data transmission blocking and packet loss are prevented. Furthermore, in the whole data transmission process, the data packet is sent according to whether a token is available, the whole data transmission process has no queue scheduling overhead, and the consumption of the processing capacity of the system is low, namely, the invention can realize effective flexible bandwidth regulation and control on the basis of not increasing the processing overhead of the system.
More specifically, the above example of idle bandwidth utilization further specifically includes:
if the token number of each IP address under the current network segment is not exhausted, maintaining the current token number without adjustment; meanwhile, if the token number of the first IP address enables the bandwidth used by the terminal device in data transmission under the first IP address to reach the upper limit of the preemptible bandwidth, the existing token number is maintained without adjustment.
In an example, the determining whether the number of tokens of the first IP address enables the practical bandwidth of the terminal device at the first IP address during data transmission to reach the upper limit of the preemptible bandwidth specifically includes:
and acquiring uplink and downlink flow based on the number of tokens of the current first IP address to acquire the use bandwidth of the first IP address, and further judging whether the use bandwidth of the terminal equipment under the first IP address reaches the upper limit of the preemptible bandwidth. Specifically, the obtaining of the uplink and downlink traffic based on the number of tokens of the current first IP address means that, when the first IP address holds the current number of tokens, the size of bytes of a data packet that has been sent based on the number of tokens is counted, and the uplink and downlink traffic of the first IP address, that is, the actual usage bandwidth, is obtained. The first IP address reaching the preemptible bandwidth upper limit during data transmission indicates whether the bandwidth sum of all the terminal devices under the first IP address can reach the preemptible bandwidth upper limit.
As an option, the increase and decrease of the number of tokens of the IP address are preset through an actual use scene, and under the scenes of household use and small and micro enterprises, the increase and decrease of the number of tokens of the IP address at each time are changed by one time to guarantee the bandwidth.
In an example, the determining whether the number of tokens corresponding to the second IP address will cause the second IP address to exceed the guaranteed bandwidth during data transmission specifically includes:
and calculating the byte size of a data packet to be sent based on the token number of the IP address to obtain the uplink and downlink flow of the IP address, further obtaining the theoretical bandwidth of the IP address based on the uplink and downlink flow of the IP address, and comparing the theoretical bandwidth with the guaranteed bandwidth to judge whether the IP address exceeds the guaranteed bandwidth. When the second IP address exceeds the guaranteed bandwidth during data transmission, the bandwidth of any terminal equipment under the second IP address exceeds the guaranteed bandwidth.
In one example, the idle bandwidth utilization step is triggered at intervals of a timer period and/or by an external request, so as to adjust the number of tokens of each IP address in real time. After the external request triggers that the user terminal establishes communication connection with the execution main body (kernel) of the regulation and control method of the invention, the corresponding bandwidth regulation request information is sent, and the kernel executes the corresponding idle bandwidth utilization step again. Preferably, the idle bandwidth utilization step adjusts and updates the token number of each network segment and each IP address according to the actual bandwidth usage in the previous period, that is, recalculates the token size of each IP address in the next period to adapt to the changing data transmission scenario. The timer period is a fixed period, and as a preferred option, the period (interval) of the timer period is adjustable, i.e., may be set to 1s,100ms,10ms, etc., so as to improve the token adjustment sensitivity of the terminal device. In this example, the timer period is 50ms, which is the number of tokens that update the IP address 20 times in 1 second.
In one example, the method further comprises a data caching step:
and re-enqueuing the unsent data packet in the last period to the queue head of the kernel queue for buffering. In the Linux system, a queue is originally arranged for buffering data packets received from an interface, the original working mode of the queue is that subsequent packets enter the tail of the queue, and only a mode of enqueuing from the tail of the queue is provided. In order to ensure that the sequence of the buffered packets in the next (periodic) transmission queue is not disordered, the packets which cannot be transmitted need to be re-queued to the head of the queue, thereby reducing the error probability of data transmission.
In one example, the method further comprises a data transmission monitoring alert step of:
judging whether the total token number of the current network segment is less than zero, and if so, executing a first alarm action; otherwise, judging whether the token number of the IP address under the current network segment is less than zero, and if so, executing a second alarm action; otherwise, continuously counting the number of bytes of the data packet sent in the current period, wherein the number of bytes sent in the network segment and the number of bytes sent in the IP address are included; the using condition of the current bandwidth is alarmed and prompted through the number of the tokens of the network segment and the IP address, so that the using condition of the current network bandwidth can be more intuitively obtained. Specifically, the executing of the first alarm action specifically includes displaying a "FAIL" mark, displaying a corresponding network segment name, and inserting a data packet which is not sent in the period into the tail of the temporary queue; and executing the second alarm action, namely displaying a 'FAIL' mark, displaying a corresponding IP address, and simultaneously inserting the unsent data packet into the tail of the temporary queue in the period. Of course, as an optimal option, a new warning action, such as different voice prompts or light prompts, may be additionally added while the first warning action and the second warning action are executed.
In one example, the method further comprises a kernel component establishing step, comprising:
establishing an IP address sending counter for counting the byte number of a sent data packet of the IP address to acquire real-time uplink flow and downlink flow of each IP address under the current IP token number so as to determine the use bandwidth of the IP address and further judge whether the token number of the IP address enables the use bandwidth of the IP address to reach the upper limit of the preemptible bandwidth during data transmission;
establishing a token pool for generating tokens of each network segment and each IP address so as to distribute each network segment and each IP address to obtain corresponding token number and further send corresponding data packets;
and establishing a bandwidth configuration table for storing bandwidth configuration information, further acquiring the total bandwidth of the network segments of the IP addresses, the preemptible bandwidth upper limit information and the mapping relation between each IP address and the network segment, and calculating the token number of each IP address in the next timer period based on the parameters of the bandwidth configuration table. And the network segment total bandwidth represents the physical bandwidth which can be obtained by the network segment to the maximum. The bandwidth configuration table comprises 1024 entries, each entry corresponds to the configuration of an IP address, and is called an "IP address configuration entry". The bandwidth configuration table also comprises 8 network segment configuration items, and the IP address configuration items are associated with the network segment configuration items, so that the mapping of each IP address and each network segment is realized.
In one example, the kernel component establishing step further comprises:
and establishing a network segment address sending counter for counting the byte number of the sent data packets of the network segment. Specifically, in the home and small-sized micro-enterprise scenarios, the number of terminals accessing the network is limited, 1024 IP address transmission counters (unsigned 32-bit integer) are set for counting the number of bytes already transmitted in a time period, and the IP address transmission counters correspond to the IP addresses of the terminals accessing the network one to one. Meanwhile, 8 network segment transmission counters (unsigned 32-bit integer type) are set, and each network segment transmission counter corresponds to each network segment one by one. More specifically, 1024 "IP address transmission counters" and 8 "network segment transmission counters" constitute a transmission statistical table, which is used to limit the downlink or uplink traffic of a single IP address and the uplink and downlink traffic of a network segment in a timer period by means of count-down; when the countdown is less than zero, subsequent packets to be sent are either discarded or buffered.
In one example, the kernel component establishing step further comprises:
and establishing a kernel timer for updating the token, generating a timer period, and calculating the number of tokens of each IP address in the next timer period based on the data transmission condition of the previous period, namely the bandwidth use condition.
The present embodiment provides a storage medium, which has the same inventive concept as that of a flexible bandwidth control method formed by any one or more of the above examples, and on which computer instructions are stored, and when the computer instructions are executed, the computer instructions perform the steps of the flexible bandwidth control method formed by any one or more of the above examples.
Based on such understanding, the technical solution of the present embodiment or parts of the technical solution may be essentially implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The present embodiment also provides a terminal, which has the same inventive concept as an elastic bandwidth control method formed by any one or a combination of the above examples, and includes a memory and a processor, where the memory stores computer instructions executable on the processor, and the processor executes the steps of the elastic bandwidth control method formed by any one or a combination of the above examples when executing the computer instructions. The processor may be a single or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.
Each functional unit in the embodiments provided by the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
Based on the inventive concept of any example or combination of a plurality of examples of the above bandwidth regulation and control method (idle bandwidth utilization step), the present invention further provides an elastic bandwidth regulation and control system, which specifically comprises:
the IP address sending counter is used for counting the byte number of a sent data packet of the address so as to obtain the real-time uplink flow of each IP address and further judge whether the token number of the IP address enables the use bandwidth of the terminal equipment under the IP address to reach the upper limit of the preemptible bandwidth during data transmission; specifically, the sending counter based on the IP address can count the number of bytes (uplink and downlink traffic) of the sent data packet based on the number of tokens of the current IP address, and further correlate the number of tokens of the IP address with the used bandwidth thereof.
The token pool is used for generating tokens of each network segment and each IP address so as to distribute each network segment and each IP address to obtain the corresponding token number and further send the corresponding data packet;
the bandwidth configuration table is used for storing bandwidth configuration information and further acquiring the total bandwidth of a network segment of the IP address, the guaranteed bandwidth of the IP address, the preemptible bandwidth upper limit information and the mapping relation between each IP address and the network segment;
in one example, the flexible bandwidth regulation and control system further includes a network segment transmission counter, which is used for counting the number of bytes of a network segment transmitted data packet based on the number of tokens of an IP address, so as to obtain the real-time uplink flow of each network segment;
in an example, the flexible bandwidth regulation and control system further includes a kernel timer for generating a timer period, and calculating the number of tokens for each IP address in the next timer period based on the data transmission condition, i.e. the bandwidth usage condition, of the previous period. The timer period is a fixed period, and as a preferred option, the period (interval) of the timer period is adjustable, that is, may be set to 1s,100ms,10ms, and so on, so as to improve the token adjustment sensitivity of the terminal device. In this example, the timer period is 50ms, i.e., the number of tokens that update the IP address 20 times in 1 second.
In one example, a bandwidth control method of the present invention further includes: and bandwidth control step for preempting the bandwidth exceeding the upper limit IP address, wherein the number of tokens of the current network segment is less than zero, the terminal equipment with the IP address in the current network segment discards data packets in the guaranteed bandwidth, and the number of tokens of the IP address is reduced when the bandwidth used by the terminal equipment with the IP address exceeds the guaranteed bandwidth and is established at the same time. As shown in fig. 2, as a preferred embodiment, the bandwidth controlling step of preempting the IP address exceeding the upper limit specifically includes:
judging whether the token number of the current network segment is exhausted, if so, judging whether the terminal equipment under each IP address under the current network segment discards the data packet in the guaranteed bandwidth, if so, judging whether the token number corresponding to the second IP address enables the used bandwidth of the terminal equipment under the second IP address to exceed the guaranteed bandwidth, and if so, reducing the token number of the second IP address. The second IP address indicates an IP address of the discarded packet within the guaranteed bandwidth, that is, the terminal device under the IP address of the discarded packet within the guaranteed bandwidth. Specifically, when the number of tokens in the current network segment is exhausted, it indicates that the bandwidth of the current network segment is completely used, and a data packet can be transmitted without redundant bandwidth, at this time, it is further determined whether the terminal device in the network segment discards the data packet within the guaranteed bandwidth, and if there is data discarding within the guaranteed bandwidth of the terminal device, it indicates that other terminal devices of the current IP address preempt too much bandwidth, and at this time, the number of tokens of the terminal device exceeding the guaranteed bandwidth needs to be further reduced.
More specifically, the example of controlling the bandwidth by preempting the bandwidth of the IP address exceeding the upper limit further includes:
if the terminal corresponding to each IP address under the current network segment does not discard the data packet in the guaranteed bandwidth, maintaining the number of the existing tokens without adjustment; meanwhile, if the token number of the second IP address does not cause the used bandwidth of the terminal device at the second IP address during data transmission to exceed the guaranteed bandwidth, the existing token number is maintained without adjustment.
As an option, the increase and decrease of the number of tokens of the IP address are preset through an actual use scene, and under the scenes of household use and small and micro enterprises, the increase and decrease of the number of tokens of the IP address at each time are changed by one time to guarantee the bandwidth.
In an example, the determining whether the number of tokens corresponding to the second IP address exceeds the guaranteed bandwidth during data transmission by the terminal device under the second IP address specifically includes:
and acquiring uplink and downlink flow based on the number of tokens of the current second IP address to acquire the use bandwidth of the second IP address, and further judging whether the use bandwidth of the terminal equipment under the second IP address reaches the upper limit of the preemptible bandwidth. Specifically, the obtaining of the uplink and downlink traffic based on the number of tokens of the current second IP address means that, when the second IP address holds the current number of tokens, the size of bytes of a data packet that has been sent based on the number of tokens is counted, and the uplink and downlink traffic of the IP address, that is, the actual usage bandwidth, is obtained. When the second IP address exceeds the guaranteed bandwidth during data transmission, the bandwidth of any terminal device under the second IP address exceeds the guaranteed bandwidth.
In an example, the bandwidth control step of preempting the IP address exceeding the upper limit is triggered at intervals of a timer period and/or by an external request, so as to adjust the number of tokens of each IP address in real time. After the external request triggers that the user terminal establishes communication connection with the execution main body (kernel) of the regulation and control method of the invention, the corresponding bandwidth regulation request information is sent, and the kernel executes the bandwidth control step of preempting the IP address exceeding the upper limit again. Preferably, the bandwidth control step of preempting the bandwidth beyond the upper limit IP address adjusts and updates the number of tokens in each network segment and each IP address according to the actual bandwidth usage in the previous period, i.e. recalculates the token size of each IP address in the next period, so as to adapt to the changing data transmission scenario. The timer period is a fixed period, and as a preferred option, the period (interval) of the timer period is adjustable, i.e., may be set to 1s,100ms,10ms, etc., so as to improve the token adjustment sensitivity of the terminal device. In this example, the timer period is 50ms, which is the number of tokens that update the IP address 20 times in 1 second.
In one example, the method further comprises a data caching step:
and re-enqueuing the unsent data packet in the last period to the queue head of the kernel queue for buffering. In the Linux system, a queue is originally arranged for buffering the data packets received from the interface, the original working mode of the queue is that the subsequent packets enter the tail of the queue, and only a mode of enqueuing from the tail of the queue is provided. In order to ensure that the sequence of the buffered packets in the next (periodic) transmission queue is not disordered, the packets which cannot be transmitted need to be re-queued to the head of the queue, thereby reducing the error probability of data transmission.
In one example, the method further comprises a data transmission monitoring alert step of:
judging whether the total token number of the current network segment is less than zero, and if so, executing a first alarm action; otherwise, judging whether the token number of the IP address under the current network segment is less than zero, and if so, executing a second alarm action; otherwise, continuously counting the number of bytes of the data packet sent in the current period, wherein the number of bytes of the data packet sent in the network segment and the number of bytes of the IP address sent in the network segment are included; the using condition of the current bandwidth is alarmed and prompted through the number of the tokens of the network segment and the IP address, so that the using condition of the current network bandwidth can be more intuitively obtained. Specifically, the executing of the first alarm action specifically includes displaying a "FAIL" mark, displaying a corresponding network segment name, and inserting a data packet which is not sent in the period into the tail of the temporary queue; and executing the second alarm action specifically to display a 'FAIL' mark and a corresponding IP address, and simultaneously inserting the unsent data packet into the tail of the temporary queue in the period. Of course, as an optimal option, a new warning action, such as different voice prompts or light prompts, may be additionally added while the first warning action and the second warning action are executed.
In one example, the method further comprises a kernel component establishing step, comprising:
establishing an IP address sending counter for counting the byte number of a sent data packet of the IP address to acquire real-time uplink flow and downlink flow of each IP address under the current IP token number so as to determine the use bandwidth of the IP address and further judge whether the token number of the IP address ensures that the use bandwidth of the IP address reaches the guarantee bandwidth during data transmission;
establishing a token pool for generating tokens of each network segment and each IP address so as to distribute each network segment and each IP address to obtain corresponding token number and further send corresponding data packets;
and establishing a bandwidth configuration table for storing bandwidth configuration information, further acquiring the total bandwidth of the network segments of the IP addresses, the guaranteed bandwidth of the IP addresses and the mapping relation between each IP address and the network segment, and calculating the token number of each IP address in the next timer period based on the parameters of the bandwidth configuration table. And the network segment total bandwidth represents the physical bandwidth which can be acquired by the network segment at the maximum. The bandwidth configuration table comprises 1024 entries, each entry corresponds to the configuration of an IP address, and is called an "IP address configuration entry". The bandwidth configuration table also comprises 8 network segment configuration items, and the IP address configuration items are associated with the network segment configuration items, namely the mapping of each IP address and each network segment is realized.
In one example, the kernel component establishing step further comprises:
and establishing a network segment address sending counter for counting the byte number of the sent data packets of the network segment. Specifically, in the home and small micro-enterprise scenarios, the number of terminals accessing the network is limited, 1024 IP address transmission counters (unsigned 32-bit integer) are set for counting the number of bytes already transmitted in a time period, and the IP address transmission counters are in one-to-one correspondence with the IP addresses of the terminals accessing the network. Meanwhile, 8 network segment transmission counters (unsigned 32-bit integer) are set, and each network segment transmission counter corresponds to each network segment one by one. More specifically, 1024 "IP address transmission counters" and 8 "network segment transmission counters" constitute a transmission statistical table, which is used to limit the downlink or uplink traffic of a single IP address and the uplink and downlink traffic of a network segment in a timer period by means of count-down; when the countdown is less than zero, subsequent packets to be sent are either discarded or buffered.
In one example, the kernel component establishing step further comprises:
and establishing a kernel timer for updating the token, generating a timer period, and calculating the number of tokens of each IP address in the next timer period based on the data transmission condition of the previous period, namely the bandwidth use condition.
The present embodiment provides a storage medium, which has the same inventive concept as a flexible bandwidth control method formed by any one or a combination of the above examples, and on which computer instructions are stored, and the computer instructions execute the steps of the flexible bandwidth control method formed by any one or a combination of the above examples when the computer instructions are executed.
Based on such understanding, the technical solution of the present embodiment or parts of the technical solution may be essentially implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The present embodiment also provides a terminal, which has the same inventive concept as an elastic bandwidth control method formed by any one or a combination of the above examples, and includes a memory and a processor, where the memory stores computer instructions executable on the processor, and the processor executes the steps of the elastic bandwidth control method formed by any one or a combination of the above examples when executing the computer instructions. The processor may be a single or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.
Each functional unit in the embodiments provided by the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
Based on the inventive concept of any example or combination of multiple examples of the above bandwidth regulation and control method (bandwidth control step for preempting bandwidth to exceed the upper limit IP address), the present invention further provides an elastic bandwidth regulation and control system, which specifically includes:
the IP address sending counter is used for counting the number of bytes of a sent data packet of the IP address so as to obtain the real-time uplink flow of each IP address and further judge whether the token number of the IP address enables the use bandwidth of the terminal equipment under the IP address to exceed the guaranteed bandwidth during data transmission; specifically, the sending counter based on the IP address can count the number of bytes (uplink and downlink traffic) of the sent data packet based on the number of tokens of the current IP address, and further correlate the number of tokens of the IP address with the used bandwidth thereof.
The token pool is used for generating tokens of each network segment and each IP address so as to distribute each network segment and each IP address to obtain the corresponding token number and further send the corresponding data packet;
the bandwidth configuration table is used for storing bandwidth configuration information and further acquiring the total bandwidth of a network segment of the IP address, the guaranteed bandwidth of the IP address, the preemptible bandwidth upper limit information and the mapping relation between each IP address and the network segment;
in one example, the flexible bandwidth regulation and control system further includes a network segment transmission counter, which is used for counting the number of bytes of a network segment transmitted data packet based on the number of tokens of an IP address, so as to obtain the real-time uplink flow of each network segment;
in an example, the flexible bandwidth regulation and control system further includes a kernel timer, configured to generate a timer period, and calculate the number of tokens for each IP address in the next timer period based on the data transmission condition, that is, the bandwidth usage condition, in the previous period. The timer period is a fixed period, and as a preferred option, the period (interval) of the timer period is adjustable, i.e., may be set to 1s,100ms,10ms, etc., so as to improve the token adjustment sensitivity of the terminal device. In this example, the timer period is 50ms, which is the number of tokens that update the IP address 20 times in 1 second.
Combining the control policy of the idle bandwidth utilization step with the bandwidth control policy of the bandwidth preemption over-limit IP address to obtain an optimal bandwidth regulation and control method, as shown in fig. 3, specifically includes:
s1: judging whether the token number of the current network segment is exhausted, if not, entering a step S2, otherwise, entering a step S3;
s2: judging whether the token number of each IP address under the current network segment is exhausted, if not, maintaining the current token; if so, judging whether the token number of the first IP address enables the first IP address to reach the upper limit of the preemptible bandwidth during data transmission, if so, maintaining the existing token, and if not, increasing the token number of the first IP address, and finishing the adjustment of the token of the IP address;
s3: judging whether the terminal equipment under each IP address under the current network segment discards a data packet in a guaranteed bandwidth or not, and if not, maintaining the existing token; otherwise, judging whether the number of tokens corresponding to the second IP address can enable the second IP address to exceed the guaranteed bandwidth during data transmission, and if not, maintaining the existing tokens; otherwise, the token number of the second IP address is reduced, and the adjustment of the token of the IP address is finished.
By the above preferred example, in each timer period, a terminal that preempts excessive bandwidth (preempts the upper limit of the bandwidth) is identified, and then the number of tokens is reduced, so as to further limit the bandwidth; under the condition that the network segment bandwidth is not completely occupied, any terminal can up-regulate the token as long as packet loss occurs until the upper limit of the preemptible bandwidth is reached, and then idle bandwidth is utilized and released to required terminal equipment, so that effective transmission of data is guaranteed, flexible bandwidth control is realized according to user data transmission requirements in different time periods, and due to the fact that queue scheduling overhead is not involved, only overhead for judging whether the token owned by the IP address is exhausted is increased, and under the condition that the data packet is not discarded, increase of system overhead can be ignored.
Based on the inventive concept of the combination of the control strategy of the idle bandwidth utilization step and the bandwidth control strategy of the bandwidth preemption over-limit IP address, the invention also provides an elastic bandwidth regulation and control system, which specifically comprises:
the IP address sending counter is used for counting the number of bytes of a sent data packet of the IP address so as to obtain the real-time uplink flow of each IP address, further judging whether the token number of the IP address enables the use bandwidth of the terminal equipment under the IP address to reach the upper limit of the preemptible bandwidth during data transmission and judging whether the token number of the IP address enables the use bandwidth of the terminal equipment under the IP address to exceed the guaranteed bandwidth during data transmission; specifically, the number of bytes of the data packet that has been sent based on the number of tokens of the current IP address can be counted based on the IP address sending counter, and the number of tokens of the IP address is associated with the bandwidth used by the token.
The token pool is used for generating tokens of each network segment and each IP address so as to enable each network segment and each IP address to be distributed to obtain the corresponding token number and further send the corresponding data packet;
the bandwidth configuration table is used for storing bandwidth configuration information and further acquiring the total bandwidth of a network segment of the IP address, the guaranteed bandwidth of the IP address, the preemptible bandwidth upper limit information and the mapping relation between each IP address and the network segment;
in one example, the flexible bandwidth regulation and control system further includes a network segment transmission counter, which is used for counting the number of bytes of a network segment transmitted data packet based on the number of tokens of an IP address, so as to obtain the real-time uplink flow of each network segment;
in an example, the flexible bandwidth regulation and control system further includes a kernel timer for generating a timer period, and calculating the number of tokens for each IP address in the next timer period based on the data transmission condition, i.e. the bandwidth usage condition, of the previous period. The timer period is a fixed period, and as a preferred option, the period (interval) of the timer period is adjustable, i.e., may be set to 1s,100ms,10ms, etc., so as to improve the token adjustment sensitivity of the terminal device. In this example, the timer period is 50ms, i.e., the number of tokens that update the IP address 20 times in 1 second.
As an option, the total bandwidth of the network segments in the bandwidth configuration table represents the physical bandwidth which can be obtained by the network segment at the maximum, if the current downlink bandwidth of the internet outlet is 500M, if there are two LAN segments, the sum of the theoretical calculated values of the total bandwidths which can be obtained by the two network segments is equal to 500M, wherein the LAN1 network segment is 192.168.10.0/24, and the bandwidth is 200Mbit; LAN2 segment 192.168.11.0/24, bandwidth 300Mbit. The preemptible bandwidth upper limit represents the maximum bandwidth available for the terminal equipment under the IP address, and is default to 32 times of the guaranteed bandwidth. The guaranteed bandwidth represents the minimum bandwidth which can meet normal communication of the terminal equipment under the IP address, the guaranteed bandwidth of the terminal equipment can use default setting, and the default setting can calculate the guaranteed bandwidth according to the number of the terminals on line in the network segment. Taking LAN1 segment as an example, if the number of current online terminals is 80, the guaranteed bandwidth is 200/80/4=0.6m, that is, each online terminal can obtain 0.6Mbit of guaranteed bandwidth. If the number of on-line terminals is reduced to 50 during operation, the guaranteed bandwidth of each on-line terminal becomes 200/50/4=1m. More specifically, the bandwidth configuration table includes 1024 entries, where each entry corresponds to the configuration of an IP address, which is referred to as an "IP address configuration entry". The bandwidth configuration table also comprises 8 network segment configuration items, and the IP address configuration items are associated with the network segment configuration items, namely the mapping of each IP address and each network segment is realized.
The bandwidth configuration parameters of the bandwidth configuration table are in a preferred default configuration mode, the relevance between the parameter details and the parameters is shielded in the mode, a user only needs to configure the total bandwidth of a WAN (Wide area network) port, the occupied bandwidth of each LAN (local area network) segment can be obtained, the parameters of guaranteed bandwidth of an IP (Internet protocol) address, preemptible bandwidth upper limit information and the like can be automatically calculated, and further bandwidth control is achieved.
Based on the above preferred flexible bandwidth regulation and control system (the regulation and control system corresponding to the control policy of the idle bandwidth utilization step + the bandwidth control policy of the bandwidth preemption over-limit IP address), the optimal example of the present invention is obtained by combining the example combination of the above flexible bandwidth regulation and control method (any example or combination of multiple examples of the control policy of the idle bandwidth utilization step and the bandwidth control policy of the bandwidth preemption over-limit IP address), and in order to further explain the inventive concept of the present invention, the data transmission flow of the optimal example is specifically explained:
first, a method for regulating and controlling uplink data (data of a terminal in a LAN segment accessing the internet) of a linux system is described as an example, and as shown in fig. 4, the method specifically includes:
s21: receiving IP address packet from LAN port, querying routing table, and obtaining specific IP address packet sent through a WAN port;
s22: judging whether the total token number of the network segment is less than zero, if so, inserting the IP address packet into the tail of the temporary queue, and setting a FAIL mark by a corresponding IP address transmission counter; otherwise, go to step S23;
s23: judging whether the token number of the IP address is less than zero, if so, inserting the IP address packet into the tail of the temporary queue, and setting a FAIL mark by a corresponding IP address sending counter; otherwise, the IP address sending counter is decreased, and the network segment sending counter is decreased;
s24: the SNAT process is performed to replace the source IP address (IP address of the terminal) with the IP address (POST _ ROUTING) of the WAN, thereby transmitting the IP address packet.
Further, as a preferred option, in step S22, if the total number of network segment tokens is less than zero, the method further includes adjusting the IP address token, which specifically includes:
judging whether the terminal equipment under each IP address under the current network segment discards a data packet in a guaranteed bandwidth or not, and if not, maintaining the current token; if the data packet is discarded, judging whether the token number corresponding to the IP address can enable the IP address to exceed the guaranteed bandwidth during data transmission, and if not, maintaining the existing token; if the token number exceeds the guaranteed bandwidth, the token number of the IP address is reduced, and the adjustment of the token of the IP address is finished.
Furthermore, taking the method for regulating and controlling downlink data (data sent from a server on the internet to a LAN segment terminal) of the linux system as an example, as shown in fig. 5, the method specifically includes:
s31: receiving an IP address packet from a WAN port, performing DNAT processing (PRE _ ROUTING), and restoring a target IP address pointing to a LAN segment terminal;
s32: judging whether the total token number of the network segment is less than zero, if so, inserting the IP address packet into the tail of the temporary queue, and setting a FAIL mark by a corresponding IP address sending counter; otherwise, go to step S33;
s33: judging whether the token number of the IP address is less than zero, if so, inserting the IP address packet into the tail of the temporary queue, and setting a FAIL mark by a corresponding IP address sending counter; otherwise, the IP address sending counter is decreased, and the network segment sending counter is decreased;
s34: and inquiring the routing table to know that the specific IP address packet is specifically sent through a certain LAN port, so as to send the IP address packet to the corresponding terminal equipment.
Further, as a preferred option, in step S33, if the number of tokens of the IP address is less than zero, further adjusting the token of the IP address includes:
and judging whether the token number of the first IP address enables the use bandwidth of the terminal equipment under the first IP address during data transmission to reach the preemptible bandwidth upper limit, if so, maintaining the existing token, and if not, increasing the token number of the first IP address, and finishing the adjustment of the token of the IP address.
In the aspect of queue management, from the beginning of data entering kernel buffering, only the unique queue 'sd- > process _ queue' provided by the linux kernel is used, if dequeued data cannot be sent out because no token exists, linked lists are formed according to the dequeue sequence, and before the kernel 'process _ backlog' function exits, the linked lists are inserted back into the queue, so that the whole process is simple and controllable. In the aspect of data classification and identification, because the terminal devices are not prioritized, downlink data from WAN- > LAN or uplink data from LAN- > WAN only needs to index the IP address of the terminal to the IP address sending counter and the network segment sending counter, the IP address packet does not need to be brought into different classes by a filter, and the bandwidth control strategy flow is simple; in the queue scheduling aspect, the invention only has one queue for buffering data, whether the data can be sent is only according to whether a token is available at present, on the basis of the original route of linux and NAT processing flow, the invention has no overhead of a queue scheduling link, and the system processing overhead is small. In summary, the present invention only adds the overhead of judging whether the token owned by the IP address is exhausted and re-enqueuing and storing the token under the condition of exhaustion on the basis of the original Linux downlink data DNAT + route, uplink data route + SNAT, and the required system processing capacity consumption is small, that is, the effective flexible bandwidth regulation and control can be realized on the basis of not increasing the system processing overhead.
The above detailed description is for the purpose of describing the invention in detail, and it should not be construed that the detailed description is limited to the description, and it should be understood that various simple deductions and substitutions can be made by those skilled in the art without departing from the spirit of the invention.

Claims (9)

1. A method for regulating and controlling elastic bandwidth is characterized in that: the method comprises the steps of idle bandwidth utilization:
judging whether the token number of the current network segment is exhausted, if not, judging whether the token number of each IP address under the current network segment is exhausted, if so, judging whether the token number of the first IP address enables the practical bandwidth of the terminal equipment under the first IP address to reach the upper limit of the preemptible bandwidth during data transmission, and if not, increasing the token number of the first IP address;
the method also comprises a bandwidth control step of preempting the bandwidth to exceed the upper limit IP address:
and when the token number of the current network segment is less than zero, the terminal equipment with the IP address in the current network segment discards the data packet in the guaranteed bandwidth, and the token number of the IP address ensures that the used bandwidth of the terminal equipment with the IP address exceeds the guaranteed bandwidth and is simultaneously established, reducing the token number of the IP address.
2. The method of claim 1, wherein the method further comprises: when the bandwidth utilization step is carried out: determining the number of tokens of the IP address so that the bandwidth used by the terminal device under the IP address reaches the upper limit of the preemptible bandwidth specifically includes: acquiring uplink and downlink flow under the token number based on the current IP address so as to acquire the use bandwidth of the IP address, and further judging whether the use bandwidth of the terminal equipment under the IP address reaches the upper limit of the bandwidth capable of being preempted;
when the broadband control step is carried out: determining the number of tokens of the IP address so that the used bandwidth of the terminal device under the IP address exceeds the guaranteed bandwidth specifically includes: and acquiring uplink and downlink flow based on the token number of the current IP address to acquire the use bandwidth of the IP address, and further judging whether the use bandwidth of the terminal equipment under the IP address exceeds the guaranteed bandwidth.
3. The method of claim 1, wherein the method further comprises: when the bandwidth utilization step or the bandwidth control step is carried out, the token number of each IP address is adjusted in real time by taking a timer period as an interval trigger and/or an external request trigger.
4. The method of claim 3, wherein the method further comprises: the method further comprises a data buffering processing step: and re-enqueuing the unsent data packet in the last period to the queue head of the kernel queue for buffering.
5. The method for regulating and controlling the elastic bandwidth according to claim 1, wherein: the method also comprises a data transmission monitoring and alarming step: judging whether the total token number of the current network segment is less than zero, and if so, executing a first alarm action; otherwise, judging whether the token number of the IP address under the current network segment is less than zero, and if so, executing a second alarm action; and otherwise, continuously counting the number of bytes of the data packet sent in the current period.
6. The method of claim 1, wherein the method further comprises: the method also comprises a kernel component establishing step, which comprises the following steps:
establishing an IP address sending counter for counting the byte number of a sent data packet of the IP address so as to determine whether the token number of the IP address enables the use bandwidth of the terminal equipment under the IP address to reach the upper limit of the preemptible bandwidth;
establishing a token pool for generating tokens of all network segments and all IP addresses;
and establishing a bandwidth configuration table for storing bandwidth configuration information, and further acquiring the upper limit information of the preemptible bandwidth.
7. The method of claim 3, wherein the method further comprises: the kernel component establishing step further comprises: a core timer for token update is established for generating a timer period.
8. A storage medium having stored thereon computer instructions, characterized in that: the computer instructions when executed perform the steps of a method for flexible bandwidth regulation according to any one of claims 1 to 7.
9. A terminal comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, characterized in that: the processor when executing the computer instructions performs the steps of a method for flexible bandwidth regulation according to any one of claims 1 to 7.
CN202211188389.8A 2022-09-28 2022-09-28 Elastic bandwidth regulation and control method, storage medium and terminal Active CN115297064B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211188389.8A CN115297064B (en) 2022-09-28 2022-09-28 Elastic bandwidth regulation and control method, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211188389.8A CN115297064B (en) 2022-09-28 2022-09-28 Elastic bandwidth regulation and control method, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN115297064A CN115297064A (en) 2022-11-04
CN115297064B true CN115297064B (en) 2023-02-28

Family

ID=83833581

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211188389.8A Active CN115297064B (en) 2022-09-28 2022-09-28 Elastic bandwidth regulation and control method, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN115297064B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006279784A (en) * 2005-03-30 2006-10-12 Fujitsu Ltd Edge switch
CN1964326A (en) * 2006-12-04 2007-05-16 杭州华为三康技术有限公司 A method to monitor flow and flow monitoring equipment
CN109861920A (en) * 2019-01-16 2019-06-07 深圳市融汇通金科技有限公司 A kind of method and device of elasticity current limliting
CN110505158A (en) * 2019-09-29 2019-11-26 深信服科技股份有限公司 A kind of network bandwidth control method, device and electronic equipment and storage medium
CN113938435A (en) * 2021-08-30 2022-01-14 奇安信科技集团股份有限公司 Data transmission method, data transmission device, electronic device, storage medium, and program product

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101232449B (en) * 2008-02-27 2010-09-01 福建星网锐捷网络有限公司 Method and apparatus for distributing bandwidth
CN101282305B (en) * 2008-05-22 2010-07-21 杭州华三通信技术有限公司 Bandwidth control method for distributed system as well as service plate
US20150071181A1 (en) * 2013-09-09 2015-03-12 Verizon Patent And Licensing Inc. Method and apparatus for selectively adapting bandwidth consumption

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006279784A (en) * 2005-03-30 2006-10-12 Fujitsu Ltd Edge switch
CN1964326A (en) * 2006-12-04 2007-05-16 杭州华为三康技术有限公司 A method to monitor flow and flow monitoring equipment
CN109861920A (en) * 2019-01-16 2019-06-07 深圳市融汇通金科技有限公司 A kind of method and device of elasticity current limliting
CN110505158A (en) * 2019-09-29 2019-11-26 深信服科技股份有限公司 A kind of network bandwidth control method, device and electronic equipment and storage medium
CN113938435A (en) * 2021-08-30 2022-01-14 奇安信科技集团股份有限公司 Data transmission method, data transmission device, electronic device, storage medium, and program product

Also Published As

Publication number Publication date
CN115297064A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
US11316795B2 (en) Network flow control method and network device
US10230645B1 (en) Dynamic adjustment of quality of service parameters
JP3386117B2 (en) Multilayer class identification communication device and communication device
US6862265B1 (en) Weighted fair queuing approximation in a network switch using weighted round robin and token bucket filter
US8265076B2 (en) Centralized wireless QoS architecture
US20060045009A1 (en) Device and method for managing oversubsription in a network
JP3784049B2 (en) Method and system for a network processor for scheduling output using a disconnect / reconnect flow queue
US11258717B2 (en) Method for sending service packet, network device, and system
WO2007047865A2 (en) Coalescence of disparate quality of service matrics via programmable mechanism
EP1433066A1 (en) System and method for packet forwarding
EP1372306A2 (en) Multimode queuing system for Diffserv routers
ZA200500717B (en) Programmable scheduling for ip routers
WO2014173367A2 (en) Qos implementation method, system, device and computer storage medium
CN113852567B (en) Fairness scheduling device and method for multi-mode service flow
US10965605B2 (en) Communication system, communication control method, and communication apparatus
CN107835133B (en) Stream priority control method based on multi-attribute decision
JP3844425B2 (en) Multi-rate radio base station equipment
AU2002339349B2 (en) Distributed transmission of traffic flows in communication networks
KR101737516B1 (en) Method and apparatus for packet scheduling based on allocating fair bandwidth
CN116582493A (en) Data center network link selection method and device and electronic equipment
CN115297064B (en) Elastic bandwidth regulation and control method, storage medium and terminal
CN107483360B (en) Service flow scheduling method and device
KR20120055947A (en) Method and apparatus for providing Susbscriber-aware per flow
Tokmakov et al. A case for data centre traffic management on software programmable ethernet switches
Cisco Configuring Custom Queueing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A flexible bandwidth control method, storage medium, and terminal

Granted publication date: 20230228

Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd.

Pledgor: WUHAN CETRON YIKONG TECHNOLOGY CO.,LTD.

Registration number: Y2024980009482

PE01 Entry into force of the registration of the contract for pledge of patent right