CN111163037A - IP fragmentation optimization method and device - Google Patents
IP fragmentation optimization method and device Download PDFInfo
- Publication number
- CN111163037A CN111163037A CN201811319546.8A CN201811319546A CN111163037A CN 111163037 A CN111163037 A CN 111163037A CN 201811319546 A CN201811319546 A CN 201811319546A CN 111163037 A CN111163037 A CN 111163037A
- Authority
- CN
- China
- Prior art keywords
- message
- mss
- value
- segment length
- udp
- 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
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/166—IP fragmentation; TCP segmentation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention provides an IP fragmentation optimization method and device. The method comprises the following steps: receiving a message of a transmission parameter negotiation sent by communication equipment when a Transmission Control Protocol (TCP) connection is established; comparing the value of the MSS parameter of the maximum segment length carried in the message with the value of the MSS parameter of the preset maximum segment length; and when the value of the MSS parameter of the maximum message segment length carried in the message is larger than the MSS value of the preset maximum message segment length, sending the MSS value of the preset maximum message segment length to the communication equipment so that the communication equipment carries out IP message transmission according to the MSS value of the preset maximum message segment length. The embodiment of the invention controls the size of the IP message by presetting the MSS parameter value, can eliminate the IP fragmentation of a transmission layer and improve the performance of a transmission network.
Description
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to an IP fragmentation optimization method and device.
Background
The 4G Core network is an Evolved Packet Core (EPC), and services are carried in a PS (Packet switch) domain, thereby implementing IP of the Core network. At present, the transport layer of the 4G network has already implemented transport IP, an IP packet can be sent out only through the physical layer, and the physical layer generally limits the maximum length of a data frame sent once. If there is a message to be transmitted in the IP layer and the data length is larger than the MTU (Maximum Transmission Unit) in the link layer, the IP layer needs to fragment the message and divide the message into several pieces, so that each piece is smaller than the MTU. Correspondingly, at the receiving end of the IP packet, a plurality of IP fragments need to be reassembled, and finally, a complete IP packet is recovered.
The 4G networking is complex, and the network elements are geographically dispersed, so that the packet frame of the end user may pass through multiple IP networks, and in this case, some disadvantages caused by the IP fragmentation may be expanded to seriously affect the network performance, for example, a complete IP header is repeatedly added to each IP fragmentation, which increases the network load and reduces the transmission efficiency. If one fragment is lost, it is not possible to retransmit a fragment selectively and thus to discard the whole packet, which reduces the performance of the transmission network.
Disclosure of Invention
Aiming at the problems of the prior art, the embodiment of the invention provides an IP fragmentation optimization method and device.
In a first aspect, an embodiment of the present invention provides an IP fragmentation optimization method, where the method is applied to a network device, and the method includes:
receiving a message of a transmission parameter negotiation sent by communication equipment when a Transmission Control Protocol (TCP) connection is established;
comparing the value of the MSS parameter of the maximum segment length carried in the message with the value of the MSS parameter of the preset maximum segment length;
and when the value of the MSS parameter of the maximum message segment length carried in the message is larger than the MSS value of the preset maximum message segment length, sending the MSS value of the preset maximum message segment length to the communication equipment so that the communication equipment carries out IP message transmission according to the MSS value of the preset maximum message segment length.
In a second aspect, an embodiment of the present invention provides an IP fragmentation optimization method, where the method is applied to a communication device, and the method includes:
sending a message of negotiating transmission parameters to network equipment, wherein the message of negotiating transmission parameters carries a maximum message segment length MSS parameter;
receiving a feedback message sent by network equipment, wherein when the value of a maximum message segment length MSS parameter carried by the message of the negotiation transmission parameter is greater than a preset maximum message segment length MSS value, the feedback message carries the preset maximum message segment length MSS value;
and carrying out IP message transmission according to the MSS value of the preset maximum message segment length.
In a third aspect, an embodiment of the present invention provides an IP fragmentation optimization apparatus, where the apparatus is located in a network device, and the apparatus includes:
a first receiving unit, configured to receive a message of negotiating transmission parameters, sent by a communication device when establishing a transmission control protocol TCP connection;
a first comparing unit, configured to compare the value of the MSS parameter with the maximum segment length carried in the message with a preset value of the MSS parameter;
a first sending unit, configured to send a preset maximum message segment length MSS value to the communication device when the value of the maximum message segment length MSS parameter carried in the message is greater than the preset maximum message segment length MSS value, so that the communication device performs IP packet transmission according to the preset maximum message segment length MSS value.
In a fourth aspect, an embodiment of the present invention provides an IP fragmentation optimization apparatus, where the apparatus is located in a communication device, and the apparatus includes:
a third sending unit, configured to send a message of negotiating transmission parameters to a network device, where the message of negotiating transmission parameters carries a maximum segment length MSS parameter;
a third receiving unit, configured to receive a feedback message sent by a network device, where when a value of a maximum segment length MSS parameter carried in a message of negotiating transmission parameters is greater than a preset maximum segment length MSS value, the feedback message carries the preset maximum segment length MSS value;
and the transmission unit is used for transmitting the IP message according to the MSS value of the preset maximum message segment length.
In a fifth aspect, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the IP fragmentation optimization method when executing the program.
In a sixth aspect, an embodiment of the present invention further provides a non-transitory computer readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the IP fragmentation optimization method described above.
The embodiment of the invention controls the size of the IP message by presetting the MSS parameter value, can eliminate the IP fragmentation of a transmission layer and improve the performance of a transmission network.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used 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 invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of the user plane protocol stack of the S1 interface and the X2 interface;
fig. 2 is a schematic flowchart of an IP fragmentation optimization method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of IP fragmentation optimization according to another embodiment of the present invention;
fig. 4 is a schematic flowchart of IP fragmentation optimization according to another embodiment of the present invention;
fig. 5 is a schematic flowchart of IP fragmentation optimization according to another embodiment of the present invention;
fig. 6 is a flowchart illustrating a method for controlling a size of a TCP packet according to an embodiment of the present invention;
fig. 7 is a flowchart illustrating a method for controlling a size of a UDP packet according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an IP fragmentation optimization apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an IP fragmentation optimization apparatus according to yet another embodiment of the present invention;
fig. 10 is a schematic structural diagram of an IP fragmentation optimization apparatus according to yet another embodiment of the present invention;
fig. 11 is a schematic structural diagram of an IP fragmentation optimization apparatus according to yet another embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The transmission layer of the 4G network implements IP transmission, and the service planes of the interfaces connected between the eNodeB (base station) and the S-GW (Serving GateWay) and the interfaces connected between the enodebs all use GTPU (GPRS tunneling Protocol for the User plane) as a transmission bearer.
Fig. 1 shows a schematic diagram of the user plane protocol stack of the S1 interface and the X2 interface.
Referring to fig. 1, the service plane of the PS domain core network is the GTPU protocol, and the transmission path of the GTPU tunnel directly uses the UDP/IP protocol of the transport layer. The payload of GTPU is the packet frame of the upper layer terminal user, and the packet frame of the terminal user also adopts IP protocol, that is to say, the packet frame of the upper layer terminal user is the IP message of the user communication layer.
The transmission network layer of the PS domain core network should avoid IP fragmentation as much as possible, and the key is to control the size of the upper layer terminal payload, which is an IP message, so the size of the IP packet of the terminal user can be controlled according to the characteristics of the TCP/IP protocol. The application layer of the terminal User generally does not directly use the IP Protocol, but uses the transmission layer TCP (transmission control Protocol) or UDP (User Datagram Protocol) above the network layer to transmit data, and most internet services are based on TCP, so the size of the IP packet can be controlled by controlling the size of the TCP/UDP packet.
The embodiment of the invention provides an IP fragmentation optimization method.
Fig. 2 is a flowchart illustrating an IP fragmentation optimization method according to an embodiment of the present invention, where the method is applied to a network device.
As shown in fig. 2, the IP fragmentation optimization method provided in the embodiment of the present invention specifically includes the following steps:
s11, receiving a message of negotiation transmission parameters sent by the communication equipment when establishing Transmission Control Protocol (TCP) connection;
specifically, the communication device includes a mobile terminal and a server, where the mobile terminal and the server may carry MSS (Maximum Segment Size) parameters of both sides to negotiate when performing TCP link establishment, where a value of the MSS parameter indicates a Maximum value of a TCP layer payload, and a longest data Segment of a TCP organization may not exceed the Maximum value.
The embodiment of the invention receives MSS parameters carried by a mobile terminal and a server terminal when TCP link establishment is carried out.
S12, comparing the MSS parameter value of the maximum segment length carried in the message with the MSS value of the preset maximum segment length;
in the embodiment of the present invention, a network device (e.g., EPC network element device) configures a maximum MSS for link communication in advance, and after acquiring MSS parameters carried by a mobile terminal and a server, compares the MSS parameters with a preset MSS value.
S13, when the value of the MSS parameter of the maximum segment length carried in the message is greater than the MSS value of the preset maximum segment length, sending the MSS value of the preset maximum segment length to the communication device, so that the communication device performs IP packet transmission according to the MSS value of the preset maximum segment length.
Specifically, when the MSS parameter carried by the mobile terminal is greater than the preset MSS value, the MSS parameter carried by the mobile terminal is modified to the preset MSS value, when the MSS parameter carried by the server is greater than the preset MSS value, the MSS parameter carried by the server is modified to the preset MSS value, and the small value of the MSS parameter carried finally is used as the MSS used by the link, so that the IP packet transmitted by the mobile terminal and the server does not exceed the preset MSS value.
The embodiment of the invention controls and controls the size of the IP message by presetting the MSS parameter value, can eliminate the IP fragmentation of a transmission layer and improves the performance of a transmission network.
Specifically, the method further comprises:
and configuring the MSS value of the preset maximum message segment length according to the payload of the service plane terminal user and the message size of the transport layer protocol.
The MTU of the IP transport layer of the 4G network is generally 1500, and in the process of accessing the network by the terminal, the application layer protocol of the terminal generally transmits according to the MTU of the upper network as much as possible in order to improve transmission efficiency, so that the terminal payload of 1500 is often generated, and referring to the schematic diagram of the user plane protocol stack in fig. 1, the length of the IP packet is 1500+ GTPU header 8+ UDP header 8+ IP header 20 is 1536. This results in that the payload is transmitted in the PS core network and the protocol header of the transport layer protocol exceeds the MTU of the transport layer IP, and IP fragmentation is necessary.
The embodiment of the invention intercepts the IP message of the user in the service plane, the payload of the user terminal can be obtained by peeling off the GTPU head, the size of the MSS is preset according to the obtained payload of the user terminal and the size of the protocol head (GTPU head + UDP head + IP head) of the transport layer protocol, for example, the MSS is preset to 1460, the MSS negotiated at two ends of the TCP cannot exceed the set MSS, thereby controlling the length of the IP message to be smaller than the MTU.
Fig. 3 shows a flowchart of an IP fragmentation optimization method according to an embodiment of the present invention.
As shown in fig. 3, the IP fragmentation optimization method provided in the embodiment of the present invention specifically includes the following steps:
s14, receiving a User Datagram Protocol (UDP) message sent by the communication equipment;
the embodiment of the invention receives the UDP message sent by the mobile terminal or the server during communication.
S15, comparing whether the length of the UDP message is larger than the length of a preset UDP message;
the embodiment of the invention sets the maximum length of the UDP message on network equipment (such as EPC network element equipment) in advance, and compares the length of the UDP message with the length of a preset UDP message after the UDP message sent by a mobile terminal or a server is obtained.
S16, when the length of the UDP packet is greater than the length of a predefined UDP packet, discarding the UDP packet, and sending an ICMP packet, which is used to instruct the communication device to adjust the size of the UDP packet.
UDP is a connectionless datagram protocol, has no link establishment process, and does not segment user data, and after receiving user data, it simply submits the user data plus a UDP header to a lower IP layer. And if the length of the obtained UDP message exceeds the preset UDP message length, the UDP is failed to send and is directly discarded.
The embodiment of the invention uses ICMP (Internet Control Message protocol) Internet to Control the size of the UDP Message, and informs the sender that the application layer Message of the UDP protocol is too large and the size of the UDP Message needs to be adjusted.
The embodiment of the invention enables the sender to automatically adjust the size of the UDP message by limiting the length of the UDP message, thereby controlling the size of the IP message of the transmission network, avoiding IP fragmentation of a transmission layer and improving the performance of the transmission network.
It should be noted that the embodiment of the present invention for defining the size of the UDP packet and the embodiment for defining the size of the TCP packet may be implemented in a network element in combination, or may be implemented on different network elements separately. Optionally, the embodiment of the present invention is implemented on an EPC network element.
Specifically, the method further comprises:
and configuring the length of the preset UDP message according to the payload of the service plane terminal user and the message size of the transport layer protocol.
The MTU of the IP transport layer of the 4G network is generally 1500, and in the process of accessing the network by a terminal, transmission is performed according to the MTU of the upper layer network as much as possible in order to improve transmission efficiency, so that a terminal payload of 1500 is often generated. The embodiment of the invention intercepts the IP message of the user on the service side, strips off the GTPU head to obtain the payload of the user terminal, and presets the UDP message length according to the obtained payload of the user terminal and the size of the protocol head of the transport layer protocol (GTPU head + UDP head + IP head). For example, the length of the UDP packet is preset to 1500, so that the length of the UDP packet is controlled to be smaller than the MTU.
Fig. 4 is a flowchart illustrating an IP fragmentation optimization method according to an embodiment of the present invention, where the method is applied to a communication device.
As shown in fig. 4, the IP fragmentation optimization method provided in the embodiment of the present invention specifically includes the following steps:
s21, sending a message of negotiating transmission parameters to network equipment, wherein the message of negotiating transmission parameters carries a maximum message segment length MSS parameter;
specifically, the communication device includes a mobile terminal and a server, and when performing TCP link establishment, the mobile terminal and the server may carry MSS (Maximum Segment Size) parameters of both sides to negotiate through the network device. Optionally, the network device is an EPC network element device.
S22, receiving a feedback message sent by the network equipment, wherein when the value of the MSS parameter of the maximum message segment length carried by the message of the negotiation transmission parameter is larger than the MSS value of the preset maximum message segment length, the feedback message carries the MSS value of the preset maximum message segment length;
specifically, the network device compares the MSS carried by the mobile terminal with a preset MSS of the device, and sends the preset MSS back to the communication device when the MSS carried by the network device is greater than the preset MSS.
And S23, transmitting the IP message according to the MSS value of the preset maximum message segment length.
Specifically, the preset MSS value is used as an MSS used by the link, so that the IP packet transmitted by the mobile terminal and the server end does not exceed the preset MSS value.
The embodiment of the invention controls and controls the size of the IP message by presetting the MSS parameter value, can eliminate the IP fragmentation of a transmission layer and improves the performance of a transmission network.
Fig. 5 is a flowchart illustrating an IP fragmentation optimization method according to an embodiment of the present invention, where the method is applied to a communication device.
As shown in fig. 5, the IP fragmentation optimization method provided in the embodiment of the present invention specifically includes the following steps:
s24, sending a User Datagram Protocol (UDP) message to the network equipment;
specifically, the communication device includes a mobile terminal and a server, and the mobile terminal or the server sends a UDP packet to the network device. Optionally, the network device is an EPC network element device.
S25, receiving a control message protocol ICMP message sent by a network device, wherein the control message protocol ICMP message contains information that a user datagram protocol UDP message needs to be fragmented;
specifically, the network device uses an icmp (Internet Control Message protocol) Internet, Control Message protocol) to notify the sender that the application layer Message of the UDP protocol is too large and needs to be fragmented.
S26, adjusting the size of the UDP message according to the information that the UDP message needs to be fragmented.
Specifically, after the mobile terminal or the server receives the ICMP message, the size of the UDP message is adjusted, so that the size of the UDP message does not exceed the preset UDP message length.
The embodiment of the invention enables the sender to automatically adjust the size of the UDP message by limiting the length of the UDP message, thereby controlling the size of the IP message of the transmission network, avoiding IP fragmentation of a transmission layer and improving the performance of the transmission network.
The following describes the method for controlling the size of the TCP packet in detail by using a specific example.
Fig. 6 is a flowchart illustrating a method for controlling a size of a TCP packet according to an embodiment of the present invention.
As shown in fig. 6, the method for controlling the size of a TCP packet provided in the embodiment of the present invention specifically includes the following steps:
the mobile terminal carries its own MSS parameter (MSS is 1460) to send the request for establishing connection to EPC network element (SYN is the link establishment mark);
after receiving the request message for establishing the connection, the EPC network element judges that the MSS in the message is larger than a pre-configured MSS value MAX _ PS _ TCP _ MSS, and modifies the MSS value in the request message to be MAX _ PS _ TCP _ MSS;
the EPC network element carries MSS (MAX _ PS _ TCP _ MSS) and sends the request message to the server;
the server side carries an MSS parameter (MSS is 1460) of the server side to send a message (SYNACK) allowing connection establishment to an EPC network element;
after receiving the message allowing connection establishment, the EPC network element judges that the MSS in the message is larger than a pre-configured MSS value MAX _ PS _ TCP _ MSS, and modifies the MSS value in the message allowing link establishment into MAX _ PS _ TCP _ MSS;
the EPC network element carries MSS (maximum output value) MAX _ PS _ TCP _ MSS and sends the message of allowing to establish the link to the mobile terminal;
and the mobile terminal sends an acknowledgement message (ACK) to the EPC network element, and the EPC network element sends the acknowledgement message to the server side.
The following describes in detail the method for controlling the size of the UDP packet according to the embodiment of the present invention with specific examples.
Fig. 7 is a flowchart illustrating a method for controlling a size of a UDP packet according to an embodiment of the present invention.
As shown in fig. 7, the method for controlling the size of the UDP packet according to the embodiment of the present invention specifically includes the following steps:
the mobile terminal sends the UDP packet to an EPC network element (the length of the UDP packet is 1500);
when detecting that the length of a UDP packet is greater than a preset UDP length MAX _ PS _ UDP _ SIZE, an EPC network element generates an ICMP message, wherein the type is filled to 3 (a target address is not reachable), the CODE field is filled to 4 (fragmentation is needed and DF setting is carried out), and the generated ICMP message is sent to a mobile terminal;
and the mobile terminal adjusts the size of the UDP message and retransmits the UDP message.
Similarly, when the server side is used as the sender, the steps are the same, and are not described herein again.
It should be noted that the embodiment for controlling the size of the TCP packet and the embodiment for controlling the size of the UDP packet provided in the embodiment of the present invention may be implemented in a network element in combination, or may be implemented on different network elements separately. Optionally, the embodiment of the present invention is implemented on an EPC network element.
The embodiment of the invention also provides an IP fragmentation optimization device.
Fig. 8 shows a schematic structural diagram of an IP fragmentation optimization apparatus provided in an embodiment of the present invention, where the apparatus is located in a network device.
As shown in fig. 8, the IP fragmentation optimization apparatus provided in the embodiment of the present invention includes a first receiving unit 11, a first comparing unit 12, and a first sending unit 13, where:
the first receiving unit 11 is configured to receive a message of negotiating transmission parameters, which is sent by a communication device when a transmission control protocol TCP connection is established;
specifically, the communication device includes a mobile terminal and a server, where the mobile terminal and the server may carry MSS (Maximum Segment Size) parameters of both sides to negotiate when performing TCP link establishment, where a value of the MSS parameter indicates a Maximum value of a TCP layer payload, and a longest data Segment of a TCP organization may not exceed the Maximum value.
The embodiment of the invention receives MSS parameters carried by a mobile terminal and a server terminal when TCP link establishment is carried out.
The first comparing unit 12 is configured to compare the value of the maximum segment length MSS parameter carried in the message with a preset value of the maximum segment length MSS;
in the embodiment of the present invention, a network device (e.g., EPC network element device) configures a maximum MSS for link communication in advance, and after acquiring MSS parameters carried by a mobile terminal and a server, compares the MSS parameters with a preset MSS value.
A first sending unit 13, configured to send a preset maximum message segment length MSS value to the communication device when the value of the maximum message segment length MSS parameter carried in the message is greater than the preset maximum message segment length MSS value, so that the communication device performs IP packet transmission according to the preset maximum message segment length MSS value.
Specifically, when the MSS parameter carried by the mobile terminal is greater than the preset MSS value, the MSS parameter carried by the mobile terminal is modified to the preset MSS value, when the MSS parameter carried by the server is greater than the preset MSS value, the MSS parameter carried by the server is modified to the preset MSS value, and the small value of the MSS parameter carried finally is used as the MSS used by the link, so that the IP packet transmitted by the mobile terminal and the server does not exceed the preset MSS value.
The embodiment of the invention controls and controls the size of the IP message by presetting the MSS parameter value, can eliminate the IP fragmentation of a transmission layer and improves the performance of a transmission network.
Specifically, the apparatus further comprises:
and the first configuration unit is used for configuring the MSS value according to the payload of the service plane terminal user and the message size of the transport layer protocol.
The embodiment of the invention intercepts the IP message of the user in the service plane, the payload of the user terminal can be obtained by peeling off the GTPU head, the size of the MSS is preset according to the obtained payload of the user terminal and the size of the protocol head (GTPU head + UDP head + IP head) of the transport layer protocol, for example, the MSS is preset to 1460, the MSS negotiated at two ends of the TCP cannot exceed the set MSS, thereby controlling the length of the IP message to be smaller than the MTU.
Fig. 9 is a schematic structural diagram of an IP fragmentation optimization apparatus according to yet another embodiment of the present invention, where the apparatus is located in a network device.
As shown in fig. 9, the IP fragmentation optimization apparatus provided in the embodiment of the present invention includes a second receiving unit 14, a second comparing unit 15, a discarding unit 16, and a second sending unit 17, where:
the second receiving unit 14 is configured to receive a user datagram protocol UDP packet sent by a communication device;
the embodiment of the invention receives the UDP message sent by the mobile terminal or the server during communication.
The second comparing unit 15 is configured to compare whether the length of the UDP packet is greater than a preset length of the UDP packet;
the embodiment of the invention sets the maximum length of the UDP message on network equipment (such as EPC network element equipment) in advance, and compares the length of the UDP message with the length of a preset UDP message after the UDP message sent by a mobile terminal or a server is obtained.
The discarding unit 16 is configured to discard the user datagram protocol UDP packet when the length of the user datagram protocol UDP packet is greater than a preset length of the user datagram protocol UDP packet;
UDP is a connectionless datagram protocol, has no link establishment process, and does not segment user data, and after receiving user data, it simply submits the user data plus a UDP header to a lower IP layer. And if the length of the obtained UDP message exceeds the preset UDP message length, the UDP is failed to send and is directly discarded.
The second sending unit 17 is configured to send a control message protocol ICMP message to the communication device, where the control message protocol ICMP message is used to instruct the communication device to adjust the size of a user datagram protocol UDP message.
The embodiment of the invention uses ICMP (Internet Control Message protocol) Internet to Control the size of the UDP Message, and informs the sender that the application layer Message of the UDP protocol is too large and the size of the UDP Message needs to be adjusted.
The embodiment of the invention enables the sender to automatically adjust the size of the UDP message by limiting the length of the UDP message, thereby controlling the size of the IP message of the transmission network, avoiding IP fragmentation of a transmission layer and improving the performance of the transmission network.
It should be noted that the embodiment of the apparatus for defining the size of the UDP packet and the embodiment of the apparatus for defining the size of the TCP packet in the present invention may be implemented in a network element in combination, or may be implemented in different network elements separately. Optionally, the embodiment of the present invention is implemented on an EPC network element.
Specifically, the apparatus further comprises:
and the second configuration unit is used for configuring the length of the preset user datagram protocol UDP message according to the payload of the service plane terminal user and the message size of the transport layer protocol.
The MTU of the IP transport layer of the 4G network is generally 1500, and the embodiment of the present invention intercepts the IP packet of the user in the service plane, strips off the GTPU header to obtain the payload of the end user, and presets the UDP packet length according to the obtained payload of the end user and the size of the protocol header of the transport layer protocol (GTPU header + UDP header + IP header). For example, the length of the UDP packet is preset to 1500, so that the length of the UDP packet is controlled to be smaller than the MTU.
Fig. 10 is a schematic structural diagram of an IP fragmentation optimization apparatus according to yet another embodiment of the present invention, where the apparatus is located in a communication device.
As shown in fig. 10, the IP fragmentation optimization apparatus provided in the embodiment of the present invention includes a third sending unit 21, a third receiving unit 22, and a transmission unit 23, where:
the third sending unit 21 is configured to send a message of negotiating transmission parameters to a network device, where the message of negotiating transmission parameters carries a maximum segment length MSS parameter;
specifically, the communication device includes a mobile terminal and a server, and when performing TCP link establishment, the mobile terminal and the server may carry MSS (Maximum Segment Size) parameters of both sides to negotiate through the network device. Optionally, the network device is an EPC network element device.
The third receiving unit 22 is configured to receive a feedback message sent by a network device, where when a value of a maximum segment length MSS parameter carried in the message of negotiating transmission parameters is greater than a preset maximum segment length MSS value, the feedback message carries the preset maximum segment length MSS value;
specifically, the network device compares the MSS carried by the mobile terminal with a preset MSS of the device, and sends the preset MSS back to the communication device when the MSS carried by the network device is greater than the preset MSS.
The transmission unit 23 is configured to perform IP packet transmission according to the MSS value of the preset maximum packet segment length.
Specifically, the preset MSS value is used as an MSS used by the link, so that the IP packet transmitted by the mobile terminal and the server end does not exceed the preset MSS value.
The embodiment of the invention controls and controls the size of the IP message by presetting the MSS parameter value, can eliminate the IP fragmentation of a transmission layer and improves the performance of a transmission network.
Fig. 11 is a schematic structural diagram of an IP fragmentation optimization apparatus according to yet another embodiment of the present invention, where the apparatus is located in a communication device.
As shown in fig. 11, the IP fragmentation optimization apparatus provided in the embodiment of the present invention includes a fourth sending unit 24, a fourth receiving unit 25, and an adjusting unit 26, where:
the fourth sending unit 24 is configured to send a user datagram protocol UDP packet to a network device;
specifically, the communication device includes a mobile terminal and a server, and the mobile terminal or the server sends a UDP packet to the network device. Optionally, the network device is an EPC network element device.
The fourth receiving unit 25 is configured to receive a control message protocol ICMP message sent by a network device, where the control message protocol ICMP message includes information that a user datagram protocol UDP message needs to be fragmented;
specifically, the network device uses an icmp (Internet Control Message protocol) Internet, Control Message protocol) to notify the sender that the application layer Message of the UDP protocol is too large and needs to be fragmented.
The adjusting unit 26 is configured to adjust the size of the UDP packet according to the information that the UDP packet needs to be fragmented.
Specifically, after the mobile terminal or the server receives the ICMP message, the size of the UDP message is adjusted, so that the size of the UDP message does not exceed the preset UDP message length.
The embodiment of the invention enables the sender to automatically adjust the size of the UDP message by limiting the length of the UDP message, thereby controlling the size of the IP message of the transmission network, avoiding IP fragmentation of a transmission layer and improving the performance of the transmission network.
The functional modules in the embodiments of the present invention may be implemented by a hardware processor (hardware processor), and the embodiments of the present invention are not described again.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
An embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method shown in fig. 2 is implemented.
Fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
As shown in fig. 12, the electronic device provided by the embodiment of the present invention includes a memory 31, a processor 32, a bus 33, and a computer program stored on the memory 31 and executable on the processor 32. The memory 31 and the processor 32 complete communication with each other through the bus 33.
The processor 32 is used to call the program instructions in the memory 31 to implement the method of fig. 2 when executing the program.
For example, the processor implements the following method when executing the program:
receiving a message of a transmission parameter negotiation sent by communication equipment when a Transmission Control Protocol (TCP) connection is established;
comparing the value of the MSS parameter of the maximum segment length carried in the message with the value of the MSS parameter of the preset maximum segment length;
and when the value of the MSS parameter of the maximum message segment length carried in the message is larger than the MSS value of the preset maximum message segment length, sending the MSS value of the preset maximum message segment length to the communication equipment so that the communication equipment carries out IP message transmission according to the MSS value of the preset maximum message segment length.
The electronic device provided by the embodiment of the invention controls the size of the IP message by presetting the MSS parameter value, can eliminate the IP fragmentation of a transmission layer and improves the performance of a transmission network.
An embodiment of the present invention also provides a non-transitory computer readable storage medium, on which a computer program is stored, and the program, when executed by a processor, implements the steps of fig. 2.
For example, the processor implements the following method when executing the program:
receiving a message of a transmission parameter negotiation sent by communication equipment when a Transmission Control Protocol (TCP) connection is established;
comparing the value of the MSS parameter of the maximum segment length carried in the message with the value of the MSS parameter of the preset maximum segment length;
and when the value of the MSS parameter of the maximum message segment length carried in the message is larger than the MSS value of the preset maximum message segment length, sending the MSS value of the preset maximum message segment length to the communication equipment so that the communication equipment carries out IP message transmission according to the MSS value of the preset maximum message segment length.
The non-transitory computer readable storage medium provided in the embodiment of the present invention controls the size of the IP packet by presetting the value of the MSS parameter, so that the IP fragmentation of the transport layer can be eliminated, and the performance of the transport network can be improved.
An embodiment of the present invention discloses a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, which when executed by a computer, enable the computer to perform the methods provided by the above-mentioned method embodiments, for example, including:
receiving a message of a transmission parameter negotiation sent by communication equipment when a Transmission Control Protocol (TCP) connection is established;
comparing the value of the MSS parameter of the maximum segment length carried in the message with the value of the MSS parameter of the preset maximum segment length;
and when the value of the MSS parameter of the maximum message segment length carried in the message is larger than the MSS value of the preset maximum message segment length, sending the MSS value of the preset maximum message segment length to the communication equipment so that the communication equipment carries out IP message transmission according to the MSS value of the preset maximum message segment length.
Those skilled in the art will appreciate that although some embodiments described herein include some features included in other embodiments instead of others, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (14)
1. An IP fragmentation optimization method, applied to a network device, the method comprising:
receiving a message of a transmission parameter negotiation sent by communication equipment when a Transmission Control Protocol (TCP) connection is established;
comparing the value of the MSS parameter of the maximum segment length carried in the message with the value of the MSS parameter of the preset maximum segment length;
and when the value of the MSS parameter of the maximum message segment length carried in the message is larger than the MSS value of the preset maximum message segment length, sending the MSS value of the preset maximum message segment length to the communication equipment so that the communication equipment carries out IP message transmission according to the MSS value of the preset maximum message segment length.
2. The method of claim 1, further comprising:
and configuring the MSS value of the preset maximum message segment length according to the payload of the service plane terminal user and the message size of the transport layer protocol.
3. The method of claim 1, further comprising:
receiving a User Datagram Protocol (UDP) message sent by communication equipment;
comparing whether the length of the UDP message is larger than the length of a preset UDP message;
when the length of the user datagram protocol UDP message is larger than the length of a preset user datagram protocol UDP message, discarding the user datagram protocol UDP message, and sending a control message protocol ICMP message to the communication equipment, wherein the control message protocol ICMP message is used for indicating the communication equipment to adjust the size of the user datagram protocol UDP message.
4. The method of claim 3, further comprising:
and configuring the length of the preset UDP message according to the payload of the service plane terminal user and the message size of the transport layer protocol.
5. An IP fragmentation optimization method applied to a communication device, the method comprising:
sending a message of negotiating transmission parameters to network equipment, wherein the message of negotiating transmission parameters carries a maximum message segment length MSS parameter;
receiving a feedback message sent by network equipment, wherein when the value of a maximum message segment length MSS parameter carried by the message of the negotiation transmission parameter is greater than a preset maximum message segment length MSS value, the feedback message carries the preset maximum message segment length MSS value;
and carrying out IP message transmission according to the MSS value of the preset maximum message segment length.
6. The method of claim 5, further comprising:
sending a User Datagram Protocol (UDP) message to network equipment;
receiving a control message protocol ICMP message sent by network equipment, wherein the control message protocol ICMP message contains information of a user datagram protocol UDP message needing fragmentation;
and adjusting the size of the UDP message according to the information of the UDP message needing fragmentation.
7. An IP fragmentation optimization apparatus, wherein the apparatus is located in a network device, and the apparatus comprises:
a first receiving unit, configured to receive a message of negotiating transmission parameters, sent by a communication device when establishing a transmission control protocol TCP connection;
a first comparing unit, configured to compare the value of the MSS parameter with the maximum segment length carried in the message with a preset value of the MSS parameter;
a first sending unit, configured to send a preset maximum message segment length MSS value to the communication device when the value of the maximum message segment length MSS parameter carried in the message is greater than the preset maximum message segment length MSS value, so that the communication device performs IP packet transmission according to the preset maximum message segment length MSS value.
8. The apparatus of claim 7, further comprising:
and the first configuration unit is used for configuring the MSS value according to the payload of the service plane terminal user and the message size of the transport layer protocol.
9. The apparatus of claim 7, further comprising:
a second receiving unit, configured to receive a user datagram protocol UDP packet sent by a communication device;
the second comparison unit is used for comparing whether the length of the user datagram protocol UDP message is greater than the length of a preset user datagram protocol UDP message or not;
a discarding unit, configured to discard the user datagram protocol UDP packet when the length of the user datagram protocol UDP packet is greater than a preset user datagram protocol UDP packet length;
a second sending unit, configured to send a control message protocol ICMP message to the communication device, where the control message protocol ICMP message is used to instruct the communication device to adjust a size of a user datagram protocol UDP message.
10. The apparatus of claim 9, further comprising:
and the second configuration unit is used for configuring the length of the preset user datagram protocol UDP message according to the payload of the service plane terminal user and the message size of the transport layer protocol.
11. An IP fragmentation optimization apparatus, the apparatus located in a communication device, the apparatus comprising:
a third sending unit, configured to send a message of negotiating transmission parameters to a network device, where the message of negotiating transmission parameters carries a maximum segment length MSS parameter;
a third receiving unit, configured to receive a feedback message sent by a network device, where when a value of a maximum segment length MSS parameter carried in a message of negotiating transmission parameters is greater than a preset maximum segment length MSS value, the feedback message carries the preset maximum segment length MSS value;
and the transmission unit is used for transmitting the IP message according to the MSS value of the preset maximum message segment length.
12. The apparatus of claim 11, further comprising:
a fourth sending unit, configured to send a user datagram protocol UDP packet to the network device;
a fourth receiving unit, configured to receive a control message protocol ICMP message sent by a network device, where the control message protocol ICMP message includes information that a user datagram protocol UDP message needs to be fragmented;
and the adjusting unit is used for adjusting the size of the UDP message according to the information that the UDP message needs to be fragmented.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the IP fragmentation optimization method according to any of claims 1 to 6 when executing the program.
14. A non-transitory computer readable storage medium, having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the IP fragmentation optimization method according to any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811319546.8A CN111163037A (en) | 2018-11-07 | 2018-11-07 | IP fragmentation optimization method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811319546.8A CN111163037A (en) | 2018-11-07 | 2018-11-07 | IP fragmentation optimization method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111163037A true CN111163037A (en) | 2020-05-15 |
Family
ID=70554524
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811319546.8A Pending CN111163037A (en) | 2018-11-07 | 2018-11-07 | IP fragmentation optimization method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111163037A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114629974A (en) * | 2022-05-10 | 2022-06-14 | 新华三技术有限公司 | Message transmission method, device and equipment |
CN115022419A (en) * | 2022-06-30 | 2022-09-06 | 武汉思普崚技术有限公司 | Method, device and storage medium for automatically adjusting MSS |
CN115022252A (en) * | 2022-05-31 | 2022-09-06 | 青岛海信移动通信技术股份有限公司 | Method and equipment for configuring maximum length of transmission data packet |
CN115052049A (en) * | 2022-06-15 | 2022-09-13 | 北京天融信网络安全技术有限公司 | Message forwarding method and system based on IPsec tunnel |
CN117579725A (en) * | 2023-12-12 | 2024-02-20 | 中科驭数(北京)科技有限公司 | Method, device, equipment and medium for transmitting message in segments |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7006526B1 (en) * | 2001-07-31 | 2006-02-28 | Cisco Technology, Inc. | Mechanisms for avoiding problems associated with network address protocol translation |
CN1863165A (en) * | 2006-01-24 | 2006-11-15 | 华为技术有限公司 | Method for reducing data IP fragmentation quantity in PS network |
CN101663864A (en) * | 2007-03-22 | 2010-03-03 | 艾利森电话股份有限公司 | Method for configuring the link maximum transmission unit (MTU) in a user equipment (UE). |
CN101924689A (en) * | 2009-06-16 | 2010-12-22 | 中兴通讯股份有限公司 | Negotiation method of maximum segmentation parameters and network forwarding equipment |
CN102469088A (en) * | 2010-11-17 | 2012-05-23 | 郑州威科姆科技股份有限公司 | Mass data transmission method based on UDP (User Datagram Protocol) |
CN103079232A (en) * | 2013-01-16 | 2013-05-01 | 大唐移动通信设备有限公司 | Method and device for determining maximum capacity of message |
US20130223445A1 (en) * | 2012-02-27 | 2013-08-29 | Microsoft Corporation | Stateful NAT64 Function in a Distributed Architecture |
CN103647759A (en) * | 2013-11-26 | 2014-03-19 | 华为技术有限公司 | Negotiation method and apparatus of maximum segment size (MSS) |
CN105704084A (en) * | 2014-11-24 | 2016-06-22 | 中兴通讯股份有限公司 | Processing method of TCP connection, processing device and mobile terminal |
US9912600B1 (en) * | 2014-11-06 | 2018-03-06 | vIPtela Inc. | Dynamic discovery of network packet size |
CN108429700A (en) * | 2017-02-13 | 2018-08-21 | 华为技术有限公司 | A kind of method and device sending message |
-
2018
- 2018-11-07 CN CN201811319546.8A patent/CN111163037A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7006526B1 (en) * | 2001-07-31 | 2006-02-28 | Cisco Technology, Inc. | Mechanisms for avoiding problems associated with network address protocol translation |
CN1863165A (en) * | 2006-01-24 | 2006-11-15 | 华为技术有限公司 | Method for reducing data IP fragmentation quantity in PS network |
CN101663864A (en) * | 2007-03-22 | 2010-03-03 | 艾利森电话股份有限公司 | Method for configuring the link maximum transmission unit (MTU) in a user equipment (UE). |
CN101924689A (en) * | 2009-06-16 | 2010-12-22 | 中兴通讯股份有限公司 | Negotiation method of maximum segmentation parameters and network forwarding equipment |
CN102469088A (en) * | 2010-11-17 | 2012-05-23 | 郑州威科姆科技股份有限公司 | Mass data transmission method based on UDP (User Datagram Protocol) |
US20130223445A1 (en) * | 2012-02-27 | 2013-08-29 | Microsoft Corporation | Stateful NAT64 Function in a Distributed Architecture |
CN103079232A (en) * | 2013-01-16 | 2013-05-01 | 大唐移动通信设备有限公司 | Method and device for determining maximum capacity of message |
CN103647759A (en) * | 2013-11-26 | 2014-03-19 | 华为技术有限公司 | Negotiation method and apparatus of maximum segment size (MSS) |
US9912600B1 (en) * | 2014-11-06 | 2018-03-06 | vIPtela Inc. | Dynamic discovery of network packet size |
CN105704084A (en) * | 2014-11-24 | 2016-06-22 | 中兴通讯股份有限公司 | Processing method of TCP connection, processing device and mobile terminal |
CN108429700A (en) * | 2017-02-13 | 2018-08-21 | 华为技术有限公司 | A kind of method and device sending message |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114629974A (en) * | 2022-05-10 | 2022-06-14 | 新华三技术有限公司 | Message transmission method, device and equipment |
CN115022252A (en) * | 2022-05-31 | 2022-09-06 | 青岛海信移动通信技术股份有限公司 | Method and equipment for configuring maximum length of transmission data packet |
CN115022252B (en) * | 2022-05-31 | 2024-04-09 | 青岛海信移动通信技术有限公司 | Method and equipment for configuring maximum length of transmission data packet |
CN115052049A (en) * | 2022-06-15 | 2022-09-13 | 北京天融信网络安全技术有限公司 | Message forwarding method and system based on IPsec tunnel |
CN115022419A (en) * | 2022-06-30 | 2022-09-06 | 武汉思普崚技术有限公司 | Method, device and storage medium for automatically adjusting MSS |
CN115022419B (en) * | 2022-06-30 | 2024-02-20 | 武汉思普崚技术有限公司 | Method, device and storage medium for automatically adjusting MSS |
CN117579725A (en) * | 2023-12-12 | 2024-02-20 | 中科驭数(北京)科技有限公司 | Method, device, equipment and medium for transmitting message in segments |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111163037A (en) | IP fragmentation optimization method and device | |
US11477130B2 (en) | Transmission control method and apparatus | |
US10069602B2 (en) | Transmission control protocol proxy in long term evolution radio access network | |
EP1353481B1 (en) | Mobile communication method and system | |
EP3075110B1 (en) | Controlling a transmission control protocol window size | |
US9736047B2 (en) | Methods and systems for reducing network congestion | |
US20150237173A1 (en) | TCP Proxy Server | |
US10524175B2 (en) | Data transmission method and network device | |
KR20130132074A (en) | Method and apparatus for controlling congestion in a wireless communication system | |
CN102780712B (en) | Conversation switching method and device | |
CN114039933A (en) | IP transmission method, device, equipment and product of 5G network link | |
US10530693B2 (en) | Congestion control method and apparatus, and related device | |
WO2014000307A1 (en) | Data transmission method, network element device and communication system | |
WO2016095198A1 (en) | Apparatus, system and method for preventing tcp connection interruption | |
CN107493260B (en) | Apparatus, system, and method for adaptive segment size for data transmission | |
WO2018097073A1 (en) | Information notification device, information notification method, and recording medium having program recorded thereon | |
CN104955079A (en) | Data transmission method and performance enhancing proxy in wireless ad hoc network | |
US20230344554A1 (en) | Access layer ip packet processing method, apparatus and device | |
Zhu et al. | Radio-aware tcp optimization in mobile network | |
CN103581137A (en) | ECN proxy equipment and ECN notification method | |
US9882682B2 (en) | Message distributing system, message distributing apparatus, message distributing method and message distributing program | |
Le et al. | Removing tcp congestion control on the last hop in split tcp environments | |
Sanchez et al. | TCP/IP performance over EGPRS network | |
WO2021244191A1 (en) | Method and device for implementing mutual switching between 4g and 5g networks and storage medium | |
KR20200061295A (en) | Method for transmitting data packet at low latency and appratus therefor |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200515 |
|
RJ01 | Rejection of invention patent application after publication |