[go: up one dir, main page]

WO2017206460A1 - Method, apparatus and device for setting maximum transmission unit value - Google Patents

Method, apparatus and device for setting maximum transmission unit value Download PDF

Info

Publication number
WO2017206460A1
WO2017206460A1 PCT/CN2016/108027 CN2016108027W WO2017206460A1 WO 2017206460 A1 WO2017206460 A1 WO 2017206460A1 CN 2016108027 W CN2016108027 W CN 2016108027W WO 2017206460 A1 WO2017206460 A1 WO 2017206460A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
downlink
mtu value
mtu
maximum
Prior art date
Application number
PCT/CN2016/108027
Other languages
French (fr)
Chinese (zh)
Inventor
张震
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017206460A1 publication Critical patent/WO2017206460A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the present invention relates to the field of communications, and in particular, to a method, device, and device for setting a maximum transmission unit value.
  • the maximum transmission unit (MTU) value is incorrect, resulting in the inability to access the Internet.
  • MTU maximum transmission unit
  • the same type of router product appears in some areas. Internet access is available. Users in some areas cannot access the Internet. Users cannot access the Internet in certain frequency bands and can access the Internet in other frequency bands. Users can open certain websites and cannot open certain websites.
  • TCP transmission control protocol
  • the minimum MTU size of all network nodes is fixed to the router product. However, this fixed configuration causes the user to be unable to access the Internet when the MTU of the network node changes. In 2014, MF96G products encountered up to 25% customer retreat rate, and finally found out that the reason is that the network MTU parameter changes cause users to not access the Internet.
  • the related art there is a scheme for automatic configuration of MTU and fixed configuration of MTU.
  • the related technologies are all uplinked by the wireless router through the Internet Control Message Protocol (ICMP) protocol.
  • ICMP Internet Control Message Protocol
  • the large message is sent to the server, and the minimum MTU value in the network node is detected by means of the response message of the server.
  • the network nodes passing through the downlink and the uplink may not be the same.
  • the MTU value of the downlink network node cannot be detected; for the fixed configuration scheme, during the development period of the wireless router, the minimum MTU of the network node is obtained from the operator, and then fixedly configured into the router, which is not flexible enough. If the MTU value of the network node changes, the router cannot dynamically configure the MTU value.
  • the embodiment of the present invention provides a method, a device, and a device for setting a maximum transmission unit value, so as to at least solve the problem that the MTU value of the downlink network node cannot be detected and cannot receive the big data packet sent by the server in the related art.
  • a method for setting a maximum transmission unit value comprising: receiving an instruction for instructing a device to be powered on; determining a minimum maximum transmission unit MTU value in a downlink between the device and the server ; Set the determined minimum MTU value in the device.
  • determining a minimum MTU value in a downlink between the device and the server includes: determining a minimum MTU value by using a Transmission Control Protocol (TCP).
  • TCP Transmission Control Protocol
  • determining the minimum MTU value by using the transmission control protocol TCP includes: determining a maximum MTU value that the device is allowed to set; acquiring text content corresponding to the maximum MTU value of the server; wherein the server establishes a TCP connection with the device. If it is determined that the MTU value set in the device is the maximum MTU value, whether the downlink is connected; if the judgment result is yes, it is determined that the maximum MTU value allowed to be set is the minimum MTU value.
  • the method further includes: if the MTU value set in the device is the maximum MTU value. If the downlink is not connected, determine a first MTU value that is smaller than a maximum MTU value by a first predetermined value; and determine whether the downlink is connected if the MTU value set in the device is the first MTU value.
  • the minimum MTU value is determined by determining that the MTU value set in the device is the first intermediate value between the maximum MTU value and the first MTU value.
  • the downlink result is that the MTU value set in the device is the first intermediate value between the maximum MTU value and the first MTU value
  • the second intermediate value whether the downlink is connected; the above-mentioned determination process of the intermediate value is repeatedly performed until the previous judgment result is that the downlink is connected to the corresponding intermediate value and the latter judgment result is the downlink.
  • the difference between the non-connected corresponding intermediate values is smaller than the second predetermined value, it is determined that the corresponding intermediate value of the previous judgment result that the downlink is connected is the minimum MTU value.
  • the method further includes: if the downlink result is that the downlink is disconnected And continuing to determine a third MTU value that is smaller than the first MTU value by a third predetermined value, and continuing to determine whether the downlink is connected if the MTU value set in the device is the third MTU value, and repeatedly performing the foregoing fetching The value and the judging process, until the downlink is connected, the first MTU value is taken as the maximum MTU value, and the minimum MTU value is determined in a manner of determining the minimum MTU value in the case where the determination result is that the downlink is connected.
  • whether the downlink is connected includes: detecting a downlink that interacts with the server. a packet; determining whether the maximum downlink packet length in the downlink packet is the second intermediate value; detecting whether the end identifier of the text content transmission is received within the predetermined time; wherein, the maximum downlink packet length is the second middle In the case where the value is received and the end identifier is received within a predetermined time, the downlink connection is determined.
  • a setting device for a maximum transmission unit value comprising: a receiving module configured to receive an instruction for instructing a device to be powered on; and a determining module configured to determine between the device and the server The minimum and maximum transmission unit MTU value in the downlink; a setting module configured to set the determined minimum MTU value in the device.
  • the determining module is further configured to determine a minimum MTU value by the transmission control protocol TCP.
  • the determining module is further configured to determine a maximum MTU value that the device is allowed to set; obtain text content corresponding to the maximum MTU value of the server; wherein the server establishes a TCP connection with the device; determining to set in the device MTU value is the maximum MTU value In the case where the downlink is connected; and in the case where the judgment result is yes, it is determined that the maximum MTU value allowed to be set is the minimum MTU value.
  • the determining module is further configured to determine, when the MTU value set in the device is the maximum MTU value, that the downlink is not connected, and determine the first predetermined value that is smaller than the maximum MTU value.
  • the MTU value is determined whether the downlink is connected if the MTU value set in the device is the first MTU value, and the minimum MTU value is determined by the following manner when the determination result is that the downlink is connected.
  • the intermediate value whether the downlink is connected; the above-mentioned determination process of the intermediate value is repeatedly performed until the previous judgment result is that the downlink is connected to the corresponding intermediate value and the latter judgment result is that the downlink is not Unicom If the difference between the intermediate value should be less than a second predetermined value, a determination result is determined before the downlink communication with a corresponding intermediate value minimum MTU value.
  • the determining module is further configured to continue to determine a third MTU value that is smaller than the first MTU value by a third predetermined value, and continue to determine the third, if the determination result is that the downlink is not connected.
  • the MTU value whether the downlink is connected, repeating the above process of taking the third MTU value and determining whether the downlink is connected, until the result of the determination is that the downlink is connected, and the first MTU value is maximized.
  • the MTU value determines the minimum MTU value by determining the minimum MTU value in the case where the determination result is that the downlink is connected.
  • the determining module is further configured to: detect a downlink packet that interacts with the server; determine whether a maximum downlink packet length in the downlink packet is a second intermediate value; and detect whether the text content is received within a predetermined time.
  • the end identifier of the transmission completion wherein, when the maximum downlink packet length is the second intermediate value, and the end identifier is received within the predetermined time, the downlink connectivity is determined.
  • an apparatus comprising the above-described setting means for the maximum transmission unit value.
  • a storage medium is also provided.
  • the storage medium is configured to store program code for performing the steps of: receiving an instruction to indicate that the device is powered on; determining a minimum maximum transmission unit MTU value in the downlink between the device and the server; determining a minimum MTU value Set in the device.
  • the determined minimum MTU value is set in the device, that is, by automatically detecting the minimum MTU value in the downlink.
  • the downlink network node MTU is no longer detected, and the determined downlink MTU is more accurate.
  • the problem that the big data packet sent by the server can be received can solve the problem that the MTU value of the downlink network node cannot be detected and the big data packet sent by the server cannot be received.
  • FIG. 1 is a block diagram showing the hardware structure of a mobile terminal for setting a maximum transmission unit value according to an embodiment of the present invention
  • FIG. 2 is a structural block diagram of a network architecture according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method of setting a maximum transmission unit value according to an embodiment of the present invention
  • FIG. 4 is a schematic flow chart of a method for determining an MTU value according to a preferred embodiment of the present invention.
  • FIG. 5 is a structural block diagram of a setting device for a maximum transmission unit value according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of steps performed by an initialization module according to a preferred embodiment of the present invention.
  • FIG. 7 is a step performed by an MTU value configuration module according to a preferred embodiment of the present invention.
  • FIG. 8 is a schematic diagram of steps performed by a connection server module according to a preferred embodiment of the present invention.
  • FIG. 9 is a schematic diagram of steps performed by a downlink message monitoring MTU calculation module according to a preferred embodiment of the present invention.
  • FIG. 1 is a hardware structural block diagram of a mobile terminal for setting a maximum transmission unit value according to an embodiment of the present invention.
  • the mobile terminal 10 may include one or more (only one shown) processor 102 (the processor 102 may include, but is not limited to, a Microcontroller Unit (MCU) or a programmable logic device.
  • a processing device such as a Field Programmable Gate Array (FPGA), a memory 104 for storing data, and a transmission device 106 for a communication function.
  • FPGA Field Programmable Gate Array
  • FIG. 1 is merely illustrative and does not limit the structure of the above electronic device.
  • the mobile terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • the memory 104 can be used to store software programs and modules of the application software, such as program instructions/modules corresponding to the setting method of the maximum transmission unit value in the embodiment of the present invention, and the processor 102 runs the software programs and modules stored in the memory 104. Thereby performing various functional applications and data processing, that is, implementing the above method.
  • the memory 104 can include a high speed random access memory, Non-volatile memory can be included, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 104 may further include memory remotely located relative to processor 102, which may be connected to mobile terminal 10 over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Transmission device 106 is for receiving or transmitting data via a network.
  • the above-described network specific example may include a wireless network provided by a communication provider of the mobile terminal 10.
  • the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • the embodiment of the present application can be run on the network architecture shown in FIG. 2, as shown in FIG. 2, the network architecture includes: a device and a server, where the device and the server interact with each other.
  • FIG. 3 is a flowchart of a method for setting a maximum transmission unit value according to an embodiment of the present invention, as shown in FIG. The process includes the following steps:
  • Step S302 receiving an instruction for instructing the device to start networking
  • Step S304 determining a minimum maximum transmission unit MTU value in a downlink between the device and the server;
  • Step S306 setting the determined minimum MTU value in the device.
  • the determined minimum MTU value is set in the device, that is, by automatically detecting the minimum MTU value in the downlink.
  • the downlink network node MTU is no longer detected, and the minimum MTU of the determined downlink is more accurate.
  • the problem of the big data packet sent by the server can be received, and the MTU value of the downlink network node cannot be detected, and the big data packet sent by the server cannot be received. problem.
  • each of the foregoing network nodes has an allowed minimum MTU value, and the largest MTU value among the minimum MTU values is the minimum MTU value in the downlink; that is, the minimum MTU.
  • the value is the maximum message length of a message that can pass through all network nodes in the downlink.
  • the above step S304 may be performed to determine a minimum MTU value by using a transmission control protocol TCP.
  • TCP transmission control protocol
  • determining the minimum MTU value by using the TCP may be performed by: determining a maximum MTU value that the device is allowed to set; acquiring text content corresponding to the maximum MTU value of the server; wherein the server establishes a TCP connection with the device; determining in the device If the set MTU value is the maximum MTU value, whether the downlink is connected; if the judgment result is yes, it is determined that the maximum MTU value that is allowed to be set is the minimum MTU value.
  • the MTU value set in the device is the maximum MTU value
  • whether the downlink is connected may be: detecting a downlink packet that interacts with the server; and determining a maximum downlink in the downlink packet. Whether the length of the packet is the maximum MTU value; whether the end identifier of the text content transmission is received within a predetermined time; wherein the maximum downlink packet length is the maximum MTU value, and the end identifier is received within the predetermined time.
  • the downlink is connected. That is, if the maximum MTU value allowed by the device enables the downlink to be connected, it can directly determine that the minimum MTU value (final MTU value) of the downlink is the above-prepared MTU value.
  • end identifier may be an http/1.xOK key field, but is not limited thereto.
  • the method may further include: if the MTU value set in the device is the maximum MTU value, If the downlink is not connected, determine a first MTU value that is smaller than a maximum MTU value by a first predetermined value; and determine whether the downlink is connected if the MTU value set in the device is the first MTU value.
  • the minimum MTU value is determined by determining that the MTU value set in the device is the first intermediate value between the maximum MTU value and the first MTU value. If the downlink is connected, if the downlink is connected, if the downlink is connected, the continuation is determined in the device.
  • the MTU value is the second intermediate value between the first intermediate value and the maximum MTU value, whether the downlink is connected; repeating the above-mentioned determination process of taking the intermediate value until the previous judgment result is that the downlink is Connected In the case where the difference between the intermediate value and the intermediate value corresponding to the next determination result that the downlink disconnection is less than the second predetermined value, it is determined that the previous intermediate result is that the downlink is connected and the corresponding intermediate value is the smallest. MTU value.
  • first intermediate value may be any value between the maximum MTU value and the first MTU value, and may be an average value of the maximum MTU value and the first MTU value, but is not limited thereto.
  • second intermediate value may be any value between the first intermediate value and the maximum MTU value, or may be an average value of the maximum MTU value and the first intermediate value, but is not limited thereto.
  • the MTU value is 9, the judgment result is that the downlink is connected, and when the MTU value is 10, the downlink is not connected, then it can be determined.
  • the minimum MTU value is 9.
  • the MTU value of 9 is considered to be the corresponding intermediate value of the previous judgment result that the downlink is connected.
  • the MTU value of 10 can be regarded as the result of the subsequent judgment being that the downlink is not connected.
  • the intermediate value, the second predetermined value can be set to 2.
  • whether the downlink is connected may include: Detecting a downlink packet that interacts with the server; determining whether the maximum downlink packet length in the downlink packet is the second intermediate value; detecting whether the end identifier of the text content transmission is received within a predetermined time; wherein, the largest downlink packet is received The length of the text is the second intermediate value, and in the case where the end identifier is received within a predetermined time, the downlink connectivity is determined.
  • the method further includes: determining that the downlink is disconnected In case, if the third MTU value that is smaller than the first MTU value by the third predetermined value is continuously determined, and if the MTU value set in the device is further determined to be the third MTU value, whether the downlink is connected, and the execution is repeated. The process of taking the third MTU value and determining whether the downlink is connected, until the result of the determination is that the downlink is connected, and the first MTU value is used as the maximum MTU value, and the foregoing is determined to be that the downlink is connected. Next, the way to determine the minimum MTU value determines the minimum MTU value.
  • first predetermined value, the second predetermined value, and the third predetermined value may be determined according to actual conditions, but are not limited thereto.
  • the foregoing method may further include: acquiring text content of the server; that is, each time the MTU value is required, the TCP connection needs to be re-established.
  • the text content of the foregoing obtaining server may be obtained by using a wget command, but is not limited thereto.
  • the minimum MTU value is determined by the above method, the determination speed of the minimum MTU value is improved, and the accuracy of determining the minimum MTU value of the downlink is also improved.
  • execution body of the above steps may be a terminal, a router, or the like, but is not limited thereto.
  • a method for automatically detecting a network MTU value based on a TCP protocol which is provided by a preferred embodiment of the present invention.
  • a device such as a router
  • After a device is powered on, it is connected to a server configured by default, and obtains a default server text content by using the wget command, and the device detects the server.
  • Connected downgrade The size of the file, whether it receives the message sent by the server, and judges whether the connection ends three conditions according to the HTTP/1.x OK key field to detect the minimum MTU value of the network node.
  • the default configured server address can be changed by the user to the actual web address, and it can be detected whether the currently configured web address is not correct due to the MTU.
  • 4 is a schematic flowchart of a method for determining an MTU value according to a preferred embodiment of the present invention. As shown in FIG. 4, the method includes:
  • the first step is to configure the router MTU initial value MTU0.
  • MTU0 is small enough to ensure that MTU0 packets can pass through all network nodes; configure the default server address. Users can modify the server address on webui.
  • the router obtains the text content of the server through the wget command.
  • the fourth step is to detect whether the 1500 size packet can pass through all network nodes. If yes, configure the router to have a final MTU of 1500. If not, find the final MTU value in the range of MTU0-1500 by the binary search method: reset the router.
  • the MTU value is a maximum of 1500. The router re-monitoring the downlink packets that interact with the server. If the maximum downlink packet length is 1500 and the HTTP/1.x OK key field is received, the final MTU value of the router can be set to 1500. If the HTTP/1.x OK field or the uplink packet ACK acknowledgment message is not received within the TCP timeout period, the minimum MTU value in the downlink network link node is between MTU0 and 1500.
  • the fifth step is to find the final MTU value in the range of MTU0-1500 by the binary search method. If the minimum MTU of all network nodes in the downlink is in the range of MTU0-1500, then use the binary search method to find the minimum network node of the downlink. MTU value. First set the router MTU to Then use the wget command to obtain the content of the server text. If the maximum downlink packet length is in the monitored downlink packet, And receive the HTTP/1.x OK key field and re-detect the MTU Value, if the HTTP/1.x OK field or the upstream packet ACK acknowledgment message is not received within the TCP timeout period, the MTU is re-detected. The value is searched in turn according to the rules of the half-find method.
  • the MTU1 value at the final search point of the binary search method is set to the router, and the first time after the first power-on, the first step is to search for the minimum MTU value in the downlink.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • a device for setting a maximum transmission unit value is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and the description thereof has been omitted.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 5 is a structural block diagram of a device for setting a maximum transmission unit value according to an embodiment of the present invention. As shown in FIG. 5, the device includes:
  • the receiving module 52 is configured to receive an instruction for instructing the device to be powered on
  • the determining module 54 is connected to the receiving module 52, and is configured to determine a minimum and maximum transmission unit MTU value in a downlink between the device and the server;
  • the setting module 56 is connected to the determining module 54 and configured to set the minimum MTU. The value is set in the device.
  • the determining module 54 determines the minimum MTU in the downlink
  • the setting module 56 sets the determined minimum MTU value in the device, that is, through the automatic Detecting the minimum MTU value in the downlink, compared with the minimum MTU value of the network node that detects the uplink route in the prior art, the downlink network node MTU is no longer detected, and thus the determined The minimum MTU of the downlink is more accurate, and the problem of the big data packet sent by the server can be received, and the big data packet sent by the server cannot be received by the MTU of the downlink network node in the related art. The problem.
  • each of the foregoing network nodes has an allowed minimum MTU value, and the largest MTU value among the minimum MTU values is the minimum MTU value in the downlink; that is, the minimum MTU.
  • the value is the maximum message length of a message that can pass through all network nodes in the downlink.
  • the determining module 54 may be further configured to determine a minimum MTU value by using a Transmission Control Protocol (TCP).
  • TCP Transmission Control Protocol
  • the uplink MTU value is sent to the server through the ICMP protocol to detect the minimum MTU value in the network node, and the minimum MTU value of the downlink is determined by using the TCP protocol.
  • the determining module 54 is further configured to determine a maximum MTU value that the device is allowed to set; obtain text content corresponding to the maximum MTU value of the server; wherein the server establishes a TCP connection with the device; If the MTU value set in the device is the maximum MTU value, whether the downlink is connected; and if the judgment result is yes, it is determined that the maximum MTU value allowed to be set is the minimum MTU value.
  • the MTU value set in the device is the maximum MTU value
  • whether the downlink is connected may be: detecting a downlink packet that interacts with the server; and determining a maximum downlink in the downlink packet. Whether the length of the packet is the maximum MTU value; whether the end identifier of the text content transmission is received within a predetermined time; wherein the maximum downlink packet length is the maximum MTU value, and the end identifier is received within the predetermined time.
  • the determining module 54 may be further configured to determine that the MTU value set in the device is the maximum MTU value, and if the downlink is not connected, determine that the MTU value is smaller than the maximum MTU value.
  • determining a minimum MTU value determining whether the downlink is connected if the MTU value set in the device is the first intermediate value between the maximum MTU value and the first MTU value; If the MTU value set in the value is the first intermediate value between the maximum MTU value and the first MTU value, if the downlink is connected, continue to determine that the MTU value set in the device is the first intermediate value.
  • the second intermediate value between the maximum MTU values whether the downlink is connected; repeating the above-mentioned determination process of taking the intermediate value until the previous judgment result is that the downlink is connected to the corresponding intermediate value and after In a case where the result of the determination is that the difference between the intermediate values corresponding to the downlink non-coupling is less than the second predetermined value, the corresponding intermediate value of the previous determination result that the downlink is connected is determined to be the minimum MTU value.
  • first intermediate value may be any value between the maximum MTU value and the first MTU value, and may be an average value of the maximum MTU value and the first MTU value, but is not limited thereto.
  • second intermediate value may be any value between the first intermediate value and the maximum MTU value, or may be an average value of the maximum MTU value and the first intermediate value, but is not limited thereto.
  • whether the downlink is connected may include: detecting a downlink report interacting with the server. Determining whether the maximum downlink packet length in the downlink packet is the second intermediate value; detecting whether the end identifier of the text content transmission is received within the predetermined time; The downlink connection is determined when the maximum downlink packet length is the second intermediate value and the end identifier of the text content transmission is received within a predetermined time.
  • the determining module 54 may further be configured to continue to determine a third MTU value that is smaller than the first MTU value by a third predetermined value if the determination result is that the downlink is not connected, and Continuing to determine whether the downlink is connected when the MTU value set in the device is the third MTU value, and repeatedly performing the above process of taking the third MTU value and determining whether the downlink is connected, until the judgment result is downlink.
  • the path is connected, and the first MTU value is used as the maximum MTU value.
  • the minimum MTU value is determined by determining the minimum MTU value in the case where the determination result is that the downlink is connected.
  • the determining module 54 is further configured to detect a downlink packet that interacts with the server, determine whether a maximum downlink packet length in the downlink packet is a second intermediate value, and detect whether an end identifier of the text content transmission is received within a predetermined time. Wherein, in a case where the maximum downlink message length is the second intermediate value, and the end identifier of the text content transmission is completed within a predetermined time, the downlink connection is determined.
  • the determination speed of the minimum MTU value is improved, and the accuracy of determining the minimum MTU value of the downlink is also improved.
  • first predetermined value, the second predetermined value, and the third predetermined value may be determined according to actual conditions, but are not limited thereto.
  • the foregoing device may be located in the terminal, or may be located in the device, such as a router, but is not limited thereto.
  • the device for automatically detecting the MTU value of the network is provided by the preferred embodiment of the present invention.
  • the router is connected to the server through the TCP protocol, and the wget command is used to obtain the text content of the server, and the size of the downlink packet is monitored, whether the packet sent by the server is received, According to the HTTP/1.x OK key field, it is judged whether the connection ends three conditions, and the half-find search method is used to find the minimum MTU value of all network nodes in the downlink.
  • the above device comprises an initialization module, an MTU value configuration module, a connection server module, and a downlink message monitoring MTU calculation module.
  • FIG. 6 is a schematic diagram of steps performed by an initialization module according to a preferred embodiment of the present invention. As shown in FIG. 6 , the main content of the initialization module is to restore the configuration default service domain name after the router is started, and configure the initial MTU value of the router. MTU0.
  • the MTU value configuration module mainly completes the MTU provided by the initialization module and the downlink packet monitoring MTU calculation module, and is configured to In the router.
  • FIG. 8 is a schematic diagram of steps performed by a connection server module according to a preferred embodiment of the present invention.
  • the main content of the connection server module is to determine whether the current device is the first time for dial-up networking, and if so, Connect to the server through the wget command, and obtain the text content from the server, and provide the IP address corresponding to the server domain name and the source and destination ports of the established tcp to monitor the MTU calculation module for the downlink packet.
  • the downlink message monitoring MTU calculation module mainly monitors a tcp connection established between a connection server module and a server.
  • the tcp connection to be monitored is determined by connecting the IP corresponding to the server domain name provided by the server module and the source and destination ports of the established tcp.
  • the downlink packet monitoring MTU calculation module determines the configuration of the current MTU value configuration module by monitoring the size of the downlink packet, whether it receives the packet sent by the server, and determining whether the connection is terminated according to the HTTP/1.x OK key field. Whether the MTU is the final MTU value.
  • the end of the half-find loop is completed and the automatic detection ends. If not, provide a new MTU that needs to be detected to configure the MTU value configuration module into the router, and notify the connection server module to reconnect to the server and obtain the text content on the server.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the above modules are in any combination.
  • the forms are located in different processors.
  • an apparatus including the setting means of the maximum transmission unit value in the above embodiment 2. It should be noted that, for the explanation of the above-mentioned setting device of the maximum transmission unit value, refer to the explanation in Embodiment 2, and details are not described herein again.
  • Embodiments of the present invention also provide a storage medium.
  • the above storage medium may be set to store program code for executing the steps of the method in Embodiment 1.
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • the processor performs the steps of the method in Embodiment 1 according to the stored program code in the storage medium.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

Provided are a method, apparatus and device for setting maximum transmission unit value The method comprises: receiving an instruction for instructing a device to boot up and connect to the Internet; determining a minimum maximum transmission unit (MTU) value in a downlink between the device and the server; and setting the determined minimum MTU value in the device. By means of the present invention, the problem in the art that a big data message sent by a server cannot be received due to the fact that a MTU value of a downlink network node cannot be detected is solved.

Description

最大传输单元值的设置方法及装置、设备Method, device and device for setting maximum transmission unit value 技术领域Technical field

本发明涉及通信领域,具体而言,涉及一种最大传输单元值的设置方法及装置、设备。The present invention relates to the field of communications, and in particular, to a method, device, and device for setting a maximum transmission unit value.

背景技术Background technique

在用户通过的路由器产品上网过程中,经常会遇到由于最大传输单元(Maximum Transmission Unit,简称MTU)值不对导致不能上网的情况出现,例如:同一类路由器产品,出现在某些地区使用的用户可以上网,某些地区的用户不能上网;用户在某个频段不能上网,在其他频段可以上网;用户可以打开某些网址,不能打开某些网址。虽然,在传输控制协议(Transfer Control Protocol,简称TCP)连接过程中,会协商双方MTU大小,最后按照最小的MTU进行报文传输,但是,这种协商只是两端之间的协商,网络中节点的MTU值,在协商过程中并不知道。在项目开发期,会与运营商沟通,所有网络节点最小MTU大小,然后固定配置到路由器产品中,但是这种固定配置,在网络节点MTU变化时,会导致用户不能上网情况出现。在2014年,MF96G产品遇到高达25%客退机率,最后查明原因是网络MTU参数改变导致用户不能上网。During the process of accessing the router products that the user passes through, it is often encountered that the maximum transmission unit (MTU) value is incorrect, resulting in the inability to access the Internet. For example, the same type of router product appears in some areas. Internet access is available. Users in some areas cannot access the Internet. Users cannot access the Internet in certain frequency bands and can access the Internet in other frequency bands. Users can open certain websites and cannot open certain websites. In the transmission control protocol (TCP) connection process, the MTU size of both parties is negotiated, and finally the packet transmission is performed according to the minimum MTU. However, this negotiation is only negotiation between the two ends, and nodes in the network. The MTU value is not known during the negotiation process. During the project development period, the operator will communicate with the operator. The minimum MTU size of all network nodes is fixed to the router product. However, this fixed configuration causes the user to be unable to access the Internet when the MTU of the network node changes. In 2014, MF96G products encountered up to 25% customer retreat rate, and finally found out that the reason is that the network MTU parameter changes cause users to not access the Internet.

相关技术中存在MTU自动配置和MTU固定配置的方案,对于相关技术中的MTU值自动配置的方案,相关技术中都是在无线路由器通过互联网控制信息协议(Internet Control Message Protocol,ICMP)协议上行发送大报文给服务器,借助服务器的响应消息,探测网络节点中的最小MTU值,对于该方案,由于下行链路和上行链路所经过的网络节点可能并不相同,此时,采用该方案,可能存在下行链路网络节点MTU值探测不到的问题;对于固定配置的方案,在无线路由器开发期,从运营商中获取网络节点的最小MTU,然后固定配置到路由器中,此方案不够灵活,如果网络节点的MTU值改变,则路由器无法动态配置MTU值。 In the related art, there is a scheme for automatic configuration of MTU and fixed configuration of MTU. For the scheme of automatically configuring the MTU value in the related art, the related technologies are all uplinked by the wireless router through the Internet Control Message Protocol (ICMP) protocol. The large message is sent to the server, and the minimum MTU value in the network node is detected by means of the response message of the server. For this solution, the network nodes passing through the downlink and the uplink may not be the same. There may be a problem that the MTU value of the downlink network node cannot be detected; for the fixed configuration scheme, during the development period of the wireless router, the minimum MTU of the network node is obtained from the operator, and then fixedly configured into the router, which is not flexible enough. If the MTU value of the network node changes, the router cannot dynamically configure the MTU value.

针对相关技术中的上述技术问题,目前尚未提出有效的解决方案。In view of the above technical problems in the related art, an effective solution has not yet been proposed.

发明内容Summary of the invention

本发明实施例提供了一种最大传输单元值的设置方法及装置、设备,以至少解决相关技术中下行链路网络节点MTU值探测不到导致无法接收到服务器发送的大数据报文的问题。The embodiment of the present invention provides a method, a device, and a device for setting a maximum transmission unit value, so as to at least solve the problem that the MTU value of the downlink network node cannot be detected and cannot receive the big data packet sent by the server in the related art.

根据本发明的一个实施例,提供了一种最大传输单元值的设置方法,包括:接收用于指示设备开机联网的指令;确定设备与服务器之间的下行链路中的最小最大传输单元MTU值;将确定的最小MTU值设置在设备中。According to an embodiment of the present invention, a method for setting a maximum transmission unit value is provided, comprising: receiving an instruction for instructing a device to be powered on; determining a minimum maximum transmission unit MTU value in a downlink between the device and the server ; Set the determined minimum MTU value in the device.

在本发明实施例中,确定设备与服务器之间的下行链路中的最小MTU值包括:通过传输控制协议(Transmission Control Protocol,TCP)确定最小MTU值。In the embodiment of the present invention, determining a minimum MTU value in a downlink between the device and the server includes: determining a minimum MTU value by using a Transmission Control Protocol (TCP).

在本发明实施例中,通过传输控制协议TCP确定最小MTU值包括:确定设备允许设置的最大MTU值;获取服务器的与最大MTU值对应的文本内容;其中,服务器与设备之间建立有TCP连接;判断在设备中设置的MTU值为最大MTU值的情况下,下行链路是否是连通的;在判断结果为是的情况下,确定允许设置的最大MTU值为最小MTU值。In the embodiment of the present invention, determining the minimum MTU value by using the transmission control protocol TCP includes: determining a maximum MTU value that the device is allowed to set; acquiring text content corresponding to the maximum MTU value of the server; wherein the server establishes a TCP connection with the device. If it is determined that the MTU value set in the device is the maximum MTU value, whether the downlink is connected; if the judgment result is yes, it is determined that the maximum MTU value allowed to be set is the minimum MTU value.

在本发明实施例中,在判断在设备中设置的MTU值为最大MTU值的情况下,下行链路是否是连通的之后,还包括:在设备中设置的MTU值为最大MTU值的情况下,下行链路是不连通的情况下,确定比最大MTU值小第一预定值的第一MTU值;判断在设备中设置的MTU值为第一MTU值的情况下,下行链路是否是连通的;在判断结果为下行链路是连通的情况下,通过以下方式,确定最小MTU值:判断在设备中设置的MTU值为最大MTU值与第一MTU值之间的第一中间值的情况下,下行链路是否是连通的;在判断结果为在设备中设置的MTU值为最大MTU值与第一MTU值之间的第一中间值的情况下,下行链路是连通的情况下,继续判断在设备中设置的MTU值为第一中间值与最大MTU值之间的第 二中间值的情况下,下行链路是否是连通的;重复执行上述取中间值的判断过程,直到前一次判断结果为下行链路是连通的对应的中间值与后一次判断结果为下行链路不连通对应的中间值之间的差小于第二预定值的情况下,确定前一次判断结果为下行链路是连通的对应的中间值为最小MTU值。In the embodiment of the present invention, after determining whether the MTU value set in the device is the maximum MTU value, whether the downlink is connected, the method further includes: if the MTU value set in the device is the maximum MTU value. If the downlink is not connected, determine a first MTU value that is smaller than a maximum MTU value by a first predetermined value; and determine whether the downlink is connected if the MTU value set in the device is the first MTU value. When the judgment result is that the downlink is connected, the minimum MTU value is determined by determining that the MTU value set in the device is the first intermediate value between the maximum MTU value and the first MTU value. If the downlink is connected, if the downlink result is that the MTU value set in the device is the first intermediate value between the maximum MTU value and the first MTU value, Continue to judge that the MTU value set in the device is between the first intermediate value and the maximum MTU value. In the case of the second intermediate value, whether the downlink is connected; the above-mentioned determination process of the intermediate value is repeatedly performed until the previous judgment result is that the downlink is connected to the corresponding intermediate value and the latter judgment result is the downlink. In the case where the difference between the non-connected corresponding intermediate values is smaller than the second predetermined value, it is determined that the corresponding intermediate value of the previous judgment result that the downlink is connected is the minimum MTU value.

在本发明实施例中,在判断在设备中设置的MTU值为第一MTU值的情况下,下行链路是否是连通的之后,还包括:在判断结果为下行链路是不连通的情况下,继续确定比第一MTU值小第三预定值的第三MTU值,以及继续判断在设备中设置的MTU值为第三MTU值的情况下,下行链路是否是连通的,重复执行上述取值以及判断过程,直到下行链路是连通的,将第一MTU值作为最大MTU值,采用上述在判断结果为下行链路是连通的情况下,确定最小MTU值的方式确定最小MTU值。In the embodiment of the present invention, after determining whether the MTU value set in the device is the first MTU value, whether the downlink is connected, the method further includes: if the downlink result is that the downlink is disconnected And continuing to determine a third MTU value that is smaller than the first MTU value by a third predetermined value, and continuing to determine whether the downlink is connected if the MTU value set in the device is the third MTU value, and repeatedly performing the foregoing fetching The value and the judging process, until the downlink is connected, the first MTU value is taken as the maximum MTU value, and the minimum MTU value is determined in a manner of determining the minimum MTU value in the case where the determination result is that the downlink is connected.

在本发明实施例中,判断在设备中设置的MTU值为第一中间值与最大MTU值之间的第二中间值的情况下,下行链路是否是连通的包括:检测与服务器交互的下行报文;判断下行报文中最大的下行报文长度是否为第二中间值;检测在预定时间内是否收到文本内容传输完毕的结束标识;其中,在最大的下行报文长度为第二中间值,且在预定时间内收到结束标识的情况下,确定下行链路连通。In the embodiment of the present invention, if it is determined that the MTU value set in the device is the second intermediate value between the first intermediate value and the maximum MTU value, whether the downlink is connected includes: detecting a downlink that interacts with the server. a packet; determining whether the maximum downlink packet length in the downlink packet is the second intermediate value; detecting whether the end identifier of the text content transmission is received within the predetermined time; wherein, the maximum downlink packet length is the second middle In the case where the value is received and the end identifier is received within a predetermined time, the downlink connection is determined.

根据本发明的另一个实施例,提供了一种最大传输单元值的设置装置,包括:接收模块,设置为接收用于指示设备开机联网的指令;确定模块,设置为确定设备与服务器之间的下行链路中的最小最大传输单元MTU值;设置模块,设置为将确定的最小MTU值设置在设备中。According to another embodiment of the present invention, there is provided a setting device for a maximum transmission unit value, comprising: a receiving module configured to receive an instruction for instructing a device to be powered on; and a determining module configured to determine between the device and the server The minimum and maximum transmission unit MTU value in the downlink; a setting module configured to set the determined minimum MTU value in the device.

在本发明实施例中,确定模块,还设置为通过传输控制协议TCP确定最小MTU值。In an embodiment of the invention, the determining module is further configured to determine a minimum MTU value by the transmission control protocol TCP.

在本发明实施例中,确定模块还设置为确定设备允许设置的最大MTU值;获取服务器的与最大MTU值对应的文本内容;其中,服务器与设备之间建立有TCP连接;判断在设备中设置的MTU值为最大MTU值 的情况下,下行链路是否是连通的;以及在判断结果为是的情况下,确定允许设置的最大MTU值为最小MTU值。In the embodiment of the present invention, the determining module is further configured to determine a maximum MTU value that the device is allowed to set; obtain text content corresponding to the maximum MTU value of the server; wherein the server establishes a TCP connection with the device; determining to set in the device MTU value is the maximum MTU value In the case where the downlink is connected; and in the case where the judgment result is yes, it is determined that the maximum MTU value allowed to be set is the minimum MTU value.

在本发明实施例中,确定模块还设置为在设备中设置的MTU值为最大MTU值的情况下,下行链路是不连通的情况下,确定比最大MTU值小第一预定值的第一MTU值;判断在设备中设置的MTU值为第一MTU值的情况下,下行链路是否是连通的;以及在判断结果为下行链路是连通的情况下,通过以下方式,确定最小MTU值:判断在设备中设置的MTU值为最大MTU值与第一MTU值之间的第一中间值的情况下,下行链路是否是连通的;在判断结果为在设备中设置的MTU值为最大MTU值与第一MTU值之间的第一中间值的情况下,下行链路是连通的情况下,继续判断在设备中设置的MTU值为第一中间值与最大MTU值之间的第二中间值的情况下,下行链路是否是连通的;重复执行上述取中间值的判断过程,直到前一次判断结果为下行链路是连通的对应的中间值与后一次判断结果为下行链路不联通对应的中间值之间的差小于第二预定值的情况下,确定前一次判断结果为下行链路是连通的对应的中间值为最小MTU值。In the embodiment of the present invention, the determining module is further configured to determine, when the MTU value set in the device is the maximum MTU value, that the downlink is not connected, and determine the first predetermined value that is smaller than the maximum MTU value. The MTU value is determined whether the downlink is connected if the MTU value set in the device is the first MTU value, and the minimum MTU value is determined by the following manner when the determination result is that the downlink is connected. : determining whether the downlink is connected if the MTU value set in the device is the first intermediate value between the maximum MTU value and the first MTU value; and determining that the MTU value set in the device is the largest In the case of the first intermediate value between the MTU value and the first MTU value, if the downlink is connected, it continues to determine that the MTU value set in the device is the second between the first intermediate value and the maximum MTU value. In the case of the intermediate value, whether the downlink is connected; the above-mentioned determination process of the intermediate value is repeatedly performed until the previous judgment result is that the downlink is connected to the corresponding intermediate value and the latter judgment result is that the downlink is not Unicom If the difference between the intermediate value should be less than a second predetermined value, a determination result is determined before the downlink communication with a corresponding intermediate value minimum MTU value.

在本发明实施例中,确定模块还设置为在判断结果为下行链路是不连通的情况下,继续确定比第一MTU值小第三预定值的第三MTU值,以及继续判断在第三MTU值的情况下,下行链路是否是连通的,重复执行上述取第三MTU值以及判断下行链路是否连通的过程,直到判断结果为下行链路是连通的,将第一MTU值作为最大MTU值,采用上述在判断结果为下行链路是连通的情况下,确定最小MTU值的方式确定最小MTU值。In the embodiment of the present invention, the determining module is further configured to continue to determine a third MTU value that is smaller than the first MTU value by a third predetermined value, and continue to determine the third, if the determination result is that the downlink is not connected. In the case of the MTU value, whether the downlink is connected, repeating the above process of taking the third MTU value and determining whether the downlink is connected, until the result of the determination is that the downlink is connected, and the first MTU value is maximized. The MTU value determines the minimum MTU value by determining the minimum MTU value in the case where the determination result is that the downlink is connected.

在本发明实施例中,确定模块还设置为检测与服务器交互的下行报文;判断下行报文中最大的下行报文长度是否为第二中间值;以及检测在预定时间内是否收到文本内容传输完毕的结束标识;其中,在最大的下行报文长度为第二中间值,且在预定时间内收到结束标识的情况下,确定下行链路连通。 In the embodiment of the present invention, the determining module is further configured to: detect a downlink packet that interacts with the server; determine whether a maximum downlink packet length in the downlink packet is a second intermediate value; and detect whether the text content is received within a predetermined time. The end identifier of the transmission completion; wherein, when the maximum downlink packet length is the second intermediate value, and the end identifier is received within the predetermined time, the downlink connectivity is determined.

根据本发明的另一个实施例,提供了一种设备,包括上述的最大传输单元值的设置装置。According to another embodiment of the present invention, there is provided an apparatus comprising the above-described setting means for the maximum transmission unit value.

根据本发明的又一个实施例,还提供了一种存储介质。该存储介质设置为存储用于执行以下步骤的程序代码:接收用于指示设备开机联网的指令;确定设备与服务器之间的下行链路中的最小最大传输单元MTU值;将确定的最小MTU值设置在设备中。According to still another embodiment of the present invention, a storage medium is also provided. The storage medium is configured to store program code for performing the steps of: receiving an instruction to indicate that the device is powered on; determining a minimum maximum transmission unit MTU value in the downlink between the device and the server; determining a minimum MTU value Set in the device.

通过本发明,由于在接收到用于指示设备开机联网的指令后,确定下行链路中的最小MTU,将确定的最小MTU值设置在设备中,即通过自动检测下行链路中的最小MTU值,与现有技术中通过探测上行连路由的网络节点的最小MTU值相比,不再出现下行链路网络节点MTU检测不到的情况下,进而使得确定的下行链路的MTU更加准确,进而能够接收到服务器发送的大数据报文的问题,进而可以解决相关技术中下行链路网络节点MTU值探测不到导致无法接收到服务器发送的大数据报文的问题。With the present invention, since the minimum MTU in the downlink is determined after receiving an instruction for instructing the device to be powered on, the determined minimum MTU value is set in the device, that is, by automatically detecting the minimum MTU value in the downlink. Compared with the minimum MTU value of the network node that detects the uplink route in the prior art, the downlink network node MTU is no longer detected, and the determined downlink MTU is more accurate. The problem that the big data packet sent by the server can be received can solve the problem that the MTU value of the downlink network node cannot be detected and the big data packet sent by the server cannot be received.

附图说明DRAWINGS

此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:

图1是本发明实施例的一种最大传输单元值的设置方法的移动终端的硬件结构框图;1 is a block diagram showing the hardware structure of a mobile terminal for setting a maximum transmission unit value according to an embodiment of the present invention;

图2是根据本发明实施例提供的网络架构的结构框图;2 is a structural block diagram of a network architecture according to an embodiment of the present invention;

图3是根据本发明实施例的最大传输单元值的设置方法的流程图;3 is a flowchart of a method of setting a maximum transmission unit value according to an embodiment of the present invention;

图4是根据本发明优选实施例提供的确定MTU值的方法的流程示意图;4 is a schematic flow chart of a method for determining an MTU value according to a preferred embodiment of the present invention;

图5是根据本发明实施例的最大传输单元值的设置装置的结构框图;FIG. 5 is a structural block diagram of a setting device for a maximum transmission unit value according to an embodiment of the present invention; FIG.

图6是根据本发明优选实施例提供的初始化模块执行的步骤的示意图;6 is a schematic diagram of steps performed by an initialization module according to a preferred embodiment of the present invention;

图7是根据本发明优选实施例提供的MTU值配置模块执行的步骤的 示意图;7 is a step performed by an MTU value configuration module according to a preferred embodiment of the present invention. schematic diagram;

图8是根据本发明优选实施例提供的连接服务器模块执行的步骤的示意图;FIG. 8 is a schematic diagram of steps performed by a connection server module according to a preferred embodiment of the present invention; FIG.

图9是根据本发明优选实施例提供的下行报文监测MTU计算模块执行的步骤的示意图。FIG. 9 is a schematic diagram of steps performed by a downlink message monitoring MTU calculation module according to a preferred embodiment of the present invention.

具体实施方式detailed description

下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It is to be understood that the terms "first", "second" and the like in the specification and claims of the present invention are used to distinguish similar objects, and are not necessarily used to describe a particular order or order.

实施例1Example 1

本申请实施例1所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本发明实施例的一种最大传输单元值的设置方法的移动终端的硬件结构框图。如图1所示,移动终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器(Microcontroller Unit,简称MCU)或可编程逻辑器件(Field Programmable Gate Array,简称FPGA)等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输装置106。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,移动终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided by Embodiment 1 of the present application can be executed in a mobile terminal, a computer terminal or the like. Taking a mobile terminal as an example, FIG. 1 is a hardware structural block diagram of a mobile terminal for setting a maximum transmission unit value according to an embodiment of the present invention. As shown in FIG. 1, the mobile terminal 10 may include one or more (only one shown) processor 102 (the processor 102 may include, but is not limited to, a Microcontroller Unit (MCU) or a programmable logic device. A processing device such as a Field Programmable Gate Array (FPGA), a memory 104 for storing data, and a transmission device 106 for a communication function. It will be understood by those skilled in the art that the structure shown in FIG. 1 is merely illustrative and does not limit the structure of the above electronic device. For example, the mobile terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.

存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的最大传输单元值的设置方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还 可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store software programs and modules of the application software, such as program instructions/modules corresponding to the setting method of the maximum transmission unit value in the embodiment of the present invention, and the processor 102 runs the software programs and modules stored in the memory 104. Thereby performing various functional applications and data processing, that is, implementing the above method. The memory 104 can include a high speed random access memory, Non-volatile memory can be included, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, memory 104 may further include memory remotely located relative to processor 102, which may be connected to mobile terminal 10 over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。Transmission device 106 is for receiving or transmitting data via a network. The above-described network specific example may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.

本申请实施例可以运行于图2所示的网络架构上,如图2所示,该网络架构包括:设备和服务器,其中,设备和服务器之间进行交互。The embodiment of the present application can be run on the network architecture shown in FIG. 2, as shown in FIG. 2, the network architecture includes: a device and a server, where the device and the server interact with each other.

在本实施例中提供了一种运行于上述移动终端或网络架构的最大传输单元值的设置方法,图3是根据本发明实施例的最大传输单元值的设置方法的流程图,如图3所示,该流程包括如下步骤:In this embodiment, a method for setting a maximum transmission unit value of the mobile terminal or the network architecture is provided. FIG. 3 is a flowchart of a method for setting a maximum transmission unit value according to an embodiment of the present invention, as shown in FIG. The process includes the following steps:

步骤S302,接收用于指示设备开机联网的指令;Step S302, receiving an instruction for instructing the device to start networking;

步骤S304,确定设备与服务器之间的下行链路中的最小最大传输单元MTU值;Step S304, determining a minimum maximum transmission unit MTU value in a downlink between the device and the server;

步骤S306,将确定的最小MTU值设置在设备中。Step S306, setting the determined minimum MTU value in the device.

通过上述步骤,由于在接收到用于指示设备开机联网的指令后,确定下行链路中的最小MTU,将确定的最小MTU值设置在设备中,即通过自动检测下行链路中的最小MTU值,与现有技术中通过探测上行连路由的网络节点的最小MTU值相比,不再出现下行链路网络节点MTU检测不到的情况下,进而使得确定的下行链路的最小MTU更加准确,进而能够接收到服务器发送的大数据报文的问题,进而可以解决相关技术中下行链路网络节点MTU值探测不到导致无法接收到服务器发送的大数据报文的 问题。Through the above steps, since the minimum MTU in the downlink is determined after receiving the instruction for instructing the device to start networking, the determined minimum MTU value is set in the device, that is, by automatically detecting the minimum MTU value in the downlink. Compared with the minimum MTU value of the network node that detects the uplink route in the prior art, the downlink network node MTU is no longer detected, and the minimum MTU of the determined downlink is more accurate. The problem of the big data packet sent by the server can be received, and the MTU value of the downlink network node cannot be detected, and the big data packet sent by the server cannot be received. problem.

需要说明的是,上述下行链路中的每一个网络节点都有一个允许的最小MTU值,这些最小MTU值中的最大的MTU值即为上述下行链路中的最小MTU值;即上述最小MTU值为能够通过下行链路中的所有网络节点的报文的最大的报文长度。It should be noted that each of the foregoing network nodes has an allowed minimum MTU value, and the largest MTU value among the minimum MTU values is the minimum MTU value in the downlink; that is, the minimum MTU. The value is the maximum message length of a message that can pass through all network nodes in the downlink.

在本发明的一个实施例中,上述步骤S304可以表现为通过传输控制协议TCP确定最小MTU值。与相关技术中通过ICMP协议上行发送大报文给服务器,探测网络节点中最小的MTU值相比,通过TCP协议实现下行链路的最小MTU值的确定。In an embodiment of the present invention, the above step S304 may be performed to determine a minimum MTU value by using a transmission control protocol TCP. Compared with the related art, the uplink MTU value is sent to the server through the ICMP protocol to detect the minimum MTU value in the network node, and the minimum MTU value of the downlink is determined by using the TCP protocol.

具体地,通过TCP确定最小MTU值可以表现为:确定设备允许设置的最大MTU值;获取服务器的与最大MTU值对应的文本内容;其中,服务器与设备之间建立有TCP连接;判断在设备中设置的MTU值为最大MTU值的情况下,下行链路是否是连通的;在判断结果为是的情况下,确定允许设置的最大MTU值为最小MTU值。Specifically, determining the minimum MTU value by using the TCP may be performed by: determining a maximum MTU value that the device is allowed to set; acquiring text content corresponding to the maximum MTU value of the server; wherein the server establishes a TCP connection with the device; determining in the device If the set MTU value is the maximum MTU value, whether the downlink is connected; if the judgment result is yes, it is determined that the maximum MTU value that is allowed to be set is the minimum MTU value.

需要说明的是,判断在设备中设置的MTU值为最大MTU值的情况下,下行链路是否是连通的,可以表现为:检测与服务器交互的下行报文;判断下行报文中最大的下行报文长度是否为最大MTU值;检测在预定时间内是否收到文本内容传输完毕的结束标识;其中,在最大的下行报文长度为最大MTU值,且在预定时间内收到结束标识的情况下,确定在设备中设置的MTU值为最大MTU的情况下,下行链路连通。即如果设备允许设置的最大MTU值能够使得下行链路是连通的,可以直接确定下行链路的最小MTU值(最终MTU值)为上述允许设置的MTU值。It should be noted that, in the case that the MTU value set in the device is the maximum MTU value, whether the downlink is connected may be: detecting a downlink packet that interacts with the server; and determining a maximum downlink in the downlink packet. Whether the length of the packet is the maximum MTU value; whether the end identifier of the text content transmission is received within a predetermined time; wherein the maximum downlink packet length is the maximum MTU value, and the end identifier is received within the predetermined time. Next, when it is determined that the MTU value set in the device is the maximum MTU, the downlink is connected. That is, if the maximum MTU value allowed by the device enables the downlink to be connected, it can directly determine that the minimum MTU value (final MTU value) of the downlink is the above-prepared MTU value.

需要说明的是,上述结束标识可以是http/1.xOK关键字段,但并不限于此。It should be noted that the foregoing end identifier may be an http/1.xOK key field, but is not limited thereto.

需要说明的是,在预定时间内如果没有收到上述结束标识和/或上行数据包确认(Acknowledgement,简称ACK)消息,则下行链路中最小MTU值应当比上述最大MTU值小,需要进一步确定,因而,在本发明的一个 实施例中,在判断在设备中设置的MTU值为最大MTU值的情况下,下行链路是否是连通的之后,上述方法还可以包括:在设备中设置的MTU值为最大MTU值的情况下,下行链路是不连通的情况下,确定比最大MTU值小第一预定值的第一MTU值;判断在设备中设置的MTU值为第一MTU值的情况下,下行链路是否是连通的;在判断结果为下行链路是连通的情况下,通过以下方式,确定最小MTU值:判断在设备中设置的MTU值为最大MTU值与第一MTU值之间的第一中间值的情况下,下行链路是否是连通的;在判断结果为在最大MTU值与第一MTU值之间的第一中间值的情况下,下行链路是连通的情况下,继续判断在设备中设置的MTU值为第一中间值与最大MTU值之间的第二中间值的情况下,下行链路是否是连通的;重复执行上述取中间值的判断过程,直到前一次判断结果为下行链路是连通的对应的中间值与后一次判断结果为下行链路不连通对应的中间值之间的差小于第二预定值的情况下,确定前一次判断结果为下行链路是连通的对应的中间值为最小MTU值。It should be noted that if the end identifier and/or the acknowledgment (ACK) message are not received within the predetermined time, the minimum MTU value in the downlink should be smaller than the maximum MTU value, and further determination is needed. And thus, in the present invention In the embodiment, after determining whether the MTU value set in the device is the maximum MTU value, whether the downlink is connected, the method may further include: if the MTU value set in the device is the maximum MTU value, If the downlink is not connected, determine a first MTU value that is smaller than a maximum MTU value by a first predetermined value; and determine whether the downlink is connected if the MTU value set in the device is the first MTU value. When the judgment result is that the downlink is connected, the minimum MTU value is determined by determining that the MTU value set in the device is the first intermediate value between the maximum MTU value and the first MTU value. If the downlink is connected, if the downlink is connected, if the downlink is connected, the continuation is determined in the device. If the MTU value is the second intermediate value between the first intermediate value and the maximum MTU value, whether the downlink is connected; repeating the above-mentioned determination process of taking the intermediate value until the previous judgment result is that the downlink is Connected In the case where the difference between the intermediate value and the intermediate value corresponding to the next determination result that the downlink disconnection is less than the second predetermined value, it is determined that the previous intermediate result is that the downlink is connected and the corresponding intermediate value is the smallest. MTU value.

需要说明的是,上述第一中间值可以是最大MTU值与第一MTU值之间的任意一个值,优选地,可以是最大MTU值与第一MTU值的的平均值,但并不限于此,同样,第二中间值可以是第一中间值与最大MTU值之间的任意一个值,也可以是最大MTU值与第一中间值的的平均值,但并不限于此。前一次判断结果为下行链路是连通的对应的中间值与后一次判断结果为下行链路不连通对应的中间值之间的差小于第二预定值的情况下,确定前一次判断结果为下行链路是连通的对应的中间值为最小MTU值举例说明:假设在MTU值为9时,判断结果为下行链路是连通的,而在MTU值为10时下行链路不连通,则可以确定最小MTU值为9,上述MTU值为9可以认为是前一次判断结果为下行链路是连通的对应的中间值,上述MTU值为10可以认为是后一次判断结果为下行链路不连通对应的中间值,该第二预定值可以设定为2。It should be noted that the foregoing first intermediate value may be any value between the maximum MTU value and the first MTU value, and may be an average value of the maximum MTU value and the first MTU value, but is not limited thereto. Similarly, the second intermediate value may be any value between the first intermediate value and the maximum MTU value, or may be an average value of the maximum MTU value and the first intermediate value, but is not limited thereto. In the case where the previous judgment result is that the difference between the corresponding intermediate value in which the downlink is connected and the intermediate value corresponding to the downlink disconnection in the latter judgment result is smaller than the second predetermined value, it is determined that the previous judgment result is the downlink. The corresponding intermediate value of the link is the minimum MTU value. For example, if the MTU value is 9, the judgment result is that the downlink is connected, and when the MTU value is 10, the downlink is not connected, then it can be determined. The minimum MTU value is 9. The MTU value of 9 is considered to be the corresponding intermediate value of the previous judgment result that the downlink is connected. The MTU value of 10 can be regarded as the result of the subsequent judgment being that the downlink is not connected. The intermediate value, the second predetermined value can be set to 2.

需要说明的是,判断在设备中设置的MTU值为第一中间值与最大MTU值之间的第二中间值的情况下,下行链路是否是连通的可以包括: 检测与服务器交互的下行报文;判断下行报文中最大的下行报文长度是否为第二中间值;检测在预定时间内是否收到文本内容传输完毕的结束标识;其中,在最大的下行报文长度为第二中间值,且在预定时间内收到结束标识的情况下,确定下行链路连通。It should be noted that, if it is determined that the MTU value set in the device is the second intermediate value between the first intermediate value and the maximum MTU value, whether the downlink is connected may include: Detecting a downlink packet that interacts with the server; determining whether the maximum downlink packet length in the downlink packet is the second intermediate value; detecting whether the end identifier of the text content transmission is received within a predetermined time; wherein, the largest downlink packet is received The length of the text is the second intermediate value, and in the case where the end identifier is received within a predetermined time, the downlink connectivity is determined.

在本发明的一个实施例中,在判断在设备中设置的MTU值为第一MTU值的情况下,下行链路是否是连通的之后,还包括:在判断结果为下行链路是不连通的情况下,继续确定比第一MTU值小第三预定值的第三MTU值,以及继续判断在设备中设置的MTU值为第三MTU值的情况下,下行链路是否是连通的,重复执行上述取第三MTU值以及判断下行链路是否连通的过程,直到判断结果为下行链路是连通的,将第一MTU值作为最大MTU值,采用上述在判断结果为下行链路是连通的情况下,确定最小MTU值的方式确定最小MTU值。In an embodiment of the present invention, after determining whether the MTU value set in the device is the first MTU value, whether the downlink is connected, the method further includes: determining that the downlink is disconnected In case, if the third MTU value that is smaller than the first MTU value by the third predetermined value is continuously determined, and if the MTU value set in the device is further determined to be the third MTU value, whether the downlink is connected, and the execution is repeated. The process of taking the third MTU value and determining whether the downlink is connected, until the result of the determination is that the downlink is connected, and the first MTU value is used as the maximum MTU value, and the foregoing is determined to be that the downlink is connected. Next, the way to determine the minimum MTU value determines the minimum MTU value.

需要说明的是,上述第一预定值、上述第二预定值和第三预定值可以是根据实际情况进行确定,但并不限于此。It should be noted that the first predetermined value, the second predetermined value, and the third predetermined value may be determined according to actual conditions, but are not limited thereto.

需要说明的是,在上述每次判断下行链路是否是连通的之前,上述方法还可以包括:获取服务器的文本内容;即在每次MTU值下,需要重新进行TCP连接。需要说明的是,上述获取服务器的文本内容,可以通过wget命令来获取,但并不限于此。It should be noted that, before the foregoing determining whether the downlink is connected, the foregoing method may further include: acquiring text content of the server; that is, each time the MTU value is required, the TCP connection needs to be re-established. It should be noted that the text content of the foregoing obtaining server may be obtained by using a wget command, but is not limited thereto.

通过上述方法确定最小MTU值,提高了最小MTU值的确定速度,也提高了确定下行链路的最小MTU值的准确度。The minimum MTU value is determined by the above method, the determination speed of the minimum MTU value is improved, and the accuracy of determining the minimum MTU value of the downlink is also improved.

需要说明的是,上述步骤的执行主体可以为终端,也可以是路由器等,但不限于此。It should be noted that the execution body of the above steps may be a terminal, a router, or the like, but is not limited thereto.

为了更好地理解本发明以下结合优选的实施例对本发明做进一步地解释。For a better understanding of the invention, the invention will be further explained below in conjunction with preferred embodiments.

本发明优选实施例提出的一种基于TCP协议的自动检测网络MTU值的方法,设备(比如路由器)开机联网后,与默认配置的服务器连接,通过wget命令获取默认服务器文本内容,设备检测与服务器连接的下行报 文大小、是否收到服务器发送的报文、并根据HTTP/1.x OK关键字段判断该连接是否结束三个条件来探测网络节点最小MTU值。默认配置的服务器地址可以由用户改变成实际上网的网址,可以检测当前配置的网址是否是MTU不对导致打不开的。图4是根据本发明优选实施例提供的确定MTU值的方法的流程示意图,如图4所示,该方法包括:A method for automatically detecting a network MTU value based on a TCP protocol, which is provided by a preferred embodiment of the present invention. After a device (such as a router) is powered on, it is connected to a server configured by default, and obtains a default server text content by using the wget command, and the device detects the server. Connected downgrade The size of the file, whether it receives the message sent by the server, and judges whether the connection ends three conditions according to the HTTP/1.x OK key field to detect the minimum MTU value of the network node. The default configured server address can be changed by the user to the actual web address, and it can be detected whether the currently configured web address is not correct due to the MTU. 4 is a schematic flowchart of a method for determining an MTU value according to a preferred embodiment of the present invention. As shown in FIG. 4, the method includes:

第一步,配置路由器MTU初始值MTU0。MTU0足够小,保证MTU0大小的报文可以通过所有网络节点;配置默认服务器地址。用户可以在webui上修改服务器地址。The first step is to configure the router MTU initial value MTU0. MTU0 is small enough to ensure that MTU0 packets can pass through all network nodes; configure the default server address. Users can modify the server address on webui.

第二步,路由器开机第一次联网后,路由器通过wget命令获取服务器的文本内容。In the second step, after the router is powered on for the first time, the router obtains the text content of the server through the wget command.

第三步,检测MTU0大小的报文是否可以通过所有网络节点,即检测MTU0时,下行链路是否是连通的,如果是连通的,则执行第四步,如果不连通,则网络不通:路由器监测与服务器交互的下行报文,如果最大的下行报文长度为MTU0,并且收到HTTP/1.x OK关键字段。说明路由器与服务器链路是通的。如果在TCP超时时间内没有收到HTTP/1.x OK关键字段,说明网络不通,不是MTU值不对导致的,而是其他原因导致的网络不通。In the third step, it is detected whether the MTU0 packet can pass through all the network nodes, that is, when the MTU0 is detected, whether the downlink is connected, and if it is connected, the fourth step is performed. If not, the network is unreachable: the router Monitor the downlink packets that interact with the server. If the maximum downlink packet length is MTU0, the HTTP/1.x OK key field is received. Explain that the router is connected to the server link. If the HTTP/1.x OK key field is not received within the TCP timeout period, the network is unreachable, and the MTU is not correct. The network is unreasonable due to other reasons.

第四步,检测1500大小报文是否可以通过所有网络节点,如果是,则配置路由器最终MTU为1500,如果不是,则通过折半查找法,查找MTU0~1500范围内的最终MTU值:重新设置路由器MTU值为最大值1500。路由器重新监测与服务器交互的下行报文,如果最大的下行报文长度为1500,并收到HTTP/1.x OK关键字段,说明路由器最终MTU值可以设置为1500。如果在TCP超时时间内没有收到HTTP/1.x OK字段或者上行数据包ACK确认消息,说明下行网络链路节点中最小的MTU值在MTU0~1500范围之间。The fourth step is to detect whether the 1500 size packet can pass through all network nodes. If yes, configure the router to have a final MTU of 1500. If not, find the final MTU value in the range of MTU0-1500 by the binary search method: reset the router. The MTU value is a maximum of 1500. The router re-monitoring the downlink packets that interact with the server. If the maximum downlink packet length is 1500 and the HTTP/1.x OK key field is received, the final MTU value of the router can be set to 1500. If the HTTP/1.x OK field or the uplink packet ACK acknowledgment message is not received within the TCP timeout period, the minimum MTU value in the downlink network link node is between MTU0 and 1500.

第五步,通过折半查找法,查找MTU0~1500范围内的最终MTU值,如果下行链路所有网络节点最小MTU在MTU0~1500范围内,然后使用折半查找法,查找下行链路所有网络节点最小MTU值。首先设置路由器 MTU为

Figure PCTCN2016108027-appb-000001
然后使用wget命令获取服务器文本内容,如果在监测的下行报文中,如果最大的下行报文长度为
Figure PCTCN2016108027-appb-000002
并收到HTTP/1.x OK关键字段,重新检测MTU为
Figure PCTCN2016108027-appb-000003
值,如果在TCP超时时间内没有收到HTTP/1.x OK字段或者上行数据包ACK确认消息,重新检测MTU为
Figure PCTCN2016108027-appb-000004
值,按照折半查找法规则依次轮寻查找……。The fifth step is to find the final MTU value in the range of MTU0-1500 by the binary search method. If the minimum MTU of all network nodes in the downlink is in the range of MTU0-1500, then use the binary search method to find the minimum network node of the downlink. MTU value. First set the router MTU to
Figure PCTCN2016108027-appb-000001
Then use the wget command to obtain the content of the server text. If the maximum downlink packet length is in the monitored downlink packet,
Figure PCTCN2016108027-appb-000002
And receive the HTTP/1.x OK key field and re-detect the MTU
Figure PCTCN2016108027-appb-000003
Value, if the HTTP/1.x OK field or the upstream packet ACK acknowledgment message is not received within the TCP timeout period, the MTU is re-detected.
Figure PCTCN2016108027-appb-000004
The value is searched in turn according to the rules of the half-find method.

第六步,将折半查找法最终查找处的MTU1值设置到路由器中,下次开机第一次拨号后按照第一步,重新查找下行链路中最小MTU值。In the sixth step, the MTU1 value at the final search point of the binary search method is set to the router, and the first time after the first power-on, the first step is to search for the minimum MTU value in the downlink.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

实施例2Example 2

在本实施例中还提供了一种最大传输单元值的设置装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a device for setting a maximum transmission unit value is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and the description thereof has been omitted. As used below, the term "module" may implement a combination of software and/or hardware of a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.

图5是根据本发明实施例的最大传输单元值的设置装置的结构框图,如图5所示,该装置包括:FIG. 5 is a structural block diagram of a device for setting a maximum transmission unit value according to an embodiment of the present invention. As shown in FIG. 5, the device includes:

接收模块52,设置为接收用于指示设备开机联网的指令;The receiving module 52 is configured to receive an instruction for instructing the device to be powered on;

确定模块54,与上述接收模块52连接,设置为确定设备与服务器之间的下行链路中的最小最大传输单元MTU值;The determining module 54 is connected to the receiving module 52, and is configured to determine a minimum and maximum transmission unit MTU value in a downlink between the device and the server;

设置模块56,与上述确定模块54连接,设置为将确定的最小MTU 值设置在设备中。The setting module 56 is connected to the determining module 54 and configured to set the minimum MTU. The value is set in the device.

通过上述装置,由于接收模块52在接收到设置为指示设备开机联网的指令后,确定模块54确定下行链路中的最小MTU,设置模块56将确定的最小MTU值设置在设备中,即通过自动检测下行链路中的最小MTU值,与现有技术中通过探测上行连路由的网络节点的最小MTU值相比,不再出现下行链路网络节点MTU检测不到的情况下,进而使得确定的下行链路的最小MTU更加准确,进而能够接收到服务器发送的大数据报文的问题,进而可以解决相关技术中下行链路网络节点MTU值探测不到导致无法接收到服务器发送的大数据报文的问题。Through the above device, since the receiving module 52 receives the instruction set to indicate that the device is powered on, the determining module 54 determines the minimum MTU in the downlink, and the setting module 56 sets the determined minimum MTU value in the device, that is, through the automatic Detecting the minimum MTU value in the downlink, compared with the minimum MTU value of the network node that detects the uplink route in the prior art, the downlink network node MTU is no longer detected, and thus the determined The minimum MTU of the downlink is more accurate, and the problem of the big data packet sent by the server can be received, and the big data packet sent by the server cannot be received by the MTU of the downlink network node in the related art. The problem.

需要说明的是,上述下行链路中的每一个网络节点都有一个允许的最小MTU值,这些最小MTU值中的最大的MTU值即为上述下行链路中的最小MTU值;即上述最小MTU值为能够通过下行链路中的所有网络节点的报文的最大的报文长度。It should be noted that each of the foregoing network nodes has an allowed minimum MTU value, and the largest MTU value among the minimum MTU values is the minimum MTU value in the downlink; that is, the minimum MTU. The value is the maximum message length of a message that can pass through all network nodes in the downlink.

在本发明的一个实施例中,上述确定模块54还可以设置为通过传输控制协议TCP确定最小MTU值。与相关技术中通过ICMP协议上行发送大报文给服务器,探测网络节点中最小的MTU值相比,通过TCP协议实现下行链路的最小MTU值的确定。In an embodiment of the present invention, the determining module 54 may be further configured to determine a minimum MTU value by using a Transmission Control Protocol (TCP). Compared with the related art, the uplink MTU value is sent to the server through the ICMP protocol to detect the minimum MTU value in the network node, and the minimum MTU value of the downlink is determined by using the TCP protocol.

在本发明的一个实施例中,上述确定模块54还设置为确定设备允许设置的最大MTU值;获取服务器的与最大MTU值对应的文本内容;其中,服务器与设备之间建立有TCP连接;判断在设备中设置的MTU值为最大MTU值的情况下,下行链路是否是连通的;以及在判断结果为是的情况下,确定允许设置的最大MTU值为最小MTU值。In an embodiment of the present invention, the determining module 54 is further configured to determine a maximum MTU value that the device is allowed to set; obtain text content corresponding to the maximum MTU value of the server; wherein the server establishes a TCP connection with the device; If the MTU value set in the device is the maximum MTU value, whether the downlink is connected; and if the judgment result is yes, it is determined that the maximum MTU value allowed to be set is the minimum MTU value.

需要说明的是,判断在设备中设置的MTU值为最大MTU值的情况下,下行链路是否是连通的,可以表现为:检测与服务器交互的下行报文;判断下行报文中最大的下行报文长度是否为最大MTU值;检测在预定时间内是否收到文本内容传输完毕的结束标识;其中,在最大的下行报文长度为最大MTU值,且在预定时间内收到结束标识的情况下,确定在设备 中设置的MTU值为最大MTU的情况下,下行链路连通。即如果设备允许设置的最大MTU值能够使得下行链路是连通那个的,可以直接确定下行链路的最小MTU值(最终MTU值)为上述允许设置的MTU值。It should be noted that, in the case that the MTU value set in the device is the maximum MTU value, whether the downlink is connected may be: detecting a downlink packet that interacts with the server; and determining a maximum downlink in the downlink packet. Whether the length of the packet is the maximum MTU value; whether the end identifier of the text content transmission is received within a predetermined time; wherein the maximum downlink packet length is the maximum MTU value, and the end identifier is received within the predetermined time. Next, determine the device In the case where the MTU value set in the middle is the maximum MTU, the downlink is connected. That is, if the maximum MTU value allowed by the device enables the downlink to be connected to that one, it can directly determine that the minimum MTU value (final MTU value) of the downlink is the above-mentioned allowable MTU value.

需要说明的是,在预定时间内如果没有收到文本内容传输完毕的结束标识和/或上行数据包ACK确认消息,则下行链路中最小MTU值应当比上述最大MTU值小,需要进一步确定,因而,在本发明的一个实施例中,上述确定模块54还可以设置为在设备中设置的MTU值为最大MTU值的情况下,下行链路是不连通的情况下,确定比最大MTU值小第一预定值的第一MTU值;判断在设备中设置的MTU值为第一MTU值的情况下,下行链路是否是连通的;以及在判断结果为下行链路是连通的情况下,通过以下方式,确定最小MTU值:判断在设备中设置的MTU值为最大MTU值与第一MTU值之间的第一中间值的情况下,下行链路是否是连通的;在判断结果为在设备中设置的MTU值为最大MTU值与第一MTU值之间的第一中间值的情况下,下行链路是连通的情况下,继续判断在设备中设置的MTU值为第一中间值与最大MTU值之间的第二中间值的情况下,下行链路是否是连通的;重复执行上述取中间值的判断过程,直到前一次判断结果为下行链路是连通的对应的中间值与后一次判断结果为下行链路不联通对应的中间值之间的差小于第二预定值的情况下,确定前一次判断结果为下行链路是连通的对应的中间值为最小MTU值。It should be noted that if the end identifier of the text content transmission and/or the uplink packet ACK acknowledgement message are not received within the predetermined time, the minimum MTU value in the downlink should be smaller than the maximum MTU value, and further determination is needed. Therefore, in an embodiment of the present invention, the determining module 54 may be further configured to determine that the MTU value set in the device is the maximum MTU value, and if the downlink is not connected, determine that the MTU value is smaller than the maximum MTU value. a first MTU value of the first predetermined value; determining whether the downlink is connected if the MTU value set in the device is the first MTU value; and in the case where the determination result is that the downlink is connected, In the following manner, determining a minimum MTU value: determining whether the downlink is connected if the MTU value set in the device is the first intermediate value between the maximum MTU value and the first MTU value; If the MTU value set in the value is the first intermediate value between the maximum MTU value and the first MTU value, if the downlink is connected, continue to determine that the MTU value set in the device is the first intermediate value. In the case of the second intermediate value between the maximum MTU values, whether the downlink is connected; repeating the above-mentioned determination process of taking the intermediate value until the previous judgment result is that the downlink is connected to the corresponding intermediate value and after In a case where the result of the determination is that the difference between the intermediate values corresponding to the downlink non-coupling is less than the second predetermined value, the corresponding intermediate value of the previous determination result that the downlink is connected is determined to be the minimum MTU value.

需要说明的是,上述第一中间值可以是最大MTU值与第一MTU值之间的任意一个值,优选地,可以是最大MTU值与第一MTU值的的平均值,但并不限于此,同样,第二中间值可以是第一中间值与最大MTU值之间的任意一个值,也可以是最大MTU值与第一中间值的的平均值,但并不限于此。It should be noted that the foregoing first intermediate value may be any value between the maximum MTU value and the first MTU value, and may be an average value of the maximum MTU value and the first MTU value, but is not limited thereto. Similarly, the second intermediate value may be any value between the first intermediate value and the maximum MTU value, or may be an average value of the maximum MTU value and the first intermediate value, but is not limited thereto.

需要说明的是,判断在设备中设置的MTU值为第一中间值与最大MTU值之间的第二中间值的情况下,下行链路是否是连通的可以包括:检测与服务器交互的下行报文;判断下行报文中最大的下行报文长度是否为第二中间值;检测在预定时间内是否收到文本内容传输完毕的结束标识; 其中,在最大的下行报文长度为第二中间值,且在预定时间内收到文本内容传输完毕的结束标识的情况下,确定下行链路连通。It should be noted that, if it is determined that the MTU value set in the device is the second intermediate value between the first intermediate value and the maximum MTU value, whether the downlink is connected may include: detecting a downlink report interacting with the server. Determining whether the maximum downlink packet length in the downlink packet is the second intermediate value; detecting whether the end identifier of the text content transmission is received within the predetermined time; The downlink connection is determined when the maximum downlink packet length is the second intermediate value and the end identifier of the text content transmission is received within a predetermined time.

在本发明的一个实施例中,上述确定模块54还可以设置为在判断结果为下行链路是不连通的情况下,继续确定比第一MTU值小第三预定值的第三MTU值,以及继续判断在设备中设置的MTU值为第三MTU值的情况下,下行链路是否是连通的,重复执行上述取第三MTU值以及判断下行链路是否连通的过程,直到判断结果为下行链路是连通的,将第一MTU值作为最大MTU值,采用上述在判断结果为下行链路是连通的情况下,确定最小MTU值的方式确定最小MTU值。In an embodiment of the present invention, the determining module 54 may further be configured to continue to determine a third MTU value that is smaller than the first MTU value by a third predetermined value if the determination result is that the downlink is not connected, and Continuing to determine whether the downlink is connected when the MTU value set in the device is the third MTU value, and repeatedly performing the above process of taking the third MTU value and determining whether the downlink is connected, until the judgment result is downlink. The path is connected, and the first MTU value is used as the maximum MTU value. The minimum MTU value is determined by determining the minimum MTU value in the case where the determination result is that the downlink is connected.

上述确定模块54还设置为检测与服务器交互的下行报文;判断下行报文中最大的下行报文长度是否为第二中间值;以及检测在预定时间内是否收到文本内容传输完毕的结束标识;其中,在最大的下行报文长度为第二中间值,且在预定时间内收到文本内容传输完毕的结束标识的情况下,确定下行链路连通。The determining module 54 is further configured to detect a downlink packet that interacts with the server, determine whether a maximum downlink packet length in the downlink packet is a second intermediate value, and detect whether an end identifier of the text content transmission is received within a predetermined time. Wherein, in a case where the maximum downlink message length is the second intermediate value, and the end identifier of the text content transmission is completed within a predetermined time, the downlink connection is determined.

通过上述装置,提高了最小MTU值的确定速度,也提高了确定下行链路的最小MTU值的准确度。Through the above device, the determination speed of the minimum MTU value is improved, and the accuracy of determining the minimum MTU value of the downlink is also improved.

需要说明的是,上述第一预定值、上述第二预定值和第三预定值可以是根据实际情况进行确定,但并不限于此。It should be noted that the first predetermined value, the second predetermined value, and the third predetermined value may be determined according to actual conditions, but are not limited thereto.

需要说明的是,上述装置可以位于终端中,也可以位于设备中,比如路由器中,但并不限于此。It should be noted that the foregoing device may be located in the terminal, or may be located in the device, such as a router, but is not limited thereto.

为了更好地理解本发明,以下结合优选的实施例对本发明做进一步解释。For a better understanding of the invention, the invention is further explained in conjunction with the preferred embodiments.

本发明优选实施例提出的一种自动检测网络MTU值的装置,通过TCP协议,路由器与服务器连接,使用wget命令获取服务器文本内容,通过监测下行报文大小、是否收到服务器发送的报文、并根据HTTP/1.x OK关键字段判断该连接是否结束三条件,使用折半查找法,查找出下行链路所有网络节点最小MTU值。 The device for automatically detecting the MTU value of the network is provided by the preferred embodiment of the present invention. The router is connected to the server through the TCP protocol, and the wget command is used to obtain the text content of the server, and the size of the downlink packet is monitored, whether the packet sent by the server is received, According to the HTTP/1.x OK key field, it is judged whether the connection ends three conditions, and the half-find search method is used to find the minimum MTU value of all network nodes in the downlink.

上述装置包括初始化模块,MTU值配置模块,连接服务器模块,下行报文监测MTU计算模块。The above device comprises an initialization module, an MTU value configuration module, a connection server module, and a downlink message monitoring MTU calculation module.

图6是根据本发明优选实施例提供的初始化模块执行的步骤的示意图,如图6所示,初始化模块涉及的主要内容是完成路由器启动后,恢复配置默认服务起域名,配置路由器初始MTU值为MTU0。FIG. 6 is a schematic diagram of steps performed by an initialization module according to a preferred embodiment of the present invention. As shown in FIG. 6 , the main content of the initialization module is to restore the configuration default service domain name after the router is started, and configure the initial MTU value of the router. MTU0.

图7是根据本发明优选实施例提供的MTU值配置模块执行的步骤的示意图,如图7所示,MTU值配置模块主要完成由初始化模块和下行报文监测MTU计算模块提供的MTU,配置到路由器中。7 is a schematic diagram of steps performed by an MTU value configuration module according to a preferred embodiment of the present invention. As shown in FIG. 7, the MTU value configuration module mainly completes the MTU provided by the initialization module and the downlink packet monitoring MTU calculation module, and is configured to In the router.

图8是根据本发明优选实施例提供的连接服务器模块执行的步骤的示意图,如图8所示,连接服务器模块的主要内容是完成判断当期设备是否是第一次开机拨号联网,如果是,则通过wget命令连接服务器,并从服务器上获取文本内容,并提供服务器域名对应的IP地址和建立的tcp的源和目的端口给下行报文监测MTU计算模块。FIG. 8 is a schematic diagram of steps performed by a connection server module according to a preferred embodiment of the present invention. As shown in FIG. 8, the main content of the connection server module is to determine whether the current device is the first time for dial-up networking, and if so, Connect to the server through the wget command, and obtain the text content from the server, and provide the IP address corresponding to the server domain name and the source and destination ports of the established tcp to monitor the MTU calculation module for the downlink packet.

图9是根据本发明优选实施例提供的下行报文监测MTU计算模块执行的步骤的示意图,如图9所示,下行报文监测MTU计算模块主要是监测连接服务器模块与服务器建立的tcp连接,通过连接服务器模块提供的服务器域名对应的IP和建立的tcp的源和目的端口,确定需要监测的tcp连接。下行报文监测MTU计算模块通过监测下行报文大小、是否收到服务器发送的报文、并根据HTTP/1.x OK关键字段判断该连接是否结束三条件,判断当前MTU值配置模块配置的MTU是否是最终MTU值。如果是,结束折半查找循环,自动检测结束。如果不是,提供新的需要检测的MTU给MTU值配置模块配置到路由器中,并通知连接服务器模块重新连接服务器并获取服务器上的文本内容。9 is a schematic diagram of steps performed by a downlink message monitoring MTU calculation module according to a preferred embodiment of the present invention. As shown in FIG. 9, the downlink message monitoring MTU calculation module mainly monitors a tcp connection established between a connection server module and a server. The tcp connection to be monitored is determined by connecting the IP corresponding to the server domain name provided by the server module and the source and destination ports of the established tcp. The downlink packet monitoring MTU calculation module determines the configuration of the current MTU value configuration module by monitoring the size of the downlink packet, whether it receives the packet sent by the server, and determining whether the connection is terminated according to the HTTP/1.x OK key field. Whether the MTU is the final MTU value. If it is, the end of the half-find loop is completed and the automatic detection ends. If not, provide a new MTU that needs to be detected to configure the MTU value configuration module into the router, and notify the connection server module to reconnect to the server and obtain the text content on the server.

需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that each of the above modules may be implemented by software or hardware. For the latter, the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the above modules are in any combination. The forms are located in different processors.

实施例3 Example 3

在本实施例中还提供了一种设备,包括上述实施例2中的最大传输单元值的设置装置。需要说明的是,对于上述最大传输单元值的设置装置的解释,参考实施例2中的解释,此处不再赘述。Also provided in the embodiment is an apparatus including the setting means of the maximum transmission unit value in the above embodiment 2. It should be noted that, for the explanation of the above-mentioned setting device of the maximum transmission unit value, refer to the explanation in Embodiment 2, and details are not described herein again.

实施例4Example 4

本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行实施例1中的方法的步骤的程序代码。Embodiments of the present invention also provide a storage medium. Alternatively, in the present embodiment, the above storage medium may be set to store program code for executing the steps of the method in Embodiment 1.

可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory. A variety of media that can store program code, such as a disc or a disc.

可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行实施例1中的方法的步骤。Optionally, in the embodiment, the processor performs the steps of the method in Embodiment 1 according to the stored program code in the storage medium.

可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.

显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.

以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精 神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Where in the essence of the invention Any modifications, equivalent substitutions, improvements, etc. made within the principles of God and the principles are intended to be included within the scope of the present invention.

Claims (13)

一种最大传输单元值的设置方法,包括:A method for setting a maximum transmission unit value, including: 接收用于指示设备开机联网的指令;Receiving an instruction for instructing the device to boot up; 确定所述设备与服务器之间的下行链路中的最小最大传输单元MTU值;Determining a minimum maximum transmission unit MTU value in a downlink between the device and the server; 将确定的所述最小MTU值设置在所述设备中。The determined minimum MTU value is set in the device. 根据权利要求1所述的方法,其中,确定所述设备与所述服务器之间的所述下行链路中的最小MTU值包括:The method of claim 1, wherein determining a minimum MTU value in the downlink between the device and the server comprises: 通过传输控制协议TCP确定所述最小MTU值。The minimum MTU value is determined by a Transmission Control Protocol TCP. 根据权利要求2所述的方法,其中,通过传输控制协议TCP确定所述最小MTU值包括:The method of claim 2, wherein determining the minimum MTU value by the transmission control protocol TCP comprises: 确定所述设备允许设置的最大MTU值;Determining a maximum MTU value that the device is allowed to set; 获取所述服务器的与所述最大MTU值对应的文本内容;其中,所述服务器与所述设备之间建立有TCP连接;Obtaining text content of the server corresponding to the maximum MTU value; wherein a TCP connection is established between the server and the device; 判断在所述设备中设置的MTU值为最大MTU值的情况下,所述下行链路是否是连通的;Determining whether the downlink is connected if the MTU value set in the device is the maximum MTU value; 在判断结果为是的情况下,确定允许设置的所述最大MTU值为所述最小MTU值。In the case where the determination result is YES, it is determined that the maximum MTU value allowed to be set is the minimum MTU value. 根据权利要求3所述的方法,其中,在判断在所述设备中设置的MTU值为最大MTU值的情况下,所述下行链路是否是连通的之后,还包括:The method according to claim 3, wherein, after determining whether the MTU value set in the device is the maximum MTU value, whether the downlink is connected, the method further includes: 在在所述设备中设置的MTU值为最大MTU值的情况下,所述下行链路不连通的情况下,确定比所述最大MTU值小第一预定值的 第一MTU值;In a case where the MTU value set in the device is the maximum MTU value, if the downlink is not connected, determining that the first predetermined value is smaller than the maximum MTU value First MTU value; 在所述设备中设置的MTU值为第一MTU值的情况下,判断所述下行链路是否是连通的;If the MTU value set in the device is the first MTU value, determining whether the downlink is connected; 在判断结果为所述下行链路是连通的情况下,通过以下方式,确定所述最小MTU值:判断在所述设备中设置的MTU值为所述最大MTU值与所述第一MTU值之间的第一中间值的情况下,所述下行链路是否是连通的;在判断结果为在所述设备中设置的MTU值为所述最大MTU值与所述第一MTU值之间的第一中间值的情况下,所述下行链路是连通的情况下,继续判断在所述设备中设置的MTU值为所述第一中间值与所述最大MTU值之间的第二中间值的情况下,所述下行链路是否是连通的;重复执行上述取中间值的判断过程,直到前一次判断结果为所述下行链路是连通的对应的中间值与后一次判断结果为所述下行链路不连通对应的中间值之间的差小于第二预定值的情况下,确定所述前一次判断结果为所述下行链路是连通的对应的中间值为所述最小MTU值。If the result of the determination is that the downlink is connected, the minimum MTU value is determined by determining that the MTU value set in the device is the maximum MTU value and the first MTU value. In the case of the first intermediate value, whether the downlink is connected; the result of the determination is that the MTU value set in the device is between the maximum MTU value and the first MTU value. In the case of an intermediate value, if the downlink is connected, continue to determine that the MTU value set in the device is a second intermediate value between the first intermediate value and the maximum MTU value. If the downlink is connected, the process of determining the intermediate value is repeated until the previous determination result is that the downlink is connected to the corresponding intermediate value and the subsequent determination result is the downlink. In a case where the difference between the intermediate values of the link disconnection is less than the second predetermined value, determining that the previous judgment result is that the corresponding intermediate value of the downlink is connected is the minimum MTU value. 根据权利要求4所述的方法,其中,在判断在所述设备中设置的MTU值为所述第一MTU值的情况下,所述下行链路是否是连通的之后,还包括:The method according to claim 4, wherein, after determining whether the MTU value set in the device is the first MTU value, whether the downlink is connected, the method further includes: 在判断结果为所述下行链路是不连通的情况下,继续确定比所述第一MTU值小第三预定值的第三MTU值,以及继续判断在所述设备中设置的MTU值为所述第三MTU值的情况下,所述下行链路是否是连通的,重复执行上述取第三MTU值以及判断下行链路是否连通的过程,直到判断结果为所述下行链路是连通的,将所述第一MTU值作为所述最大MTU值,采用上述在判断结果为所述下行链路是连通的情况下,确定所述最小MTU值的方式确定所述最小MTU值。If the result of the determination is that the downlink is not connected, continue to determine a third MTU value that is smaller than the first MTU value by a third predetermined value, and continue to determine that the MTU value set in the device is In the case of the third MTU value, whether the downlink is connected, repeating the process of taking the third MTU value and determining whether the downlink is connected, until the result of the determination is that the downlink is connected, Using the first MTU value as the maximum MTU value, determining the minimum MTU value by determining the minimum MTU value in a case where the determination result is that the downlink is connected. 根据权利要求4所述的方法,其中,判断在所述第一中间值 与所述最大MTU值之间的第二中间值的情况下,所述下行链路是否是连通的包括:The method of claim 4 wherein said determining said first intermediate value In the case of the second intermediate value between the maximum MTU value, whether the downlink is connected includes: 检测与所述服务器交互的下行报文;Detecting a downlink message that interacts with the server; 判断所述下行报文中最大的下行报文长度是否为所述第二中间值;Determining whether the maximum downlink packet length in the downlink packet is the second intermediate value; 检测在预定时间内是否收到文本内容传输完毕的结束标识;Detecting whether an end identifier of the text content transmission is received within a predetermined time; 其中,在所述最大的下行报文长度为所述第二中间值,且在所述预定时间内收到所述结束标识的情况下,确定所述下行链路连通。And determining, in the case that the maximum downlink packet length is the second intermediate value, and receiving the end identifier within the predetermined time, determining the downlink connectivity. 一种最大传输单元值的设置装置,包括:A setting device for a maximum transmission unit value, comprising: 接收模块,设置为接收用于指示设备开机联网的指令;a receiving module, configured to receive an instruction for instructing the device to be powered on; 确定模块,设置为确定所述设备与服务器之间的下行链路中的最小最大传输单元MTU值;a determining module configured to determine a minimum maximum transmission unit MTU value in a downlink between the device and the server; 设置模块,设置为将确定的所述最小MTU值设置在所述设备中。A setting module is arranged to set the determined minimum MTU value in the device. 根据权利要求7所述的装置,其中,所述确定模块,还设置为通过传输控制协议TCP确定所述最小MTU值。The apparatus of claim 7, wherein the determining module is further configured to determine the minimum MTU value by a transmission control protocol TCP. 根据权利要求8所述的装置,其中,所述确定模块还设置为确定所述设备允许设置的最大MTU值;获取所述服务器的与所述最大MTU值对应的文本内容;其中,所述服务器与所述设备之间建立有TCP连接;判断在所述设备中设置的MTU值为最大MTU值的情况下,所述下行链路是否是连通的;以及在判断结果为是的情况下,确定允许设置的所述最大MTU值为所述最小MTU值。The apparatus of claim 8, wherein the determining module is further configured to determine a maximum MTU value that the device is allowed to set; obtain text content of the server corresponding to the maximum MTU value; wherein the server Establishing a TCP connection with the device; determining whether the downlink is connected if the MTU value set in the device is the maximum MTU value; and determining if the determination result is yes, determining The maximum MTU value allowed to be set is the minimum MTU value. 根据权利要求9所述的装置,其中,所述确定模块还设置为在所述设备中设置的MTU值为最大MTU值的情况下,所述下行链 路是不连通的情况下,确定比所述最大MTU值小第一预定值的第一MTU值;判断在设备中设置的MTU值为所述第一MTU值的情况下,所述下行链路是否是连通的;以及在判断结果为所述下行链路是连通的情况下,通过以下方式,确定所述最小MTU值:判断在所述设备中设置的MTU值为最大MTU值与所述第一MTU值之间的第一中间值的情况下,所述下行链路是否是连通的;在判断结果为在所述设备中设置的MTU值为所述最大MTU值与所述第一MTU值之间的第一中间值的情况下,所述下行链路是连通的情况下,继续判断在所述设备中设置的MTU值为所述第一中间值与所述最大MTU值之间的第二中间值的情况下,所述下行链路是否是连通的;重复执行上述取中间值的判断过程,直到前一次判断结果为所述下行链路是连通的对应的中间值与后一次判断结果为所述下行链路不连通对应的中间值之间的差小于第二预定值的情况下,确定所述前一次判断结果为所述下行链路是连通的对应的中间值为所述最小MTU值。The apparatus according to claim 9, wherein said determining module is further configured to: if the MTU value set in said device is a maximum MTU value, said downlink If the path is not connected, determining a first MTU value that is smaller than the maximum MTU value by a first predetermined value; and determining that the MTU value set in the device is the first MTU value, the downlink Whether it is connected; and if the result of the determination is that the downlink is connected, determining the minimum MTU value by determining that the MTU value set in the device is the maximum MTU value and the first In the case of a first intermediate value between the MTU values, whether the downlink is connected; in the judgment result, the MTU value set in the device is the maximum MTU value and the first MTU value. In the case of the first intermediate value, if the downlink is connected, continue to determine that the MTU value set in the device is between the first intermediate value and the maximum MTU value. In the case of two intermediate values, whether the downlink is connected; the above-mentioned determination process of taking the intermediate value is repeatedly performed until the previous judgment result is that the downlink is connected to the corresponding intermediate value and the subsequent judgment result Corresponding to the downlink disconnection When the difference is smaller than a second predetermined value between the intermediate value, determining that the previous determination result of the downlink communication is an intermediate value corresponding to the minimum MTU value. 根据权利要求10所述的装置,其中,所述确定模块还设置为在判断结果为所述下行链路是不连通的情况下,继续确定比所述第一MTU值小第三预定值的第三MTU值,以及继续判断在所述设备中设置的MTU值为所述第三MTU值的情况下,所述下行链路是否是连通的,重复执行上述取第三MTU值以及判断下行链路是否连通的过程,直到判断结果为所述下行链路是连通的,将所述第一MTU值作为所述最大MTU值,采用上述在判断结果为所述下行链路是连通的情况下,确定所述最小MTU值的方式确定所述最小MTU值。The apparatus according to claim 10, wherein said determining module is further configured to continue to determine a third predetermined value smaller than said first MTU value if said determination result is that said downlink is not connected And the third MTU value, and the continuation of determining whether the MTU value set in the device is the third MTU value, whether the downlink is connected, repeatedly performing the foregoing taking the third MTU value, and determining the downlink Whether the process is connected until the determination result is that the downlink is connected, and the first MTU value is used as the maximum MTU value, and the foregoing is determined when the determination result is that the downlink is connected. The manner of the minimum MTU value determines the minimum MTU value. 根据权利要求10所述的装置,其中,所述确定模块还设置为检测与所述服务器交互的下行报文;判断所述下行报文中最大的下行报文长度是否为所述第二中间值;以及检测在预定时间内是否收到文本内容传输完毕的结束标识;其中,在所述最大的下行报文长度为所述第二中间值,且在所述预定时间内收到所述结束标识的情况下, 确定所述下行链路连通。The apparatus according to claim 10, wherein the determining module is further configured to detect a downlink message that interacts with the server; and determine whether a maximum downlink message length in the downlink message is the second intermediate value And detecting an end identifier of whether the text content transmission is completed within a predetermined time; wherein the maximum downlink message length is the second intermediate value, and the end identifier is received within the predetermined time in the case of, The downlink connectivity is determined. 一种设备,包括:权利要求7至12中任一项所述的装置。 An apparatus comprising: the apparatus of any one of claims 7 to 12.
PCT/CN2016/108027 2016-05-31 2016-11-30 Method, apparatus and device for setting maximum transmission unit value WO2017206460A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610380230 2016-05-31
CN201610380230.4 2016-05-31

Publications (1)

Publication Number Publication Date
WO2017206460A1 true WO2017206460A1 (en) 2017-12-07

Family

ID=60478471

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/108027 WO2017206460A1 (en) 2016-05-31 2016-11-30 Method, apparatus and device for setting maximum transmission unit value

Country Status (1)

Country Link
WO (1) WO2017206460A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115842732A (en) * 2023-02-13 2023-03-24 北京天维信通科技有限公司 Method for detecting MTU (maximum Transmission Unit) by distributed full paths
CN116095755A (en) * 2022-12-30 2023-05-09 深圳和而泰智能控制股份有限公司 Method, device and electronic equipment for dynamically negotiating bluetooth communication parameters
CN116192768A (en) * 2023-03-06 2023-05-30 安超云软件有限公司 Method, device, equipment and storage medium for determining maximum transmission unit

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020141448A1 (en) * 2001-03-27 2002-10-03 Nec Corporation Packet transfer apparatus and method
US20030187975A1 (en) * 2002-03-28 2003-10-02 International Business Machines Corporation Apparatus and method of reducing dataflow disruption when detecting path maximum transmission unit (PMTU)
CN101400085A (en) * 2007-09-30 2009-04-01 华为技术有限公司 Method, device and system for negotiating maximum transmission unit value of path
CN101695048A (en) * 2009-10-29 2010-04-14 福建星网锐捷网络有限公司 Discovering and processing method of maximum transmission unit of tunnel and device as well as router
CN104067654A (en) * 2012-01-09 2014-09-24 摩托罗拉移动有限责任公司 Dynamic TCP layer optimization for real-time field performance

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020141448A1 (en) * 2001-03-27 2002-10-03 Nec Corporation Packet transfer apparatus and method
US20030187975A1 (en) * 2002-03-28 2003-10-02 International Business Machines Corporation Apparatus and method of reducing dataflow disruption when detecting path maximum transmission unit (PMTU)
CN101400085A (en) * 2007-09-30 2009-04-01 华为技术有限公司 Method, device and system for negotiating maximum transmission unit value of path
CN101695048A (en) * 2009-10-29 2010-04-14 福建星网锐捷网络有限公司 Discovering and processing method of maximum transmission unit of tunnel and device as well as router
CN104067654A (en) * 2012-01-09 2014-09-24 摩托罗拉移动有限责任公司 Dynamic TCP layer optimization for real-time field performance

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116095755A (en) * 2022-12-30 2023-05-09 深圳和而泰智能控制股份有限公司 Method, device and electronic equipment for dynamically negotiating bluetooth communication parameters
CN115842732A (en) * 2023-02-13 2023-03-24 北京天维信通科技有限公司 Method for detecting MTU (maximum Transmission Unit) by distributed full paths
CN115842732B (en) * 2023-02-13 2023-05-23 北京天维信通科技有限公司 Method for detecting MTU (modulation transfer unit) in distributed full path
CN116192768A (en) * 2023-03-06 2023-05-30 安超云软件有限公司 Method, device, equipment and storage medium for determining maximum transmission unit

Similar Documents

Publication Publication Date Title
CN107864228B (en) A connection establishment method and system in a content distribution network
US10367893B1 (en) Method and apparatus of performing peer-to-peer communication establishment
CN106465161B (en) Access point, method of operating access point, and computer-readable medium
WO2016101493A1 (en) Data transmission method and device, terminal and storage medium
WO2017054547A1 (en) Bidirectional forwarding detection method and apparatus
US10666773B2 (en) Method and device for establishing multipath network connections
CN111988212A (en) Message transmission method and related device
CN110999257A (en) Delivery method selection for delivery of server notifications
CN105337814A (en) Network equipment connection method, equipment and system
WO2017088494A1 (en) Link management method and apparatus
WO2017206460A1 (en) Method, apparatus and device for setting maximum transmission unit value
CN106487696B (en) Link failure detection method and device
US20180084597A1 (en) Method of managing communication interfaces for a multipath transmission control protocol (mptcp) connection
CN103491011B (en) BGP conversation changing method and device
TW200836542A (en) A method of providing a mobility service
CN102281194A (en) Message transmission method and network equipment
US20200389359A1 (en) Unidirectional link detection mode auto-detection
CN108574615A (en) A content transmission method, device and system based on multipath MPTCP
CN114125023B (en) Method and device for determining data connection, storage medium and electronic device
WO2017219667A1 (en) Method, device, and system for modifying mss
US20150365443A1 (en) Method, server and apparatus for establishing point-to-point connection
CN105634810B (en) Method and system for accessing universal plug and play device, access device
CN112311613B (en) Link detection method and device
CN113596938A (en) Network switching method and device of mobile terminal, storage medium and electronic device
CN114024897B (en) Port switching method and system

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16903840

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16903840

Country of ref document: EP

Kind code of ref document: A1