WO2014026571A1 - Method and device for sending generic routing encapsulation tunnel message - Google Patents
Method and device for sending generic routing encapsulation tunnel message Download PDFInfo
- Publication number
- WO2014026571A1 WO2014026571A1 PCT/CN2013/081236 CN2013081236W WO2014026571A1 WO 2014026571 A1 WO2014026571 A1 WO 2014026571A1 CN 2013081236 W CN2013081236 W CN 2013081236W WO 2014026571 A1 WO2014026571 A1 WO 2014026571A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- message
- value
- fragmentation
- maximum transmission
- transmission unit
- Prior art date
Links
- 238000005538 encapsulation Methods 0.000 title claims abstract description 102
- 238000000034 method Methods 0.000 title claims abstract description 33
- 230000005540 biological transmission Effects 0.000 claims abstract description 70
- 238000013467 fragmentation Methods 0.000 claims description 86
- 238000006062 fragmentation reaction Methods 0.000 claims description 86
- 239000012634 fragment Substances 0.000 claims description 32
- 238000001514 detection method Methods 0.000 claims description 21
- 230000004044 response Effects 0.000 claims description 17
- 238000000638 solvent extraction Methods 0.000 abstract 2
- 239000000523 sample Substances 0.000 description 33
- 230000008569 process Effects 0.000 description 6
- 230000008521 reorganization Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000006798 recombination Effects 0.000 description 1
- 238000005215 recombination Methods 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
Definitions
- the present invention relates to the field of communications, and in particular, to a method and apparatus for transmitting a general route encapsulation tunnel message. Background technique
- the Generic Routing Encapsulation (GRE) protocol is a tunnel encapsulation protocol that encapsulates packets of a certain network layer protocol, such as IP, IPv6, and MPLS, into another network layer protocol, such as IP.
- IP network layer protocol
- the mechanism in IPv6 packets enables packets to be transmitted on heterogeneous networks.
- the system needs to transmit a payload packet, which needs to be encapsulated and sent to a destination.
- the payload packet uses a different protocol than the protocol supported by the network. In this case, the payload needs to be carried out.
- the GRE is encapsulated, and then the GRE packet is encapsulated in another protocol for forwarding.
- the outer protocol is an encapsulation protocol, which is a protocol used on the network.
- the GRE provides a tunnel encapsulation technology to enable the user's IPv6. Packets can traverse the IPv4 backbone network. Encapsulation and decapsulation are performed on the IPv4 network edge device.
- the forwarding routing table is searched and the IPv6 packet is imported into the GRE tunnel for GRE encapsulation: Encapsulating the GRE header And the outer IPv4 header, the encapsulated IPv4 packet traverses the IPv4 network and reaches the edge device R2 of the IPv4 network, decapsulates the R2 device, strips the outer packaged IPv4 header and the GRE header, and restores the original IPv6 packet.
- the text is forwarded by IPv6 to the IPv6 destination.
- the encapsulated IPv4 packet length is greater than the maximum transmission unit (MTU) of the outbound interface of the GRE tunnel or the MTU of the intermediate forwarding device, the encapsulated IPv4 packet will be fragmented.
- GRE decapsulation node must first After reorganization, decapsulation can be performed and forwarding will continue.
- the encapsulated GRE packets are fragmented on the GRE tunnel outbound interface or the intermediate forwarding device.
- the fragmented GRE packets are reassembled on the GRE decapsulation node before they can be forwarded.
- the recombination processing burden of the GRE tunnel decapsulation node is increased.
- the processing capability of the decapsulation node becomes a bottleneck of network transmission.
- reorganization requires a large amount of reassembly pool resources. If the reassembly server has limited reassembly resources, a large number of fragments arrive at the decapsulation node, which may result in partial fragmentation not requiring reassembly pool resources and packet loss.
- the main technical problem to be solved by the embodiments of the present invention is to provide a method and a device for sending a general-purpose route encapsulation tunnel packet, which can reduce the probability of fragmentation of the packet after encapsulation, and reduce the occupation of the decapsulated node resource by reorganization. , improve network transmission capabilities.
- a method for sending a general-purpose route encapsulation tunnel packet comprising the following steps: determining a packet fragmentation value of a general route encapsulation tunnel packet;
- the packet to be sent after the fragmentation or the to-be-sent packet that does not need to be fragmented is encapsulated and sent using the general routing encapsulation protocol.
- the packet fragmentation value is a preset fixed value.
- the method for obtaining the packet fragmentation value is: sending a probe packet, and calculating, according to the fed back packet information, a maximum transmission unit value of the universal routing encapsulation tunnel, and setting the maximum transmission unit value to the Message fragmentation value.
- the setting, by using the detection packet, the packet fragmentation value of the universal routing encapsulation tunnel includes: Obtaining a first maximum transmission unit value of the universal routing encapsulation tunnel, and setting the first maximum transmission unit value to an initial packet fragmentation value;
- the second largest transmission unit value of the universal routing encapsulation tunnel is calculated according to the response packet, and the second maximum transmission is used.
- the unit value updates the initial packet fragment value
- the second maximum transmission unit value is updated to the message fragment value.
- the obtaining the first maximum transmission unit value of the universal routing encapsulation tunnel comprises: obtaining a maximum transmission unit value of the outbound interface of the universal routing encapsulation tunnel, and subtracting the encapsulation header length from the maximum transmission unit value to obtain a general routing encapsulation tunnel
- the first maximum transmission unit value; the encapsulation header length includes: an outer IP header length and an outer common routing encapsulation header length.
- the method further includes: repeatedly sending the probe message periodically or irregularly.
- the embodiment of the present invention further provides a device for sending a general-purpose route encapsulation tunnel packet, which includes a fragmentation value obtaining unit, a packet fragmentation unit, a message encapsulation unit, and a message sending unit.
- the fragmentation value obtaining unit is configured to determine a fragmentation value of the general routing encapsulation tunnel packet, and the packet fragmentation unit is configured to determine, according to the packet fragmentation value, whether fragmentation is to be sent. If necessary, the packet to be sent is fragmented;
- the packet encapsulating unit is configured to encapsulate the to-be-sent packet to be sent or the to-be-sent packet to be sent according to a general routing encapsulation protocol;
- the packet sending unit is configured to send the to-be-sent packet that is encapsulated by the packet encapsulating unit.
- the fragment value obtaining unit is further configured to preset the packet fragment value to be a fixed value.
- the fragmentation value obtaining unit further includes a probe message module and a slice value setting module;
- the probe packet module is configured to generate a probe packet that detects a maximum transmission unit value of the universal route encapsulation tunnel; and send the probe packet to a packet encapsulation unit;
- the fragment value setting module is configured to calculate a maximum transmission unit value of the universal routing encapsulation tunnel according to the fed back message information, and set the maximum transmission unit value to the packet fragmentation value.
- the fragment value setting module is further configured to obtain a first maximum transmission unit value of the universal routing encapsulation tunnel, and set the maximum transmission unit value to an initial packet fragmentation value;
- the probe packet module is further configured to: according to the first maximum transmission unit value obtained by the fragment value setting module, construct a probe packet, and send the constructed probe packet to the packet encapsulation Unit
- the fragment value setting module is further configured to: determine whether the received response message is a response message for discarding the detection message, and if yes, calculate the real-purpose routing encapsulation tunnel according to the response message. And a second maximum transmission unit value, and updating the initial message fragment value by using the second maximum transmission unit value, and updating the second maximum transmission unit value to a packet fragmentation value.
- the fragment value setting module obtains the maximum transmission unit value of the outbound interface of the universal routing encapsulation tunnel, and subtracts the encapsulation header length from the maximum transmission unit value to obtain the first maximum transmission unit value of the universal routing encapsulation tunnel.
- the length of the encapsulation header includes: an outer IP header length and an outer universal routing encapsulation header length.
- the probe message module is further configured to repeatedly send the probe message periodically or irregularly.
- the beneficial effects of the embodiment of the present invention are as follows: By setting a packet fragmentation value, the packet to be sent is compared with the value to determine whether to perform fragmentation, so that a larger packet is fragmented before being encapsulated, and subtracted. The probability of fragmentation after packet encapsulation is reduced, which further reduces the occupation of decapsulating node resources by reorganization and improves network transmission capability.
- the method and device for sending a general route encapsulation tunnel message in the embodiment of the present invention are also
- the MTU value of the general route encapsulation tunnel is dynamically detected by using the probe packet, and the packet fragmentation value is dynamically set by the value, so that the fragmentation of the packet is more effective and accurate.
- the MTU value is fragmented for the packets to be sent or forwarded by the GRE tunnel, further reducing the probability of fragmentation of the encapsulated GRE packets, and decentralizing the reassembly nodes to reduce the burden of reassembly of the GRE tunnel decapsulation nodes, and reducing the reorganization Decapsulate the occupation of node resources and improve network transmission capacity.
- FIG. 1 is a network topology diagram of a general route encapsulation tunnel transmission in the prior art
- FIG. 2 is a flowchart of a method for transmitting a packet of a general routing encapsulation tunnel according to an embodiment of the present invention
- FIG. 3 is a schematic structural diagram of a device for sending a packet of a general routing encapsulation tunnel according to an embodiment of the present invention.
- an embodiment of the present invention provides a method for sending a general-purpose route encapsulation tunnel message, which mainly includes the following steps:
- Step S201 Obtain a packet fragmentation value of the GRE tunnel.
- the packet fragment value of the GRE tunnel is obtained, and the value is used as the reference value of the fragment to be sent.
- the fragment value of the packet there are many ways to obtain the fragment value of the packet.
- the fragmentation value which is an optimal fixed value. When the packet exceeds the fragment value, the fragmentation operation is performed.
- the dynamic real-time control of the packet fragmentation value makes the packet transmission more effective and accurate.
- the specific method is as follows: Sending a probe packet, according to the feedback
- the packet information is calculated to obtain the maximum transmission unit value of the universal routing encapsulation tunnel, and the value is used as the packet fragmentation value.
- Step S2011 Obtain the first maximum transmission unit value of the general route encapsulation tunnel, and set the fragmentation value of the initial packet;
- the maximum transmission unit value of the GRE tunnel can be obtained by direct acquisition or probe acquisition.
- a preferred acquisition mode is provided: first, the route is searched according to the destination address configured by the GRE tunnel, and the outbound interface of the GRE tunnel is obtained from the route entry, and the MTU value of the outbound interface is obtained; Option configuration, calculate the length of the GRE header, plus the length of the outer IP header is recorded as the length of the encapsulation header.
- the GRE original header length is 4 bytes.
- the GRE can be configured with the Checksum option, the Key option, and the Sequence Number option. For each additional option, the header length is increased by 4 bytes, and the Check option is 2 bytes long.
- the padding field of the byte is also 4 bytes, and the resulting GRE header length is 4-16 bytes.
- the GRE outer IP header is 20 bytes long, and the outer IP header cannot contain options. Then, the length of the encapsulation header is subtracted from the MTU value of the outbound interface, and the result is used as the first MTU value of the GRE tunnel, and the value is set as the initial packet fragmentation value.
- Step S2012 Construct a probe packet according to the first maximum transmission unit value, and encapsulate and send the probe packet.
- the detection packet may be in the form of a GRE keepalive packet.
- the length of the inner IP packet is the first MTU of the GRE tunnel.
- the GRE Keepalive packet is a two-layer GRE encapsulation.
- the options for the GRE tunnel option are only added to the Key option.
- the Checksum option and the Sequence Number option are not added.
- the outer GRE header is configured according to the GRE tunnel option.
- the encapsulation is performed.
- the non-fragmentable DF flag bit in the outer IP header of the GRE keepalive packet is set to 1, and the keepalive packet is sent.
- GRE Keepalive packets are transmitted in the network if the MTU of a node in the GRE network is less than The length of the GRE Keepalive packet. Because the non-fragmented DF flag is set in the outer IP header, the node sends the Internet Control Message Protocol (ICMP) Datagram to the source node while discarding the Keepalive packet. Too Big will spoof the text, and fill in the MTU value of the node in the next hop MTU field of the ICMP message header.
- the ICMP Datagram Too Big message belongs to the ICMP Destination Unreachable message.
- the type field is 3, that is, type 3, and the code field is 4, that is, code 4.
- the ICMP header carries the original IP header that generates the ICMP message. 8-byte data portion.
- Step S2013 If the received response message is a response packet for discarding the probe packet, the second largest transmission unit value of the real-time universal route encapsulation tunnel is calculated according to the response packet, and the second maximum transmission unit value is used. Update the initial packet fragment value;
- the MTU of a node in the network is smaller than the length of the Keepalive message, and the received ICMP Datagram Too Big message is parsed from the ICMP Datagram Too Big.
- the source IP address, the destination address, and the protocol number are removed from the original IP address carried in the packet. If the protocol number is 47, it indicates that the GRE packet is encapsulated.
- the GRE tunnel is found according to the source and destination IP addresses, and the ICMP packet is used.
- the next hop MTU field value is subtracted from the encapsulation header length to obtain a second maximum transmission unit value, and the initial packet fragment value is updated with the second maximum transmission unit value.
- the MTU value of each node in the GRE network is greater than or equal to the keepalive packet length, the MTU of the GRE tunnel is kept unchanged and the packet fragmentation value is not updated.
- Step S202 determining, according to the packet fragmentation value, whether the packet to be sent needs to be fragmented; if fragmentation is required, proceeding to step S203; otherwise, executing step S204;
- the updated packet fragmentation value is sent to the forwarding plane, and is used as a basis for determining whether to perform early fragmentation when the forwarding plane forwards the packet through the GRE tunnel;
- the fragment value is also used as a basis for judging whether or not to slice in advance. If the length of the packet to be forwarded or sent is greater than the packet fragment value, the process goes to step S203. If the length of the packet to be forwarded or sent is less than or equal to the packet fragment value, the process proceeds directly to step S204.
- Step S203 Perform a fragmentation process on the packet that needs to be fragmented.
- the packet that is determined to be fragmented in step S202 is mainly subjected to fragmentation processing according to the corresponding fragmentation mode.
- Step S204 Perform GRE encapsulation on the processed packet.
- step S205 the processed fragmented packet or the packet that does not need to be fragmented is GRE-encapsulated, and the process proceeds to step S205.
- Step S205 Send the encapsulated message.
- the route or the outbound interface of the destination address of the GRE tunnel may be changed.
- the probe packet may be sent periodically or irregularly.
- the MTU value of the latest GRE tunnel is obtained, and the optimal packet fragment value is updated.
- a general route encapsulation tunnel packet sending apparatus which mainly includes a fragment value obtaining unit 301, a packet fragmentation unit 302, a packet encapsulating unit 303, and a packet sending.
- the fragment value obtaining unit 301 is configured to obtain a packet value of a general route encapsulation tunnel message.
- the fragmentation value obtaining unit 301 further includes: a probe packet module 3011 and a fragmentation value setting module 3012;
- the probe packet module 3011 can be configured to customize a packet fragment value so that the GRE tunnel can fragment the packet.
- the probe packet 3011 can also be configured to generate a probe report for detecting the maximum transmission unit value of the general route encapsulation tunnel. And sending the probe packet to the packet encapsulation unit After the 303 is encapsulated, the packet sending unit 304 performs transmission, and the packet fragmentation value is efficiently obtained by using the method.
- the fragmentation value setting module 3012 is configured to calculate a maximum transmission unit value of the universal routing encapsulation tunnel according to the fed back message information, and set the value to a packet fragmentation value.
- the probe packet module 3011 is further configured to construct a probe packet according to the first maximum transmission unit value acquired by the fragment value setting module 3012, and send the constructed probe packet to the packet encapsulation unit. After the 303 is encapsulated, the packet is sent by the packet sending unit 304; the probe packet is a non-fragmentable packet;
- the fragmentation value setting module 3012 is further configured to determine whether the feedback packet is a response packet for discarding the probe packet, and if yes, calculate, according to the response packet, a second maximum of the universal routing encapsulation tunnel in real time. Transmit the unit value and set the second maximum transmission unit value update to the latest message fragment value.
- the specific process of obtaining the packet fragmentation value by the fragmentation value acquisition unit 301 has already performed detailed parameters in the above-mentioned general route encapsulation tunnel packet transmission method, and details are not described herein.
- the message fragmentation unit 302 is configured to determine, according to the packet fragmentation value, whether the packet to be sent needs to be fragmented; if necessary, fragment the to-be-sent packet;
- the packet encapsulating unit 303 is configured to perform GRE encapsulation according to the to-be-sent packet to be sent or the to-be-sent packet that does not need to be fragmented.
- the packet sending unit 304 is configured to send the to-be-sent packet encapsulated by the packet encapsulating unit 303.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Provided are a method and device for sending a generic routing encapsulation tunnel message. The method includes: determining a partitioned value of a generic routing encapsulation tunnel message; according to the message partitioned value, judging whether a message to be sent needs to be partitioned; if needed, partitioning the message to be sent; and sending the partitioned message to be sent or the message to be sent which need not be partitioned, after encapsulating same using a generic routing encapsulation protocol. The present invention can reduce the partitioning probability of a message after being encapsulated, thereby reducing the occupancy of the decapsulation node resources due to restructuring, and improving the network transmission capability.
Description
一种通用路由封装隧道报文发送方法和装置 技术领域 General route encapsulation tunnel message sending method and device
本发明涉及通信领域, 特别涉及一种通用路由封装隧道报文发送方法 和装置。 背景技术 The present invention relates to the field of communications, and in particular, to a method and apparatus for transmitting a general route encapsulation tunnel message. Background technique
通用路由封装 ( Generic Routing Encapsulation, GRE )协议是一种隧道 封装协议, 它提供了将某种网络层协议, 如: IP、 IPv6、 MPLS等的报文封 装在另外一种网络层协议, 如 IP、 IPv6报文中的机制, 使报文能够在异种 网络中传输。 在某些情况下, 系统需要传输一个有效载荷包, 需要将它封 装并发送至某个目的地, 而该有效载荷包使用的协议不同于该网络所支持 的协议, 这时需要将有效载荷进行 GRE封装, 然后将此 GRE 包封装在其 它协议中进行转发, 该外层协议即为封装协议, 为该网络上使用的协议。 The Generic Routing Encapsulation (GRE) protocol is a tunnel encapsulation protocol that encapsulates packets of a certain network layer protocol, such as IP, IPv6, and MPLS, into another network layer protocol, such as IP. The mechanism in IPv6 packets enables packets to be transmitted on heterogeneous networks. In some cases, the system needs to transmit a payload packet, which needs to be encapsulated and sent to a destination. The payload packet uses a different protocol than the protocol supported by the network. In this case, the payload needs to be carried out. The GRE is encapsulated, and then the GRE packet is encapsulated in another protocol for forwarding. The outer protocol is an encapsulation protocol, which is a protocol used on the network.
请参考图 1, 当用户网络改造为 IPv6网络, 而骨干网络依然是 IPv4网 络时, 用户网络的 IPv6用户要访问远端的 IPv6服务时, GRE提供了一种 隧道封装技术, 以使得用户的 IPv6报文能够穿越 IPv4骨干网络。封装和解 封装都是在 IPv4网络边缘设备进行的, 当 IPv6用户的原始 IPv6报文到达 IPv4网络边缘设备 R1进行转发时,查找转发路由表,将 IPv6报文导入 GRE 隧道进行 GRE封装: 封装 GRE头和外层 IPv4头,封装后的 IPv4报文穿越 IPv4网络到达 IPv4网络另一个边缘设备 R2, 在 R2设备上进行解封装, 剥 去外层封装的 IPv4头和 GRE头,还原出原始的 IPv6报文进行 IPv6转发到 达 IPv6目的地。 当封装后的 IPv4报文长度大于 GRE隧道出接口最大传输 单元( Maximum Transmission Unit, MTU )或者中间转发设备出口 MTU时, 封装后的 IPv4报文将进行分片,分片后传输的报文在 GRE解封装节点要先
重组后才能进行解封装, 并继续转发。 Referring to FIG. 1, when the user network is transformed into an IPv6 network, and the backbone network is still an IPv4 network, when the IPv6 user of the user network needs to access the remote IPv6 service, the GRE provides a tunnel encapsulation technology to enable the user's IPv6. Packets can traverse the IPv4 backbone network. Encapsulation and decapsulation are performed on the IPv4 network edge device. When the original IPv6 packet of the IPv6 user reaches the IPv4 network edge device R1 for forwarding, the forwarding routing table is searched and the IPv6 packet is imported into the GRE tunnel for GRE encapsulation: Encapsulating the GRE header And the outer IPv4 header, the encapsulated IPv4 packet traverses the IPv4 network and reaches the edge device R2 of the IPv4 network, decapsulates the R2 device, strips the outer packaged IPv4 header and the GRE header, and restores the original IPv6 packet. The text is forwarded by IPv6 to the IPv6 destination. When the encapsulated IPv4 packet length is greater than the maximum transmission unit (MTU) of the outbound interface of the GRE tunnel or the MTU of the intermediate forwarding device, the encapsulated IPv4 packet will be fragmented. GRE decapsulation node must first After reorganization, decapsulation can be performed and forwarding will continue.
当 GRE隧道 MTU设置不合理时, 封装后的 GRE报文就会在 GRE隧 道出接口或者中间转发设备上分片, 分片后的 GRE报文要在 GRE解封装 节点上重组后才能转发, 这增加了 GRE隧道解封装节点的重组处理负担, 当有大量用户接入 GRE隧道并且存在大量分片的情况下, 解封装节点的处 理能力将成为网络传输的瓶颈。 另外, 重组需要占用大量的重组池资源, 如果解封装节点的重组池资源有限, 大量分片到达解封装节点时, 会导致 部分分片申请不到重组池资源而丟包。 发明内容 When the MTU of the GRE tunnel is unreasonable, the encapsulated GRE packets are fragmented on the GRE tunnel outbound interface or the intermediate forwarding device. The fragmented GRE packets are reassembled on the GRE decapsulation node before they can be forwarded. The recombination processing burden of the GRE tunnel decapsulation node is increased. When a large number of users access the GRE tunnel and there are a large number of fragments, the processing capability of the decapsulation node becomes a bottleneck of network transmission. In addition, reorganization requires a large amount of reassembly pool resources. If the reassembly server has limited reassembly resources, a large number of fragments arrive at the decapsulation node, which may result in partial fragmentation not requiring reassembly pool resources and packet loss. Summary of the invention
本发明实施例要解决的主要技术问题是, 提供一种通用路由封装隧道 报文发送方法和装置, 可减小报文在封装后进行分片的概率, 减少因重组 对解封装节点资源的占用, 提高网络传输能力。 The main technical problem to be solved by the embodiments of the present invention is to provide a method and a device for sending a general-purpose route encapsulation tunnel packet, which can reduce the probability of fragmentation of the packet after encapsulation, and reduce the occupation of the decapsulated node resource by reorganization. , improve network transmission capabilities.
为解决上述技术问题, 本发明实施例采用的技术方案如下: To solve the above technical problem, the technical solution adopted by the embodiment of the present invention is as follows:
一种通用路由封装隧道报文发送方法, 该方法包括以下步骤: 确定通用路由封装隧道报文分片值; A method for sending a general-purpose route encapsulation tunnel packet, the method comprising the following steps: determining a packet fragmentation value of a general route encapsulation tunnel packet;
根据所述报文分片值, 判断待发送报文是否需要分片; 若需要, 则对 所述待发送报文进行分片; And determining, according to the packet fragmentation value, whether the packet to be sent needs to be fragmented; if necessary, performing fragmentation on the to-be-sent packet;
对分片后的待发送报文或者不需要分片的待发送报文使用通用路由封 装协议封装后发送。 The packet to be sent after the fragmentation or the to-be-sent packet that does not need to be fragmented is encapsulated and sent using the general routing encapsulation protocol.
优选地, 所述报文分片值为预设的固定值。 Preferably, the packet fragmentation value is a preset fixed value.
优选地, 所述报文分片值的获取方式是: 发送探测报文, 根据反馈的 报文信息计算得到所述通用路由封装隧道的最大传输单元值, 将该最大传 输单元值设置为所述报文分片值。 Preferably, the method for obtaining the packet fragmentation value is: sending a probe packet, and calculating, according to the fed back packet information, a maximum transmission unit value of the universal routing encapsulation tunnel, and setting the maximum transmission unit value to the Message fragmentation value.
优选地, 所述利用探测报文设置所述通用路由封装隧道的报文分片值, 包括:
获取通用路由封装隧道的第一最大传输单元值, 将所述第一最大传输 单元值设置为初始报文分片值; Preferably, the setting, by using the detection packet, the packet fragmentation value of the universal routing encapsulation tunnel includes: Obtaining a first maximum transmission unit value of the universal routing encapsulation tunnel, and setting the first maximum transmission unit value to an initial packet fragmentation value;
根据所述第一最大传输单元值, 构造探测报文; 封装并发送所述探测 报文; 其中, 所述探测报文为不可分片报文; And configuring, according to the first maximum transmission unit value, a probe packet, and transmitting the probe packet, where the probe packet is a non-fragmentable packet;
若接收的回应报文为丟弃所述探测报文的回应报文, 则根据该回应报 文计算得到实时的所述通用路由封装隧道的第二最大传输单元值, 并用所 述第二最大传输单元值更新所述初始报文分片值; If the received response packet is a response packet that discards the probe packet, the second largest transmission unit value of the universal routing encapsulation tunnel is calculated according to the response packet, and the second maximum transmission is used. The unit value updates the initial packet fragment value;
将第二最大传输单元值更新为报文分片值。 The second maximum transmission unit value is updated to the message fragment value.
优选地, 所述获取通用路由封装隧道的第一最大传输单元值, 包括: 获取通用路由封装隧道出接口的最大传输单元值, 并用该最大传输单元值 减去封装头长度得到通用路由封装隧道的所述第一最大传输单元值; 所述 封装头长度包括: 外层 IP头长度和外层通用路由封装包头长度。 Preferably, the obtaining the first maximum transmission unit value of the universal routing encapsulation tunnel comprises: obtaining a maximum transmission unit value of the outbound interface of the universal routing encapsulation tunnel, and subtracting the encapsulation header length from the maximum transmission unit value to obtain a general routing encapsulation tunnel The first maximum transmission unit value; the encapsulation header length includes: an outer IP header length and an outer common routing encapsulation header length.
优选地, 该方法还包括: 定期或者不定期重复发送所述探测报文。 本发明实施例还提供一种通用路由封装隧道报文发送装置, 包括分片 值获取单元、 报文分片单元、 报文封装单元和报文发送单元; Preferably, the method further includes: repeatedly sending the probe message periodically or irregularly. The embodiment of the present invention further provides a device for sending a general-purpose route encapsulation tunnel packet, which includes a fragmentation value obtaining unit, a packet fragmentation unit, a message encapsulation unit, and a message sending unit.
所述分片值获取单元, 配置为确定通用路由封装隧道报文分片值; 所述报文分片单元, 配置为根据所述报文分片值, 判断待发送报文是 否需要分片; 若需要, 则对所述待发送报文进行分片; The fragmentation value obtaining unit is configured to determine a fragmentation value of the general routing encapsulation tunnel packet, and the packet fragmentation unit is configured to determine, according to the packet fragmentation value, whether fragmentation is to be sent. If necessary, the packet to be sent is fragmented;
所述报文封装单元, 配置为将分片后的待发送报文或者不需要分片的 待发送报文根据通用路由封装协议进行封装; The packet encapsulating unit is configured to encapsulate the to-be-sent packet to be sent or the to-be-sent packet to be sent according to a general routing encapsulation protocol;
所述报文发送单元, 配置为将所述报文封装单元封装完成的待发送报 文进行发送。 The packet sending unit is configured to send the to-be-sent packet that is encapsulated by the packet encapsulating unit.
优选地, 所述的分片值获取单元, 还配置为预设置所述报文分片值为 固定值。 Preferably, the fragment value obtaining unit is further configured to preset the packet fragment value to be a fixed value.
优选地, 分片值获取单元还包括探测报文模块和分片值设定模块;
所述探测报文模块, 配置为生成探测所述通用路由封装隧道最大传输 单元值的探测报文; 并将所述探测报文发送给报文封装单元; Preferably, the fragmentation value obtaining unit further includes a probe message module and a slice value setting module; The probe packet module is configured to generate a probe packet that detects a maximum transmission unit value of the universal route encapsulation tunnel; and send the probe packet to a packet encapsulation unit;
所述分片值设定模块, 配置为根据反馈的报文信息计算所述通用路由 封装隧道的最大传输单元值, 并将该最大传输单元值设定为所述报文分片 值。 The fragment value setting module is configured to calculate a maximum transmission unit value of the universal routing encapsulation tunnel according to the fed back message information, and set the maximum transmission unit value to the packet fragmentation value.
优选地, 所述分片值设定模块, 还配置为获取通用路由封装隧道的第 一最大传输单元值, 并将该最大传输单元值设置为初始报文分片值; Preferably, the fragment value setting module is further configured to obtain a first maximum transmission unit value of the universal routing encapsulation tunnel, and set the maximum transmission unit value to an initial packet fragmentation value;
所述探测报文模块, 还配置为根据所述分片值设定模块获取的所述第 一最大传输单元值, 构造探测报文, 并将构造好的所述探测报文发送给报 文封装单元; The probe packet module is further configured to: according to the first maximum transmission unit value obtained by the fragment value setting module, construct a probe packet, and send the constructed probe packet to the packet encapsulation Unit
所述分片值设定模块, 还配置为判断接收的回应报文是否为丟弃所述 探测报文的回应报文, 若是, 则根据该回应报文计算得到实时的所述通用 路由封装隧道的第二最大传输单元值, 并用所述第二最大传输单元值更新 所述初始报文分片值, 并将所述第二最大传输单元值更新为报文分片值。 The fragment value setting module is further configured to: determine whether the received response message is a response message for discarding the detection message, and if yes, calculate the real-purpose routing encapsulation tunnel according to the response message. And a second maximum transmission unit value, and updating the initial message fragment value by using the second maximum transmission unit value, and updating the second maximum transmission unit value to a packet fragmentation value.
优选地, 所述分片值设定模块通过获取通用路由封装隧道出接口的最 大传输单元值, 并用该最大传输单元值减去封装头长度得到通用路由封装 隧道的所述第一最大传输单元值; 所述封装头长度包括: 外层 IP头长度和 外层通用路由封装包头长度。 Preferably, the fragment value setting module obtains the maximum transmission unit value of the outbound interface of the universal routing encapsulation tunnel, and subtracts the encapsulation header length from the maximum transmission unit value to obtain the first maximum transmission unit value of the universal routing encapsulation tunnel. The length of the encapsulation header includes: an outer IP header length and an outer universal routing encapsulation header length.
优选地, 所述探测报文模块, 还配置为定期或者不定期的重复发送所 述探测报文。 Preferably, the probe message module is further configured to repeatedly send the probe message periodically or irregularly.
本发明实施例的有益效果是: 通过设置一个报文分片值, 使待发送的 报文与该值进行对比判断是否进行分片, 使较大的报文在封装之前进行分 片处理, 减小了报文在封装后进行分片的概率, 进一步减少因重组对解封 装节点资源的占用, 提高网络传输能力。 The beneficial effects of the embodiment of the present invention are as follows: By setting a packet fragmentation value, the packet to be sent is compared with the value to determine whether to perform fragmentation, so that a larger packet is fragmented before being encapsulated, and subtracted. The probability of fragmentation after packet encapsulation is reduced, which further reduces the occupation of decapsulating node resources by reorganization and improves network transmission capability.
此外, 本发明实施例的通用路由封装隧道报文发送方法和装置, 还通
过使用探测报文的方式动态的探测通用路由封装隧道的 MTU值,并通过该 值动态设置报文分片值, 使对报文的分片更具实效性和精确性; 同时, 利 用探测所得的 MTU值对要经过 GRE隧道发送或者转发的报文进行分片处 理, 进一步减少封装后的 GRE报文分片的概率, 分散重组节点以降低 GRE 隧道解封装节点重组的负担, 减少因重组对解封装节点资源的占用, 提高 网络传输能力。 附图说明 In addition, the method and device for sending a general route encapsulation tunnel message in the embodiment of the present invention are also The MTU value of the general route encapsulation tunnel is dynamically detected by using the probe packet, and the packet fragmentation value is dynamically set by the value, so that the fragmentation of the packet is more effective and accurate. The MTU value is fragmented for the packets to be sent or forwarded by the GRE tunnel, further reducing the probability of fragmentation of the encapsulated GRE packets, and decentralizing the reassembly nodes to reduce the burden of reassembly of the GRE tunnel decapsulation nodes, and reducing the reorganization Decapsulate the occupation of node resources and improve network transmission capacity. DRAWINGS
图 1为现有技术中通用路由封装隧道传输的网络拓朴图; 1 is a network topology diagram of a general route encapsulation tunnel transmission in the prior art;
图 2为本发明一实施例中通用路由封装隧道报文发送方法的流程图; 图 3 为本发明一实施例中通用路由封装隧道报文发送装置的结构示意 图。 具体实施方式 2 is a flowchart of a method for transmitting a packet of a general routing encapsulation tunnel according to an embodiment of the present invention; and FIG. 3 is a schematic structural diagram of a device for sending a packet of a general routing encapsulation tunnel according to an embodiment of the present invention. detailed description
为使本发明实施例的技术方案和优点更加清楚, 下面通过具体实施方 式结合附图对本发明实施例作进一步详细说明。 In order to make the technical solutions and advantages of the embodiments of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
请参考图 2, 本发明实施例提供了一种通用路由封装隧道报文发送方 法, 其主要包括以下步骤: Referring to FIG. 2, an embodiment of the present invention provides a method for sending a general-purpose route encapsulation tunnel message, which mainly includes the following steps:
步骤 S201 : 获取 GRE隧道的报文分片值; Step S201: Obtain a packet fragmentation value of the GRE tunnel.
在本步骤中, 获取 GRE隧道的报文分片值, 用该值作为待发送图片进 行分片的参照值。 其中, 该报文分片值的获取方式有许多种, 较优的, 在 本实施例中, 可以有两种获取方式: 一种是通过对该 GRE隧道大致的传输 能力界定, 设置一个合适的分片值, 该值为一个最优的固定值, 当报文超 过该分片值时, 即进行分片操作。 In this step, the packet fragment value of the GRE tunnel is obtained, and the value is used as the reference value of the fragment to be sent. There are many ways to obtain the fragment value of the packet. Preferably, in this embodiment, there are two ways of obtaining: One is to define a general transmission capacity of the GRE tunnel, and set a suitable one. The fragmentation value, which is an optimal fixed value. When the packet exceeds the fragment value, the fragmentation operation is performed.
此外, 还有一种获取方式是: 通过动态的实时调控报文分片值, 使报 文的传输更具实效性和精确性, 具体的做法为: 发送探测报文, 根据反馈
的报文信息计算得到所述通用路由封装隧道的最大传输单元值, 将该值作 为所述报文分片值。 In addition, there is another way to obtain the following: The dynamic real-time control of the packet fragmentation value makes the packet transmission more effective and accurate. The specific method is as follows: Sending a probe packet, according to the feedback The packet information is calculated to obtain the maximum transmission unit value of the universal routing encapsulation tunnel, and the value is used as the packet fragmentation value.
所述通过探测报文设置报文分片值的具体过程可以分为以下几步: 步骤 S2011 : 获取通用路由封装隧道的第一最大传输单元值,设置为初 始报文分片值; The specific process of setting the packet fragmentation value by using the probe packet may be divided into the following steps: Step S2011: Obtain the first maximum transmission unit value of the general route encapsulation tunnel, and set the fragmentation value of the initial packet;
在该步骤中, 可以通过直接获取或者探测获取的方式获取 GRE隧道的 最大传输单元值。 本实施例中, 提供一种较优的获取方式: 首先根据 GRE 隧道所配置的目的地址查路由,从路由条目中得到所述 GRE隧道的出接口, 获取出接口的 MTU值;根据 GRE隧道的选项配置,计算出 GRE包头长度, 加上外层 IP头长度记为封装头长度。 GRE原始包头长度为 4字节, GRE 能够配置的选项有 Checksum选项、 Key选项和 Sequence Number选项, 每 增加一种选项, 包头长度就增加 4字节, Check选项长度为 2字节, 加上两 字节的填充字段,也是 4字节,由此得到的 GRE包头长度为 4-16字节不等。 GRE外层 IP头长度为 20字节, 外层 IP头不能包含选项。 然后用所述该出 接口的 MTU值减去封装头长度, 计算结果作为 GRE隧道第一 MTU值, 并将该值设置为初始报文分片值。 In this step, the maximum transmission unit value of the GRE tunnel can be obtained by direct acquisition or probe acquisition. In this embodiment, a preferred acquisition mode is provided: first, the route is searched according to the destination address configured by the GRE tunnel, and the outbound interface of the GRE tunnel is obtained from the route entry, and the MTU value of the outbound interface is obtained; Option configuration, calculate the length of the GRE header, plus the length of the outer IP header is recorded as the length of the encapsulation header. The GRE original header length is 4 bytes. The GRE can be configured with the Checksum option, the Key option, and the Sequence Number option. For each additional option, the header length is increased by 4 bytes, and the Check option is 2 bytes long. The padding field of the byte is also 4 bytes, and the resulting GRE header length is 4-16 bytes. The GRE outer IP header is 20 bytes long, and the outer IP header cannot contain options. Then, the length of the encapsulation header is subtracted from the MTU value of the outbound interface, and the result is used as the first MTU value of the GRE tunnel, and the value is set as the initial packet fragmentation value.
步骤 S2012: 根据所述第一最大传输单元值, 构造探测报文; 封装并发 送所述探测报文; Step S2012: Construct a probe packet according to the first maximum transmission unit value, and encapsulate and send the probe packet.
在本实施例中, 探测报文可以有多种形式, 较优的选择为 GRE Keepalive报文, 填充封装后内层 IP报文长度为 GRE隧道第一 MTU大小。 GRE Keepalive报文为两层 GRE封装, 内层 GRE头封装时对于 GRE隧道 选项配置的选项仅添力口 Key选项,不添力口 Checksum选项和 Sequence Number 选项, 外层 GRE 头依据 GRE 隧道选项配置进行封装; 设置所述 GRE Keepalive报文外层 IP头中不可分片 DF标志位为 1,发送该 Keepalive报文。 GRE Keepalive报文在网络中传输,如果 GRE网络中某个节点的 MTU小于
GRE Keepalive报文长度, 由于外层 IP头中设置了不可分片 DF标志, 则该 节点在丟弃该 Keepalive报文的同时会向源节点发送 Internet控制报文协议 ( Internet Control Message Protocol, ICMP ) Datagram Too Big才艮文, 并在 该 ICMP报文头部下一跳 MTU字段填入本节点的 MTU值。 ICMP Datagram Too Big报文属于 ICMP目标不可达( Destination Unreachable )报文, 类型 字段为 3, 即 type 3, 代码字段为 4, 即 code 4, ICMP包头后面携带产生该 ICMP报文的原始 IP头和 8字节的数据部分。 In this embodiment, the detection packet may be in the form of a GRE keepalive packet. The length of the inner IP packet is the first MTU of the GRE tunnel. The GRE Keepalive packet is a two-layer GRE encapsulation. When the inner GRE header is encapsulated, the options for the GRE tunnel option are only added to the Key option. The Checksum option and the Sequence Number option are not added. The outer GRE header is configured according to the GRE tunnel option. The encapsulation is performed. The non-fragmentable DF flag bit in the outer IP header of the GRE keepalive packet is set to 1, and the keepalive packet is sent. GRE Keepalive packets are transmitted in the network if the MTU of a node in the GRE network is less than The length of the GRE Keepalive packet. Because the non-fragmented DF flag is set in the outer IP header, the node sends the Internet Control Message Protocol (ICMP) Datagram to the source node while discarding the Keepalive packet. Too Big will spoof the text, and fill in the MTU value of the node in the next hop MTU field of the ICMP message header. The ICMP Datagram Too Big message belongs to the ICMP Destination Unreachable message. The type field is 3, that is, type 3, and the code field is 4, that is, code 4. The ICMP header carries the original IP header that generates the ICMP message. 8-byte data portion.
步骤 S2013 : 若接收的回应报文为丟弃探测报文的回应报文, 则根据该 回应报文计算得到实时的通用路由封装隧道的第二最大传输单元值, 并用 该第二最大传输单元值更新初始报文分片值; Step S2013: If the received response message is a response packet for discarding the probe packet, the second largest transmission unit value of the real-time universal route encapsulation tunnel is calculated according to the response packet, and the second maximum transmission unit value is used. Update the initial packet fragment value;
在本实施例中, 如果收到网络中回应的 ICMP Datagram Too Big报文, 说明网络中某个节点的 MTU小于 Keepalive报文长度, 解析收到的 ICMP Datagram Too Big报文,从 ICMP Datagram Too Big报文携带的原始 IP头中 取出源地址、 目的地址和协议号, 如果协议号为 47, 表明封装的是 GRE报 文, 依据此源、 目的 IP地址查找到 GRE隧道, 并用 ICMP报文中的下一跳 MTU字段值减去封装头长度, 以得到第二最大传输单元值, 并用该第二最 大传输单元值更新初始报文分片值。 In this embodiment, if an ICMP Datagram Too Big message is received in the network, the MTU of a node in the network is smaller than the length of the Keepalive message, and the received ICMP Datagram Too Big message is parsed from the ICMP Datagram Too Big. The source IP address, the destination address, and the protocol number are removed from the original IP address carried in the packet. If the protocol number is 47, it indicates that the GRE packet is encapsulated. The GRE tunnel is found according to the source and destination IP addresses, and the ICMP packet is used. The next hop MTU field value is subtracted from the encapsulation header length to obtain a second maximum transmission unit value, and the initial packet fragment value is updated with the second maximum transmission unit value.
如果收到的是 Keepalive报文的正常回应, 说明 GRE网络中各节点的 MTU值均大于或等于 Keepalive报文长度, 则保持 GRE隧道 MTU不变, 也不对报文分片值进行更新。 If the MTU value of each node in the GRE network is greater than or equal to the keepalive packet length, the MTU of the GRE tunnel is kept unchanged and the packet fragmentation value is not updated.
在通过上述方法获取到报文分片值之后, 进入以下步骤: After obtaining the packet fragment value by the above method, go to the following steps:
步骤 S202: 根据所述报文分片值, 判断待发送报文是否需要分片; 如 果需要分片, 则转入步骤 S203; 否则, 执行步骤 S204; Step S202: determining, according to the packet fragmentation value, whether the packet to be sent needs to be fragmented; if fragmentation is required, proceeding to step S203; otherwise, executing step S204;
在本实施例中, 将更新后的报文分片值下发转发面, 作为转发面转发 报文经过该 GRE隧道时判断是否进行提前分片的依据; 同时控制面发包经
过该 GRE隧道封装时, 也以该分片值作为判断是否提前分片的依据。 如果 待转发或者发送的报文长度大于该报文分片值, 则转入步骤 S203, 如果判 断待转发或者发送的报文长度小于或等于该报文分片值, 则直接进入步骤 S204。 In this embodiment, the updated packet fragmentation value is sent to the forwarding plane, and is used as a basis for determining whether to perform early fragmentation when the forwarding plane forwards the packet through the GRE tunnel; When the GRE tunnel is encapsulated, the fragment value is also used as a basis for judging whether or not to slice in advance. If the length of the packet to be forwarded or sent is greater than the packet fragment value, the process goes to step S203. If the length of the packet to be forwarded or sent is less than or equal to the packet fragment value, the process proceeds directly to step S204.
步骤 S203: 对需要进行分片的报文进行分片处理; Step S203: Perform a fragmentation process on the packet that needs to be fragmented.
在该步骤中, 主要对步骤 S202中判断需要进行分片的报文按照相应的 分片方式进行分片处理。 In this step, the packet that is determined to be fragmented in step S202 is mainly subjected to fragmentation processing according to the corresponding fragmentation mode.
步骤 S204: 对处理后的报文进行 GRE封装; Step S204: Perform GRE encapsulation on the processed packet.
在该步骤中, 对上述经过处理的分片后的报文或者不需要进行分片的 报文进行 GRE封装, 进入步骤 S205。 In this step, the processed fragmented packet or the packet that does not need to be fragmented is GRE-encapsulated, and the process proceeds to step S205.
步骤 S205: 对已封装的所述报文进行发送。 Step S205: Send the encapsulated message.
在本实施例中, 因为 GRE隧道目的地址的路由或者出接口可能会发生 变化, 为了保持报文分片值的实时性和有效性, 较优的, 可以定期或者不 定期的发送探测报文, 以获取最新的 GRE隧道的 MTU值, 并更新最优的 报文分片值。 In this embodiment, the route or the outbound interface of the destination address of the GRE tunnel may be changed. To maintain the real-time and validity of the packet fragmentation value, the probe packet may be sent periodically or irregularly. The MTU value of the latest GRE tunnel is obtained, and the optimal packet fragment value is updated.
请参考图 3,在本发明实施例中还提供一种通用路由封装隧道报文发送 装置, 其主要包括分片值获取单元 301、 报文分片单元 302、 报文封装单元 303和报文发送单元 304; Referring to FIG. 3, in the embodiment of the present invention, a general route encapsulation tunnel packet sending apparatus is further provided, which mainly includes a fragment value obtaining unit 301, a packet fragmentation unit 302, a packet encapsulating unit 303, and a packet sending. Unit 304;
其中, 所述分片值获取单元 301, 配置为获取通用路由封装隧道报文分 片值。 The fragment value obtaining unit 301 is configured to obtain a packet value of a general route encapsulation tunnel message.
为实现较优的获取 GRE隧道的报文分片值, 分片值获取单元 301进一 步包括: 探测报文模块 3011和分片值设定模块 3012; To achieve a better packet fragmentation value of the GRE tunnel, the fragmentation value obtaining unit 301 further includes: a probe packet module 3011 and a fragmentation value setting module 3012;
所述探测报文模块 3011 不仅可以配置为自定义一个较优的报文分片 值, 以便 GRE隧道对报文进行分片; 还可以配置为生成探测通用路由封装 隧道最大传输单元值的探测报文, 并将所述探测报文发送给报文封装单元
303进行封装后, 由报文发送单元 304进行发送, 其通过该种方式来高效的 获取报文分片值; The probe packet module 3011 can be configured to customize a packet fragment value so that the GRE tunnel can fragment the packet. The probe packet 3011 can also be configured to generate a probe report for detecting the maximum transmission unit value of the general route encapsulation tunnel. And sending the probe packet to the packet encapsulation unit After the 303 is encapsulated, the packet sending unit 304 performs transmission, and the packet fragmentation value is efficiently obtained by using the method.
分片值设定模块 3012, 配置为根据反馈的报文信息计算通用路由封装 隧道的最大传输单元值, 并将该值设定为报文分片值。 The fragmentation value setting module 3012 is configured to calculate a maximum transmission unit value of the universal routing encapsulation tunnel according to the fed back message information, and set the value to a packet fragmentation value.
进一步地, 探测报文模块 3011, 还配置为根据分片值设定模块 3012获 取的所述第一最大传输单元值, 构造探测报文; 并将已构造的探测报文发 送给报文封装单元 303进行封装后, 由报文发送单元 304进行发送; 所述 探测报文为不可分片报文; Further, the probe packet module 3011 is further configured to construct a probe packet according to the first maximum transmission unit value acquired by the fragment value setting module 3012, and send the constructed probe packet to the packet encapsulation unit. After the 303 is encapsulated, the packet is sent by the packet sending unit 304; the probe packet is a non-fragmentable packet;
分片值设定模块 3012, 还配置为判断反馈报文是否为丟弃所述探测报 文的回应报文, 若是, 则根据该回应报文计算得到实时所述通用路由封装 隧道的第二最大传输单元值, 并将该第二最大传输单元值更新设置为最新 报文分片值。 The fragmentation value setting module 3012 is further configured to determine whether the feedback packet is a response packet for discarding the probe packet, and if yes, calculate, according to the response packet, a second maximum of the universal routing encapsulation tunnel in real time. Transmit the unit value and set the second maximum transmission unit value update to the latest message fragment value.
在本实施例中, 分片值获取单元 301 获取报文分片值的具体过程在上 述通用路由封装隧道报文发送方法中已经进行了详细的参数, 在此就不再 进行赘述了。 In this embodiment, the specific process of obtaining the packet fragmentation value by the fragmentation value acquisition unit 301 has already performed detailed parameters in the above-mentioned general route encapsulation tunnel packet transmission method, and details are not described herein.
报文分片单元 302, 主要配置为根据所述报文分片值, 判断待发送报文 是否需要分片; 若需要, 则对该待发送报文进行分片; The message fragmentation unit 302 is configured to determine, according to the packet fragmentation value, whether the packet to be sent needs to be fragmented; if necessary, fragment the to-be-sent packet;
报文封装单元 303,配置为将分片后的待发送报文或者不需要分片的待 发送报文根据进行 GRE封装; The packet encapsulating unit 303 is configured to perform GRE encapsulation according to the to-be-sent packet to be sent or the to-be-sent packet that does not need to be fragmented.
报文发送单元 304,配置为将报文封装单元 303封装完成的待发送报文 进行发送。 The packet sending unit 304 is configured to send the to-be-sent packet encapsulated by the packet encapsulating unit 303.
以上内容是结合具体的实施方式对本发明所作的进一步详细说明, 不 能认定本发明的具体实施只局限于这些说明。 对于本发明所属技术领域的 普通技术人员来说, 在不脱离本发明构思的前提下, 还可以做出若干简单 推演或替换, 都应当视为属于本发明的保护范围。
The above is a further detailed description of the present invention in connection with the specific embodiments, and the specific embodiments of the present invention are not limited to the description. It is to be understood by those skilled in the art that the present invention may be practiced without departing from the spirit and scope of the invention.
Claims
1、 一种通用路由封装隧道报文发送方法, 该方法包括: 1. A method for sending universal routing encapsulated tunnel messages. The method includes:
确定通用路由封装隧道报文分片值; Determine the general routing encapsulation tunnel message fragmentation value;
根据所述报文分片值, 判断待发送报文是否需要分片; 若需要, 则对 所述待发送报文进行分片; According to the message fragmentation value, determine whether the message to be sent needs to be fragmented; if necessary, fragment the message to be sent;
对分片后的待发送报文、 或者不需要分片的待发送报文, 使用通用路 由封装协议封装后发送。 For fragmented messages to be sent, or messages to be sent that do not need to be fragmented, use the universal routing encapsulation protocol to encapsulate and send them.
2、 如权利要求 1所述的通用路由封装隧道报文发送方法, 其中, 所述 报文分片值为预设的固定值。 2. The universal routing encapsulation tunnel message sending method as claimed in claim 1, wherein the message fragmentation value is a preset fixed value.
3、 如权利要求 1所述的通用路由封装隧道报文发送方法, 其中, 所述 报文分片值的获取方式包括: 发送探测报文, 根据反馈的报文信息计算得 到所述通用路由封装隧道的最大传输单元值, 将该最大传输单元值设置为 所述报文分片值。 3. The universal routing encapsulation tunnel message sending method according to claim 1, wherein the method of obtaining the message fragmentation value includes: sending a detection message, and calculating the universal routing encapsulation based on the feedback message information. The maximum transmission unit value of the tunnel is set as the packet fragmentation value.
4、 如权利要求 3所述的通用路由封装隧道报文发送方法, 其中, 所述 利用探测报文设置所述通用路由封装隧道的报文分片值, 包括: 4. The universal routing encapsulation tunnel message sending method as claimed in claim 3, wherein the use of detection messages to set the message fragmentation value of the universal routing encapsulation tunnel includes:
获取通用路由封装隧道的第一最大传输单元值, 将所述第一最大传输 单元值设置为初始报文分片值; Obtain the first maximum transmission unit value of the universal routing encapsulation tunnel, and set the first maximum transmission unit value as the initial message fragmentation value;
根据所述第一最大传输单元值, 构造探测报文, 封装并发送所述探测 报文; 其中, 所述探测报文为不可分片报文; Construct a detection message according to the first maximum transmission unit value, encapsulate and send the detection message; wherein, the detection message is a non-fragmentable message;
若接收的回应报文为丟弃所述探测报文的回应报文, 则根据该回应报 文计算得到实时的所述通用路由封装隧道的第二最大传输单元值, 并用所 述第二最大传输单元值更新所述初始报文分片值; If the received response message is a response message that discards the detection message, the real-time second maximum transmission unit value of the universal routing encapsulation tunnel is calculated based on the response message, and the second maximum transmission unit value is used The unit value updates the initial message fragmentation value;
将所述第二最大传输单元值更新为报文分片值。 The second maximum transmission unit value is updated to the message fragmentation value.
5、 如权利要求 4所述的通用路由封装隧道报文发送方法, 其中, 所述 获取通用路由封装隧道的第一最大传输单元值, 包括:
获取通用路由封装隧道出接口的最大传输单元值, 并用该最大传输单 元值减去封装头长度, 得到通用路由封装隧道的所述第一最大传输单元值; 其中, 所述封装头长度包括: 外层 IP头长度和外层通用路由封装包头 长度。 5. The universal routing encapsulation tunnel message sending method according to claim 4, wherein said obtaining the first maximum transmission unit value of the universal routing encapsulation tunnel includes: Obtain the maximum transmission unit value of the outbound interface of the universal routing encapsulation tunnel, and subtract the encapsulation header length from the maximum transmission unit value to obtain the first maximum transmission unit value of the universal routing encapsulation tunnel; wherein, the encapsulation header length includes: The length of the layer IP header and the length of the outer general routing encapsulation header.
6、 如权利要求 3-5中任一项所述的通用路由封装隧道报文发送方法, 其中, 该方法还包括: 定期或者不定期重复发送所述探测报文。 6. The universal routing encapsulation tunnel message sending method according to any one of claims 3 to 5, wherein the method further includes: repeatedly sending the detection message regularly or irregularly.
7、 一种通用路由封装隧道报文发送装置, 该装置包括: 分片值获取单 元、 报文分片单元、 报文封装单元和报文发送单元; 其中, 7. A universal routing encapsulation tunnel message sending device, which includes: a fragmentation value acquisition unit, a message fragmentation unit, a message encapsulation unit and a message sending unit; wherein,
所述分片值获取单元, 配置为确定通用路由封装隧道报文分片值; 所述报文分片单元, 配置为根据所述报文分片值, 判断待发送报文是 否需要分片; 若需要, 则对所述待发送报文进行分片; The fragmentation value acquisition unit is configured to determine the universal routing encapsulation tunnel message fragmentation value; the message fragmentation unit is configured to determine whether the message to be sent needs to be fragmented based on the message fragmentation value; If necessary, fragment the message to be sent;
所述报文封装单元, 配置为将分片后的待发送报文、 或者不需要分片 的待发送报文, 根据通用路由封装协议进行封装; The message encapsulation unit is configured to encapsulate the fragmented message to be sent, or the message to be sent that does not require fragmentation, according to a universal routing encapsulation protocol;
所述报文发送单元, 配置为发送所述报文封装单元已封装的待发送报 文。 The message sending unit is configured to send the message to be sent that has been encapsulated by the message encapsulating unit.
8、 如权利要求 7所述的通用路由封装隧道报文发送装置, 其中, 所述 分片值获取单元, 还配置为预设置所述报文分片值为固定值。 8. The universal routing encapsulation tunnel message sending device according to claim 7, wherein the fragmentation value acquisition unit is further configured to preset the message fragmentation value to a fixed value.
9、 如权利要求 7所述的通用路由封装隧道报文发送装置, 其中, 分片 值获取单元还包括: 探测报文模块和分片值设定模块; 其中, 9. The universal routing encapsulation tunnel message sending device as claimed in claim 7, wherein the fragmentation value acquisition unit further includes: a detection message module and a fragmentation value setting module; wherein,
所述探测报文模块, 配置为生成探测所述通用路由封装隧道最大传输 单元值的探测报文, 并将所述探测报文发送给报文封装单元; The detection message module is configured to generate a detection message that detects the maximum transmission unit value of the universal routing encapsulation tunnel, and send the detection message to the message encapsulation unit;
所述分片值设定模块, 配置为根据反馈的报文信息计算所述通用路由 封装隧道的最大传输单元值, 并将该最大传输单元值设定为所述报文分片 值。 The fragmentation value setting module is configured to calculate the maximum transmission unit value of the universal routing encapsulation tunnel based on the feedback message information, and set the maximum transmission unit value as the message fragmentation value.
10、 如权利要求 9所述的通用路由封装隧道报文发送装置, 其中, 所
述分片值设定模块, 还配置为获取通用路由封装隧道的第一最大传输单元 值, 并将该第一最大传输单元值设置为初始报文分片值; 10. The universal routing encapsulated tunnel message sending device as claimed in claim 9, wherein: The fragmentation value setting module is further configured to obtain the first maximum transmission unit value of the universal routing encapsulation tunnel, and set the first maximum transmission unit value as the initial message fragmentation value;
所述探测报文模块, 还配置为根据所述分片值设定模块获取的所述第 一最大传输单元值, 构造探测报文, 并将所述探测报文发送给报文封装单 元; 其中, 所述探测报文为不可分片报文; The detection message module is also configured to construct a detection message based on the first maximum transmission unit value obtained by the fragmentation value setting module, and send the detection message to the message encapsulation unit; wherein , the detection message is a non-fragmentable message;
所述分片值设定模块, 还配置为判断接收的回应报文是否为丟弃所述 探测报文的回应报文, 若是, 则根据该回应报文计算得到实时的所述通用 路由封装隧道的第二最大传输单元值, 并用所述第二最大传输单元值更新 所述初始报文分片值, 并将所述第二最大传输单元值更新为报文分片值。 The fragmentation value setting module is also configured to determine whether the received response message is a response message that discards the detection message. If so, calculate the real-time universal routing encapsulation tunnel based on the response message. the second maximum transmission unit value, and use the second maximum transmission unit value to update the initial message fragmentation value, and update the second maximum transmission unit value to the message fragmentation value.
11、 如权利要求 10所述的通用路由封装隧道报文发送装置, 其中, 所 述分片值设定模块, 配置为通过获取通用路由封装隧道出接口的最大传输 单元值, 并用该最大传输单元值减去封装头长度, 得到通用路由封装隧道 的所述第一最大传输单元值; 11. The universal routing encapsulated tunnel message sending device according to claim 10, wherein the fragmentation value setting module is configured to obtain the maximum transmission unit value of the universal routing encapsulated tunnel outbound interface and use the maximum transmission unit Subtract the encapsulation header length from the value to obtain the first maximum transmission unit value of the universal routing encapsulation tunnel;
其中, 所述封装头长度包括: 外层 IP头长度和外层通用路由封装包头 长度。 Wherein, the encapsulation header length includes: the outer IP header length and the outer general routing encapsulation header length.
12、如权利要求 9-11中任一项所述的通用路由封装隧道报文发送装置, 其中, 所述探测报文模块, 还配置为定期或者不定期的重复发送所述探测 报文。
12. The universal routing encapsulation tunnel message sending device according to any one of claims 9-11, wherein the detection message module is further configured to repeatedly send the detection message regularly or irregularly.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012102883221A CN102868613A (en) | 2012-08-14 | 2012-08-14 | Method and device for transmission of generic routing encapsulation tunnel packet |
CN201210288322.1 | 2012-08-14 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014026571A1 true WO2014026571A1 (en) | 2014-02-20 |
Family
ID=47447215
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2013/081236 WO2014026571A1 (en) | 2012-08-14 | 2013-08-09 | Method and device for sending generic routing encapsulation tunnel message |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN102868613A (en) |
WO (1) | WO2014026571A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117376179A (en) * | 2023-12-04 | 2024-01-09 | 成都北中网芯科技有限公司 | Method, system, equipment and medium for filtering GRE protocol message |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102868613A (en) * | 2012-08-14 | 2013-01-09 | 中兴通讯股份有限公司 | Method and device for transmission of generic routing encapsulation tunnel packet |
CN104378315B (en) * | 2014-11-17 | 2018-02-27 | 京信通信系统(中国)有限公司 | A kind of method and device of CAPWAP tunnel packet transmission |
CN104618275A (en) * | 2015-01-21 | 2015-05-13 | 大唐移动通信设备有限公司 | Fragmentation processing method and equipment |
CN106411783A (en) * | 2016-09-30 | 2017-02-15 | 杭州华三通信技术有限公司 | Message sending method and device |
CN106656724A (en) * | 2016-12-20 | 2017-05-10 | 上海优刻得信息科技有限公司 | Message encapsulation method and equipment |
CN109428802B (en) * | 2017-08-28 | 2021-05-14 | 中国电信股份有限公司 | Tunnel message encapsulation and decapsulation method and tunnel platform |
CN110177052A (en) * | 2019-04-30 | 2019-08-27 | 佛山易识科技有限公司 | A kind of fragment processing method and processing device of tunnel packet |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1716943A (en) * | 2004-06-28 | 2006-01-04 | 杭州华为三康技术有限公司 | Method and system for obtaining path maximum transmission length in channel gateway environment |
WO2008040203A1 (en) * | 2006-09-15 | 2008-04-10 | Huawei Technologies Co., Ltd. | Method, system, and router for calculating the maximum transmission unit of the router output interface |
CN101207571A (en) * | 2007-12-12 | 2008-06-25 | 华为技术有限公司 | Apparatus and method for forwarding packets |
CN102868613A (en) * | 2012-08-14 | 2013-01-09 | 中兴通讯股份有限公司 | Method and device for transmission of generic routing encapsulation tunnel packet |
-
2012
- 2012-08-14 CN CN2012102883221A patent/CN102868613A/en active Pending
-
2013
- 2013-08-09 WO PCT/CN2013/081236 patent/WO2014026571A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1716943A (en) * | 2004-06-28 | 2006-01-04 | 杭州华为三康技术有限公司 | Method and system for obtaining path maximum transmission length in channel gateway environment |
WO2008040203A1 (en) * | 2006-09-15 | 2008-04-10 | Huawei Technologies Co., Ltd. | Method, system, and router for calculating the maximum transmission unit of the router output interface |
CN101207571A (en) * | 2007-12-12 | 2008-06-25 | 华为技术有限公司 | Apparatus and method for forwarding packets |
CN102868613A (en) * | 2012-08-14 | 2013-01-09 | 中兴通讯股份有限公司 | Method and device for transmission of generic routing encapsulation tunnel packet |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117376179A (en) * | 2023-12-04 | 2024-01-09 | 成都北中网芯科技有限公司 | Method, system, equipment and medium for filtering GRE protocol message |
Also Published As
Publication number | Publication date |
---|---|
CN102868613A (en) | 2013-01-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014026571A1 (en) | Method and device for sending generic routing encapsulation tunnel message | |
Conta et al. | Generic packet tunneling in IPv6 specification | |
JP5648737B2 (en) | Communication apparatus and communication method | |
CN102325076B (en) | Method for discovering PMTU (Path Maximum Transfer Unit) and node | |
US11153207B2 (en) | Data link layer-based communication method, device, and system | |
CN104125191B (en) | Processing method, equipment and the system of point-to-point protocol based on Ethernet | |
CN101827031A (en) | Method and device for packet transmission in user datagram protocol UDP tunnel | |
WO2009124477A1 (en) | Method, system and device for packet transmission | |
CN111510513B (en) | MAP-E link acceleration method, device, storage medium and network equipment | |
CN115333859B (en) | IPsec protocol message encryption and decryption method based on chip scheme | |
EP4057576A1 (en) | Packet encapsulating method and apparatus, and packet decapsulating method and apparatus | |
KR100624686B1 (en) | System and Method for setting packet Maximum Transmission Unit of IPv6 transition tunnel using Packet too big message | |
WO2011103820A2 (en) | Method and apparatus for network address translation | |
CN102420772B (en) | Tunnel message transmission and receiving methods and devices | |
JP2008252393A (en) | Communication terminal device, distribution device, error notifying method, and error notification program | |
WO2012041168A1 (en) | Processing method for network connection for ipv6 network and device thereof | |
EP2600569B1 (en) | Method, apparatus and system for processing a tunnel packet | |
CN107547691B (en) | Address resolution protocol message proxy method and device | |
CN102238084B (en) | Method and device for forwarding cross-domain message, route equipment and client | |
WO2014063612A1 (en) | Method for smart end node to access to trill network, smart end node and routing bridge | |
CN108111385B (en) | Message forwarding method and device | |
CN113746715A (en) | Communication method and device | |
WO2023279990A1 (en) | Packet transmission method, apparatus and system, network device, and storage medium | |
JP4660346B2 (en) | BRIDGE DEVICE AND BRIDGE DEVICE CONTROL METHOD | |
CN116260895A (en) | Method and system for improving UDP (user datagram protocol) fragment packet forwarding performance based on PMTU (packet transfer request) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 13829695 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 13829695 Country of ref document: EP Kind code of ref document: A1 |