[go: up one dir, main page]

CN113206800B - Message caching method and device and network equipment - Google Patents

Message caching method and device and network equipment Download PDF

Info

Publication number
CN113206800B
CN113206800B CN202110276639.2A CN202110276639A CN113206800B CN 113206800 B CN113206800 B CN 113206800B CN 202110276639 A CN202110276639 A CN 202110276639A CN 113206800 B CN113206800 B CN 113206800B
Authority
CN
China
Prior art keywords
priority
packet loss
loss threshold
threshold corresponding
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110276639.2A
Other languages
Chinese (zh)
Other versions
CN113206800A (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.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies 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 New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN202110276639.2A priority Critical patent/CN113206800B/en
Publication of CN113206800A publication Critical patent/CN113206800A/en
Application granted granted Critical
Publication of CN113206800B publication Critical patent/CN113206800B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
    • 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/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2425Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
    • H04L47/2433Allocation of priorities to traffic types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

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

Abstract

The specification provides a message caching method, a message caching device and network equipment, and relates to the technical field of communication. A message caching method is applied to a forwarding chip and comprises the following steps: analyzing the received message and determining the priority of the message; if the occupation amount of the self cache queue is larger than or equal to the packet loss threshold corresponding to the priority, discarding the message; if the occupation amount of the buffer queue per se is smaller than the packet loss threshold corresponding to the priority, writing the message into the buffer queue; and in the adjacent priorities, the packet loss threshold corresponding to the high priority is greater than the packet loss threshold corresponding to the low priority. By the method, the high-priority protocol message can be cached and processed, and the reliability of the network equipment is improved.

Description

Message caching method and device and network equipment
Technical Field
The present disclosure relates to the field of technologies, and in particular, to a method and an apparatus for caching packets, and a network device.
Background
With the popularization and development of networks, the complexity of the networks is continuously increased, and the requirement on the forwarding capability of network equipment is higher and higher. The network equipment comprises a plurality of network ports, a forwarding chip and a processor, wherein when the network equipment forwards messages, the forwarding chip receives the flows from the network ports, writes the messages in the flows into a cache queue of the forwarding chip for caching, and sends the messages to the processor for processing through the cache queue.
The buffer queue may be understood as a memory, which forwards the buffered packets according to the first-in first-out rule. When the message written into the buffer queue exceeds the storage space of the buffer queue, the exceeding message is discarded, so that the message packet loss occurs.
When the network device forwards the message, the message can be classified into a protocol message and a data message, and because the flow of the data message is far greater than that of the protocol message, the cache queue can be occupied by more data messages, and the protocol message which is crucial to message forwarding is discarded by the network device, so that a fault occurs when the network device forwards the message, and the reliability of the network device is reduced.
Disclosure of Invention
In order to overcome the problems in the related art, the present specification provides a message caching method, a message caching device, and a network device.
In combination with the first aspect of the embodiments of the present specification, the present application provides a message caching method, applied to a forwarding chip, including:
analyzing the received message and determining the priority of the message;
if the occupation amount of the self cache queue is larger than or equal to the packet loss threshold corresponding to the priority, discarding the message;
if the occupation amount of the buffer queue per se is smaller than the packet loss threshold corresponding to the priority, writing the message into the buffer queue;
and in the adjacent priorities, the packet loss threshold corresponding to the high priority is greater than the packet loss threshold corresponding to the low priority.
Further, the method further comprises:
acquiring the occupation amount of a self cache queue;
judging whether the occupancy of the cache queue is greater than or equal to an alarm threshold value of the first priority;
if so, adjusting the packet loss threshold corresponding to a second priority lower than the first priority from a default value to a modified value;
the default value of the packet loss threshold corresponding to each priority is larger than the correction value of the packet loss threshold corresponding to the priority, and the alarm threshold corresponding to each priority is smaller than the default value of the packet loss threshold corresponding to the priority.
Optionally, the modification value of the packet loss threshold is half of the default value of the packet loss threshold.
Optionally, the alarm threshold corresponding to each priority is greater than the default of the packet loss threshold corresponding to the next priority of the priority.
Further, after adjusting the packet loss threshold corresponding to the second priority with the priority lower than the first priority from the default value to the modification value, the method further includes:
and if the acquired occupied amount of the cache queue is smaller than the restoration threshold corresponding to the first priority, adjusting the packet loss threshold corresponding to the next priority adjacent to the first priority from the correction value to the default value.
In combination with the second aspect of the embodiments of the present specification, the present application provides a packet caching apparatus, applied to a forwarding chip, including:
the analysis unit is used for analyzing the received message and determining the priority of the message;
the discarding unit is used for discarding the message if the occupation amount of the self cache queue is larger than or equal to a packet loss threshold corresponding to the priority;
the writing unit is used for writing the message into the cache queue if the occupation amount of the cache queue per se is smaller than the packet loss threshold corresponding to the priority;
and in the adjacent priorities, the packet loss threshold corresponding to the high priority is greater than the packet loss threshold corresponding to the low priority.
Further, the apparatus further comprises:
the detection unit is used for acquiring the occupancy of the buffer queue of the detection unit;
the judging unit is used for judging whether the occupation amount of the cache queue is greater than or equal to the alarm threshold value of the first priority;
the adjusting unit is used for adjusting the packet loss threshold corresponding to a second priority lower than the first priority from a default value to a correction value if the packet loss threshold is the correct value;
the default value of the packet loss threshold corresponding to each priority is larger than the correction value of the packet loss threshold corresponding to the priority, and the alarm threshold corresponding to each priority is smaller than the default value of the packet loss threshold corresponding to the priority.
Optionally, the modification value of the packet loss threshold is half of the default value of the packet loss threshold.
Optionally, the alarm threshold corresponding to each priority is greater than the default of the packet loss threshold corresponding to the next priority of the priority.
Further, the adjusting unit is further configured to, after the packet loss threshold corresponding to the second priority with the priority lower than the first priority is adjusted from the default value to the modification value, if the acquired occupancy of the buffer queue is smaller than the restoration threshold corresponding to the first priority, adjust the packet loss threshold corresponding to the next priority adjacent to the first priority from the modification value to the default value.
In combination with the third aspect of the embodiments of the present specification, the present application provides a network device, including a forwarding chip and a processor;
the forwarding chip calls the program instructions to the method of any of the above.
The technical scheme provided by the implementation mode of the specification can have the following beneficial effects:
in the embodiment of the present specification, corresponding packet loss thresholds are set for a plurality of preset priorities, and the size of the corresponding packet loss threshold is set according to the priorities, and when the occupied amount of the cache queue reaches the packet loss threshold corresponding to one priority, the packet with the priority corresponding to the packet loss threshold is discarded, so that a cache space can be reserved for the packet with a higher priority in the cache queue, the discarding of the protocol packet with a higher priority due to too much cache queue occupied by the data packet with a lower priority is avoided, and the reliability of the network device is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the specification.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a flow chart of a message caching method according to the present application;
FIG. 2 is a schematic diagram of a network device to which the present application relates;
fig. 3 is a schematic diagram of a forwarding chip caching message in a message caching method according to the present application, where an occupancy of a cache queue is not greater than a packet loss threshold of priority 3;
fig. 4 is a schematic diagram of a forwarding chip caching message in a message caching method according to the present application, where an occupancy of a cache queue is greater than a packet loss threshold of priority 3;
fig. 5 is a schematic diagram of a forwarding chip caching message in a message caching method according to the present application, where an occupancy of a cache queue is greater than an alarm threshold of priority 0;
fig. 6 is a schematic structural diagram of a packet caching apparatus according to the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification.
The application provides a message caching method, which is applied to a forwarding chip, and as shown in fig. 1, the message caching method includes:
s100, analyzing the received message and determining the priority of the message.
The structure of the network device, as shown in fig. 2, includes several network ports, forwarding chips and processors. The network ports are respectively connected to the forwarding chip and transmit the received message to the forwarding chip. The forwarding chip may be a Logic chip, such as an FPGA (Field Programmable Gate Array) and a CPLD (Complex Programmable Logic Device). The forwarding chip may be connected to the processor through an ethernet interface or PCIE (Peripheral Component Interconnect Express), and performs message interaction. The processor may process the protocol messages and the data messages in the network device.
After the forwarding chip receives the messages, the messages may be buffered in a buffer queue in the forwarding chip. The forwarding chip is provided with a memory, and a part of memory space can be defined in the memory in advance for caching the received message when the forwarding chip is designed. This part of the memory space may be understood as a buffer queue, for example, the memory space is set to M. The reading and writing of the buffer queue can be performed according to a determined reading and writing rule, and generally, a FIFO (First in First out) mode can be adopted for reading and writing.
In the process of converging the messages received on the network port, namely, the parallel messages on the network port are transmitted in a serial mode, and in the process, the forwarding chip can analyze the messages and acquire the message characteristics from the messages. Thereafter, the message completing the aggregation process may be input to a buffer queue. The message characteristics may include a port number (i.e., an identifier of an Internet port) of the received message, a message type (including a Protocol or service of the message), an IP (Internet Protocol) address, a priority carried by the message, and the like.
It should be noted that, according to different implementation manners, the priority mentioned in this embodiment may be a priority carried in the message, or may be determined according to the priority carried in the message and a protocol applied to the message.
For example, for data packets, the data packets may be classified into packets for transmitting video streams, packets for transmitting audio streams, packets for transmitting images, packets for transmitting texts, and the like according to the service types, and since video and audio more require reliable transmission, the priority of the packets for video streams and the priority of the packets for audio streams may be higher than that of the packets for images and texts, and for protocol packets, although the overall priority may be higher than that of the data packets, the priority may also be classified for different protocols. Therefore, the data packets and the protocol packets can be divided into a plurality of priorities according to different data packets and different protocol packets, and the priorities can be carried in the packets for transmission according to the pre-agreement in the network. In this case, the priority carried in the message can be understood as the priority proposed in the present embodiment.
Alternatively, only a small number of priorities may be agreed on in the network, for example, only two priorities may be assigned according to the protocol packets and the data packets. However, in the network device, in order to perform packet processing more finely, after receiving the packet, the forwarding chip may perform division based on the protocol type or the service type, so as to form priorities with a number greater than the priority.
The priority mentioned in the present embodiment may be determined in the above two ways. The following description will be given by taking an example of dividing the packet into four priorities of 0 to 3, where priority 0 may be considered as the highest priority, and priority 3 may be considered as the lowest priority. Priority 0 and priority 1, priority 1 and priority 2, and priority 2 and priority 3 may be considered adjacent priorities, respectively.
S101, if the occupation amount of the buffer queue of the mobile terminal is larger than or equal to a packet loss threshold corresponding to the priority, discarding the message.
And S102, if the occupation amount of the buffer queue per se is smaller than the packet loss threshold corresponding to the priority, writing the message into the buffer queue.
In the normal working process of the network equipment, the forwarding chip continuously writes messages into the cache queue and forwards the messages cached in the cache queue to one side of the processor. In this process, the forwarding chip monitors the occupancy of the storage space in the buffer queue.
In order to implement the priority caching of the important packets by the cache queue and avoid the packet loss of the important packets, different packet loss thresholds may be set for each priority, where the packet loss thresholds correspond to the storage space of the cache queue. The packet loss threshold is used for indicating the forwarding chip to discard the message of the priority received subsequently when the buffer queue reaches the packet loss threshold of the priority.
In the adjacent priorities, the packet loss threshold corresponding to the high priority is greater than the packet loss threshold corresponding to the low priority, that is, the packet loss threshold set from high to low according to the priority is gradually decreased. When the storage space of the buffer queue is set to be M, the packet loss threshold of priority 0 may be set to be a, the packet loss threshold of priority 1 may be set to be B, the packet loss threshold of priority 2 may be C, and the packet loss threshold of priority 3 may be set to be D. Then, the size relationship between the storage space of the buffer queue and the packet loss threshold value of each priority can be M > a > B > C > D.
The storage space of the buffer queue may be set based on the size of the frame, for example, may be set based on the size of a jumbo frame (at most 9000 bytes), the storage space M of the buffer queue may be set to the size of 20 frames, and the difference between adjacent packet loss thresholds may be set to 4 frames, thereby obtaining a-M-4-16 frames, B-a-4-12 frames, C-B-4-8 frames, and D-C-4 frames.
When the network device starts to process and forward the message, as shown in fig. 3, the message enters the buffer queue from one side of the entering direction, and is forwarded to the processor from one side of the exiting direction, and the forwarding chip obtains the occupied amount of the buffer queue, and determines whether the current message can be written into the buffer queue before the message is written into the buffer queue.
When the processing and forwarding are started, because the bandwidth in the outgoing direction of the cache queue is greater than the message receiving rate in the incoming direction, the message entering the cache queue is immediately sent to the processor, and therefore the packet loss processing of the message is not needed.
Because the message rate uploaded by all the network ports does not reach the output rate of the buffer queue to the processor in most of time, the sum of the bandwidth of the network ports is greater than the bandwidth sent by the buffer queue to the processor in order to ensure the message forwarding efficiency. However, at some time, when the forwarding chip receives a traffic with a higher rate sent by the network port, it may happen that the receiving rate of the packet in the ingress direction is higher than the output rate (limited by the egress bandwidth) of the packet sent by the forwarding chip to the processor in the egress direction, and at this time, the packet starts to be accumulated in the cache queue.
In the process of buffering the message, if the occupied amount of the buffer queue does not reach the packet loss threshold corresponding to the priority 3, as shown in fig. 3, the forwarding chip may write all the messages into the buffer queue for processing. After a period of time, the occupancy of the buffer queue reaches the packet loss threshold corresponding to the priority 3, as shown in fig. 4, at this time, when the forwarding chip receives the packet and determines that the priority of the packet is 3, the packet is not written into the buffer queue, and is directly discarded. Then, the message with priority 3 will not occupy more storage space of the buffer queue, so that the remaining storage space of the buffer queue is reserved for the message with higher priority. Thereafter, if the occupancy of the buffer queue can be reduced to be less than the packet loss threshold of priority 3, the buffer of the packet of priority 3 can be continued.
It should be noted that, in order to prevent instability caused by repeated switching between packet loss and packet non-loss of the forwarding chip when the occupied amount of the buffer queue jumps above and below the packet loss threshold, a stable period may be set when packet loss is started and stopped, for example, 5 seconds, and in these 5 seconds, the forwarding chip does not change the packet loss and the writing state based on the same priority, but the 5 seconds may still be changed based on different priorities. Of course, the set stable period may be set according to the actual situation of processing the message set by the network, and is not limited herein.
Then, if the occupancy of the cache queue continues to increase and reaches the packet loss threshold corresponding to the priority 2, the forwarding chip receives the packet and determines that the priority of the packet is 2, and the packet may be discarded, so as to reserve the remaining storage space in the cache queue for the higher-priority packet to be cached. For the priority 1 and the priority 0, the processing is the same as the above, and the description is not repeated here. For the highest priority (i.e. priority 0), a packet loss threshold may also be set, where the packet loss threshold of the priority is close to (or equal to) the value M of the storage space of the buffer queue, that is, when the buffer queue is close to being full (or is full), the packet with the highest priority may also be discarded.
In the embodiment of the present specification, corresponding packet loss thresholds are set for a plurality of preset priorities, and the sizes of the corresponding packet loss thresholds are set according to the priorities, and when the occupancy of the cache queue reaches the packet loss threshold corresponding to one priority, the packet of the priority corresponding to the packet loss threshold is discarded, so that a cache space can be reserved for the packet of higher priority in the cache queue, the protocol packet of higher priority is prevented from being discarded because the data packet of lower priority occupies too much of the cache queue, and the reliability of the network device is improved.
Because the high-priority packet is a protocol packet, packet loss of such a packet will bring a serious influence on packet processing and forwarding of the network device, and therefore, the protocol packet should be processed preferentially over the data packet. In order to better ensure that the high-priority packet is cached, further, the method further includes:
s103, acquiring the occupation amount of the buffer queue of the self-body.
After the forwarding chip starts working, in the process of processing and forwarding the message, the forwarding chip continuously monitors the occupancy of the buffer queue of the forwarding chip to determine the processing mode of packet loss and buffer.
And S104, judging whether the occupancy of the buffer queue is greater than or equal to the alarm threshold of the first priority.
And S105, if so, adjusting the packet loss threshold corresponding to a second priority lower than the first priority from a default value to a correction value.
The default value of the packet loss threshold corresponding to each priority is larger than the correction value of the packet loss threshold corresponding to the priority, and the alarm threshold corresponding to each priority is smaller than the default value of the packet loss threshold corresponding to the priority.
With respect to the packet loss threshold, in this embodiment, an alarm threshold may also be set for each priority, where the alarm threshold is used to adjust the packet loss threshold of the next priority of the priority. For example, the alarm threshold a0 may be set for priority 0, the alarm threshold B0 for priority 1, and the alarm threshold C0 for priority 2. Priority 4 does not set the alarm threshold because the alarm threshold has the effect of adjusting the packet loss threshold for the next priority to that priority, and because it is the lowest priority, there is no lower priority and therefore no alarm threshold is set. Moreover, because the alarm threshold of one priority is triggered before the packet loss threshold of the priority, the alarm threshold corresponding to each priority except the lowest priority is smaller than the packet loss threshold corresponding to each priority. Taking the packet loss threshold as an example, the magnitude relationship of the set alarm threshold is M > a0 > B0 > C0 > D.
When the forwarding chip receives the back-pressure signal of the processor, the message is accumulated in the buffer queue, and if the occupied amount of the buffer queue still does not reach the packet loss threshold of the lowest priority (i.e. priority 3), the forwarding chip still writes the message into the buffer queue normally. However, if the occupied amount of the buffer queue exceeds the packet loss threshold of priority 3 as shown in fig. 4, the forwarding chip starts to discard the packet with priority 3. However, because the output rate in the outgoing direction of the buffer queue is still less than the receiving rate in the incoming direction, the messages in the buffer queue are continuously accumulated, and the occupancy of the buffer queue reaches the alarm threshold of priority 2. At this time, the forwarding chip will adjust the packet loss threshold of the next priority (i.e. priority 3) of priority 2 downward, for example, two values may be preset for the packet loss threshold, which are respectively referred to as a default value and a modification value, where the default value of the packet loss threshold is greater than the modification value of the packet loss threshold. And when the alarm threshold value is not reached, performing packet loss processing on the message with the priority 3 according to the default value of the packet loss threshold value. And after the occupation amount of the cache queue reaches the alarm threshold value of the priority level 2, the forwarding chip reduces the packet loss threshold value of the priority level 3 to a correction value.
Therefore, the forwarding chip discards the messages with the priority 3 in a longer time period and preferentially caches the messages with the priority 0-2, so that the writing of the messages with the priority 3 in the cache queue is reduced, and the accumulation of the messages in the cache queue is gradually relieved.
It should be noted that the alarm threshold of one priority may be greater than or equal to the packet loss threshold of the next priority of the priority, and this may be set according to actual requirements. For example, when the packet loss threshold set by the lowest priority is relatively high (or can be understood as a packet loss threshold of a previous priority relatively close to the lowest priority), the alarm threshold of the previous priority of the lowest priority may be set to be equal to the packet loss threshold of the lowest priority. Of course, a more reasonable setting manner is that the alarm threshold corresponding to each priority is greater than the default value of the packet loss threshold corresponding to the next priority of the priority.
For example, when the occupancy of the buffer queue reaches the packet loss threshold of priority 3, the forwarding chip starts packet loss for the packet with priority 3, and if the packet loss at this time can already relieve the accumulation of the buffer queue for the packet, the adjustment of the packet loss threshold of priority 3 does not need to be triggered. If the packet loss processing of the forwarding chip on the message of the priority 3 does not alleviate the accumulation of the message in the cache queue, the occupancy of the cache queue reaches the alarm threshold of the priority 2, and then the drop loss threshold of the priority 3 is triggered to be adjusted downwards so as to further alleviate the accumulation of the message in the cache queue.
In addition, in order to make the relationship between the default value of the packet loss threshold and the modification value of the packet loss threshold more reasonable, optionally, the modification value of the packet loss threshold may be set to be half of the default value of the packet loss threshold, so as to consider both the packet loss amount of the low-priority packet and the buffer amount of the high-priority packet.
However, in the normal operation process of the network device, the impact of high-rate traffic is not always present at all times, and therefore, under the condition that the number of the messages cached in the cache queue is reduced, the packet loss of the low-priority messages still needs to be avoided as much as possible.
In addition, since the rate of the traffic is too high, the storage space of the buffer queue may be occupied in a short time, and therefore, the buffer queue may be instantly full and reach a packet loss threshold or an alarm threshold of a higher priority. At this time, the alarm threshold of the highest level that the occupied amount reaches may be directly triggered, for example, as shown in fig. 5, if the occupied amount of the buffer queue exceeds the alarm threshold of the highest priority (i.e., priority 0), the forwarding chip may directly adjust the packet loss thresholds corresponding to the multiple priorities (i.e., priorities 1 to 3) that are lower than priority 0 from the default value to the modification value, that is, the packet loss threshold of priority 1 is adjusted to B1, the packet loss threshold of priority 2 is adjusted to C1, and the packet loss threshold of priority 3 is adjusted to D1, so as to more effectively ensure the writing of the highest priority packet into the buffer queue.
Therefore, after the step S105 of adjusting the packet loss threshold corresponding to the second priority having the priority lower than the first priority from the default value to the correction value, the method further includes:
and S106, if the acquired occupied amount of the cache queue is smaller than the restoration threshold corresponding to the first priority, adjusting the packet loss threshold corresponding to the next priority adjacent to the first priority from the corrected value to the default value.
The forwarding chip may further be provided with a restoration threshold corresponding to each priority, and since the packet loss threshold of the highest priority is not adjusted when the packet loss threshold of the priority is adjusted, the restoration threshold may be set for priorities other than the highest priority.
Generally, the recovery threshold corresponding to a priority is smaller than the alarm threshold of the priority, for example, the recovery threshold may be set to be half of the alarm threshold corresponding to the priority. Of course, the specific setting of the restoration threshold is not limited to this, and the restoration threshold may be set to be the same as the alarm threshold, but the operation of restoring the packet loss threshold may be triggered by adding another condition. For example, the occupancy of the buffer queue is lower than the alarm threshold, and the time for meeting the condition that the occupancy is lower than the alarm threshold is longer than a preset time period, such as 5 seconds.
By setting the restoration threshold, when the occupied amount of the buffer queue is low, the buffer of the messages with all priorities can be restored, so that the messages can be prevented from being discarded under the condition that the processor can process the messages, and the reliability of the network equipment for buffering and processing the messages is further improved.
Correspondingly, the present application further provides a packet caching apparatus, applied to a forwarding chip, as shown in fig. 6, including:
the analysis unit is used for analyzing the received message and determining the priority of the message;
the discarding unit is used for discarding the message if the occupation amount of the self cache queue is larger than or equal to a packet loss threshold corresponding to the priority;
the writing unit is used for writing the message into the cache queue if the occupation amount of the cache queue per se is smaller than the packet loss threshold corresponding to the priority;
and in the adjacent priorities, the packet loss threshold corresponding to the high priority is greater than the packet loss threshold corresponding to the low priority.
Further, the apparatus further comprises:
the detection unit is used for acquiring the occupancy of the buffer queue of the detection unit;
the judging unit is used for judging whether the occupation amount of the cache queue is greater than or equal to the alarm threshold value of the first priority;
the adjusting unit is used for adjusting the packet loss threshold corresponding to a second priority lower than the first priority from a default value to a correction value if the packet loss threshold is the correct value;
the default value of the packet loss threshold corresponding to each priority is larger than the correction value of the packet loss threshold corresponding to the priority, and the alarm threshold corresponding to each priority is smaller than the default value of the packet loss threshold corresponding to the priority.
Optionally, the modification value of the packet loss threshold is half of the default value of the packet loss threshold.
Optionally, the alarm threshold corresponding to each priority is greater than the default of the packet loss threshold corresponding to the next priority of the priority.
Further, the adjusting unit is further configured to, after the packet loss threshold corresponding to the second priority with the priority lower than the first priority is adjusted from the default value to the modification value, if the acquired occupancy of the buffer queue is smaller than the restoration threshold corresponding to the first priority, adjust the packet loss threshold corresponding to the next priority adjacent to the first priority from the modification value to the default value.
Correspondingly, the present application also provides a network device, as shown in fig. 2, including a forwarding chip and a processor.
Program instructions are burned in the forwarding chip in advance and used for the forwarding chip to call and execute the message caching method. Of course, in the network device, several network ports may be further provided, and the network ports are connected to a forwarding chip, and the forwarding chip is connected to the processor.
In the embodiment of the present specification, corresponding packet loss thresholds are set for a plurality of preset priorities, and the sizes of the corresponding packet loss thresholds are set according to the priorities, and when the occupancy of the cache queue reaches the packet loss threshold corresponding to one priority, the packet of the priority corresponding to the packet loss threshold is discarded, so that a cache space can be reserved for the packet of higher priority in the cache queue, the protocol packet of higher priority is prevented from being discarded because the data packet of lower priority occupies too much of the cache queue, and the reliability of the network device is improved.
It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
The above description is only for the purpose of illustrating the preferred embodiments of the present disclosure and is not to be construed as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (9)

1. A message caching method is applied to a forwarding chip and comprises the following steps:
analyzing the received message and determining the priority of the message;
if the occupation amount of the self cache queue is larger than or equal to the packet loss threshold corresponding to the priority, the message is discarded;
if the occupation amount of the buffer queue per se is smaller than the packet loss threshold corresponding to the priority, writing the message into the buffer queue;
in the adjacent priorities, the packet loss threshold corresponding to the high priority is greater than the packet loss threshold corresponding to the low priority;
the method further comprises the following steps:
acquiring the occupation amount of a self cache queue;
judging whether the occupancy of the cache queue is greater than or equal to an alarm threshold value of a first priority;
if so, adjusting the packet loss threshold corresponding to a second priority lower than the first priority from a default value to a modified value;
the default value of the packet loss threshold corresponding to each priority is larger than the correction value of the packet loss threshold corresponding to the priority, and the alarm threshold corresponding to each priority is smaller than the default value of the packet loss threshold corresponding to the priority.
2. The method according to claim 1, wherein the modification value of the packet loss threshold is half of the default value of the packet loss threshold.
3. The method of claim 1, wherein the alarm threshold corresponding to each priority is greater than a default value of the packet loss threshold corresponding to a next priority of the priority.
4. The method according to claim 1, wherein after the adjusting the packet loss threshold corresponding to the second priority lower than the first priority from a default value to a modified value, the method further comprises:
and if the acquired occupied amount of the cache queue is smaller than the restoration threshold corresponding to the first priority, adjusting the packet loss threshold corresponding to the next priority adjacent to the first priority from the corrected value to the default value.
5. A message buffer device is applied to a forwarding chip and comprises:
the analysis unit is used for analyzing the received message and determining the priority of the message;
the discarding unit is used for discarding the message if the occupation amount of the buffer queue per se is larger than or equal to the packet loss threshold corresponding to the priority;
the writing unit is used for writing the message into the cache queue if the occupation amount of the cache queue per se is smaller than the packet loss threshold corresponding to the priority;
in the adjacent priorities, the packet loss threshold corresponding to the high priority is greater than the packet loss threshold corresponding to the low priority;
the device further comprises:
the detection unit is used for acquiring the occupancy of the buffer queue of the detection unit;
the judging unit is used for judging whether the occupied amount of the cache queue is larger than or equal to an alarm threshold value of a first priority;
the adjusting unit is used for adjusting the packet loss threshold corresponding to a second priority lower than the first priority from a default value to a correction value if the packet loss threshold is the same as the first priority;
the default value of the packet loss threshold corresponding to each priority is larger than the correction value of the packet loss threshold corresponding to the priority, and the alarm threshold corresponding to each priority is smaller than the default value of the packet loss threshold corresponding to the priority.
6. The apparatus according to claim 5, wherein the modification value of the packet loss threshold is half of the default value of the packet loss threshold.
7. The apparatus of claim 5, wherein the alarm threshold corresponding to each priority is greater than a default value of the packet loss threshold corresponding to a next priority of the priority.
8. The apparatus according to claim 5, wherein the adjusting unit is further configured to, after the packet loss threshold corresponding to the second priority having the priority lower than the first priority is adjusted from a default value to a modification value, if the acquired occupied amount of the buffer queue is smaller than the restoration threshold corresponding to the first priority, adjust the packet loss threshold corresponding to a next priority adjacent to the first priority from the modification value to the default value.
9. A network device comprising a forwarding chip and a processor;
the forwarding chip invokes program instructions to perform the method of any of claims 1-4.
CN202110276639.2A 2021-03-15 2021-03-15 Message caching method and device and network equipment Active CN113206800B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110276639.2A CN113206800B (en) 2021-03-15 2021-03-15 Message caching method and device and network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110276639.2A CN113206800B (en) 2021-03-15 2021-03-15 Message caching method and device and network equipment

Publications (2)

Publication Number Publication Date
CN113206800A CN113206800A (en) 2021-08-03
CN113206800B true CN113206800B (en) 2022-05-27

Family

ID=77025407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110276639.2A Active CN113206800B (en) 2021-03-15 2021-03-15 Message caching method and device and network equipment

Country Status (1)

Country Link
CN (1) CN113206800B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111917666A (en) * 2020-07-27 2020-11-10 西安电子科技大学 Data frame preemptive cache management method based on service level agreement
CN113726611A (en) * 2021-09-01 2021-11-30 深圳市大洲智创科技有限公司 Method for flow control based on protocol
CN113923169B (en) * 2021-10-11 2024-10-01 浙江大华技术股份有限公司 Message filtering method and device, storage medium and electronic device
CN114415969B (en) * 2022-02-09 2023-09-29 杭州云合智网技术有限公司 Method for dynamically storing messages of exchange chip
CN115277880B (en) * 2022-06-17 2024-04-19 奇安信科技集团股份有限公司 Network message parsing method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594691A (en) * 2012-02-23 2012-07-18 中兴通讯股份有限公司 Method and device for processing message
CN102594669A (en) * 2012-02-06 2012-07-18 福建星网锐捷网络有限公司 Data message processing method, device and equipment
CN104378308A (en) * 2014-11-19 2015-02-25 盛科网络(苏州)有限公司 Method and device for detecting message sending rate
CN105306232A (en) * 2014-06-18 2016-02-03 中兴通讯股份有限公司 Alarm data processing method and network management device
CN107454014A (en) * 2016-05-30 2017-12-08 中兴通讯股份有限公司 A kind of method and device of Priority Queuing
CN107547416A (en) * 2016-06-28 2018-01-05 中兴通讯股份有限公司 A kind of processing method and processing device of protocol massages
CN108933741A (en) * 2018-09-25 2018-12-04 新华三技术有限公司 A kind of wireless communications method and device
CN110493145A (en) * 2019-08-01 2019-11-22 新华三大数据技术有限公司 A kind of caching method and device
CN111163016A (en) * 2019-12-09 2020-05-15 杭州迪普科技股份有限公司 Queue management method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594669A (en) * 2012-02-06 2012-07-18 福建星网锐捷网络有限公司 Data message processing method, device and equipment
CN102594691A (en) * 2012-02-23 2012-07-18 中兴通讯股份有限公司 Method and device for processing message
CN105306232A (en) * 2014-06-18 2016-02-03 中兴通讯股份有限公司 Alarm data processing method and network management device
CN104378308A (en) * 2014-11-19 2015-02-25 盛科网络(苏州)有限公司 Method and device for detecting message sending rate
CN107454014A (en) * 2016-05-30 2017-12-08 中兴通讯股份有限公司 A kind of method and device of Priority Queuing
CN107547416A (en) * 2016-06-28 2018-01-05 中兴通讯股份有限公司 A kind of processing method and processing device of protocol massages
CN108933741A (en) * 2018-09-25 2018-12-04 新华三技术有限公司 A kind of wireless communications method and device
CN110493145A (en) * 2019-08-01 2019-11-22 新华三大数据技术有限公司 A kind of caching method and device
CN111163016A (en) * 2019-12-09 2020-05-15 杭州迪普科技股份有限公司 Queue management method and device

Also Published As

Publication number Publication date
CN113206800A (en) 2021-08-03

Similar Documents

Publication Publication Date Title
CN113206800B (en) Message caching method and device and network equipment
US9007902B1 (en) Method and apparatus for preventing head of line blocking in an Ethernet system
US10129151B2 (en) Traffic management implementation method and apparatus, and network device
JP5157577B2 (en) Packet buffer management device for determining arrival packet discard and its discard determination method
RU2316127C2 (en) Spectrally limited controlling packet transmission for controlling overload and setting up calls in packet-based networks
CN108243116B (en) Flow control method and switching equipment
CN116527584B (en) Congestion control method and device, communication network, and computer storage medium
US8848525B2 (en) Methods, systems, and computer readable media for providing adaptive jitter buffer management based on packet statistics for media gateway
JPS63176045A (en) Method and apparatus for width control type packet exchange
KR102763178B1 (en) Method and device for controlling data transmission, and storage medium
US8369219B2 (en) System and method for managing bandwidth
US7453800B2 (en) Communications apparatus and congestion control method
CN105591983B (en) QoS outlet bandwidth adjusting method and device
CN108540395A (en) Without the congestion judgment method lost in network
JPH0681157B2 (en) Traffic optimization method for digital packet switching network.
WO2023116611A1 (en) Queue control method and apparatus
CN1549508A (en) A system flow control method
JP4652314B2 (en) Ether OAM switch device
JPH08504546A (en) Congestion management method in frame relay network and node of frame relay network
CN118101568A (en) CPU soft forwarding congestion processing method, system, equipment and readable storage medium
CN113518046B (en) Message forwarding method and frame type switching equipment
CN116260773A (en) A congestion control method and related equipment
Irawan et al. Performance evaluation of queue algorithms for video-on-demand application
US20080159320A1 (en) Layer 3 switch device and its control method
CN116346720A (en) Information transmission device and method

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