CN109428801A - File transmitting method and device - Google Patents
File transmitting method and device Download PDFInfo
- Publication number
- CN109428801A CN109428801A CN201710731263.3A CN201710731263A CN109428801A CN 109428801 A CN109428801 A CN 109428801A CN 201710731263 A CN201710731263 A CN 201710731263A CN 109428801 A CN109428801 A CN 109428801A
- Authority
- CN
- China
- Prior art keywords
- data packets
- bytes
- data packet
- network device
- tokens
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 101000611240 Homo sapiens Low molecular weight phosphotyrosine protein phosphatase Proteins 0.000 claims description 18
- 102100040323 Low molecular weight phosphotyrosine protein phosphatase Human genes 0.000 claims description 18
- 230000002776 aggregation Effects 0.000 claims description 5
- 238000004220 aggregation Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 abstract description 14
- 238000010586 diagram Methods 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 7
- 230000001934 delay Effects 0.000 description 6
- 230000005641 tunneling Effects 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000012790 confirmation Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 230000000903 blocking effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005538 encapsulation Methods 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4633—Interconnection of networks using encapsulation techniques, e.g. tunneling
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/16—Multipoint routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/82—Miscellaneous aspects
- H04L47/825—Involving tunnels, e.g. MPLS
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
本申请公开了一种报文发送方法及装置,属于通信技术领域。所述方法包括:当接收到第二网络设备通过多条隧道中的任一隧道发送的携带有报文序号的数据报文时,对数据报文进行存储;对于存储的多个数据报文,按照多个数据报文中每个数据报文携带的报文序号,对多个数据报文进行排序;当排序后的多个数据报文中存在满足序号顺序的n个数据报文时,如果n个数据报文的总字节数大于预设字节数,则从多条隧道中确定时延最大的问题隧道;生成携带有问题隧道标识的控制报文发送给第二网络设备,由第二网络设备减少发往问题隧道的数据报文的数量。本申请可以提高数据报文的转发效率,从而提高第一网络设备与第二网络设备之间建立的多条隧道的整体吞吐量。
The present application discloses a message sending method and device, which belong to the technical field of communications. The method includes: when receiving a data message carrying a message sequence number sent by the second network device through any one of the multiple tunnels, storing the data message; for the stored multiple data messages, Sort the multiple data packets according to the packet sequence number carried by each data packet in the multiple data packets; when there are n data packets satisfying the sequence number order in the sorted multiple data packets, if The total number of bytes of the n data packets is greater than the preset number of bytes, the problem tunnel with the largest delay is determined from the multiple tunnels; a control packet carrying the identification of the problem tunnel is generated and sent to the second network device, and the 2. The network device reduces the number of data packets sent to the problem tunnel. The present application can improve the forwarding efficiency of data packets, thereby improving the overall throughput of multiple tunnels established between the first network device and the second network device.
Description
技术领域technical field
本申请涉及通信技术领域,特别涉及一种报文发送方法及装置。The present application relates to the field of communication technologies, and in particular, to a method and device for sending a message.
背景技术Background technique
随着通信技术的发展,为了提高网络设备的接入带宽,增加接入的可靠性,往往采用混合接入(Hybrid Access,HA)技术实现网络设备间的连接。HA技术是指将两个网络设备同时通过多种不同类型的数据链路进行连接,以在该多种不同类型的数据链路上建立这两个网络设备之间的多条隧道,这两个网络设备中的一个网络设备可以将报文通过该多条隧道中的任一隧道发送给另一个网络设备。例如,这两个网络设备可以为家庭网关(HomeGateway, HG)和混合接入汇聚点(Hybrid Access Aggregation Point,HAAP),HG与HAAP之间可以建立有数字用户线路(Digital Subscriber Line,DSL)隧道和长期演进技术(LongTerm Evolution,LTE)隧道。此时,HG可以将报文通过DSL隧道或LTE隧道发送给HAAP,当然,HAAP也可以将报文通过DSL隧道或LTE隧道发送给HG。With the development of communication technology, in order to improve the access bandwidth of network devices and increase the reliability of access, hybrid access (Hybrid Access, HA) technology is often used to realize the connection between network devices. HA technology refers to connecting two network devices at the same time through multiple different types of data links to establish multiple tunnels between the two network devices on the multiple different types of data links. One of the network devices may send the packet to another network device through any one of the multiple tunnels. For example, the two network devices may be a home gateway (HomeGateway, HG) and a hybrid access aggregation point (Hybrid Access Aggregation Point, HAAP), and a digital subscriber line (Digital Subscriber Line, DSL) tunnel can be established between the HG and the HAAP and Long Term Evolution (Long Term Evolution, LTE) tunnels. At this time, the HG can send the packet to the HAAP through the DSL tunnel or the LTE tunnel. Of course, the HAAP can also send the packet to the HG through the DSL tunnel or the LTE tunnel.
这两个网络设备中进行报文发送的网络设备可以称为发送端,进行报文接收的网络设备可以称为接收端。目前,发送端中会维护有一个令牌桶(Token Bucket,TB),发送端会以恒定的速率向该令牌桶中添加令牌,该速率可以是基于发送端与接收端之间建立的多条隧道中的目标隧道的带宽确定得到。之后,如果发送端要向接收端发送某个报文,则可以将该报文的字节数与该令牌桶中的令牌数进行比较。如果该报文的字节数小于或等于该令牌桶中的令牌数,则从该令牌桶中取出与该报文的字节数相同数量的令牌,并将该报文通过目标隧道发送给接收端;如果该报文的字节数大于该令牌桶中的令牌数,则不从该令牌桶中取出令牌,将该报文通过该多条隧道中除目标隧道之外的隧道发送给接收端。Among the two network devices, the network device that transmits the message may be referred to as the sender, and the network device that receives the message may be referred to as the receiver. At present, the sender will maintain a token bucket (TB), and the sender will add tokens to the token bucket at a constant rate, which can be based on the relationship between the sender and the receiver. The bandwidth of the target tunnel in the multiple tunnels is determined. Afterwards, if the sender wants to send a certain packet to the receiver, it can compare the number of bytes of the packet with the number of tokens in the token bucket. If the number of bytes in the packet is less than or equal to the number of tokens in the token bucket, take out the same number of tokens as the number of bytes in the packet from the token bucket, and pass the packet through the target The tunnel is sent to the receiver; if the number of bytes in the packet is greater than the number of tokens in the token bucket, the token is not taken from the token bucket, and the packet is passed through the multiple tunnels except the target tunnel. out of the tunnel sent to the receiver.
实际应用中,发送端一般会将一个数据流分成多个数据报文进行发送,此时为了保证数据流可以在接收端被准确恢复,发送端会按照该多个数据报文的发送顺序为该多个数据报文分配报文序号。接收端接收到发送端发送的数据报文后,可以先将该数据报文存储到重排序缓冲区中,之后,对于重排序缓冲区中的多个数据报文,按照该多个数据报文中每个数据报文的报文序号对该多个数据报文进行排序,并对排序后的该多个数据报文中满足序号顺序的数据报文进行转发,以此保证数据报文是按照其在发送端上的发送顺序来被转发。In practical applications, the sender generally divides a data stream into multiple data packets for transmission. At this time, in order to ensure that the data stream can be accurately recovered at the receiver, the sender will send the data packets according to the order in which the multiple data packets are sent. Multiple data packets are assigned a packet sequence number. After receiving the data packet sent by the sender, the receiving end can first store the data packet in the reordering buffer, and then, for multiple data packets in the reordering buffer, according to the The packet sequence number of each data packet in the data packet sorts the multiple data packets, and forwards the data packets that satisfy the sequence number order among the multiple data packets after sorting, so as to ensure that the data packets are in accordance with the It is forwarded in the order in which it was sent on the sender.
然而,如果发送端与接收端之间建立的多条隧道中的某条隧道的时延与其它隧道的时延相差较大,则发送端通过该隧道发送的数据报文到达接收端的时间将会晚于同时通过其它隧道发送的数据报文到达接收端的时间。这种情况下,通过其它隧道发送的数据报文在到达接收端后,由于通过该隧道发送的数据报文尚未到达,所以,通过其它隧道发送的数据报文需要在接收端的重排序缓冲区中持续等待至通过该隧道发送的数据报文到达后,才能完成满足序号顺序的排序,继而才能被转发,从而导致数据报文的转发耗时较长,转发效率较低,进而导致发送端与接收端之间建立的多条隧道的整体吞吐量较低。However, if the delay of one of the multiple tunnels established between the sender and the receiver is significantly different from the delay of other tunnels, the time for the data packets sent by the sender through the tunnel to reach the receiver will be longer than that of the other tunnels. It is later than the time when the data packets sent through other tunnels arrive at the receiver at the same time. In this case, after the data packets sent through other tunnels arrive at the receiving end, because the data packets sent through this tunnel have not yet arrived, the data packets sent through other tunnels need to be placed in the reordering buffer of the receiving end. Continue to wait until the data packets sent through the tunnel arrive before completing the sorting that satisfies the sequence number sequence and then forwarding them. As a result, the forwarding of data packets takes a long time and the forwarding efficiency is low. The overall throughput of multiple tunnels established between peers is lower.
发明内容SUMMARY OF THE INVENTION
为了解决相关技术中数据报文的转发效率较低的问题,本申请提供了一种报文发送方法及装置。所述技术方案如下:In order to solve the problem of low forwarding efficiency of data messages in the related art, the present application provides a message sending method and device. The technical solution is as follows:
第一方面,提供了一种报文发送方法,应用于第一网络设备,所述第一网络设备与第二网络设备之间建立有多条隧道,所述方法包括:In a first aspect, a method for sending a packet is provided, which is applied to a first network device, where multiple tunnels are established between the first network device and the second network device, and the method includes:
当接收到所述第二网络设备通过所述多条隧道中的任一隧道发送的携带有报文序号的数据报文时,对所述数据报文进行存储;When receiving a data packet carrying a packet sequence number sent by the second network device through any one of the multiple tunnels, storing the data packet;
对于存储的多个数据报文,按照所述多个数据报文中每个数据报文携带的报文序号,对所述多个数据报文进行排序;For the stored multiple data packets, sorting the multiple data packets according to the packet sequence number carried by each data packet in the multiple data packets;
当排序后的所述多个数据报文中存在满足序号顺序的n个数据报文时,如果所述n个数据报文的总字节数大于预设字节数,则从所述多条隧道中确定问题隧道,所述问题隧道为所述多条隧道中时延最大的隧道,所述n为正整数;When there are n data packets satisfying the sequence number order in the sorted multiple data packets, if the total number of bytes of the n data packets is greater than the preset number of bytes, then Determine the problem tunnel in the tunnel, the problem tunnel is the tunnel with the largest delay among the multiple tunnels, and the n is a positive integer;
生成携带有问题隧道标识的控制报文,并将所述控制报文发送给所述第二网络设备,由所述第二网络设备基于所述问题隧道标识,减少发往所述问题隧道的数据报文的数量。Generating a control packet carrying the faulty tunnel identifier, and sending the control packet to the second network device, and the second network device reduces the data sent to the faulty tunnel based on the faulty tunnel identifier The number of messages.
需要说明的是,第二网络设备和第一网络设备可以为采用HA技术进行连接的网络设备。例如,当第一网络设备为HG时,第二网络设备可以为HAAP;当第一网络设备为HAAP时,第二网络设备可以为HG,本发明实施例对此不作限定。It should be noted that, the second network device and the first network device may be network devices connected using the HA technology. For example, when the first network device is HG, the second network device may be HAAP; when the first network device is HAAP, the second network device may be HG, which is not limited in this embodiment of the present invention.
另外,该多条隧道为第二网络设备与第一网络设备之间建立的不同类型的隧道。例如,该多条隧道可以为DSL隧道、LTE隧道等,本发明实施例对此不作限定。In addition, the multiple tunnels are different types of tunnels established between the second network device and the first network device. For example, the multiple tunnels may be DSL tunnels, LTE tunnels, and the like, which are not limited in this embodiment of the present invention.
在本发明实施例中,第二网络设备减少发往问题隧道的数据报文的数量后,可以有效减少问题隧道因报文阻塞引起的时延增加,从而可以有效降低问题隧道的时延,进而减小问题隧道的时延与其它隧道的时延之间的差距。在此情况下,第一网络设备中存储的通过其它隧道发送的数据报文无需等待较长时间即可被转发,数据报文的转发效率得以提升,第一网络设备与第二网络设备之间建立的多条隧道的整体吞吐量也将得以提升,且此时第一网络设备中大量的数据报文突发式地被转发的情形将得以缓解,从而使得后续第二网络设备可以以相对均匀的速度发送新的数据报文,进而避免了第一网络设备与第二网络设备之间的流量突发,而每条数据流的无突发特性使得该多条隧道能够更加稳定地进行工作。In the embodiment of the present invention, after the second network device reduces the number of data packets sent to the problem tunnel, the increase in delay caused by packet congestion in the problem tunnel can be effectively reduced, so that the delay of the problem tunnel can be effectively reduced, and further Reduce the gap between the delay of the problem tunnel and the delay of other tunnels. In this case, the data packets stored in the first network device and sent through other tunnels can be forwarded without waiting for a long time, and the forwarding efficiency of the data packets is improved. The overall throughput of the multiple established tunnels will also be improved, and at this time, the situation that a large number of data packets are forwarded in bursts in the first network device will be alleviated, so that the subsequent second network device can be relatively evenly distributed. A new data packet can be sent at a high speed, thereby avoiding traffic bursts between the first network device and the second network device, and the non-burst characteristic of each data stream enables the multiple tunnels to work more stably.
其中,所述第一网络设备包括第一令牌桶,且当所述第一令牌桶中的令牌数不为0时,以第一预设速率向所述第一令牌桶中添加令牌,当所述第一令牌桶中的令牌数为0时,一次性向所述第一令牌桶中添加所述第一令牌桶能够容纳的最大数量的令牌,所述最大数量为所述预设字节数;所述如果所述n个数据报文的总字节数大于预设数值,则从所述多条隧道中确定问题隧道,包括:The first network device includes a first token bucket, and when the number of tokens in the first token bucket is not 0, adding tokens to the first token bucket at a first preset rate token, when the number of tokens in the first token bucket is 0, add the maximum number of tokens that the first token bucket can hold to the first token bucket at one time, the maximum The number is the preset number of bytes; if the total number of bytes of the n data packets is greater than the preset value, determine the problem tunnel from the multiple tunnels, including:
对于所述n个数据报文中的第i个数据报文,判断所述第i个数据报文的字节数是否大于所述第一令牌桶中的令牌数,所述i为大于或等于1且小于或等于n的整数;For the ith data packet in the n data packets, determine whether the number of bytes of the ith data packet is greater than the number of tokens in the first token bucket, and the i is greater than or an integer equal to 1 and less than or equal to n;
当所述第i个数据报文的字节数小于或等于所述第一令牌桶中的令牌数时,从所述第一令牌桶中取出与所述第i个数据报文的字节数相同数量的令牌;当所述第i个数据报文的字节数大于所述第一令牌桶中的令牌数时,从所述多条隧道中确定问题隧道,确定所述第i个数据报文的字节数与所述第一令牌桶中的令牌数之间的差值,从所述第一令牌桶中取出所有令牌,并在向所述第一令牌桶中添加令牌后,从所述第一令牌桶中取出与所述差值相同数量的令牌;When the number of bytes of the i-th data packet is less than or equal to the number of tokens in the first token bucket, take out from the first token bucket the number of bytes related to the i-th data packet Tokens with the same number of bytes; when the number of bytes of the i-th data packet is greater than the number of tokens in the first token bucket, determine the problem tunnel from the multiple tunnels, and determine the The difference between the number of bytes of the i-th data packet and the number of tokens in the first token bucket is taken out, and all tokens are taken out from the first token bucket and sent to the first token bucket. After adding tokens to a token bucket, take out the same number of tokens as the difference from the first token bucket;
令i=i+1,返回所述对于所述n个数据报文中的第i个数据报文,判断所述第i个数据报文的字节数是否大于所述第一令牌桶中的令牌数的步骤,直至所述i与所述n相等为止。Let i=i+1, return the i-th data packet in the n data packets, and determine whether the number of bytes of the i-th data packet is greater than that in the first token bucket number of tokens until the i equals the n.
由于第一令牌桶中最大能够容纳与预设字节数相同数量的令牌,所以当第i个数据报文的字节数大于第一令牌桶中的令牌数时,表明该n个数据报文中前i个数据报文的总字节数大于预设字节数,因此,此时可以从该多条隧道中确定问题隧道。Since the first token bucket can hold up to the same number of tokens as the preset number of bytes, when the number of bytes of the i-th data packet is greater than the number of tokens in the first token bucket, it indicates that the n The total number of bytes of the first i data packets in the data packets is greater than the preset number of bytes. Therefore, at this time, the problem tunnel can be determined from the multiple tunnels.
进一步地,当所述第i个数据报文的字节数大于所述第一令牌桶中的令牌数时,对所述第i个数据报文进行第一标记;当所述第i个数据报文的字节数小于或等于所述第一令牌桶中的令牌数时,对所述第i个数据报文进行第二标记。Further, when the number of bytes of the i-th data packet is greater than the number of tokens in the first token bucket, the i-th data packet is first marked; When the number of bytes of each data packet is less than or equal to the number of tokens in the first token bucket, a second mark is performed on the i-th data packet.
在本发明实施例中,该n个数据报文中被进行第一标记的数据报文的数量即为该n个数据报文的总字节数与预设字节数的比值,此时该n个数据报文中被进行第一标记的数据报文的数量可以表征流量突发程度,即该n个数据报文中被进行第一标记的数据报文的数量越多,流量突发程度越高,该n个数据报文中被进行第一标记的数据报文的数量越少,流量突发程度越低。而流量突发程度又是由问题隧道的时延与其它隧道的时延之间的差距决定的,因此,该n个数据报文中被进行第一标记的数据报文的数量可以表征问题隧道的时延与其它隧道的时延之间的相差程度,即该n个数据报文中被进行第一标记的数据报文的数量越多,问题隧道的时延与其它隧道的时延之间的差距越大,该n个数据报文中被进行第一标记的数据报文的数量越少,问题隧道的时延与其它隧道的时延之间的差距越小。In this embodiment of the present invention, the number of the first marked data packets in the n data packets is the ratio of the total number of bytes of the n data packets to the preset number of bytes. The number of the first marked data packets in the n data packets can represent the traffic burst degree, that is, the greater the number of the first marked data packets in the n data packets, the higher the traffic burst degree The higher the value, the less the number of data packets that are marked with the first mark among the n data packets, and the lower the degree of traffic burst. The degree of traffic burst is determined by the difference between the delay of the problem tunnel and the delay of other tunnels. Therefore, the number of the first marked data packets in the n data packets can represent the problem tunnel. The degree of difference between the delay of the problem tunnel and the delay of other tunnels, that is, the greater the number of data packets with the first marking in the n data packets, the difference between the delay of the problem tunnel and the delay of other tunnels. The larger the difference is, the smaller the number of data packets to be first marked in the n data packets, and the smaller the gap between the delay of the problem tunnel and the delay of other tunnels.
其中,所述从所述多条隧道中确定问题隧道,包括:Wherein, the determining the problem tunnel from the multiple tunnels includes:
从所述n个数据报文中确定接收时间最晚的目标数据报文;Determine the target data message with the latest reception time from the n data messages;
从所述多条隧道中确定所述第一网络设备发送所述目标数据报文时所使用的隧道;determining, from the plurality of tunnels, the tunnel used by the first network device when sending the target data packet;
将所述第一网络设备发送所述目标数据报文时所使用的隧道确定为问题隧道。The tunnel used by the first network device to send the target data packet is determined as a problem tunnel.
其中,所述生成携带有问题隧道标识的控制报文,包括:Wherein, the generating of the control packet carrying the problematic tunnel identifier includes:
每当对所述n个数据报文中的数据报文进行第一标记时,生成携带有问题隧道标识的控制报文;或者,Whenever the first marking is performed on a data packet in the n data packets, a control packet carrying the identification of the tunnel in question is generated; or,
在每个预设周期内,确定所述n个数据报文中被进行第一标记的数据报文的数量,基于被进行第一标记的数据报文的数量,确定所述问题隧道的问题等级,生成携带有问题隧道标识和所述问题等级的控制报文。In each preset period, determine the number of the data packets with the first marking in the n data packets, and determine the problem level of the problem tunnel based on the number of the data packets with the first marking , and generate a control packet carrying the problem tunnel identifier and the problem level.
在本发明实施例中,可以当该n个数据报文中每出现一个被进行第一标记的数据报文时,就生成一个控制报文并将其发送给第二网络设备,在此情况下,所发送的控制报文的数量可以表征问题隧道的时延与其它隧道的时延之间的相差程度。或者,可以在每个预设周期内生成一个控制报文并将其发送给第二网络设备,在此情况下,所发送的控制报文中携带的问题等级可以表征问题隧道的时延与其它隧道的时延之间的相差程度。In this embodiment of the present invention, a control packet may be generated and sent to the second network device every time a first marked data packet appears in the n data packets. In this case, , the number of sent control packets can represent the difference between the delay of the problem tunnel and the delay of other tunnels. Alternatively, a control packet can be generated in each preset period and sent to the second network device. In this case, the problem level carried in the sent control packet can represent the delay of the problem tunnel and other The difference between the delays of the tunnels.
进一步地,所述对所述多个数据报文进行排序之后,还包括:Further, after the sorting of the plurality of data packets, the method further includes:
当排序后的所述多个数据报文中存在满足序号顺序的n个数据报文时,基于所述n个数据报文中每个数据报文的字节数,以小于或等于第二预设速率的速率对所述n个数据报文进行转发。When there are n data packets that satisfy the sequence of the sequence numbers in the sorted plurality of data packets, based on the number of bytes of each data packet in the n data packets, the number of bytes in each data packet is less than or equal to the second predetermined value. The n data packets are forwarded at the set rate.
在本发明实施例中,第一网络设备以小于或等于第二预设速率的速率对该n个数据报文进行转发,从而可以有效避免大量数据报文突发式地被转发,进而可以有效避免后续该大量数据报文的确认报文被突发式返回第二网络设备,使得后续第二网络设备可以以较为均匀的速度进行新的数据报文的发送,避免了第一网络设备与第二网络设备之间的流量突发,保证了该多条隧道的稳定性。In this embodiment of the present invention, the first network device forwards the n data packets at a rate that is less than or equal to the second preset rate, so that a large number of data packets can be effectively avoided from being forwarded in bursts, thereby effectively Avoid the subsequent confirmation messages of the large number of data messages being returned to the second network device in bursts, so that the subsequent second network device can send new data messages at a relatively uniform speed, avoiding the first network device and the second network device. The burst of traffic between the two network devices ensures the stability of the multiple tunnels.
其中,所述第一网络设备包括第二令牌桶,且以所述第二预设速率向所述第二令牌桶中添加令牌;所述基于所述n个数据报文中每个数据报文的字节数,以小于或等于第二预设速率的速率对所述n个数据报文进行转发,包括:Wherein, the first network device includes a second token bucket, and adds tokens to the second token bucket at the second preset rate; The number of bytes of data packets, the n data packets are forwarded at a rate less than or equal to the second preset rate, including:
对于所述n个数据报文中的第i个数据报文,判断所述第i个数据报文的字节数是否大于所述第二令牌桶中的令牌数;For the ith data packet in the n data packets, determine whether the number of bytes of the ith data packet is greater than the number of tokens in the second token bucket;
当所述第i个数据报文的字节数小于或等于所述第二令牌桶中的令牌数时,从所述第二令牌桶中取出与所述第i个数据报文的字节数相同数量的令牌,并对所述第i个数据报文进行转发;当所述第i个数据报文的字节数大于所述第二令牌桶中的令牌数时,继续等待,直至所述第i个数据报文的字节数小于或等于所述第二令牌桶中的令牌数时,从所述第二令牌桶中取出与所述第i个数据报文的字节数相同数量的令牌,并对所述第i个数据报文进行转发;When the number of bytes of the i-th data packet is less than or equal to the number of tokens in the second token bucket, extract from the second token bucket the number of bytes related to the i-th data packet The number of tokens in the same number of bytes is the same, and the i-th data packet is forwarded; when the number of bytes of the i-th data packet is greater than the number of tokens in the second token bucket, Continue to wait until the number of bytes of the i-th data packet is less than or equal to the number of tokens in the second token bucket, and take out the i-th data from the second token bucket The number of bytes of the message is the same as the number of tokens, and the i-th data message is forwarded;
令i=i+1,返回所述对于所述n个数据报文中的第i个数据报文,判断所述第i个数据报文的字节数是否大于所述第二令牌桶中的令牌数的步骤,直至所述i与所述n相等为止。Let i=i+1, return the i-th data packet in the n data packets, and determine whether the number of bytes of the i-th data packet is greater than that in the second token bucket number of tokens until the i equals the n.
在本发明实施例中,第一网络设备在对该n个数据报文进行转发时,会通过第二令牌桶限制一次可以转发的数据报文的最大字节数,从而可以保证第一网络设备以小于或等于第二预设速率的速率对该n个数据报文进行转发。In this embodiment of the present invention, when forwarding the n data packets, the first network device will limit the maximum number of bytes of data packets that can be forwarded at one time through the second token bucket, thereby ensuring that the first network The device forwards the n data packets at a rate less than or equal to the second preset rate.
第二方面,提供了一种报文发送装置,所述报文发送装置具有实现上述第一方面中报文发送方法行为的功能。所述报文发送装置包括至少一个模块,所述至少一个模块用于实现上述第一方面所提供的报文发送方法。In a second aspect, a message sending apparatus is provided, and the message sending apparatus has a function of implementing the behavior of the message sending method in the first aspect. The message sending apparatus includes at least one module, and the at least one module is configured to implement the message sending method provided in the first aspect.
第三方面,提供了一种报文发送装置,所述报文发送装置的结构中包括处理器和存储器,所述存储器用于存储支持报文发送装置执行上述第一方面所提供的报文发送方法的程序,以及存储用于实现上述第一方面所述的报文发送方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。所述报文发送装置还可以包括通信总线,所述通信总线用于在所述处理器与所述存储器之间建立连接。In a third aspect, a message sending device is provided, the structure of the message sending device includes a processor and a memory, and the memory is used for storing and supporting the message sending device to perform the message sending provided in the first aspect. A program of the method, and storing data involved in implementing the message sending method described in the first aspect above. The processor is configured to execute programs stored in the memory. The message sending apparatus may further include a communication bus for establishing a connection between the processor and the memory.
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的报文发送方法。In a fourth aspect, a computer-readable storage medium is provided, 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 method for sending a message in the first aspect.
第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的报文发送方法。In a fifth aspect, a computer program product containing instructions is provided, which, when executed on a computer, causes the computer to execute the method for sending a message described in the first aspect.
上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。The technical effects obtained by the second aspect, the third aspect, the fourth aspect, and the fifth aspect are similar to the technical effects obtained by the corresponding technical means in the first aspect, and will not be repeated here.
本申请提供的技术方案带来的有益效果是:第二网络设备通过多条隧道中的任一隧道向第二网络设备发送携带有报文序号的数据报文,当第一网络设备接收到第二网络设备通过发送的数据报文时,对该数据报文进行存储。之后,第一网络设备对于存储的多个数据报文,按照该多个数据报文中每个数据报文携带的报文序号,对该多个数据报文进行排序,继而当排序后的多个数据报文中存在满足序号顺序的n个数据报文时,如果该n个数据报文的总字节数大于预设字节数,表明该多条隧道中时延最大的问题隧道的时延与其它隧道的时延相差较大,则可以从该多条隧道中确定问题隧道,并生成携带有问题隧道标识的控制报文发送给第二网络设备。当第二网络设备接收该控制报文时,可以基于该控制报文携带的问题隧道标识,减少发往问题隧道的数据报文的数量,以减少问题隧道因报文阻塞引起的时延增加,从而可以有效降低问题隧道的时延,进而减小问题隧道的时延与其它隧道的时延之间的差距。在此情况下,第一网络设备中存储的通过其它隧道发送的数据报文无需等待较长时间即可被转发,数据报文的转发效率得以提升,第一网络设备与第二网络设备之间建立的多条隧道的整体吞吐量也将得以提升,且此时第一网络设备中大量的数据报文突发式地被转发的情形将得以缓解,从而使得后续第二网络设备可以以相对均匀的速度发送新的数据报文,进而避免了第一网络设备与第二网络设备之间的流量突发,而每条数据流的无突发特性使得该多条隧道能够更加稳定地进行工作。The beneficial effects brought about by the technical solutions provided in the present application are: the second network device sends a data message carrying the message sequence number to the second network device through any one of the multiple tunnels, and when the first network device receives the first When the two network devices pass the sent data message, the data message is stored. After that, the first network device sorts the multiple data packets according to the packet sequence number carried by each data packet in the multiple data packets, and then sorts the multiple data packets after sorting. When there are n data packets that satisfy the sequence number order among the n data packets, if the total number of bytes of the n data packets is greater than the preset number of bytes, it indicates the time of the problem tunnel with the largest delay among the multiple tunnels. If the delay differs greatly from the delay of other tunnels, the problem tunnel can be determined from the multiple tunnels, and a control packet carrying the identification of the problem tunnel can be generated and sent to the second network device. When the second network device receives the control packet, it can reduce the number of data packets sent to the problem tunnel based on the problem tunnel identifier carried in the control packet, so as to reduce the delay increase caused by packet congestion in the problem tunnel, Therefore, the delay of the problem tunnel can be effectively reduced, thereby reducing the gap between the delay of the problem tunnel and the delay of other tunnels. In this case, the data packets stored in the first network device and sent through other tunnels can be forwarded without waiting for a long time, and the forwarding efficiency of the data packets is improved. The overall throughput of the multiple established tunnels will also be improved, and at this time, the situation that a large number of data packets are forwarded in bursts in the first network device will be alleviated, so that the subsequent second network device can be relatively evenly distributed. A new data packet can be sent at a high speed, thereby avoiding traffic bursts between the first network device and the second network device, and the non-burst characteristic of each data stream enables the multiple tunnels to work more stably.
附图说明Description of drawings
图1A是本发明实施例提供的一种两个网络设备连接的示意图;1A is a schematic diagram of the connection of two network devices according to an embodiment of the present invention;
图1B是本发明实施例提供的一种数据报文发送时的示意图;FIG. 1B is a schematic diagram when a data packet is sent according to an embodiment of the present invention;
图1C是本发明实施例提供的一种数据报文转发时的示意图;1C is a schematic diagram of a data packet forwarding provided by an embodiment of the present invention;
图1D是本发明实施例提供的一种报文发送方法所涉及的实施环境的示意图;1D is a schematic diagram of an implementation environment involved in a message sending method provided by an embodiment of the present invention;
图2是本发明实施例提供的一种网络设备的结构示意图;FIG. 2 is a schematic structural diagram of a network device provided by an embodiment of the present invention;
图3是本发明实施例提供的一种报文发送方法的流程图;3 is a flowchart of a method for sending a message according to an embodiment of the present invention;
图4是本发明实施例提供的一种报文发送装置的结构示意图。FIG. 4 is a schematic structural diagram of an apparatus for sending a message according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
在对本发明实施例进行详细地解释说明之前,对本发明实施例涉及的应用场景和实施环境予以说明。Before explaining the embodiments of the present invention in detail, the application scenarios and implementation environments involved in the embodiments of the present invention are described.
首先,对本发明实施例涉及的应用场景进行说明。First, the application scenarios involved in the embodiments of the present invention are described.
HA技术允许两个网络设备之间同时建立多条隧道,这两个网络设备中的一个网络设备可以将报文通过该多条隧道中的任一隧道发送给另一个网络设备,从而可以明显提高网络设备的接入带宽,增加接入的可靠性。例如,如图1A所示,这两个网络设备可以为HG和HAAP, HG与HAAP之间同时建立有DSL隧道和LTE隧道,HG可以将报文通过DSL隧道或LTE 隧道发送给HAAP,当然,HAAP也可以将报文通过DSL隧道或LTE隧道发送给HG。The HA technology allows multiple tunnels to be established between two network devices at the same time. One of the two network devices can send packets to another network device through any of the multiple tunnels, thereby significantly improving the performance of the network. The access bandwidth of network equipment increases the reliability of access. For example, as shown in FIG. 1A , the two network devices can be HG and HAAP. A DSL tunnel and an LTE tunnel are established between HG and HAAP at the same time, and HG can send packets to HAAP through the DSL tunnel or LTE tunnel. Of course, HAAP can also send packets to HG through DSL tunnel or LTE tunnel.
这两个网络设备中进行报文发送的网络设备可以称为发送端,进行报文接收的网络设备可以称为接收端。目前,发送端在发送数据报文时,会按照数据报文的发送顺序为数据报文分配报文序号,以便接收端接收到发送端发送的数据报文后,可以按照其报文序号恢复数据报文在发送端上的发送顺序,继而对数据报文进行转发。例如,如图1B所示,发送端向接收端发送报文序号分别为1、2、3、4、5、6的六个数据报文。之后,接收端先接收到报文序号为1的数据报文,将该数据报文存储在重排序缓冲区中,此时由于该数据报文满足序号顺序,所以对该数据报文进行转发。此后,接收端又接收到报文序号分别为3、5的两个数据报文,将这两个数据报文存储在重排序缓冲区中,此时由于这两个数据报文按照其报文序号排序后不满足序号顺序,所以暂时不对这两个数据报文进行转发。Among the two network devices, the network device that transmits the message may be referred to as the sender, and the network device that receives the message may be referred to as the receiver. At present, when the sender sends a data packet, it will assign a packet sequence number to the data packet according to the sending sequence of the data packet, so that after receiving the data packet sent by the sender, the receiver can restore the data according to its packet sequence number. The order in which the packets are sent on the sender, and then the data packets are forwarded. For example, as shown in FIG. 1B , the transmitting end sends six data packets with packet sequence numbers of 1, 2, 3, 4, 5, and 6 to the receiving end, respectively. After that, the receiving end first receives the data packet with the packet sequence number of 1, and stores the data packet in the reordering buffer. At this time, since the data packet satisfies the sequence number sequence, the data packet is forwarded. After that, the receiving end receives two data packets with packet sequence numbers 3 and 5 respectively, and stores the two data packets in the reordering buffer. The sequence number sequence does not satisfy the sequence number sequence, so the two data packets are not forwarded temporarily.
这种情况下,如果发送端与接收端之间建立的多条隧道中的某条隧道的时延与其它隧道的时延相差较大,则发送端通过该隧道发送的数据报文到达接收端的时间将会晚于同时通过其它隧道发送的数据报文到达接收端的时间。此时,通过其它隧道发送的数据报文到达接收端后,需要在重排序缓冲区中持续等待至通过该隧道发送的数据报文到达后,才能完成满足序号顺序的排序,继而才能被转发,从而导致数据报文的转发耗时较长,转发效率较低,进而导致发送端与接收端之间建立的多条隧道的整体吞吐量较低。例如,如图1B所示,发送端将报文序号分别为1、3、5的三个数据报文通过一条隧道发送给接收端,将报文序号分别为2、4、6的三个数据报文通过另一条隧道发送给接收端。假设两条隧道的时延差距较大,报文序号分别为1、3、5的三个数据报文先到达接收端,报文序号分别为2、4、6的三个数据报文后到达接收端,则报文序号为3的数据报文需要在重排序缓冲区中持续等待至报文序号为2的数据报文到达后,才能与其完成满足序号顺序的排序,继而才能被转发。同理,报文序号为5的数据报文需要在重排序缓冲区中持续等待至报文序号为4的数据报文到达后,才能被转发。In this case, if the delay of one of the multiple tunnels established between the sender and the receiver is significantly different from the delay of other tunnels, the data packets sent by the sender through this tunnel will reach the receiver's The time will be later than the time when the data packets sent through other tunnels arrive at the receiver at the same time. At this time, after the data packets sent through other tunnels arrive at the receiving end, they need to wait in the reordering buffer until the data packets sent through the tunnel arrive. As a result, the forwarding of the data packet takes a long time, and the forwarding efficiency is low, which in turn leads to a low overall throughput of the multiple tunnels established between the sender and the receiver. For example, as shown in Figure 1B, the sender sends three data packets with packet sequence numbers 1, 3, and 5 to the receiver through a tunnel, and sends three data packets with packet sequence numbers 2, 4, and 6 respectively. The packet is sent to the receiver through another tunnel. Assuming that the delay difference between the two tunnels is relatively large, the three data packets with packet sequence numbers 1, 3, and 5 arrive at the receiving end first, and the three data packets with packet sequence numbers 2, 4, and 6 arrive later. At the receiving end, the data packet with the packet sequence number 3 needs to continue to wait in the reordering buffer until the data packet with the packet sequence number 2 arrives before it can complete the sorting that satisfies the sequence number sequence, and then can be forwarded. Similarly, the data packet with the packet sequence number 5 needs to continue to wait in the reordering buffer until the data packet with the packet sequence number 4 arrives before it can be forwarded.
另外,当发送端与接收端之间建立的多条隧道中的某条隧道的时延与其它隧道的时延相差较大时,先到达接收端的数据报文需要等待后到达的数据报文。在该等待过程中,接收端可能会通过时延较小的隧道接收到较多的数据报文,则当通过时延较大的隧道发送的数据报文到达接收端时,在很短的时间内会有大量的数据报文完成满足序号顺序的排序,从而造成大量的数据报文突发式地被转发,进而导致后续该大量的数据报文的确认报文被突发式返回发送端,而发送端收到大量的确认报文后又会突发式地进行大量新的数据报文的发送,造成流量突发,影响了隧道的稳定性。例如,如图1C所示,发送端与接收端之间建立有隧道1 和隧道2,隧道1的时延与隧道2的时延相差较大,且隧道1的时延小于隧道2的时延,发送端将报文序号分别为4、5、6的三个数据报文通过隧道2发送给接收端,将报文序号分别为7、8、9的三个数据报文通过隧道1发送给接收端。之后,由于隧道1和隧道2的时延影响,接收端先接收到报文序号为7的数据报文,然后同时接收到报文序号为8和4的两个数据报文,再接收到报文序号为9和5的两个数据报文,最后接收到报文序号为6的数据报文。此时,报文序号为7、8、9的三个数据报文到达后如果等待至报文序号为6的数据报文到达,则将会完成满足序号顺序的排序,继而报文序号为6、7、8、9的四个数据报文将会被转发,从而造成大量的数据报文突发式地被转发。In addition, when the delay of one of the multiple tunnels established between the sender and the receiver is significantly different from the delay of other tunnels, the data packets that arrive at the receiver first need to wait for the data packets that arrive later. During this waiting process, the receiver may receive more data packets through the tunnel with smaller delay. There will be a large number of data packets to complete the sequence of the sequence number, which will cause a large number of data packets to be forwarded in bursts, and then cause the subsequent confirmation packets of the large number of data packets to be returned to the sender in bursts. However, after receiving a large number of acknowledgment packets, the sender will send a large number of new data packets in bursts, resulting in burst traffic and affecting the stability of the tunnel. For example, as shown in FIG. 1C , tunnel 1 and tunnel 2 are established between the sender and the receiver, the delay of tunnel 1 is quite different from the delay of tunnel 2, and the delay of tunnel 1 is smaller than that of tunnel 2 , the sender sends three data packets with packet sequence numbers 4, 5, and 6 to the receiver through tunnel 2, and sends three data packets with packet sequence numbers 7, 8, and 9 through tunnel 1 to Receiving end. Afterwards, due to the delay of tunnel 1 and tunnel 2, the receiving end first receives the data packet with the packet sequence number 7, and then simultaneously receives the two data packets with packet sequence numbers 8 and 4, and then receives the packet. Two data packets with sequence numbers 9 and 5 are received, and finally a data packet with packet sequence number 6 is received. At this time, if the three data packets with the packet sequence numbers of 7, 8, and 9 arrive, if they wait until the data packet with the packet sequence number of 6 arrives, the sorting that satisfies the sequence number sequence will be completed, and then the packet sequence number will be 6. Four data packets of , 7, 8, and 9 will be forwarded, causing a large number of data packets to be forwarded in bursts.
由上可知,当发送端与接收端之间建立的多条隧道中的某条隧道的时延与其它隧道的时延相差较大时,不仅会造成发送端与接收端之间建立的多条隧道的整体吞吐量的降低,还会造成发送端与接收端之间的流量突发,影响发送端与接收端之间建立的隧道的稳定性。为此,本发明实施例提供了一种报文发送方法,可以在发送端与接收端之间建立的多条隧道中的某条隧道的时延与其它隧道的时延相差较大时,确定该多条隧道中时延最大的问题隧道,并使发送端减少发往问题隧道的数据报文的数量,从而避免该多条隧道的整体吞吐量的降低,且避免发送端与接收端之间的流量突发。It can be seen from the above that when the delay of one of the multiple tunnels established between the sender and the receiver is significantly different from the delay of other tunnels, not only will the delay of a tunnel established between the sender and the receiver be The reduction of the overall throughput of the tunnel will also cause traffic bursts between the sender and the receiver, which affects the stability of the tunnel established between the sender and the receiver. To this end, an embodiment of the present invention provides a packet sending method, which can determine when the delay of a certain tunnel among the multiple tunnels established between the sending end and the receiving end differs greatly from the delay of other tunnels. The problem tunnel with the largest delay among the multiple tunnels makes the sender reduce the number of data packets sent to the problem tunnel, thereby avoiding the reduction of the overall throughput of the multiple tunnels, and avoiding the communication between the sender and the receiver. traffic bursts.
然后,对本发明实施例涉及的实施环境进行说明。Next, the implementation environment related to the embodiment of the present invention will be described.
图1D是本发明实施例提供的一种报文发送方法所涉及的实施环境的示意图。参见图1D,该实施环境可以包括:第一网络设备110和第二网络设备120,第一网络设备110与第二网络设备120之间建立有多条隧道,且第一网络设备110可以通过该多条隧道中的任一隧道向第二网络设备120发送报文,当然,第二网络设备120也可以通过该多条隧道中的任一隧道向第一网络设备110发送报文。FIG. 1D is a schematic diagram of an implementation environment involved in a method for sending a message according to an embodiment of the present invention. Referring to FIG. 1D, the implementation environment may include: a first network device 110 and a second network device 120, multiple tunnels are established between the first network device 110 and the second network device 120, and the first network device 110 can pass the Any one of the multiple tunnels sends a packet to the second network device 120. Of course, the second network device 120 may also send a packet to the first network device 110 through any one of the multiple tunnels.
其中,第一网络设备110可以按照数据报文的发送顺序为数据报文分配报文序号,并将携带有报文序号的数据报文通过该多条隧道发送给第二网络设备120。第二网络设备120每当接收到第一网络设备110发送的一个数据报文时,可以对该数据报文进行存储,且每当存储一个数据报文时,可以对存储的多个数据报文进行排序,如果排序后的多个数据报文中存在满足序号顺序的n个数据报文,则可以对该n个数据报文进行转发。The first network device 110 may allocate a packet sequence number to the data packet according to the sending sequence of the data packet, and send the data packet carrying the packet sequence number to the second network device 120 through the multiple tunnels. Whenever the second network device 120 receives a data packet sent by the first network device 110, it may store the data packet, and whenever it stores a data packet, it may store a plurality of stored data packets. Sorting is performed. If there are n data packets satisfying the sequence of the sequence numbers in the sorted multiple data packets, the n data packets can be forwarded.
接下来对本发明实施例提供的第一网络设备和第二网络设备予以说明。Next, the first network device and the second network device provided by the embodiments of the present invention will be described.
图2是本发明实施例提供的一种网络设备的结构示意图,该网络设备可以是图1D中所示的第一网络设备110或第二网络设备120。参见图2,该网络设备包括至少一个处理器201,通信总线202,存储器203以及至少一个通信接口204。FIG. 2 is a schematic structural diagram of a network device provided by an embodiment of the present invention, and the network device may be the first network device 110 or the second network device 120 shown in FIG. 1D . Referring to FIG. 2 , the network device includes at least one processor 201 , a communication bus 202 , a memory 203 and at least one communication interface 204 .
处理器201可以是一个通用中央处理器(Central Processing Unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。The processor 201 may be a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an application-specific integrated circuit (application-specific integrated circuit, ASIC), or one or more processors for controlling the execution of the programs of the present application. integrated circuit.
通信总线202可包括一通路,在上述组件之间传送信息。Communication bus 202 may include a path to communicate information between the components described above.
存储器203可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其它类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其它类型的动态存储设备,也可以是电可擦可编程只读存储器(ElectricallyErasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其它光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器203可以是独立存在,通过通信总线202与处理器201相连接。存储器203也可以和处理器201集成在一起。Memory 203 may be read-only memory (ROM) or other type of static storage device that can store static information and instructions, random access memory (RAM), or other type of static storage device that can store information and instructions It can also be an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage ( including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of being stored by a computer any other medium taken, but not limited to this. The memory 203 can exist independently and is connected to the processor 201 through the communication bus 202 . The memory 203 may also be integrated with the processor 201 .
通信接口204,使用任何收发器一类的装置,用于与其它设备或通信网络通信,如以太网,无线接入网(Radio Access Network,RAN),无线局域网(Wireless Local AreaNetworks, WLAN)等。The communication interface 204, using any device such as a transceiver, is used to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN) and the like.
在具体实现中,作为一种实施例,处理器201可以包括一个或多个CPU,例如图2中所示的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 201 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 2 .
在具体实现中,作为一种实施例,该网络设备可以包括多个处理器,例如图2中所示的处理器201和处理器205。这些处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the network device may include multiple processors, such as the processor 201 and the processor 205 shown in FIG. 2 . Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
在具体实现中,作为一种实施例,该网络设备还可以包括输出设备206和输入设备207。输出设备206和处理器201通信,可以以多种方式来显示信息。例如,输出设备206可以是液晶显示器(liquid crystal display,LCD),发光二极管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备207 和处理器201通信,可以以多种方式接收用户的输入。例如,输入设备207可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an embodiment, the network device may further include an output device 206 and an input device 207 . The output device 206 is in communication with the processor 201 and can display information in a variety of ways. For example, the output device 206 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, a projector, or the like. Input device 207 is in communication with processor 201 and can receive user input in a variety of ways. For example, the input device 207 may be a mouse, a keyboard, a touch screen device, a sensor device, or the like.
上述的网络设备可以是一个通用网络设备或者是一个专用网络设备。在具体实现中,网络设备可以是台式机、便携式电脑、网络服务器、掌上电脑(Personal DigitalAssistant,PDA)、移动手机、平板电脑、无线终端设备、通信设备或者嵌入式设备,本发明实施例不限定网络设备的类型。The above-mentioned network device may be a general network device or a dedicated network device. In a specific implementation, the network device may be a desktop computer, a portable computer, a network server, a PDA (Personal Digital Assistant, PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device, which is not limited in the embodiments of the present invention. Type of network device.
其中,存储器203用于存储执行本申请方案的程序代码210,处理器201用于执行存储 器203中存储的程序代码210。该网络设备可以通过处理器201以及存储器203中的程序代 码210,来实现下文图3实施例提供的报文发送方法。The memory 203 is used for storing the program code 210 for executing the solution of the present application, and the processor 201 is used for executing the program code 210 stored in the memory 203. The network device can use the processor 201 and the program code 210 in the memory 203 to implement the message sending method provided in the embodiment of Fig. 3 below.
接下来对本发明实施例提供的报文发送方法进行详细地解释说明。Next, the packet sending method provided by the embodiment of the present invention is explained in detail.
图3是本发明实施例提供的一种报文发送方法的流程图。参见图3,该方法包括:FIG. 3 is a flowchart of a method for sending a message according to an embodiment of the present invention. Referring to Figure 3, the method includes:
步骤301:第二网络设备通过多条隧道中的任一隧道向第一网络设备发送数据报文。Step 301: The second network device sends a data packet to the first network device through any one of the multiple tunnels.
需要说明的是,第二网络设备和第一网络设备可以为采用HA技术进行连接的网络设备。例如,当第一网络设备为HG时,第二网络设备可以为HAAP;当第一网络设备为HAAP时,第二网络设备可以为HG,本发明实施例对此不作限定。It should be noted that, the second network device and the first network device may be network devices connected using the HA technology. For example, when the first network device is HG, the second network device may be HAAP; when the first network device is HAAP, the second network device may be HG, which is not limited in this embodiment of the present invention.
另外,该多条隧道为第二网络设备与第一网络设备之间建立的不同类型的隧道。例如,该多条隧道可以为DSL隧道、LTE隧道等,本发明实施例对此不作限定。In addition, the multiple tunnels are different types of tunnels established between the second network device and the first network device. For example, the multiple tunnels may be DSL tunnels, LTE tunnels, and the like, which are not limited in this embodiment of the present invention.
需要说明的是,数据报文中可以携带有报文序号,数据报文携带的报文序号可以是按照数据报文的发送顺序确定得到。例如,第二网络设备依次向第一网络设备发送数据报文1、数据报文2和数据报文3,则数据报文1、数据报文2和数据报文3携带的报文序号分别可以为1、2、3。It should be noted that the data packet may carry a packet sequence number, and the packet sequence number carried in the data packet may be determined according to the sending order of the data packets. For example, if the second network device sends data packet 1, data packet 2, and data packet 3 to the first network device in sequence, the packet sequence numbers carried in data packet 1, data packet 2, and data packet 3 can be respectively 1, 2, 3.
另外,第二网络设备向第一网络设备发送的数据报文可以使用预设隧道协议封装得到,此时数据报文中可以包括隧道协议头部字段,隧道协议头部字段中可以包括报文序号字段,报文序号字段中可以包含有数据报文的报文序号。In addition, the data packet sent by the second network device to the first network device may be obtained by encapsulating a preset tunneling protocol. In this case, the data packet may include a tunneling protocol header field, and the tunneling protocol header field may include a packet sequence number. field, the message sequence number field may contain the message sequence number of the data message.
再者,预设隧道协议可以预先进行设置,如预设隧道协议可以为通用路由封装(Generic Routing Encapsulation,GRE)协议,此时数据报文中可以包括GRE头部字段(GREHeader), GRE头部字段中可以包含报文序号字段(Sequence Number),Sequence Number中可以包含有报文序号。Furthermore, the preset tunneling protocol may be set in advance, for example, the preset tunneling protocol may be a Generic Routing Encapsulation (Generic Routing Encapsulation, GRE) protocol. In this case, the data packet may include a GRE header field (GREHeader), a GRE header. The field may include a message sequence number field (Sequence Number), and the Sequence Number may include a message sequence number.
步骤302:当第一网络设备接收到第二网络设备通过多条隧道中的任一隧道发送的数据报文时,对该数据报文进行存储。Step 302: When the first network device receives a data packet sent by the second network device through any one of the multiple tunnels, the data packet is stored.
需要说明的是,第一网络设备可以将该数据报文存储到重排序缓冲区(bondingreordering buffer)中,当然,第一网络设备也可以将该数据报文存储到其它存储器中,本发明实施例对此不作限定。It should be noted that the first network device may store the data packet in a reordering buffer (bonding reordering buffer). Of course, the first network device may also store the data packet in another memory. This embodiment of the present invention This is not limited.
另外,第一网络设备每接收到第二网络设备发送的一个数据报文,就可以对该数据报文进行存储,且每存储一个数据报文,就可以通过如下步骤303对已经存储的多个数据报文进行排序。In addition, each time the first network device receives a data packet sent by the second network device, it can store the data packet, and each time a data packet is stored, it can perform the following step 303 to store multiple data packets that have been stored. Data packets are sorted.
步骤303:第一网络设备对于存储的多个数据报文,按照该多个数据报文中每个数据报文携带的报文序号,对该多个数据报文进行排序。Step 303: The first network device sorts the stored multiple data packets according to the packet sequence number carried by each data packet in the multiple data packets.
例如,该多个数据报文为数据报文1、数据报文3、数据报文2和数据报文5,且数据报文1、数据报文3、数据报文2和数据报文5携带的报文序号分别为1、3、2、5,则可以按照该多个数据报文中每个数据报文携带的报文序号,对该多个数据报文进行排序,排序后的多个数据报文依序为数据报文1、数据报文2、数据报文3、数据报文5。For example, the multiple data packets are data packet 1, data packet 3, data packet 2, and data packet 5, and data packet 1, data packet 3, data packet 2, and data packet 5 carry The sequence numbers of the packets are 1, 3, 2, and 5 respectively, then the multiple data packets can be sorted according to the packet sequence number carried by each data packet in the multiple data packets, and the sorted multiple data packets can be sorted. The data packets are, in sequence, data packet 1, data packet 2, data packet 3, and data packet 5.
步骤304:当排序后的多个数据报文中存在满足序号顺序的n个数据报文时,如果该n 个数据报文的总字节数大于预设字节数,则第一网络设备从该多条隧道中确定问题隧道,n 为正整数。Step 304: When there are n data packets satisfying the sequence number order in the sorted multiple data packets, if the total number of bytes of the n data packets is greater than the preset number of bytes, the first network device will Determine the problem tunnel among the multiple tunnels, and n is a positive integer.
需要说明的是,序号顺序即为根据预设的编号规则编定报文序号时的顺序。例如,当报文序号为数字编号时,序号顺序可以为1、2、3、4……;当报文序号为字母编号时,序号顺序可以为a、b、c、d……。It should be noted that the sequence of the sequence numbers is the sequence in which the sequence numbers of the packets are programmed according to the preset numbering rules. For example, when the message serial number is a numerical number, the serial number sequence can be 1, 2, 3, 4...; when the message serial number is an alphabetical number, the serial number sequence can be a, b, c, d... .
另外,预设字节数可以预先进行设置,且预设字节数可以设置的较大,如预设字节数可以为1000、1500等,本发明实施例对此不作限定。In addition, the preset number of bytes may be set in advance, and the preset number of bytes may be set larger, for example, the preset number of bytes may be 1000, 1500, etc., which is not limited in this embodiment of the present invention.
再者,问题隧道可以为该多条隧道中时延最大的隧道,且问题隧道的时延与该多条隧道中除问题隧道之外的其它隧道的时延相差较大,此时,第二网络设备通过问题隧道发送的数据报文到达第一网络设备的时间将会晚于第二网络设备同时通过其它隧道发送的数据报文到达第一网络设备的时间。Furthermore, the problem tunnel may be the tunnel with the largest delay among the multiple tunnels, and the delay of the problem tunnel is quite different from the delays of other tunnels except the problem tunnel among the multiple tunnels. In this case, the second The time when the data packet sent by the network device through the problem tunnel reaches the first network device will be later than the time when the data packet sent by the second network device simultaneously through other tunnels reaches the first network device.
由于第一网络设备每接收到一个数据报文就会对其进行存储,且每存储一个数据报文就会对存储的多个数据报文进行排序,并对排序后满足序号顺序的数据报文进行转发。因此,当该n个数据报文的总字节数大于预设字节数时,即当该n个数据报文的总字节数较大时,表明该n个数据报文中接收时间最晚的数据报文的报文序号位于其它数据报文的报文序号之前,此时该n个数据报文中其它数据报文一直在等待该数据报文的到来而未能被转发,因而导致该数据报文到达第一网络设备且进行排序后,满足序号顺序的数据报文的总字节数较大。Because the first network device will store a data packet every time it receives it, and every time a data packet is stored, it will sort the stored data packets, and sort the data packets that satisfy the sequence number order. forward. Therefore, when the total number of bytes of the n data packets is greater than the preset number of bytes, that is, when the total number of bytes of the n data packets is larger, it indicates that the receiving time among the n data packets is the longest. The packet sequence number of the late data packet is located before the packet sequence number of the other data packets. At this time, the other data packets in the n data packets have been waiting for the arrival of the data packet and have not been forwarded, resulting in After the data packet arrives at the first network device and is sorted, the total number of bytes of the data packet satisfying the sequence number sequence is larger.
由于报文序号是按照数据报文在第二网络设备上的发送顺序确定得到,所以该n个数据报文中接收时间最晚的数据报文是在其它数据报文之前被第二网络设备所发送。然而,该数据报文却在其它数据报文之后才到达第一网络设备,因而表明该多条隧道中时延最大的问题隧道的时延与其它隧道的时延相差较大。在问题隧道的时延的影响下,通过问题隧道较早发送的数据报文到达第一网络设备的时间反而较晚,因而在该数据报文到达第一网络设备后,短时间内有大量的数据报文完成满足序号顺序的排序,造成流量突发。Since the packet sequence number is determined according to the order in which the data packets are sent on the second network device, the data packet with the latest reception time among the n data packets is received by the second network device before other data packets. send. However, the data packet arrives at the first network device after other data packets, which indicates that the delay of the problem tunnel with the largest delay among the multiple tunnels is quite different from the delay of other tunnels. Under the influence of the delay of the faulty tunnel, the data packet sent earlier through the faulty tunnel arrives at the first network device later. Therefore, after the data packet reaches the first network device, a large number of Data packets are sorted to meet the sequence number sequence, resulting in traffic bursts.
因此,如果该n个数据报文的总字节数大于预设字节数,则第一网络设备可以从该多条隧道中确定问题隧道,且从该多条隧道中确定问题隧道时,可以先从该n个数据报文中确定接收时间最晚的目标数据报文,再从该多条隧道中确定第一网络设备发送目标数据报文时所使用的隧道,之后,将第一网络设备发送目标数据报文时所使用的隧道确定为问题隧道。Therefore, if the total number of bytes of the n data packets is greater than the preset number of bytes, the first network device can determine the problem tunnel from the multiple tunnels, and when determining the problem tunnel from the multiple tunnels, it can First, determine the target data packet with the latest reception time from the n data packets, and then determine the tunnel used by the first network device to send the target data packet from the multiple tunnels. The tunnel used for sending the target data message is determined as the problem tunnel.
需要说明的是,第一网络设备可以直接当该n个数据报文的总字节数大于预设字节数时,从该多条隧道中确定问题隧道;或者,可以通过第一网络设备中包括的第一令牌桶实现如果该n个数据报文的总字节数大于预设字节数,则从该多条隧道中确定问题隧道的操作。It should be noted that the first network device can directly determine the problem tunnel from the multiple tunnels when the total number of bytes of the n data packets is greater than the preset number of bytes; The included first token bucket implements the operation of determining the problem tunnel from the multiple tunnels if the total number of bytes of the n data packets is greater than the preset number of bytes.
其中,当第一令牌桶中的令牌数不为0时,第一网络设备可以以第一预设速率向第一令牌桶中添加令牌,当第一令牌桶中的令牌数为0时,第一网络设备可以一次性向第一令牌桶中添加第一令牌桶能够容纳的最大数量的令牌,该最大数量可以为预设字节数。Wherein, when the number of tokens in the first token bucket is not 0, the first network device may add tokens to the first token bucket at the first preset rate, when the tokens in the first token bucket When the number is 0, the first network device may add the maximum number of tokens that the first token bucket can hold to the first token bucket at one time, and the maximum number may be a preset number of bytes.
另外,第一预设速率即为第一令牌桶的承诺信息速率(Committed InformationRate,CIR),第一预设速率可以预先进行设置,且第一预设速率可以是根据该多条隧道的总带宽确定得到,也即是,第一令牌桶中的令牌添加速度与第一网络设备从该多条隧道中接收字节的速度相匹配。In addition, the first preset rate is the committed information rate (Committed Information Rate, CIR) of the first token bucket, the first preset rate can be set in advance, and the first preset rate can be based on the total number of tunnels. The bandwidth is determined, that is, the token adding speed in the first token bucket matches the speed at which the first network device receives bytes from the plurality of tunnels.
具体地,当通过第一令牌桶实现如果该n个数据报文的总字节数大于预设字节数,则从该多条隧道中确定问题隧道的操作时,该操作可以包括如下步骤(1)-(3)。Specifically, when the operation of determining the problem tunnel from the multiple tunnels if the total number of bytes of the n data packets is greater than the preset number of bytes is implemented through the first token bucket, the operation may include the following steps (1)-(3).
(1)对于该n个数据报文中的第i个数据报文,判断第i个数据报文的字节数是否大于第一令牌桶中的令牌数,i为大于或等于1且小于或等于n的整数。(1) For the ith data packet in the n data packets, determine whether the number of bytes of the ith data packet is greater than the number of tokens in the first token bucket, i is greater than or equal to 1 and Integer less than or equal to n.
(2)当第i个数据报文的字节数小于或等于第一令牌桶中的令牌数时,从第一令牌桶中取出与第i个数据报文的字节数相同数量的令牌;当第i个数据报文的字节数大于第一令牌桶中的令牌数时,从该多条隧道中确定问题隧道,确定第i个数据报文的字节数与第一令牌桶中的令牌数之间的差值,从第一令牌桶中取出所有令牌,并在向第一令牌桶中添加令牌后,从第一令牌桶中取出与该差值相同数量的令牌。(2) When the number of bytes of the i-th data packet is less than or equal to the number of tokens in the first token bucket, take out the same number of bytes as the i-th data packet from the first token bucket token; when the number of bytes of the i-th data packet is greater than the number of tokens in the first token bucket, determine the problem tunnel from the multiple tunnels, and determine that the number of bytes of the i-th data packet is the same as the number of bytes in the i-th data packet. The difference between the number of tokens in the first token bucket, take all tokens from the first token bucket, and after adding tokens to the first token bucket, take out from the first token bucket The same number of tokens as this difference.
由于第一令牌桶中最大能够容纳与预设字节数相同数量的令牌,所以当第i个数据报文的字节数大于第一令牌桶中的令牌数时,表明该n个数据报文中前i个数据报文的总字节数大于预设字节数,因此,此时可以从该多条隧道中确定问题隧道。Since the first token bucket can hold up to the same number of tokens as the preset number of bytes, when the number of bytes of the i-th data packet is greater than the number of tokens in the first token bucket, it indicates that the n The total number of bytes of the first i data packets in the data packets is greater than the preset number of bytes. Therefore, at this time, the problem tunnel can be determined from the multiple tunnels.
(3)令i=i+1,返回步骤(1),直至i与n相等为止。(3) Let i=i+1, and return to step (1) until i and n are equal.
进一步地,当第i个数据报文的字节数大于第一令牌桶中的令牌数时,还可以对第i个数据报文进行第一标记。其中,第一标记可以预先进行设置,如第一标记可以为将数据报文标记为黄色等,本发明实施例对此不作限定。Further, when the number of bytes of the i-th data packet is greater than the number of tokens in the first token bucket, the i-th data packet may also be marked with the first mark. The first mark may be preset, for example, the first mark may be to mark the data packet as yellow, etc., which is not limited in this embodiment of the present invention.
这种情况下,该n个数据报文中被进行第一标记的数据报文的数量即为该n个数据报文的总字节数与预设字节数的比值,此时该n个数据报文中被进行第一标记的数据报文的数量可以表征流量突发程度,即该n个数据报文中被进行第一标记的数据报文的数量越多,流量突发程度越高,该n个数据报文中被进行第一标记的数据报文的数量越少,流量突发程度越低。In this case, the number of the first marked data packets in the n data packets is the ratio of the total number of bytes of the n data packets to the preset number of bytes. The number of first marked data packets in the data packets can represent the degree of traffic burst, that is, the more the number of first marked data packets in the n data packets, the higher the traffic burst degree , the smaller the number of the first marked data packets among the n data packets, the lower the traffic burst degree.
而流量突发程度又是由问题隧道的时延与其它隧道的时延之间的差距决定的,因此,该 n个数据报文中被进行第一标记的数据报文的数量可以表征问题隧道的时延与其它隧道的时延之间的相差程度,即该n个数据报文中被进行第一标记的数据报文的数量越多,问题隧道的时延与其它隧道的时延之间的差距越大,该n个数据报文中被进行第一标记的数据报文的数量越少,问题隧道的时延与其它隧道的时延之间的差距越小。The degree of traffic burst is determined by the difference between the delay of the problem tunnel and the delay of other tunnels. Therefore, the number of the first marked data packets in the n data packets can represent the problem tunnel. The degree of difference between the delay of the problem tunnel and the delay of other tunnels, that is, the greater the number of data packets with the first marking in the n data packets, the difference between the delay of the problem tunnel and the delay of other tunnels. The larger the difference is, the smaller the number of data packets to be first marked in the n data packets, and the smaller the gap between the delay of the problem tunnel and the delay of other tunnels.
实际应用中,为了更为明显地将该n个数据报文中进行第一标记的数据报文与其它数据报文进行区分,进一步地,当第i个数据报文的字节数小于或等于第一令牌桶中的令牌数时,还可以对第i个数据报文进行第二标记。其中,第二标记可以预先进行设置,如第二标记可以为将数据报文标记为绿色等,本发明实施例对此不作限定。在此情况下,该n个数据报文中每出现一个被进行第一标记的数据报文,则会确定一次问题隧道,而出现一个被进行第二标记的数据报文,则不会确定问题隧道。In practical applications, in order to more clearly distinguish the first marked data packet in the n data packets from other data packets, further, when the number of bytes of the i-th data packet is less than or equal to When the number of tokens in the first token bucket is equal to the number of tokens in the first token bucket, a second mark may also be performed on the i-th data packet. The second mark may be preset, for example, the second mark may be marking the data packet as green, etc., which is not limited in this embodiment of the present invention. In this case, each time a data packet marked with the first mark appears in the n data packets, the problem tunnel will be determined once, and if there is a data packet marked with the second mark, the problem will not be determined. tunnel.
步骤305:第一网络设备生成携带有问题隧道标识的控制报文,并将该控制报文发送给第二网络设备。Step 305: The first network device generates a control packet carrying the identification of the problematic tunnel, and sends the control packet to the second network device.
需要说明的是,问题隧道标识用于唯一标识问题隧道,且问题隧道标识可以为问题隧道的名称、类型等,本发明实施例对此不作限定。It should be noted that the problem tunnel identifier is used to uniquely identify the problem tunnel, and the problem tunnel identifier may be the name and type of the problem tunnel, which is not limited in this embodiment of the present invention.
当确定问题隧道的方式不同时,生成携带有问题隧道标识的控制报文的方式也不同。具体地,当步骤304是直接当该n个数据报文的总字节数大于预设字节数时,从该多条隧道中确定问题隧道时,也即是,在步骤304中仅确定一次问题隧道时,可以直接生成携带有问题隧道标识的控制报文,此时只生成一个控制报文并将其发送给第二网络设备。When the methods for determining the problem tunnel are different, the methods for generating the control packet carrying the identification of the problem tunnel are also different. Specifically, when step 304 is to determine the problem tunnel from the multiple tunnels directly when the total number of bytes of the n data packets is greater than the preset number of bytes, that is, only one determination is made in step 304 When there is a problem tunnel, a control packet carrying the identification of the problem tunnel can be directly generated. In this case, only one control packet is generated and sent to the second network device.
或者,当步骤304是通过第一令牌桶实现如果该n个数据报文的总字节数大于预设字节数,则从该多条隧道中确定问题隧道的操作时,可以每当对该n个数据报文中的数据报文进行第一标记时,也即是,在步骤304中每确定一次问题隧道时,生成携带有问题隧道标识的控制报文,此时该n个数据报文中每出现一个被进行第一标记的数据报文,就会生成一个控制报文并将其发送给第二网络设备,在此情况下,所发送的控制报文的数量可以表征问题隧道的时延与其它隧道的时延之间的相差程度。Or, when step 304 is to use the first token bucket to realize the operation of determining the problem tunnel from the multiple tunnels if the total number of bytes of the n data packets is greater than the preset number of bytes, the When the data packets in the n data packets are marked for the first time, that is, each time a problem tunnel is determined in step 304, a control packet carrying the identification of the problem tunnel is generated. At this time, the n data packets are Every time a data packet marked with the first mark appears in the text, a control packet will be generated and sent to the second network device. In this case, the number of sent control packets can represent the problem tunnel. The difference between the delay and the delay of other tunnels.
或者,当步骤304是通过第一令牌桶实现如果该n个数据报文的总字节数大于预设字节数,则从该多条隧道中确定问题隧道的操作时,可以在每个预设周期内,确定该n个数据报文中被进行第一标记的数据报文的数量,基于被进行第一标记的数据报文的数量,确定问题隧道的问题等级,生成携带有问题隧道标识和该问题等级的控制报文,此时是在每个预设周期内生成一个控制报文并将其发送给第二网络设备,在此情况下,所发送的控制报文中携带的问题等级可以表征问题隧道的时延与其它隧道的时延之间的相差程度。Or, when step 304 is to use the first token bucket to realize the operation of determining the problem tunnel from the multiple tunnels if the total number of bytes of the n data packets is greater than the preset number of bytes, the operation can be performed in each tunnel. Within a preset period, determine the number of data packets that are first marked in the n data packets, determine the problem level of the problem tunnel based on the number of data packets that are first marked, and generate a tunnel carrying the problem Identifies the control message with the problem level. At this time, a control message is generated in each preset period and sent to the second network device. In this case, the problem carried in the sent control message The grade can represent the difference between the delay of the problem tunnel and the delay of other tunnels.
需要说明的是,预设周期可以预先进行设置,且预设周期可以根据实际应用需求来进行设置,本发明实施例对此不作限定。It should be noted that the preset period may be set in advance, and the preset period may be set according to actual application requirements, which is not limited in this embodiment of the present invention.
另外,问题等级用于表征问题隧道的时延与其它隧道的时延之间的相差程度,且问题等级越高,表明问题隧道的时延与其它隧道的时延之间的差距越大,问题等级越小,表明问题隧道的时延与其它隧道的时延之间的差距越小。In addition, the problem level is used to represent the degree of difference between the delay of the problem tunnel and the delay of other tunnels, and the higher the problem level, the greater the gap between the delay of the problem tunnel and the delay of other tunnels, the problem is The smaller the level, the smaller the gap between the delay of the problem tunnel and the delay of other tunnels.
其中,基于被进行第一标记的数据报文的数量,确定该问题隧道的问题等级时,可以基于被进行第一标记的数据报文的数量,从存储的数量与等级之间的对应关系中,获取对应的等级,并将获取的等级确定为该问题隧道的问题等级。当然,实际应用中,也可以基于被进行第一标记的数据报文的数量,通过其它方式确定该问题隧道的问题等级,本发明实施例对此不作限定。Wherein, when determining the problem level of the problem tunnel based on the number of data packets that are first marked, the problem level of the problem tunnel may be determined from the stored correspondence between the number and the level based on the number of data packets that are first marked. , obtain the corresponding grade, and determine the obtained grade as the problem grade of the problem tunnel. Of course, in practical applications, the problem level of the problem tunnel may also be determined in other manners based on the number of data packets that are first marked, which is not limited in this embodiment of the present invention.
需要说明的是,实际应用中,该控制报文可以通过对现有的控制报文进行扩展得到,例如,可以在现有的控制报文中增加坏隧道通知属性值对(Bad Tunnel NotificationAttribute Value Pair,BTN AVP),BTNAVP中可以包括属性类型(Attribute Type)字段、属性长度(Attribute Length)字段、坏隧道通知(Bad Tunnel Notification)字段等,其中,Bad Tunnel Notification 字段中可以包含问题隧道标识。It should be noted that, in practical applications, the control packet can be obtained by extending the existing control packet. For example, a bad tunnel notification attribute value pair (Bad Tunnel NotificationAttribute Value Pair) can be added to the existing control packet. , BTN AVP), BTNAVP may include an attribute type (Attribute Type) field, an attribute length (Attribute Length) field, a bad tunnel notification (Bad Tunnel Notification) field, etc., wherein, the Bad Tunnel Notification field may contain a problem tunnel identifier.
进一步地,当该控制报文中还携带有问题等级时,该控制报文也可以通过对现有的控制报文进行扩展得到,例如,可以在现有的控制报文中增加坏隧道等级属性值对(BadTunnel Grade Attribute Value Pair,BTG AVP),BTG AVP中可以包括属性类型(Attribute Type)字段、属性长度(Attribute Length)字段、坏隧道等级(Bad TunnelGrade)字段等,其中,Bad Tunnel Grade字段中可以包含问题隧道标识和问题等级。Further, when the control message also carries the problem level, the control message can also be obtained by extending the existing control message, for example, the bad tunnel level attribute can be added to the existing control message. Value pair (BadTunnel Grade Attribute Value Pair, BTG AVP), the BTG AVP may include an attribute type (Attribute Type) field, an attribute length (Attribute Length) field, a bad tunnel grade (Bad TunnelGrade) field, etc. Among them, the Bad Tunnel Grade field can contain the problem tunnel ID and problem level.
步骤306:当第二网络设备接收到该控制报文时,基于该控制报文携带的问题隧道标识,减少发往问题隧道的数据报文的数量。Step 306: When the second network device receives the control packet, it reduces the number of data packets sent to the problem tunnel based on the problem tunnel identifier carried in the control packet.
具体地,当第二网络设备接收到该控制报文时,可以将该控制报文携带的问题隧道标识所标识的隧道确定为问题隧道,并减少发往问题隧道的数据报文的数量。Specifically, when the second network device receives the control packet, it may determine the tunnel identified by the problem tunnel identifier carried in the control packet as the problem tunnel, and reduce the number of data packets sent to the problem tunnel.
其中,第二网络设备减少发往问题隧道的数据报文的数量时,还可以基于接收到的该控制报文的数量,或基于该控制报文中携带的问题等级,确定问题隧道的时延与其它隧道的时延之间的相差程度;基于问题隧道的时延与其它隧道的时延之间的相差程度,确定发往问题隧道的数据报文的目标数量,并将发往问题隧道的数据报文的数量减少至目标数量。Wherein, when the second network device reduces the number of data packets sent to the problem tunnel, it may also determine the delay of the problem tunnel based on the number of the control packets received, or based on the problem level carried in the control packet The degree of difference between the delays of other tunnels and the delays of other tunnels; based on the degree of difference between the delays of the problem tunnels and the delays of other tunnels, determine the target number of data packets sent to the problem tunnels, and send them to the problem tunnels. The number of datagrams is reduced to the target number.
值得说明的是,第二网络设备减少发往问题隧道的数据报文的数量后,可以有效减少问题隧道因报文阻塞引起的时延增加,从而可以有效降低问题隧道的时延,进而减小问题隧道的时延与其它隧道的时延之间的差距。在此情况下,第一网络设备中存储的通过其它隧道发送的数据报文无需等待较长时间即可被转发,数据报文的转发效率得以提升,第一网络设备与第二网络设备之间建立的多条隧道的整体吞吐量也将得以提升,且此时第一网络设备中大量的数据报文突发式地被转发的情形将得以缓解,从而使得后续第二网络设备可以以相对均匀的速度发送新的数据报文,进而避免了第一网络设备与第二网络设备之间的流量突发,而每条数据流的无突发特性使得该多条隧道能够更加稳定地进行工作。It is worth noting that after the second network device reduces the number of data packets sent to the problem tunnel, it can effectively reduce the delay increase caused by the packet blocking of the problem tunnel, thereby effectively reducing the delay of the problem tunnel, thereby reducing the delay. The difference between the delay of the tunnel in question and the delay of other tunnels. In this case, the data packets stored in the first network device and sent through other tunnels can be forwarded without waiting for a long time, and the forwarding efficiency of the data packets is improved. The overall throughput of the multiple established tunnels will also be improved, and at this time, the situation that a large number of data packets are forwarded in bursts in the first network device will be alleviated, so that the subsequent second network device can be relatively evenly distributed. A new data packet can be sent at a high speed, thereby avoiding traffic bursts between the first network device and the second network device, and the non-burst characteristic of each data stream enables the multiple tunnels to work more stably.
在本发明实施例中,第二网络设备通过多条隧道中的任一隧道向第二网络设备发送携带有报文序号的数据报文,当第一网络设备接收到第二网络设备通过发送的数据报文时,对该数据报文进行存储。之后,第一网络设备对于存储的多个数据报文,按照该多个数据报文中每个数据报文携带的报文序号,对该多个数据报文进行排序,继而当排序后的多个数据报文中存在满足序号顺序的n个数据报文时,如果该n个数据报文的总字节数大于预设字节数,表明该多条隧道中时延最大的问题隧道的时延与其它隧道的时延相差较大,则可以从该多条隧道中确定问题隧道,并生成携带有问题隧道标识的控制报文发送给第二网络设备。当第二网络设备接收该控制报文时,可以基于该控制报文携带的问题隧道标识,减少发往问题隧道的数据报文的数量,以减少问题隧道因报文阻塞引起的时延增加,从而可以有效降低问题隧道的时延,进而减小问题隧道的时延与其它隧道的时延之间的差距。在此情况下,第一网络设备中存储的通过其它隧道发送的数据报文无需等待较长时间即可被转发,数据报文的转发效率得以提升,第一网络设备与第二网络设备之间建立的多条隧道的整体吞吐量也将得以提升,且此时第一网络设备中大量的数据报文突发式地被转发的情形将得以缓解,从而使得后续第二网络设备可以以相对均匀的速度发送新的数据报文,进而避免了第一网络设备与第二网络设备之间的流量突发,而每条数据流的无突发特性使得该多条隧道能够更加稳定地进行工作。In this embodiment of the present invention, the second network device sends a data packet carrying a packet sequence number to the second network device through any one of the multiple tunnels. When the first network device receives the data packet sent by the second network device through When a data message is received, the data message is stored. After that, the first network device sorts the multiple data packets according to the packet sequence number carried by each data packet in the multiple data packets, and then sorts the multiple data packets after sorting. When there are n data packets that satisfy the sequence number order among the n data packets, if the total number of bytes of the n data packets is greater than the preset number of bytes, it indicates the time of the problem tunnel with the largest delay among the multiple tunnels. If the delay differs greatly from the delay of other tunnels, the problem tunnel can be determined from the multiple tunnels, and a control packet carrying the identification of the problem tunnel can be generated and sent to the second network device. When the second network device receives the control packet, it can reduce the number of data packets sent to the problem tunnel based on the problem tunnel identifier carried in the control packet, so as to reduce the delay increase caused by the packet blocking of the problem tunnel. Therefore, the delay of the problem tunnel can be effectively reduced, thereby reducing the gap between the delay of the problem tunnel and the delay of other tunnels. In this case, the data packets stored in the first network device and sent through other tunnels can be forwarded without waiting for a long time, and the forwarding efficiency of the data packets is improved. The overall throughput of the established multiple tunnels will also be improved, and at this time, the situation in which a large number of data packets are forwarded in bursts in the first network device will be alleviated, so that the subsequent second network device can use a relatively uniform rate. A new data packet is sent at a high speed, thereby avoiding traffic bursts between the first network device and the second network device, and the non-burst characteristic of each data stream enables the multiple tunnels to work more stably.
如前文所述,本发明实施例的步骤303中第一网络设备对于存储的多个数据报文,按照该多个数据报文中每个数据报文携带的报文序号,对该多个数据报文进行排序后,不仅可以通过步骤304确定问题隧道,进一步地,还可以当排序后的该多个数据报文中存在满足序号顺序的n个数据报文时,基于该n个数据报文中每个数据报文的字节数,以小于或等于第二预设速率的速率对该n个数据报文进行转发。As described above, in step 303 of this embodiment of the present invention, for the plurality of data packets stored, the first network device records the data packets for the plurality of data packets according to the packet sequence number carried by each data packet in the plurality of data packets. After the packets are sorted, not only can the problem tunnel be determined through step 304, further, when there are n data packets that satisfy the sequence number order in the sorted data packets, based on the n data packets The number of bytes of each data packet in the n data packets is forwarded at a rate less than or equal to the second preset rate.
需要说明的是,第二预设速率可以预先进行设置,且第二预设速率可以是根据该多条隧道的总带宽确定得到,也即是,第二预设速率与第一网络设备从该多条隧道中接收字节的速度相匹配。It should be noted that the second preset rate may be set in advance, and the second preset rate may be determined according to the total bandwidth of the multiple tunnels, that is, the second preset rate and the first network device from the Match the speed at which bytes are received across multiple tunnels.
其中,基于该n个数据报文中每个数据报文的字节数,以小于或等于第二预设速率的速率对该n个数据报文进行转发的操作可以通过第一网络设备中包括的第二令牌桶实现。Wherein, based on the number of bytes of each data packet in the n data packets, the operation of forwarding the n data packets at a rate less than or equal to the second preset rate can be performed by including in the first network device The second token bucket implementation.
需要说明的是,为了限制流量突发,第二令牌桶能够容纳的最大令牌数较小,例如,第二令牌桶能够容纳的最大令牌数可以远小于第一令牌桶能够容纳的最大令牌数。It should be noted that, in order to limit traffic bursts, the maximum number of tokens that the second token bucket can hold is relatively small. For example, the maximum number of tokens that the second token bucket can hold may be much smaller than that of the first token bucket. maximum number of tokens.
另外,第一网络设备可以以第二预设速率向第二令牌桶中添加令牌,第二预设速率即为第二令牌桶的CIR,此时第二令牌桶中的令牌添加速度与第一网络设备从该多条隧道中接收字节的速度相匹配。In addition, the first network device may add tokens to the second token bucket at a second preset rate, and the second preset rate is the CIR of the second token bucket. At this time, the token in the second token bucket is The rate of addition matches the rate at which the first network device receives bytes from the plurality of tunnels.
具体地,第一网络设备通过第二令牌桶实现基于该n个数据报文中每个数据报文的字节数,以小于或等于第二预设速率的速率对该n个数据报文进行转发的操作时,该操作可以包括如下步骤(1)-(3)。Specifically, the first network device uses the second token bucket to implement, based on the number of bytes of each of the n data packets, for the n data packets at a rate less than or equal to the second preset rate When the forwarding operation is performed, the operation may include the following steps (1)-(3).
(1)对于该n个数据报文中的第i个数据报文,判断第i个数据报文的字节数是否大于第二令牌桶中的令牌数。(1) For the ith data packet in the n data packets, determine whether the number of bytes of the ith data packet is greater than the number of tokens in the second token bucket.
(2)当第i个数据报文的字节数小于或等于第二令牌桶中的令牌数时,从第二令牌桶中取出与第i个数据报文的字节数相同数量的令牌,并对第i个数据报文进行转发;当第i个数据报文的字节数大于第二令牌桶中的令牌数时,继续等待,直至第i个数据报文的字节数小于或等于第二令牌桶中的令牌数时,从第二令牌桶中取出与第i个数据报文的字节数相同数量的令牌,并对第i个数据报文进行转发。(2) When the number of bytes of the i-th data packet is less than or equal to the number of tokens in the second token bucket, take out the same number of bytes as the i-th data packet from the second token bucket and forward the i-th data packet; when the number of bytes of the i-th data packet is greater than the number of tokens in the second token bucket, continue to wait until the i-th data packet reaches the When the number of bytes is less than or equal to the number of tokens in the second token bucket, take out the same number of tokens as the number of bytes in the i-th data packet from the second token bucket, and perform an analysis on the i-th data packet. The text is forwarded.
进一步地,当第i个数据报文的字节数小于或等于第二令牌桶中的令牌数时,还可以对第i个数据报文进行第三标记,当第i个数据报文的字节数大于第二令牌桶中的令牌数时,还可以对第i个数据报文进行第四标记。在此情况下,该n个数据报文中被进行第三标记的数据报文允许其转发,被进行第四标记的数据报文则需等到第二令牌桶中的令牌数恢复到足够的数量后,才会对其重新进行标记(即对其进行第三标记)并允许其转发。Further, when the number of bytes of the i-th data packet is less than or equal to the number of tokens in the second token bucket, a third mark may also be performed on the i-th data packet. When the number of bytes of the ith is greater than the number of tokens in the second token bucket, a fourth mark may also be performed on the ith data packet. In this case, the data packets marked with the third mark among the n data packets are allowed to be forwarded, and the data packets marked with the fourth mark need to wait until the number of tokens in the second token bucket is restored to enough , it will be re-marked (ie, it will be marked a third time) and allowed to be forwarded.
其中,第三标记和第四标记可以预先进行设置,如第三标记可以为将数据报文标记为绿色等,第四标记可以为将数据报文标记为红色等,本发明实施例对此不作限定。The third mark and the fourth mark may be set in advance, for example, the third mark may be marking the data packet as green, etc., and the fourth mark may be marking the data packet as red, etc., which is not made in this embodiment of the present invention. limited.
(3)令i=i+1,返回步骤(1),直至i与n相等为止。(3) Let i=i+1, and return to step (1) until i and n are equal.
在本发明实施例中,第一网络设备在对该n个数据报文进行转发时,会通过第二令牌桶限制一次可以转发的数据报文的最大字节数,从而可以有效避免大量数据报文突发式地被转发,进而可以有效避免后续该大量数据报文的确认报文被突发式返回第二网络设备,使得后续第二网络设备可以以较为均匀的速度进行新的数据报文的发送,避免了第一网络设备与第二网络设备之间的流量突发,保证了该多条隧道的稳定性。In the embodiment of the present invention, when the first network device forwards the n data packets, the second token bucket limits the maximum number of bytes of the data packets that can be forwarded at one time, thereby effectively avoiding a large amount of data The packets are forwarded in bursts, thereby effectively preventing the subsequent confirmation packets of a large number of data packets from being returned to the second network device in bursts, so that the subsequent second network devices can transmit new data packets at a relatively uniform speed. The sending of the message avoids traffic bursts between the first network device and the second network device, and ensures the stability of the multiple tunnels.
图4是本发明实施例提供的一种报文发送装置的结构示意图,该报文发送装置应用于第一网络设备,该报文发送装置可以由软件、硬件或者两者的结合实现成为第一网络设备的部分或者全部,该第一网络设备可以为图2所示的网络设备,且第一网络设备与第二网络设备之间建立有多条隧道。参见图4,该装置包括存储模块401,排序模块402,确定模块403和发送模块404。4 is a schematic structural diagram of an apparatus for sending a message according to an embodiment of the present invention. The apparatus for sending a message is applied to a first network device, and the apparatus for sending a message can be implemented by software, hardware, or a combination of the two to become the first network device. Part or all of the network device, the first network device may be the network device shown in FIG. 2 , and multiple tunnels are established between the first network device and the second network device. Referring to FIG. 4 , the apparatus includes a storage module 401 , a sorting module 402 , a determining module 403 and a sending module 404 .
存储模块401,用于执行图3实施例中的步骤302;a storage module 401, configured to perform step 302 in the embodiment of FIG. 3;
排序模块402,用于执行图3实施例中的步骤303;a sorting module 402, configured to perform step 303 in the embodiment of FIG. 3;
确定模块403,用于执行图3实施例中的步骤304;Determining module 403, configured to perform step 304 in the embodiment of FIG. 3;
发送模块404,用于执行图3实施例中的步骤305。The sending module 404 is configured to perform step 305 in the embodiment of FIG. 3 .
可选地,第一网络设备包括第一令牌桶,且当第一令牌桶中的令牌数不为0时,以第一预设速率向第一令牌桶中添加令牌,当第一令牌桶中的令牌数为0时,一次性向第一令牌桶中添加第一令牌桶能够容纳的最大数量的令牌,最大数量为预设字节数;确定模块403包括:Optionally, the first network device includes a first token bucket, and when the number of tokens in the first token bucket is not 0, adding tokens to the first token bucket at a first preset rate, when When the number of tokens in the first token bucket is 0, add the maximum number of tokens that the first token bucket can hold to the first token bucket at one time, and the maximum number is the preset number of bytes; the determining module 403 includes: :
第一判断单元,用于执行图3实施例中的步骤304的步骤(1);a first judgment unit, configured to perform step (1) of step 304 in the embodiment of FIG. 3;
取令牌单元,用于执行图3实施例中的步骤304的步骤(2);a token-fetching unit for performing step (2) of step 304 in the embodiment of FIG. 3;
第一触发单元,用于执行图3实施例中的步骤304的步骤(3)。The first trigger unit is configured to execute step (3) of step 304 in the embodiment of FIG. 3 .
可选地,确定模块403包括:Optionally, the determining module 403 includes:
第一确定单元,用于从n个数据报文中确定接收时间最晚的目标数据报文;a first determining unit, configured to determine the target data message with the latest reception time from the n data messages;
第二确定单元,用于从多条隧道中确定第一网络设备发送目标数据报文时所使用的隧道;a second determining unit, configured to determine the tunnel used by the first network device to send the target data message from the multiple tunnels;
第三确定单元,用于将第一网络设备发送目标数据报文时所使用的隧道确定为问题隧道。The third determining unit is configured to determine the tunnel used by the first network device to send the target data message as the problem tunnel.
可选地,确定模块403还包括:Optionally, the determining module 403 further includes:
标记单元,用于当第i个数据报文的字节数大于第一令牌桶中的令牌数时,对第i个数据报文进行第一标记;a marking unit, configured to first mark the ith data packet when the number of bytes of the ith data packet is greater than the number of tokens in the first token bucket;
相应地,发送模块404包括:Correspondingly, the sending module 404 includes:
第一生成单元,用于每当对n个数据报文中的数据报文进行第一标记时,生成携带有问题隧道标识的控制报文;或者,a first generating unit, configured to generate a control packet carrying a problematic tunnel identifier whenever the first marking is performed on a data packet in the n data packets; or,
第二生成单元,用于在每个预设周期内,确定n个数据报文中被进行第一标记的数据报文的数量,基于被进行第一标记的数据报文的数量,确定问题隧道的问题等级,生成携带有问题隧道标识和问题等级的控制报文。The second generating unit is configured to determine, in each preset period, the number of data packets that are marked with the first mark among the n data packets, and determine the problem tunnel based on the number of data packets that are marked with the first mark. The problem level is specified, and a control packet carrying the problem tunnel ID and problem level is generated.
可选地,该装置还包括:Optionally, the device also includes:
转发模块,用于当排序后的多个数据报文中存在满足序号顺序的n个数据报文时,基于 n个数据报文中每个数据报文的字节数,以小于或等于第二预设速率的速率对n个数据报文进行转发。The forwarding module is used for, when there are n data packets satisfying the sequence number order in the sorted multiple data packets, based on the number of bytes of each data packet in the n data packets, the number of bytes in each data packet is less than or equal to the second The rate of the preset rate forwards n data packets.
可选地,第一网络设备包括第二令牌桶,且以第二预设速率向第二令牌桶中添加令牌;转发模块包括:Optionally, the first network device includes a second token bucket, and adds tokens to the second token bucket at a second preset rate; the forwarding module includes:
第二判断单元,用于对于n个数据报文中的第i个数据报文,判断第i个数据报文的字节数是否大于第二令牌桶中的令牌数;The second judgment unit is used for judging whether the number of bytes of the ith data packet is greater than the number of tokens in the second token bucket for the ith data packet in the n data packets;
转发单元,用于当第i个数据报文的字节数小于或等于第二令牌桶中的令牌数时,从第二令牌桶中取出与第i个数据报文的字节数相同数量的令牌,并对第i个数据报文进行转发;当第i个数据报文的字节数大于第二令牌桶中的令牌数时,继续等待,直至第i个数据报文的字节数小于或等于第二令牌桶中的令牌数时,从第二令牌桶中取出与第i个数据报文的字节数相同数量的令牌,并对第i个数据报文进行转发;The forwarding unit is used to extract the byte number of the i-th data packet from the second token bucket when the number of bytes of the i-th data packet is less than or equal to the number of tokens in the second token bucket the same number of tokens, and forward the i-th data packet; when the number of bytes of the i-th data packet is greater than the number of tokens in the second token bucket, continue to wait until the i-th data packet When the number of bytes of the data packet is less than or equal to the number of tokens in the second token bucket, take out the same number of tokens as the number of bytes of the i-th data packet from the second token bucket, and compare the i-th data packet with the same number of tokens. data packets are forwarded;
第二触发单元,用于令i=i+1,触发第二判断单元对于n个数据报文中的第i个数据报文,判断第i个数据报文的字节数是否大于第二令牌桶中的令牌数,直至i与n相等为止。The second triggering unit is configured to set i=i+1, and trigger the second judgment unit to judge whether the number of bytes of the i-th data packet is greater than that of the second data packet for the i-th data packet in the n data packets. The number of tokens in the bucket until i equals n.
可选地,当第一网络设备为家庭网关HG时,第二网络设备为混合接入汇聚点HAAP;当第一网络设备为HAAP时,第二网络设备为HG。Optionally, when the first network device is a home gateway HG, the second network device is a hybrid access aggregation point HAAP; when the first network device is a HAAP, the second network device is HG.
在本发明实施例中,第二网络设备通过多条隧道中的任一隧道向第二网络设备发送携带有报文序号的数据报文,当第一网络设备接收到第二网络设备通过发送的数据报文时,对该数据报文进行存储。之后,第一网络设备对于存储的多个数据报文,按照该多个数据报文中每个数据报文携带的报文序号,对该多个数据报文进行排序,继而当排序后的多个数据报文中存在满足序号顺序的n个数据报文时,如果该n个数据报文的总字节数大于预设字节数,表明该多条隧道中时延最大的问题隧道的时延与其它隧道的时延相差较大,则可以从该多条隧道中确定问题隧道,并生成携带有问题隧道标识的控制报文发送给第二网络设备。当第二网络设备接收该控制报文时,可以基于该控制报文携带的问题隧道标识,减少发往问题隧道的数据报文的数量,以减少问题隧道因报文阻塞引起的时延增加,从而可以有效降低问题隧道的时延,进而减小问题隧道的时延与其它隧道的时延之间的差距。在此情况下,第一网络设备中存储的通过其它隧道发送的数据报文无需等待较长时间即可被转发,数据报文的转发效率得以提升,第一网络设备与第二网络设备之间建立的多条隧道的整体吞吐量也将得以提升,且此时第一网络设备中大量的数据报文突发式地被转发的情形将得以缓解,从而使得后续第二网络设备可以以相对均匀的速度发送新的数据报文,进而避免了第一网络设备与第二网络设备之间的流量突发,而每条数据流的无突发特性使得该多条隧道能够更加稳定地进行工作。In this embodiment of the present invention, the second network device sends a data packet carrying a packet sequence number to the second network device through any one of the multiple tunnels. When the first network device receives the data packet sent by the second network device through When a data message is received, the data message is stored. After that, the first network device sorts the multiple data packets according to the packet sequence number carried by each data packet in the multiple data packets, and then sorts the multiple data packets after sorting. When there are n data packets that satisfy the sequence number order among the n data packets, if the total number of bytes of the n data packets is greater than the preset number of bytes, it indicates the time of the problem tunnel with the largest delay among the multiple tunnels. If the delay differs greatly from the delay of other tunnels, the problem tunnel can be determined from the multiple tunnels, and a control packet carrying the identification of the problem tunnel can be generated and sent to the second network device. When the second network device receives the control packet, it can reduce the number of data packets sent to the problem tunnel based on the problem tunnel identifier carried in the control packet, so as to reduce the delay increase caused by packet congestion in the problem tunnel, Therefore, the delay of the problem tunnel can be effectively reduced, thereby reducing the gap between the delay of the problem tunnel and the delay of other tunnels. In this case, the data packets stored in the first network device and sent through other tunnels can be forwarded without waiting for a long time, and the forwarding efficiency of the data packets is improved. The overall throughput of the multiple established tunnels will also be improved, and at this time, the situation that a large number of data packets are forwarded in bursts in the first network device will be alleviated, so that the subsequent second network device can be relatively evenly distributed. A new data packet can be sent at a high speed, thereby avoiding traffic bursts between the first network device and the second network device, and the non-burst characteristic of each data stream enables the multiple tunnels to work more stably.
需要说明的是:上述实施例提供的报文发送装置在报文发送时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的报文发送装置与报文发送方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the message sending device provided in the above embodiment sends a message, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by different functional modules as required. , that is, dividing the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the message sending apparatus and the message sending method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机指令时,全部或部分地产生按照本发明实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(DigitalSubscriber Line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(DigitalVersatile Disc, DVD))、或者半导体介质(例如:固态硬盘(Solid State Disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the procedures or functions according to the embodiments of the present invention result in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions may be stored on or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer, server or data center (For example: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (for example: infrared, wireless, microwave, etc.) way to transmit to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available medium may be a magnetic medium (for example: floppy disk, hard disk, magnetic tape), optical medium (for example: Digital Versatile Disc (DVD)), or semiconductor medium (for example: Solid State Disk (SSD)), etc. .
以上该为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above examples provided for this application are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection scope of this application. .
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710731263.3A CN109428801A (en) | 2017-08-23 | 2017-08-23 | File transmitting method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710731263.3A CN109428801A (en) | 2017-08-23 | 2017-08-23 | File transmitting method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN109428801A true CN109428801A (en) | 2019-03-05 |
Family
ID=65499353
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710731263.3A Withdrawn CN109428801A (en) | 2017-08-23 | 2017-08-23 | File transmitting method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109428801A (en) |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111669831A (en) * | 2020-05-22 | 2020-09-15 | 中国联合网络通信集团有限公司 | A resource allocation method and device |
| CN111726300A (en) * | 2020-06-15 | 2020-09-29 | 哈工大机器人(合肥)国际创新研究院 | Data sending method and device |
| CN112751741A (en) * | 2019-10-31 | 2021-05-04 | 中兴通讯股份有限公司 | Message transmission method and device |
| CN113992607A (en) * | 2021-09-09 | 2022-01-28 | 新华三信息安全技术有限公司 | Message processing method and device |
| CN114095433A (en) * | 2021-11-25 | 2022-02-25 | 新华三技术有限公司合肥分公司 | Message sending method, device, electronic equipment and medium |
| CN114731334A (en) * | 2020-02-14 | 2022-07-08 | 华为技术有限公司 | Message order preserving method and device |
| WO2022156808A1 (en) * | 2021-01-25 | 2022-07-28 | 华为技术有限公司 | Packet processing method and related apparatus |
| CN114978986A (en) * | 2022-05-13 | 2022-08-30 | 中国联合网络通信集团有限公司 | Data transmission method, device and storage medium |
| CN115037671A (en) * | 2021-03-04 | 2022-09-09 | 华为技术有限公司 | Multi-path aggregation scheduling method and electronic equipment |
| WO2023283924A1 (en) * | 2021-07-16 | 2023-01-19 | 北京小米移动软件有限公司 | Data transmission method, data transmission apparatus, and storage medium |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102271086A (en) * | 2011-07-25 | 2011-12-07 | 华为技术有限公司 | Method and device for sending messages |
| CN102984081A (en) * | 2012-10-30 | 2013-03-20 | 盛科网络(苏州)有限公司 | Method and system of message processing in network equipment |
| CN103618678A (en) * | 2013-11-18 | 2014-03-05 | 北京星网锐捷网络技术有限公司 | Method, device and system for self-adaptation multiple-link aggregation |
| US20150003240A1 (en) * | 2006-02-21 | 2015-01-01 | Rockstar Consortium Us Lp | Adaptive call routing in ip networks |
| CN106230619A (en) * | 2016-07-21 | 2016-12-14 | 湖南智卓创新金融电子有限公司 | Data sending, receiving method and device, data transmission method and system |
| CN106411773A (en) * | 2016-08-29 | 2017-02-15 | 武汉微创光电股份有限公司 | Traffic shaping method and system in video transmission based on token bucket |
-
2017
- 2017-08-23 CN CN201710731263.3A patent/CN109428801A/en not_active Withdrawn
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150003240A1 (en) * | 2006-02-21 | 2015-01-01 | Rockstar Consortium Us Lp | Adaptive call routing in ip networks |
| CN102271086A (en) * | 2011-07-25 | 2011-12-07 | 华为技术有限公司 | Method and device for sending messages |
| CN102984081A (en) * | 2012-10-30 | 2013-03-20 | 盛科网络(苏州)有限公司 | Method and system of message processing in network equipment |
| CN103618678A (en) * | 2013-11-18 | 2014-03-05 | 北京星网锐捷网络技术有限公司 | Method, device and system for self-adaptation multiple-link aggregation |
| CN106230619A (en) * | 2016-07-21 | 2016-12-14 | 湖南智卓创新金融电子有限公司 | Data sending, receiving method and device, data transmission method and system |
| CN106411773A (en) * | 2016-08-29 | 2017-02-15 | 武汉微创光电股份有限公司 | Traffic shaping method and system in video transmission based on token bucket |
Cited By (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112751741A (en) * | 2019-10-31 | 2021-05-04 | 中兴通讯股份有限公司 | Message transmission method and device |
| CN112751741B (en) * | 2019-10-31 | 2023-09-15 | 中兴通讯股份有限公司 | Message transmission method and device |
| CN114731334B (en) * | 2020-02-14 | 2023-10-20 | 华为技术有限公司 | Message order preserving method and device |
| CN114731334A (en) * | 2020-02-14 | 2022-07-08 | 华为技术有限公司 | Message order preserving method and device |
| CN111669831B (en) * | 2020-05-22 | 2022-09-09 | 中国联合网络通信集团有限公司 | A resource allocation method and device |
| CN111669831A (en) * | 2020-05-22 | 2020-09-15 | 中国联合网络通信集团有限公司 | A resource allocation method and device |
| CN111726300A (en) * | 2020-06-15 | 2020-09-29 | 哈工大机器人(合肥)国际创新研究院 | Data sending method and device |
| EP4254883A4 (en) * | 2021-01-25 | 2024-05-22 | Huawei Technologies Co., Ltd. | Packet processing method and related apparatus |
| WO2022156808A1 (en) * | 2021-01-25 | 2022-07-28 | 华为技术有限公司 | Packet processing method and related apparatus |
| CN115037671A (en) * | 2021-03-04 | 2022-09-09 | 华为技术有限公司 | Multi-path aggregation scheduling method and electronic equipment |
| WO2023283924A1 (en) * | 2021-07-16 | 2023-01-19 | 北京小米移动软件有限公司 | Data transmission method, data transmission apparatus, and storage medium |
| CN113992607B (en) * | 2021-09-09 | 2023-11-03 | 新华三信息安全技术有限公司 | Message processing method and device |
| CN113992607A (en) * | 2021-09-09 | 2022-01-28 | 新华三信息安全技术有限公司 | Message processing method and device |
| CN114095433A (en) * | 2021-11-25 | 2022-02-25 | 新华三技术有限公司合肥分公司 | Message sending method, device, electronic equipment and medium |
| CN114095433B (en) * | 2021-11-25 | 2024-02-23 | 新华三技术有限公司合肥分公司 | Message sending method and device, electronic equipment and medium |
| CN114978986A (en) * | 2022-05-13 | 2022-08-30 | 中国联合网络通信集团有限公司 | Data transmission method, device and storage medium |
| CN114978986B (en) * | 2022-05-13 | 2024-05-14 | 中国联合网络通信集团有限公司 | Data transmission method, device and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109428801A (en) | File transmitting method and device | |
| CN111654447B (en) | Method and device for message transmission | |
| CN108494676B (en) | Data transmission method, data transmission device, data transceiving equipment, data transceiving system and storage medium | |
| US20190260609A1 (en) | Packet processing method and network device in hybrid access network | |
| CN108390820A (en) | Method, equipment and the system of load balancing | |
| CN108881008A (en) | A method, device and system for data transmission | |
| CN111436030B (en) | Method, device and system for reporting data usage | |
| CN104301066A (en) | Data packet transmission method and device | |
| CN108471629A (en) | The control method of business service quality, equipment and system in transmission network | |
| CN109548063B (en) | Method, device, equipment and storage medium for processing message | |
| CN111026324B (en) | Updating method and device of forwarding table entry | |
| CN113938872B (en) | Communication method, device, system and computer storage medium | |
| WO2019165855A1 (en) | Message transmission method and device | |
| CN110324162B (en) | Business service quality detection method, equipment and system | |
| CN111740903B (en) | A data transmission method and device | |
| CN112019492B (en) | Access control method, device and storage medium | |
| WO2018108127A1 (en) | Method for sending information, method for receiving information, pdcp entity, and computer storage medium | |
| CN110677871B (en) | Data sending method and sending device, data receiving method and receiving device | |
| US10999210B2 (en) | Load sharing method and network device | |
| CN115550250B (en) | Small flow packet retransmission method, system, electronic device and storage medium | |
| CN107733903B (en) | Data transmission confirmation method based on UDP (user Datagram protocol) and base station | |
| CN110391998A (en) | A method and device for service stream transmission | |
| CN111865884B (en) | A message processing method, device and equipment | |
| CN102316022B (en) | Protocol message forwarding method and communication equipment | |
| CN114697253A (en) | Method for determining forwarding path of service chain and communication device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| WW01 | Invention patent application withdrawn after publication |
Application publication date: 20190305 |
|
| WW01 | Invention patent application withdrawn after publication |