CN116192696A - Method, device and storage medium for traffic congestion prevention configuration - Google Patents

Method, device and storage medium for traffic congestion prevention configuration Download PDF

Info

Publication number
CN116192696A
CN116192696A CN202310056728.5A CN202310056728A CN116192696A CN 116192696 A CN116192696 A CN 116192696A CN 202310056728 A CN202310056728 A CN 202310056728A CN 116192696 A CN116192696 A CN 116192696A
Authority
CN
China
Prior art keywords
port
serial number
ports
determining
sending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310056728.5A
Other languages
Chinese (zh)
Inventor
张晓敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Teletest Technology Co ltd
Original Assignee
Beijing Teletest 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 Beijing Teletest Technology Co ltd filed Critical Beijing Teletest Technology Co ltd
Priority to CN202310056728.5A priority Critical patent/CN116192696A/en
Publication of CN116192696A publication Critical patent/CN116192696A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • 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/12Avoiding congestion; Recovering from congestion
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

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

Abstract

The method comprises the steps of obtaining the number of a plurality of ports of tested equipment, determining the number of rounds of sending traffic packets based on the number of the plurality of ports, obtaining a port configuration scheme corresponding to each port in each sending round when determining each port as a sending port, determining a traffic packet sending scheme of the tested equipment based on the port configuration scheme corresponding to each port, wherein each port in each round of sending scheme of the traffic packet is only used as a sending port and is only used as a receiving port. The method and the device can reduce traffic congestion.

Description

