


技术领域technical field
本申请涉及网络通信技术领域,特别设计一种报文处理方法和装置。The present application relates to the technical field of network communication, and particularly designs a message processing method and device.
背景技术Background technique
随着网络技术的飞速发展,用户的数量越来越大,网络设备接收到的用户通过终端发送的报文也越来越多。通常网络设备解析处理来自终端的报文后还需要向终端发送响应的报文,如果网络上有突发的大量的报文需要响应,响应的报文可能远大于接收的报文,若接口的带宽不足以满足业务对带宽的需求,就会产生丢包,导致发送报文的用户得不到响应的报文。With the rapid development of network technology, the number of users is increasing, and network devices receive more and more packets sent by users through terminals. Usually, the network device needs to send a response packet to the terminal after parsing and processing the packets from the terminal. If there are a large number of burst packets on the network that need to be responded, the response packets may be much larger than the received packets. If the bandwidth is insufficient to meet the bandwidth requirements of the service, packet loss occurs, and the user who sends the packet cannot receive a response packet.
某些业务发生丢包是可以容忍的,而有些业务发生丢包则会造成业务中断,这是无法容忍的。因此,如何降低报文处理过程中的丢包率是亟需解决的问题。Packet loss in some services can be tolerated, while packet loss in some services will cause service interruption, which is intolerable. Therefore, how to reduce the packet loss rate during packet processing is an urgent problem to be solved.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请提供一种报文处理方法和装置,以降低报文处理过程中的丢包率。In view of this, the present application provides a packet processing method and device to reduce the packet loss rate during packet processing.
具体地,本申请是通过如下技术方案实现的:Specifically, the application is achieved through the following technical solutions:
一种报文处理方法,应用于网络设备中,所述方法包括:A packet processing method, applied to a network device, the method comprising:
根据预设的重要流量缓存队列包括的各个报文确定所述重要流量缓存队列所需的实际带宽;Determine the actual bandwidth required by the important traffic buffer queue according to each packet included in the preset important traffic buffer queue;
根据所述网络设备的总带宽和所述实际带宽从所述网络设备的聚合端口中选取指定成员口;Select a designated member port from the aggregated ports of the network device according to the total bandwidth and the actual bandwidth of the network device;
通过所述指定成员口转发所述重要流量缓存队列包括的各个报文。Each packet included in the important traffic buffer queue is forwarded through the designated member port.
一种报文处理装置,应用于网络设备中,所述装置包括:A message processing apparatus, applied in network equipment, the apparatus comprising:
确定模块,用于根据预设的重要流量缓存队列包括的各个报文确定所述重要流量缓存队列所需的实际带宽;a determining module, configured to determine the actual bandwidth required by the important traffic buffer queue according to each message included in the preset important traffic buffer queue;
选取模块,用于根据所述网络设备的总带宽和所述实际带宽从所述网络设备的聚合端口中选取指定成员口;A selection module, configured to select a designated member port from the aggregated ports of the network device according to the total bandwidth and the actual bandwidth of the network device;
转发模块,用于通过所述指定成员口转发所述重要流量缓存队列包括的各个报文。A forwarding module, configured to forward each packet included in the important traffic buffer queue through the designated member port.
一种电子设备,所述电子设备包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;An electronic device, the electronic device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
存储器,用于存放计算机程序;memory for storing computer programs;
处理器,用于执行存储器上所存储的程序时,实现上述的方法步骤。The processor is configured to implement the above method steps when executing the program stored in the memory.
一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述的方法步骤。A computer-readable storage medium stores a computer program in the computer-readable storage medium, and the computer program implements the above method steps when executed by a processor.
由以上本申请提供的技术方案可见,可以根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽,然后根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取指定成员口,通过指定成员口转发重要流量缓存队列包括的各个报文,由于可以实时为重要流量缓存队列分配指定成员口,并且指定成员口的带宽足以满足重要流量缓存队列的需求,从而可以确保正常发送重要流量缓存队列包括的各个报文,降低重要流量缓存队列包括的报文的丢包率。It can be seen from the above technical solutions provided by the present application that the actual bandwidth required by the important traffic buffer queue can be determined according to each packet included in the preset important traffic buffer queue, and then aggregated from the network device according to the total bandwidth and actual bandwidth of the network device. Select a designated member port from the port, and forward each packet included in the important traffic buffer queue through the designated member port. Since the designated member port can be allocated to the important traffic buffer queue in real time, and the bandwidth of the designated member port is sufficient to meet the needs of the important traffic buffer queue, Therefore, each packet included in the important traffic buffer queue can be sent normally, and the packet loss rate of the packets included in the important traffic buffer queue can be reduced.
附图说明Description of drawings
图1为本申请示出的一种报文处理方法的流程图;1 is a flowchart of a message processing method shown in this application;
图2为本申请示出的一种报文处理装置的结构示意图;2 is a schematic structural diagram of a message processing apparatus shown in the application;
图3为本申请示出的一种电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device shown in this application.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as recited in the appended claims.
在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this application and the appended claims, the singular forms "a," "" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited by these terms. These terms are only used to distinguish the same type of information from each other. For example, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information without departing from the scope of the present application. Depending on the context, the word "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determining."
为了解决上述问题,本发明实施例提供了一种报文处理方法,以降低报文处理过程中的丢包率。请参见图1,图1为本申请示出的一种报文处理方法的流程图,应用于网络设备中。In order to solve the above problem, an embodiment of the present invention provides a packet processing method, so as to reduce the packet loss rate in the packet processing process. Please refer to FIG. 1. FIG. 1 is a flowchart of a packet processing method shown in the present application, which is applied to a network device.
S11:根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽。S11: Determine the actual bandwidth required by the important traffic buffer queue according to each packet included in the preset important traffic buffer queue.
可以预先设置重要流量缓存队列,顾名思义,可以将需要发送的重要流量的报文保存在重要流量缓存队列中。在处理报文时,由于重要流量缓存队列是实时变化的,因此,可以实时根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽。The important traffic buffer queue can be set in advance. As the name implies, the packets of the important traffic that need to be sent can be saved in the important traffic buffer queue. When processing packets, since the important traffic buffer queue changes in real time, the actual bandwidth required by the important traffic buffer queue can be determined in real time according to each packet included in the preset important traffic buffer queue.
S12:根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取指定成员口。S12: Select a designated member port from the aggregated ports of the network device according to the total bandwidth and actual bandwidth of the network device.
网络设备上转发报文的多个端口可以形成聚合端口,通常,并不是需要聚合端口所有的成员口参与转发报文,因此,可以根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取一部分成员口,这部分成员口可以定义为指定成员口。Multiple ports that forward packets on a network device can form an aggregate port. Usually, not all member ports of an aggregate port are required to participate in forwarding packets. Select a part of the member ports, and this part of the member ports can be defined as the specified member ports.
S13:通过指定成员口转发重要流量缓存队列包括的各个报文。S13: Forward each packet included in the important traffic buffer queue through the designated member port.
由以上本申请提供的技术方案可见,可以根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽,然后根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取指定成员口,通过指定成员口转发重要流量缓存队列包括的各个报文,由于可以实时为重要流量缓存队列分配指定成员口,并且指定成员口的带宽足以满足重要流量缓存队列的需求,从而可以确保正常发送重要流量缓存队列包括的各个报文,降低重要流量缓存队列包括的报文的丢包率。It can be seen from the above technical solutions provided by the present application that the actual bandwidth required by the important traffic buffer queue can be determined according to each packet included in the preset important traffic buffer queue, and then aggregated from the network device according to the total bandwidth and actual bandwidth of the network device. Select a designated member port from the port, and forward each packet included in the important traffic buffer queue through the designated member port. Since the designated member port can be allocated to the important traffic buffer queue in real time, and the bandwidth of the designated member port is sufficient to meet the needs of the important traffic buffer queue, Therefore, each packet included in the important traffic buffer queue can be sent normally, and the packet loss rate of the packets included in the important traffic buffer queue can be reduced.
具体的,上述S11中的根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽,实现过程具体包括:Specifically, in the above S11, the actual bandwidth required by the important traffic buffer queue is determined according to each packet included in the preset important traffic buffer queue, and the implementation process specifically includes:
统计重要流量缓存队列包括的所有报文的报文总长度和报文数量;Collect statistics on the total length and number of packets of all packets included in the important traffic buffer queue;
将报文总长度除以报文数量,得到重要流量缓存队列的报文平均长度;Divide the total length of packets by the number of packets to obtain the average length of packets in the buffer queue for important traffic;
确定重要流量缓存队列包括的所有报文的报文长度中的最大报文长度与最小报文长度的第一均值;Determine the first average of the maximum packet length and the minimum packet length among the packet lengths of all packets included in the important traffic buffer queue;
确定报文平均长度是否小于第一均值;Determine whether the average length of the message is less than the first average;
若确定报文平均长度等于或者大于第一均值,则将报文总长度确定为重要流量缓存队列所需的实际带宽;If it is determined that the average length of the packets is equal to or greater than the first average value, the total length of the packets is determined as the actual bandwidth required by the important traffic buffer queue;
若确定报文平均长度小于第一均值,则确定最小报文长度与第一均值的第二均值,并确定报文平均长度是否小于第二均值,若确定报文平均长度小于第二均值,则将报文总长度的第一设定倍数确定为重要流量缓存队列所需的实际带宽;若确定报文平均长度大于或等于第二均值,则将报文总长度的第二设定倍数确定为重要流量缓存队列所需的实际带宽。If it is determined that the average length of the packets is less than the first average value, then determine the second average value between the minimum packet length and the first average value, and determine whether the average length of the packets is less than the second average value. The first set multiple of the total packet length is determined as the actual bandwidth required by the important traffic buffer queue; if it is determined that the average packet length is greater than or equal to the second average, the second set multiple of the total packet length is determined as The actual bandwidth required by the important traffic buffer queue.
由于在发送报文时需要附带前导码等额外信息,导致发送报文时需要的带宽比报文本身的长度更多,报文越小,额外信息占比就越大。因此,当重要流量缓存队列的报文平均长度越小时,就需要额外的带宽越多。为了防止因预留带宽过小而造成发包时拥塞等等问题,需要为重要流量缓存队列的报文分配更多的带宽。其中,第一设定倍数可以但不限于为120%,第二设定倍数可以但不限于为110%。Since additional information such as a preamble needs to be attached when sending a message, the bandwidth required for sending a message is more than the length of the message itself. The smaller the message, the greater the proportion of additional information. Therefore, when the average length of packets in the important traffic buffer queue is smaller, more additional bandwidth is required. To prevent congestion when sending packets due to too small reserved bandwidth, you need to allocate more bandwidth for packets in important traffic buffer queues. Wherein, the first set multiple may be, but not limited to, 120%, and the second set multiple may be, but not limited to, 110%.
具体的,上述S12中的根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取指定成员口,实现过程具体包括:Specifically, in the above S12, a designated member port is selected from the aggregated ports of the network device according to the total bandwidth and the actual bandwidth of the network device, and the implementation process specifically includes:
从网络设备的聚合端口的各个成员口中选出状态为开启的成员口,得到候选成员口集合;Select a member port whose state is open from each member port of the aggregation port of the network device, and obtain a set of candidate member ports;
计算网络设备的总带宽和实际带宽的差值;Calculate the difference between the total bandwidth and the actual bandwidth of the network device;
根据预设算法从候选成员口集合中选取带宽之和不超过且最接近差值的成员口,得到指定成员口。According to a preset algorithm, a member port whose sum of bandwidths does not exceed and is closest to the difference is selected from the set of candidate member ports to obtain a designated member port.
网络设备的聚合端口的各个成员口的状态可能是开启,也可能是关闭,这里需要从中选出状态为开启的成员口,这些成员口组成候选成员口集合A;若网络设备的总带宽为B0,重要流量缓存队列所需的实际带宽为B,可以计算B0与B的差值,根据预设算法从候选成员口集合中选取带宽之和不超过且最接近差值的成员口集合A1,用于转发不重要流量缓存队列的报文,余下的成员口集合(A-A1)是转发重要流量缓存队列的指定成员口。其中,预设算法可以有很多种,下面列举两种算法进行说明,一种算法为0/1背包问题的算法;另一种算法为,将聚合端口的各个成员口的带宽从小到大依次排序,然后从中去除带宽最小的端口开始,直到所有剔除的端口集A1的带宽之和不超过且最接近差值,余下的成员口集合(A-A1)就是需要的指定成员口。The status of each member port of the aggregation port of the network device may be open or closed. Here, you need to select the member ports whose status is open. These member ports form the candidate member port set A; if the total bandwidth of the network device is B0 , the actual bandwidth required by the important traffic buffer queue is B, and the difference between B0 and B can be calculated. According to the preset algorithm, select the member port set A1 whose bandwidth sum does not exceed and is closest to the difference from the candidate member port set, and use For forwarding packets in the buffer queue for unimportant traffic, the remaining member port set (A-A1) is the designated member port for forwarding the buffer queue for important traffic. Among them, there are many kinds of preset algorithms. Two algorithms are listed below for description. One algorithm is the algorithm of the 0/1 knapsack problem; the other algorithm is to sort the bandwidth of each member port of the aggregation port from small to large. , and then remove the port with the smallest bandwidth, until the sum of the bandwidth of all removed port sets A1 does not exceed and is closest to the difference, and the remaining member port set (A-A1) is the required designated member port.
一种可选的实施方式,上述方法还包括:An optional embodiment, the above method also includes:
接收终端或者其他网络设备发送的第一报文;Receive the first message sent by the terminal or other network device;
获取第一报文的第一五元组信息,第一五元组信息包括第一源互联网协议(Internet Protocol,IP)地址、第一目的IP地址、第一源端口、第一目的端口和协议;Obtain first quintuple information of the first packet, where the first quintuple information includes a first source Internet Protocol (Internet Protocol, IP) address, a first destination IP address, a first source port, a first destination port, and a protocol ;
在预设的访问控制列表查找第一五元组信息;Find the first five-tuple information in the preset access control list;
若在访问控制列表中查找到第一五元组信息,则在重要流量信息表中查找包括第一目的IP地址为第二源IP地址、第一源IP地址为第二目的IP地址、第一目的端口为第二源端口、第二源端口为第二目的端口和协议的第二五元组信息,若在重要流量信息表中未查找到第二五元组信息,则在重要流量信息表中建立第二五元组信息。If the first five-tuple information is found in the access control list, the important traffic information table is searched for the information including the first destination IP address as the second source IP address, the first source IP address as the second destination IP address, the first destination IP address as the second destination IP address, and the first The destination port is the second source port, the second source port is the second destination port and the second quintuple information of the protocol. If the second quintuple information is not found in the important traffic information table, it will be in the important traffic information table. Create the second quintuple information in .
终端或者其他网络设备会向该网络设备发送报文,这些报文可以定义为第一报文,第一报文携带的五元组信息可以定义为第一五元组信息,然后根据网络设备上的访问控制列表确定第一五元组信息是否需要保存在重要流量信息表中。若在预设的访问控制列表查找到第一五元组信息,说明第一报文所属的流量可以称为重要流量,因此,可以在重要流量信息表中查找包括第一目的IP地址为第二源IP地址、第一源IP地址为第二目的IP地址、第一目的端口为第二源端口、第二源端口为第二目的端口和协议的第二五元组信息,若在重要流量信息表中未查找到第二五元组信息,则在重要流量信息表中建立第二五元组信息,比较第一五元组信息与第二五元组信息可以发现,第二五元组信息就是将第一五元组信息中的源目的IP地址互换、以及将原目的端口互换;若在预设的访问控制列表未查找到第一五元组信息,说明第一报文所属的流量可以称为不重要流量,无需在重要流量信息列表中查找第二五元组信息。The terminal or other network device will send packets to the network device. These packets can be defined as the first packet, and the quintuple information carried in the first packet can be defined as the first quintuple information. The access control list for determining whether the first five-tuple information needs to be stored in the important traffic information table. If the first quintuple information is found in the preset access control list, it means that the traffic to which the first packet belongs can be called important traffic. Therefore, the important traffic information table can be found to include the first destination IP address as the second The source IP address, the first source IP address is the second destination IP address, the first destination port is the second source port, and the second source port is the second destination port and the second quintuple information of the protocol. The second quintuple information is not found in the table, then the second quintuple information is established in the important traffic information table, and the first quintuple information and the second quintuple information are compared. That is, the source and destination IP addresses in the first five-tuple information are exchanged, and the original destination port is exchanged; if the first five-tuple information is not found in the preset access control list, it indicates that the first packet belongs to Traffic can be called unimportant traffic, and there is no need to look up the second quintuple information in the list of important traffic information.
一种可选的实施方式,上述方法还包括:An optional embodiment, the above method also includes:
获取生成的第二报文;Obtain the generated second message;
在重要流量信息表中查找第二报文的第三五元组信息;Find the third quintuple information of the second packet in the important traffic information table;
若在重要流量信息表中查找到第三五元组信息,则将第二报文加入重要流量缓存队列;If the third quintuple information is found in the important traffic information table, the second packet is added to the important traffic buffer queue;
若在重要流量信息表中未查找到第三五元组信息,则将第二报文加入不重要流量缓存队列。If the third quintuple information is not found in the important traffic information table, the second packet is added to the unimportant traffic buffer queue.
可以针对重要流量和不重要流量设置两个缓存队列,一个为重要流量缓存队列,一个为不重要流量缓存队列。网络设备通常会对接收到的报文进行响应,这些报文可以定义为第二报文,可以根据重要流量信息表来确定将第二报文加入到哪个队列中,若将第二报文的五元组信息定义为第三五元组信息,可以在重要流量信息表中查找第三五元组信息,若在重要流量信息表中查找到第三五元组信息,说明第二报文所属的流量是重要流量,则将第二报文加入重要流量缓存队列;若在重要流量信息表中未查找到第三五元组信息,说明第二报文所属的流量是不重要流量,则将第二报文加入不重要流量缓存队列。Two buffer queues can be set for important traffic and unimportant traffic, one for important traffic and one for unimportant traffic. The network device usually responds to the received packets. These packets can be defined as second packets. The queue to which the second packet is added can be determined according to the important traffic information table. The quintuple information is defined as the third quintuple information, and the third quintuple information can be found in the important traffic information table. If the third quintuple information is found in the important traffic information table, it means that the second packet belongs to If the traffic is important traffic, the second packet is added to the important traffic buffer queue; if the third and fifth tuple information is not found in the important traffic information table, it means that the traffic to which the second packet belongs is unimportant traffic, then the second packet is added to the important traffic buffer queue. The second packet is added to the unimportant traffic buffer queue.
请参见图2,图2为本申请示出的一种报文处理装置的结构示意图,应用于网络设备中,该装置包括:Please refer to FIG. 2. FIG. 2 is a schematic structural diagram of a message processing apparatus shown in the present application, applied to a network device, and the apparatus includes:
确定模块21,用于根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽;A
选取模块22,用于根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取指定成员口;Selecting
转发模块23,用于通过指定成员口转发重要流量缓存队列包括的各个报文。The
由以上本申请提供的技术方案可见,可以根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽,然后根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取指定成员口,通过指定成员口转发重要流量缓存队列包括的各个报文,由于可以实时为重要流量缓存队列分配指定成员口,并且指定成员口的带宽足以满足重要流量缓存队列的需求,从而可以确保正常发送重要流量缓存队列包括的各个报文,降低重要流量缓存队列包括的报文的丢包率。It can be seen from the above technical solutions provided by the present application that the actual bandwidth required by the important traffic buffer queue can be determined according to each packet included in the preset important traffic buffer queue, and then aggregated from the network device according to the total bandwidth and actual bandwidth of the network device. Select a designated member port from the port, and forward each packet included in the important traffic buffer queue through the designated member port. Since the designated member port can be allocated to the important traffic buffer queue in real time, and the bandwidth of the designated member port is sufficient to meet the needs of the important traffic buffer queue, Therefore, each packet included in the important traffic buffer queue can be sent normally, and the packet loss rate of the packets included in the important traffic buffer queue can be reduced.
具体的,确定模块21,用于根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽,具体用于:Specifically, the determining
统计重要流量缓存队列包括的所有报文的报文总长度和报文数量;Collect statistics on the total length and number of packets of all packets included in the important traffic buffer queue;
将报文总长度除以报文数量,得到重要流量缓存队列的报文平均长度;Divide the total length of packets by the number of packets to obtain the average length of packets in the buffer queue for important traffic;
确定重要流量缓存队列包括的所有报文的报文长度中的最大报文长度与最小报文长度的第一均值;Determine the first average of the maximum packet length and the minimum packet length among the packet lengths of all packets included in the important traffic buffer queue;
确定报文平均长度是否小于第一均值;Determine whether the average length of the message is less than the first average;
若确定报文平均长度等于或者大于第一均值,则将报文总长度确定为重要流量缓存队列所需的实际带宽;If it is determined that the average length of the packets is equal to or greater than the first average value, the total length of the packets is determined as the actual bandwidth required by the important traffic buffer queue;
若确定报文平均长度小于第一均值,则确定最小报文长度与第一均值的第二均值,并确定报文平均长度是否小于第二均值,若确定报文平均长度小于第二均值,则将报文总长度的第一设定倍数确定为重要流量缓存队列所需的实际带宽;若确定报文平均长度大于或等于第二均值,则将报文总长度的第二设定倍数确定为重要流量缓存队列所需的实际带宽。If it is determined that the average length of the packets is less than the first average value, then determine the second average value between the minimum packet length and the first average value, and determine whether the average length of the packets is less than the second average value. The first set multiple of the total packet length is determined as the actual bandwidth required by the important traffic buffer queue; if it is determined that the average packet length is greater than or equal to the second average, the second set multiple of the total packet length is determined as The actual bandwidth required by the important traffic buffer queue.
具体的,选取模块22,用于根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取指定成员口,具体用于:Specifically, the
从网络设备的聚合端口的各个成员口中选出状态为开启的成员口,得到候选成员口集合;Select a member port whose state is open from each member port of the aggregation port of the network device, and obtain a set of candidate member ports;
计算网络设备的总带宽和实际带宽的差值;Calculate the difference between the total bandwidth and the actual bandwidth of the network device;
根据预设算法从候选成员口集合中选取带宽之和不超过且最接近差值的成员口,得到指定成员口。According to a preset algorithm, a member port whose sum of bandwidths does not exceed and is closest to the difference is selected from the set of candidate member ports to obtain a designated member port.
一种可选的实施方式,上述装置还包括:An optional embodiment, the above-mentioned device also includes:
接收模块,用于接收终端或者其他网络设备发送的第一报文;a receiving module, configured to receive the first message sent by the terminal or other network equipment;
第一获取模块,用于获取第一报文的第一五元组信息,第一五元组信息包括第一源IP地址、第一目的IP地址、第一源端口、第一目的端口和协议;The first obtaining module is used to obtain the first quintuple information of the first packet, where the first quintuple information includes the first source IP address, the first destination IP address, the first source port, the first destination port and the protocol ;
第一查找模块,用于在预设的访问控制列表查找第一五元组信息;a first search module, configured to search for the first five-tuple information in a preset access control list;
建立模块,用于若在访问控制列表中查找到第一五元组信息,则在重要流量信息表中查找包括第一目的IP地址为第二源IP地址、第一源IP地址为第二目的IP地址、第一目的端口为第二源端口、第二源端口为第二目的端口和协议的第二五元组信息,若在重要流量信息表中未查找到第二五元组信息,则在重要流量信息表中建立第二五元组信息。The establishment module is used to find the first five-tuple information in the access control list, then find in the important traffic information table that the first destination IP address is the second source IP address, and the first source IP address is the second destination IP address, the first destination port is the second source port, the second source port is the second destination port and the second quintuple information of the protocol, if the second quintuple information is not found in the important traffic information table, then The second quintuple information is established in the important flow information table.
一种可选的实施方式,上述装置还包括:An optional embodiment, the above-mentioned device also includes:
第二获取模块,用于获取生成的第二报文;The second obtaining module is used to obtain the generated second message;
第二查找模块,用于在重要流量信息表中查找第二报文的第三五元组信息;The second search module is used to search the third quintuple information of the second packet in the important traffic information table;
加入模块,用于若在重要流量信息表中查找到第三五元组信息,则将第二报文加入重要流量缓存队列;若在重要流量信息表中未查找到第三五元组信息,则将第二报文加入不重要流量缓存队列。The adding module is used to add the second packet to the important traffic buffer queue if the third and fifth tuple information is found in the important traffic information table; if the third and fifth tuple information is not found in the important traffic information table, Then, the second packet is added to the unimportant traffic buffer queue.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。For the apparatus embodiments, since they basically correspond to the method embodiments, reference may be made to the partial descriptions of the method embodiments for related parts. The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present application. Those of ordinary skill in the art can understand and implement it without creative effort.
本申请实施例还提供了一种电子设备,请参见图3所示,包括处理器310、通信接口320、存储器330和通信总线340,其中,处理器310,通信接口320,存储器330通过通信总线340完成相互间的通信。An embodiment of the present application further provides an electronic device, as shown in FIG. 3 , including a
存储器330,用于存放计算机程序;a
处理器310,用于执行存储器330上所存放的程序时,实现上述实施例中任一所述的报文处理方法。The
通信接口320用于上述电子设备与其他设备之间的通信。The
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital SignalProcessing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; may also be a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
由以上本申请提供的技术方案可见,可以根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽,然后根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取指定成员口,通过指定成员口转发重要流量缓存队列包括的各个报文,由于可以实时为重要流量缓存队列分配指定成员口,并且指定成员口的带宽足以满足重要流量缓存队列的需求,从而可以确保正常发送重要流量缓存队列包括的各个报文,降低重要流量缓存队列包括的报文的丢包率。It can be seen from the above technical solutions provided by the present application that the actual bandwidth required by the important traffic buffer queue can be determined according to each packet included in the preset important traffic buffer queue, and then aggregated from the network device according to the total bandwidth and actual bandwidth of the network device. Select a designated member port from the port, and forward each packet included in the important traffic buffer queue through the designated member port. Since the designated member port can be allocated to the important traffic buffer queue in real time, and the bandwidth of the designated member port is sufficient to meet the needs of the important traffic buffer queue, Therefore, each packet included in the important traffic buffer queue can be sent normally, and the packet loss rate of the packets included in the important traffic buffer queue can be reduced.
相应地,本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述实施例中任一所述的报文处理方法。Correspondingly, the embodiments of the present application further provide a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer executes the message described in any one of the foregoing embodiments. Approach.
由以上本申请提供的技术方案可见,可以根据预设的重要流量缓存队列包括的各个报文确定重要流量缓存队列所需的实际带宽,然后根据网络设备的总带宽和实际带宽从网络设备的聚合端口中选取指定成员口,通过指定成员口转发重要流量缓存队列包括的各个报文,由于可以实时为重要流量缓存队列分配指定成员口,并且指定成员口的带宽足以满足重要流量缓存队列的需求,从而可以确保正常发送重要流量缓存队列包括的各个报文,降低重要流量缓存队列包括的报文的丢包率。It can be seen from the above technical solutions provided by the present application that the actual bandwidth required by the important traffic buffer queue can be determined according to each packet included in the preset important traffic buffer queue, and then aggregated from the network device according to the total bandwidth and actual bandwidth of the network device. Select a designated member port from the port, and forward each packet included in the important traffic buffer queue through the designated member port. Since the designated member port can be allocated to the important traffic buffer queue in real time, and the bandwidth of the designated member port is sufficient to meet the needs of the important traffic buffer queue, Therefore, each packet included in the important traffic buffer queue can be sent normally, and the packet loss rate of the packets included in the important traffic buffer queue can be reduced.
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the present application. within the scope of protection.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010201844.8ACN111404839B (en) | 2020-03-20 | 2020-03-20 | Message processing method and device |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010201844.8ACN111404839B (en) | 2020-03-20 | 2020-03-20 | Message processing method and device |
| Publication Number | Publication Date |
|---|---|
| CN111404839Atrue CN111404839A (en) | 2020-07-10 |
| CN111404839B CN111404839B (en) | 2023-05-26 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010201844.8AActiveCN111404839B (en) | 2020-03-20 | 2020-03-20 | Message processing method and device |
| Country | Link |
|---|---|
| CN (1) | CN111404839B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113542148A (en)* | 2021-07-15 | 2021-10-22 | 恒安嘉新(北京)科技股份公司 | Message aggregation method and device, network card and readable storage medium |
| CN114143247A (en)* | 2021-11-03 | 2022-03-04 | 中盈优创资讯科技有限公司 | IP relay circuit flow emigration and emigration method and device |
| CN115118600A (en)* | 2021-03-18 | 2022-09-27 | 华为技术有限公司 | Method, device and storage medium for adjusting physical bandwidth of outgoing interface |
| CN116208547A (en)* | 2022-12-29 | 2023-06-02 | 新华三技术有限公司 | A message transmission method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102480411A (en)* | 2010-11-23 | 2012-05-30 | 中兴通讯股份有限公司 | Reservation method and system for protected bandwidth resources |
| CN103763208A (en)* | 2014-01-29 | 2014-04-30 | 华为技术有限公司 | Data flow limiting method and device |
| CN108600100A (en)* | 2018-07-13 | 2018-09-28 | 新华三技术有限公司合肥分公司 | Member port choosing method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102480411A (en)* | 2010-11-23 | 2012-05-30 | 中兴通讯股份有限公司 | Reservation method and system for protected bandwidth resources |
| CN103763208A (en)* | 2014-01-29 | 2014-04-30 | 华为技术有限公司 | Data flow limiting method and device |
| CN108600100A (en)* | 2018-07-13 | 2018-09-28 | 新华三技术有限公司合肥分公司 | Member port choosing method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115118600A (en)* | 2021-03-18 | 2022-09-27 | 华为技术有限公司 | Method, device and storage medium for adjusting physical bandwidth of outgoing interface |
| CN115118600B (en)* | 2021-03-18 | 2025-08-08 | 华为技术有限公司 | Method, device and storage medium for adjusting physical bandwidth of outbound interface |
| CN113542148A (en)* | 2021-07-15 | 2021-10-22 | 恒安嘉新(北京)科技股份公司 | Message aggregation method and device, network card and readable storage medium |
| CN114143247A (en)* | 2021-11-03 | 2022-03-04 | 中盈优创资讯科技有限公司 | IP relay circuit flow emigration and emigration method and device |
| CN116208547A (en)* | 2022-12-29 | 2023-06-02 | 新华三技术有限公司 | A message transmission method and device |
| Publication number | Publication date |
|---|---|
| CN111404839B (en) | 2023-05-26 |
| Publication | Publication Date | Title |
|---|---|---|
| CN111404839A (en) | Message processing method and device | |
| JP7623432B2 (en) | Congestion Avoidance in Slice-Based Networks | |
| JP7634561B2 (en) | MESSAGE PROCESSING METHOD AND APPARATUS, NOTIFICATION METHOD AND APPARATUS, NETWORK BRIDGE NODE, SOURCE DEVICE, STORAGE MEDIUM AND MESSAGE PROCESSING SYSTEM | |
| CN118433113A (en) | Receiver-based sophisticated congestion control | |
| WO2021120783A1 (en) | Message processing method and apparatus | |
| CN112087390B (en) | Network routing method and device | |
| US20210021503A1 (en) | Telemetry Event Aggregation | |
| TW201520770A (en) | Mirroring for measuring the flow of a sampled network | |
| US9350631B2 (en) | Identifying flows causing undesirable network events | |
| US20220029926A1 (en) | Queue management in a forwarder | |
| CN114079638B (en) | Data transmission method, device and storage medium for multi-protocol hybrid network | |
| WO2020249128A1 (en) | Service routing method and apparatus | |
| CN111585896A (en) | Data forwarding method and device and readable storage medium | |
| WO2023125380A1 (en) | Data management method and corresponding apparatus | |
| WO2021128927A1 (en) | Message processing method and apparatus, storage medium, and electronic apparatus | |
| CN117354253A (en) | A network congestion notification method, device and storage medium | |
| CN117221225A (en) | Network congestion notification method, device and storage medium | |
| Salah et al. | Performance analysis and comparison of interrupt-handling schemes in gigabit networks | |
| CN101309219B (en) | Traffic limitation method and apparatus of slicing message | |
| WO2021013205A1 (en) | Packet loss positioning method, apparatus and system, and computer storage medium | |
| US10547561B1 (en) | Queuing system to achieve maximum queuing latency in a computing device | |
| CN111464455A (en) | Message output method and device | |
| CN114915564A (en) | Network state measuring method, device and system | |
| CN109792405B (en) | Method and apparatus for shared buffer allocation in a transmission node | |
| CN111641698B (en) | Data statistical method, system, equipment and storage medium |
| 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 |