CN116192768A - Method, device, equipment and storage medium for determining maximum transmission unit - Google Patents
Method, device, equipment and storage medium for determining maximum transmission unit Download PDFInfo
- Publication number
- CN116192768A CN116192768A CN202310207235.7A CN202310207235A CN116192768A CN 116192768 A CN116192768 A CN 116192768A CN 202310207235 A CN202310207235 A CN 202310207235A CN 116192768 A CN116192768 A CN 116192768A
- Authority
- CN
- China
- Prior art keywords
- mtu
- target
- message
- node
- length
- 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.)
- Pending
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 83
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000001514 detection method Methods 0.000 claims abstract description 238
- 238000004891 communication Methods 0.000 claims abstract description 21
- 238000012544 monitoring process Methods 0.000 claims abstract description 18
- 239000000523 sample Substances 0.000 claims description 42
- 238000004590 computer program Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 10
- 238000012545 processing Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 238000005538 encapsulation Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000013024 troubleshooting Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/36—Flow control; Congestion control by determining packet size, e.g. maximum transfer unit [MTU]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
- H04L43/0882—Utilisation of link capacity
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Storage Device Security (AREA)
Abstract
The application relates to a method, a device, equipment and a storage medium for determining a maximum transmission unit, wherein the method is used for source node equipment, and the source node equipment comprises a target source node, a virtual node and a capturing node; the target source node, the virtual node and the capture node are respectively in communication connection with a data exchange node; the method comprises the following steps: when a detection request for the MTU of the target maximum transmission unit is received, the virtual node is controlled to forward the MTU detection message through the data exchange node; the capturing node is used for carrying out message receiving monitoring on the data exchange node; when a target reply message corresponding to the MTU detection message is monitored, the MTU of the target maximum transmission unit is determined according to the target reply message, and a program for receiving and transmitting a specific message is not required to be installed on a source node, so that safety risks such as data leakage and the like occurring when the MTU is determined are avoided, and the problem that a user does not trust the installed program is solved.
Description
Technical Field
The present invention relates to the field of data communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for determining a maximum transmission unit.
Background
In a network, information is usually transferred in units of data packets, and the length of the largest data packet that can be transmitted by the network is called a maximum transmission unit (Maximum Transmission Unit, MTU). When the length of a data packet transmitted by a network exceeds the MTU, the message is fragmented and even lost, so that the problems of errors, traffic failure of large packets and the like occur in the network transmission. Thus, determining the MTU in a network transmission is significant for troubleshooting definitions of network transmission problems.
In the prior art, a program for transmitting and receiving a specific message is generally installed at a source node, and when determining the MTU of a network, the program is operated so that the source node transmits a probe message of a specific length to a destination node. After the source node receives the message returned by the destination node, judging whether the length of the message returned by the destination node is a valid MTU. If so, continuously increasing the length of the detection message sent to the destination node by the source node until the destination node does not return the message any more in a specific time period, thereby determining the MTU of the network.
However, in the above solution, the need to obtain the user rights to install the program for transmitting and receiving the specific message at the source node may cause security risks such as data leakage and the like when determining the MTU, and problems that the user does not trust the installed program.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for determining a maximum transmission unit, which do not need to install a program for sending and receiving a specific message at a source node, solve the problems of security risks such as data leakage and the like and the program which is not trusted to be installed by a user when determining an MTU.
In one aspect, a method for determining a maximum transmission unit is provided, where the method is used for a source node device, and the source node device includes a target source node, a virtual node, and a capture node; the target source node, the virtual node and the capture node are respectively in communication connection with the data exchange node;
the method comprises the following steps:
when a detection request for the MTU of the target maximum transmission unit is received, the virtual node is controlled to forward the MTU detection message through the data exchange node;
the method comprises the steps that message receiving monitoring is conducted on a data exchange node through a capturing node;
when a target reply message corresponding to the MTU detection message is monitored, determining a target maximum transmission unit MTU according to the target reply message.
Optionally, the MTU probe packet includes a target identification number, and the method further includes:
when the reply message with the target identification number is monitored, the reply message with the target identification number is determined to be the target reply message.
Optionally, the MTU probe packet includes an non-sharable identifier, where the non-sharable identifier is used to characterize that neither the MTU probe packet nor the target reply packet is sent in a sharable manner.
Optionally, determining the target maximum transmission unit MTU according to the target reply message includes:
acquiring a first length of a target reply message and a second length of an MTU detection message;
when the first length is equal to the second length, determining that the target reply message is valid;
when the first length is not equal to the second length, determining that the target reply message is invalid;
and determining the MTU of the target maximum transmission unit according to the effective target reply message.
Optionally, determining the target maximum transmission unit MTU according to the valid target reply message includes:
updating the second length of the MTU detection message to the latest length when the effective target reply message is acquired until the latest length meets the detection ending condition;
and determining the latest length as a target Maximum Transmission Unit (MTU), wherein the detection ending condition is that the latest length is the maximum value in a preset detection range.
Optionally, updating the second length of the MTU probe message to the latest length each time a valid target reply message is acquired until the latest length meets the probe end condition includes:
when the second length is equal to the maximum value in the preset detection range, determining the maximum value in the preset detection range as the latest length;
when the second length is greater than or equal to the minimum value in the preset detection range and less than the maximum value in the preset detection range, the following steps are executed until the minimum value in the updated preset detection range is equal to the maximum value:
determining the median value of the current preset detection range as the latest length to obtain an updated MTU detection message;
the control virtual node forwards the updated MTU detection message through the data exchange node so as to obtain a reply message corresponding to the updated MTU detection message, and obtain the updated reply message;
and updating the maximum value or the minimum value in the current preset detection range according to the third length and the median value of the updated reply message to obtain the updated preset detection range.
Optionally, updating the maximum value or the minimum value in the preset detection range according to the third length and the median of the updated reply message, and obtaining the updated preset detection range includes:
When the third length is equal to the median value, updating the median value to the minimum value in the current preset detection range to obtain an updated preset detection range;
and when the third length is not equal to the median value, updating the subtracted median value to the maximum value in the current preset detection range, and obtaining the updated preset detection range.
In yet another aspect, a determining apparatus of a maximum transmission unit is provided, where the apparatus is used for a source node device, and the source node device includes a target source node, a virtual node, and a capturing node; the target source node, the virtual node and the capture node are respectively in communication connection with the data exchange node;
the device comprises:
the control module is used for controlling the virtual node to forward the MTU detection message through the data exchange node when receiving the detection request of the MTU of the target maximum transmission unit;
the monitoring module is used for carrying out message receiving monitoring on the data exchange node through the capture node;
and the determining module is used for determining the maximum MTU of the target transmission unit according to the target reply message when the target reply message corresponding to the MTU detection message is monitored.
In yet another aspect, a computer device is provided, the computer device including a processor and a memory having at least one instruction stored therein, the at least one instruction being loaded and executed by the processor to implement the method of determining a maximum transmission unit described above.
In yet another aspect, a computer readable storage medium having stored therein at least one instruction loaded and executed by a processor to implement the method of determining a maximum transmission unit described above is provided.
In yet another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium and executes the computer instructions so that the computer device performs the method of determining the maximum transmission unit described above.
The technical scheme that this application provided can include following beneficial effect:
when receiving a detection request for the MTU of the target maximum transmission unit, the virtual node can be controlled to forward the MTU detection message through the data exchange node when the target source node, the virtual node and the capture node are in communication connection with the data exchange node, so that the MTU detection message is prevented from being sent by the source node, and a program for sending a specific message is not required to be installed on the target source node by acquiring relevant user rights; the data exchange node is monitored by the capturing node through message receiving, when a target reply message corresponding to the MTU detection message is monitored, the MTU of the target maximum transmission unit is determined according to the target reply message, the source node is prevented from receiving the target reply message corresponding to the MTU detection message, and a program for receiving a specific message is not required to be installed on the target source node by acquiring relevant user rights. In summary, through the new virtual node and the capturing node respectively sending and monitoring the message related to the MTU determination, the program for receiving and sending the specific message does not need to be installed on the source node, the permission information related to the user on the target source node does not need to be acquired, the security risks such as data leakage and the like occurring when the MTU determination is performed are avoided, and the problem that the user does not trust the installed program is solved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram showing a configuration of a system for determining a maximum transmission unit according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a method of determining a maximum transmission unit according to an exemplary embodiment.
Fig. 3 is a schematic diagram of an ICMP message structure according to an exemplary embodiment.
Fig. 4 is a flowchart illustrating a method of determining a maximum transmission unit according to an exemplary embodiment.
Fig. 5 is a specific workflow diagram illustrating a method of determining a maximum transmission unit according to an exemplary embodiment.
Fig. 6 is a block diagram showing the construction of a maximum transmission unit determining apparatus according to an exemplary embodiment.
Fig. 7 shows a block diagram of a computer device according to an exemplary embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made apparent and fully in view of the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
It should be understood that, in the embodiments of the present application, the "indication" may be a direct indication, an indirect indication, or an indication having an association relationship. For example, a indicates B, which may mean that a indicates B directly, e.g., B may be obtained by a; it may also indicate that a indicates B indirectly, e.g. a indicates C, B may be obtained by C; it may also be indicated that there is an association between a and B.
In the description of the embodiments of the present application, the term "corresponding" may indicate that there is a direct correspondence or an indirect correspondence between the two, or may indicate that there is an association between the two, or may indicate a relationship between the two and the indicated, configured, or the like.
In the embodiment of the present application, the "predefining" may be implemented by pre-storing corresponding codes, tables or other manners that may be used to indicate relevant information in devices (including, for example, terminal devices and network devices), and the specific implementation of the present application is not limited.
Fig. 1 is a schematic diagram of a configuration of a determination system of a maximum transmission unit shown according to an exemplary embodiment. The maximum transmission unit determination system includes a source node device 110, a destination node device 120, a switch 130, and a switch 140. The source node device 110 is in communication connection with the switch 130, and the switch 130 is in communication connection with the switch 140 through the destination node device 120, so that data interaction between the source node device 110 and the destination node device 120 is realized.
Wherein, switch 130 and switch 140 are both physical switches; the source node device 110 is a network device capable of sending internet control message protocol (Internet Control Message Protocol, ICMP) messages and includes at least one virtual machine. Specifically, the source node device 110 includes a target source node 111, a data exchange node 112, a virtual switch 113, a virtual node 114, a capture node 115, and a sender node 116; the target source node 111, the virtual node 114 and the capture node 115 are all in communication connection with the data switching node 112, and the virtual switch 113 is in communication connection with the data switching node 112; the virtual node 114 is a virtual device created in advance capable of communicating with the data switching node 112; capture node 115 is also a pre-created virtual device capable of communicating with data switching node 112; the target source node 111 is a virtual machine in the source node device; the data switching node 112 may be any virtual network device, such as a tap device, that is connected to a virtual machine and provides a data transceiving function; the hairline node 116 is communicatively coupled to the virtual node 114, and the hairline node 116 is a hairline port of a hairline program (e.g., pktgen) that is pre-deployed on the source node device.
The destination node device 120 is a network device such as a computer, a virtual machine, or a virtual switch that can reply to the Ping command. When the destination node device 120 is a network device comprising at least one virtual machine, the destination node device 120 comprises a data switching node in communication with the virtual machine and a virtual switch in communication with the data switching node, the virtual switch being in communication with the switch 140. Since destination node device 120 is configured to be able to reply to the Ping command, destination node device 120 may not contain a virtual node when destination node device 120 contains a virtual machine, unlike source node device 110.
When receiving the probe request for the target maximum transmission unit MTU, the source node device 110 sends at least one MTU probe packet with a specific payload length to the virtual node 114 through pre-deployment of a packet sending procedure, so that the virtual node 114 receives the MTU probe packet and sends the at least one MTU probe packet to the data exchange node 112 for forwarding. The data switching node 112 further transmits the MTU probe message to the switch 130 through the virtual switch 113, and the switch 130 further transmits the MTU probe message to the switch 140, and further transmits the MTU probe message to the destination node device 120. When receiving the MTU detection message, the destination node device 120 returns a target reply message corresponding to the MTU detection message to the switch 140 according to the related command in the MTU detection message, the switch 140 transmits the target reply message to the switch 130 so that the target reply message is transmitted to the data switching node 112, the source node device 110 further controls the capture node 115 to perform message receiving monitoring on the data switching node 112, and when monitoring the target reply message, the source node device 110 determines a target maximum transmission unit MTU between the target source node and the destination node device according to the target reply message.
It should be noted that, in order to avoid installing a program for receiving and sending a specific message on a target source node, a location where a packet sending program is deployed does not include the target source node, and a specific deployment location of the packet sending program is not specifically limited in the embodiment of the present application, and may be deployed, for example, on a processor or a server in the source node device, or may be deployed on a network manager that manages the source node device.
Optionally, when the determining system of the maximum transmission unit is applied to an existing cloud computing system, the destination node device 120 may be a network device in the cloud computing system or a network device outside the cloud computing system, and the source node device 110 is a network device in the cloud computing system, where the packet sending program may be deployed on a server in the cloud computing system.
Alternatively, the server may be a single physical server, a server cluster formed by a plurality of physical servers, or a distributed system, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and technical computing services such as big data and artificial intelligence platforms.
Fig. 2 is a flowchart illustrating a method of determining a maximum transmission unit according to an exemplary embodiment. The method is performed by a source node device, which as shown in fig. 1 comprises a target source node, a virtual node and a capture node; the target source node, the virtual node and the capture node are respectively in communication connection with the data exchange node. As shown in fig. 2, the method for determining the maximum transmission unit may include the steps of:
in step 201, when a probe request for the MTU of the target maximum transmission unit is received, the control virtual node forwards the MTU probe message through the data exchange node.
The MTU detection message is an ICMP echo request message with the message type of Ping command reply. The encapsulation structure of the ICMP packet is shown in fig. 3, where the ICMP packet specifically includes an ethernet (ethernet) header, an IP header, an ICMP header, and a Payload, the IP header includes an option for identifying whether the ICMP packet can be fragmented, and the ICMP header includes a type option for identifying a type of the packet and a sequence number seq for identifying that the current ICMP packet is different from other ICMP packets. The type option of the ICMP message, which is an MTU probe message, is set to 0 (ping request), indicating that the message type is an ICMP echo request message replied to by the ping command. The source node device is a network device capable of sending ICMP messages and comprising at least one virtual machine, and the virtual node is a pre-created virtual device capable of communicating with the data switching node. The source node device is also in communication connection with the destination node device, and the destination node device is a network device such as a computer, a virtual machine or a virtual switch, which can reply to the Ping command.
When a user inputs a probe request command for the target maximum transmission unit MTU, the source node device receives the probe request for the target maximum transmission unit MTU. The source node device sends the MTU detection message with the length of the payload being a specific value (the specific value can be a value preset manually or a value input when a user inputs a detection request command for the MTU of the target maximum transmission unit, or a value predicted according to the MTU value between the target active node and other target node devices) to the virtual node through a packet sending port of a pre-deployed packet sending program, and then the virtual node receives the MTU detection message and forwards the MTU detection message to the target node device through the data exchange node. The destination node device is used for performing data interaction with the source node device and responding to the received MTU detection message, and can return a reply message corresponding to the MTU detection message to the source node device.
Optionally, the source node device sends at least two MTU detection messages with consistent payload lengths to the virtual node through a packet sending port of a pre-deployed packet sending program, so as to control the virtual node to forward a plurality of MTU detection messages to the destination node device through the data exchange node, and avoid the problem that the message is lost due to the problem of network communication connection quality such as poor network signals, and thus the MTU determination error is affected or the MTU determination time is prolonged.
Wherein the capture node is a pre-created virtual device capable of communicating with the data switching node. When the destination node device returns a reply message corresponding to the MTU detection message, the source node device may also receive the messages returned by other devices except the destination node device and the messages returned by the destination node device through the data exchange node, so that the capture node needs to be controlled to monitor the messages of the data exchange node so as to screen out the reply message corresponding to the MTU detection message.
In step 203, when a target reply message corresponding to the MTU detection message is monitored, a target maximum transmission unit MTU is determined according to the target reply message.
When the target node equipment responds to the received MTU detection message, a reply message with the payload consistent with the payload of the MTU detection message is returned to the source node equipment, and the source node equipment controls the capturing node to judge the ICMP message according to the encapsulation structure of the message; and monitoring the ICMP reply message with the message type being the reply message according to the type option of the ICMP header in the ICMP message, and taking the reply message with the payload consistent with the MTU detection message in the ICMP reply message as the target reply message corresponding to the MTU detection message.
After the source node device controls the capturing node to monitor the target reply message, the source node device judges whether the target reply message is effective according to whether the payload length of the target reply message is equal to the payload length of the MTU detection message. When the target reply message is valid, the source node device changes the length of the payload in the MTU detection message according to the length of the payload in the valid target reply message and a preset detection range; and then circularly detecting the MTU between the source node equipment and the destination node equipment according to the MTU detection message with the changed payload length until the circular detection is finished to obtain the MTU of the target maximum transmission unit.
Optionally, in order to reduce interference of ICMP messages replied to by Ping commands to MTU determination by other message types, the MTU probe message may include a target identification number, and the method further includes:
when the reply message with the target identification number is monitored, the reply message with the target identification number is determined to be the target reply message.
The target identification number is the sequence number seq of the ICMP header in the ICMP message. Specifically, when the MTU detection message includes the target identification number, the reply message corresponding to the MTU detection message returned by the destination node to the source node device also includes the target identification number, and after the control capture node monitors the ICMP reply message, the control capture node determines the ICMP reply message having the target identification number as the target reply message. It should be noted that, in the embodiment of the present application, the determination of the target identification number is not limited specifically, and a random value may be selected as the target identification number in a preset sequence number interval, for example, as shown in fig. 3, a random value 51234 may be selected as the target identification number in intervals [50000, 60000], or a manually set sequence number may be determined as the target identification number.
Optionally, in order to improve accuracy of determining the MTU, the MTU detection packet includes an non-sharable identifier, where the non-sharable identifier is used to characterize that neither the MTU detection packet nor the target reply packet can be sent in a sharable manner. The non-sharable identifier is to set an option for identifying whether the ICMP message can be fragmented in the IP header in the ICMP message to be "DF" so as to identify that the current ICMP message is non-sharable. When the destination node device receives the MTU detection message with the non-separately identifiable information, the destination node device also returns a reply message with the non-sharable identifier and corresponding to the MTU detection message to the source node device. The MTU detection message is set to be non-splittable, so that the possibility that the target node equipment returns a splitted target reply message to the source node equipment is avoided, the operation of recombining the message when the MTU is determined according to the splitted target reply message is further avoided, the operation error when the MTU is determined is reduced, and the accuracy of determining the MTU is further improved.
In summary, when receiving the probe request for the MTU of the target maximum transmission unit, the virtual node may be controlled to forward the MTU probe packet through the data exchange node when the target source node, the virtual node and the capture node are all in communication connection with the data exchange node, so as to avoid the source node from sending the MTU probe packet, and without acquiring the relevant user authority to install a program for sending a specific packet on the target source node; the data exchange node is monitored by the capturing node through message receiving, when a target reply message corresponding to the MTU detection message is monitored, the MTU of the target maximum transmission unit is determined according to the target reply message, the source node is prevented from receiving the target reply message corresponding to the MTU detection message, and a program for receiving a specific message is not required to be installed on the target source node by acquiring relevant user rights. In summary, through the new virtual node and the capturing node respectively sending and monitoring the message related to the MTU determination, the program for receiving and sending the specific message does not need to be installed on the source node, the permission information related to the user on the target source node does not need to be acquired, the security risks such as data leakage and the like occurring when the MTU determination is performed are avoided, and the problem that the user does not trust the installed program is solved.
Fig. 4 is a method flow diagram illustrating a method of determining a maximum transmission unit according to an exemplary embodiment. The method is performed by a source node device. As shown in fig. 3, the method for determining the maximum transmission unit may include the steps of:
in step 401, when a probe request for the MTU of the target maximum transmission unit is received, the control virtual node forwards the MTU probe message through the data exchange node.
The first length is the length of the payload in the target reply message, and the second length is the length of the payload in the MTU detection message. The specific process of the source node device monitoring the target reply message corresponding to the MTU probe message is similar to step 203 in the above embodiment, and will not be described herein. After the source node device monitors the target reply message through the capturing node, the source node device can respectively read a first message length of the target reply message and a second message length of the MTU detection message, further determine a value obtained by subtracting the lengths of the Ethernet header, the IP header and the ICMP header in the ICMP message from the first message length as a first length, and determine a value obtained by subtracting the lengths of the Ethernet header, the IP header and the ICMP header in the ICMP message from the second message length as a second length.
When the first length is equal to the second length, the source node device determines that the target reply message is valid.
In step 405, when the first length is not equal to the second length, it is determined that the target reply message is invalid.
When the first length is not equal to the second length, the source node device determines that the target reply message is invalid.
The source node device changes the length of the payload in the MTU detection message according to the length of the payload in the effective target reply message and a preset detection range; and then circularly detecting the MTU between the source node equipment and the destination node equipment according to the MTU detection message with the changed payload length until the circular detection is finished to obtain the MTU of the target maximum transmission unit.
Optionally, the source node device updates the second length of the MTU probe message to the latest length each time a valid target reply message is acquired, until the latest length meets a probe end condition, and determines the latest length as the target maximum transmission unit MTU, where the probe end condition is that the latest length is the maximum value in a preset probe range.
The source node device may not reach the maximum value when acquiring the effective target reply message, and may increase the length of the payload of the MTU detection message and then detect the MTU between the source node device and the destination node device. Therefore, the source node device continuously updates the second length of the MTU detection message to the latest length, and updates the preset detection range to determine the value of the latest length according to whether the reply message corresponding to the MTU detection message with the latest length is valid or not. And the source node equipment judges the MTU between the source node equipment and the destination node equipment to reach the maximum value until the latest length of the MTU detection message reaches the maximum value in a preset range, and takes the current latest length as the maximum transmission unit MTU of the target.
Optionally, in order to improve efficiency of MTU determination, a bisection method may be used to update a preset detection range and further update a latest length of the MTU detection packet, and specifically, updating the second length of the MTU detection packet to the latest length each time an effective target reply packet is obtained until the latest length meets a detection end condition may include:
When the second length is equal to the maximum value in the preset detection range, the maximum value in the preset detection range is determined as the latest length.
The preset detection range may be a value interval of the length of the payload in the MTU detection packet set manually in advance, or may be a value interval of the length of the payload in the MTU detection packet predicted by the source node device according to the MTU value between the target source node and other destination node devices. The source node device determines a size relationship between a second length of the MTU probe message and a maximum value in a preset probe range each time the source node device acquires a valid target reply message, and when the second length is equal to the maximum value in the preset probe range, the source node device determines the maximum value in the preset probe range as the latest length.
When the second length is greater than or equal to the minimum value in the preset detection range and less than the maximum value in the preset detection range, the following steps are executed until the minimum value in the updated preset detection range is equal to the maximum value:
and determining the median value of the current preset detection range as the latest length to obtain an updated MTU detection message.
The source node device calculates the median value of the preset detection range according to the formula 1, and updates the median value to the latest length to obtain an updated MTU detection message.
Median = (minimum value in preset detection range+maximum value in preset detection range+1)/2 formula 1
And the control virtual node forwards the updated MTU detection message through the data exchange node so as to obtain a reply message corresponding to the updated MTU detection message and obtain the updated reply message.
The source node device sends at least one same updated MTU detection message to the virtual node through a packet sending port of the packet sending program, and then the virtual node receives at least one same updated MTU detection message and forwards the updated MTU detection message to the destination node device through the data exchange node. The destination node device returns a reply message corresponding to the updated MTU detection message according to the received updated MTU detection message Xiang Yuan node device, and the source node device controls the capturing node to perform message receiving monitoring on the data exchange node so as to obtain the reply message corresponding to the updated MTU detection message, and obtain the updated reply message.
And updating the maximum value or the minimum value in the current preset detection range according to the third length and the median value of the updated reply message to obtain the updated preset detection range.
The third length is the length of the payload in the updated reply message, and the source node device determines how to update the maximum value or the minimum value of the current preset detection range according to the size relationship between the third length and the median of the updated reply message. The source node equipment updates the preset detection range through a dichotomy, so that the update speed of the preset detection range is increased, the update of the latest length is further increased, and the quick determination of the MTU is realized. Specifically, when the third length is equal to the median value, the source node device updates the median value of the current preset detection range to the minimum value in the current preset detection range, and obtains the updated preset detection range. When the third length is not equal to the median value, the source node device updates the median value of the subtracted current preset detection range to the maximum value in the current preset detection range, and obtains an updated preset detection range.
Optionally, in order to further improve the efficiency of MTU determination, before updating the second length of the MTU detection packet to the latest length, when a detection request for the MTU of the target maximum transmission unit is received, the virtual node may be controlled to forward the MTU detection packet with the payload length being the maximum value of the preset detection range through the data exchange node, so as to determine whether the reply packet corresponding to the MTU detection packet with the payload length being the maximum value of the preset detection range is valid.
When a reply message corresponding to an MTU detection message with the payload length being the maximum value of a preset detection range is effective, determining the maximum value of the preset detection range as a target maximum transmission unit MTU; when the reply message corresponding to the MTU detection message with the payload length being the maximum value of the preset detection range is invalid, the control virtual node forwards the MTU detection message with the payload length being the minimum value of the preset detection range through the data exchange node so as to determine whether the reply message corresponding to the MTU detection message with the payload length being the minimum value of the preset detection range is valid or not.
When the reply message corresponding to the MTU detection message with the payload length being the minimum value of the preset detection range is effective, updating the second length of the MTU detection message into the latest length cycle until the latest length meets the detection ending condition.
When the reply message corresponding to the MTU detection message with the payload length being the minimum value of the preset detection range is invalid, the source node device judges that the MTU between the source node device and the destination node device is not in the preset specified range, and the source node device stops determining the MTU between the target source node and the destination node device.
Optionally, when the first length of the valid target reply message acquired by the source node device is smaller than the minimum value in the preset detection range, the source node device may determine the preset detection range again or determine the invalid MTU detection again, which may indicate that the MTU determination needs to be performed again to the user.
In summary, when a probe request for the MTU of the target maximum transmission unit is received, the virtual node and the capture node are used to send an MTU probe message and receive a target reply message, so that a program for acquiring user permission to install and receive and send a specific message on the target source node is avoided, security risks such as data leakage during MTU determination are avoided, and further the problem that a user is not trusted to an installation program is solved. When determining the MTU of the target maximum transmission unit, each time an effective target reply message is obtained, on the one hand, when the latest length of the MTU detection message is preset to the maximum value in the detection range, determining the latest length as the MTU of the target maximum transmission unit; on the other hand, when the second length is greater than or equal to the minimum value in the preset detection range and less than the maximum value in the preset detection range, the preset detection range is updated through the median value of the preset detection range, namely, the preset detection range is updated by using a dichotomy, the median value of the preset detection range is determined to be the latest length, and the determination speed of the MTU of the target maximum transmission unit is further increased.
In a specific workflow diagram of a method for determining a maximum transmission unit shown in an exemplary embodiment of fig. 5, an initial preset detection range (min, max) is manually preset, when a source node device receives a detection request for a target maximum transmission unit MTU, the source node device preferentially detects a minimum value min and a maximum value max in the preset detection range, specifically, a virtual node is controlled to forward MTU detection messages with five same payload lengths as the maximum value max through a data exchange node, further, a capturing node is used for performing message receiving monitoring on the data exchange node, and when a target reply message corresponding to at least one forwarded MTU detection message is monitored, whether the payload length of the target reply message is equal to the payload length of the MTU detection message is judged; when the payload length of the target reply message is equal to that of the MTU detection message, the payload length of the target reply message is equal to that of the target reply message corresponding to the MTU detection message with the maximum value max, and the maximum value max in the preset detection range is determined to be the maximum target transmission unit MTU between the target source node and the target node; when the payload length of the target reply message is unequal to the payload length of the MTU detection message, the source node equipment controls the virtual node to forward five MTU detection messages with the same payload length as a minimum value min through the data exchange node, further monitors message receiving of the data exchange node through the capturing node, and when the target reply message corresponding to at least one forwarded MTU detection message is monitored, judges whether the payload length of the target reply message is equal to the payload length of the MTU detection message or not. When the payload length of the target reply message is unequal to the payload length of the MTU detection message, ending the determination of the MTU between the target source node and the target node equipment;
When the payload length of the target reply message is equal to the payload length of the MTU detection message, it means that the maximum value max is not the MTU between the target source node and the destination device, but the MTU between the target source node and the destination device may be greater than min although the target reply message of the MTU detection message corresponding to the minimum value min is effective, so that the source node device may perform further cyclic detection on the preset detection range (min, max), specifically, the source node device may determine whether the minimum value min in the current preset detection range is less than the maximum value max, and when the minimum value min is less than the maximum value max, determine the MTU of the target maximum transmission unit by using a dichotomy, specifically, the source node device may calculate mid of the current preset detection range according to formula 1, determine the value of mid as the latest length of the MTU detection message, obtain the updated MTU detection message, and control the virtual node to forward five identical updated MTU detection messages through the data exchange node, so as to determine whether the updated MTU detection message corresponds to the updated MTU detection message. If the updated reply message is valid, updating the minimum value min in the current preset detection range to be a median mid; if the updated reply message is invalid, updating the maximum value max in the current preset detection range to be the median mid-1, and circularly executing the steps until the relation that the minimum value min in the updated preset detection range is smaller than the maximum value max is not established, and returning to the maximum value max in the preset detection range updated last time. It can be understood that, in the embodiment of the present application, the maximum value or the minimum value in the preset detection range is updated after determining whether the minimum value min in the current preset detection range is smaller than the maximum value max, which results in that the maximum value max in the preset detection range updated last time no longer satisfies the relationship that the minimum value min is smaller than the maximum value max.
Fig. 6 is a diagram illustrating a maximum transmission unit determining apparatus according to an exemplary embodiment. The maximum transmission unit determining device includes:
and the control module 601 is configured to control the virtual node to forward the MTU probe packet through the data switching node when receiving the probe request for the MTU of the target maximum transmission unit.
The monitoring module 602 is configured to monitor, by using the capture node, message reception of the data exchange node.
The determining module 603 is configured to determine, when a target reply message corresponding to the MTU detection message is detected, a target maximum transmission unit MTU according to the target reply message.
In one possible implementation, the determining module is further configured to,
when the reply message with the target identification number is monitored, the reply message with the target identification number is determined to be the target reply message.
In one possible implementation, the determining module is further configured to,
acquiring a first length of a target reply message and a second length of an MTU detection message;
when the first length is equal to the second length, determining that the target reply message is valid;
when the first length is not equal to the second length, determining that the target reply message is invalid;
and determining the MTU of the target maximum transmission unit according to the effective target reply message.
In one possible implementation, the determining module is further configured to,
updating the second length of the MTU detection message to the latest length when the effective target reply message is acquired until the latest length meets the detection ending condition;
and determining the latest length as a target Maximum Transmission Unit (MTU), wherein the detection ending condition is that the latest length is the maximum value in a preset detection range.
In one possible implementation, the determining module is further configured to,
when the second length is equal to the maximum value in the preset detection range, determining the maximum value in the preset detection range as the latest length;
when the second length is greater than or equal to the minimum value in the preset detection range and less than the maximum value in the preset detection range, the following steps are executed until the minimum value in the updated preset detection range is equal to the maximum value:
determining the median value of the current preset detection range as the latest length to obtain an updated MTU detection message;
the control virtual node forwards the updated MTU detection message through the data exchange node so as to obtain a reply message corresponding to the updated MTU detection message, and obtain the updated reply message;
and updating the maximum value or the minimum value in the current preset detection range according to the third length and the median value of the updated reply message to obtain the updated preset detection range.
In one possible implementation, the determining module is further configured to,
when the third length is equal to the median value, updating the median value to the minimum value in the current preset detection range to obtain an updated preset detection range;
and when the third length is not equal to the median value, updating the subtracted median value to the maximum value in the current preset detection range, and obtaining the updated preset detection range.
When receiving a detection request for the MTU of the target maximum transmission unit, the virtual node can be controlled to forward the MTU detection message through the data exchange node when the target source node, the virtual node and the capture node are in communication connection with the data exchange node, so that the MTU detection message is prevented from being sent by the source node, and a program for sending a specific message is not required to be installed on the target source node by acquiring relevant user rights; the data exchange node is monitored by the capturing node through message receiving, when a target reply message corresponding to the MTU detection message is monitored, the MTU of the target maximum transmission unit is determined according to the target reply message, the source node is prevented from receiving the target reply message corresponding to the MTU detection message, and a program for receiving a specific message is not required to be installed on the target source node by acquiring relevant user rights. In summary, through the new virtual node and the capturing node respectively sending and monitoring the message related to the MTU determination, the program for receiving and sending the specific message does not need to be installed on the source node, the permission information related to the user on the target source node does not need to be acquired, the security risks such as data leakage and the like occurring when the MTU determination is performed are avoided, and the problem that the user does not trust the installed program is solved.
Fig. 7 illustrates a block diagram of a computer device 700, according to an exemplary embodiment of the present application. The computer device may be implemented as a source node device in the above-described scheme of the present application. The computer apparatus 700 includes a central processing unit (Central Processing Unit, CPU) 701, a system Memory 704 including a random access Memory (Random Access Memory, RAM) 702 and a Read-Only Memory (ROM) 703, and a system bus 705 connecting the system Memory 704 and the central processing unit 701. The computer device 700 also includes a mass storage device 706 for storing an operating system 709, application programs 710, and other program modules 711.
The mass storage device 706 is connected to the central processing unit 701 through a mass storage controller (not shown) connected to the system bus 705. The mass storage device 706 and its associated computer-readable media provide non-volatile storage for the computer device 700. That is, the mass storage device 706 may include a computer readable medium (not shown) such as a hard disk or a compact disk-Only (CD-ROM) drive.
The computer readable medium may include computer storage media and communication media without loss of generality. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, erasable programmable read-Only register (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-Only Memory (EEPROM) flash Memory or other solid state Memory technology, CD-ROM, digital versatile disks (Digital Versatile Disc, DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage medium is not limited to the one described above. The system memory 704 and mass storage device 706 described above may be collectively referred to as memory.
According to various embodiments of the present disclosure, the computer device 700 may also operate through a network, such as the Internet, to a remote computer on the network. I.e. the computer device 700 may be connected to the network 708 through a network interface unit 707 connected to the system bus 705, or alternatively, the network interface unit 707 may be used to connect to other types of networks or remote computer systems (not shown).
The memory further comprises at least one computer program stored in the memory, and the central processing unit 701 implements all or part of the steps of the method shown in the above embodiments by executing the at least one computer program.
In an exemplary embodiment, a computer readable storage medium is also provided for storing at least one computer program that is loaded and executed by a processor to implement all or part of the steps of the above method. For example, the computer readable storage medium may be Read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), compact disc Read-Only Memory (CD-ROM), magnetic tape, floppy disk, optical data storage device, and the like.
In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium and executes the computer instructions to cause the computer device to perform all or part of the steps of the method shown in any of the embodiments of fig. 2 to 4 described above.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (10)
1. The method for determining the maximum transmission unit is used for source node equipment, wherein the source node equipment comprises a target source node, a virtual node and a capturing node; the target source node, the virtual node and the capture node are respectively in communication connection with a data exchange node;
the method comprises the following steps:
when a detection request for the MTU of the target maximum transmission unit is received, the virtual node is controlled to forward the MTU detection message through the data exchange node;
the capturing node is used for carrying out message receiving monitoring on the data exchange node;
and when a target reply message corresponding to the MTU detection message is monitored, determining the maximum MTU of the target according to the target reply message.
2. The method of claim 1, wherein the MTU probe message includes a target identification number, the method further comprising:
and when the reply message with the target identification number is monitored, determining the reply message with the target identification number as the target reply message.
3. The method of claim 2, wherein the MTU probe message includes an unfractionable identifier, the unfractionable identifier being used to characterize the MTU probe message and the target reply message to be sent unfractionably.
4. A method according to any one of claims 1-3, wherein determining a target maximum transmission unit MTU based on the target reply message comprises:
acquiring a first length of the target reply message and a second length of the MTU detection message;
when the first length is equal to the second length, determining that the target reply message is valid;
when the first length is not equal to the second length, determining that the target reply message is invalid;
and determining the MTU of the target maximum transmission unit according to the effective target reply message.
5. The method of claim 4, wherein the determining the target maximum transmission unit MTU according to the valid target reply message comprises:
updating the second length of the MTU detection message to the latest length when the effective target reply message is acquired until the latest length meets the detection ending condition;
and determining the latest length as the target Maximum Transmission Unit (MTU), wherein the detection ending condition is that the latest length is the maximum value in a preset detection range.
6. The method of claim 5, wherein updating the second length of the MTU probe message to the latest length each time the valid target reply message is acquired until the latest length satisfies a probe end condition comprises:
When the second length is equal to the maximum value in the preset detection range, determining the maximum value in the preset detection range as the latest length;
when the second length is greater than or equal to the minimum value in the preset detection range and less than the maximum value in the preset detection range, performing the following steps until the minimum value in the updated preset detection range is equal to the maximum value:
determining the median value of the current preset detection range as the latest length to obtain an updated MTU detection message;
the control virtual node forwards the updated MTU detection message through the data exchange node so as to obtain a reply message corresponding to the updated MTU detection message, and the updated reply message is obtained;
and updating the maximum value or the minimum value in the current preset detection range according to the third length of the updated reply message and the median value to obtain the updated preset detection range.
7. The method of claim 6, wherein updating the maximum value or the minimum value in the preset detection range according to the third length of the updated reply message and the median value, to obtain the updated preset detection range includes:
When the third length is equal to the median value, updating the median value to be the minimum value in the current preset detection range, and obtaining the updated preset detection range;
and when the third length is not equal to the median value, updating the median value after subtracting one to the maximum value in the current preset detection range, and obtaining the updated preset detection range.
8. A device for determining a maximum transmission unit, wherein the device is used for source node equipment, and the source node equipment comprises a target source node, a virtual node and a capturing node; the target source node, the virtual node and the capture node are respectively in communication connection with a data exchange node;
the device comprises:
the control module is used for controlling the virtual node to forward the MTU detection message through the data exchange node when receiving the detection request of the target maximum transmission unit MTU;
the monitoring module is used for carrying out message receiving monitoring on the data exchange node through the capture node;
and the determining module is used for determining the MTU of the target maximum transmission unit according to the target reply message when the target reply message corresponding to the MTU detection message is monitored.
9. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to implement the method of determining a maximum transmission unit according to any one of claims 1 to 7.
10. A computer readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to implement the method of determining a maximum transmission unit according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310207235.7A CN116192768A (en) | 2023-03-06 | 2023-03-06 | Method, device, equipment and storage medium for determining maximum transmission unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310207235.7A CN116192768A (en) | 2023-03-06 | 2023-03-06 | Method, device, equipment and storage medium for determining maximum transmission unit |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116192768A true CN116192768A (en) | 2023-05-30 |
Family
ID=86448679
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310207235.7A Pending CN116192768A (en) | 2023-03-06 | 2023-03-06 | Method, device, equipment and storage medium for determining maximum transmission unit |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116192768A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117061638A (en) * | 2023-10-11 | 2023-11-14 | 腾讯科技(深圳)有限公司 | Message transmission method, device, storage medium, equipment and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1581849A (en) * | 2003-08-06 | 2005-02-16 | 三星电子株式会社 | Network system and method for discovering path MTU in data communication network |
CN1716944A (en) * | 2004-06-28 | 2006-01-04 | 杭州华为三康技术有限公司 | Method for discovering maximum transmission length of network path |
US20080165775A1 (en) * | 2007-01-04 | 2008-07-10 | Ranadip Das | Method and Apparatus for Efficient Path MTU Information Discovery and Storage |
CN102325076A (en) * | 2011-05-24 | 2012-01-18 | 中兴通讯股份有限公司 | Method for discovering PMTU (Path Maximum Transfer Unit) and node |
WO2017206460A1 (en) * | 2016-05-31 | 2017-12-07 | 中兴通讯股份有限公司 | Method, apparatus and device for setting maximum transmission unit value |
-
2023
- 2023-03-06 CN CN202310207235.7A patent/CN116192768A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1581849A (en) * | 2003-08-06 | 2005-02-16 | 三星电子株式会社 | Network system and method for discovering path MTU in data communication network |
CN1716944A (en) * | 2004-06-28 | 2006-01-04 | 杭州华为三康技术有限公司 | Method for discovering maximum transmission length of network path |
US20080165775A1 (en) * | 2007-01-04 | 2008-07-10 | Ranadip Das | Method and Apparatus for Efficient Path MTU Information Discovery and Storage |
CN102325076A (en) * | 2011-05-24 | 2012-01-18 | 中兴通讯股份有限公司 | Method for discovering PMTU (Path Maximum Transfer Unit) and node |
WO2017206460A1 (en) * | 2016-05-31 | 2017-12-07 | 中兴通讯股份有限公司 | Method, apparatus and device for setting maximum transmission unit value |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117061638A (en) * | 2023-10-11 | 2023-11-14 | 腾讯科技(深圳)有限公司 | Message transmission method, device, storage medium, equipment and system |
CN117061638B (en) * | 2023-10-11 | 2024-01-05 | 腾讯科技(深圳)有限公司 | Message transmission method, device, storage medium, equipment and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12052150B2 (en) | Monitoring wireless access point events | |
US11902139B2 (en) | Diagnosing and resolving issues in a network using probe packets | |
US8687503B2 (en) | Technique for identifying a failed network interface card within a team of network interface cards | |
US10917289B2 (en) | Handling network failures in networks with redundant servers | |
KR102133001B1 (en) | Network management device, network management system and network management method | |
US20220329512A1 (en) | Method and Apparatus for Updating Route Information, Computer Device, and Storage Medium | |
CN112953785B (en) | Link detection method and system for communication equipment of multi-core processor | |
CN114629822A (en) | Link detection method and device, electronic equipment and storage medium | |
EP3295612A1 (en) | Uplink performance management | |
CN110875857B (en) | Method, device and system for reporting disconnected network state | |
CN116192768A (en) | Method, device, equipment and storage medium for determining maximum transmission unit | |
EP3059907B1 (en) | Network packet forwarding method and device | |
US7545741B1 (en) | Technique for identifying a failed network interface card within a team of network interface cards | |
CN112737949A (en) | Fault detection method and device, electronic equipment and computer readable medium | |
US9256416B1 (en) | Methods and apparatus for automatic session validation for distributed access points | |
US11652682B2 (en) | Operations management apparatus, operations management system, and operations management method | |
CN106817316B (en) | Method, device and system for detecting path MTU | |
CN114356810B (en) | Communication connection method, device, equipment and medium for host and storage system | |
CN114765621B (en) | Method, device and network equipment for detecting state of BGP session | |
US20150200813A1 (en) | Server connection apparatus and server connection method | |
US10491544B2 (en) | Consistency control of a logical path passing through a relay device | |
CN118175566B (en) | Link detection method, device, equipment and readable storage medium | |
CN114745221B (en) | Modbus communication system and communication method | |
KR20240129352A (en) | Sdn controller, sdn network system and method for implementing ztp(zero touch provisioning) based on l3 routing protocol | |
CN118075331A (en) | Method, device, equipment and storage medium for establishing network access channel |
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 |