Method, device and storage medium for traffic congestion prevention configuration
Technical Field
The present invention relates to the field of traffic configuration, and in particular, to a method, an apparatus, and a storage medium for traffic congestion prevention configuration.
Background
In network testing of network devices (e.g., devices such as switches and routers), such as translation performance and routing performance, network testers are typically used to test the network devices. The network device is usually provided with a plurality of ports, a transmitting port and a receiving port are required to be determined from the plurality of ports in the working process of the network tester at present, the network tester and other devices send a flow packet to the transmitting port, the receiving port receives the flow packet, and the performance of the device to be tested at present is detected by observing the transmission condition of the flow packet.
In the process of detecting the tested equipment by the network tester at present, one receiving port receives flow packets of a plurality of sending ports at the same time, so that when the number of the flow packets is large, the receiving port is easy to have a congestion, the packet loss is caused, and the accuracy of the detection result of the network tester is lower.
Disclosure of Invention
In order to reduce the probability of traffic congestion in the test process, the application provides a method, a device and a storage medium for traffic congestion prevention configuration.
In a first aspect, the present application provides a method for traffic congestion prevention configuration, which adopts the following technical scheme:
a method of traffic congestion prevention configuration, comprising:
acquiring the number of a plurality of ports of the tested device;
determining a number of rounds of transmitting traffic packets based on the number of the plurality of ports;
when each port is determined to be a transmitting port, a corresponding receiving port in each transmitting round is determined to obtain a port configuration scheme corresponding to each port;
and determining a traffic packet transmission scheme of the tested device based on a port configuration scheme corresponding to each port, wherein each port in each round of transmission scheme of the traffic packet transmission scheme is only used as a primary transmission port and is only used as a primary receiving port.
By adopting the technical scheme, the number of the plurality of ports of the tested equipment is acquired, so that the number of the rounds of sending the flow packets is conveniently determined according to the number of the plurality of the ports, when each port is determined to be the sending port, the corresponding receiving port in each sending round is obtained, so that the port configuration scheme corresponding to each port is obtained, the flow packet sending scheme of the tested equipment is conveniently determined according to the port configuration scheme corresponding to each port, in the sending scheme of each round of the flow packet sending scheme, each port is only used as a sending port and is only used as a receiving port, the condition that one port is used as the receiving port of a plurality of sending ends is reduced, and the probability of flow congestion of the tested equipment in the testing process is further reduced.
In another possible implementation manner, when determining each port as a transmitting port, obtaining a port configuration scheme corresponding to each port in each transmitting round, where the determining includes:
acquiring the arrangement sequence of a plurality of ports and the serial number of each port, wherein the serial number of each port is the serial number of each port minus one in the position serial number in the arrangement sequence;
Determining a current sending port according to the arrangement sequence;
determining the sum of a first serial number and a second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current transmitting port, and the second serial number is the serial number of the second port in the arrangement sequence;
executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports; the first cycling step includes:
determining the sum of a first serial number and a third serial number, wherein the first serial number is the serial number of the current sending port, performing a remainder operation on the sum and the number of ports to obtain a remainder value, determining the port corresponding to the remainder value as a receiving port, adding one to the current third serial number to obtain a third serial number in the next receiving port determination period, and judging whether the current third serial number is the largest serial number in the serial numbers of each port;
circularly executing a second circulation step until the current sending port is the last port in the arrangement sequence, so as to obtain a port configuration scheme corresponding to each port;
The second cycling step comprises:
determining a current sending port according to the arrangement sequence;
determining the sum of a first serial number and a second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current transmitting port, and the second serial number is the serial number of the second port in the arrangement sequence;
and executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports.
By adopting the technical scheme, the arrangement sequence of the plurality of ports and the serial number of each port are obtained, wherein the serial number of each port is the serial number of the position of each port in the arrangement sequence minus one, namely, the serial number of each port is smaller than the position serial number of each port in the arrangement sequence, the current transmitting port is determined according to the arrangement sequence, the first serial number is the serial number of the current transmitting port, the second serial number is the serial number of the second port in the arrangement sequence, the first serial number and the second serial number are summed, the obtained sum and the number of the ports are subjected to operation to obtain a residual value, the port corresponding to the residual value is determined as the receiving port, the effect of determining the receiving port corresponding to the current transmitting port in the first transmitting round is achieved, the second serial number is added one to obtain the third serial number, and the first circulation step is executed until the third serial number is the maximum serial number in the serial number of each port, and the effect of determining the receiving port corresponding to the current transmitting round in each transmitting round is achieved. The first circulation step includes determining a sum of a first sequence number and a third sequence number, wherein the first sequence number is a sequence number of a current sending port, performing a sum operation on the obtained sum and the number of ports to obtain a remainder value, determining the port corresponding to the remainder value as a receiving port, adding one to the current third sequence number to obtain a third sequence number in a next receiving port determination period, and judging whether the current third sequence number is a maximum sequence number in the sequence numbers of each port, so that whether all receiving ports corresponding to the current sending port are determined is facilitated. When the current third serial number is the largest serial number in the serial numbers of each port, the fact that all receiving ports in the current sending port are confirmed to be completed is indicated, a second circulation step is executed in a circulation mode until the current sending port is the last port in the arrangement sequence, so that a port configuration scheme corresponding to each port is obtained, wherein the second circulation step comprises the steps of confirming the current sending port according to the arrangement sequence, enabling the first serial number to be the serial number of the current sending port, enabling the second serial number to be the serial number of the second port in the arrangement sequence, summing the first serial number and the second serial number, enabling the sum to be subjected to a remainder value, enabling ports corresponding to the remainder value to be confirmed to be the receiving port, enabling the second serial number to be added with 1, obtaining the third serial number, and executing the first circulation step in a circulation mode until the third serial number is the largest serial number in the serial number of each port, and therefore the effect of confirming the port configuration scheme corresponding to each port is achieved.
In another possible implementation, the method further includes:
determining a sum of a first value and a second value, wherein the first value is a value of any sending round, and the second value is a serial number of each port;
calculating the sum and the remainder value of the number of the plurality of ports;
and determining the port corresponding to the residual value as a receiving port when each port is used as a transmitting end in any transmitting round.
By adopting the technical scheme, the first value is the value of any sending round, the second value is the serial number of each port, the first value and the second value are summed, the sum and the number of the plurality of ports are subjected to residual operation to obtain the residual value, the port corresponding to the residual value is determined to be the receiving port of each port when the port is used as the sending end in any sending round, and therefore the effect of determining the receiving port of each port in each sending round is achieved.
In another possible implementation manner, the acquiring the arrangement order of the plurality of ports further includes:
judging whether ports with a preset port configuration scheme exist in the ports or not;
and if so, determining the arrangement sequence of the plurality of ports based on the preset port configuration scheme.
By adopting the technical scheme, the preset port configuration scheme is a preset configuration scheme, and whether ports with the preset port configuration scheme exist in the ports is judged, so that the subsequent arrangement sequence which is specifically based on when the port configuration scheme of each port is determined is conveniently determined. When a port with a preset port configuration scheme exists, determining the arrangement sequence of a plurality of ports according to the preset port configuration scheme. The port configuration scheme of each port can be conveniently determined according to the sequence, and the preset port configuration scheme can be included, so that the effect of calculating the port configuration scheme of each port on the basis of meeting the user requirements is achieved.
In another possible implementation, the method further includes:
outputting at least two preset port configuration schemes if at least two ports with the preset port configuration schemes exist;
determining a target preset port configuration scheme according to a confirmation instruction triggered by a user;
and determining the arrangement sequence of the plurality of ports based on the target preset port configuration scheme.
By adopting the technical scheme, when at least two ports with preset port configuration schemes exist, at least two arrangement sequences are generated when the ports with the preset port configuration schemes exist, so that the port configuration schemes of the ports can not be determined according to the arrangement sequences, the at least two preset port configuration schemes can be output, a user can conveniently determine the arrangement sequences for generating the port configuration schemes, a target preset port configuration scheme is determined according to a confirmation instruction triggered by the user, and the arrangement sequences of the ports are determined according to the target preset port configuration scheme, so that the effect that when the ports with the preset port configuration schemes exist, the unique arrangement sequences can be determined is achieved.
In another possible implementation manner, the determining a traffic packet transmission scheme of the device under test based on the port configuration scheme corresponding to each port further includes:
transmitting a specified number of traffic packets to each port;
acquiring the quantity of flow packets of each port at a corresponding receiving port in each sending round;
and determining a detection result of the tested device based on the quantity of the flow packets and the designated quantity.
By adopting the technical scheme, the specified number of flow packets are sent to each port, the number of the flow packets at the corresponding receiving port of each port in each sending round is obtained, and the detection result of the tested equipment is determined according to the number of the flow packets and the specified number, so that the purpose of detecting the tested equipment is achieved.
In another possible implementation, the method further includes:
acquiring the packet length of the flow packet corresponding to each port;
judging whether the packet lengths of the flow packets corresponding to each port are the same or not;
if the traffic packets are different, determining the rate proportion of the ports based on the packet length of each traffic packet, wherein the rate proportion is the speed ratio of the ports for transmitting the traffic packets;
And setting transmission rates of the plurality of ports based on the rate ratio.
By adopting the technical scheme, the packet length of the flow packet corresponding to each port is obtained, whether the packet length of the flow packet corresponding to each port is the same or not is judged, so that whether the flow packet transmitted by each port can reach the receiving port simultaneously is judged, when the flow packets are different, the flow packet cannot reach the receiving port simultaneously if each port transmits the flow packet according to the same transmission rate, therefore, the rate ratio of the plurality of ports can be determined according to the packet length of each flow packet, wherein the rate ratio is the speed ratio of the flow packet transmitted by the plurality of ports, and the transmission rate of the plurality of ports is set according to the rate ratio, so that the flow packet of each transmitting end can reach the receiving port simultaneously, and the situation of flow congestion can be effectively reduced when the tested equipment is detected according to the flow packet transmission scheme.
In a second aspect, the present application provides a device for traffic congestion prevention configuration, which adopts the following technical scheme:
an apparatus of traffic congestion prevention configuration, comprising:
the first acquisition module is used for acquiring the number of a plurality of ports of the tested device;
A first determining module, configured to determine a number of rounds of sending traffic packets based on the number of the plurality of ports;
the second determining module is used for determining the corresponding receiving port in each sending round when each port is used as a sending port, and obtaining a port configuration scheme corresponding to each port;
and the third determining module is used for determining a flow packet sending scheme of the tested device based on a port configuration scheme corresponding to each port, wherein each port in each round of sending scheme of the flow packet sending scheme is only used as a sending port once and is only used as a receiving port once.
By adopting the technical scheme, the first acquisition module acquires the number of the plurality of ports of the tested device, so that the subsequent first determination module determines the number of rounds of sending the flow packets according to the number of the plurality of ports, and the second determination module determines that each port is used as a receiving port in each sending round, so that a port configuration scheme corresponding to each port is obtained, and therefore, the third determination module determines the flow packet sending scheme of the tested device according to the port configuration scheme corresponding to each port, and in each round of sending scheme of the flow packet sending scheme, each port is only used as a sending port and is only used as a receiving port, so that the condition that one port is used as the receiving port of a plurality of sending ends is reduced, and the probability of flow congestion of the tested device in the testing process is further reduced.
In another possible implementation manner, when determining each port as a transmitting port, the second determining module is specifically configured to, when obtaining a port configuration scheme corresponding to each port, in a corresponding receiving port in each transmitting round:
acquiring the arrangement sequence of a plurality of ports and the serial number of each port, wherein the serial number of each port is the serial number of each port minus one in the position serial number in the arrangement sequence;
determining a current sending port according to the arrangement sequence;
determining the sum of a first serial number and a second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current transmitting port, and the second serial number is the serial number of the second port in the arrangement sequence;
executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports; the first cycling step includes:
determining the sum of a first serial number and a third serial number, wherein the first serial number is the serial number of the current sending port, performing a remainder operation on the sum and the number of ports to obtain a remainder value, determining the port corresponding to the remainder value as a receiving port, adding one to the current third serial number to obtain a third serial number in the next receiving port determination period, and judging whether the current third serial number is the largest serial number in the serial numbers of each port;
Circularly executing a second circulation step until the current sending port is the last port in the arrangement sequence, so as to obtain a port configuration scheme corresponding to each port;
the second cycling step comprises:
determining a current sending port according to the arrangement sequence;
determining the sum of a first serial number and a second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current transmitting port, and the second serial number is the serial number of the second port in the arrangement sequence;
and executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports.
In another possible implementation, the apparatus further includes:
a fourth determining module, configured to determine a sum of a first value and a second value, where the first value is a value of any sending round, and the second value is a serial number of each port;
a calculation module, configured to calculate a remainder value of the sum and the number of the plurality of ports;
and a fifth determining module, configured to determine, for each port corresponding to the residual value, a receiving port when each port is used as a transmitting end in any transmitting round.
In another possible implementation, the apparatus further includes:
the first judging module is used for judging whether ports with a preset port configuration scheme exist in the plurality of ports or not;
and a sixth determining module, configured to determine, when the plurality of ports exist, an arrangement order of the plurality of ports based on the preset port configuration scheme.
In another possible implementation, the apparatus further includes:
the output module is used for outputting at least two preset port configuration schemes when at least two ports with the preset port configuration schemes exist;
a seventh determining module, configured to determine a target preset port configuration scheme according to a confirmation instruction triggered by a user;
and an eighth determining module, configured to determine an arrangement order of the plurality of ports based on the target preset port configuration scheme.
In another possible implementation, the apparatus further includes:
a sending module, configured to send a specified number of traffic packets to each port;
the second acquisition module is used for acquiring the quantity of the flow packets at the corresponding receiving port in each sending round of each port;
and a ninth determining module, configured to determine a detection result of the device under test based on the number of traffic packets and the specified number.
In another possible implementation, the apparatus further includes:
a third obtaining module, configured to obtain a packet length of a flow packet corresponding to each port;
the second judging module is used for judging whether the packet lengths of the flow packets corresponding to each port are the same or not;
a tenth judging module, configured to determine, when the packet lengths of the traffic packets are different, a rate ratio of the plurality of ports based on the packet length of each traffic packet, where the rate ratio is a speed ratio of the plurality of ports to transmit the traffic packets;
and the setting module is used for setting the transmission rates of the plurality of ports based on the rate proportion.
In a third aspect, the present application provides an electronic device, which adopts the following technical scheme:
an electronic device, the electronic device comprising:
at least one processor;
a memory;
at least one application program, wherein the at least one application program is stored in the memory and configured to be executed by the at least one processor, the at least one application program configured to: a method of traffic congestion prevention configuration according to any of the possible implementations of the first aspect is performed.
In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
A computer readable storage medium, which when executed in a computer causes the computer to perform the method of traffic congestion prevention configuration according to any of the first aspects.
In summary, the present application includes at least one of the following beneficial technical effects:
1. the method comprises the steps of obtaining the number of a plurality of ports of tested equipment, so that the number of rounds of sending traffic packets is conveniently determined according to the number of the plurality of ports, when each port is used as a sending port, a corresponding receiving port in each sending round is determined, and accordingly a port configuration scheme corresponding to each port is obtained, so that the traffic packet sending scheme of the tested equipment is conveniently determined according to the port configuration scheme corresponding to each port, in each round of the traffic packet sending scheme, each port is only used as a sending port and is only used as a receiving port, the situation that one port is used as a receiving port of a plurality of sending ends is reduced, and the probability of traffic congestion of the tested equipment in the testing process is further reduced;
2. the first value is the value of any sending round, the second value is the serial number of each port, the first value and the second value are summed, the sum and the number of the plurality of ports are subjected to residual operation to obtain residual values, the port corresponding to the residual values is determined to be the receiving port of each port in any sending round when the port is used as a sending end, and therefore the effect of determining the receiving port of each port in each sending round is achieved.
Drawings
Fig. 1 is a flow chart of a method for traffic congestion prevention configuration in an embodiment of the present application.
Fig. 2 is a schematic structural diagram of an apparatus for traffic congestion prevention configuration in an embodiment of the present application.
Fig. 3 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
The present application is described in further detail below in conjunction with figures 1-3.
Modifications of the embodiments which do not creatively contribute to the invention may be made by those skilled in the art after reading the present specification, but are protected by patent laws only within the scope of claims of the present application.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In addition, the term "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In this context, unless otherwise specified, the term "/" generally indicates that the associated object is an "or" relationship.
Embodiments of the present application are described in further detail below with reference to the drawings attached hereto.
The embodiment of the application provides a method for traffic congestion prevention configuration, which is executed by electronic equipment, wherein the electronic equipment can be a server or terminal equipment, and the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server for providing cloud computing service. The terminal device may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., and the terminal device and the server may be directly or indirectly connected through wired or wireless communication, which is not limited herein, and as shown in fig. 1, the method includes: step S101, step S102, step S103, and step S104, wherein,
step S101, the number of the plurality of ports of the device under test is acquired.
For the embodiment of the application, the number of a plurality of ports of the tested device is obtained, so that the number of rounds of sending the flow packets can be determined according to the number. Assume that the number of ports of the device under test is currently 4.
Step S102, the number of the rounds of sending the flow packets is determined based on the number of the plurality of ports.
For the embodiment of the present application, taking step S101 as an example, the number of the multiple ports of the current tested device is 4, and it is determined that the number of the rounds of sending the traffic packet is 3. The number of the rounds of sending the flow packets is specifically determined, and the number of the multiple ports of the tested device can be subtracted by one, namely the number of the rounds of sending the flow packets.
Step S103, when each port is determined to be a transmitting port, a corresponding receiving port in each transmitting round is determined, and a port configuration scheme corresponding to each port is obtained.
For the embodiment of the application, each port is determined to be the receiving port corresponding to each sending round as the sending end, so that the port configuration scheme corresponding to each port is obtained, and the subsequent determination of the flow packet sending scheme of the tested device according to the port configuration scheme is facilitated. Taking step S101 and step S102 as an example, assume that the current 4 ports are port a, port b, port c, and port d, respectively. Assuming that the port a corresponds to the receiving port b in the 1 st transmission round, the receiving port c in the 2 nd transmission round, and the receiving port d in the 3 rd transmission text, the port configuration schemes corresponding to the port a may be a-b, a-c, and a-d.
Step S104, determining a flow packet transmission scheme of the tested device based on the port configuration scheme corresponding to each port.
Each port in each round of transmission scheme of the traffic packet transmission scheme is only used as a primary transmission port, and is only used as a primary receiving port.
For the embodiment of the application, the flow packet sending scheme of the tested device is determined according to the port configuration scheme corresponding to each port, and because each port is only used as a sending port and only used as a receiving port once in each round of sending scheme of the flow packet sending scheme, when the tested device is tested according to the flow packet sending scheme, the condition that one port is used as the receiving ports of a plurality of sending ends is effectively reduced, and the probability of flow congestion of the tested device in the testing process is further reduced.
Taking step S103 as an example, the port configuration schemes corresponding to the port a are a-b, a-c and a-d. Let port b correspond to port configuration schemes b-c, b-d, and b-a. The port configuration schemes corresponding to the port c are c-d, c-a and c-b. The port configuration schemes corresponding to the port d are d-a, d-b and d-c. The determined traffic packet transmission scheme of the tested device is port a: a-b, a-c, a-d, port b: b-c, b-d, b-a, port c: c-d, c-a, and c-b, and port d: d-a, d-b and d-c. It is apparent that in the first round transmission scheme (a-b, b-c, c-d, and d-a), each port acts as a primary transmit port and a primary receive port only. Therefore, in each round of transmission scheme, one port is not used as a receiving port corresponding to a plurality of transmitting ports, and the effect of preventing traffic congestion is achieved.
In this embodiment of the present application, for convenience in describing description according to one data stream, that is, when transmitting according to a transmission scheme, only one data stream is used for detection, because each data stream may correspond to different detection contents, for example, an S1 data stream may be used as a case when detecting that a device under test runs ipv4, an S2 data stream may be used as a case when detecting that a device under test runs ipv6, so that multiple data streams may be set according to a user requirement for detection, for example, the S1 data stream may be first put into the transmission scheme to detect the case that the device under test runs ipv4, and when the electronic device detects that the operation of the S1 data stream according to the transmission scheme is completed, the S2 data stream may be automatically put into the transmission scheme so as to continuously detect the running condition of ipv 6.
In this embodiment of the present application, when detecting that a user needs to detect multiple streams, a corresponding number of transmission schemes may be generated according to the number of data streams, that is, the detection schemes when each data stream runs may be different, for example, two streams of an S1 data stream and an S2 data stream are currently calculated correspondingly, and the S1 data stream is placed in the first transmission scheme and the S2 data stream is placed in the second transmission scheme.
In one possible implementation manner of the embodiment of the present application, when determining each port as a transmitting port, step S103 includes step S1031 (not shown in the figure), step S1032 (not shown in the figure), step S1033 (not shown in the figure), step S1034 (not shown in the figure), and step S1035 (not shown in the figure) in each transmitting round corresponding to the receiving port, and obtaining a port configuration scheme corresponding to each port,
step S1031, obtaining the arrangement sequence of the plurality of ports and the serial number of each port.
The serial number of each port is the serial number of each port minus one in the position serial number in the arrangement sequence.
For the embodiment of the application, the arrangement sequence of the plurality of ports and the serial number of each port are obtained, wherein the serial number of each port is the serial number of the position of each port in the arrangement sequence minus one, that is, the serial number of each port is one less than the position serial number of each port in the arrangement sequence. Assuming that the plurality of ports are port a, port b, port c and port d, and the order is port a, port b, port c and port d, the serial number of port a is 0, the serial number of port b is 1, the serial number of port c is 2 and the serial number of port d is 3.
Step S1032, determining the current transmitting port according to the arrangement sequence.
For the embodiment of the application, the current sending port is determined according to the arrangement sequence, so that the port needing to be configured currently is determined. Let the current transmit port be port a.
Step S1033, determining the sum of the first serial number and the second serial number, performing remainder operation on the sum and the number of ports to obtain remainder values, determining the port corresponding to the remainder values as a receiving port, and adding one to the second serial number to obtain a third serial number.
The first serial number is the serial number of the current sending port, and the second serial number is the serial number of the second port in the arrangement sequence.
For the embodiment of the present application, taking step S1031 as an example, the first sequence number is the sequence number of the current transmitting port, and assuming that the first sequence number is 0 and the second sequence number is the sequence number of the second port in the permutation sequence, the second sequence number is 1. Summing the first serial number and the second serial number to obtain a sum of 1, performing remainder operation on the 1 and the number of ports 4 to obtain a value of 1, determining the port corresponding to the 1 as a receiving port, namely determining the port b as the receiving port, and adding 1 to the second serial number to obtain a third serial number, namely, the third serial number is 2.
Step S1034, the first loop step is performed until the third sequence number is the largest sequence number among the sequence numbers of each port.
Wherein the first cycling step comprises:
determining the sum of a first serial number and a third serial number, wherein the first serial number is the serial number of the current transmitting port, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding the current third serial number to obtain a third serial number in the next receiving port determining period, and judging whether the current third serial number is the largest serial number in the serial numbers of each port.
For the embodiment of the present application, taking step S1031 as an example, the current transmitting end is taken as a port a, according to step S1033, it is determined that the receiving port of the port a in the first transmitting round is a port b, the first serial number is the serial number of the current transmitting port, that is, the first serial number is 0, the third serial number is 2, the sum of 0 and 2 is obtained, 2 and the number 4 are subjected to remainder taking operation, and the remainder is 2, because the port corresponding to 2 is a port C, the port C is determined as the receiving port of the port a in the second transmitting round, the step is circularly performed, it is determined that the receiving port corresponding to the port a in the first transmitting round is a port b, the receiving port corresponding to the second transmitting round is a port C, and the receiving port corresponding to the third transmitting round is a port d, thereby achieving the effect of determining the receiving port corresponding to each transmitting round of the current transmitting port. When the third serial number is 3, it indicates that the port configuration scheme of the port a has been found, that is, the execution of the first loop step is stopped.
Step S1035, the second circulation step is circularly executed until the current sending port is the last port in the arrangement order, so as to obtain the port configuration scheme corresponding to each port.
Wherein the second cycling step comprises:
determining a current transmitting port according to the arrangement sequence;
determining the sum of the first serial number and the second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current transmitting port, and the second serial number is the serial number of the second port in the arrangement sequence;
and executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports.
For the embodiment of the present application, the second loop step is performed in a loop until the current transmitting port is the last port in the permutation sequence, that is, when the first serial number is 3, it is indicated that the port configuration scheme of the port d is being calculated at this time, and since the port d is the last port in the permutation sequence, the second loop step is stopped. And the second circulation step comprises determining the current transmitting port according to the arrangement sequence, wherein the first serial number is the serial number of the current transmitting port, the second serial number is the serial number of the second port in the arrangement sequence, summing the first serial number and the second serial number, performing residual operation on the obtained sum and the number of the ports, obtaining residual values, determining the ports corresponding to the residual values as receiving ports, adding 1 to the second serial number, obtaining a third serial number, and performing the first circulation step in a circulation mode until the third serial number is the largest serial number in the serial numbers of the ports, thereby achieving the effect of determining the port configuration scheme corresponding to the ports.
For the embodiment of the present application, when each port is used as a transmitting end, the second loop step is corresponding to one time, and the first loop step is executed three times when the second loop step is executed once.
In the embodiment of the present application, the number of the plurality of ports may be an even number, and the plurality of ports may be divided into two parts on average, where one part is used as a transmitting port and the other part is used as a receiving port. For example, when calculating the configuration scheme corresponding to each port, the current multiple ports are port a, port b, port c, port d, port e and port f, the arrangement sequence of the multiple ports and the serial number of each port may be obtained, where the serial number of each port is the serial number of each port minus one in the position serial number in the arrangement sequence, and the current transmitting port is determined according to the arrangement sequence; determining the sum of the first serial number and the second serial number, performing residual taking operation on the sum and the number of ports to obtain a residual taking value, judging whether the port corresponding to the residual taking value belongs to a receiving port, if so, determining the port as the receiving port corresponding to the sending port, and adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current sending port, and the second serial number is the serial number of the second port in the arrangement sequence; and executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports.
Wherein the first cycling step comprises:
determining the sum of a first serial number and a third serial number, wherein the first serial number is the serial number of a current transmitting port, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, judging whether the port corresponding to the remainder taking value belongs to a receiving port, if so, determining the port as the receiving port corresponding to the current transmitting port, adding the current third serial number to obtain a third serial number in a next receiving port determining period, judging whether the current third serial number is the largest serial number in the serial number of each port, and circularly executing a second circulation step until the current transmitting port is the last port of the transmitting ports in the arrangement sequence to obtain a port configuration scheme corresponding to each port.
Wherein the second cycling step comprises:
determining a current transmitting port according to the arrangement sequence;
determining the sum of the first serial number and the second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, judging whether the port corresponding to the remainder taking value belongs to a receiving port, if so, determining the port as the receiving port corresponding to the sending port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current sending port, the second serial number is the serial number of the second port in the arrangement sequence, and executing a first circulation step until the third serial number is the largest serial number in the serial numbers of all the ports.
One possible implementation manner of the embodiment of the present application further includes step S105 (not shown in the figure), step S106 (not shown in the figure), and step S107 (not shown in the figure), where,
step S105, determining a sum of the first value and the second value.
The first value is the value of any sending round, and the second value is the serial number of each port.
For the embodiment of the present application, the first value is the value of any transmission round, and if the current transmission round is 1, the first value is 1, the second value is the serial number of each port, and if the serial number of port a is 0, the serial number of port b is 1, the serial number of port c is 2, and the serial number of port d is 3. Assuming that the receiving port of the port a at the first transmission round is currently to be determined, the second value is 0. The sum of the first value and the second value is determined to be 1.
Step S106, calculating the sum and the remainder of the number of the plurality of ports.
For the embodiment of the present application, 1 is divided by the number of multiple ports 4, resulting in a remainder value of 1.
Step S107, determining the port corresponding to the residual value as the receiving port when each port is used as the transmitting end in any transmitting round.
For the embodiment of the present application, if the port corresponding to 1 is the port b, it is determined that in the first transmission round, when the port a is used as the transmission port, the receiving port is the port b, so as to achieve the purpose of determining that each port is used as the corresponding receiving port when the port is used as the transmission port in each transmission round.
In this embodiment of the present application, when determining that each port is used as a transmitting port in each transmitting round, a manner of a corresponding receiving port may also be: and determining the port corresponding to any sequence number as a transmitting port, determining the ports corresponding to other sequence numbers except any sequence number in the arrangement sequence as receiving ports, respectively differencing the sequence numbers corresponding to the receiving ports with any sequence number, determining the difference value as the turn of the receiving port corresponding to the sequence number if the difference value is positive, summing the difference value and the number of the plurality of ports if the difference value is negative, and determining the sum value as the turn of the receiving port corresponding to the sequence number. For example, the port corresponding to the sequence number 0 is the port a, the port a is used as a transmitting port, the port b, the port c and the port d are determined as receiving ports of the port a, for example, the port c corresponds to the sequence number 2, the port c is determined as receiving port of the port a, when a specific transmitting round is performed, the sequence number of the port c and the sequence number of the port a may be differed, and when the difference is 2, the port c is the receiving port corresponding to the port a when the second transmitting round is performed.
Assuming that when the port b is a transmitting end, the corresponding sequence number of the port b is 1, that is, any sequence number is 1, when determining that the port a is a receiving port of the port b, in a specific transmitting round, the sequence number 0 of the port a and the sequence number 1 of the port b are differenced to obtain a difference value of-1, and because the difference value is a negative value, the sum of-1 and the port number 4 can be continuously summed to obtain a sum value of 3, and when the port a is the receiving port of the port b, the port a is in a third transmitting round.
One possible implementation of an embodiment of the present application, step S108 (not shown in the figure) and step S109 (not shown in the figure), where,
step S108, judging whether ports with a preset port configuration scheme exist in the ports or not.
For the embodiment of the application, the preset port configuration scheme is a preset configuration scheme, and whether ports with the preset port configuration scheme exist in the plurality of ports is judged, so that whether the arrangement sequence of specific basis when the port configuration scheme of each port is required to be determined according to the preset port configuration scheme is determined or not is determined.
Suppose that the user has set the port configuration schemes a-b, a-c, and a-d for port a among port a, port b, port c, and port d.
Step S109, if yes, determining the arrangement sequence of the plurality of ports based on a preset port configuration scheme.
For the embodiment of the present application, taking step S108 as an example, port a is a port having a preset configuration scheme, so that the arrangement sequence of the plurality of ports can be determined according to a-b, a-c, and a-d, and the determined arrangement sequence can be port a, port b, port c, and port d. According to the arrangement sequence, the port configuration scheme of each port in the plurality of ports is determined, so that the port a can meet the requirement of a user, and the flow configuration schemes of the port b, the port c and the port d can be determined.
One possible implementation manner of the embodiment of the present application further includes step S110 (not shown in the figure), step S111 (not shown in the figure), and step S112 (not shown in the figure), where,
step S110, if there are at least two ports with preset port configuration schemes, outputting at least two preset port configuration schemes.
For the embodiment of the application, when at least two ports with preset port configuration schemes exist, at least two arrangement sequences are determined according to the at least two preset port configuration schemes, so that when the traffic packet transmission scheme is determined according to the arrangement sequences, the traffic packet transmission scheme cannot be determined according to which arrangement sequence.
Assuming that the preset port configuration schemes corresponding to the current port a are a-B, a-c and a-d, the determined arrangement sequence according to the preset port configuration scheme of the port a may be a, B, c and d, the preset port configuration schemes corresponding to the current port B are B-a, B-c and B-d, and the determined arrangement sequence according to the preset port configuration scheme of the port B may be B, a, c and d. Obviously, two arrangement sequences are determined according to two preset port configuration schemes. Thus, when there are ports of at least two preset port configuration schemes, the at least two preset port configuration schemes may be output so that the user selects a preset port configuration scheme that can be used.
In this embodiment of the present application, at least two preset port configuration schemes may be output on a terminal device of a user, or at least two preset port configuration schemes may be output on a display screen, or at least two preset port configuration schemes may be output in a voice broadcast manner, which is not limited herein.
Step S111, determining a target preset port configuration scheme according to a confirmation instruction triggered by a user.
For the embodiment of the present application, an example is given, where the target preset port configuration scheme is a preset port configuration scheme corresponding to the port a. The user confirms the target preset port configuration scheme, so that the preset port configuration scheme which is specifically used for generating the arrangement sequence is conveniently and definitely the preset port configuration scheme corresponding to the port a.
When the user triggers the confirmation instruction, the confirmation instruction can be triggered by input devices such as a keyboard, a mouse, a touch screen and the like, or can be triggered by sending a voice instruction to the user, and the confirmation instruction is not limited herein.
Step S112, determining the arrangement sequence of the plurality of ports based on the target preset port configuration scheme.
For the embodiment of the present application, in the above example, the target preset port configuration scheme is a preset port configuration scheme corresponding to the port a, and the determined arrangement sequence of the plurality of ports may be a, b, c, and d.
One possible implementation manner of the embodiment of the present application further includes step S113 (not shown in the figure), step S114 (not shown in the figure), and step S115 (not shown in the figure), where,
step S113, a specified number of traffic packets are sent to each port.
For the embodiment of the application, a specified number of traffic packets are sent to each port, so that the tested device can be detected according to the traffic packets. Assuming that the number of traffic packets corresponding to port a is 20, the number of traffic packets corresponding to port b is 30, the number of traffic packets corresponding to port c is 20, and the number of traffic packets corresponding to port d is 40.
Step S114, the number of traffic packets at the corresponding receiving port in each transmission round is obtained for each port.
For the embodiment of the present application, it is assumed that the corresponding receiving port of the port a in the first transmission round is the port b, and since in the embodiment of the present application, the traffic packets corresponding to the port a, the port b, the port c and the port d are simultaneously transmitted to the corresponding receiving ports, the number of the traffic packets at the port b in the first transmission round is 20.
Step S115, determining a detection result of the device under test based on the number of traffic packets and the specified number.
For the embodiment of the present application, taking step S113 and step S114 as examples, if the number of the traffic packets of the port b is detected to be 20 in the first transmission round, it is indicated that there is no problem in the process of a-b, comparing the traffic at all receiving ends with the designated number of the ports of the transmitting end corresponding to the receiving end, so as to determine whether there is an abnormality in the transmission process of each two ports, and when there is no abnormality in the transmission process of each two ports, i.e. the number of the traffic packets is consistent with the designated number, it is indicated that there is no abnormality in the tested device, i.e. the detection result may be no abnormality; when there is an abnormality in the two port transmission process, that is, when the number of the traffic packets is inconsistent with the specified number, it is indicated that the tested device is abnormal, that is, the detection result may be abnormal.
In the embodiment of the application, the detection result can be output on the terminal equipment corresponding to the user, such as a mobile phone, so that the user can watch the detection result in time, and the detection result can also be output in a voice broadcasting mode.
In the embodiment of the application, when the electronic device detects the device to be detected according to the transmission scheme, the detection time of the device to be detected can be determined according to the user, i.e. the user can set the time when the device to be detected is in the detection state.
Further, in the embodiment of the present application, the arrangement sequence of the plurality of ports may be rearranged to obtain a reordered secondary arrangement sequence, a secondary traffic packet transmission scheme may be obtained according to the secondary arrangement sequence, and the tested device may be detected according to the secondary traffic packet transmission scheme to obtain a secondary detection result, and the first detection result may be verified according to the secondary detection result, so as to increase accuracy of the detection result. In the embodiment of the application, the arrangement sequence can be further disturbed for a plurality of times, so that a plurality of detection results are obtained, and the accuracy of the detection results is higher. In the embodiment of the present application, the shuffle function may be used as the function for scrambling the arrangement order.
One possible implementation manner of the embodiment of the present application further includes step S116 (not shown in the figure), step S117 (not shown in the figure), step S118 (not shown in the figure), and step S119 (not shown in the figure), where step S116 may be performed before step S101, may be performed after step S101, may be performed simultaneously with step S101, where,
step S116, the packet length of the flow packet corresponding to each port is obtained.
For the embodiment of the application, the packet length of the flow packet corresponding to each port is obtained so as to judge whether the packet fields of each flow packet are the same, thereby being convenient for judging whether the flow packet can reach the receiving port at the same time when each port transmits the flow packet according to the same transmission rate.
Assuming that the packet length of the traffic packet corresponding to the port a is 3000 bytes, the packet length of the traffic packet corresponding to the port b is 4000 bytes.
Step S117, judging whether the packet length of the flow packet corresponding to each port is the same.
For the embodiment of the present application, taking step S116 as an example, it is determined whether the packet lengths of the traffic packets corresponding to the port a and the port b are the same, so as to determine whether the transmission rates of the port a and the port b need to be set.
In step S118, if the packet lengths of the traffic packets are different, the rate ratios of the ports are determined based on the packet lengths of the traffic packets.
Wherein the rate ratio is the speed ratio of the traffic packets transmitted by the plurality of ports.
For the embodiment of the present application, the packet lengths of the corresponding traffic packets of the port a and the port b are different, which means that if the port a and the port b send the traffic packets according to the same sending rate, the traffic packets cannot reach the receiving ports corresponding to the port a and the port b at the same time, so that the next sending round is affected. It is thus possible to compare the packet lengths to obtain a packet length ratio of 3 for port a to port b: and 4, determining that the rate ratio of the port a to the port b is 3:4.
Step S119, setting transmission rates of the plurality of ports based on the rate ratio.
For the embodiment of the application, the rate ratio is the speed ratio of transmitting the traffic packets by the plurality of ports, and the transmission rates of the plurality of ports are set according to the rate ratio, so that the traffic packets of each sending end can reach the receiving port at the same time, and the situation of traffic congestion can be effectively reduced when the tested equipment is detected according to the traffic packet sending scheme. In the above example, the ratio of the transmission rates of the port a and the port b is set to 3:4, the traffic packets sent by the port a and the port b can reach the corresponding receiving ports at the same time.
The above embodiment describes a method for traffic congestion prevention configuration from the perspective of a method flow, and the following embodiment describes an apparatus 20 for traffic congestion prevention configuration from the perspective of a virtual module or a virtual unit, specifically the following embodiment.
The embodiment of the present application provides a device 20 for traffic congestion prevention configuration, as shown in fig. 2, the device 20 for traffic congestion prevention configuration may specifically include:
a first obtaining module 201, configured to obtain the number of a plurality of ports of the device under test;
a first determining module 202, configured to determine a number of rounds of sending a traffic packet based on a number of the plurality of ports;
A second determining module 203, configured to determine, when each port is used as a transmitting port, a corresponding receiving port in each transmitting round, and obtain a port configuration scheme corresponding to each port;
the third determining module 204 is configured to determine a traffic packet transmission scheme of the device under test based on a port configuration scheme corresponding to each port, where each port in each round of transmission schemes of the traffic packet transmission scheme is only used as a primary transmission port, and is only used as a primary reception port.
For the embodiment of the present application, the first obtaining module 201 obtains the number of the plurality of ports of the device under test, so that the subsequent first determining module 202 determines the number of rounds of sending the traffic packet according to the number of the plurality of ports, and when the second determining module 203 determines that each port is a sending port, the corresponding receiving port is in each sending round, so as to obtain a port configuration scheme corresponding to each port, so that the third determining module 204 determines, according to the port configuration scheme corresponding to each port, a traffic packet sending scheme of the device under test, and each port is only used as a sending port once in each round of the sending scheme of the traffic packet, and is only used as a receiving port once, so that the situation that one port is used as a receiving port of a plurality of sending ends is reduced, and the probability of traffic congestion of the device under test in the test is further reduced.
In one possible implementation manner of this embodiment of the present application, when determining each port as a transmitting port, the second determining module 201 is specifically configured to, when obtaining a port configuration scheme corresponding to each port, obtain a corresponding receiving port in each transmitting round:
acquiring the arrangement sequence of a plurality of ports and the serial number of each port, wherein the serial number of each port is the serial number of each port minus one in the position serial number in the arrangement sequence;
determining a current sending port according to the arrangement sequence;
determining the sum of the first serial number and the second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current transmitting port, and the second serial number is the serial number of the second port in the arrangement sequence;
executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports; the first cycling step includes:
determining the sum of a first serial number and a third serial number, wherein the first serial number is the serial number of a current transmitting port, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the current third serial number to obtain a third serial number in the next receiving port determining period, and judging whether the current third serial number is the largest serial number in the serial numbers of each port;
Circularly executing a second circulation step until the current sending port is the last port in the arrangement sequence, so as to obtain a port configuration scheme corresponding to each port;
the second cycle step includes:
determining a current transmitting port according to the arrangement sequence;
determining the sum of the first serial number and the second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current transmitting port, and the second serial number is the serial number of the second port in the arrangement sequence;
and executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports.
In one possible implementation manner of the embodiment of the present application, the apparatus 20 further includes:
a fourth determining module, configured to determine a sum of a first value and a second value, where the first value is a value of any transmission round, and the second value is a serial number of each port;
the computing module is used for computing the sum and the remainder value of the number of the plurality of ports;
and a fifth determining module, configured to determine the ports corresponding to the residual values as receiving ports when each port is used as a transmitting end in any transmitting round.
In one possible implementation manner of the embodiment of the present application, the apparatus 20 further includes:
the first judging module is used for judging whether ports with a preset port configuration scheme exist in the plurality of ports or not;
and a sixth determining module, configured to determine, when the plurality of ports exist, an arrangement order of the plurality of ports based on a preset port configuration scheme.
In one possible implementation manner of the embodiment of the present application, the apparatus 20 further includes:
the output module is used for outputting at least two preset port configuration schemes when at least two ports with the preset port configuration schemes exist;
a seventh determining module, configured to determine a target preset port configuration scheme according to a confirmation instruction triggered by a user;
and an eighth determining module, configured to determine an arrangement order of the plurality of ports based on the target preset port configuration scheme.
In one possible implementation manner of the embodiment of the present application, the apparatus 20 further includes:
a sending module, configured to send a specified number of traffic packets to each port;
the second acquisition module is used for acquiring the quantity of the flow packets at the corresponding receiving port in each sending round of each port;
and the ninth determining module is used for determining the detection result of the tested device based on the quantity of the flow packets and the designated quantity.
In one possible implementation manner of the embodiment of the present application, the apparatus 20 further includes:
the third acquisition module is used for acquiring the packet length of the flow packet corresponding to each port;
the second judging module is used for judging whether the packet lengths of the flow packets corresponding to each port are the same or not;
a tenth judging module, configured to determine, when the packet lengths of the traffic packets are different, a rate ratio of the plurality of ports based on the packet length of each traffic packet, where the rate ratio is a speed ratio of the plurality of ports to transmit the traffic packets;
and the setting module is used for setting the transmission rates of the plurality of ports based on the rate proportion.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus 20 for traffic congestion prevention configuration described above may refer to the corresponding process in the foregoing method embodiment, and will not be described herein again.
In an embodiment of the present application, as shown in fig. 3, an electronic device 30 shown in fig. 3 includes: a processor 301 and a memory 303. Wherein the processor 301 is coupled to the memory 303, such as via a bus 302. Optionally, the electronic device 30 may also include a transceiver 304. It should be noted that, in practical applications, the transceiver 304 is not limited to one, and the structure of the electronic device 30 is not limited to the embodiment of the present application.
The processor 301 may be a CPU (Central Processing Unit ), general purpose processor, DSP (Digital Signal Processor, data signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor 301 may also be a combination for performing computing functions, e.g., comprising at least one microprocessor combination, a combination of a DSP and a microprocessor, etc.
Bus 302 may include a path to transfer information between the components. Bus 302 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect Standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. Bus 302 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 3, but not only one bus or type of bus.
The Memory 303 may be, but is not limited to, a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory ) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory ), a CD-ROM (Compact Disc Read Only Memory, compact disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 303 is used for storing application program codes for executing the present application and is controlled to be executed by the processor 301. The processor 301 is configured to execute the application code stored in the memory 303 to implement what is shown in the foregoing method embodiments.
Among them, electronic devices include, but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. But may also be a server or the like. The electronic device shown in fig. 3 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments herein.
The present application provides a computer readable storage medium having a computer program stored thereon, which when run on a computer, causes the computer to perform the corresponding method embodiments described above. Compared with the related art, in the embodiment of the application, the number of the plurality of ports of the tested device is obtained, so that the number of rounds of sending the flow packets is conveniently determined according to the number of the plurality of ports, when each port is determined to be the sending port, the corresponding receiving port in each sending round is determined, so that the port configuration scheme corresponding to each port is obtained, the flow packet sending scheme of the tested device is conveniently determined according to the port configuration scheme corresponding to each port, in each round of sending scheme of the flow packet sending scheme, each port is only used as a sending port and is only used as a receiving port, the condition that one port is used as the receiving port of a plurality of sending ends is reduced, and the probability of flow congestion of the tested device in the testing process is further reduced.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present application and it should be noted that, for a person skilled in the art, several improvements and modifications can be made without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method of traffic congestion prevention configuration, comprising:
acquiring the number of a plurality of ports of the tested device;
determining a number of rounds of transmitting traffic packets based on the number of the plurality of ports;
when each port is determined to be a transmitting port, a corresponding receiving port in each transmitting round is determined to obtain a port configuration scheme corresponding to each port;
and determining a traffic packet transmission scheme of the tested device based on a port configuration scheme corresponding to each port, wherein each port in each round of transmission scheme of the traffic packet transmission scheme is only used as a primary transmission port and is only used as a primary receiving port.
2. The method for traffic congestion prevention configuration according to claim 1, wherein when determining each port as a transmitting port, obtaining a port configuration scheme corresponding to each port in each receiving port in each transmitting round comprises:
Acquiring the arrangement sequence of a plurality of ports and the serial number of each port, wherein the serial number of each port is the serial number of each port minus one in the position serial number in the arrangement sequence;
determining a current sending port according to the arrangement sequence;
determining the sum of a first serial number and a second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current transmitting port, and the second serial number is the serial number of the second port in the arrangement sequence;
executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports; the first cycling step includes:
determining the sum of a first serial number and a third serial number, wherein the first serial number is the serial number of the current sending port, performing a remainder operation on the sum and the number of ports to obtain a remainder value, determining the port corresponding to the remainder value as a receiving port, adding one to the current third serial number to obtain a third serial number in the next receiving port determination period, and judging whether the current third serial number is the largest serial number in the serial numbers of each port;
Circularly executing a second circulation step until the current sending port is the last port in the arrangement sequence, so as to obtain a port configuration scheme corresponding to each port;
the second cycling step comprises:
determining a current sending port according to the arrangement sequence;
determining the sum of a first serial number and a second serial number, performing remainder taking operation on the sum and the number of ports to obtain a remainder taking value, determining the port corresponding to the remainder taking value as a receiving port, adding one to the second serial number to obtain a third serial number, wherein the first serial number is the serial number of the current transmitting port, and the second serial number is the serial number of the second port in the arrangement sequence;
and executing the first circulation step until the third serial number is the largest serial number in the serial numbers of the ports.
3. The method of traffic congestion prevention configuration according to claim 2, wherein the method further comprises:
determining a sum of a first value and a second value, wherein the first value is a value of any sending round, and the second value is a serial number of each port;
calculating the sum and the remainder value of the number of the plurality of ports;
and determining the port corresponding to the residual value as a receiving port when each port is used as a transmitting end in any transmitting round.
4. The method for traffic congestion prevention configuration according to claim 2, wherein said obtaining an order of a plurality of ports further comprises:
judging whether ports with a preset port configuration scheme exist in the ports or not;
and if so, determining the arrangement sequence of the plurality of ports based on the preset port configuration scheme.
5. The method of traffic congestion prevention configuration according to claim 4, further comprising:
outputting at least two preset port configuration schemes if at least two ports with the preset port configuration schemes exist;
determining a target preset port configuration scheme according to a confirmation instruction triggered by a user;
and determining the arrangement sequence of the plurality of ports based on the target preset port configuration scheme.
6. The method for traffic congestion prevention configuration according to claim 1, wherein determining the traffic packet transmission scheme of the device under test based on the port configuration scheme corresponding to each port further comprises:
transmitting a specified number of traffic packets to each port;
acquiring the quantity of flow packets of each port at a corresponding receiving port in each sending round;
And determining a detection result of the tested device based on the quantity of the flow packets and the designated quantity.
7. The method of traffic congestion prevention configuration according to claim 1, further comprising:
acquiring the packet length of the flow packet corresponding to each port;
judging whether the packet lengths of the flow packets corresponding to each port are the same or not;
if the traffic packets are different, determining the rate proportion of the ports based on the packet length of each traffic packet, wherein the rate proportion is the speed ratio of the ports for transmitting the traffic packets;
and setting transmission rates of the plurality of ports based on the rate ratio.
8. An apparatus for traffic congestion prevention configuration, comprising:
the first acquisition module is used for acquiring the number of a plurality of ports of the tested device;
a first determining module, configured to determine a number of rounds of sending traffic packets based on the number of the plurality of ports;
the second determining module is used for determining the corresponding receiving port in each sending round when each port is used as a sending port, and obtaining a port configuration scheme corresponding to each port;
and the third determining module is used for determining a flow packet sending scheme of the tested device based on a port configuration scheme corresponding to each port, wherein each port in each round of sending scheme of the flow packet sending scheme is only used as a sending port once and is only used as a receiving port once.
9. An electronic device, comprising:
at least one processor;
a memory;
at least one application program, wherein the at least one application program is stored in the memory and configured to be executed by the at least one processor, the at least one application program configured to: a method of performing a traffic congestion prevention configuration according to any of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed in a computer, causes the computer to perform the method of traffic congestion prevention configuration according to any of claims 1-7.
CN202310056728.5A 2023-01-13 2023-01-13 Method, device and storage medium for traffic congestion prevention configuration Pending CN116192696A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310056728.5A CN116192696A (en) 2023-01-13 2023-01-13 Method, device and storage medium for traffic congestion prevention configuration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310056728.5A CN116192696A (en) 2023-01-13 2023-01-13 Method, device and storage medium for traffic congestion prevention configuration

Publications (1)

Publication Number Publication Date
CN116192696A true CN116192696A (en) 2023-05-30

Family

ID=86443747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310056728.5A Pending CN116192696A (en) 2023-01-13 2023-01-13 Method, device and storage medium for traffic congestion prevention configuration

Country Status (1)

Country Link
CN (1) CN116192696A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9071559B1 (en) * 2012-11-15 2015-06-30 Qlogic, Corporation Network devices having configurable receive packet queues and related methods
US20180234343A1 (en) * 2017-02-15 2018-08-16 Mellanox Technologies Tlv Ltd. Evading congestion spreading for victim flows
CN110324265A (en) * 2018-03-29 2019-10-11 阿里巴巴集团控股有限公司 Traffic distribution method, method for routing, equipment and network system
CN114374651A (en) * 2021-12-31 2022-04-19 海光信息技术股份有限公司 Transport flow control method, network on chip, electronic device, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9071559B1 (en) * 2012-11-15 2015-06-30 Qlogic, Corporation Network devices having configurable receive packet queues and related methods
US20180234343A1 (en) * 2017-02-15 2018-08-16 Mellanox Technologies Tlv Ltd. Evading congestion spreading for victim flows
CN110324265A (en) * 2018-03-29 2019-10-11 阿里巴巴集团控股有限公司 Traffic distribution method, method for routing, equipment and network system
CN114374651A (en) * 2021-12-31 2022-04-19 海光信息技术股份有限公司 Transport flow control method, network on chip, electronic device, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
梁钢: "数据采集与动态分流模型的设计", 微型机与应用, no. 01, 25 January 2004 (2004-01-25) *

Similar Documents

Publication Publication Date Title
US7272394B2 (en) Location estimation of wireless terminals in a multi-story environment
CN107466079B (en) Automatic relay switching method and device
CN112717380B (en) Network detection method and related device
CN107734556B (en) Data transfer control method and Related product
CN116192696A (en) Method, device and storage medium for traffic congestion prevention configuration
CN109388544B (en) Fault monitoring method and device and electronic equipment
CN111371536B (en) Control instruction sending method and device
CN103338131A (en) Method and equipment for testing log transmitting loss rate
CN116938776A (en) Method, device, electronic equipment and medium for network asset mapping
CN111355972A (en) Video stream processing method, server, client and medium
CN114760087B (en) DDoS attack detection method and system in software defined industrial internet
CN115811483A (en) Network state monitoring method and device, electronic equipment and storage medium
US11606282B2 (en) Method and device for detecting network reliability
CN114338386A (en) Network configuration method and device, electronic equipment and storage medium
CN114637790A (en) List data query method and device, electronic equipment and storage medium
CN113783751B (en) Method, electronic device and medium for detecting user broadband quality
CN109688167B (en) Data processing method, device, equipment and computer storage medium
CN113051077A (en) User request processing method and device, terminal equipment and storage medium
CN111614534A (en) Communication method and device and electronic equipment
CN113630282B (en) Method and device for detecting server state
CN114665990B (en) Wireless repeater testing method and device, electronic equipment and medium
CN115225530A (en) Asset state monitoring method, device, equipment and medium
CN110809761B (en) Application resource processing method and related product
CN114245415B (en) Network testing method, device, electronic equipment and medium
CN109726075B (en) Abnormal data index analysis method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination