CN109873763B - Communication method and device - Google Patents

Communication method and device Download PDF

Info

Publication number
CN109873763B
CN109873763B CN201711270248.XA CN201711270248A CN109873763B CN 109873763 B CN109873763 B CN 109873763B CN 201711270248 A CN201711270248 A CN 201711270248A CN 109873763 B CN109873763 B CN 109873763B
Authority
CN
China
Prior art keywords
router
mtu
message
packet
detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711270248.XA
Other languages
Chinese (zh)
Other versions
CN109873763A (en
Inventor
李皆明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Huawei Digital Technologies Co Ltd
Original Assignee
Beijing Huawei Digital Technologies Co Ltd
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 Beijing Huawei Digital Technologies Co Ltd filed Critical Beijing Huawei Digital Technologies Co Ltd
Priority to CN201711270248.XA priority Critical patent/CN109873763B/en
Publication of CN109873763A publication Critical patent/CN109873763A/en
Application granted granted Critical
Publication of CN109873763B publication Critical patent/CN109873763B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

A communication method and equipment are used for enabling two routers to normally communicate even under the condition that MTU supported by interfaces configured by the two routers is larger than MTU configured by an intermediate switch. The first router sends at least one first detection message to the second router, and the first detection message encapsulates the first MTU; the first router determines that a first detection feedback message is not received from the second router within a set time length, wherein the first detection feedback message is a feedback message of the first detection message; the first router cuts the first MTU by a first step length to obtain a second MTU; the first router sends at least one second detection message encapsulating the second MTU to the second router until the first router receives a detection feedback message from the second router within a set time length; and the first router takes the third MTU obtained by the last clipping as the MTU supported by the transmission path from the first router to the second router.

Description

Communication method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a communication method and device.
Background
In the current network operation, two core routers may communicate with each other through a two-layer switch network, if the Maximum Transmission Unit (MTU) supported by an interface configured by the two routers is greater than the MTU configured by the middle switch, when a message sent by one router to the other router passes through the middle switch, the switch may directly discard the message because the MTU cannot support the message, so that the two routers cannot communicate, and thus normal establishment of a protocol neighbor relationship between the two routers and normal transmission of a service message may be affected.
Disclosure of Invention
The embodiment of the application provides a communication method and device, so that two routers can normally communicate even in a scenario that an MTU supported by interfaces configured by the two routers is larger than an MTU configured by an intermediate switch.
In a first aspect, a method of communication is provided, the method being executable by a router, and the router executing the method being a first router. The method comprises the following steps: a first router sends at least one first detection message to a second router, wherein the first detection message encapsulates a first MTU (maximum transmission unit), the first MTU is an MTU supported by an outgoing interface of the first router, and the first detection message is used for detecting whether a message with the size of the first MTU can be sent to the second router; the first router determines that a first detection feedback message is not received from the second router within a set time length, wherein the first detection feedback message is a feedback message of the first detection message; the first router cuts the first MTU by a first step length to obtain a second MTU; the first router sends at least one second detection message encapsulating the second MTU to a second router until the first router receives a detection feedback message from the second router within the set time length; and the first router takes the third MTU obtained by the last clipping as the MTU supported by the transmission path from the first router to the second router.
In this embodiment, a first router in a two-tier network may send a probe packet to a second router, for example, at least one first probe packet is sent first, the first probe packet encapsulates a first MTU, if the first router does not receive the first probe feedback packet from the second router when a timer times out, the first router may clip the first MTU by a first step size to obtain a second MTU, and then send a second probe packet encapsulating the second MTU to the second router again, which is equivalent to that, if the probe feedback packet is not received when the timer times out, the MTU of the packet is considered to be too large, the first router may decrease the MTU and detect again, so that the probe packet may reach the second router until the MTU encapsulated by the probe packet is equal to the MTU supported by the intermediate switch, and the second router may reply the probe feedback packet, then, as long as the first router receives the detection feedback message before the timer expires, it can be determined that the current MTU is the MTU supported by the transmission path between the first router and the second router, so that the detection can be stopped. By the mode, even if the MTU supported by the interface configured by the two routers is larger than the MTU configured by the middle switch, the routers can determine the MTU supported by the transmission path between the routers by detecting the message, namely determine the MTU supported by the middle switch, so that the message can be physically reachable between the routers, the normal transmission of the message is ensured, and the protocol neighbor relation between the two routers can be normally established.
In one possible design, when the first router sends at least one first detection packet to the second router, the first router may send one first detection packet to the second router every first time interval.
Considering the network quality and other factors, if the first router only sends one first detection packet, the first router does not receive the first detection feedback packet when the timer is overtime, which may be due to the MTU, or due to the network transmission quality and other reasons, such as packet loss or too large delay, and if it is determined from this that the MTU is reduced, it may not be accurate enough. Therefore, in this embodiment of the present application, the first router may send one first probe packet to the second router, so that the burden on the first router is small, or considering the network quality, the first router may also send a plurality of first probe packets to the second router.
In one possible design, the first probe message and the second probe message may be ping messages, respectively.
The embodiment of the application can realize the detection of the MTU through a ping detection mechanism. However, the ping mechanism is only an alternative mechanism, and the embodiments of the present application do not limit the mechanism.
In one possible design, the first router adjusts the first MTU supported by the egress interface of the first router to the third MTU; and the first router sends a service message to the second router, wherein the MTU of the service message is the third MTU.
After the first router finally determines the MTU supported by the switch, that is, after determining the path MTU between the first router and the second router, and when the first router retransmits the service packet, the MTU of the service packet may be the path MTU between the first router and the second router finally determined by the first router, for example, the path MTU is referred to as a third MTU, thereby ensuring normal transmission of the service packet. The service packet may be generated by the first router, or may also be forwarded by other devices through the first router. If the service message is generated by the first router, the MTU of the service message is set by the first router, the first router can be directly set as the third MTU, and if the service message is forwarded by other devices through the first router, the MTU of the service message can be set by other devices. For example, after the first router determines the third MTU, the first router may notify other devices upstream of the first router of the third MTU, so that the other devices may know that the MTU of the service packet is to be set as the third MTU when the other devices subsequently send the service packet through the first router.
In a second aspect, a method of communication is provided, the method being executable by a router, the router executing the method also being a first router. The method comprises the following steps: a first router sends a detection message to a second router, wherein the detection message encapsulates a first MTU, the first MTU is an MTU supported by an outgoing interface of the first router, and the detection message is used for detecting whether a message with the size of the first MTU can be sent to the second router; the first router determines that a detection feedback message is not received from the second router within a set time length, wherein the detection feedback message is a feedback message of the detection message; the first router sends a loopback message to the second router, wherein the loopback message is used for requesting an MTU (maximum transmission unit) supported by a transmission path from the first router to the second router; the first router receives a loopback feedback message, wherein the loopback feedback message is a feedback message of the loopback message; and the first router acquires a second MTU indicated by the loopback feedback message, wherein the second MTU is an MTU supported by a transmission path from the first router to the second router.
Accordingly, in a third aspect, a method of communication is provided that is executable by a switch. The method comprises the following steps: the method comprises the steps that a switch receives a loopback message from a first router, the loopback message is used for requesting MTU (maximum transmission unit) supported by a transmission path from the first router to a second router, and the switch is located on the transmission path between the first router and the second router; the switch adds a second MTU in the loop feedback message to obtain a loop feedback message, wherein the second MTU is an MTU supported by the switch; and the switch sends the loopback feedback message to the first router.
In the embodiment of the present application, if it is determined that the sending of the probe packet fails, the first router may directly send a loopback packet, so as to directly obtain the MTU supported by the transmission path between the first router and the second router, thereby solving the problem of finding the MTU in a two-layer network, without requiring excessive probing processes, and increasing the probing speed. And the protocol neighbor relation between the first router and the second router can be normally established, and the message can be transmitted between the first router and the second router.
In one possible design, the first router adjusts the first MTU supported by an egress interface of the first router to the second MTU; and the first router sends a service message to the second router, wherein the MTU of the service message is the second MTU.
When the first router sends the service message again after the first router finally determines the MTU supported by the switch, namely after determining the second MTU, the MTU of the service message can be the second MTU, thereby ensuring the normal sending of the service message. The service packet may be generated by the first router, or may also be forwarded by other devices through the first router. If the service message is generated by the first router, the MTU of the service message is set by the first router, the first router can be directly set as the second MTU, and if the service message is forwarded by other devices through the first router, the MTU of the service message can be set by other devices. For example, after the first router determines the second MTU, the second router may notify other devices upstream of the first router of the second MTU, so that the other devices may know that the MTU of the service packet is to be set as the third MTU when subsequently sending the service packet through the first router.
In one possible design, the loopback message is an ECHO message.
In the embodiment of the application, the loopback message can be realized through the ECHO message. Of course, in the embodiment of the present application, the loopback of the packet may also be implemented by other packets, which is not limited.
In one possible design, the destination address of the loopback packet is an address of an outgoing interface of the first router.
Since the message is a loopback message, the destination address can be set as the address of the output interface of the first router, the switch adds the second MTU to the loopback message and then sends the loopback message, according to the destination address, the loopback message can directly return to the first router, the switch does not need to regenerate the message and send the message to the first router, the burden of the switch is reduced, and the working mechanism of the switch is better met.
In a fourth aspect, a router is provided. The router has the function of realizing the first router in the method design. These functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.
In one possible design, the specific structure of the router may include a processor and a transceiver. The processor and the transceiver may perform the respective functions in the method provided by the first aspect or any one of the possible designs of the first aspect.
In a fifth aspect, a router is provided. The router has the function of realizing the first router in the method design. These functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.
In one possible design, the specific structure of the router may include a processor and a transceiver. The processor and the transceiver may perform the respective functions in the method provided by the second aspect or any one of the possible designs of the second aspect.
In a sixth aspect, a switch is provided. The switch has the function of realizing the switch (first switch) in the design of the method. These functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.
In one possible design, the particular architecture of the switch may include a processor and a transceiver. The processor and the transceiver may perform the respective functions in the method provided by the third aspect or any one of the possible designs of the third aspect.
In a seventh aspect, a router is provided. The router has the function of realizing the first router in the method design. These functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.
In one possible design, the specific structure of the router may include a processing module and a transceiver module. The processing module and the transceiver module may perform the respective functions in the method provided by the first aspect or any one of the possible designs of the first aspect.
In an eighth aspect, a router is provided. The router has the function of realizing the first router in the method design. These functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.
In one possible design, the specific structure of the router may include a processing module and a transceiver module. The processing module and the transceiver module may perform the respective functions in the method provided by the second aspect or any one of the possible designs of the second aspect.
In a ninth aspect, a switch is provided. The switch has the function of realizing the switch (first switch) in the design of the method. These functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.
In one possible design, the particular architecture of the switch may include a processor and a transceiver. The processor and the transceiver may perform the respective functions in the method provided by the third aspect or any one of the possible designs of the third aspect.
In a tenth aspect, a communication device is provided. The communication device may be the first router designed in the above method, or a chip provided in the first router. The communication device includes: a memory for storing computer executable program code; and a processor coupled with the memory. Wherein the program code stored in the memory comprises instructions which, when executed by the processor, cause the communication device to perform the method performed by the first router of the first aspect or any one of the possible designs of the first aspect.
In an eleventh aspect, a communication device is provided. The communication device may be the first router designed in the above method, or a chip provided in the first router. The communication device includes: a memory for storing computer executable program code; and a processor coupled with the memory. Wherein the program code stored in the memory comprises instructions which, when executed by the processor, cause the communication device to perform the method performed by the first router of the second aspect or any of the possible designs of the second aspect.
In a twelfth aspect, a communication device is provided. The communication device may be the switch (first switch) designed in the above method, or a chip provided in the switch (first switch). The communication device includes: a memory for storing computer executable program code; and a processor coupled with the memory. Wherein the program code stored in the memory comprises instructions which, when executed by the processor, cause the communication device to perform the method performed by the switch (first switch) of the second aspect or any one of the possible designs of the second aspect.
In a thirteenth aspect, a communication system is provided that includes a first router and a switch. Wherein the first router is used for sending a detection message to the second router, the detection message encapsulates the first MTU, the first MTU is an MTU supported by an egress interface of the first router, the detection packet is used to detect whether a packet with a size of the first MTU can be sent to the second router, and determine that a detection feedback packet is not received from the second router within a set time period, the detection feedback message is a feedback message of the detection message, a loopback message is sent to the second router, the loopback message is used for requesting the MTU supported by the transmission path from the first router to the second router, receiving the loopback feedback message, the loopback feedback message is a feedback message of the loopback message, a second MTU indicated by the loopback feedback message is obtained, the second MTU is supported by a transmission path from the first router to the second router; the switch is used for receiving a loopback message from the first router, the loopback message is used for requesting an MTU supported by a transmission path between the first router and the second router, the switch is positioned on the transmission path between the first router and the second router, a second MTU is added into the loopback message to obtain a loopback feedback message, the second MTU is the MTU supported by the switch, and the loopback feedback message is sent to the first router.
In a fourteenth aspect, there is provided a computer storage medium having instructions stored thereon, which when executed on a computer, cause the computer to perform the method of the first aspect or any one of the possible designs of the first aspect.
In a fifteenth aspect, a computer storage medium is provided having stored therein instructions that, when executed on a computer, cause the computer to perform the method of the second aspect or any one of the possible designs of the second aspect.
In a sixteenth aspect, there is provided a computer storage medium having stored therein instructions that, when run on a computer, cause the computer to perform the method of the third aspect or any one of the possible designs of the third aspect.
A seventeenth aspect provides a computer program product comprising instructions stored thereon, which when run on a computer, cause the computer to perform the method of the first aspect or any one of the possible designs of the first aspect.
In an eighteenth aspect, there is provided a computer program product comprising instructions stored thereon which, when run on a computer, cause the computer to perform the method as set forth in the second aspect or any one of the possible designs of the second aspect.
A nineteenth aspect provides a computer program product comprising instructions stored thereon, which when run on a computer, cause the computer to perform the method of the third aspect or any one of the possible designs of the third aspect.
The embodiment of the application supplements and expands the technology of learning and discovering the network path MTU, and provides a discovery technology capable of efficiently and quickly detecting the path MTU of the two-layer network.
Drawings
Fig. 1A is a schematic diagram of a format of an ICMP unreachable message;
fig. 1B is a schematic diagram of a switch discarding message when MTUs supported by interfaces configured by two routers are greater than MTUs configured by an intermediate switch;
fig. 2 is a schematic view of an application scenario according to an embodiment of the present application;
fig. 3 is a flowchart of a communication method according to an embodiment of the present application;
fig. 4A is a schematic diagram of another application scenario according to an embodiment of the present application;
fig. 4B is a flowchart of another communication method provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a first router according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a first router according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a switch provided in an embodiment of the present application;
fig. 8A-8B are schematic structural diagrams of a communication device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings.
Hereinafter, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
1) A router (router) is a device for connecting local area networks and wide area networks in the internet (internet), the routing occurs in a third layer (also referred to as a three-layer network herein) of an Open System Interconnection (OSI) reference model, that is, a network layer, and the router automatically selects and sets a routing according to the channel condition, and sends signals in a front-back order according to an optimal path.
A router, also known as a gateway device, is used to connect multiple logically separate networks. By logical network is meant a single network or a sub-network. This may be accomplished by the routing function of the router when data is transferred from one subnet to another. Therefore, the router has the functions of judging network addresses and selecting Internet Protocol (IP) paths, can establish flexible connection in a multi-network interconnection environment, can connect various subnets by completely different data grouping and medium access methods, only receives information of a source station or other routers, and belongs to interconnection equipment of a network layer.
2) A switch (switch) is a network device that can perform a function of encapsulating and forwarding a packet based on Media Access Control (MAC) (hardware address of a network card) identification. The switch can "learn" the MAC address and store the learned MAC address in an internal address table, enabling the data frame to reach the destination address directly from the source address by establishing a temporary switching path between the originator and the destination of the data frame. The switches include a two-layer switch operating at a second layer of the OSI reference model (also referred to herein as a two-layer network) and a three-layer switch operating at a three-layer network, the three-layer switch or a higher layer switch. The tri-layer switch may also be capable of routing and may forward faster than the lower end router. It is mainly characterized in that: once routing and multiple forwarding. The embodiment of the application mainly discusses the two-layer exchanger.
3) MTU refers to the maximum packet size, in bytes, that can be passed through at a layer of a communication protocol. The maximum transmission unit is usually associated with a communication interface, such as a network interface card or a serial port. For example, the embodiments of the present application will discuss MTUs supported by an egress interface of a router.
4) The terms "system" and "network" in the embodiments of the present application may be used interchangeably. The "plurality" means two or more, and in view of this, the "plurality" may also be understood as "at least two" in the embodiments of the present application. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" generally indicates that the preceding and following related objects are in an "or" relationship, unless otherwise specified.
And, unless stated to the contrary, the embodiments of the present application refer to the ordinal numbers "first", "second", etc., for distinguishing a plurality of objects, and do not limit the sequence, timing, priority, or importance of the plurality of objects.
The embodiment of the present application may be applied to a Long Term Evolution (LTE) system, or a New Radio (NR) system of a fifth generation mobile communication technology (5G), or may also be applied to other similar communication systems, such as a next generation communication system.
In order to better understand the technical solutions provided by the embodiments of the present application, the technical background of the embodiments of the present application is described below.
In a three-tier network, the MTU may be discovered. For example, when the MTU of a message received by the router exceeds the MTU of the next hop network and the message cannot be split, the router needs to return a destination unreachable message (for example, ICMP unreachable message) of an Internet Control Message Protocol (ICMP) to the source device sending the message, please refer to fig. 1A, which is a format of the ICMP unreachable message. The ICMP unreachable message includes a type, a code, a checksum, a header field, an internet header field (or as an IP header) + the first 64 bits (bit) in the original message, which is a message that the MTU received by the router exceeds the MTU of the next hop network.
The type and the code are used to jointly determine the type of the ICMP message, for example, type 3 and code 4, indicating that the ICMP message is not available for the destination. In order to support the path MTU discovery technology, the router will include the MTU of the next hop network in the low-order 16 bits in the header field of the ICMP unreachable message, and this field is marked as "unused" in the ICMP standard. The high-order 16 bits remain unused and are set to 0. After receiving the ICMP unreachable message, the source device may obtain the MTU of the next hop network included in the low-order 16 bits in the header field of the ICMP unreachable message, so as to regenerate the message according to the MTU for transmission.
However, the current standard only defines the discovery of the MTU for the three-layer packet, and for the two-layer network, no standard and corresponding technology exists for discovering the MTU.
For example, referring to fig. 1B, a router a and a router B may communicate with each other via a switch a and a switch B, both of which are two-layer switches. The MTU configured for the outgoing interface of router a and the incoming interface of router B is 1500, and the MTU configured for the outgoing interface of switch a and the incoming interface of switch B is 1000. When a message sent to a router B by a router a passes through a switch a, the switch a directly discards the message because the switch a cannot support the MTU of the message, so that the router a and the router B cannot realize communication, which may affect normal establishment of a protocol neighbor relationship between the router a and the router B and normal transmission of a service message.
In view of this, the technical solution of the embodiment of the present application is provided to enable two routers to normally communicate even in a scenario where an MTU supported by an interface configured by the two routers is greater than an MTU configured by an intermediate switch.
Referring to fig. 2, an application scenario of the embodiment of the present application is described. The router comprises a first router and a second router, and a transmission path between the first router and the second router comprises a first switch and a second switch which are positioned in a two-layer network. The IP address of the outgoing interface of the first router is, for example, 10.1.1.1, and the IP address of the incoming interface of the second router is, for example, 10.1.1.2. The MTU configured for the outgoing interface of the first router and the incoming interface of the second router is, for example, 1500, and the MTU configured for the outgoing interface of the first switch and the incoming interface of the second switch is, for example, 1000. That is, a two-layer network is between the first router and the second router which are protocol neighbors, and the allowed MTU of the link of the switch interconnection positioned on the two-layer network is smaller than the interface MTU of the routers at two ends.
Among them, the MTU supported by the first switch (or the MTU supported by the switch), the MTU supported by the transmission path between the first router and the second router, the path MTU between the first router and the second router, and the MTU supported by the two-layer network between the first router and the second router are the same meaning in this document, and may be replaced with each other. These concepts will be described later.
Referring to fig. 3, in the following description, an example of applying the method to the application scenario shown in fig. 2 is provided in the embodiment of the present application. The flow of the method is described below.
S301, a first router sends at least one first detection message to a second router, then a first switch receives at least one first detection message, the first detection message encapsulates a first MTU, the first MTU is an MTU supported by an outgoing interface of the first router, the first detection message is used for detecting whether the message with the size of the first MTU can be sent to the second router, and a transmission path between the first router and the second router comprises equipment located in a second-layer network;
s302, the first switch determines the size relationship between the first MTU and the third MTU, if the first MTU is determined to be larger than the third MTU, the first switch discards at least one first detection message, and the third MTU is an MTU supported by the first switch (for example, S302); if the first MTU is determined to be equal to the third MTU, the first switch forwards at least one first detection message to next-hop equipment on the transmission path;
s303, if the first switch discards at least one first detection message, the first router determines that a first detection feedback message is not received from the second router within a set time length, wherein the first detection feedback message is a feedback message of the first detection message;
s304, the first router cuts the first MTU by a first step length to obtain a second MTU;
s305, because the first router has not detected and determined the MTU supported by the transmission path between the first router and the second router, the first router continues the detection process, for example, if the first router sends at least one second detection packet encapsulating the second MTU to the second router, the first switch receives the at least one second detection packet;
then, the processing manner of the first switch for the at least one second probe packet is similar to the processing manner for the at least one first probe packet, the first switch determines the size relationship between the second MTU and the third MTU, for example, it is determined that the second MTU is greater than the third MTU, the first switch discards the at least one second probe packet, the processing manner of the subsequent first router may also refer to S304 and S305, that is, the first router continues to perform the probing process, and the process of performing probing through the probe packet in multiple rounds is omitted in the middle.
Until after the N round of detection process, in the (N + 1) th round of detection process, S306, the first router sends at least one detection packet (referred to as a third detection packet in this embodiment) to the second router, and the fourth MTU is encapsulated in the at least one third detection packet, so that the first switch receives the at least one third detection packet;
s307, the first switch determines the size relationship between the fourth MTU and the third MTU, if the fourth MTU is larger than the third MTU, the first switch discards at least one first detection message, and if the fourth MTU is equal to the third MTU, the first switch forwards at least one third detection message to next-hop equipment on the transmission path (S307 takes the example as this); if the next hop device on the transmission path is, for example, a second switch, the second switch receives at least one third detection message;
s308, the second switch sends at least one third detection message to the second router, and the second router receives the at least one third detection message;
s309, the second router generates at least one third detection feedback message, and the third detection feedback message is a feedback message of the third detection message; wherein, the second router can generate a third detection feedback message every time receiving a third detection feedback message;
s310, the second router sends at least one third detection feedback message to the first router, and the first router receives the at least one third detection feedback message;
the second router may send a third detection feedback packet to the first router every time the second router generates a third detection feedback packet, that is, if the second router generates a plurality of third detection feedback packets, the sending time of the plurality of third detection feedback packets may be different;
in addition, the sending, by the second router, at least one third detection feedback packet to the first router includes three processes, that is, 3 processes of S310 in fig. 3, which are respectively: the second router sends at least one third detection feedback message to the second switch, the second switch receives the at least one third detection feedback message, the second switch sends the at least one third detection feedback message to the first switch, the first switch receives the at least one third detection feedback message, the first switch sends the at least one third detection feedback message to the first router, and the first router receives the at least one third detection feedback message;
s311, the first router determines that at least one third detection feedback packet is received within the set time duration, and then determines that an MTU supported by a transmission path between the first router and the second router is a fourth MTU, where the fourth MTU is an MTU obtained by the first router by the last clipping, and the fourth MTU is a third MTU. At this point, the detection process for the MTU is finished.
The arrows in S31 and S35 in fig. 3 also include dashed arrows pointing from the first switch to the second router, which indicate that the at least one first probe packet and the at least one second probe packet are actually sent to the second router, and certainly the second router cannot receive the at least one first probe packet and the at least one second probe packet, so the dashed arrows in the figure are only schematic. At least one third probe packet is sent to the second router and the second router is also capable of receiving, so the solid arrows in fig. 3 are shown.
Taking the scenario shown in fig. 2 as an example, because the first switch and the second switch are located in a two-layer network, according to the current standard, the first router cannot discover the MTU supported by the first switch. In the embodiment of the present application, a way of detecting the MTU through the probe packet is proposed for the two-layer network, so that the first router can finally know the MTU supported by the first switch, and the MTU supported by the first switch is also the MTU supported by the transmission path between the first router and the second router, the MTU supported by the first switch, i.e. the path MTU between the first router and the second router, is referred to as a path MTU, in an internet transmission path, the minimum of the maximum transmission units of all IP hops on the transmission path traversed from the source address (here the address of the first router) to the destination address (here the address of the second router), or from another perspective, the path MTU is the maximum of the maximum transmission unit that can traverse the transmission path without fragmenting the message.
The detection of the MTU in the manner provided by the embodiment of the present application is a function of a router, and as for the first router, the detection of the MTU may be selectively enabled or disabled. Then, if the first router wants to select to turn on the function, the outgoing interface specified by the first router needs to be in an available (UP) state, where the outgoing interface specified by the first router is an interface through which the first router sends the probe packet provided in the embodiment of the present application. In addition, if the first router wants to select to start the function, both the first router and the second router need to learn an Address Resolution Protocol (ARP) entry of the opposite end interface, so as to ensure that the network is physically reachable.
In the embodiment of the present application, because the detection is performed in the two-layer network, as an example, the detection message may be implemented by a ping message, that is, the detection of the MTU may be implemented by a ping detection mechanism. Of course, the ping message is only an example, or the detection of the MTU may also be implemented by a special detection message, or other mechanisms may also be used to implement the detection of the MTU, which is not limited in the embodiment of the present application. In the following description, for example, the detection message is implemented by a ping message, and the first detection message, the second detection message, the third detection message, and the like may all be ping messages as described above.
In addition, after the first router sends the detection packet, if the MTU encapsulated by the detection packet is equal to the MTU supported by the transmission path between the first router and the second router, that is, equal to the path MTU between the first router and the second router (referred to as the third MTU in this embodiment), the second router can receive the detection packet, and after receiving the detection packet, the second router generates a feedback packet for the detection packet, where the feedback packet of the detection packet is referred to as the detection feedback packet, and the second router sends the detection feedback packet to the first router, and after receiving the detection feedback packet, the first router can determine that the detection packet is successfully sent. Otherwise, after the first router sends the detection message, if the MTU encapsulated by the detection message is larger than the MTU supported by the transmission path between the first router and the second router, that is, larger than the MTU of the path between the first router and the second router, the middle first switch may discard the detection message, and the first switch may not reply the detection feedback message to the first router after discarding the detection message, and the first router may not receive the detection feedback message. Then, if the detection feedback packet is not received after a period of time, the first router can determine that the detection packet transmission fails. In this embodiment of the present application, in order to enable the first router to explicitly detect whether a packet is failed to be sent, a timer may be set, that is, the first router may set the timer and stipulate: when the timer is overtime, if the first router does not receive the feedback message of the sent detection message, the first router determines that the detection message is discarded because the MTU encapsulated by the sent detection message is too large, and the first router can reduce the MTU and resend the detection message encapsulated by the reduced MTU. The timing duration of the timer is the set duration as described above, and the set duration may be determined empirically, for example, the timing duration of the timer may be set as: when the MTU of the message sent by the first router is equal to the path MTU between the first router and the second router, the time length of the first router from the message sending to the message receiving of the feedback message of the message is long. Of course, the timing duration of the timer may also be set in other ways, and the embodiment of the present application is not limited. In addition, after the timing duration of the timer is set, the timing duration can be dynamically adjusted according to requirements.
For example, the first router needs to probe an MTU supported by a two-layer network between the first router and the second router, and the first router may enable a function of detecting an MTU (pathmtu) of the two-layer path for an outgoing interface of the first router, so that the function of probing the MTU is started.
In the process of detecting the MTU, the first router generates a first detection message, wherein a source IP address of the first detection message is an IP address of an outgoing interface of the first router, a source MAC address of the first detection message is also an MAC address of the outgoing interface of the first router, a destination IP address of the first detection message is an IP address of an incoming interface of the second router, and a destination MAC address of the first detection message is also an MAC address of an incoming interface of the second router. For example, the first detection message is a first detection message sent by the first router after the detection of the MTU is started, in the first detection message, the MTU encapsulated by the first router may be an MTU supported by an outgoing interface of the first router, and the MTU encapsulated in the first detection message is referred to as a first MTU, which is taken as an example of the scenario shown in fig. 2, and then the first MTU is equal to 1500. And the first router sets the value of the non-fragmentation (DF) flag bit in the first detection message to 1, which indicates that the first detection message cannot be split for transmission.
Considering the network quality and other factors, the first router may send at least one first probe packet to the second router, and if only one first probe packet is sent, the first router does not receive the first probe feedback packet when the timer expires, which may be due to the MTU, or due to the network transmission quality and other reasons, such as packet loss or too large delay, and if it is determined to reduce the MTU, it may not be accurate enough. Therefore, in this embodiment of the present application, the first router may send one first probe packet to the second router, or may also send multiple first probe packets to the second router, for example, the first router sends one first probe packet to the second router every first time period, when sending the first probe packet, the first router may start a timer, and before the timer expires, that is, within a set time period, as long as the first router receives a first probe feedback packet for any one first probe packet sent during the time period, it considers that the first probe packet is successfully sent. The first time period may be set by the first router, for example, to 1 second, or may be set to other time periods. In addition, after the first time length is set, the first time length can be dynamically adjusted according to requirements.
Then, since the first router can send at least one first probe packet to the second router, the timing duration of the timer can also be controlled according to the number of sent probe packets, as an example. For example, in order to reduce the number and pressure of network intermediate messages, the first time duration is set to 1 second, the timing duration of the timer is set to 5 seconds, the first router sends a first probe message to the second router every 1 second, and the first router sends 5 first probe messages within 5 seconds. And when the time of 5 seconds is up, if the first router does not receive the first detection feedback message aiming at any one first detection message sent in the 5 seconds, the first router determines that the sending of the first detection message fails.
Taking the scenario shown in fig. 2 as an example, the MTU supported by the two-layer network where the first switch and the second switch are located is 1000, which is obviously smaller than the MTU supported by the egress interface of the first router. Then, after the first switch receives the first detection packet, because the first MTU encapsulated by the first detection packet is greater than the MTU supported by the two-layer network where the first switch and the second switch are located, the first switch may discard the first detection packet. Therefore, the first detection message obviously cannot reach the second router, and the first switch cannot reply the detection feedback message to the first router, so that the first router cannot receive the detection feedback message. For example, the first switch starts a timer when sending the first detection packet, and the first switch does not receive the detection feedback packet when the timer expires (the feedback packet for the first detection packet is referred to as a first detection feedback packet herein), and then the first router determines that the first detection packet fails to be sent, and may resend the detection packet. In this embodiment, after determining that the first detection message fails to be sent, the first router generates a second detection message, where a source IP address of the second detection message is an IP address of an outgoing interface of the first router, a source MAC address of the second detection message is also an MAC address of an outgoing interface of the first router, a destination IP address of the second detection message is an IP address of an incoming interface of the second router, a destination MAC address of the second detection message is also an MAC address of an incoming interface of the second router, and a destination MAC address of the second detection message is also an MAC address of an incoming interface of the second router. Similarly, the first router sends at least one second detection message to the second router. That is, if the sending of the probe packet is unsuccessful, the first router will gradually decrease the MTU encapsulated in the probe packet, and so on, until the MTU encapsulated by the probe packet sent by the first router (i.e. the third probe packet in this embodiment) is equal to the MTU supported by the two-layer network where the first switch and the second switch are located, the first router will receive the probe feedback packet (i.e. the third probe feedback packet in this embodiment) sent by the second router before the timeout of the timer, and then the first router determines that the probing process is ended, and the MTU encapsulated in the probe packet corresponding to the probe feedback packet is the MTU supported by the transmission path between the first router and the second router, i.e. the third MTU in this embodiment, and then the first router makes the third MTU take effect at the outgoing interface of the first router, or, it is understood that the first router adjusts the MTU supported by the egress interface of the first router from the first MTU to the third MTU.
The first step size may be set by the first router, for example, in order to make the decrementing granularity fine and avoid missing the correct MTU due to too large decrementing as much as possible, the first step size may be set to 1, or in order to speed up the detection process and make the detection successful as soon as possible, the first step size may also be set to be larger. How to arrange the embodiments of the present application in detail is not limiting.
Then, if the first router sends the service message to the second router, the MTU of the service message uses the third MTU. The service packet may be generated by the first router, or may also be forwarded by other devices through the first router. Then, the first router may also send a notification message to other devices upstream of the first router, for example, send an ICMP unreachable message, where the notification message encapsulates the third MTU, and after receiving the notification message, the other devices may determine that the subsequently sent service message uses the third MTU, thereby improving the success rate of message transmission.
In the embodiment of the application, the first router can obtain the MTU supported by the transmission path between the first router and the second router by sending the detection message and gradually decreasing the MTU encapsulated by the detection message, so that the problem of discovering the MTU in a two-layer network is solved, the protocol neighbor relation between the first router and the second router can be normally established, the message can be transmitted between the first router and the second router, and the implementation mode is simple.
According to the scheme provided by the embodiment shown in fig. 3, the first router can obtain the MTU supported by the transmission path between the first router and the second router by sending the probe packet and gradually decreasing the MTU encapsulated by the probe packet, thereby solving the problem of finding the MTU in the two-layer network. But is not limited to the scheme provided by the embodiment shown in fig. 3 with respect to how MTUs are discovered in a two-tier network.
Referring to fig. 4A, another application scenario of the embodiment of the present application is described. The router comprises a first router and a second router, and a transmission path between the first router and the second router comprises a first switch and a second switch which are positioned in a two-layer network. The IP address of the outgoing interface of the first router is, for example, 10.1.1.1, and the IP address of the incoming interface of the second router is, for example, 10.1.1.2. The MTU configured for the outgoing interface of the first router and the incoming interface of the second router is, for example, 1500, and the MTU configured for the outgoing interface of the first switch and the incoming interface of the second switch is, for example, 1000. That is, a two-layer network is between the first router and the second router which are protocol neighbors, and the allowed MTU of the link of the switch interconnection positioned on the two-layer network is smaller than the interface MTU of the routers at two ends.
Referring to fig. 4B, the embodiment of the present application further provides a communication method, which can also solve the problem of discovering an MTU in a two-layer network. In the following description, the application scenario shown in fig. 4A is taken as an example of the application scenario of the communication method. The flow of the method is described below.
S41, the first router sends a detection message to the second router, the switch receives the detection message, the detection message encapsulates the first MTU, the first MTU is an MTU supported by an outgoing interface of the first router, the detection message is used for detecting whether the message with the size of the first MTU can be sent to the second router, and a transmission path between the first router and the second router comprises equipment located in a second-layer network;
s42, the switch determines that the first MTU is larger than the second MTU, the switch discards the detection message, and the second MTU is the MTU supported by the switch;
s43, the first router determines that a detection feedback message is not received from the second router within a set time length, wherein the detection feedback message is a feedback message of the detection message;
s44, the first router sends a loop-back message, the switch receives the loop-back message, and the loop-back message is used for requesting the MTU supported by the transmission path from the first router to the second router;
s45, adding a second MTU in the loopback message by the switch to obtain a loopback feedback message, wherein the loopback feedback message is a feedback message of the loopback message;
s46, the switch sends the loopback feedback message to the first router, and the first router receives the loopback feedback message;
s47, the first router obtains a second MTU indicated by the loopback feedback message, and the second MTU is an MTU supported by a transmission path from the first router to the second router.
The switch in the embodiment shown in fig. 4B may be the first switch in the scenario shown in fig. 4A. Taking the scenario shown in fig. 4A as an example, the second switch in fig. 4B is not shown because the flow of the embodiment shown in fig. 4B does not involve the second switch in fig. 4A. In addition, the arrow in S41 in fig. 4B also includes a dashed arrow pointing from the first switch to the second router, which indicates that the probe packet is actually sent to the second router, and certainly the second router cannot receive the probe packet, so the dashed arrow in the figure is only schematic.
In this embodiment, for a layer two network, the MTU may also be detected through the probe packet, so that the first router can finally know the MTU supported by the first switch, where the MTU supported by the first switch is the MTU supported by the transmission path between the first router and the second router, or the MTU supported by the first switch is the MTU supported by the first router and the second router.
Similarly to the embodiment shown in fig. 3, the detection of the MTU in the manner provided in the embodiment of the present application is a function of the router, and as for the first router, the function may be selectively turned on or turned off. Then, if the first router wants to select to turn on the function, the outgoing interface specified by the first router needs to be in an UP state, where the outgoing interface specified by the first router is an interface through which the first router sends the probe packet provided in the embodiment of the present application. In addition, if the first router wants to select to start the function, the first router and the second router are also required to learn the ARP entry of the opposite end interface, so as to ensure that the network is physically reachable.
In the embodiment of the present application, because the detection is performed in the two-layer network, as an example, the detection message may be implemented by a ping message, that is, the detection of the MTU may be implemented by a ping detection mechanism. Of course, the ping message is only an example, or the detection of the MTU may also be implemented by a special detection message, or other mechanisms may also be used to implement the detection of the MTU, which is not limited in the embodiment of the present application. In the following description, the detection message is implemented by a ping message as an example.
In addition, after the first router sends the detection packet, if the MTU encapsulated by the detection packet is equal to the MTU supported by the transmission path between the first router and the second router, that is, equal to the path MTU between the first router and the second router, the second router can receive the detection packet, and after the second router receives the detection packet, a feedback packet for the detection packet is generated, where the feedback packet of the detection packet is referred to as a detection feedback packet, the second router sends the detection feedback packet to the first router, and after the first router receives the detection feedback packet, it can determine that the detection packet is successfully sent. Otherwise, after the first router sends the detection message, if the MTU encapsulated by the detection message is larger than the MTU supported by the transmission path between the first router and the second router, that is, larger than the MTU of the path between the first router and the second router, the middle first switch may discard the detection message, and the first switch may not reply the detection feedback message to the first router after discarding the detection message, and the first router may not receive the detection feedback message. Then, if the detection feedback packet is not received after a period of time, the first router can determine that the detection packet transmission fails. In this embodiment of the present application, in order to enable the first router to explicitly detect whether a packet is failed to be sent, a timer may be set, that is, the first router may set the timer, and the timing duration of the timer is the set duration as described above, and specifies: when the timer is overtime, that is, within a set time length, if the first router has not received the feedback packet of the transmitted probe packet, it is determined that the MTU encapsulated by the transmitted probe packet is too large and discarded, and the first router may transmit a loopback packet to the second router. The setting of the timing duration of the timer can refer to the related description of the embodiment shown in fig. 3, and is not repeated.
For example, the first router needs to probe an MTU supported by a two-layer network between the first router and the second router, and the first router may enable a two-layer pathmtu detection function for an outgoing interface of the first router, so that the probe function of the MTU is started.
In the process of detecting the MTU, the first router generates a detection message, a source IP address of the detection message is an IP address of an outgoing interface of the first router, a source MAC address of the detection message is also an MAC address of an outgoing interface of the first router, a destination IP address of the detection message is an IP address of an incoming interface of the second router, and a destination MAC address of the detection message is also an MAC address of an incoming interface of the second router. In the detection message, the MTU encapsulated by the first router is an MTU supported by the egress interface of the first router, and the MTU encapsulated in the detection message is referred to as a first MTU, where taking the scenario shown in fig. 4A as an example, the first MTU is equal to 1500. And the first router sets the value of the DF flag bit in the detection message to 1, which indicates that the detection message can not be split and transmitted.
Considering network quality and other factors, the first router may send at least one probe packet to the second router, for example, the first router sends one probe packet to the second router every first time duration, the first router may start a timer when sending the first probe packet, and before the timer expires, the first router considers that the probe packet is successfully sent as long as it receives one probe feedback packet. For the description of this part, reference may be made to the related description in the embodiment shown in fig. 3, and details are not repeated.
The switch receives at least one probe message, which is described herein by way of example as the way the switch processes one of the probe messages, e.g., the first probe message received by the switch. The switch learns the MAC address of the first router egress interface upstream and discards the probe packet downstream because the MTU encapsulated by the probe packet is too large. At this time, the switch may record the MTU corresponding to the MAC address, where the MTU is an MTU of an outgoing interface of the switch, that is, an MTU supported by the switch, and is also an MTU supported by a transmission path between the first router and the second router. For example, the switch may map the mapping between the recorded MAC addresses and MTUs into the switch's MAC forwarding table.
When the timer is overtime, it is obvious that the first router does not receive the detection feedback message sent by the second router, and then the first router generates a loopback message, which is implemented by, for example, an ECHO (ECHO) message as an example. The encapsulation of the loopback packet is, for example: the source MAC address and the destination MAC address encapsulated at the data link layer are both MAC addresses of the outgoing interface of the first router, for example, 00-E0-FC-01-01-22 shown in fig. 4A, the source IP address and the destination IP address encapsulated at the network layer are both IP addresses of the outgoing interface of the first router, an ICMP unreachable message is encapsulated at the transport layer, and the next-hop MTU is filled in as 0 in the ICMP unreachable message.
And the first router sends the loopback message to the second router, and the switch receives the loopback message. The switch may obtain the MTU corresponding to the MAC address of the outgoing interface of the first router by querying the MAC forwarding table, and then the switch adds the MTU to the loopback message, for example, the switch fills the MTU in the next-hop MTU field in the ICMP unreachable message encapsulated in the ECHO message to obtain a loopback feedback message, and the MTU in the loopback feedback message is referred to as a second MTU herein.
The switch sends the loopback feedback message, and since the destination IP address of the loopback message is the IP address of the first router and the destination MAC address is also the MAC address of the first router, the loopback feedback message will return to the first router, or it is understood that the switch sends the loopback feedback message to the first router, and the first router receives the loopback feedback message, as shown by the loopback arrow in fig. 4A. The first router can obtain the second MTU encapsulated therein by analyzing the loopback feedback message, so that the first router can dynamically adjust the MTU of the outgoing interface of the first router according to the second MTU, which can be understood as that the first router adjusts the MTU supported by the outgoing interface of the first router to the second MTU.
In addition, if the time interval between the detection message timeout and the first router triggering the loopback message is too long, the MAC forwarding table of the intermediate switch device may be aged, and the recorded mapping relationship between the MAC address of the outgoing interface of the first router and the MTU supported by the switch cannot be stored continuously. In view of this, it may be specified that, after the detection message is overtime, the first router needs to enter the ECHO process within the second duration, that is, the first router triggers the ECHO message, so as to ensure that the detection is continued. The second time period may be, for example, 3 minutes, or may also be set to other time periods, and specifically may be determined according to factors such as an aging speed of the MAC forwarding table, and in addition, may also be dynamically adjusted according to a requirement after being set.
Then, if the first router sends the service message to the second router, the MTU of the service message uses the second MTU. The service packet may be generated by the first router, or may also be forwarded by other devices through the first router. Then, the first router may also send a notification message to other devices upstream of the first router, for example, send an ICMP unreachable message, where the ICMP unreachable message may be an ICMP unreachable message encapsulated in a loopback feedback message, which is equivalent to that the first router may directly analyze the loopback feedback message to obtain the ICMP unreachable message and directly send the ICMP unreachable message to other devices upstream of the first router, so that the ICMP unreachable message does not need to be re-generated, and the processing flow is reduced. After receiving the notification message, the other device can determine that the subsequently sent service message uses the second MTU, thereby improving the success rate of message transmission.
The embodiment of the application supplements and expands the technology of learning and discovering the network path MTU, and provides a discovery technology capable of efficiently and quickly detecting the path MTU of the two-layer network. In the embodiment of the present application, if it is determined that the sending of the probe packet fails, the first router may directly send a loopback packet, so as to directly obtain the MTU supported by the transmission path between the first router and the second router, thereby solving the problem of finding the MTU in a two-layer network, without requiring excessive probing processes, and increasing the probing speed. And the protocol neighbor relation between the first router and the second router can be normally established, and the message can be transmitted between the first router and the second router.
The following describes the apparatus provided by the embodiments of the present application with reference to the drawings.
Fig. 5 shows a schematic structure of a router 500. The router 500 may implement the functionality of the first router referred to above. The router 500 may be the first router described above, or may be a chip provided in the first router described above. The router 500 may include a processor 501 and a transceiver 502. Among other things, processor 501 may be used to perform S303, S304, and S311 in the embodiment shown in fig. 3, and/or other processes for supporting the techniques described herein. Transceiver 502 may be used to perform S301, S305, S306, and S310 in the embodiment shown in fig. 3, and/or other processes for supporting the techniques described herein.
For example, the transceiver 502 is configured to send at least one first probe packet to a second router, where the first probe packet encapsulates a first MTU, where the first MTU is an MTU supported by an egress interface of the router, and the first probe packet is used to detect whether a packet with a size of the first MTU can be sent to the second router;
a processor 501, configured to determine that a first detection feedback packet is not received from the second router within a set time duration, where the first detection feedback packet is a feedback packet of the first detection packet;
the processor 501 is further configured to clip the first MTU by a first step size to obtain a second MTU;
the transceiver 502 is further configured to send at least one second probe packet encapsulating the second MTU to a second router until the transceiver module receives a probe feedback packet from the second router within the set time period;
the processor 501 is further configured to use the third MTU obtained by the last clipping as the MTU supported by the transmission path from the first router to the second router.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
Fig. 6 shows a schematic diagram of a router 600. The router 600 may implement the functionality of the first router referred to above. The router 600 may be the first router described above, or may be a chip provided in the first router described above. The router 600 may include a processor 601 and a transceiver 602. Among other things, processor 601 may be used to perform S43 and S47 in the embodiment shown in FIG. 4B, and/or other processes for supporting the techniques described herein. The transceiver 602 may be used to perform S41, S44, and S46 in the embodiment shown in fig. 4B, and/or other processes for supporting the techniques described herein.
For example, the transceiver 602 is configured to send a probe packet to a second router, where the probe packet encapsulates a first MTU, where the first MTU is an MTU supported by an egress interface of the router, and the probe packet is used to detect whether a packet with a size of the first MTU can be sent to the second router;
a processor 601, configured to determine that a detection feedback packet is not received from the second router within a set duration, where the detection feedback packet is a feedback packet of the detection packet;
the transceiver 602 is further configured to send a loopback packet to the second router, where the loopback packet is used to request an MTU supported by a transmission path from the router to the second router;
the transceiver 602 is further configured to receive a loopback feedback message, where the loopback feedback message is a feedback message of the loopback message;
the processor 601 is further configured to obtain a second MTU indicated by the loopback feedback packet, where the second MTU is an MTU supported by a transmission path from the router to the second router.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
Fig. 7 shows a schematic diagram of a switch 700. The switch 700 may implement the functionality of the switch referred to above (the first switch). The switch 700 may be the switch (first switch) described above, or may be a chip provided in the switch (first switch) described above. The switch 700 may include a processor 701 and a transceiver 702. Among other things, processor 701 may be used to perform S42 and S45 in the embodiment shown in FIG. 4B, and/or other processes for supporting the techniques described herein. The transceiver 702 may be used to perform S41, S44, and S46 in the embodiment shown in fig. 4B, and/or other processes for supporting the techniques described herein.
For example, the transceiver 702 is configured to receive a loopback packet from a first router, where the loopback packet is used to request an MTU supported by a transmission path between the first router and a second router, and the switch is located on the transmission path between the first router and the second router;
the processor 701 is further configured to add a second MTU to the loopback report to obtain a loopback feedback message, where the second MTU is an MTU supported by the switch;
the transceiver 702 is further configured to send the loopback feedback packet to the first router.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
In a simple embodiment, it will be appreciated by those skilled in the art that the router 500, the router 600 or the switch 700 may also be implemented by the structure of the communication apparatus 800 as shown in fig. 8A. The communication apparatus 800 may implement the functions of the network device or the communication device referred to above. The communication device 800 may include a processor 801. Where the communication device 800 is configured to implement the functionality of the first router in the embodiment shown in fig. 3, the processor 801 may be configured to perform steps S303, S304, and S311 in the embodiment shown in fig. 3, and/or other processes for supporting the techniques described herein. When the communications device 800 is used to implement the functionality of the first router in the embodiment shown in fig. 4B, the processor 801 may be used to perform S43 and S47 in the embodiment shown in fig. 4B, and/or other processes for supporting the techniques described herein. When the communication apparatus 800 is used to implement the functions of the switch (first switch) in the embodiment shown in fig. 4B, the processor 801 may be used to perform S42 and S45 in the embodiment shown in fig. 4B, and/or other processes for supporting the techniques described herein.
The communication device 800 may be implemented by a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system on chip (SoC), a Central Processing Unit (CPU), a Network Processor (NP), a digital signal processing circuit (DSP), a Micro Controller Unit (MCU), or a programmable controller (PLD) or other integrated chips, and the communication device 600 may be disposed in the network device or the communication device according to the embodiment of the present application, so that the network device or the communication device implements the method for transmitting a message according to the embodiment of the present application.
In an alternative implementation, the communication device 800 may further include a memory 802, see fig. 8B, wherein the memory 802 is used for storing computer programs or instructions, and the processor 801 is used for decoding and executing the computer programs or instructions. It will be appreciated that these computer programs or instructions may include the functionality of the first router or switch (first switch) described above. When the functional program of the first router is decoded and executed by the processor 801, the first router can be enabled to implement the function of the first router in the communication method provided by the embodiment shown in fig. 3 or the embodiment shown in fig. 4B in the present application. When the functional program of the switch (first switch) is decoded and executed by the processor 801, the switch (first switch) can be made to implement the function of the switch (first switch) in the communication method provided by the embodiment shown in fig. 4B of the embodiment of the present application.
In an alternative implementation, these first router or switch (first switch) functions are stored in memory external to the communications device 800. When the functional program of the first router is decoded and executed by the processor 801, part or all of the content of the functional program of the first router is temporarily stored in the memory 802. When the functional program of the switch (first switch) is decoded and executed by the processor 801, part or all of the content of the functional program of the switch (first switch) is temporarily stored in the memory 802.
In an alternative implementation, these first router or switch (first switch) functions are provided in a memory 802 stored within the communications device 800. When the memory 802 inside the communication apparatus 800 stores the function program of the first router, the communication apparatus 800 may be provided in the first router of the embodiment of the present application. When the memory 802 inside the communication apparatus 800 stores therein a function program of a switch (first switch), the communication apparatus 800 may be provided in the switch (first switch) of the embodiment of the present application.
In yet another alternative implementation, some of the contents of the functional programs of the first routers are stored in a memory external to the communication device 800, and other portions of the contents of the functional programs of the first routers are stored in a memory 802 internal to the communication device 800. Alternatively, part of the contents of the function programs of these switches (first switches) are stored in a memory external to the communication device 800, and the other part of the contents of the function programs of these switches (first switches) are stored in the memory 802 internal to the communication device 800.
In the embodiment of the present application, the router 500, the router 600, the switch 700, and the communication apparatus 800 may be presented in the form of dividing each functional module according to each function, or may be presented in the form of dividing each functional module in an integrated manner. As used herein, a "module" may refer to an ASIC, a processor and memory that execute one or more software or firmware programs, an integrated logic circuit, and/or other components that provide the described functionality.
In addition, the embodiment shown in fig. 5 provides a router 500 that can be implemented in other forms. For example, the router includes a processing module and a transceiver module. For example, the processing module may be implemented by the processor 501 and the transceiver module may be implemented by the transceiver 502. Among other things, the processing module may be used to perform S303, S304, and S311 in the embodiment shown in fig. 3, and/or other processes for supporting the techniques described herein. The transceiver module may be used to perform S301, S305, S306, and S310 in the embodiment shown in fig. 3, and/or other processes for supporting the techniques described herein.
For example, the transceiver module is configured to send at least one first probe packet to a second router, where the first probe packet encapsulates a first MTU, the first MTU is an MTU supported by an egress interface of the router, and the first probe packet is used to detect whether a packet with a size of the first MTU can be sent to the second router;
a processing module, configured to determine that a first detection feedback packet is not received from the second router within a set duration, where the first detection feedback packet is a feedback packet of the first detection packet;
the processing module is further used for clipping the first MTU by a first step length to obtain a second MTU;
the transceiver module is further configured to send at least one second detection packet encapsulating the second MTU to a second router until the transceiver module receives a detection feedback packet from the second router within the set duration;
and the processing module is further configured to use the third MTU obtained by the last clipping as an MTU supported by a transmission path from the first router to the second router.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
The embodiment shown in fig. 6 provides a router 600 that may also be implemented in other forms. For example, the router includes a processing module and a transceiver module. For example, the processing module may be implemented by the processor 601 and the transceiver module may be implemented by the transceiver 602. Among other things, the processing module may be used to perform S43 and S47 in the embodiment shown in FIG. 4B, and/or other processes for supporting the techniques described herein. The transceiver module may be used to perform S41, S44, and S46 in the embodiment shown in fig. 4B, and/or other processes for supporting the techniques described herein.
For example, the transceiver module is configured to send a detection packet to a second router, where the detection packet encapsulates a first MTU, where the first MTU is an MTU supported by an egress interface of the router, and the detection packet is used to detect whether a packet with a size of the first MTU can be sent to the second router;
a processing module, configured to determine that a detection feedback packet is not received from the second router within a set duration, where the detection feedback packet is a feedback packet of the detection packet;
the receiving and sending module is further configured to send a loopback message to the second router, where the loopback message is used to request an MTU supported by a transmission path from the router to the second router;
the receiving and sending module is also used for receiving a loopback feedback message, wherein the loopback feedback message is a feedback message of the loopback message;
and the processing module is further configured to acquire a second MTU indicated by the loopback feedback packet, where the second MTU is an MTU supported by a transmission path from the router to the second router.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
The embodiment shown in fig. 7 provides a switch 700 that may also be implemented in other forms. For example, the switch includes a processing module and a transceiver module. For example, the processing module may be implemented by the processor 701, and the transceiver module may be implemented by the transceiver 702. Among other things, the processing module may be used to perform S42 and S45 in the embodiment shown in FIG. 4B, and/or other processes for supporting the techniques described herein. The transceiver module may be used to perform S41, S44, and S46 in the embodiment shown in fig. 4B, and/or other processes for supporting the techniques described herein.
For example, the transceiver module is configured to receive a loopback packet from a first router, where the loopback packet is used to request an MTU supported by a transmission path between the first router and a second router, and the switch is located on the transmission path between the first router and the second router;
the processing module is further configured to add a second MTU to the loopback report to obtain a loopback feedback message, where the second MTU is an MTU supported by the switch;
and the transceiver module is further configured to send the loopback feedback message to the first router.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
Since the router 500, the router 600, the switch 700, and the communication apparatus 800 provided in the embodiment of the present application can be used to execute the method provided in the embodiment shown in fig. 3 or the embodiment shown in fig. 4B, the technical effects obtained by the method can refer to the above method embodiment, and are not described herein again.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a Digital Versatile Disk (DVD)), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
It will be apparent to those skilled in the art that various changes and modifications may be made in the embodiments of the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to encompass such modifications and variations.

Claims (23)

1. A method of communication, comprising:
a first router sends at least one first detection message to a second router, wherein the at least one first detection message is transmitted in a two-layer network between the first router and the second router, the first detection message encapsulates a first Maximum Transmission Unit (MTU), the first MTU is an MTU supported by an outgoing interface of the first router, and the first detection message is used for detecting whether a message with the size of the first MTU can be sent to the second router;
the first router determines that a first detection feedback message is not received from the second router through the two-layer network within a set time length, wherein the first detection feedback message is a feedback message of the first detection message;
the first router cuts the first MTU by a first step length to obtain a second MTU;
the first router sends at least one second detection message encapsulating the second MTU to a second router, and the at least one second detection message encapsulating the second MTU is transmitted in a two-layer network between the first router and the second router until the first router receives a detection feedback message from the second router within the set time length; and the first router takes the third MTU obtained by the last clipping as the MTU supported by the transmission path from the first router to the second router.
2. The method of claim 1, wherein the first router sending at least one first probe packet to the second router comprises:
and the first router sends the first detection message to the second router every other first time.
3. The method of claim 2, wherein the first probe message and the second probe message are ping messages.
4. The method of any of claims 1-3, wherein the method further comprises:
the first router adjusts the first MTU supported by an outgoing interface of the first router to the third MTU;
and the first router sends a service message to the second router, wherein the MTU of the service message is the third MTU.
5. A method of communication, comprising:
a first router sends a detection message to a second router, wherein the detection message encapsulates a first Maximum Transmission Unit (MTU), the first MTU is an MTU supported by an outgoing interface of the first router, and the detection message is used for detecting whether a message with the size of the first MTU can be sent to the second router;
the first router determines that a detection feedback message is not received from the second router within a set time length, wherein the detection feedback message is a feedback message of the detection message;
the first router sends a loopback message to the second router, wherein the loopback message is used for requesting an MTU (maximum transmission unit) supported by a transmission path from the first router to the second router, and the loopback message does not include the MTU;
the first router receives a loopback feedback message, wherein the loopback feedback message is a feedback message of the loopback message;
and the first router acquires a second MTU indicated by the loopback feedback message, wherein the second MTU is an MTU supported by a transmission path from the first router to the second router.
6. The method of claim 5, wherein the method further comprises:
the first router adjusts the first MTU supported by an outgoing interface of the first router to the second MTU;
and the first router sends a service message to the second router, wherein the MTU of the service message is the second MTU.
7. A method of communication, comprising:
the method comprises the steps that a switch receives a loopback message from a first router, the loopback message is used for requesting MTU (maximum transmission unit) supported by a transmission path from the first router to a second router, the loopback message does not comprise the MTU, and the switch is located on the transmission path between the first router and the second router;
the switch adds a second MTU in the loop feedback message to obtain a loop feedback message, wherein the second MTU is an MTU supported by the switch;
and the switch sends the loopback feedback message to the first router, wherein the second MTU included in the loopback feedback message is used for adjusting the MTU supported by the output interface of the first router.
8. A method according to any of claims 5-7, wherein said loopback message is an ECHO message.
9. The method according to any of claims 5-8, wherein the destination address of the loopback message is an address of an outgoing interface of the first router.
10. A router, comprising:
a transceiver module, configured to send at least one first probe packet to a second router, where the at least one first probe packet is transmitted in a two-layer network between the router and the second router, and the first probe packet encapsulates a first Maximum Transmission Unit (MTU), where the first MTU is an MTU supported by an egress interface of the router, and is used to detect whether a packet with a size of the first MTU can be sent to the second router;
a processing module, configured to determine that a first detection feedback packet is not received from the second router through the two-layer network within a set duration, where the first detection feedback packet is a feedback packet of the first detection packet;
the processing module is further configured to clip the first MTU by a first step size to obtain a second MTU;
the transceiver module is further configured to send, to a second router, at least one second probe packet encapsulating the second MTU, where the at least one second probe packet encapsulating the second MTU is transmitted in a two-layer network between the router and the second router until the transceiver module receives a probe feedback packet from the second router within the set duration;
the processing module is further configured to use the third MTU obtained by the last clipping as the MTU supported by the transmission path from the first router to the second router.
11. The router according to claim 10, wherein the transceiver module, when sending at least one first probe packet to the second router, is specifically configured to:
and sending the first detection message to the second router every other first time.
12. The router of claim 11, wherein the first probe message and the second probe message are ping messages.
13. The router according to any of claims 10-12,
the processing module is further configured to adjust the first MTU supported by an egress interface of the router to the third MTU;
the transceiver module is further configured to send a service packet to the second router, where an MTU of the service packet is the third MTU.
14. A router, comprising:
a transceiver module, configured to send a detection packet to a second router, where the detection packet encapsulates a first maximum transmission unit MTU, the first MTU is an MTU supported by an egress interface of the router, and the detection packet is used to detect whether a packet with a size of the first MTU can be sent to the second router;
a processing module, configured to determine that a detection feedback packet is not received from the second router within a set duration, where the detection feedback packet is a feedback packet of the detection packet;
the transceiver module is further configured to send a loopback packet to the second router, where the loopback packet is used to request an MTU supported by a transmission path from the router to the second router, and the loopback packet does not include the MTU;
the transceiver module is further configured to receive a loopback feedback message, where the loopback feedback message is a feedback message of the loopback message;
the processing module is further configured to acquire a second MTU indicated by the loopback feedback packet, where the second MTU is an MTU supported by a transmission path from the router to the second router.
15. The router of claim 14,
the processing module is further configured to adjust the first MTU supported by the egress interface of the router to the second MTU;
the transceiver module is further configured to send a service packet to the second router, where an MTU of the service packet is the second MTU.
16. The router according to claim 14 or 15, wherein said loopback message is an ECHO message.
17. The router according to any of claims 14-16, wherein a destination address of the loopback message is an address of an outgoing interface of the first router.
18. A switch, comprising:
a transceiver module, configured to receive a loopback packet from a first router, where the loopback packet is used to request an MTU supported by a transmission path from the first router to a second router, and the loopback packet does not include the MTU, and the switch is located on the transmission path between the first router and the second router;
the processing module is used for adding a second MTU in the loopback message to obtain a loopback feedback message, wherein the second MTU is an MTU supported by the switch;
the transceiver module is further configured to send the loopback feedback packet to the first router, where the second MTU included in the loopback feedback packet is used to adjust an MTU supported by an egress interface of the first router.
19. The switch of claim 18, wherein the loopback message is an ECHO message.
20. The switch according to claim 18 or 19, wherein the destination address of the loopback message is an address of an outgoing interface of the first router.
21. A computer-readable storage medium storing a program or instructions which, when executed by one or more processors, implement the method of any one of claims 1-4.
22. A computer-readable storage medium storing a program or instructions which, when executed by one or more processors, implement the method of claim 5, 6, 8 or 9.
23. A computer-readable storage medium storing a program or instructions which, when executed by one or more processors, implement the method of claim 7.
CN201711270248.XA 2017-12-05 2017-12-05 Communication method and device Active CN109873763B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711270248.XA CN109873763B (en) 2017-12-05 2017-12-05 Communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711270248.XA CN109873763B (en) 2017-12-05 2017-12-05 Communication method and device

Publications (2)

Publication Number Publication Date
CN109873763A CN109873763A (en) 2019-06-11
CN109873763B true CN109873763B (en) 2021-12-03

Family

ID=66916615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711270248.XA Active CN109873763B (en) 2017-12-05 2017-12-05 Communication method and device

Country Status (1)

Country Link
CN (1) CN109873763B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111654354B (en) * 2020-05-28 2023-08-08 北京小米移动软件有限公司 Method and device for detecting maximum transmission unit MTU and storage medium
CN115842732B (en) * 2023-02-13 2023-05-23 北京天维信通科技有限公司 Method for detecting MTU (modulation transfer unit) in distributed full path

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1716943A (en) * 2004-06-28 2006-01-04 杭州华为三康技术有限公司 Method and system for obtaining path maximum transmission length in channel gateway environment
CN1716944A (en) * 2004-06-28 2006-01-04 杭州华为三康技术有限公司 Method for discovering maximum transmission length of network path
CN1992638A (en) * 2005-12-26 2007-07-04 华为技术有限公司 Method and system for obtaining path maximum transmission unit in network
CN101159691A (en) * 2007-11-22 2008-04-09 杭州华三通信技术有限公司 Originated multi-protocol label switching packet maximum length determining method and node
CN101616078A (en) * 2009-07-16 2009-12-30 杭州华三通信技术有限公司 A kind of discover method of PMTU, router and node device
CN102325076A (en) * 2011-05-24 2012-01-18 中兴通讯股份有限公司 Method for discovering PMTU (Path Maximum Transfer Unit) and node
US9282050B2 (en) * 2013-10-30 2016-03-08 Palo Alto Research Center Incorporated System and method for minimum path MTU discovery in content centric networks

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9356879B2 (en) * 2014-05-22 2016-05-31 Dell Products L.P. Optimized path maximum transmission unit discovery

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1716943A (en) * 2004-06-28 2006-01-04 杭州华为三康技术有限公司 Method and system for obtaining path maximum transmission length in channel gateway environment
CN1716944A (en) * 2004-06-28 2006-01-04 杭州华为三康技术有限公司 Method for discovering maximum transmission length of network path
CN1992638A (en) * 2005-12-26 2007-07-04 华为技术有限公司 Method and system for obtaining path maximum transmission unit in network
CN101159691A (en) * 2007-11-22 2008-04-09 杭州华三通信技术有限公司 Originated multi-protocol label switching packet maximum length determining method and node
CN101616078A (en) * 2009-07-16 2009-12-30 杭州华三通信技术有限公司 A kind of discover method of PMTU, router and node device
CN102325076A (en) * 2011-05-24 2012-01-18 中兴通讯股份有限公司 Method for discovering PMTU (Path Maximum Transfer Unit) and node
US9282050B2 (en) * 2013-10-30 2016-03-08 Palo Alto Research Center Incorporated System and method for minimum path MTU discovery in content centric networks

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Path MTU Discovery;J. Mogul;;《RCF1191》;19901130;全文 *

Also Published As

Publication number Publication date
CN109873763A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
US11522790B2 (en) Multipath data transmission processing method and network device
US10904932B2 (en) Tunnel binding based communication method and network device
US20210083948A1 (en) On-demand probing for quality of experience metrics
RU2456745C2 (en) Method and device for macrodiversion of downlink in cellular communication networks
US9276898B2 (en) Method and device for link fault detecting and recovering based on ARP interaction
WO2011110118A2 (en) Fault detection method and system
US10750553B2 (en) Systems and methods for selection of collocated nodes in 5G network
CN108601043B (en) Method and apparatus for controlling wireless access point
WO2016081734A2 (en) Techniques to support heterogeneous network data path discovery
US8811190B2 (en) Maximum transmission unit (MTU) size discovery mechanism and method for data-link layers
WO2015096409A1 (en) Method, device and system for discovering link in software-defined network
US11502962B2 (en) Method, apparatus, and system for implementing data transmission
EP3979576A1 (en) Packet forwarding method, device, and computer-readable storage medium
EP3817285B1 (en) Method and device for monitoring forwarding table entry
JP2014520428A (en) Multipath overlay network and multipath management protocol thereof
EP4138443A1 (en) Communication method and apparatus
US9800479B2 (en) Packet processing method, forwarder, packet processing device, and packet processing system
JP2021534669A (en) Packet processing method and gateway device
US9503276B2 (en) Method and system to reduce wireless network packets for centralised layer two network
CN109873763B (en) Communication method and device
KR20140124116A (en) Apparatus and method for optimizing data-path in mobile communication network
WO2021232841A1 (en) Communication method and apparatus
WO2021109997A1 (en) Anti-fiber breakage method and device for segment routing tunnel, ingress node and storage medium
US9426186B2 (en) Methods and systems for load balancing call sessions over a dual ring internet protocol (IP) network
WO2019196853A1 (en) Tcp acceleration method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant