MTU configuration method and device

文档序号:1538027 发布日期:2020-02-14 浏览:12次 中文

阅读说明:本技术 一种mtu配置方法和装置 (MTU configuration method and device ) 是由 温曙光 于 2018-08-01 设计创作,主要内容包括:本申请提出一种MTU配置方法和装置,所述方法包括:根据网络数据包的属性信息确定接入网络设备与目的主机链路的MTU阈值;如果确定所述网络数据包的数据量小于或者等于所述MTU阈值,向所述目的主机发送所述网络数据包。本申请利用SDN(Software Defined Network,软件定义网络)技术进行流级的MTU优化,可以使得主机在访问公网等网络较复杂的环境中,使用较小的相对安全的MTU,比如1500;主机在访问内部网络时,使用较大的MTU,优化内部传输优化,实现动态MTU优化,是一种实时的调整策略,可以随时根据主机的需要进行调整。有广泛的适用性。(The application provides a method and a device for configuring an MTU (maximum Transmission Unit), wherein the method comprises the following steps: determining an MTU threshold value of a link between the access network equipment and a target host according to the attribute information of the network data packet; and if the data volume of the network data packet is determined to be less than or equal to the MTU threshold value, sending the network data packet to the destination host. The method and the device perform flow-level MTU optimization by using an SDN (Software Defined Network) technology, so that a host can use a smaller and relatively safe MTU (maximum transmission unit), such as 1500, in an environment with more complex Network such as a public Network; when the host accesses the internal network, the large MTU is used, the internal transmission optimization is optimized, the dynamic MTU optimization is realized, and the method is a real-time adjustment strategy and can be adjusted at any time according to the requirements of the host. Has wide applicability.)

1. A method for configuring an MTU, comprising:

determining an MTU threshold value of a link between the access network equipment and a target host according to the attribute information of the network data packet;

and if the data volume of the network data packet is determined to be less than or equal to the MTU threshold value, sending the network data packet to the destination host.

2. The method of claim 1, wherein: further comprising:

and if the data volume of the network data packet is determined to be larger than the MTU threshold value, discarding the network data packet and feeding back a network control message fragmentation message to the host.

3. The method of claim 1, wherein: the method is applied to access network equipment, and the access network equipment comprises equipment for forwarding network data packets among a plurality of network nodes.

4. The method of claim 1, wherein: determining the MTU threshold of the link between the access network device and the destination host according to the attribute information of the network data packet comprises:

and when the host accesses the network with the network environment greater than or equal to the preset complexity according to the attribute of the network data packet, determining the MTU of the link between the access network equipment and the target host as a preset default value.

5. The method of claim 1, wherein: determining the MTU threshold of the link between the access network device and the destination host according to the attribute information of the network data packet comprises:

when the host accesses a network with a network environment smaller than the preset complexity according to the attribute of the network data packet, setting the MTU value of the network card of the host as the maximum MTU value supported by the link between the host and the access network equipment;

and receiving the network data packet sent by the host according to the maximum MTU value supported by the link between the host and the access network equipment.

6. The method of claim 1, wherein: the attribute information includes: a destination address corresponding to the network data packet and a communication protocol used by the network data packet.

7. The method of claim 5, wherein: the method further comprises the following steps:

and acquiring the maximum MTU value supported by the link of the host and the access network equipment through the SDN controller.

8. The method of claim 1, wherein: determining the MTU threshold of the link between the access network equipment and the destination host according to the attribute information of the network data packet comprises at least one of the following steps:

setting an MTU default value of a link between the access network equipment and the target host corresponding to the attribute information of the network data packet as the MTU threshold value;

and setting the MTU value of the link between the access network equipment and the target host computer corresponding to the acquired attribute information of the network data packet as the MTU threshold value.

9. An MTU configuration apparatus, comprising:

the determining module is set to determine the MTU threshold value of the link between the access network equipment and the target host according to the attribute information of the network data packet;

and the sending module is set to send the network data packet to the destination host if the data volume of the network data packet is determined to be less than or equal to the MTU threshold.

10. The apparatus of claim 9, wherein: further comprising:

and the feedback module is set to discard the network data packet and feed back a network control message fragmentation message to the host if the data volume of the network data packet is determined to be larger than the MTU threshold value.

11. The apparatus of claim 9, wherein: the determining module determining the MTU threshold of the link between the access network device and the destination host according to the attribute information of the network data packet comprises:

