CN109218119B - Network packet loss diagnosis method and network equipment - Google Patents

Network packet loss diagnosis method and network equipment Download PDF

Info

Publication number
CN109218119B
CN109218119B CN201710525031.2A CN201710525031A CN109218119B CN 109218119 B CN109218119 B CN 109218119B CN 201710525031 A CN201710525031 A CN 201710525031A CN 109218119 B CN109218119 B CN 109218119B
Authority
CN
China
Prior art keywords
messages
message
packet loss
distribution information
receiving queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710525031.2A
Other languages
Chinese (zh)
Other versions
CN109218119A (en
Inventor
姜先绪
罗向征
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication 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 Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201710525031.2A priority Critical patent/CN109218119B/en
Publication of CN109218119A publication Critical patent/CN109218119A/en
Application granted granted Critical
Publication of CN109218119B publication Critical patent/CN109218119B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • 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/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • H04L43/0835One way packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis

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 embodiment of the invention provides a network packet loss diagnosis method which is applied to network equipment. The method comprises the following steps: receiving a message input by a network interface at a linear speed rate; storing the input message into a receiving queue through an IO channel of a processor; taking out the messages in the receiving queue to obtain the message number distribution information of the messages taken out from the receiving queue; judging whether packet loss occurs or not according to the total number of input messages and the number distribution information of the messages; and when the packet loss is judged to occur, analyzing the message number distribution information to obtain the reason of the packet loss. The network packet loss diagnosis method can diagnose the packet loss condition of the network equipment, accurately position the packet loss reason when the network equipment loses packets, and improve the development efficiency of the network equipment.

Description

Network packet loss diagnosis method and network equipment
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a network packet loss diagnosis method and a network device.
Background
With the continuous development of data communication technology, the application of data communication technology is becoming more and more extensive. Meanwhile, the demand of people for network transmission bandwidth is increasing, and network device (such as a router or other electronic devices with routing function) suppliers need to develop better performance and larger bandwidth network devices to meet the social demands. In the development process of the network device, the problem of packet loss of the network device due to various reasons generally needs to be solved, which brings great trouble to the development of the network device. Therefore, the problem of diagnosing the reason for packet loss when the network device generates the packet loss phenomenon is an extremely important problem in the data communication technology.
At present, in the method for diagnosing the reason for packet loss of the network device in the prior art, the processing performance of the network device is estimated by counting the time for processing the unit packet by the network device, and the reason for packet loss is inferred by the estimation result. However, the unit packet processing time obtained by statistics in the diagnosis method is not accurate due to scheduling, interruption, abnormal signal processing, and the like of a data forwarding thread of the network device on an operating system, and the reliability of the packet loss reason obtained by corresponding inference is not high, and the error is large, so that the packet loss reason cannot be accurately diagnosed. Therefore, how to provide a diagnostic method capable of accurately locating the reason of packet loss when the network device has the packet loss phenomenon is an urgent technical problem to be solved for those skilled in the art.
Disclosure of Invention
In order to overcome the above-mentioned deficiencies in the prior art, the present invention aims to provide a network packet loss diagnosis method and a network device. The network packet loss diagnosis method can diagnose the packet loss condition of the network equipment, accurately position the packet loss reason when the network equipment loses packets, and improve the development efficiency of the network equipment.
As for the network packet loss diagnosis method, a preferred embodiment of the present invention provides a network packet loss diagnosis method, which is applied to a network device. The method comprises the following steps:
receiving a message input by a network interface at a linear speed rate;
storing the input message into a receiving queue through an IO channel of a processor;
taking out the messages in the receiving queue to obtain the message number distribution information of the messages taken out from the receiving queue;
judging whether packet loss occurs or not according to the total number of input messages and the number distribution information of the messages;
and when the packet loss is judged to occur, analyzing the message number distribution information to obtain the reason of the packet loss.
In terms of a network device, a preferred embodiment of the present invention provides a network device. The apparatus comprises:
the message receiving module is used for receiving a message input from a network interface at the linear speed of the network interface and storing the input message into a receiving queue through an IO channel of the processor;
the message reading module is used for taking out the messages in the receiving queue and obtaining the message number distribution information of the messages taken out from the receiving queue;
the packet loss judging module is used for judging whether packet loss occurs or not according to the total number of input messages and the message number distribution information;
and the packet loss reason acquisition module is used for analyzing the message number distribution information to obtain the reason of packet loss when the packet loss is judged to occur.
Compared with the prior art, the network packet loss diagnosis method provided by the preferred embodiment of the invention
And the network equipment has the following beneficial effects: the network packet loss diagnosis method can diagnose the packet loss condition of the network equipment, accurately position the packet loss reason when the network equipment loses packets, and improve the development efficiency of the network equipment. Specifically, the method comprises the steps of receiving a message input from a network interface at a network interface linear speed, storing the input message into a receiving queue through an IO channel of a processor, and taking out the message in the receiving queue to obtain message number distribution information of the message taken out from the receiving queue; the method judges whether packet loss occurs or not according to the total number of input messages and the number distribution information of the messages; when the packet loss is judged to occur, the packet loss reason is obtained by analyzing the packet number distribution information, so that the accurate diagnosis of the packet loss reason is realized, and the development efficiency of network equipment is improved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments are briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention, and therefore should not be considered as limiting the scope of the claims of the present invention, and it is obvious for those skilled in the art that other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a flowchart illustrating a network packet loss diagnosis method according to a preferred embodiment of the present invention.
Fig. 2 is a schematic flow chart of the sub-steps included in step S230 shown in fig. 1.
Fig. 3 is a flowchart illustrating the sub-steps included in step S240 shown in fig. 1.
Fig. 4 is a flowchart illustrating the sub-steps included in step S250 shown in fig. 1.
Fig. 5 is another flow chart of a network packet loss diagnosis method according to a preferred embodiment of the present invention.
Fig. 6 is a block diagram of a network device according to a preferred embodiment of the present invention.
Fig. 7 is a block diagram of the message reading module shown in fig. 6.
Fig. 8 is a block diagram of the packet loss determining module shown in fig. 6.
Fig. 9 is a block diagram of the packet loss cause acquiring module shown in fig. 6.
Fig. 10 is another block diagram of a network device according to a preferred embodiment of the present invention.
Icon: 100-a network device; 110-a message receiving module; 120-message reading module; 130-packet loss judging module; 140-packet loss reason acquisition module; 121-message fetch submodule; 122-number statistics submodule; 131-a quantity acquisition submodule; 132-packet loss determination submodule; 141-number comparison submodule; 142-cause determination submodule; 150-cache configuration module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Fig. 1 is a schematic flow chart of a network packet loss diagnosis method according to a preferred embodiment of the present invention. The network packet loss diagnosis method is applied to the network device 100, and is used for diagnosing the packet loss condition of the network device 100, and accurately positioning the packet loss reason when the network device 100 loses packets, so as to improve the development efficiency of the network device 100. The specific flow and steps of the network packet loss diagnosis method shown in fig. 1 are described in detail below.
In this embodiment of the present invention, the network packet loss diagnosis method includes the following steps:
step S210, receiving a message input by the network interface at the linear speed rate.
In this embodiment, the network device 100 includes a network interface, a memory, and a processor, and the network device 100 may receive a message input from outside the network device 100 through the network interface. The input rate of the message is the line speed rate of the network interface, and the message may be input to the network device 100 from the network interface by the tester at the line speed rate of the network interface. In an embodiment mode of this embodiment, a DMA (Direct Memory Access) controller is disposed on an interface chip of the network interface, and the DMA controller may transmit an input packet to a processor IO channel of the processor in a DMA manner, so as to receive the packet input from the network interface.
In this embodiment, the network device 100 may obtain the total number of input messages through hardware reception statistics of an interface chip of the network interface in the process of receiving the messages input from the network interface.
Step S220, store the input message into the receiving queue through the IO channel of the processor.
In this embodiment, the processor includes an IO controller, the processor is connected to the memory through an internal bus, and the processor is configured to transmit the received packet to the memory through the IO controller and the internal bus in a DMA manner through the processor IO channel. Wherein, a receiving queue (recv queue) for storing messages exists in the memory. In an implementation manner of this embodiment, the IO controller is a PCIE controller, the PCIE controller is connected to a DMA controller of the interface chip through a PCIE bus, and a message input from the network interface is directly stored in the receive queue of the memory through the PCIE bus and the IO channel of the processor in a DMA manner through the DMA controller. The maximum number of messages that can be buffered in the receive queue may be set by a developer of the network device 100.
Step S230, extracting the messages in the receiving queue, and obtaining the message number distribution information of the messages extracted from the receiving queue.
In this embodiment, the memory stores software for reading the received packet by the network device 100, and the software can be run by the processor to take out the packet in the receive queue. The network device 100 may fetch the message stored in the receive queue through the software. The network device 100 may count the number of messages taken out from the receive queue in each round of the software in the process of taking out the messages in the receive queue by the software, so as to obtain the message number distribution information corresponding to the messages taken out by the software. The message number distribution information is the distribution of the number of messages taken out by the software in each round, and the total number of messages taken out by the software, that is, the total number of messages that can be actually forwarded by the network device 100, can be obtained by adding the number of messages taken out in each round.
Specifically, please refer to fig. 2, which is a flowchart illustrating the sub-steps included in step S230 shown in fig. 1. In an embodiment of the present invention, the step S230 may include a sub-step S231 and a sub-step S232. Wherein the substeps 231 and the substep S232 are as follows:
and a substep S231 of retrieving the packets in the receiving queue in a polling manner, wherein the maximum number of retrieved packets in each round is equal to the maximum packet buffer number of the receiving queue.
In this embodiment, the network device 100 may control the software to take out the packets in the receiving queue in a polling manner, so as to implement a function of reading the input packets by the network device 100, where the maximum number of packets taken out by the software in each round is equal to the maximum packet buffer number of the receiving queue. Specifically, the number of messages taken out by the software in each round is equal to the maximum message buffer number of the receiving queue when the receiving queue is full; and when the receiving queue is not full, the number of the messages taken out by the software in each round is equal to the number of all the messages currently cached by the receiving queue. And the message reading in each round of the software is finished when the receiving queue is empty or the number of the messages taken out by the software at one time is equal to the maximum message cache number of the receiving queue, and the software starts the message reading in the next round after the message reading in each round is finished.
In this embodiment, the steps of receiving the message input from the network interface of the network device 100, storing the input message in the receive queue, and taking out the message in the receive queue by the control software in a polling manner are all performed during the time period of performing the performance debugging on the network device 100.
And a substep S232 of counting the number of the messages taken out in each round to obtain the distribution information of the number of the messages taken out from the receiving queue.
In this embodiment, when the network device 100 controls the software to read the packets in the receiving queue, the number of packets taken out by the software in each round can be obtained. The network device 100 obtains the message number distribution information corresponding to the message taken out from the receiving queue by the software by counting the number of the messages taken out in each round of the software.
Step S240, determining whether packet loss occurs according to the total number of input packets and the packet number distribution information.
In this embodiment, the network device 100 may determine whether the network device 100 has a packet loss problem according to the total number of input packets and packet number distribution information corresponding to the packets taken out from the receive queue by the software.
Specifically, please refer to fig. 3, which is a flowchart illustrating the sub-steps included in step S240 shown in fig. 1. In the embodiment of the present invention, the step S240 may include a sub-step S241, a sub-step S242, and a sub-step S243. The substep S241, the substep S242 and the substep S243 are as follows:
and a substep S241 of obtaining the total number of the taken messages according to the message number distribution information.
In this embodiment, the network device 100 may obtain the number of messages taken out by the software in each round from the message number distribution information, and obtain the total number of messages taken out by the software by adding the number of messages taken out in each round.
And a substep S242 of comparing the total number of the extracted messages with the total number of the input messages.
In this embodiment, the total number of the messages extracted by the software is the total number of the messages that can be actually forwarded by the network device 100 from the received messages. The network device 100 may determine whether the network device 100 has a packet loss problem by comparing the total number of the extracted packets with the total number of the packets input from the network interface.
In an implementation manner of this embodiment, the total number of input messages may be obtained by performing hardware reception statistics on an interface chip of the network device 100, and the total number of messages extracted by the software may be obtained by performing addition operation on the number of messages extracted in each round. In another implementation manner of this embodiment, the total number of input messages may be obtained by a tester that sends the messages, and the total number of extracted messages may be obtained by the tester after the network device 100 forwards the extracted messages to the tester.
And a substep S243, when the total number of the taken messages is less than the total number of the input messages, determining that packet loss occurs.
In this embodiment, when the comparison result between the total number of the extracted messages and the total number of the input messages indicates that the total number of the extracted messages is smaller than the total number of the input messages, the comparison result indicates that the network device 100 cannot completely receive and read the messages input from the network interface, and it can be determined that the packet loss problem occurs in the network device 100.
Step S250, when the packet loss is judged to occur, analyzing the message number distribution information to obtain the reason of the packet loss.
In this embodiment, when the network device 100 is determined to have a packet loss phenomenon, the packet loss reason of the network device 100 can be obtained by analyzing the packet number distribution information corresponding to the packet taken out by the software, so as to improve the efficiency of the network device 100 in solving the packet loss problem in the packet receiving and forwarding function in the development process.
Specifically, please refer to fig. 4, which is a flowchart illustrating the sub-steps included in step S250 shown in fig. 1. In the embodiment of the present invention, the step S250 may include a sub-step S251, a sub-step S252, and a sub-step S253. The substep S251, the substep S252 and the substep S253 are as follows:
and a substep S251, comparing the number of the messages taken out in each round in the message number distribution information with the maximum buffer number of the receiving queue.
In this embodiment, the network device 100 may obtain the number of messages taken out by each software round by querying the number of messages taken out by each software round in the message number distribution information. When the network device 100 obtains the number of messages taken out in each round of software, the number of messages taken out in each round is compared with the maximum buffer number of the receiving queue, so as to determine the reason for packet loss of the network device 100.
In this embodiment, the number of the messages taken out in each round of the message number distribution information may represent the receiving performance of the network device 100 on the input messages, and the network device 100 may obtain whether the reason for the packet loss of the network device 100 is the packet loss caused by the IO performance insufficiency of the processor or the packet loss caused by the software processing performance insufficiency by analyzing the number of the messages taken out in each round. The IO performance of the processor is the capacity of the processor for storing the message entering the processor into the receiving queue of the memory, and the processing performance of the software is the capacity of the software for taking out the message stored in the receiving queue of the memory.
And a substep S252, when the number of the messages taken out in each round is equal to the maximum message cache number, determining that the reason for packet loss is insufficient due to software processing performance.
In this embodiment, because the packet received by the network device 100 from the network interface is a packet input at the line speed of the network interface, when the network device 100 loses a packet, the number of packets taken out by the software has two conditions: one is the situation that the number of the messages taken out in each round is equal to the maximum message cache number, and the other is the situation that the number of the messages taken out in each round is smaller than the maximum message cache number.
In this embodiment, when the number of messages taken out in each round is equal to the maximum number of message buffers, it indicates that the IO performance of the processor of the network device 100 is sufficient and the software processing performance of the network device 100 is insufficient, the frequency of taking out the messages in the receiving queue by the software is too low, backlog occurs on the receiving queue for the input messages, the operation of reading the messages by the software is performed when the receiving queue is full, and the number of messages taken out in each round by the software is equal to the maximum number of message buffers of the receiving queue, so that the receiving queue is congested and loses packets, and it may be determined that the reason for the loss of the network device 100 is that the software processing performance of the network device 100 is insufficient.
And a substep S253, when the number of the messages taken out in each round is less than the maximum message cache number, judging that the reason of packet loss is insufficient due to IO performance of the processor.
In this embodiment, when the number of messages taken out in each round is less than the maximum number of message buffers, it indicates that the IO performance of the processor of the network device 100 is insufficient and the software processing performance of the network device 100 is sufficient, so that congestion occurs when an input message is stored in a receive queue through an IO channel of the processor, and a part of the input message is lost at an IO controller, and since the software processing performance is sufficient, the frequency of taking out the message at the receive queue by the software is high, so that the software reads the message buffered in the receive queue under the condition that the receive queue is not full, and the reason for the lost message of the network device 100 is that the IO performance of the processor of the network device 100 is insufficient when the number of messages taken out in each round is less than the maximum number of message buffers.
Fig. 5 is a schematic flow chart of a network packet loss diagnosis method according to a preferred embodiment of the present invention. In this embodiment of the present invention, the method for diagnosing network packet loss may further include:
step S260, configuring the maximum message buffer number of the receiving queue.
In this embodiment, a developer of the network device 100 may configure the maximum number of message buffers in the receive queue of the memory before debugging the message receiving and forwarding performance of the network device 100, so as to ensure that the network device 100 operates normally on the message receiving and forwarding function. In this embodiment, the maximum number of the packet caches may be 256, 128, or 64, and the maximum number of the packet caches may be set by a developer of the network device 100 according to different requirements. In an implementation manner of this embodiment, the maximum number of packet buffers is preferably 256.
Fig. 6 is a block diagram of a network device 100 according to a preferred embodiment of the present invention. In this embodiment of the present invention, the network device 100 is configured to receive and forward a packet. The network device 100 may include: a message receiving module 110, a message reading module 120, a packet loss determining module 130, and a packet loss reason obtaining module 140.
The message receiving module 110 is configured to receive a message input from a network interface at a network interface linear speed, and store the input message in a receiving queue through an IO channel of a processor.
In this embodiment, the message receiving module 110 may receive, through the network interface of the network device 100, a message input from outside the network device 100 at a network interface linear speed, and monitor the total number of input messages in a process of receiving the message input from the network interface of the network device 100. The message receiving module 110 controls the PCIE controller and the internal bus to form a processor IO channel after transmitting a message input from the network interface to the processor through the DMA controller and the PCIE bus in a DMA manner, and is configured to directly store the received message in a receiving queue of the memory. The message receiving module 110 may execute the steps S210 and S220 in fig. 1, and the detailed description may refer to the above detailed description of the steps S210 and S220.
The message reading module 120 is configured to take out the messages in the receiving queue, and obtain the message number distribution information of the messages taken out from the receiving queue.
In this embodiment, the message reading module 120 may take out the message in the receiving queue through software stored in the memory and used for implementing the network device 100 to read the received message. The message reading module 120 may count the number of the messages taken out from the receiving queue by the software in the process of taking out the messages in the receiving queue by the software, so as to obtain the message number distribution information corresponding to the messages taken out by the software.
Specifically, please refer to fig. 7, which is a block diagram of the message reading module 120 shown in fig. 6. In the embodiment of the present invention, the message reading module 120 includes a message fetching sub-module 121 and a number counting sub-module 122.
The message fetching submodule 121 is configured to fetch the messages in the receiving queue in a polling manner, where the maximum number of fetched messages in each round is equal to the maximum message buffer number of the receiving queue.
In this embodiment, the message fetching submodule 121 may control the software to fetch the messages in the receiving queue in a polling manner, so as to implement a function of reading the input messages by the network device 100, where the maximum number of the messages fetched by the software in each round is equal to the maximum message buffer number of the receiving queue.
The number counting submodule 122 is configured to count the number of messages taken out in each round, so as to obtain the distribution information of the number of messages corresponding to the messages taken out from the receiving queue.
In this embodiment, the number counting sub-module 122 may count the number of messages taken out in each round of the software when the message taking-out sub-module 121 controls the software to read the messages in the receiving queue, so as to obtain the message number distribution information corresponding to the messages taken out of the receiving queue by the software.
The packet loss determining module 130 is configured to determine whether packet loss occurs according to the total number of input packets and the packet number distribution information.
In this embodiment, the packet loss determining module 130 may determine whether the network device 100 has a packet loss problem according to the total number of input packets and packet number distribution information corresponding to the packets taken out from the receiving queue by the software.
Specifically, please refer to fig. 8, which is a block diagram illustrating the packet loss determining module 130 shown in fig. 6. In this embodiment of the present invention, the packet loss determining module 130 includes a number obtaining sub-module 131 and a packet loss determining sub-module 132.
The quantity obtaining submodule 131 is configured to obtain the total quantity of the extracted messages according to the message quantity distribution information.
In this embodiment, the quantity obtaining sub-module 131 obtains the number of messages taken out by the software in each round from the message number distribution information, and obtains the total number of messages taken out by the software by adding the number of messages taken out in each round.
The packet loss determining submodule 132 is configured to compare the total number of the extracted messages with the total number of the input messages, and determine that packet loss occurs when the total number of the extracted messages is smaller than the total number of the input messages.
In this embodiment, when the comparison result between the total number of the extracted messages and the total number of the input messages indicates that the total number of the extracted messages is smaller than the total number of the input messages, it indicates that the network device 100 cannot completely receive and read the messages input from the network interface, and it can be determined that the packet loss problem occurs in the network device 100.
The packet loss reason obtaining module 140 is configured to analyze the packet number distribution information to obtain a reason for packet loss when it is determined that packet loss occurs.
In this embodiment, the packet loss reasons of the network device 100 include: packet loss due to insufficient IO performance of the processor, and packet loss due to insufficient processing performance of the software. When determining that the network device 100 loses the packet, the packet loss reason acquiring module 140 may obtain the packet loss reason of the network device 100 by analyzing the packet number distribution information corresponding to the software received packet, so as to improve the efficiency of the network device 100 in solving the packet loss problem in the packet receiving and forwarding function in the development process.
Specifically, please refer to fig. 9, which is a block diagram illustrating the packet loss reason acquiring module 140 shown in fig. 6. In the embodiment of the present invention, the packet loss reason acquiring module 140 includes a number comparing sub-module 141 and a reason determining sub-module 142.
The number comparison submodule 141 is configured to compare the number of the messages taken out in each round in the message number distribution information with the maximum buffer number of the receiving queue.
In this embodiment, the number comparison sub-module 141 may obtain the number of messages taken out in each round of software by querying the number of messages taken out in each round of software in the message number distribution information, and compare the number of messages taken out in each round with the maximum buffer number of the receiving queue when obtaining the number of messages taken out in each round of software, so as to determine the reason for packet loss of the network device 100.
The reason determining submodule 142 is configured to determine that the packet loss reason is insufficient due to the software processing performance when the number of the messages taken out in each round is equal to the maximum message cache number, and determine that the packet loss reason is insufficient due to the IO performance of the processor when the number of the messages taken out in each round is smaller than the maximum message cache number.
In this embodiment, because the packet received by the network device 100 from the network interface is a packet input at the line speed of the network interface, when the network device 100 loses a packet, the number of packets taken out by the software has two conditions: one is the situation that the number of the messages taken out in each round is equal to the maximum message cache number, and the other is the situation that the number of the messages taken out in each round is smaller than the maximum message cache number.
In this embodiment, when the number of messages taken out in each round is equal to the maximum number of message buffers, it indicates that the IO performance of the processor of the network device 100 is sufficient and the software processing performance of the network device 100 is insufficient, the frequency of taking out the messages in the receiving queue by the software is too low, backlog occurs on the receiving queue for the input messages, the operation of reading the messages by the software is performed when the receiving queue is full, and the number of messages taken out in each round by the software is equal to the maximum number of message buffers of the receiving queue, so that the receiving queue is congested and loses packets, and it may be determined that the reason for the loss of the network device 100 is that the software processing performance of the network device 100 is insufficient.
When the number of messages taken out in each round is smaller than the maximum message buffer number, it indicates that the IO performance of the processor of the network device 100 is insufficient and the software processing performance of the network device 100 is sufficient, so that congestion occurs when the input messages are stored in the receive queue through the IO channel of the processor, and a part of the input messages are lost at the IO controller, and because the software processing performance is sufficient, the frequency of taking out the messages at the receive queue by the software is high, so that under the condition that the receive queue is not full, the software reads the messages buffered in the receive queue, so that the number of the messages taken out in each round by the software is smaller than the maximum message buffer number, and it can be determined that the reason for the lost of the network device 100 is the IO performance insufficiency of the processor of the network device 100.
Referring to fig. 10, another block diagram of a network device 100 according to a preferred embodiment of the invention is shown. In this embodiment of the present invention, the network device 100 may further include a cache configuration module 150.
The buffer configuration module 150 is configured to configure the maximum number of buffer buffers for the receiving queue.
In this embodiment, a developer of the network device 100 may configure the maximum packet buffer number of the receive queue of the memory through the buffer configuration module 150, so as to ensure normal operation of the network device 100 on a packet receiving and forwarding function. In this embodiment, the maximum number of the message caches may be 256, 128, or 64. In an implementation manner of this embodiment, the maximum number of packet buffers is preferably 256.
In summary, in the network packet loss diagnosis method and the network device provided in the preferred embodiment of the present invention, the network packet loss diagnosis method can diagnose the packet loss condition of the network device, and accurately locate the reason for packet loss when the network device loses packet, so as to improve the development efficiency of the network device. Specifically, the method comprises the steps of receiving a message input from a network interface at a network interface linear speed, storing the input message into a receiving queue through an IO channel of a processor, and taking out the message in the receiving queue to obtain message number distribution information of the message taken out from the receiving queue; the method judges whether packet loss occurs or not according to the total number of input messages and the number distribution information of the messages; when the packet loss is judged to occur, the packet loss reason is obtained by analyzing the packet number distribution information, so that the accurate diagnosis of the packet loss reason is realized, and the development efficiency of network equipment is improved.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A network packet loss diagnosis method is applied to network equipment, and is characterized by comprising the following steps:
receiving a message input by a network interface at a linear speed rate;
storing the input message into a receiving queue through an IO channel of a processor;
taking out the messages in the receiving queue to obtain the message number distribution information of the messages taken out from the receiving queue;
judging whether packet loss occurs or not according to the total number of input messages and the number distribution information of the messages;
and when the packet loss is judged to occur, analyzing the packet number distribution information according to the maximum packet buffer number of the receiving queue to obtain the packet loss reason.
2. The method of claim 1, wherein the step of retrieving the packets in the receive queue and obtaining the packet number distribution information of the retrieved packets from the receive queue comprises:
taking out the messages in a receiving queue in a polling mode, wherein the maximum number of the taken-out messages in each round is equal to the maximum message buffer number of the receiving queue;
and counting the number of the messages taken out in each round to obtain the message number distribution information of the messages taken out from the receiving queue.
3. The method according to claim 2, wherein the step of determining whether packet loss occurs according to the total number of input packets and the packet number distribution information comprises:
obtaining the total number of the taken messages according to the message number distribution information;
comparing the total number of the taken messages with the total number of the input messages;
and when the total number of the taken messages is less than the total number of the input messages, judging that packet loss occurs.
4. The method according to claim 2, wherein when it is determined that packet loss occurs, the step of analyzing the packet number distribution information according to the maximum packet buffer number of the receive queue to obtain a packet loss cause comprises:
comparing the number of the messages taken out in each round in the message number distribution information with the maximum buffer number of the receiving queue;
when the number of the messages taken out in each round is equal to the maximum message cache number, judging that the reason of packet loss is that the software processing performance is insufficient;
and when the number of the messages taken out in each round is less than the maximum message cache number, judging that the reason of packet loss is caused by insufficient IO performance of the processor.
5. The method of claim 1, further comprising:
and configuring the maximum message buffer number of the receiving queue.
6. A network device, the device comprising:
the message receiving module is used for receiving a message input from a network interface at the linear speed of the network interface and storing the input message into a receiving queue through an IO channel of the processor;
the message reading module is used for taking out the messages in the receiving queue and obtaining the message number distribution information of the messages taken out from the receiving queue;
the packet loss judging module is used for judging whether packet loss occurs or not according to the total number of input messages and the message number distribution information;
and the packet loss reason acquisition module is used for analyzing the message number distribution information according to the maximum message cache number of the receiving queue to obtain the reason of packet loss when the packet loss is judged to occur.
7. The device of claim 6, wherein the packet reading module comprises:
the message extracting submodule is used for extracting the messages in the receiving queue in a polling mode, wherein the maximum number of the extracted messages in each round is equal to the maximum message caching number of the receiving queue;
and the number counting submodule is used for counting the number of the messages taken out in each round to obtain the message number distribution information of the messages taken out from the receiving queue.
8. The apparatus according to claim 7, wherein the packet loss determining module comprises:
the quantity obtaining submodule is used for obtaining the total quantity of the taken messages according to the message quantity distribution information;
and the packet loss judgment submodule is used for comparing the total number of the taken messages with the total number of the input messages and judging that packet loss occurs when the total number of the taken messages is less than the total number of the input messages.
9. The apparatus according to claim 7, wherein the packet loss cause obtaining module includes:
the number comparison submodule is used for comparing the number of the messages taken out in each round in the message number distribution information with the maximum cache number of the receiving queue;
and the reason judging submodule is used for judging that the packet loss reason is insufficient due to the insufficient software processing performance when the number of the messages taken out in each round is equal to the maximum message cache number, and is also used for judging that the packet loss reason is insufficient due to the insufficient IO performance of the processor when the number of the messages taken out in each round is smaller than the maximum message cache number.
10. The apparatus of claim 6, further comprising:
and the buffer configuration module is used for configuring the maximum message buffer number of the receiving queue.
CN201710525031.2A 2017-06-30 2017-06-30 Network packet loss diagnosis method and network equipment Active CN109218119B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710525031.2A CN109218119B (en) 2017-06-30 2017-06-30 Network packet loss diagnosis method and network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710525031.2A CN109218119B (en) 2017-06-30 2017-06-30 Network packet loss diagnosis method and network equipment

Publications (2)

Publication Number Publication Date
CN109218119A CN109218119A (en) 2019-01-15
CN109218119B true CN109218119B (en) 2020-11-27

Family

ID=64961183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710525031.2A Active CN109218119B (en) 2017-06-30 2017-06-30 Network packet loss diagnosis method and network equipment

Country Status (1)

Country Link
CN (1) CN109218119B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877659A (en) * 2010-06-30 2010-11-03 中兴通讯股份有限公司 Method, device and system for monitoring packet loss
CN101902398A (en) * 2010-07-12 2010-12-01 中兴通讯股份有限公司 Method and system for receiving and transmitting data packet
CN102340442A (en) * 2010-07-21 2012-02-01 杭州华三通信技术有限公司 Method for adjusting interface receiving queue length and apparatus thereof
CN102480430A (en) * 2010-11-24 2012-05-30 迈普通信技术股份有限公司 Method and device for realizing message order preservation
CN102984035A (en) * 2013-01-04 2013-03-20 盛科网络(苏州)有限公司 Loopback test method and system of packet loss probability of network data
CN103986548A (en) * 2013-02-07 2014-08-13 华为技术有限公司 Method for determining packet loss reasons and terminal
CN104917641A (en) * 2014-03-11 2015-09-16 中国电信股份有限公司 Method, device and system for testing packet loss
US9438497B2 (en) * 2013-05-06 2016-09-06 Viavi Solutions Inc. Method and system for measuring packet loss

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877659A (en) * 2010-06-30 2010-11-03 中兴通讯股份有限公司 Method, device and system for monitoring packet loss
CN101902398A (en) * 2010-07-12 2010-12-01 中兴通讯股份有限公司 Method and system for receiving and transmitting data packet
CN102340442A (en) * 2010-07-21 2012-02-01 杭州华三通信技术有限公司 Method for adjusting interface receiving queue length and apparatus thereof
CN102480430A (en) * 2010-11-24 2012-05-30 迈普通信技术股份有限公司 Method and device for realizing message order preservation
CN102984035A (en) * 2013-01-04 2013-03-20 盛科网络(苏州)有限公司 Loopback test method and system of packet loss probability of network data
CN103986548A (en) * 2013-02-07 2014-08-13 华为技术有限公司 Method for determining packet loss reasons and terminal
US9438497B2 (en) * 2013-05-06 2016-09-06 Viavi Solutions Inc. Method and system for measuring packet loss
CN104917641A (en) * 2014-03-11 2015-09-16 中国电信股份有限公司 Method, device and system for testing packet loss

Also Published As

Publication number Publication date
CN109218119A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
US10638409B2 (en) Wi-Fi roaming management
WO2017112366A1 (en) Managing communication congestion for internet of things devices
CN107426113B (en) Message receiving method and network equipment
CN112491979B (en) Network card data packet cache management method, device, terminal and storage medium
CN107135088B (en) Method and device for processing logs in cloud computing system
CN106921665B (en) Message processing method and network equipment
CN111949568A (en) Message processing method and device and network chip
JP7132297B2 (en) Method and apparatus for monitoring global failure of virtual gateway cluster
EP3742674A1 (en) Coherent capturing of shared-buffer status
CN115208808A (en) Service quality testing method and device, chip equipment and storage medium
CN112506722B (en) Self-checking reset method and device applied to switch
CN116303173B (en) Method, device and system for reducing RDMA engine on-chip cache and chip
CN109218119B (en) Network packet loss diagnosis method and network equipment
CN109284257B (en) Log writing method and device, electronic equipment and storage medium
CN108804152B (en) Method and device for adjusting configuration parameters
WO2022152230A1 (en) Information flow identification method, network chip, and network device
CN115002009A (en) Flow sampling method, device, system, electronic equipment and medium
CN114428685A (en) Data processing method, device, equipment and computer storage medium
CN114116128A (en) Method, device, equipment and storage medium for fault diagnosis of container instance
CN110381537B (en) QoE-based bandwidth speed limiting method, device, equipment and storage medium
JP2008005118A (en) Network monitor system
CN115333917A (en) CDN anomaly detection method and device
US10560317B2 (en) Subscription to a subset of switching events
CN117041172B (en) White box switch interface request processing method and device
CN112749398B (en) Data transmission channel control method and system

Legal Events

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