A method and system for determining port network traffic scheduling
By obtaining and calculating historical data of network traffic, combined with Netconf and Python language, we can determine and determine the optimal schedulable port, which solves the congestion and stability problems caused by excessive network device port traffic and improves the efficiency and stability of traffic scheduling. .
Patent Information
- Application Number
- CN202111568388.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-12-21
AI Technical Summary
Existing technology can easily lead to problems such as congestion, slow response speed, and packet loss when network device port traffic is too large, and it is difficult to improve the efficiency and flexibility of traffic scheduling strategies while ensuring the continued stability of the destination scheduling port.
By obtaining the probability of the historical optimal schedulable port, the historical total number of target ports, calculating the probability that the target port is the optimal schedulable port, and combining the Netconf command and Python language to obtain bandwidth traffic, determine whether the source IP address comes from the IP network of the source port. segment, determine the incoming traffic, reacquire bandwidth traffic, and determine the target port as the ideal and optimal schedulable port.
It improves the deployment efficiency and flexibility of traffic scheduling policies, ensures the continued stability of the destination scheduling port, and avoids network congestion and packet loss.
Smart Images

Figure CN114338470B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of network communications, and in particular relates to a method and system for determining port network traffic scheduling. Background Art
[0002] With the rapid development of computer technology and network communication technology, business requests in the network have become more and more frequent, and the network traffic generated has also increased significantly. When the traffic on the network device port is too large, the network will be blocked, the response speed will be slow, and even the data packet will be lost. When scheduling traffic, it is necessary to conduct a comprehensive evaluation of the scheduling destination port to ensure that the traffic is scheduled to a stable port. It is necessary to improve the efficiency and flexibility of traffic scheduling strategy deployment, and to ensure the continuous stability of the destination scheduling port. Summary of the invention
[0003] The present invention aims at the deficiencies in the prior art and provides a method and system for determining port network traffic scheduling.
[0004] In a first aspect, the present invention provides a method for determining port network traffic scheduling, comprising:
[0005] The probability of obtaining the best historical schedulable port;
[0006] Obtain the total number of historical data that the target port is the ideal optimal schedulable port;
[0007] Obtain the total number of historical data where the target port is a non-ideal optimal schedulable port;
[0008] Get the historical total number of optimal schedulable ports;
[0009] Calculate the probability that the target port is the optimal schedulable port;
[0010] Use Netconf command set and Python language to obtain the bandwidth flow of the optimal schedulable target port;
[0011] Determine whether the source IP address in the bandwidth traffic comes from the IP network segment of the source port;
[0012] If yes, determine that the bandwidth traffic is incoming traffic;
[0013] If not, re-obtain the optimal schedulable target port bandwidth flow;
[0014] The target port whose difference between the incoming flow and the source port flow is less than or equal to the target percentage of the total source port flow is determined as the ideal optimal schedulable port.
[0015] Furthermore, the port network traffic scheduling determination method also includes sniffing and capturing data for the network policy of the most likely optimally schedulable target port, analyzing the sniffed message to obtain a message quintuple, adding the program execution time, and storing it in a historical scheduling database; the message quintuple includes a source address, a destination address, a source port, a destination port, and a protocol.
[0016] Further, the calculating the probability that the target port is the optimal schedulable port includes:
[0017] The probability that the target port is the optimal schedulable port is calculated according to the following formula:
[0018]
[0019] Among them, DD(D|+) is the probability that the target port is the optimal schedulable port; DD(+|D) is the probability of the historical optimal schedulable port; DD(D) is the ratio of the historical total number of target ports that are ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(+|N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports.
[0020] In a second aspect, the present invention provides a port network traffic scheduling determination system, comprising:
[0021] A first acquisition module is used to obtain the probability of the historical optimal schedulable port;
[0022] The second acquisition module is used to obtain the total number of historical data that the target port is an ideal optimal schedulable port;
[0023] A third acquisition module is used to obtain a total number of historical data of target ports that are not ideal optimal schedulable ports;
[0024] A fourth acquisition module is used to obtain the total number of optimal schedulable ports in history;
[0025] A calculation module, used for calculating the probability that the target port is the optimal schedulable port;
[0026] A fifth acquisition module is used to obtain the bandwidth flow of the optimal schedulable target port by using a Netconf command set and combining the Python language;
[0027] A judgment module is used to judge whether the source IP address in the bandwidth flow comes from the IP network segment of the source port;
[0028] A determination module, used to determine that the bandwidth flow is an incoming flow when the judgment module determines that the source IP address in the bandwidth flow is from the IP network segment of the source port;
[0029] A sixth acquisition module, configured to reacquire the optimal schedulable target port bandwidth flow when the judgment module determines that the source IP address in the bandwidth flow does not come from the IP network segment of the source port;
[0030] The determination module is used to determine the target port whose difference between the introduced flow and the source port flow is less than or equal to the target percentage of the total source port flow as an ideal optimal schedulable port.
[0031] Furthermore, the calculation module includes:
[0032] The calculation unit is used to calculate the probability that the target port is the optimal schedulable port according to the following formula:
[0033]
[0034] Among them, DD(D|+) is the probability that the target port is the optimal schedulable port; DD(+|D) is the probability of the historical optimal schedulable port; DD(D) is the ratio of the historical total number of target ports that are ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(+|N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports.
[0035] The present invention provides a method and system for determining port network traffic scheduling, wherein the method includes obtaining the probability of the historical optimal schedulable port; obtaining the historical total number of the target port being the ideal optimal schedulable port; obtaining the historical total number of the target port being the unideal optimal schedulable port; obtaining the historical total number of the optimal schedulable port; calculating the probability of the target port being the optimal schedulable port; using the Netconf command set and combining the Python language to obtain the bandwidth flow of the optimal schedulable target port; judging whether the source IP address in the bandwidth flow comes from the IP network segment of the source port; if so, determining that the bandwidth flow is the introduced flow; if not, re-obtaining the bandwidth flow of the optimal schedulable target port; and determining the target port whose difference between the introduced flow and the source port flow is less than or equal to the target percentage of the total source port flow as the ideal optimal schedulable port. The present invention adopts the above scheme to improve the efficiency and flexibility of the deployment of the traffic scheduling strategy and ensure the continuous stability of the destination scheduling port. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 A workflow diagram of a port network traffic scheduling determination method provided by an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of the structure of a port network traffic scheduling and determination system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] like Figure 1 As shown, the embodiment of the present invention partially provides a method for determining port network traffic scheduling, including:
[0041] Step S101, obtaining the probability of the historical best schedulable port.
[0042] In this step, the probability of the historical optimal schedulable port is obtained by accessing the historical scheduling database, which stores the schedulable port source IP, port index, protocol type, and identification judgment. Netconf commands are used to collect traffic, and the traffic analysis program written in Python is used to collect source port traffic and calculate the port traffic bandwidth utilization. A switch port with a maximum rate of 100Mb has an incoming traffic of 20Mbps and an outgoing traffic of 10Mbps. The network bandwidth utilization is (20+10)Mb / 100Mb=30%.
[0043] Regarding the Python language, Python itself is designed to be extensible. Not all features and functions are integrated into the language core. Python provides a rich API and tools so that programmers can easily use C language, C++, Cython to write extension modules. The Python compiler itself can also be integrated into other programs that require scripting languages. The present invention utilizes its following features:
[0044] Embeddability: Python can be embedded into C / C++ programs, thus providing scripting capabilities to program users.
[0045] Rich libraries: The Python standard library is really huge. It can help handle a variety of tasks, including regular expressions, document generation, unit testing, threads, databases, web browsers, CGI, FTP, email, XML, XML-RPC, HTML, WAV files, password systems, GUI (graphical user interface), Tk and other system-related operations. This is called Python's "full-featured" concept. In addition to the standard library, there are many other high-quality libraries, such as wxPython, Twisted, and Python Image Library, etc. The following functions of Python are used in the implementation of the present invention:
[0046] Python->scapy function library:
[0047] Scapy is a Python program that enables users to send, sniff and dissect and forge network packets. This feature allows to build tools that can probe, scan or attack a network. In other words, Scapy is a powerful interactive packet manipulation program. It is able to forge or decode packets of a large number of protocols, send them over the wire, capture them, match requests and replies, and more. Scapy can easily handle most of the classic tasks such as scanning, tracerouting, probing, unit testing, attacks or network discovery. It can replace hping, arpspoof, arp-sk, arping, p0f and even some parts of Nmap, tcpdump and tshark.
[0048] Python->sr1 module
[0049] Scapy is a powerful tool written in Python. Currently, many excellent network scanning attack tools use this module. You can also use this module in your own program to send, monitor and parse network data packets. Compared with Nmap, this module is more basic. You can more intuitively understand various scanning attack behaviors in the network.
[0050] Python->sendp module
[0051] sendp: Send layer 2 data packets, Inter: Data packet sending interval (in seconds), loop: Set whether the program sends all the time, set this item to 1, otherwise set it to 0.
[0052] Step S102, obtaining the total number of target ports that are ideal optimal schedulable ports;
[0053] Step S103, obtaining the total number of historical cases where the target port is a non-ideal optimal schedulable port;
[0054] Step S104, obtaining the total number of optimal schedulable ports in history;
[0055] Step S105, calculating the probability that the target port is the optimal schedulable port.
[0056] In this step, the probability that the target port is the optimal schedulable port is calculated according to the following formula:
[0057]
[0058] Among them, DD(D|+) is the probability that the target port is the optimal schedulable port; DD(+|D) is the probability of the historical optimal schedulable port; DD(D) is the ratio of the historical total number of target ports that are ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(+|N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports.
[0059] Step S106, using the Netconf command set and combining with the Python language to obtain the bandwidth flow of the optimal schedulable target port;
[0060] Step S107, determining whether the source IP address in the bandwidth flow is from the IP network segment of the source port;
[0061] Step S108, if yes, determine the bandwidth traffic as incoming traffic;
[0062] Step S109, if not, re-obtain the optimal schedulable target port bandwidth flow;
[0063] Step S1010: Determine the target port whose difference between the imported traffic and the source port traffic is less than or equal to the target percentage of the total source port traffic as the ideal optimal schedulable port.
[0064] Steps S101-S1010 improve the efficiency and flexibility of traffic scheduling strategy deployment and ensure the continuous stability of the destination scheduling port.
[0065] Optionally, the port network traffic scheduling determination method also includes sniffing and capturing data for the network policy of the most likely optimal schedulable target port, analyzing the sniffed message to obtain a message quintuple, adding the program execution time, and storing it in a historical scheduling database; the message quintuple includes a source address, a destination address, a source port, a destination port, and a protocol.
[0066] Execute through Python program, use sniff() function to sniff packets purposefully according to the destination port, and filter to filter and schedule network policy packets; (sniff is used to sniff packets, and filter sets filtering conditions for packets)
[0067] Sniff and capture packets for the network policy obtained through scheduling, and analyze the sniffed packets to obtain the five-tuple of packets, including source address, destination address, source port, destination port, and protocol, and then add timestamps for classified storage;
[0068] Analyze the five-tuple information of the message in combination with the timestamp, and obtain the message analysis features within the time range from the start to the end of the scheduling:
[0069] Within a certain time range, such as between 0:00 today and 0:00 the next day, when the traffic is dispatched to the new network port, the program executes the five-tuple parsing to obtain the source, destination IP and other information, store it in the database and analyze it. For example: the network traffic value introduced by the five-tuple source IP is 20M, and the traffic introduced to the new port by the two strategies of the source port is 25M, then the efficiency of the existing port to introduce traffic is 20 / 25=80%. The higher the index, the better the drainage effect. Due to network abnormalities or transmission problems, it may not be 100%.
[0070] By analyzing whether the source IP address in the traffic comes from the IP address segment of the specified source port within a certain time range and abstracting it as an introduction identifier, the stability of network transmission at the destination port of network traffic scheduling is comprehensively determined by combining the current network port packet loss rate, delay milliseconds and other indicators that affect network transmission quality.
[0071] The introduced flag is 0 for introduced traffic and 1 for not introduced traffic.
[0072] like Figure 2 As shown, the embodiment of the present invention also provides a port network traffic scheduling determination system, including:
[0073] A first acquisition module 10 is used to obtain the probability of the historical optimal schedulable port;
[0074] The second acquisition module 20 is used to obtain the total number of target ports that are ideal optimal schedulable ports;
[0075] The third acquisition module 30 is used to obtain the total number of historical data that the target port is a non-ideal optimal schedulable port;
[0076] A fourth acquisition module 40 is used to acquire the total number of optimal schedulable ports in history;
[0077] A calculation module 50, used for calculating the probability that the target port is the optimal schedulable port;
[0078] A fifth acquisition module 60 is used to obtain the bandwidth flow of the optimal schedulable target port by using a Netconf command set and combining the Python language;
[0079] A determination module 70 is used to determine whether the source IP address in the bandwidth flow is from the IP network segment of the source port;
[0080] A determination module 80, configured to determine that the bandwidth flow is an incoming flow when the judgment module determines that the source IP address in the bandwidth flow is from the IP network segment of the source port;
[0081] A sixth acquisition module 90, configured to reacquire the optimal schedulable target port bandwidth flow when the judgment module determines that the source IP address in the bandwidth flow does not come from the IP network segment of the source port;
[0082] The determination module 100 is used to determine a target port whose difference between the incoming flow and the source port flow is less than or equal to the target percentage of the total source port flow as an ideal optimal schedulable port.
[0083] Optionally, the calculation module includes:
[0084] The calculation unit is used to calculate the probability that the target port is the optimal schedulable port according to the following formula:
[0085]
[0086] Among them, DD(D|+) is the probability that the target port is the optimal schedulable port; DD(+|D) is the probability of the historical optimal schedulable port; DD(D) is the ratio of the historical total number of target ports that are ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(+|N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports.
[0087] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention or some parts of the embodiments.
[0088] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
[0089] The present invention has been described in detail above in conjunction with specific implementations and exemplary examples, but these descriptions cannot be understood as limiting the present invention. Those skilled in the art understand that, without departing from the spirit and scope of the present invention, a variety of equivalent substitutions, modifications or improvements may be made to the technical solution of the present invention and its implementation methods, all of which fall within the scope of the present invention. The scope of protection of the present invention shall be subject to the attached claims.
Claims
1. A method for determining port network traffic scheduling, characterized in that: include: The probability of obtaining the historical best schedulable port; Obtain the total number of historical data that the target port is the ideal optimal schedulable port; Obtain the total number of historical data where the target port is a non-ideal optimal schedulable port; Get the historical total number of optimal schedulable ports; Calculate the probability that the target port is the optimal schedulable port; perform data sniffing and packet capture on the network policy of the optimal schedulable target port with the highest probability, analyze the sniffed message to obtain a five-tuple message, add the program execution time, and store it in a historical scheduling database; the five-tuple message includes a source address, a destination address, a source port, a destination port, and a protocol; Use Netconf command set and Python language to obtain the bandwidth flow of the optimal schedulable target port; Determine whether the source IP address in the bandwidth traffic comes from the IP network segment of the source port; If yes, determine that the bandwidth traffic is incoming traffic; If not, re-obtain the optimal schedulable target port bandwidth flow; The target port whose difference between the incoming flow and the source port flow is less than or equal to the target percentage of the total source port flow is determined as the ideal optimal schedulable port; The calculating of the probability that the target port is the optimal schedulable port includes: The probability that the target port is the optimal schedulable port is calculated according to the following formula: ; Among them, DD(D|+) is the probability that the target port is the optimal schedulable port; DD(+|D) is the probability of the historical optimal schedulable port; DD(D) is the ratio of the historical total number of target ports that are ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(+|N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports.
2. A port network traffic scheduling determination system, characterized in that: include: A first acquisition module is used to obtain the probability of the historical optimal schedulable port; The second acquisition module is used to obtain the total number of historical data that the target port is an ideal optimal schedulable port; A third acquisition module is used to obtain a total number of historical data of target ports that are not ideal optimal schedulable ports; A fourth acquisition module is used to obtain the total number of optimal schedulable ports in history; A calculation module, used for calculating the probability that the target port is the optimal schedulable port; A fifth acquisition module is used to obtain the bandwidth flow of the optimal schedulable target port by using a Netconf command set and combining the Python language; A judgment module is used to judge whether the source IP address in the bandwidth flow comes from the IP network segment of the source port; A determination module, used to determine that the bandwidth flow is an incoming flow when the judgment module determines that the source IP address in the bandwidth flow is from the IP network segment of the source port; A sixth acquisition module, configured to reacquire the optimal schedulable target port bandwidth flow when the judgment module determines that the source IP address in the bandwidth flow does not come from the IP network segment of the source port; A determination module, used for determining a target port whose difference between the incoming flow and the source port flow is less than or equal to the target percentage of the total source port flow as an ideal optimal schedulable port; The calculation module includes: a calculation unit, which is used to calculate the probability that the target port is the optimal schedulable port according to the following formula: ; Among them, DD(D|+) is the probability that the target port is the optimal schedulable port; DD(+|D) is the probability of the historical optimal schedulable port; DD(D) is the ratio of the historical total number of target ports that are ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(+|N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports; DD(N) is the ratio of the historical total number of target ports that are non-ideal optimal schedulable ports to the historical total number of optimal schedulable ports.