and when the host accesses the network with the network environment greater than or equal to the preset complexity according to the attribute of the network data packet, determining the MTU of the link between the access network equipment and the target host as a preset default value.

12. The apparatus of claim 9, wherein: further comprising:

the configuration module is set to set the MTU value of the host network card as the maximum MTU value supported by the link between the host and the access network equipment;

and the receiving module is set to receive the network data packet sent by the host according to the maximum MTU value supported by the link between the host and the access network equipment.

13. The apparatus of claim 12, wherein: the configuration module is further configured to:

and acquiring the maximum MTU value supported by the link of the host and the access network equipment through the SDN controller.

14. The apparatus of claim 9, wherein: the determining module determines the MTU threshold of the link between the access network device and the destination host according to the attribute information of the network data packet, wherein the MTU threshold comprises at least one of the following:

setting an MTU default value of a link between the access network equipment and the target host corresponding to the attribute information of the network data packet as the MTU threshold value;

and setting the MTU value of the link between the access network equipment and the target host computer corresponding to the acquired attribute information of the network data packet as the MTU threshold value.

Technical Field

The invention relates to the technical field of communication, in particular to a method and a device for configuring an MTU (maximum Transmission Unit).

Background

MTU (Maximum Transmission Unit) refers to the Maximum IP (Internet Protocol) message length that can be transmitted in one message Transmission process. In an IP network, the physical links between each hop have different MTU sizes depending on their characteristics. A typical value of an Ethernet for MTU of a common physical link is 1500, and a typical value of a PPPOE (Point to Point Protocol over Ethernet, Point to Point communication Protocol based on Ethernet) is 1492; there are also MTUs for various tunnel links that require the size of various tunnel headers to be subtracted from the MTU for the underlying physical bearer link.

In the network, the host can only sense the physical characteristics of the link of the next hop (direct link), thereby automatically configuring the MTU of the link outlet. When the IP packet is forwarded in the network, if the MTU of the link reaching the next hop becomes small, the router needs to perform an IP fragmentation operation to divide the current IP packet into a plurality of IP packets for transmission, so that the length of each packet is smaller than or equal to the MTU of the link of the next hop. The IP message recombination is only executed at the destination node.

The MTU has an important influence on the performance of the network, and the larger the MTU is, the more data an IP message can carry except a header is, the higher the efficiency is. Therefore, network equipment manufacturers are constantly striving to improve the MTU of physical networks; frames with MTUs greater than 1500 are called Jumbo frames (Jumbo frames). The MTU of a common mega-frame is 9000, and MTU configurations of other sizes exist. In view of the complexity of the network, coexistence of various MTUs is a reality of network development.

Therefore, it becomes an important matter to discover the MTU on the link from the host to the destination host. Network performance is wasted if the MTU configuration is not appropriate. If the MTU of the host direct-connected link is set to be too small, the performance and efficiency of the network cannot be fully exerted; if the MTU of the host direct-connected link is set to be too large, the IP message needs to be fragmented and recombined in the forwarding process, and the performance of the network node is also consumed. In addition, the fragmentation of the IP packet will generate more data packets, and the packet processing speed (packet per second) is a performance index to which many network devices are sensitive at present.

