Background
Since the GTP message is transmitted using a User Datagram Protocol (UDP), it is necessary to ensure that a partial type of GTP message can be successfully transmitted to the target node, for example, the GTP message includes a GTP Request (Request) message, a GTP Notification (Notification) message, a GTP Command (Command) message, and other types of messages, and when the source GTP processing node sends these types of GTP messages, the peer GTP processing node needs to return a corresponding acknowledgement message. The Request message is confirmed by a Response (Response) message, and the Notification message is confirmed by an acknowledgement (acknowledgement) message. The Command message may be acknowledged by a Request (Request) message.
The structure of the message header of the current GTP message is shown in fig. 1, where the message header of the GTP message includes a Sequence Number (Sequence Number) with a size of two bytes, and the values of the Sequence numbers carried in the acknowledgment message and the acknowledged message are identical, so as to form an acknowledgment relationship, that is, when the node at the receiving end receives the request message, the notification message, or the instruction message, the value of the Sequence Number carried in the returned acknowledgment message is consistent with the value of the Sequence Number of the received request message, the received notification message, or the received instruction message, so as to indicate acknowledgment of the received request message, the received notification message, or the received instruction message.
In addition, since two GTP processing nodes may send operations for the same User Equipment (UE) to each other at the same time, it is necessary to avoid collision caused by sending messages with the same sequence number by different GTP processing nodes by carrying different Message Type (Message Type) indications in the messages. For example, when the sequence number carried in the GTP request message sent by the node a to the node B is 11, the node B may send the request message also carrying the sequence number of 11 to the node a, but at this time, the message types carried in the messages sent by the node a and the node B indicate that the currently sent messages cannot be mutually confirmed, so that no collision occurs.
In order to avoid repeated processing and attack of messages, when a GTP processing node receives messages with the same message type and the same sequence number, the GTP processing node considers that the messages received later are repeated messages and discards the repeated messages.
Because the GTP request message (or the notification message) sent by a certain GTP processing node may be a response of another GTP message or may be an independently sent GTP request message, and the current GTP request message does not carry the information indicating that the GTP request message (or the notification message) is the acknowledgment message of a certain GTP message or the independently sent GTP request message, the node sending the GTP command message cannot confirm whether the received GTP request message is the acknowledgment message corresponding to the self-sent GTP command message or the independently sent GTP request message sent by the peer GTP processing node, thereby affecting the normal processing of the node receiving the GTP request message. In some concurrent situations, the GTP request message may be discarded as a duplicate message by the GTP processing node in error. For example, referring to fig. 2, node B sends GTP request message R with Sequence Number (SN) of 2 to node a, when node a does not respond to the message, node a sends GTP command message C with sequence number also of 2 to node B, at this time node B must reply acknowledgement message C of GTP request message R with sequence number of 2, at this time node a receives acknowledgement message C, since message C and message R have the same message type and the same sequence number, node a may consider message C as a repetition of message R, thereby discarding message C.
In summary, in the prior art, the GTP processing node sometimes cannot recognize whether the received GTP message is the acknowledgment message of the GTP message sent by itself.
Disclosure of Invention
The embodiment of the invention provides a method, a system and a device for transmitting a GTP message, which are used for solving the problem that in the prior art, a GTP processing node cannot identify whether the received GTP message is a confirmation message of the GTP message sent by the GTP processing node.
The method for sending the GTP message provided by the embodiment of the invention comprises the following steps:
the source end GTP processing node sets indication information in a GTP message to be sent, wherein the indication information is used for indicating whether the GTP message to be sent is a message for confirming the GTP message sent by an opposite end GTP processing node;
and the source GTP processing node sends the GTP message carrying the indication information to the opposite GTP processing node.
The method for receiving the GTP message provided by the embodiment of the invention comprises the following steps:
the GTP processing node receives the GTP message and analyzes indication information from the GTP message, wherein the indication information is used for indicating whether the received GTP message is a message for confirming the GTP message sent by the GTP processing node;
and the GTP processing node determines whether the GTP message is a message for confirming the GTP message sent by the GTP processing node according to the indication information.
The GTP message transmission method provided by the embodiment of the invention comprises the following steps:
the source end GTP processing node sets indication information in a GTP message to be sent, wherein the indication information is used for indicating whether the GTP message to be sent is a message for confirming the GTP message sent by an opposite end GTP processing node;
the source GTP processing node sends the GTP message provided with the indication information to an opposite GTP processing node;
the opposite terminal GTP processing node receives a GTP message sent by the source terminal GTP processing node and analyzes the indication information from the GTP message;
and the opposite-end GTP processing node determines whether the GTP message sent by the source-end GTP processing node is a message for confirming the GTP message sent by the opposite-end GTP processing node according to the indication information.
The GTP message transmission system provided by the embodiment of the invention comprises:
the source end GTP processing node is used for setting indication information in a GTP message to be sent, wherein the indication information is used for indicating whether the GTP message to be sent is a message for confirming the GTP message sent by the opposite end GTP processing node; sending the GTP message provided with the indication information to an opposite GTP processing node;
the opposite-end GTP processing node is used for receiving the GTP message sent by the source-end GTP processing node and analyzing the indication information from the GTP message; and determining whether the GTP message sent by the source GTP processing node is a message for confirming the GTP message sent by the source GTP processing node according to the indication information.
The GTP processing device provided by the embodiment of the invention comprises:
an indication information adding unit, configured to set indication information in a GTP message to be sent, where the indication information is used to indicate whether the GTP message to be sent is a message for confirming a GTP message sent by an opposite GTP processing node;
and the sending unit is used for sending the GTP message carrying the indication information to the GTP processing node of the opposite end.
The GTP processing device provided by the embodiment of the invention comprises:
the indication information analysis unit is used for receiving the GTP message sent by the GTP processing node of the opposite terminal and analyzing the indication information from the received GTP message, wherein the indication information is used for indicating whether the GTP message is a message for confirming the GTP message sent by the indication information;
and the determining unit is used for determining whether the GTP message sent by the opposite-end GTP processing node is a message for confirming the GTP message sent by the opposite-end GTP processing node according to the indication information.
In the embodiment of the invention, a source end GTP processing node sets indication information in a GTP message to be sent, wherein the indication information is used for indicating whether the GTP message to be sent is a message for confirming a GTP message sent by an opposite end GTP processing node; the source end GTP processing node sends the GTP message carrying the indication information to the opposite end GTP processing node, so that the GTP processing node can determine whether the GTP message is a confirmation message of the GTP message sent by the GTP processing node for any received GTP message, and the received GTP message is correctly processed.
Detailed Description
The embodiment of the invention provides a method, a system and a device for transmitting a GTP message, which are used for solving the problem that in the prior art, a GTP processing node cannot identify whether the received GTP message is a confirmation message of the GTP message sent by the GTP processing node.
The following describes embodiments of the present invention in detail with reference to the accompanying drawings.
Referring to fig. 3, a method for transmitting a GTP message provided in the embodiment of the present invention includes:
s301, the source end GTP processing node sets indication information in a GTP message to be sent, wherein the indication information is used for indicating whether the GTP message to be sent is a message for confirming the GTP message sent by the opposite end GTP processing node.
S302, the source GTP processing node sends the GTP message carrying the indication information to the opposite GTP processing node.
S303, the opposite terminal GTP processing node receives the GTP message sent by the source terminal GTP processing node and analyzes the indication information from the GTP message.
Preferably, the indication information is set in the message header of the GTP message to be sent, the opposite-end GTP processing node decodes the received GTP message, and reads the indication information in the message header of the GTP message according to the definition of the message header of the GTP message.
And S304, the opposite-end GTP processing node determines whether the received GTP message is a message for confirming the GTP message sent by the opposite-end GTP processing node according to the indication information read in the step S303.
The following embodiment of the present invention will simply refer to the indication information used for indicating whether the GTP message to be sent is a message for confirming the GTP message sent by the peer GTP processing node as the indication information.
The indication information is set in the message header of the GTP message to be sent in the embodiment of the invention. Certainly, the indication message can also be set in the message body or the extended message header of the GTP message, but because the length of the message header is relatively fixed and the unpacking is relatively quick, setting the indication message in the message header can determine the message response relationship more quickly and effectively, and thus, executing subsequent operations such as stopping the message retransmission timer and the like, and enabling the GTP message processing to be more efficient.
There are various methods for setting the indication information in the header of the GTP message to be sent, and several ways are described below.
As can be seen from fig. 1, in the prior art, the first bit and the fifth bit of the first byte in the header of the GTP message are not occupied, and therefore, in the embodiment of the present invention, the indication information may be set in the first bit or the fifth bit of the first byte in the header of the GTP message. For example, referring to fig. 4, an identifier a is set in a first bit of a first byte in a header of a GTP message to carry indication information, where if a GTP message to be sent is an acknowledgment message of another GTP message, a is set to 1, and otherwise, a is set to 0.
The embodiment of the invention can also carry the indication information by the sequence number in the message header of the GTP message to be sent. Then, preferably, the step of setting, by the GTP processing node, the indication information in the GTP message to be sent includes:
the GTP processing node encodes a serial number in a message header of a GTP message to be sent, and respectively generates a response information part and a matching part, wherein the response information part comprises indication information; the matching section includes matching information for identifying that there is a response relationship with another GTP message. For example: the message type of GTP message M to be sent is a request message, message M is an acknowledgement message of another GTP message N, and the message type of message N is an instruction message. Setting the value of the response information part of the message N to 0 indicates that the message is not a response of any message, and when the sequence number in the message header of the message M is coded, generating the value of the response information part to be 1 to indicate that the message M is an acknowledgement message of another message (namely the message N); the matching part of message N is generated by its sending node, e.g. set to 11, then the value of the matching part of message M must be the same as the value of the matching part in the sequence number in the header of message N, also set to 11, to indicate that message N is an acknowledgement message for message M.
It should be noted that the sequence numbers of different GTP messages of the same message type are different to distinguish them from each other, that is, the sequence numbers of different GTP messages of different message types may be the same.
Preferably, when the GTP message to be sent is not the acknowledgment message of another GTP message, the sequence number in the GTP message to be sent may be set as the first parameter value; when the GTP message to be sent is an acknowledgment message of another GTP message, the sequence number in the GTP message to be sent may be set as the second parameter value. The first parameter value is an odd number, and the second parameter value is an even number; or, the first parameter value is an even number, and the second parameter value is an odd number. For example, the acknowledgement message sequence number-1 may be set. For example, when the sequence number of a certain indication message (original message) is set to 21, the corresponding sequence number of the request message confirming the indication message may be 20, and the sequence number of the reply message of the request message may also be 20.
Preferably, when the GTP message to be sent is an uplink origination message (non-acknowledgement message), the sequence number in the GTP message to be sent may be set as the third parameter value; when the GTP message to be sent is a downlink origination message (non-acknowledgement message), the sequence number in the GTP message to be sent may be set as the fourth parameter value. The third parameter value is an odd number, and the fourth parameter value is an even number; or, the third parameter value is an even number, and the fourth parameter value is an odd number. For example: when the sequence number of a certain uplink message (origination message) is set to 21, the corresponding sequence number of the request message (downlink response message) confirming the indication message needs to be set to the same sequence number as the uplink message, that is, 21, because the uplink request is answered, and the sequence number of the response message of the request message is also 21. While the sequence number of the downstream request message (origination message) is set to an even number, e.g., 22. So that the sequence numbers of the origination message and the response message in the same direction do not collide.
In addition, as shown in fig. 1, in the embodiment of the present invention, indication information may be set in the 11 th byte and/or the 12 th byte (reserved byte) in the header of the GTP message, where the indication information may be an identifier of one bit or may be a complete sequence number of the acknowledged GTP message.
The following describes a system and apparatus provided by an embodiment of the present invention.
Referring to fig. 5, a GTP message transmission system provided in the embodiment of the present invention includes:
a source GTP processing node 501, configured to set indication information in a GTP message to be sent, where the indication information is used to indicate whether the GTP message to be sent is a message for confirming a GTP message sent by an opposite GTP processing node 502; and, send GTP message with the indication information set to peer GTP processing node 502.
The opposite-end GTP processing node 502 is configured to receive the GTP message sent by the source-end GTP processing node 501, and analyze the indication information from the GTP message; and, according to the indication information, determining whether the GTP message sent by the source GTP processing node 501 is a message for confirming the GTP message sent by itself.
Referring to fig. 6, a GTP processing apparatus provided in an embodiment of the present invention includes:
an indication information adding unit 601, configured to set indication information in a GTP message to be sent, where the indication information is used to indicate whether the GTP message to be sent is a message for confirming a GTP message sent by an opposite GTP processing node.
A sending unit 602, configured to send the GTP message carrying the indication information to the peer GTP processing node.
Preferably, the indication information adding unit 601 sets the indication information in a message header of the GTP message to be sent.
Preferably, the indication information adding unit 601 includes:
and the indication information unit is used for setting a sequence number in a message header of the GTP message to be sent and generating indication information.
And the adding unit is used for adding the indication information into a message header of the GTP message to be sent.
Preferably, the GTP processing apparatus may further include:
the identification unit is used for receiving the GTP message sent by the GTP processing node of the opposite terminal and analyzing the indication information which is used for indicating whether the GTP message is a message for confirming the GTP message sent by the identification unit; and determining whether the GTP message sent by the opposite GTP processing node is a message for confirming the GTP message sent by the opposite GTP processing node according to the indication information.
Referring to fig. 7, a GTP processing apparatus provided in an embodiment of the present invention includes:
an indication information parsing unit 701, configured to receive a GTP message sent by an opposite-end GTP processing node, and parse out indication information from the received GTP message, where the indication information is used to indicate whether the GTP message is a message for confirming a GTP message sent by the GTP message itself.
A determining unit 702, configured to determine, according to the indication information, whether the GTP message sent by the peer GTP processing node is a message for confirming the GTP message sent by the peer GTP processing node.
It should be noted that the indication information adding unit 601, the sending unit 602, the indication information analyzing unit 701, and the determining unit 702 may also be disposed in the same GTP processing node, that is, the GTP processing node may send the GTP message using the scheme provided in the embodiment of the present invention, or may receive the GTP message using the scheme provided in the embodiment of the present invention.
In summary, different types of messages are defined in the current GTP, including request messages, response messages, command messages, and so on. However, since GTP messages are transmitted based on the UDP protocol, to ensure proper communication and execution of GTP messages, acknowledgements need to be made to the GTP messages sent out, especially to the command messages and request messages, to ensure that the messages have been received and processed by the receiving end. The acknowledgement of the current GTP message is done by the sequence number contained in the header of the acknowledgement message, i.e. the acknowledgement message matches the sequence number of the acknowledged message to which it corresponds. Therefore, the node sending the GTP message determines whether the received GTP message corresponds to the sent GTP message according to the sequence number of the received GTP message, thereby determining whether to resend the GTP message. With the increase of the message types of the current GTP versions, the instruction message needs to be confirmed by the request message, and the request message needs to be confirmed by the response message. Thus, the request message may be an acknowledgement corresponding to a certain instruction message or may be a message unrelated to any instruction message. However, because parallel processing is allowed for messages of a certain terminal in the network, a node sending an instruction message cannot distinguish whether the received message is an independently sent message or an acknowledgement message corresponding to the sent instruction message according to information carried in the received message. The embodiment of the invention provides that the GTP message carries indication information for indicating whether the sent GTP message is a confirmation message of another GTP message, thereby avoiding the problem that a node sending the GTP message in the prior art cannot distinguish whether the received GTP message is a message sent independently or corresponds to a confirmation message sent out by the node, so that the GTP processing node can correctly process the received GTP message and determine whether the GTP message sent by the node needs to be sent again.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.