To address this problem, The IETF (The Internet Engineering Task Force, Internet Engineering Task Force) defines The Path MTU Discovery (PMTUD, Path MTU Discovery) process: a DF (Don't fragment, not allow to fragment) bit is set in the IP packet, when the router forwards the packet, if the packet is larger than MTU of the next hop link, the fragmentation operation is not executed, the packet is discarded, and an ICMP fragmentation Message (Internet Control Message Protocol) is sent to the source node.

However, because ICMP fragmentation needed is often dropped by intermediate firewalls, PMTUD is destroyed and cannot guarantee success.

Disclosure of Invention

The application provides a method and a device for configuring an MTU (maximum Transmission Unit), which can realize dynamic adjustment of the MTU according to the needs of a host.

The technical scheme is as follows:

in a first aspect, the present invention provides a method for configuring an MTU, including:

determining an MTU threshold value of a link between the access network equipment and a target host according to the attribute information of the network data packet;

and if the data volume of the network data packet is determined to be less than or equal to the MTU threshold value, sending the network data packet to the destination host.

Preferably, the method further comprises:

and if the data volume of the network data packet is determined to be larger than the MTU threshold value, discarding the network data packet and feeding back a network control message fragmentation message to the host.

Preferably, the method is applied to an access network device, which includes a device for forwarding network data packets between a plurality of network nodes.

Preferably, the determining the MTU threshold of the link between the access network device and the destination host according to the attribute information of the network data packet includes:

and when the host accesses the network with the network environment greater than or equal to the preset complexity according to the attribute of the network data packet, determining the MTU of the link between the access network equipment and the target host as a preset default value.

Preferably, the determining the MTU threshold of the link between the access network device and the destination host according to the attribute information of the network data packet includes:

when the host accesses a network with a network environment smaller than the preset complexity according to the attribute of the network data packet, setting the MTU value of the network card of the host as the maximum MTU value supported by the link between the host and the access network equipment;

and receiving the network data packet sent by the host according to the maximum MTU value supported by the link between the host and the access network equipment.

Preferably, the attribute information includes: a destination address corresponding to the network data packet and a communication protocol used by the network data packet.

Preferably, the method further comprises:

and acquiring the maximum MTU value supported by the link of the host and the access network equipment through the SDN controller.

Preferably, determining the MTU threshold of the access network device and the destination host link according to the attribute information of the network data packet includes at least one of:

setting an MTU default value of a link between the access network equipment and the target host corresponding to the attribute information of the network data packet as the MTU threshold value;

and setting the MTU value of the link between the access network equipment and the target host computer corresponding to the acquired attribute information of the network data packet as the MTU threshold value.

In a second aspect, the present invention provides an MTU configuration apparatus, including:

the determining module is set to determine the MTU threshold value of the link between the access network equipment and the target host according to the attribute information of the network data packet;

and the sending module is set to send the network data packet to the destination host if the data volume of the network data packet is determined to be less than or equal to the MTU threshold.

Preferably, the apparatus further comprises:

and the feedback module is set to discard the network data packet and feed back a network control message fragmentation message to the host if the data volume of the network data packet is determined to be larger than the MTU threshold value.

Preferably, the determining, by the determining module, the MTU threshold of the link between the access network device and the destination host according to the attribute information of the network data packet includes:

and when the host accesses the network with the network environment greater than or equal to the preset complexity according to the attribute of the network data packet, determining the MTU of the link between the access network equipment and the target host as a preset default value.

Preferably, the apparatus further comprises:

the configuration module is set to set the MTU value of the host network card as the maximum MTU value supported by the link between the host and the access network equipment;

and the receiving module is set to receive the network data packet sent by the host according to the maximum MTU value supported by the link between the host and the access network equipment.

Preferably, the configuration module is further configured to:

and acquiring the maximum MTU value supported by the link of the host and the access network equipment through the SDN controller.

Preferably, the determining module determines the MTU threshold of the link between the access network device and the destination host according to the attribute information of the network data packet, where the MTU threshold includes at least one of:

setting an MTU default value of a link between the access network equipment and the target host corresponding to the attribute information of the network data packet as the MTU threshold value;

and setting the MTU value of the link between the access network equipment and the target host computer corresponding to the acquired attribute information of the network data packet as the MTU threshold value.

Compared with the prior art, the application has the following beneficial effects:

the method and the device perform flow-level MTU optimization by using an SDN (Software Defined Network) technology, so that a host can use a smaller and relatively safe MTU (maximum transmission unit), such as 1500, in an environment with more complex Network such as a public Network; when the host accesses the internal network, the large MTU is used, the internal transmission optimization is optimized, the dynamic MTU optimization is realized, and the method is a real-time adjustment strategy and can be adjusted at any time according to the requirements of the host. Has wide applicability.

Drawings

Fig. 1 is a flowchart of an MTU configuration method according to an embodiment of the present invention;

FIG. 2 is a flow chart of determining candidate physical machines according to an embodiment of the present invention;

fig. 3 is a schematic structural diagram of an MTU configuration apparatus according to an embodiment of the present invention.

Detailed Description

The technical solutions of the present application will be described in more detail below with reference to the accompanying drawings and embodiments.

It should be noted that, if not conflicted, the embodiments and the features of the embodiments can be combined with each other and are within the scope of protection of the present application. Additionally, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.

In one configuration, a computing device performing MTU configuration may include one or more processors (CPUs), input/output interfaces, network interfaces, and memory (memory).

The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium. The memory may include one or more modules.

Computer-readable media include both non-transitory and non-transitory, removable and non-removable storage media that can implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种报文传输方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!