WO2021088813A1 - 报文封装方法及装置、报文解封装方法及装置 - Google Patents

报文封装方法及装置、报文解封装方法及装置 Download PDF

Info

Publication number
WO2021088813A1
WO2021088813A1 PCT/CN2020/126209 CN2020126209W WO2021088813A1 WO 2021088813 A1 WO2021088813 A1 WO 2021088813A1 CN 2020126209 W CN2020126209 W CN 2020126209W WO 2021088813 A1 WO2021088813 A1 WO 2021088813A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
field
header field
original
packet
Prior art date
Application number
PCT/CN2020/126209
Other languages
English (en)
French (fr)
Inventor
喻敬海
熊泉
刘兴铨
韩瑞波
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to EP20884959.6A priority Critical patent/EP4057576A4/en
Priority to US17/773,860 priority patent/US20220393908A1/en
Publication of WO2021088813A1 publication Critical patent/WO2021088813A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2592Translation of Internet protocol [IP] addresses using tunnelling or encapsulation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2514Translation of Internet protocol [IP] addresses between local and global IP addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2517Translation of Internet protocol [IP] addresses using port numbers

Definitions

  • the present disclosure relates to the field of communications, and in particular to a method and device for encapsulating a message, and a method and device for de-encapsulating a message.
  • 1 is a schematic diagram of the flow label mapping in the related technology. As shown in FIG. 1, the mapping relationship in the corresponding technology is generally fixed, that is, it does not change dynamically.
  • NAT network address translator
  • NATPT Network Address Translator, Protocol Translator
  • NATPT Network Address Translator, Protocol Translator
  • Fig. 2 is a schematic diagram of NATPT traversal in the transmission process in related technologies. As shown in Fig. 2, the service flow to be transmitted needs to traverse multiple NATPTs before reaching the opposite end. In the transmission process of the above-mentioned service flow, each time NATPT is traversed, the external IP address and port number may change, and the changes caused by each NATPT traversal do not follow a fixed mapping relationship. Therefore, the method of deterministic service flow tracking based on a fixed mapping relationship in the related art will fail in the above-mentioned situation.
  • NAT network address translator
  • NATPT Network Address Translator, Protocol Translator
  • the embodiments of the present disclosure provide a message encapsulation method and device, and a message decapsulation method and device, so as to at least solve the problem that the processing of deterministic service flows in related technologies is not applicable.
  • a message encapsulation method which is applied to a sending side, and the method includes: encapsulating a first message according to a preset encapsulation format to obtain a second message, wherein The first message is obtained by encapsulating a service flow, and the second message carries flow attribute information, and the flow attribute information is used to indicate characteristic attributes of the service flow.
  • a message sending method which is applied to the sending side, and the method includes: sending a second message to the receiving side; wherein the second message is implemented according to the above-mentioned implementation.
  • the message encapsulation method described in the example is obtained.
  • a message processing method which is applied to an intermediate node, and the method includes: determining and processing a second message according to flow attribute information; wherein, the second message The message is obtained according to the message encapsulation method described in the foregoing embodiment.
  • a message decapsulation method which is applied to the receiving side, and the method includes: decapsulating a second message, wherein the second message is sent by The side encapsulates the first message according to a preset encapsulation format to obtain the first message, the first message is obtained by encapsulating the service flow on the sending side, and the second message carries flow attribute information, and The stream attribute information is used to indicate the characteristic attribute of the service stream.
  • a message decapsulation method which is applied to the receiving side, and the method includes: receiving a second message sent by the sending side, and according to the message described in the above embodiment.
  • the text decapsulation method performs decapsulation processing on the second message.
  • a message encapsulation device applied to the sending side, the device includes: an encapsulation module configured to encapsulate the first message according to a preset encapsulation format to obtain the first message The second message, wherein the first message is obtained by encapsulating a service flow, the second message carries flow attribute information, and the flow attribute information is used to indicate characteristic attributes of the service flow.
  • a message encapsulation device applied to the sending side, the device comprising: a sending module configured to send a second message to the receiving side; wherein the second message The message is obtained according to the message encapsulation device described in the foregoing embodiment.
  • a message processing device applied to an intermediate node, the device comprising: a processing module configured to determine and process a second message according to flow attribute information; wherein, The second message is obtained according to the message encapsulation device described in the foregoing embodiment.
  • a message decapsulation device which is applied to the receiving side, and the device includes: a decapsulation module configured to perform decapsulation processing on a second message, wherein the The second message is obtained by encapsulating the first message by the sending side according to a preset encapsulation format, the first message is obtained by encapsulating the service flow on the sending side, and the second message carries Stream attribute information, where the stream attribute information is used to indicate the characteristic attributes of the service stream.
  • a message receiving device which is applied to the receiving side, and the device includes: a receiving module configured to receive a second message sent by the sending side, and according to the above-mentioned embodiment
  • the message decapsulation device described above performs decapsulation processing on the second message.
  • a computer-readable storage medium and a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any of the foregoing when running. The steps in the method embodiment.
  • an electronic device including a memory and a processor, the memory is stored with a computer program, and the processor is configured to run the computer program to execute any of the above Steps in the method embodiment.
  • the present disclosure can solve the problem that the processing of the deterministic service flow in the related technology is not applicable, so as to achieve the effect that the deterministic service flow can be applied in different transmission processes.
  • Fig. 1 is a schematic diagram of stream label mapping in related technologies
  • Figure 2 is a schematic diagram of NATPT traversal in the transmission process in related technologies
  • Fig. 3 is a flowchart of a message encapsulation method provided according to an embodiment of the present disclosure
  • Fig. 4 is a schematic diagram of a Tspec field provided according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of a first packaging format provided according to an embodiment of the present disclosure.
  • Fig. 6 is a schematic diagram of a second encapsulation format provided according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram of a third encapsulation format provided according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram of a fourth encapsulation format provided according to an embodiment of the present disclosure.
  • FIG. 9 is a flowchart of a method for sending a message according to an embodiment of the present disclosure.
  • FIG. 10 is a flowchart of a message processing method according to an embodiment of the present disclosure.
  • FIG. 11 is a flowchart of a method for decapsulating a message according to an embodiment of the present disclosure
  • FIG. 12 is a flowchart of a method for receiving a message according to an embodiment of the present disclosure
  • FIG. 13 is a structural block diagram of a message packaging device provided according to an embodiment of the present disclosure.
  • Fig. 14 is a structural block diagram of a message sending device according to an embodiment of the present disclosure.
  • Fig. 15 is a structural block diagram of a message processing device provided according to an embodiment of the present disclosure.
  • Fig. 16 is a structural block diagram of a message decapsulation device provided according to an embodiment of the present disclosure.
  • Fig. 17 is a structural block diagram of a message receiving apparatus according to an embodiment of the present disclosure.
  • FIG. 3 is a flowchart of a message encapsulation method provided according to an embodiment of this disclosure. As shown in FIG. 3, the method in this embodiment includes:
  • S102 Encapsulate the first message according to a preset encapsulation format to obtain a second message, where the first message is obtained by encapsulating the service flow, the second message carries flow attribute information, and the flow attribute information is used for Indicates the characteristic attributes of the service flow.
  • the above-mentioned first message indicates the message obtained by encapsulating the service flow to be sent according to the conventional message format in the related technology.
  • the first message includes the IP header field.
  • the IP content field, the IP header field and the IP content field are the original IP header field and the original IP content field described below in this embodiment, and those skilled in the art can learn the original IP header field according to common knowledge in the art. The specific components of the original IP content field are not repeated here.
  • the encapsulation of the first message according to the preset encapsulation format shown in this embodiment to obtain the second message may be based on the first message according to the preset encapsulation format, or may be Based on the service flow to be sent, the encapsulation format corresponding to the first message and the second message are combined to directly encapsulate the service flow to be sent, which is not limited in the present disclosure.
  • step S102 the execution subject of the above step S102 is the sending side, specifically the Deterministic Traffic Gateway (DTGW) in the sending side.
  • DTGW Deterministic Traffic Gateway
  • the first packet since the first packet can be encapsulated according to the preset encapsulation format to obtain the second packet, the first packet is obtained by encapsulating the service flow, and the first packet is obtained by encapsulating the service flow.
  • the second message carries flow attribute information, and the flow attribute information is used to indicate the characteristic attributes of the service flow. Therefore, the message encapsulation method in this embodiment can solve the problem that the processing of the deterministic service flow in the related technology is not applicable, so as to achieve the effect that the deterministic service flow can be applied in different transmission processes.
  • the second message in this embodiment carries flow attribute information, even if NAT or NATPT needs to be traversed in the second message transmission, the external IP address and port number will change.
  • the message can still establish a definite mapping relationship with the corresponding service flow according to the flow attribute information, so that the tracking processing from the sending side to the receiving side for the service flow can still be realized.
  • encapsulating the first message according to the preset encapsulation format to obtain the second message includes:
  • At least a transmission characteristic Tspec field is inserted in a preset position of the first packet according to a preset encapsulation format to obtain a second packet, where the Tspec field includes stream attribute information.
  • the Tspec field inserted in the first packet described above includes flow attribute information
  • the first packet after the Tspec field is inserted that is, the second packet, can carry flow attribute information.
  • the stream attribute information includes at least one of the following:
  • the Tspec field includes a next protocol field (next protocol, N-P) field, a length field, a content indication field, and an information field;
  • N-P next protocol field
  • the content indication field is used to indicate the type of stream attribute information and whether the corresponding type of stream attribute information appears in the information field according to a preset bit definition, and the information field is used to indicate the content of the stream attribute information.
  • the above-mentioned NP field is used to indicate the subsequent protocol type of the NP field; the Length field is used to indicate the total length of the Tspec field; the content indication field is used to indicate one of the information fields that subsequently appear in the content indication field Or a plurality of stream attribute information appear in sequence in a preset order.
  • the content indication field includes a plurality of bits arranged in a preset order to correspondingly indicate whether the stream attribute information in the subsequent information field is used, for example, "1" indicates that the corresponding stream attribute information will appear in the subsequent information field, and "0" indicates that the corresponding stream attribute information will not appear in the subsequent information field.
  • bits 0-5 are used in the content indication field, and the remaining bits are temporarily reserved.
  • Maximum frame length used to indicate the maximum message length of the second message after the service flow is encapsulated, recorded as maxFrameSize; the above-mentioned maximum frame length is indicated by the 0bit bit in the content indication field, and the bit value of 0 means that there is no such information Code, 1 means this message appears.
  • Cycle interval It is used to indicate the desired scheduling interval. It can also indicate the cycle interval of the second message itself, in nanoseconds (ns), which is recorded as cycleTime; the above cycle interval is indicated by 1 bit in the content indication field, this bit A bit value of 0 means that there is no encoding of this information, and a value of 1 means that this information appears.
  • Maximum number of messages per cycle used to indicate the maximum number of messages that may arrive within the length of time indicated by the cycle interval, recorded as MaxIntervalFrames.
  • the maximum number of messages per cycle is indicated by 2 bits in the content indication field. A bit value of 0 means that there is no encoding of this information, and a value of 1 means that this information appears.
  • Maximum tolerable cumulative delay used to indicate the maximum cumulative delay on the second packet forwarding path, which can be used for path calculation, in nanoseconds (ns), recorded as maxAccumulatedLatency, the above-mentioned maximum tolerable cumulative delay is in the content
  • the indication field is indicated by a 3bit bit. A value of 0 for this bit means that there is no encoding of this information, and a value of 1 means that this information appears.
  • Per-node scheduling delay used for asynchronous scheduling.
  • the per-node scheduling delay is used to indicate the expected schedule based on the period of the received message Scheduled periodically; the above-mentioned scheduling cycle depends on the internal time scheduling cycle of the device and the queue scheduling time slice, such as TimeInterval of 802.1Qbv.
  • the scheduling delay per node is used to indicate how long it is expected to be scheduled out in nanoseconds (ns), which is recorded as perNodeSchDelay.
  • ns nanoseconds
  • the above-mentioned scheduling delay of each node is indicated by 4 bits in the content indication field. A value of 0 for this bit means that there is no encoding of this information, and a value of 1 means that this information appears.
  • Maximum tolerable cumulative jitter used to indicate the maximum cumulative jitter on the packet forwarding path.
  • the maximum tolerable cumulative jitter indicates the tolerable cumulative jitter time, in nanoseconds (ns), recorded as maxAccumulatedJitter, and the maximum tolerable cumulative jitter is 5bit in the content indication field. Bit indication. A value of 0 for this bit means that there is no encoding of this information, and a value of 1 means that this information appears.
  • FIG. 4 is a schematic diagram of a Tspec field provided according to an embodiment of the present disclosure, and the structure of the above-mentioned Tspec field is shown in FIG. 4.
  • encapsulating the first message according to the preset encapsulation format to obtain the second message further includes:
  • the Tspec field and the User Datagram Protocol UDP header field are inserted in the preset position of the first message to obtain the second message, wherein the UDP header field is inserted before the Tspec field.
  • the above UDP header field is used to indicate that the UDP header field in the second message subsequently appears as the Tspec field; specifically, the UDP header field can be indicated by the destination port number. For example, port 4600.
  • encapsulating the first message according to the preset encapsulation format to obtain the second message includes:
  • configuring the encapsulation rule includes: configuring an encapsulation format and configuring a deterministic service flow matching rule;
  • the deterministic business flow matching rule is used to match the business flow with the deterministic business flow.
  • the above-mentioned encapsulation rules are used for the configuration of the encapsulation format on the one hand, and on the other hand for the configuration of the deterministic service flow matching rules; the above-mentioned deterministic service flow matching rules can specifically match the service flow to be sent to It is determined whether the service flow needs to be encapsulated according to the message encapsulation method in this embodiment.
  • the packaging format includes one of the following: a first packaging format, a second packaging format, a third packaging format, and a fourth packaging format; wherein,
  • the first encapsulation format includes the original network protocol IP header field, UDP header field, Tspec field, and original IP content field;
  • the second encapsulation format includes new IP header field, UDP header field, Tspec field, original IP header field, and original IP content field;
  • the third encapsulation format includes the original IP header field, the newly created UDP header field, the Tspec field, the original UDP header field, the ESI header field, and the original IP message content field;
  • the fourth encapsulation format includes the new IP header field, the new UDP header field, the Tspec field, the original UDP header field, the ESP header field, the original IP header field, and the original IP content field.
  • the first encapsulation format and the second encapsulation format can be selected or determined correspondingly according to the configured encapsulation format
  • the third encapsulation format and the fourth encapsulation format can be selected or determined according to the encapsulation format adopted by the first message.
  • a corresponding selection or determination is made; specifically, the above-mentioned third encapsulation format and fourth encapsulation format are encapsulation formats adopted when the ipsec processing has been performed in the first message.
  • the foregoing first encapsulation format may also be referred to as a transmission mode
  • the foregoing second encapsulation format may also be referred to as a tunnel mode
  • the foregoing third encapsulation format and fourth encapsulation format may also be referred to as a converged mode or a hybrid mode.
  • encapsulating the first message according to the encapsulation rule to obtain the second message includes:
  • the original IP header field and the original IP content field of the first message Insert the UDP header field and the Tspec field between them, and adjust the protocol field in the original IP header field to obtain the second packet; or,
  • the new IP header is inserted before the original IP header field of the first message according to the second encapsulation format Field, UDP header field and Tspec field to obtain the second packet; or,
  • the original UDP header field is included in the first message, and the original UDP header field is inserted between the original IP header field and the original IP content field of the first message, according to the third encapsulation format, in the first message Insert the newly created UDP header field and the Tspec field between the original IP header field and the original UDP header field of a message to obtain the second message; or,
  • the original UDP header field is included in the first message, and the original UDP header field is inserted before the original IP header field of the first message, according to the fourth encapsulation format, in the newly created IP of the first message.
  • the newly created UDP header field and the Tspec field are inserted between the header field and the original UDP header field to obtain the second message.
  • FIG. 5 is a schematic diagram of a first packaging format provided according to an embodiment of the present disclosure.
  • the structure of the above-mentioned first packaging format is shown in FIG. 5
  • FIG. 6 is a schematic diagram of a second packaging format provided according to an embodiment of the present disclosure.
  • the structure of the packaging format is shown in FIG. 6
  • FIG. 7 is a schematic diagram of a third packaging format provided according to an embodiment of the present disclosure, and the structure of the foregoing third packaging format is shown in FIG. 7
  • FIG. 8 is provided according to an embodiment of the present disclosure
  • a schematic diagram of the third encapsulation format The structure of the above-mentioned third encapsulation format is shown in FIG. 8.
  • the above-mentioned first message includes the original UDP header field, which indicates that the first message is a message obtained after ipsec processing is performed on the service flow.
  • Two different ipsec processing modes of the stream namely the ESP transmission mode and the ESP tunnel mode; the corresponding original UDP header field in the third encapsulation format is inserted between the original IP header field and the original IP content field of the first packet It indicates the ESP transmission mode of ipsec, and the corresponding original UDP header field in the fourth encapsulation format is inserted before the original IP header field of the first packet, that is, indicates the ESP tunnel mode of ipsec.
  • adjusting the protocol field in the original IP header field indicates that the original protocol content indicated in the protocol field in the original IP header field is modified to indicate the UDP protocol to indicate the original IP header After the field is the UDP field; and the original protocol content indicated in the protocol field is written into the NP field in the Tspec field to indicate the corresponding protocol content after the Tspec field.
  • the method before encapsulating the first message according to the preset encapsulation format to obtain the second message, the method further includes:
  • the network address translation NAT function is configured between the sending side and the receiving side.
  • NAT or NATPT can be provided between the sending side and the receiving side, or a related device that can realize the network address translation function is provided.
  • the message encapsulation method in this embodiment needs to be adopted.
  • this embodiment can be used. This disclosure does not limit the message encapsulation method or other encapsulation methods in.
  • the DTGW function on the sending side is turned on, and it is detected that there is a NAT in the network between the sending side and the receiving side, that is, the DTGW determines that the packet encapsulation method in the foregoing embodiment needs to be used to encapsulate the service flow. Based on this, DTGW configures encapsulation rules, which include configuration encapsulation format and configuration deterministic business matching rules.
  • the sending side needs to transmit the following service streams: the source address is 10.0.0.3, the destination address is 10.0.0.4, the service type is TCP, the source port number of TCP is 20000, and the destination port number is 5000.
  • the DTGW first matches the above-mentioned service flow through deterministic service matching rules, and determines that the packet encapsulation method in the above-mentioned embodiment is required for encapsulation; at the same time, DTGW determines that the mode of encapsulation of the service flow is the transmission mode according to the configuration, that is, the above-mentioned embodiment At this time, if the DTGW does not detect that the service flow has been processed by ipsec, the first encapsulation format can be used for encapsulation processing.
  • the DTGW can process the service flow or the first packet after the service flow is encapsulated in a conventional encapsulation method.
  • the DTGW is used to process the first packet.
  • the subsequent specific embodiments 2 to 3 all adopt this method, and will not be repeated.
  • the above-mentioned DTGW detects whether the service flow has been processed by ipsec by detecting whether there is a UDP header field in the first message, that is, the original UDP header field, or whether the destination port number of the UDP message is Such as 4500 and other well-known port numbers used by ipsec, etc., to achieve detection.
  • the DTGW inserts the first packet according to the first encapsulation format, that is, inserts the UDP header field and the Tspec field in sequence between the original IP header field and the original IP content field of the first packet.
  • the NP field is 0x06, indicating that the subsequent protocol is tcp; the Length field is 10, indicating that the length of the second message is 10; the content indication field is 0x0007, indicating that there is a maximum frame length, cycle interval, and per-interval message in the second message
  • the information field is 0x0064007D0010, which indicates the content of the stream attribute information in the order of the maximum frame length, the cycle interval, and the number of packets per interval. It should be further explained that the above Tspec fields are all in hexadecimal system, where the content indication field is converted to binary system, which corresponds to multiple bits in the above embodiment, and the information field is converted to decimal system, which corresponds to the above stream. The specific value of the attribute.
  • the first message can be encapsulated. Change the protocol field of the original IP header field from 0x06 corresponding to the TCP protocol to 0x11 corresponding to the UDP protocol; then you can insert the UDP header field between the original IP header field and the original IP content field, and in the UDP header
  • the above-mentioned Tspec field is inserted after the field, where the UDP header field indicates that the destination port number is 4600.
  • the total length field and checksum field in the original IP content field need to be modified to increase the packet length by 18 (where the UDP header field corresponds to 8 characters Section, the Tspec field corresponds to 10 bytes), so that the second message can be obtained.
  • the DTGW on the sending side After the DTGW on the sending side obtains the second message, it can send the second message to the DTGW on the receiving side.
  • the DTGW function on the sending side is turned on, and it is detected that there is a NAT in the network between the sending side and the receiving side, that is, the DTGW determines that the packet encapsulation method in the foregoing embodiment needs to be used to encapsulate the service flow. Based on this, DTGW configures encapsulation rules, which include configuration encapsulation format and configuration deterministic business matching rules.
  • the sending side needs to transmit the following service streams: source address 10.0.0.5, destination address 10.0.0.6, service type is TCP, TCP source port number is 20000, and destination port number is 5000.
  • DTGW first matches the above-mentioned service flow through deterministic service matching rules, and determines that the packet encapsulation method in the above-mentioned embodiment needs to be used for encapsulation; at the same time, DTGW determines that the mode of encapsulation of the service flow is tunnel mode according to the configuration, that is, the above-mentioned embodiment In the second encapsulation format; at this time, if the DTGW does not detect that the service flow has been processed by ipsec, the second encapsulation format can be used for encapsulation processing.
  • the NP field is 0x06, indicating that the subsequent protocol is tcp; the Length field is 10, indicating that the length of the second message is 10; the content indication field is 0x0007, indicating that there is a maximum frame length, cycle interval, and per-interval message in the second message
  • the information field is 0x0064007D0010, which indicates the content of the stream attribute information in the order of the maximum frame length, the cycle interval, and the number of packets per interval.
  • the first packet can be encapsulated; specifically, the above-mentioned new IP header field, UDP header field, and Tspec field are inserted into the original IP in sequence.
  • the UDP header field indicates that the destination port number is 4600. Since the packet length changes after inserting the UDP header field and the Tspec field, it is necessary to modify the total length field and checksum field in the original IP content field to increase the packet length by 18 (where the UDP header field corresponds to 8 characters Section, the Tspec field corresponds to 10 bytes), so that the second message can be obtained.
  • the DTGW on the sending side After the DTGW on the sending side obtains the second message, it can send the second message to the DTGW on the receiving side.
  • the DTGW function on the sending side is turned on, and it is detected that there is a NAT in the network between the sending side and the receiving side, that is, the DTGW determines that the packet encapsulation method in the foregoing embodiment needs to be used to encapsulate the service flow. Based on this, DTGW configures encapsulation rules, which include configuration encapsulation format and configuration deterministic business matching rules.
  • the sending side needs to transmit the following service streams: the source address is 10.0.0.3, the destination address is 10.0.0.4, the service type is TCP, the source port number of TCP is 20000, and the destination port number is 5000.
  • DTGW first matches the above-mentioned service flow through deterministic service matching rules, and determines that the packet encapsulation method in the above-mentioned embodiment is required for encapsulation; at the same time, DTGW determines that the mode of encapsulation of the service flow is the transmission mode according to the configuration; at this time, DTGW It is detected that the first packet corresponding to the service flow has been processed by ipsec, so the encapsulation format in the configuration is ignored, and the mixed mode is used for encapsulation according to the ipsec processing method, that is, the third encapsulation format or the fourth encapsulation format is used for encapsulation .
  • the NP field is 0x06, indicating that the subsequent protocol is tcp; the Length field is 10, indicating that the length of the second message is 10; the content indication field is 0x0007, indicating that there is a maximum frame length, cycle interval, and per-interval message in the second message
  • the information field is 0x0064007D0010, which indicates the content of the stream attribute information in the order of the maximum frame length, the cycle interval, and the number of packets per interval.
  • the first message can be encapsulated; specifically, the newly created UDP header field and the above Tspec field are sequentially inserted into the first message, and the insertion position is based on the first message.
  • the ipsec processing method is selected or determined.
  • the original UDP header field is located after the original IP header field, and the third encapsulation format is used to insert the newly created UDP header field and the above-mentioned Tspec field To between the original IP header field and the original UDP header field; if the original UDP header field in the first packet is before the original IP header field, the fourth encapsulation format is used to create a new UDP header field and the above Tspec field Insert between the newly created IP header field and the original UDP header field; among them, the newly created UDP header field indicates that the destination port number is 4600.
  • the DTGW on the sending side After the DTGW on the sending side obtains the second message, it can send the second message to the DTGW on the receiving side.
  • the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present disclosure essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium (such as ROM/RAM). , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, a computer, a server, or a network device, etc.) execute the method described in each embodiment of the present disclosure.
  • FIG. 9 is a flowchart of a method for sending a message according to an embodiment of the present disclosure. As shown in FIG. 9, the method for sending a message in this embodiment is shown in FIG. include:
  • the second message in this embodiment is obtained according to the message encapsulation method described in the above embodiment 1. Therefore, the related technical features and technical effects of the second message in this embodiment correspond to those in the above embodiment 1. , This disclosure will not be repeated here.
  • the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present disclosure essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium (such as ROM/RAM). , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, a computer, a server, or a network device, etc.) execute the method described in each embodiment of the present disclosure.
  • FIG. 10 is a flowchart of a message processing method provided according to an embodiment of the present disclosure. As shown in FIG. 10, the message processing in this embodiment is Methods include:
  • S302 Determine and process the second packet according to the flow attribute information.
  • the second message in this embodiment is obtained according to the message encapsulation method described in the above embodiment 1. Therefore, the related technical features and technical effects of the second message in this embodiment correspond to those in the above embodiment 1. , This disclosure will not be repeated here.
  • the above determination and processing of the second message indicates the tracking and determination of the deterministic service flow; since the mapping relationship between the flow attribute information and the second message is fixed, those skilled in the art can follow In the related art, based on the deterministic service flow processing method of the mapping object such as the IP address, it is known how to determine the second packet according to the flow attribute information, which is not repeated here in this disclosure.
  • the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present disclosure essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium (such as ROM/RAM). , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, a computer, a server, or a network device, etc.) execute the method described in each embodiment of the present disclosure.
  • FIG. 11 is a flowchart of a message decapsulation method provided according to an embodiment of the present disclosure. As shown in FIG. 11, the message in this embodiment is The text decapsulation methods include:
  • S402. Decapsulate the second packet, where the second packet is obtained by encapsulating the first packet on the sending side according to a preset encapsulation format, and the first packet is obtained by encapsulating the service flow on the sending side.
  • the second message carries flow attribute information, and the flow attribute information is used to indicate the characteristic attributes of the service flow.
  • step S402 is the receiving side, specifically the DTGW in the receiving side.
  • step S402 the decapsulation process performed on the second message corresponds to the encapsulation process of the second message; the related technical features and technical effects of encapsulating the second message are the same as those in the embodiment. Corresponding to 1, so this embodiment will not repeat them.
  • the sending side encapsulates the first message according to a preset encapsulation format to obtain the second message, which includes:
  • the second packet is obtained by inserting at least a transmission characteristic Tspec field in a preset position of the first packet by the sending side according to a preset encapsulation format, where the Tspec field includes stream attribute information.
  • the stream attribute information includes at least one of the following:
  • the Tspec field includes a subsequent protocol field N-P field, a length field, a content indication field, and an information field;
  • the content indication field is used to indicate the type of stream attribute information and whether the corresponding type of stream attribute information appears in the information field according to the preset bit definition, and the information field is used to indicate the content of the stream attribute information.
  • the second message is obtained by encapsulating the first message by the sending side according to a preset encapsulation format, which further includes:
  • the second message is obtained by inserting the Tspec field and the User Datagram Protocol UDP header field in the preset position of the first message by the sending side according to the preset encapsulation format; wherein, the UDP header field is inserted before the Tspec field.
  • the second message is obtained by encapsulating the first message by the sending side according to a preset encapsulation format, which further includes:
  • the second message is obtained by encapsulating the first message by the sending side according to the configured encapsulation rule;
  • the configured encapsulation rule includes: configuring an encapsulation format and configuring a deterministic service flow matching rule;
  • the deterministic business flow matching rule is used to match the business flow with the deterministic business flow.
  • the packaging format includes one of the following: a first packaging format, a second packaging format, a third packaging format, and a fourth packaging format; wherein,
  • the first encapsulation format includes the original network protocol IP header field, UDP header field, Tspec field, and original IP content field;
  • the second encapsulation format includes new IP header field, UDP header field, Tspec field, original IP header field, and original IP content field;
  • the third encapsulation format includes the original IP header field, the newly created UDP header field, the Tspec field, the original UDP header field, the ESI header field, and the original IP message content field;
  • the fourth encapsulation format includes the new IP header field, the new UDP header field, the Tspec field, the original UDP header field, the ESP header field, the original IP header field, and the original IP content field.
  • the second message is obtained by encapsulating the first message by the sending side according to the configured encapsulation rule, which further includes:
  • the original IP header of the first packet is added according to the first encapsulation format. Insert the UDP header field and the Tspec field between the field and the original IP content field, and adjust the protocol field in the original IP header field to obtain; or,
  • the second packet is configured by the sending side in the encapsulation format as the second encapsulation format, and the original UDP header field is not included in the first packet, according to the second encapsulation format, the original IP header of the first packet Insert the newly created IP header field, UDP header field and Tspec field before the field to obtain; or,
  • the sending side of the second message includes the original UDP header field in the first message
  • the original UDP header field is inserted between the original IP header field and the original IP content field of the first message
  • the sending side of the second message includes the original UDP header field in the first message, and the original UDP header field is inserted before the original IP header field of the first message, according to the fourth encapsulation format, Insert the newly created UDP header field and the Tspec field between the newly created IP header field and the original UDP header field of the first message to obtain.
  • decapsulating the second message includes:
  • the encapsulation format of the second packet is the first encapsulation format
  • the encapsulation format of the second packet is the second encapsulation format, remove the newly created IP header field, UDP header field, and Tspec field in the second packet; or,
  • the encapsulation format of the second packet is the third encapsulation format, remove the newly created UDP header field and the Tspec field in the second packet, and adjust the protocol field in the original IP header field; or,
  • the encapsulation format of the second packet is the fourth encapsulation format, remove the new IP header field, the new UDP header field, and the Tspec field in the second packet, and adjust the protocol field in the original IP header field .
  • the decapsulation operation in the above step S402 corresponds to the encapsulation operation of the second message, specifically, the field inserted in the first message is removed during the encapsulation process of the second message, and the corresponding adjustment is performed.
  • the content of the field is not limited to the encapsulation operation of the second message.
  • the DTGW on the receiving side is turned on. At this time, the DTGW receives the service flow, and the service flow is the second packet encapsulated in the above-mentioned first encapsulation format using the transmission mode.
  • the DTGW can determine that the second packet is UDT encapsulated according to the UDP header field and the destination port number in the second packet, and further determine the second packet according to the UDP header field and the destination port number.
  • the message is not encapsulated in the tunnel mode, so that it can be determined that the second message is encapsulated in the transmission mode, that is, the above-mentioned first encapsulation format.
  • the protocol information corresponding to the NP field in the Tspec field in the second packet can be assigned to the original IP header field; at the same time, DTGW detects the Length field in the Tspec field and determines that the Tspec field is 10, so it can be modified
  • the DTGW After the DTGW strips the UDP header field and the Tspec field in the second message, it can forward the message again.
  • the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present disclosure essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium (such as ROM/RAM). , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, a computer, a server, or a network device, etc.) execute the method described in each embodiment of the present disclosure.
  • FIG. 12 is a flowchart of the message receiving method provided according to an embodiment of the present disclosure. As shown in FIG. 12, the message receiving method in this embodiment is Methods include:
  • S502 Receive a second message sent by the sending side, and perform decapsulation processing on the second message.
  • the decapsulation process of the second message adopts the message decapsulation method in the above embodiment 4. Therefore, the related technical features and technical effects of the decapsulation process of the second message in this embodiment are the same as those described above.
  • Embodiment 4 corresponds to this embodiment, which will not be repeated here.
  • the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present disclosure essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium (such as ROM/RAM). , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, a computer, a server, or a network device, etc.) execute the method described in each embodiment of the present disclosure.
  • a message encapsulation device is also provided, which is applied to the sending side.
  • the device is used to implement the above-mentioned embodiments and preferred implementations, and what has been described will not be repeated.
  • the term "module" can implement a combination of software and/or hardware with predetermined functions.
  • the devices described in the following embodiments are preferably implemented by software, implementation by hardware or a combination of software and hardware is also possible and conceived.
  • FIG. 13 is a structural block diagram of a message encapsulation device according to an embodiment of the present disclosure. As shown in FIG. 13, the message encapsulation device in this embodiment includes:
  • the encapsulation module 602 is configured to encapsulate the first message according to the preset encapsulation format to obtain the second message, wherein the first message is obtained by encapsulating the service flow, and the second message carries flow attribute information, and the flow The attribute information is used to indicate the characteristic attributes of the service flow.
  • encapsulating the first message according to the preset encapsulation format to obtain the second message includes:
  • At least a transmission characteristic Tspec field is inserted in a preset position of the first packet according to a preset encapsulation format to obtain a second packet, where the Tspec field includes stream attribute information.
  • the stream attribute information includes at least one of the following:
  • the Tspec field includes a subsequent protocol field N-P field, a length field, a content indication field, and an information field;
  • the content indication field is used to indicate the type of stream attribute information and whether the corresponding type of stream attribute information appears in the information field according to a preset bit definition, and the information field is used to indicate the content of the stream attribute information.
  • encapsulating the first message according to the preset encapsulation format to obtain the second message further includes:
  • the Tspec field and the User Datagram Protocol UDP header field are inserted in the preset position of the first message to obtain the second message, wherein the UDP header field is inserted before the Tspec field.
  • encapsulating the first message according to the preset encapsulation format to obtain the second message includes:
  • configuring the encapsulation rule includes: configuring an encapsulation format and configuring a deterministic service flow matching rule;
  • the deterministic business flow matching rule is used to match the business flow with the deterministic business flow.
  • the packaging format includes one of the following: a first packaging format, a second packaging format, a third packaging format, and a fourth packaging format; wherein,
  • the first encapsulation format includes the original network protocol IP header field, UDP header field, Tspec field, and original IP content field;
  • the second encapsulation format includes new IP header field, UDP header field, Tspec field, original IP header field, and original IP content field;
  • the third encapsulation format includes the original IP header field, the newly created UDP header field, the Tspec field, the original UDP header field, the ESI header field, and the original IP message content field;
  • the fourth encapsulation format includes the new IP header field, the new UDP header field, the Tspec field, the original UDP header field, the ESP header field, the original IP header field, and the original IP content field.
  • encapsulating the first message according to the encapsulation rule to obtain the second message includes:
  • the original IP header field and the original IP content field of the first message Insert the UDP header field and the Tspec field between them, and adjust the protocol field in the original IP header field to obtain the second packet; or,
  • the new IP header is inserted before the original IP header field of the first message according to the second encapsulation format Field, UDP header field and Tspec field to obtain the second packet; or,
  • the original UDP header field is included in the first message, and the original UDP header field is inserted between the original IP header field and the original IP content field of the first message, according to the third encapsulation format, in the first message Insert the newly created UDP header field and the Tspec field between the original IP header field and the original UDP header field of a message to obtain the second message; or,
  • the original UDP header field is included in the first message, and the original UDP header field is inserted before the original IP header field of the first message, according to the fourth encapsulation format, in the newly created IP of the first message.
  • the newly created UDP header field and the Tspec field are inserted between the header field and the original UDP header field to obtain the second message.
  • the method before encapsulating the first message according to the preset encapsulation format to obtain the second message, the method further includes:
  • each of the above modules can be implemented by software or hardware.
  • it can be implemented in the following manner, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination.
  • the forms are located in different processors.
  • a device for sending a message is also provided, which is applied to the sending side.
  • the device is used to implement the above-mentioned embodiments and preferred implementations, and those that have been explained will not be repeated.
  • the term "module" can implement a combination of software and/or hardware with predetermined functions.
  • the devices described in the following embodiments are preferably implemented by software, implementation by hardware or a combination of software and hardware is also possible and conceived.
  • Fig. 14 is a structural block diagram of a message sending device provided according to an embodiment of the present disclosure. As shown in Fig. 14, the device in this embodiment includes:
  • the sending module 702 is configured to send the second message to the receiving side.
  • each of the above modules can be implemented by software or hardware.
  • it can be implemented in the following manner, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination.
  • the forms are located in different processors.
  • a message processing device is also provided, which is applied to an intermediate node.
  • the device is used to implement the above-mentioned embodiments and preferred implementations, and what has been described will not be repeated.
  • the term "module" can implement a combination of software and/or hardware with predetermined functions.
  • the devices described in the following embodiments are preferably implemented by software, implementation by hardware or a combination of software and hardware is also possible and conceived.
  • FIG. 15 is a structural block diagram of a message processing device provided according to an embodiment of the present disclosure. As shown in FIG. 15, the device in this embodiment includes:
  • the processing module 802 is configured to determine and process the second packet according to the flow attribute information.
  • each of the above modules can be implemented by software or hardware.
  • it can be implemented in the following manner, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination.
  • the forms are located in different processors.
  • a device for decapsulating a message is also provided, which is applied to the receiving side.
  • the device is used to implement the above-mentioned embodiments and preferred implementations, and what has been described will not be repeated.
  • the term "module" can implement a combination of software and/or hardware with predetermined functions.
  • the devices described in the following embodiments are preferably implemented by software, implementation by hardware or a combination of software and hardware is also possible and conceived.
  • FIG. 16 is a structural block diagram of a message decapsulation device provided according to an embodiment of the present disclosure. As shown in FIG. 16, the device in this embodiment includes:
  • the decapsulation module 902 is configured to perform decapsulation processing on the second message, where the second message is obtained by encapsulating the first message by the sending side according to a preset encapsulation format, and the first message is obtained by the sending side.
  • the service flow is encapsulated and obtained, the second message carries flow attribute information, and the flow attribute information is used to indicate the characteristic attributes of the service flow.
  • the sending side encapsulates the first message according to a preset encapsulation format to obtain the second message, which includes:
  • the second packet is obtained by inserting at least a transmission characteristic Tspec field in a preset position of the first packet by the sending side according to a preset encapsulation format, where the Tspec field includes stream attribute information.
  • the stream attribute information includes at least one of the following:
  • the Tspec field includes a subsequent protocol field N-P field, a length field, a content indication field, and an information field;
  • the content indication field is used to indicate the type of stream attribute information and whether the corresponding type of stream attribute information appears in the information field according to a preset bit definition, and the information field is used to indicate the content of the stream attribute information.
  • the second message is obtained by encapsulating the first message by the sending side according to a preset encapsulation format, which further includes:
  • the second message is obtained by inserting the Tspec field and the User Datagram Protocol UDP header field in the preset position of the first message by the sending side according to the preset encapsulation format; wherein, the UDP header field is inserted before the Tspec field.
  • the second message is obtained by encapsulating the first message by the sending side according to a preset encapsulation format, which further includes:
  • the second message is obtained by encapsulating the first message by the sending side according to the configured encapsulation rule;
  • the configured encapsulation rule includes: configuring an encapsulation format and configuring a deterministic service flow matching rule;
  • the deterministic business flow matching rule is used to match the business flow with the deterministic business flow.
  • the packaging format includes one of the following: a first packaging format, a second packaging format, a third packaging format, and a fourth packaging format; wherein,
  • the first encapsulation format includes the original network protocol IP header field, UDP header field, Tspec field, and original IP content field;
  • the second encapsulation format includes new IP header field, UDP header field, Tspec field, original IP header field, and original IP content field;
  • the third encapsulation format includes the original IP header field, the newly created UDP header field, the Tspec field, the original UDP header field, the ESI header field, and the original IP message content field;
  • the fourth encapsulation format includes the new IP header field, the new UDP header field, the Tspec field, the original UDP header field, the ESP header field, the original IP header field, and the original IP content field.
  • the second message is obtained by encapsulating the first message by the sending side according to the configured encapsulation rule, which further includes:
  • the original IP header of the first packet is added according to the first encapsulation format. Insert the UDP header field and the Tspec field between the field and the original IP content field, and adjust the protocol field in the original IP header field to obtain; or,
  • the second packet is configured by the sending side in the encapsulation format as the second encapsulation format, and the original UDP header field is not included in the first packet, according to the second encapsulation format, the original IP header of the first packet Insert the newly created IP header field, UDP header field and Tspec field before the field to obtain; or,
  • the sending side of the second message includes the original UDP header field in the first message
  • the original UDP header field is inserted between the original IP header field and the original IP content field of the first message
  • the sending side of the second message includes the original UDP header field in the first message, and the original UDP header field is inserted before the original IP header field of the first message, according to the fourth encapsulation format, Insert the newly created UDP header field and the Tspec field between the newly created IP header field and the original UDP header field of the first message to obtain.
  • performing decapsulation processing on the second message includes:
  • the encapsulation format of the second packet is the first encapsulation format
  • the encapsulation format of the second packet is the second encapsulation format, remove the newly created IP header field, UDP header field, and Tspec field in the second packet; or,
  • the encapsulation format of the second packet is the third encapsulation format, remove the newly created UDP header field and the Tspec field in the second packet, and adjust the protocol field in the original IP header field; or,
  • the encapsulation format of the second packet is the fourth encapsulation format, remove the new IP header field, the new UDP header field, and the Tspec field in the second packet, and adjust the protocol field in the original IP header field .
  • each of the above modules can be implemented by software or hardware.
  • it can be implemented in the following manner, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination.
  • the forms are located in different processors.
  • a message receiving device is also provided, which is applied to the receiving side.
  • the device is used to implement the above-mentioned embodiments and preferred implementations, and the descriptions that have been described will not be repeated.
  • the term "module" can implement a combination of software and/or hardware with predetermined functions.
  • the devices described in the following embodiments are preferably implemented by software, implementation by hardware or a combination of software and hardware is also possible and conceived.
  • FIG. 17 is a structural block diagram of a message receiving device provided according to an embodiment of the present disclosure. As shown in FIG. 17, the device in this embodiment includes:
  • the receiving module 1002 is configured to receive the second message sent by the sending side.
  • each of the above modules can be implemented by software or hardware.
  • it can be implemented in the following manner, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination.
  • the forms are located in different processors.
  • the embodiment of the present disclosure also provides a computer-readable storage medium, and a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any of the foregoing method embodiments when running. step.
  • the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the method steps described in the above-mentioned Embodiments 1 to 5.
  • the foregoing computer-readable storage medium may include, but is not limited to: U disk, Read-Only Memory (Read-Only Memory, ROM for short), Random Access Memory (Random Access Memory, for short) It is a variety of media that can store computer programs such as RAM), mobile hard disks, magnetic disks, or optical disks.
  • An embodiment of the present disclosure also provides an electronic device, including a memory and a processor, the memory is stored with a computer program, and the processor is configured to run the computer program to execute the steps in any of the foregoing method embodiments.
  • the aforementioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the aforementioned processor, and the input-output device is connected to the aforementioned processor.
  • the above-mentioned processor may be configured to execute the method steps described in the above-mentioned Embodiments 1 to 5 through a computer program.
  • modules or steps of the present disclosure can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices.
  • they can be implemented with program codes executable by the computing device, so that they can be stored in the storage device for execution by the computing device, and in some cases, can be executed in a different order than here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本公开提供了一种报文封装方法及装置、报文解封装方法及装置,其中,报文封装方法包括:根据预设的封装格式对第一报文进行封装以获取第二报文,其中,所述第一报文由业务流封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。

Description

报文封装方法及装置、报文解封装方法及装置 技术领域
本公开涉及通信领域,具体而言,涉及一种报文封装方法及装置、报文解封装方法及装置。
背景技术
在互联网工程任务组IETF的标准Detnet工作组的草案中,关于确定性业务流的处理指出了基于IP的流标示映射问题,并具体提出在不同的Detnet封装中进行流标示映射的处理方案;图1是相关技术中流标示映射的示意图,如图1所示,相应技术中的映射关系一般是固定的,即不会动态变化。
上述处理方式在大多数情况下均可生效,但在对于需经过网络地址转换器(Network Address Translator,NAT)处理或者附带协议转换器的网络地址转换器(Network Address Translator Protocol Translator,NATPT)处理的情况下,上述处理方式则无法工作;图2是相关技术中传输过程穿越NATPT的示意图,如图2所示,需传输的业务流需穿越多个NATPT,才能到达对端。上述业务流的传输过程中,每穿越一次NATPT,外部IP地址和端口号均有可能发生变化,且每次穿越NATPT而导致的变化并不遵循固定的映射对照关系。因此,相关技术中基于固定映射关系进行确定性业务流跟踪的方法则上述情形下即会失效。
针对上述相关技术中,确定性业务流的处理无法适用的问题,相关技术中尚未提出有效的解决方案。
发明内容
本公开实施例提供一种报文封装方法及装置、报文解封装方法及装置,以至少解决相关技术中确定性业务流的处理无法适用的问题。
根据本公开的一个实施例,提供了一种报文封装方法,应用于发送侧, 所述方法包括:根据预设的封装格式对第一报文进行封装以获取第二报文,其中,所述第一报文由业务流封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。
根据本公开的另一个实施例,还提供了一种报文发送方法,应用于发送侧,所述方法包括:将第二报文发送至接收侧;其中,所述第二报文根据上述实施例中所述的报文封装方法得到。
根据本公开的另一个实施例,还提供了一种报文处理方法,应用于中间节点,所述方法包括:根据流属性信息对第二报文进行确定与处理;其中,所述第二报文根据上述实施例中所述的报文封装方法得到。
根据本公开的另一个实施例,还提供了一种报文解封装方法,应用于接收侧,所述方法包括:对第二报文进行解封装处理,其中,所述第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,所述第一报文由所述发送侧对业务流进行封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。
根据本公开的另一个实施例,还提供了一种报文解封装方法,应用于接收侧,所述方法包括:接收发送侧发送的第二报文,并根据上述实施例中所述的报文解封装方法对所述第二报文进行解封装处理。
根据本公开的另一个实施例,还提供了一种报文封装装置,应用于发送侧,所述装置包括:封装模块,设置为根据预设的封装格式对第一报文进行封装以获取第二报文,其中,所述第一报文由业务流封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。
根据本公开的另一个实施例,还提供了一种报文封装装置,应用于发送侧,所述装置包括:发送模块,设置为将第二报文发送至接收侧;其中,所述第二报文根据上述实施例中所述的报文封装装置得到。
根据本公开的另一个实施例,还提供了一种报文处理装置,应用于中间节点,所述装置包括:处理模块,设置为根据流属性信息对第二报文进 行确定与处理;其中,所述第二报文根据上述实施例中所述的报文封装装置得到。
根据本公开的另一个实施例,还提供了一种报文解封装装置,应用于接收侧,所述装置包括:解封装模块,设置为对第二报文进行解封装处理,其中,所述第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,所述第一报文由所述发送侧对业务流进行封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。
根据本公开的另一个实施例,还提供了一种报文接收装置,应用于接收侧,所述装置包括:接收模块,设置为接收发送侧发送的第二报文,并根据上述实施例所述的报文解封装装置对所述第二报文进行解封装处理。
根据本公开的另一个实施例,还提供了一种计算机可读的存储介质,所述计算机可读的存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
根据本公开的另一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。
通过本公开,由于可以根据预设的封装格式对第一报文进行封装以获取第二报文,其中,所述第一报文由业务流封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。因此,本公开可将解决相关技术中确定性业务流的处理无法适用的问题,以达到对确定性业务流在不同传输过程中均可适用的效果。
附图说明
此处所说明的附图用来提供对本公开的进一步理解,构成本申请的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:
图1是相关技术中流标示映射的示意图;
图2是相关技术中传输过程穿越NATPT的示意图;
图3是根据本公开实施例提供的报文封装方法的流程图;
图4是根据本公开实施例提供的Tspec字段的示意图;
图5是根据本公开实施例提供的第一封装格式的示意图;
图6是根据本公开实施例提供的第二封装格式的示意图;
图7是根据本公开实施例提供的第三封装格式的示意图;
图8是根据本公开实施例提供的第四封装格式的示意图;
图9是根据本公开实施例提供的报文发送方法的流程图;
图10是根据本公开实施例提供的报文处理方法的流程图;
图11是根据本公开实施例提供的报文解封装方法的流程图;
图12是根据本公开实施例提供的报文接收方法的流程图;
图13是根据本公开实施例提供的报文封装装置的结构框图;
图14是根据本公开实施例提供的报文发送装置的结构框图;
图15是根据本公开实施例提供的报文处理装置的结构框图;
图16是根据本公开实施例提供的报文解封装装置的结构框图;
图17是根据本公开实施例提供的报文接收装置的结构框图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本公开。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
实施例1
本实施例提供了一种报文封装方法,应用于发送侧,图3是根据本公 开实施例提供的报文封装方法的流程图,如图3所示,本实施例中的方法包括:
S102,根据预设的封装格式对第一报文进行封装以获取第二报文,其中,第一报文由业务流封装获得,第二报文中携带有流属性信息,流属性信息用于指示业务流的特征属性。
需要进一步说明的是,上述第一报文即指示按照相关技术中的常规报文格式对于待发送的业务流进行封装后所得的报文,通常而言,第一报文中包括IP头部字段与IP内容字段,该IP头部字段与IP内容字段即本实施例中下述的原始IP头部字段与原始IP内容字段,本领域技术人员可根据本领域的公知常识获知原始IP头部字段与原始IP内容字段的具体构成部分,故在此不再赘述。
本实施例中所示的根据预设的封装格式对第一报文进行封装以获取第二报文,可以是在第一报文的基础上根据预设的封装格式进行封装,也可以是在待发送的业务流的基础上,将第一报文与第二报文对应的封装格式结合以直接对待发送的业务流进行封装,本公开对此不作限定。
需要进一步说明的是,上述步骤S102的执行主体为发送侧,具体为发送侧中的确定性业务网关(Deterministic Traffic Gateway,DTGW)。
通过本实施例中的报文封装方法,由于可以根据预设的封装格式对第一报文进行封装以获取第二报文,其中,所述第一报文由业务流封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。因此,本实施例中的报文封装方法可将解决相关技术中确定性业务流的处理无法适用的问题,以达到对确定性业务流在不同传输过程中均可适用的效果。
具体而言,由于本实施例中的第二报文携带有流属性信息,因此,在第二报文传输中,即使需穿越NAT或NATPT进而导致外部IP地址和端口号发生变化,但第二报文仍可根据流属性信息与对应的业务流建立确定的映射关系,从而仍可实现对于业务流的在发送侧至接收侧之间的跟踪处 理。
在一可选实施例中,根据预设的封装格式对第一报文进行封装以获取第二报文,包括:
根据预设的封装格式在第一报文的预设位置至少***传送特性Tspec字段以获取第二报文,其中,Tspec字段包括流属性信息。
需要进一步说明的是,由于上述在第一报文中***的Tspec字段包括流属性信息,因此,***Tspec字段后的第一报文,即第二报文即可实现携带流属性信息。
在一可选实施例中,流属性信息包括以下至少之一:
最大帧长度、循环间隔、每循环最大报文数、最大可容忍累计时延、每节点调度时延、最大可容忍累计抖动。
在一可选实施例中,Tspec字段包括后续协议字段(next protocol,N-P)字段、长度Length字段、内容指示字段以及信息字段;
其中,内容指示字段用于根据预设的比特位定义指示流属性信息的类型以及对应类型的流属性信息是否在信息字段中出现,信息字段用于指示流属性信息的内容。
需要进一步说明的是,上述N-P字段即用于指示该N-P字段后续的协议类型;Length字段用于指示Tspec字段的总长度;内容指示字段用于指示该内容指示字段后续出现的信息字段中的一个或多个流属性信息按照预设的顺序依次出现,具体而言,内容指示字段包括多个预设顺序排列的bit位,以对应指示后续的信息字段中的流属性信息是否使用,例如,可通过“1”指示对应的流属性信息会出现在随后的信息字段,通过“0”指示对应的流属性信息不会出现在随后的信息字段。目前内容指示字段只使用了bit位0-5,其余bit位暂时保留。
上述信息字段中,定义有上述流属性信息包括:最大帧长度、循环间隔、每循环最大报文数、最大可容忍累计时延、每节点调度时延、最大可容忍累计抖动,上述流属性信息的具体含义如下:
最大帧长度:用于指示业务流封装后的第二报文的最大报文长度,记为maxFrameSize;上述最大帧长度在内容指示字段中由0bit位指示,此bit位值为0表示没有此信息编码,为1表示此信息出现。
循环间隔:用于指示希望的调度间隔,也可以指示第二报文自身的循环间隔,单位为纳秒(ns),记为cycleTime;上述循环间隔在内容指示字段中由1bit位指示,此bit位值为0表示没有此信息编码,为1表示此信息出现。
每循环最大报文数:用于指示上述循环间隔所指示的时间长度内,最大的可能到达报文数,记为MaxIntervalFrames,上述每循环最大报文数在内容指示字段中由2bit位指示,此bit位值为0表示没有此信息编码,为1表示此信息出现。
最大可容忍累计时延:用于指示第二报文转发路径上,最大的累计时延,可用于路径计算,单位为纳秒(ns),记为maxAccumulatedLatency,上述最大可容忍累计时延在内容指示字段中由3bit位指示,此bit位值为0表示没有此信息编码,为1表示此信息出现。
每节点调度时延:用于进行异步调度,当每节点调度时延对应数值小于或者等于7时,该每节点调度时延用于指示期望在基于收到报文的周期后,第几个调度周期调度出去;上述调度周期依赖于设备内部的时间调度周期,及队列调度时间片,譬如802.1Qbv的TimeInterval。
当每节点调度时延对应数值大于7时,该每节点调度时延用于指示期望在多长时间内调度出去,单位纳秒(ns),记为perNodeSchDelay。上述每节点调度时延在内容指示字段中由4bit位指示,此bit位值为0表示没有此信息编码,为1表示此信息出现。
最大可容忍累计抖动:用于指示报文转发路径上最大的累计抖动。该最大可容忍累计抖动可用于时隙调度安排,路径计算。当最大可容忍累计抖动对应数值小于或者等于7时,该最大可容忍累计抖动用于指示抖动范围=cycleTime/(MaxIntervalFrames*maxAccumulatedJitter),
当最大可容忍累计抖动对应数值大于7时,该最大可容忍累计抖动指示可容忍的累计抖动时间,单位为纳秒(ns),记为maxAccumulatedJitter,最大可容忍累计抖动在内容指示字段中由5bit位指示,此bit位值为0表示没有此信息编码,为1表示此信息出现。
需要进一步说明的是,上述流属性信息仅为部分可以表征业务流的特征属性的信息,本实施例中的Tspec字段也可以在上述信息字段的基础上重新定义新的流属性信息,本公开对此不作限定。图4是根据本公开实施例提供的Tspec字段的示意图,上述Tspec字段的结构如图4所示。
在一可选实施例中,根据预设的封装格式对第一报文进行封装以获取第二报文,还包括:
根据预设的封装格式,在第一报文的预设位置***Tspec字段以及用户数据报协议UDP头部字段,以获取第二报文,其中,UDP头部字段***至Tspec字段之前。
需要进一步说明的是,上述UDP头部字段即用于指示第二报文中该UDP头部字段后续出现的即为Tspec字段;具体而言,该UDP头部字段可以通过目的端口号进行指示,例如4600端口。
在一可选实施例中,根据预设的封装格式对第一报文进行封装以获取第二报文,包括:
配置封装规则,并根据封装规则对第一报文进行封装以获取第二报文;其中,配置封装规则包括:配置封装格式以及配置确定性业务流匹配规则;
确定性业务流匹配规则用于对业务流与确定性业务流进行匹配。
需要进一步说明的是,上述封装规则一方面用于封装格式的配置,另一方面用于确定性业务流匹配规则的配置;上述确定性业务流匹配规则具体可对待发送的业务流进行匹配,以确定该业务流是否需要按照本实施例中的报文封装方法进行封装。
在一可选实施例中,封装格式包括以下之一:第一封装格式、第二封装格式、第三封装格式以及第四封装格式;其中,
第一封装格式包括原始网络协议IP头部字段、UDP头部字段、Tspec字段、原始IP内容字段;
第二封装格式包括新建IP头部字段、UDP头部字段、Tspec字段、原始IP头部字段、原始IP内容字段;
第三封装格式包括原始IP头部字段,新建UDP头部字段、Tspec字段、原始UDP头部字段、ESI头部字段,原始IP报文内容字段;
第四封装格式包括新建IP头部字段、新建UDP头部字段、Tspec字段、原始UDP头部字段、ESP头部字段、原始IP头部字段、原始IP内容字段。
需要进一步说明的是,上述第一封装格式与第二封装格式可根据配置的封装格式进行对应的选择或确定,上述第三封装格式与第四封装格式可根据第一报文所采用的封装格式进行对应的选择或确定;具体而言,上述第三封装格式与第四封装格式是在第一报文中已经进行了ipsec处理的情形下所采用的封装格式。
上述第一封装格式也可称为传输模式,上述第二封装格式也可称为隧道模式,上述第三封装格式以及第四封装格式也可称为融合模式或混合模式。
在一可选实施例中,根据封装规则对第一报文进行封装以获取第二报文,包括:
在封装格式配置为第一封装格式,以及第一报文中未包括原始UDP头部字段的情况下,根据第一封装格式,在第一报文的原始IP头部字段以及原始IP内容字段之间***UDP头部字段与Tspec字段,并调整原始IP头部字段中的协议字段,以获取第二报文;或者,
在封装格式配置为第二封装格式,以及第一报文中未包括原始UDP头部字段的情况下,根据第二封装格式,在第一报文的原始IP头部字段之前***新建IP头部字段、UDP头部字段与Tspec字段,以获取第二报文;或者,
在第一报文中包括原始UDP头部字段,以及原始UDP头部字段***在第一报文的原始IP头部字段以及原始IP内容字段之间的情况下,根据第三封装格式,在第一报文的原始IP头部字段与原始UDP头部字段之间***新建UDP头部字段与Tspec字段,以获取第二报文;或者,
在第一报文中包括原始UDP头部字段,以及原始UDP头部字段***在第一报文的原始IP头部字段之前的情况下,根据第四封装格式,在第一报文的新建IP头部字段与原始UDP头部字段之间***新建UDP头部字段与Tspec字段,以获取第二报文。
图5是根据本公开实施例提供的第一封装格式的示意图,上述第一封装格式的结构如图5所示;图6是根据本公开实施例提供的第二封装格式的示意图,上述第二封装格式的结构如图6所示;图7是根据本公开实施例提供的第三封装格式的示意图,上述第三封装格式的结构如图7所示;图8是根据本公开实施例提供的第三封装格式的示意图,上述第三封装格式的结构如图8所示。
需要进一步说明的是,上述第一报文中包括原始UDP头部字段,即指示第一报文是对于业务流进行ipsec处理后所得到的报文,图7与图8分别示出了对于业务流的两种不同的ipsec处理模式,即ESP传输模式以及ESP隧道模式;上述第三封装格式中对应的原始UDP头部字段***在第一报文的原始IP头部字段以及原始IP内容字段之间,即指示ipsec的ESP传输模式,上述第四封装格式中对应的原始UDP头部字段***在第一报文的原始IP头部字段之前,即指示ipsec的ESP隧道模式。
上述第一封装格式中,调整原始IP头部字段中的协议字段,即指示将原始IP头部字段中的协议protocol字段中所指示的原始协议内容修改为指示UDP协议,以指示原始IP头部字段之后为UDP字段;而该protocol字段中所指示的原始协议内容写入至Tspec字段中的N-P字段,以指示Tspec字段之后对应的协议内容。
上述第二封装格式中
在一可选实施例中,根据预设的封装格式对第一报文进行封装以获取第二报文之前,还包括:
检测发送侧与接收侧之间是否配置有网络地址转换NAT功能。
需要进一步说明的是,发送侧与接收侧之间配置有网络地址转换NAT功能,具体可以为发送侧与接收侧之间设置有NAT或NATPT,或具有可实现网络地址转换功能的相关装置。在检测发送侧与接收侧之间配置有NAT功能的情形下,则需采用本实施例中的报文封装方法,在检测发送侧与接收侧之间未配置有NAT功能时,可本实施例中的报文封装方法或其它封装方法,本公开对此不作限定。
以下通过具体实施例的方式对于本实施例中的报文封装方法进行进一步的阐述。
具体实施例1
发送侧的DTGW功能开启,并检测到发送侧与接收侧之间的网络中具有NAT存在,即DTGW确定需要采用上述实施例中的报文封装方法进行业务流的封装。基于此,DTGW配置封装规则,该封装规则包括配置封装格式以及配置确定性业务匹配规则。
发送侧需对以下业务流进行传输:源地址10.0.0.3,目的地址10.0.0.4,业务类型为TCP,TCP的源端口号为20000,目的端口号为5000。
DTGW首先通过确定性业务匹配规则匹配上述业务流,确定需采用上述实施例中的报文封装方法进行封装;同时,DTGW根据配置,确定该业务流进行封装的模式为传输模式,即上述实施例中的第一封装格式;此时,在DTGW未检测到该业务流已经经过ipsec的处理的情形下,即可采用第一封装格式进行封装处理。
需要进一步说明的是,DTGW进行处理的可以是业务流,也可以是采用常规封装方式对业务流进行封装处理后的第一报文,本具体实施例中以DTGW对第一报文的处理进行阐述,后续的具体实施例2至3均采用该方式,不再赘述。
需要进一步说明的是,上述DTGW检测该业务流是否经过ipsec的处理,可以通过检测第一报文中是否已存在UDP头部字段,即原始UDP头部字段,或UDP报文目的端口号是否为如4500等ipsec使用的知名端口号,等方式以实现检测。
DTGW未检测到该业务流已经经过ipsec的处理
DTGW根据第一封装格式对第一报文进行***操作,即在第一报文的原始IP头部字段与原始IP内容字段之间依次***UDP头部字段以及Tspec字段。根据上述业务流的流属性,最大帧长度=100,循环间隔=125ns,每间隔报文数=16,则对应的Tspec字段编码内容为:
N-P字段为0x06,指示后续协议为tcp;Length字段为10,指示第二报文长度为10;内容指示字段为0x0007,指示第二报文中的存在最大帧长度、循环间隔以及每间隔报文数;信息字段为0x0064007D0010,则按上述最大帧长度、循环间隔以及每间隔报文数的顺序依次指示了上述流属性信息的内容。需要进一步说明的是,上述Tspec字段均采用16进制,其中,内容指示字段转换为2进制,即对应上述实施例中的多个bit位,信息字段转换为10进制,则对应上述流属性的具体数值。
完成上述Tspec字段的编码后,即可对第一报文进行封装。将原始IP头部字段的protocol字段由TCP协议对应的0x06,修改为UDP协议对应的0x11;之后可在原始IP头部字段与原始IP内容字段之间***UDP头部字段,并在UDP头部字段之后***上述Tspec字段,其中,UDP头部字段指示目的端口号为4600。由于***UDP头部字段与Tspec字段后,报文长度发生变化,故还需修改原始IP内容字段中的total length字段以及checksum字段,以将报文长度增加18(其中UDP头部字段对应8字节,Tspec字段对应10字节),以此即可得到第二报文。
发送侧的DTGW得到第二报文后,即可将第二报文发送至接收侧的DTGW。
具体实施例2
发送侧的DTGW功能开启,并检测到发送侧与接收侧之间的网络中具有NAT存在,即DTGW确定需要采用上述实施例中的报文封装方法进行业务流的封装。基于此,DTGW配置封装规则,该封装规则包括配置封装格式以及配置确定性业务匹配规则。
发送侧需对以下业务流进行传输:源地址10.0.0.5,目的地址10.0.0.6,业务类型为TCP,TCP的源端口号为20000,目的端口号为5000。
DTGW首先通过确定性业务匹配规则匹配上述业务流,确定需采用上述实施例中的报文封装方法进行封装;同时,DTGW根据配置,确定该业务流进行封装的模式为隧道模式,即上述实施例中的第二封装格式;此时,在DTGW未检测到该业务流已经经过ipsec的处理的情形下,即可采用第二封装格式进行封装处理。
DTGW根据第二封装格式对第一报文进行***操作,即首先构建新建IP头部字段,该新建IP头部字段中包括源地址10.0.0.5,目的地址10.0.0.6,协议类型UDP;需要进一步说明的是,为确保设置的目的地址可到达接收端,此处还可以使用原始IP头部字段中的地址。进一步地,根据上述业务流的流属性,最大帧长度=100,循环间隔=125ns,每间隔报文数=16,则对应的Tspec字段编码内容为:
N-P字段为0x06,指示后续协议为tcp;Length字段为10,指示第二报文长度为10;内容指示字段为0x0007,指示第二报文中的存在最大帧长度、循环间隔以及每间隔报文数;信息字段为0x0064007D0010,则按上述最大帧长度、循环间隔以及每间隔报文数的顺序依次指示了上述流属性信息的内容。
完成上述新建IP头部字段的构建以及Tspec字段的编码后,即可对第一报文进行封装;具体而言,将上述新建IP头部字段、UDP头部字段以及Tspec字段依次***在原始IP头部字段之前,其中,UDP头部字段指示目的端口号为4600。由于***UDP头部字段与Tspec字段后,报文长度发生变化,故还需修改原始IP内容字段中的total length字段以及 checksum字段,以将报文长度增加18(其中UDP头部字段对应8字节,Tspec字段对应10字节),以此即可得到第二报文。
发送侧的DTGW得到第二报文后,即可将第二报文发送至接收侧的DTGW。
具体实施例3
发送侧的DTGW功能开启,并检测到发送侧与接收侧之间的网络中具有NAT存在,即DTGW确定需要采用上述实施例中的报文封装方法进行业务流的封装。基于此,DTGW配置封装规则,该封装规则包括配置封装格式以及配置确定性业务匹配规则。
发送侧需对以下业务流进行传输:源地址10.0.0.3,目的地址10.0.0.4,业务类型为TCP,TCP的源端口号为20000,目的端口号为5000。
DTGW首先通过确定性业务匹配规则匹配上述业务流,确定需采用上述实施例中的报文封装方法进行封装;同时,DTGW根据配置,确定该业务流进行封装的模式为传输模式;此时,DTGW检测到该业务流对应的第一报文已经经过ipsec的处理,故忽视配置中的封装格式,而根据ipsec的处理方式采用混合模式进行封装,即采用第三封装格式或第四封装格式进行封装。
根据上述业务流的流属性,最大帧长度=100,循环间隔=125ns,每间隔报文数=16,则对应的Tspec字段编码内容为:
N-P字段为0x06,指示后续协议为tcp;Length字段为10,指示第二报文长度为10;内容指示字段为0x0007,指示第二报文中的存在最大帧长度、循环间隔以及每间隔报文数;信息字段为0x0064007D0010,则按上述最大帧长度、循环间隔以及每间隔报文数的顺序依次指示了上述流属性信息的内容。
完成上述Tspec字段的编码后,即可对第一报文进行封装;具体而言,将新建UDP头部字段以及上述Tspec字段依次***至第一报文中,***位置依据第一报文所采用的ipsec的处理方式进行选择或确定,具体而言, 在第一报文中原始UDP头部字段位于原始IP头部字段之后,则采用第三封装格式将新建UDP头部字段以及上述Tspec字段***至原始IP头部字段与原始UDP头部字段之间;在第一报文中原始UDP头部字段位于原始IP头部字段之前,则采用第四封装格式将新建UDP头部字段以及上述Tspec字段***新建IP头部字段与原始UDP头部字段之间;其中,新建UDP头部字段指示目的端口号为4600。由于***上述新建UDP头部字段与Tspec字段后,报文长度发生变化,故还需修改原始IP内容字段中的total length字段以及checksum字段,以将报文长度增加18(其中新建UDP头部字段对应8字节,Tspec字段对应10字节),以此即可得到第二报文。
发送侧的DTGW得到第二报文后,即可将第二报文发送至接收侧的DTGW。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个计算机可读的存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
实施例2
本实施例提供了一种报文发送方法,应用于发送侧,图9是根据本公开实施例提供的报文发送方法的流程图,如图9所示,本实施例中的报文发送方法包括:
S202,将第二报文发送至接收侧。
本实施例中的第二报文是根据上述实施例1所述的报文封装方法得到的,因此,本实施例中第二报文的相关技术特征与技术效果均与上述实施例1相对应,本公开在此不再赘述。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个计算机可读的存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
实施例3
本实施例还提供了一种报文处理方法,应用于中间节点,图10是根据本公开实施例提供的报文处理方法的流程图,如图10所示,本实施例中的报文处理方法包括:
S302,根据流属性信息对第二报文进行确定与处理。
本实施例中的第二报文是根据上述实施例1所述的报文封装方法得到的,因此,本实施例中第二报文的相关技术特征与技术效果均与上述实施例1相对应,本公开在此不再赘述。
需要进一步说明的是,上述对第二报文进行确定与处理,即指示确定性业务流的追踪与确定;由于流属性信息与第二报文的映射关系固定,因此,本领域技术人员可以根据相关技术中基于IP地址等映射对象的确定性业务流处理方式,获知如何根据流属性信息对第二报文进行确定,本公开在此不再赘述。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个计算机可读的存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端 设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
实施例4
本实施例还提供了一种报文解封装方法,应用于接收侧,图11是根据本公开实施例提供的报文解封装方法的流程图,如图11所示,本实施例中的报文解封装方法包括:
S402,对第二报文进行解封装处理,其中,第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,第一报文由发送侧对业务流进行封装获得,第二报文中携带有流属性信息,流属性信息用于指示业务流的特征属性。
需要进一步说明的是,上述步骤S402的执行主体为接收侧,具体为接收侧中的DTGW。
需要进一步说明的是,上述步骤S402中,对第二报文执行的解封装处理与第二报文的封装处理相对应;对第二报文进行封装的相关技术特征与技术效果均与实施例1中相对应,故本实施例不再赘述。
在一可选实施例中,第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,包括:
第二报文由发送侧根据预设的封装格式在第一报文的预设位置至少***传送特性Tspec字段以获取,其中,Tspec字段包括流属性信息。
在一可选实施例中,流属性信息包括以下至少之一:
最大帧长度、循环间隔、每循环最大报文数、最大可容忍累计时延、每节点调度时延、最大可容忍累计抖动。
在一可选实施例中,Tspec字段包括后续协议字段N-P字段、长度Length字段、内容指示字段以及信息字段;
其中,内容指示字段用于根据预设的比特位定义指示流属性信息的类型以及对应类型的流属性信息是否在信息字段中出现,信息字段用于指示 流属性信息的内容。
在一可选实施例中,第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,还包括:
第二报文由发送侧根据预设的封装格式,在第一报文的预设位置***Tspec字段以及用户数据报协议UDP头部字段以获取;其中,UDP头部字段***至Tspec字段之前。
在一可选实施例中,第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,还包括:
第二报文由发送侧根据配置的封装规则对第一报文进行封装以获取;其中,配置的封装规则包括:配置封装格式以及配置确定性业务流匹配规则;
确定性业务流匹配规则用于对业务流与确定性业务流进行匹配。
在一可选实施例中,封装格式包括以下之一:第一封装格式、第二封装格式、第三封装格式以及第四封装格式;其中,
第一封装格式包括原始网络协议IP头部字段、UDP头部字段、Tspec字段、原始IP内容字段;
第二封装格式包括新建IP头部字段、UDP头部字段、Tspec字段、原始IP头部字段、原始IP内容字段;
第三封装格式包括原始IP头部字段,新建UDP头部字段、Tspec字段、原始UDP头部字段、ESI头部字段,原始IP报文内容字段;
第四封装格式包括新建IP头部字段、新建UDP头部字段、Tspec字段、原始UDP头部字段、ESP头部字段、原始IP头部字段、原始IP内容字段。
在一可选实施例中,第二报文由发送侧根据配置的封装规则对第一报文进行封装以获取,还包括:
第二报文由发送侧在封装格式配置为第一封装格式,以及第一报文中 未包括原始UDP头部字段的情况下,根据第一封装格式,在第一报文的原始IP头部字段以及原始IP内容字段之间***UDP头部字段与Tspec字段,并调整原始IP头部字段中的协议字段以获取;或者,
第二报文由发送侧在封装格式配置为第二封装格式,以及第一报文中未包括原始UDP头部字段的情况下,根据第二封装格式,在第一报文的原始IP头部字段之前***新建IP头部字段、UDP头部字段与Tspec字段以获取;或者,
第二报文由发送侧在第一报文中包括原始UDP头部字段,以及原始UDP头部字段***在第一报文的原始IP头部字段以及原始IP内容字段之间的情况下,根据第三封装格式,在第一报文的原始IP头部字段与原始UDP头部字段之间***新建UDP头部字段与Tspec字段以获取;或者,
第二报文由发送侧在第一报文中包括原始UDP头部字段,以及原始UDP头部字段***在第一报文的原始IP头部字段之前的情况下,根据第四封装格式,在第一报文的新建IP头部字段与原始UDP头部字段之间***新建UDP头部字段与Tspec字段以获取。
在一可选实施例中,对第二报文进行解封装处理,包括:
在第二报文的封装格式为第一封装格式的情况下,去除第二报文中的UDP头部字段以及Tspec字段,并调整原始IP头部字段中的协议字段;或者,
在第二报文的封装格式为第二封装格式的情况下,去除第二报文中的新建IP头部字段、UDP头部字段以及Tspec字段;或者,
在第二报文的封装格式为第三封装格式的情况下,去除第二报文中的新建UDP头部字段以及Tspec字段,并调整原始IP头部字段中的协议字段;或者,
在第二报文的封装格式为第四封装格式的情况下,去除第二报文中的新建IP头部字段、新建UDP头部字段以及Tspec字段,并调整原始IP头部字段中的协议字段。
需要进一步说明的是,上述步骤S402中的解封装操作对应第二报文的封装操作,具体而言,即将第二报文封装过程中,在第一报文中***的字段去除,并调整对应的字段内容。
为进一步说明本实施例中的报文解封装方法,以下通过具体实施例的方式进行详细阐述。
具体实施例4
接收侧的DTGW开启,此时,DTGW接收到业务流,该业务流为采用传输模式,即上述第一封装格式进行封装后的第二报文。DTGW在进行确定过程中,可根据该第二报文中的UDP头部字段以及目的端口号,确定该第二报文采用UDT封装,进一步根据UDP头部字段以及目的端口号确定该第二报文未采用隧道模式进行封装,以此即可确定第二报文采用传输模式进行封装,即上述第一封装格式。
基于此,即可将第二报文中Tspec字段中的N-P字段中对应的协议信息赋值给原始IP头部字段;同时,DTGW检测Tspec字段中的Length字段,确定Tspec字段为10,故可修改原始IP头部字段中的total length字段以及checksum字段,其中,需将原始IP头部字段中total length字段指示的报文长度减去18(UDP头部字段对应的8字节,以及Tspec字段对应的10字节)
DTGW将第二报文中的UDP头部字段以及Tspec字段剥离后,即可再对于该报文进行转发。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个计算机可读的存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个 实施例所述的方法。
实施例5
本实施例中提供了一种报文接收方法,应用于接收侧,图12是根据本公开实施例提供的报文接收方法的流程图,如图12所示,本实施例中的报文接收方法包括:
S502,接收发送侧发送的第二报文,并对于第二报文进行解封装处理。
本实施例中对于第二报文的解封装处理采用上述实施例4中的报文解封装方法,因此,本实施例中第二报文的解封装处理的相关技术特征与技术效果均与上述实施例4相对应,本实施例在此不再赘述。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个计算机可读的存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
实施例6
在本实施例中还提供了一种报文封装装置,应用于发送侧,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图13是根据本公开实施例提供的报文封装装置的结构框图,如图13所示,本实施例中的报文封装装置包括:
封装模块602,设置为根据预设的封装格式对第一报文进行封装以获取第二报文,其中,第一报文由业务流封装获得,第二报文中携带有流属 性信息,流属性信息用于指示业务流的特征属性。
在一可选实施例中,根据预设的封装格式对第一报文进行封装以获取第二报文,包括:
根据预设的封装格式在第一报文的预设位置至少***传送特性Tspec字段以获取第二报文,其中,Tspec字段包括流属性信息。
在一可选实施例中,流属性信息包括以下至少之一:
最大帧长度、循环间隔、每循环最大报文数、最大可容忍累计时延、每节点调度时延、最大可容忍累计抖动。
在一可选实施例中,Tspec字段包括后续协议字段N-P字段、长度Length字段、内容指示字段以及信息字段;
其中,内容指示字段用于根据预设的比特位定义指示流属性信息的类型以及对应类型的流属性信息是否在信息字段中出现,信息字段用于指示流属性信息的内容。
在一可选实施例中,根据预设的封装格式对第一报文进行封装以获取第二报文,还包括:
根据预设的封装格式,在第一报文的预设位置***Tspec字段以及用户数据报协议UDP头部字段,以获取第二报文,其中,UDP头部字段***至Tspec字段之前。
在一可选实施例中,根据预设的封装格式对第一报文进行封装以获取第二报文,包括:
配置封装规则,并根据封装规则对第一报文进行封装以获取第二报文;其中,配置封装规则包括:配置封装格式以及配置确定性业务流匹配规则;
确定性业务流匹配规则用于对业务流与确定性业务流进行匹配。
在一可选实施例中,封装格式包括以下之一:第一封装格式、第二封装格式、第三封装格式以及第四封装格式;其中,
第一封装格式包括原始网络协议IP头部字段、UDP头部字段、Tspec 字段、原始IP内容字段;
第二封装格式包括新建IP头部字段、UDP头部字段、Tspec字段、原始IP头部字段、原始IP内容字段;
第三封装格式包括原始IP头部字段,新建UDP头部字段、Tspec字段、原始UDP头部字段、ESI头部字段,原始IP报文内容字段;
第四封装格式包括新建IP头部字段、新建UDP头部字段、Tspec字段、原始UDP头部字段、ESP头部字段、原始IP头部字段、原始IP内容字段。
在一可选实施例中,根据封装规则对第一报文进行封装以获取第二报文,包括:
在封装格式配置为第一封装格式,以及第一报文中未包括原始UDP头部字段的情况下,根据第一封装格式,在第一报文的原始IP头部字段以及原始IP内容字段之间***UDP头部字段与Tspec字段,并调整原始IP头部字段中的协议字段,以获取第二报文;或者,
在封装格式配置为第二封装格式,以及第一报文中未包括原始UDP头部字段的情况下,根据第二封装格式,在第一报文的原始IP头部字段之前***新建IP头部字段、UDP头部字段与Tspec字段,以获取第二报文;或者,
在第一报文中包括原始UDP头部字段,以及原始UDP头部字段***在第一报文的原始IP头部字段以及原始IP内容字段之间的情况下,根据第三封装格式,在第一报文的原始IP头部字段与原始UDP头部字段之间***新建UDP头部字段与Tspec字段,以获取第二报文;或者,
在第一报文中包括原始UDP头部字段,以及原始UDP头部字段***在第一报文的原始IP头部字段之前的情况下,根据第四封装格式,在第一报文的新建IP头部字段与原始UDP头部字段之间***新建UDP头部字段与Tspec字段,以获取第二报文。
在一可选实施例中,根据预设的封装格式对第一报文进行封装以获取 第二报文之前,还包括:
检测发送侧与接收侧之间是否配置有网络地址转换NAT功能。
本实施例中报文封装装置的其余特征与优点均与实施例1中的报文封装方法相对应,故本实施例在此不再赘述。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
实施例7
在本实施例中还提供了一种报文发送装置,应用于发送侧,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图14是根据本公开实施例提供的报文发送装置的结构框图,如图14所示,本实施例中的装置包括:
发送模块702,设置为将第二报文发送至接收侧。
本实施例中报文发送装置的其余特征与优点均与实施例2中的报文发送方法相对应,故本实施例在此不再赘述。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
实施例8
在本实施例中还提供了一种报文处理装置,应用于中间节点,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和 硬件的组合的实现也是可能并被构想的。
图15是根据本公开实施例提供的报文处理装置的结构框图,如图15所示,本实施例中的装置包括:
处理模块802,设置为根据流属性信息对第二报文进行确定与处理。
本实施例中报文处理装置的其余特征与优点均与实施例3中的报文处理方法相对应,故本实施例在此不再赘述。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
实施例9
在本实施例中还提供了一种报文解封装装置,应用于接收侧,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图16是根据本公开实施例提供的报文解封装装置的结构框图,如图16所示,本实施例中的装置包括:
解封装模块902,设置为对第二报文进行解封装处理,其中,第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,第一报文由发送侧对业务流进行封装获得,第二报文中携带有流属性信息,流属性信息用于指示业务流的特征属性。
在一可选实施例中,第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,包括:
第二报文由发送侧根据预设的封装格式在第一报文的预设位置至少***传送特性Tspec字段以获取,其中,Tspec字段包括流属性信息。
在一可选实施例中,流属性信息包括以下至少之一:
最大帧长度、循环间隔、每循环最大报文数、最大可容忍累计时延、每节点调度时延、最大可容忍累计抖动。
在一可选实施例中,Tspec字段包括后续协议字段N-P字段、长度Length字段、内容指示字段以及信息字段;
其中,内容指示字段用于根据预设的比特位定义指示流属性信息的类型以及对应类型的流属性信息是否在信息字段中出现,信息字段用于指示流属性信息的内容。
在一可选实施例中,第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,还包括:
第二报文由发送侧根据预设的封装格式,在第一报文的预设位置***Tspec字段以及用户数据报协议UDP头部字段以获取;其中,UDP头部字段***至Tspec字段之前。
在一可选实施例中,第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,还包括:
第二报文由发送侧根据配置的封装规则对第一报文进行封装以获取;其中,配置的封装规则包括:配置封装格式以及配置确定性业务流匹配规则;
确定性业务流匹配规则用于对业务流与确定性业务流进行匹配。
在一可选实施例中,封装格式包括以下之一:第一封装格式、第二封装格式、第三封装格式以及第四封装格式;其中,
第一封装格式包括原始网络协议IP头部字段、UDP头部字段、Tspec字段、原始IP内容字段;
第二封装格式包括新建IP头部字段、UDP头部字段、Tspec字段、原始IP头部字段、原始IP内容字段;
第三封装格式包括原始IP头部字段,新建UDP头部字段、Tspec字段、原始UDP头部字段、ESI头部字段,原始IP报文内容字段;
第四封装格式包括新建IP头部字段、新建UDP头部字段、Tspec字段、原始UDP头部字段、ESP头部字段、原始IP头部字段、原始IP内容字段。
在一可选实施例中,第二报文由发送侧根据配置的封装规则对第一报文进行封装以获取,还包括:
第二报文由发送侧在封装格式配置为第一封装格式,以及第一报文中未包括原始UDP头部字段的情况下,根据第一封装格式,在第一报文的原始IP头部字段以及原始IP内容字段之间***UDP头部字段与Tspec字段,并调整原始IP头部字段中的协议字段以获取;或者,
第二报文由发送侧在封装格式配置为第二封装格式,以及第一报文中未包括原始UDP头部字段的情况下,根据第二封装格式,在第一报文的原始IP头部字段之前***新建IP头部字段、UDP头部字段与Tspec字段以获取;或者,
第二报文由发送侧在第一报文中包括原始UDP头部字段,以及原始UDP头部字段***在第一报文的原始IP头部字段以及原始IP内容字段之间的情况下,根据第三封装格式,在第一报文的原始IP头部字段与原始UDP头部字段之间***新建UDP头部字段与Tspec字段以获取;或者,
第二报文由发送侧在第一报文中包括原始UDP头部字段,以及原始UDP头部字段***在第一报文的原始IP头部字段之前的情况下,根据第四封装格式,在第一报文的新建IP头部字段与原始UDP头部字段之间***新建UDP头部字段与Tspec字段以获取。
在一可选实施例中,对第二报文进行解封装处理,包括:
在第二报文的封装格式为第一封装格式的情况下,去除第二报文中的UDP头部字段以及Tspec字段,并调整原始IP头部字段中的协议字段;或者,
在第二报文的封装格式为第二封装格式的情况下,去除第二报文中的新建IP头部字段、UDP头部字段以及Tspec字段;或者,
在第二报文的封装格式为第三封装格式的情况下,去除第二报文中的新建UDP头部字段以及Tspec字段,并调整原始IP头部字段中的协议字段;或者,
在第二报文的封装格式为第四封装格式的情况下,去除第二报文中的新建IP头部字段、新建UDP头部字段以及Tspec字段,并调整原始IP头部字段中的协议字段。
本实施例中报文解封装装置的其余特征与优点均与实施例4中的报文解封装方法相对应,故本实施例在此不再赘述。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
实施例10
在本实施例中还提供了一种报文接收装置,应用于接收侧,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图17是根据本公开实施例提供的报文接收装置的结构框图,如图17所示,本实施例中的装置包括:
接收模块1002,设置为接收发送侧发送的第二报文。
本实施例中报文接收装置的其余特征与优点均与实施例5中的报文接收方法相对应,故本实施例在此不再赘述。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
实施例11
本公开的实施例还提供了一种计算机可读的存储介质,该计算机可读的存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述计算机可读的存储介质可以被设置为存储用于执行上述实施例1至5中所述的方法步骤的计算机程序。
可选地,在本实施例中,上述计算机可读的存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
实施例12
本公开的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
可选地,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行上述实施例1至5中所述的方法步骤。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特 定的硬件和软件结合。
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (28)

  1. 一种报文封装方法,应用于发送侧,所述方法包括:
    根据预设的封装格式对第一报文进行封装以获取第二报文,其中,所述第一报文由业务流封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。
  2. 根据权利要求1所述的方法,其中,所述根据预设的封装格式对第一报文进行封装以获取第二报文,包括:
    根据预设的所述封装格式在所述第一报文的预设位置至少***传送特性Tspec字段以获取所述第二报文,其中,所述Tspec字段包括所述流属性信息。
  3. 根据权利要求2所述的方法,其中,所述流属性信息包括以下至少之一:
    最大帧长度、循环间隔、每循环最大报文数、最大可容忍累计时延、每节点调度时延、最大可容忍累计抖动。
  4. 根据权利要求3所述的方法,其中,所述Tspec字段包括后续协议字段N-P字段、长度Length字段、内容指示字段以及信息字段;
    其中,所述内容指示字段用于根据预设的比特位定义指示所述流属性信息的类型以及对应类型的所述流属性信息是否在所述信息字段中出现,所述信息字段用于指示所述流属性信息的内容。
  5. 根据权利要求2所述的方法,其中,所述根据预设的封装格式对第一报文进行封装以获取第二报文,还包括:
    根据预设的所述封装格式,在所述第一报文的预设位置***所述Tspec字段以及用户数据报协议UDP头部字段,以获取所述第二报文, 其中,所述UDP头部字段***至所述Tspec字段之前。
  6. 根据权利要求2至5任一项中所述的方法,其中,所述根据预设的封装格式对第一报文进行封装以获取第二报文,包括:
    配置封装规则,并根据所述封装规则对所述第一报文进行封装以获取所述第二报文;其中,所述配置封装规则包括:配置所述封装格式以及配置确定性业务流匹配规则;
    所述确定性业务流匹配规则用于对所述业务流与确定性业务流进行匹配。
  7. 根据权利要求6所述的方法,其中,所述封装格式包括以下之一:第一封装格式、第二封装格式、第三封装格式以及第四封装格式;其中,
    所述第一封装格式包括原始网络协议IP头部字段、UDP头部字段、所述Tspec字段、原始IP内容字段;
    所述第二封装格式包括新建IP头部字段、UDP头部字段、所述Tspec字段、原始IP头部字段、原始IP内容字段;
    所述第三封装格式包括原始IP头部字段,新建UDP头部字段、所述Tspec字段、原始UDP头部字段、ESI头部字段,原始IP报文内容字段;
    所述第四封装格式包括新建IP头部字段、新建UDP头部字段、所述Tspec字段、原始UDP头部字段、ESP头部字段、原始IP头部字段、原始IP内容字段。
  8. 根据权利要求7所述的方法,其中,所述根据所述封装规则对所述第一报文进行封装以获取所述第二报文,包括:
    在所述封装格式配置为所述第一封装格式,以及所述第一报文中未包括所述原始UDP头部字段的情况下,根据所述第一封装格式,在所述第一报文的所述原始IP头部字段以及所述原始IP内容字段之间***所述UDP头部字段与所述Tspec字段,并调整所述原始IP头部字段中的协议字段,以获取所述第二报文;或者,
    在所述封装格式配置为所述第二封装格式,以及所述第一报文中未包括所述原始UDP头部字段的情况下,根据所述第二封装格式,在所述第一报文的所述原始IP头部字段之前***所述新建IP头部字段、所述UDP头部字段与所述Tspec字段,以获取所述第二报文;或者,
    在所述第一报文中包括所述原始UDP头部字段,以及所述原始UDP头部字段***在所述第一报文的所述原始IP头部字段以及所述原始IP内容字段之间的情况下,根据所述第三封装格式,在所述第一报文的所述原始IP头部字段与所述原始UDP头部字段之间***所述新建UDP头部字段与所述Tspec字段,以获取所述第二报文;或者,
    在所述第一报文中包括所述原始UDP头部字段,以及所述原始UDP头部字段***在所述第一报文的所述原始IP头部字段之前的情况下,根据所述第四封装格式,在所述第一报文的所述新建IP头部字段与所述原始UDP头部字段之间***所述新建UDP头部字段与所述Tspec字段,以获取所述第二报文。
  9. 根据权利要求1所述的方法,其中,所述根据预设的封装格式对第一报文进行封装以获取第二报文之前,还包括:
    检测所述发送侧与所述接收侧之间是否配置有网络地址转换NAT功能。
  10. 一种报文发送方法,应用于发送侧,所述方法包括:将第二报文发送至接收侧;其中,所述第二报文根据权利要求1至9任一项中所述的报文封装方法得到。
  11. 一种报文处理方法,应用于中间节点,所述方法包括:根据流属性信息对第二报文进行确定与处理;其中,所述第二报文根据权利要求1至9任一项中所述的报文封装方法得到。
  12. 一种报文解封装方法,应用于接收侧,所述方法包括:
    对第二报文进行解封装处理,其中,所述第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,所述第一报文由所述发送侧对业务流进行封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。
  13. 根据权利要求12所述的方法,其中,所述第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,包括:
    所述第二报文由所述发送侧根据预设的所述封装格式在所述第一报文的预设位置至少***传送特性Tspec字段以获取,其中,所述Tspec字段包括所述流属性信息。
  14. 根据权利要求13所述的方法,其中,所述流属性信息包括以下至少之一:
    最大帧长度、循环间隔、每循环最大报文数、最大可容忍累计时延、每节点调度时延、最大可容忍累计抖动。
  15. 根据权利要求14所述的方法,其中,所述Tspec字段包括后续协议字段N-P字段、长度Length字段、内容指示字段以及信息字段;
    其中,所述内容指示字段用于根据预设的比特位定义指示所述流属性信息的类型以及对应类型的所述流属性信息是否在所述信息字段中出现,所述信息字段用于指示所述流属性信息的内容。
  16. 根据权利要求13所述的方法,其中,所述第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,还包括:
    所述第二报文由所述发送侧根据预设的所述封装格式,在所述第一报文的预设位置***所述Tspec字段以及用户数据报协议UDP头部字段以获取;其中,所述UDP头部字段***至所述Tspec字段之前。
  17. 根据权利要求13至16任一项中所述的方法,其中,所述第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,还包括:
    所述第二报文由所述发送侧根据配置的封装规则对所述第一报文进行封装以获取;其中,所述配置的封装规则包括:配置所述封装格式以及配置确定性业务流匹配规则;
    所述确定性业务流匹配规则用于对所述业务流与确定性业务流进行匹配。
  18. 根据权利要求17所述的方法,其中,所述封装格式包括以下之一:第一封装格式、第二封装格式、第三封装格式以及第四封装格式;其中,
    所述第一封装格式包括原始网络协议IP头部字段、UDP头部字段、所述Tspec字段、原始IP内容字段;
    所述第二封装格式包括新建IP头部字段、UDP头部字段、所述Tspec字段、原始IP头部字段、原始IP内容字段;
    所述第三封装格式包括原始IP头部字段,新建UDP头部字段、所述Tspec字段、原始UDP头部字段、ESI头部字段,原始IP报文内容字段;
    所述第四封装格式包括新建IP头部字段、新建UDP头部字段、所述Tspec字段、原始UDP头部字段、ESP头部字段、原始IP头部字段、原始IP内容字段。
  19. 根据权利要求18所述的方法,其中,所述第二报文由所述发送侧根据配置的封装规则对所述第一报文进行封装以获取,还包括:
    所述第二报文由所述发送侧在所述封装格式配置为所述第一封装格式,以及所述第一报文中未包括所述原始UDP头部字段的情况下,根据所述第一封装格式,在所述第一报文的所述原始IP头部字段以及所述原始IP内容字段之间***所述UDP头部字段与所述Tspec字段,并调整所述原始IP头部字段中的协议字段以获取;或者,
    所述第二报文由所述发送侧在所述封装格式配置为所述第二封装格式,以及所述第一报文中未包括所述原始UDP头部字段的情况下,根据所述第二封装格式,在所述第一报文的所述原始IP头部字段之前***所述新建IP头部字段、所述UDP头部字段与所述Tspec字段以获取;或者,
    所述第二报文由所述发送侧在所述第一报文中包括所述原始UDP头部字段,以及所述原始UDP头部字段***在所述第一报文的所述原始IP头部字段以及所述原始IP内容字段之间的情况下,根据所述第三封装格式,在所述第一报文的所述原始IP头部字段与所述原始UDP头部字段之间***所述新建UDP头部字段与所述Tspec字段以获取;或者,
    所述第二报文由所述发送侧在所述第一报文中包括所述原始 UDP头部字段,以及所述原始UDP头部字段***在所述第一报文的所述原始IP头部字段之前的情况下,根据所述第四封装格式,在所述第一报文的所述新建IP头部字段与所述原始UDP头部字段之间***所述新建UDP头部字段与所述Tspec字段以获取。
  20. 根据权利要求18所述的方法,其中,所述对第二报文进行解封装处理,包括:
    在所述第二报文的所述封装格式为所述第一封装格式的情况下,去除所述第二报文中的所述UDP头部字段以及所述Tspec字段,并调整所述原始IP头部字段中的协议字段;或者,
    在所述第二报文的所述封装格式为所述第二封装格式的情况下,去除所述第二报文中的所述新建IP头部字段、所述UDP头部字段以及所述Tspec字段;或者,
    在所述第二报文的所述封装格式为所述第三封装格式的情况下,去除所述第二报文中的所述新建UDP头部字段以及所述Tspec字段,并调整所述原始IP头部字段中的协议字段;或者,
    在所述第二报文的所述封装格式为所述第四封装格式的情况下,去除所述第二报文中的所述新建IP头部字段、所述新建UDP头部字段以及所述Tspec字段,并调整所述原始IP头部字段中的协议字段。
  21. 一种报文接收方法,应用于接收侧,所述方法包括:
    接收发送侧发送的第二报文,并根据权利要求12至20任一项中所述的报文解封装方法对所述第二报文进行解封装处理。
  22. 一种报文封装装置,应用于发送侧,所述装置包括:
    封装模块,设置为根据预设的封装格式对第一报文进行封装以获 取第二报文,其中,所述第一报文由业务流封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。
  23. 一种报文发送装置,应用于发送侧,所述装置包括:
    发送模块,设置为将第二报文发送至接收侧;其中,所述第二报文根据权利要求22所述的报文封装装置得到。
  24. 一种报文处理装置,应用于中间节点,所述装置包括:
    处理模块,设置为根据流属性信息对第二报文进行确定与处理;其中,所述第二报文根据权利要求22所述的报文封装装置得到。
  25. 一种报文解封装装置,应用于接收侧,其中,所述装置包括:
    解封装模块,设置为对第二报文进行解封装处理,其中,所述第二报文由发送侧根据预设的封装格式对第一报文进行封装以获取,所述第一报文由所述发送侧对业务流进行封装获得,所述第二报文中携带有流属性信息,所述流属性信息用于指示所述业务流的特征属性。
  26. 一种报文接收装置,应用于接收侧,所述装置包括:
    接收模块,设置为接收发送侧发送的第二报文,并根据权利要求25所述的报文解封装装置对所述第二报文进行解封装处理。
  27. 一种计算机可读的存储介质,所述计算机可读的存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至9、权利要求10、权利要求11、权利要求12至20、权利要求21任一项中所述的方法。
  28. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权 利要求1至9、权利要求10、权利要求11、权利要求12至20、权利要求21任一项中所述的方法。
PCT/CN2020/126209 2019-11-08 2020-11-03 报文封装方法及装置、报文解封装方法及装置 WO2021088813A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20884959.6A EP4057576A4 (en) 2019-11-08 2020-11-03 METHOD AND APPARATUS FOR ENCAPSULATING PACKAGES, AND METHOD AND APPARATUS FOR DECAPSULATING PACKAGES
US17/773,860 US20220393908A1 (en) 2019-11-08 2020-11-03 Message Encapsulation Method and Apparatus, and Message Decapsulation Method and Apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911089691.6A CN112787902B (zh) 2019-11-08 2019-11-08 报文封装方法及装置、报文解封装方法及装置
CN201911089691.6 2019-11-08

Publications (1)

Publication Number Publication Date
WO2021088813A1 true WO2021088813A1 (zh) 2021-05-14

Family

ID=75748514

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/126209 WO2021088813A1 (zh) 2019-11-08 2020-11-03 报文封装方法及装置、报文解封装方法及装置

Country Status (4)

Country Link
US (1) US20220393908A1 (zh)
EP (1) EP4057576A4 (zh)
CN (1) CN112787902B (zh)
WO (1) WO2021088813A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114386368A (zh) * 2022-03-23 2022-04-22 百芯智能制造科技(深圳)有限公司 一种封装规格项数据的处理方法以及处理装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117278645A (zh) * 2022-06-13 2023-12-22 中兴通讯股份有限公司 报文封装方法及装置、存储介质及电子装置
CN114925386B (zh) * 2022-07-15 2022-10-25 飞腾信息技术有限公司 数据处理方法、计算机设备、数据处理***及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6519254B1 (en) * 1999-02-26 2003-02-11 Lucent Technologies Inc. RSVP-based tunnel protocol providing integrated services
US20190116485A1 (en) * 2017-10-13 2019-04-18 Cisco Technology, Inc. Dynamic rerouting of wireless traffic based on input from machine learning-based mobility path analysis
CN110167068A (zh) * 2018-02-14 2019-08-23 华为技术有限公司 一种处理服务质量QoS参数的方法、网元、***及存储介质
CN110417707A (zh) * 2018-04-27 2019-11-05 中兴通讯股份有限公司 数据发送保护方法、装置、***及计算机可读存储介质

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100387023C (zh) * 2004-04-26 2008-05-07 华为技术有限公司 流状态建立的方法
US8274894B2 (en) * 2008-05-07 2012-09-25 Nokia Corporation Quality of service and power aware forwarding rules for mesh points in wireless mesh networks
US8295287B2 (en) * 2010-01-27 2012-10-23 National Instruments Corporation Network traffic shaping for reducing bus jitter on a real time controller
US8374183B2 (en) * 2010-06-22 2013-02-12 Microsoft Corporation Distributed virtual network gateways
WO2011157108A2 (zh) * 2011-05-30 2011-12-22 华为技术有限公司 一种网络传输特性分析方法、装置及***
CN104753823B (zh) * 2013-12-31 2018-04-10 华为技术有限公司 建立服务质量预留的方法及节点
JP6492112B2 (ja) * 2014-06-26 2019-03-27 華為技術有限公司Huawei Technologies Co.,Ltd. ソフトウェア定義ネットワーク化のためのサービス品質制御方法及びデバイス
US10530736B2 (en) * 2016-01-19 2020-01-07 Cisco Technology, Inc. Method and apparatus for forwarding generic routing encapsulation packets at a network address translation gateway
US10686568B2 (en) * 2016-12-29 2020-06-16 Microsoft Technology Licensing, Llc Active flow diagnostics for cloud-hosted networks
US10911262B2 (en) * 2017-10-31 2021-02-02 Cisco Technology, Inc. Deterministic forwarding across L2 and L3 networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6519254B1 (en) * 1999-02-26 2003-02-11 Lucent Technologies Inc. RSVP-based tunnel protocol providing integrated services
US20190116485A1 (en) * 2017-10-13 2019-04-18 Cisco Technology, Inc. Dynamic rerouting of wireless traffic based on input from machine learning-based mobility path analysis
CN110167068A (zh) * 2018-02-14 2019-08-23 华为技术有限公司 一种处理服务质量QoS参数的方法、网元、***及存储介质
CN110417707A (zh) * 2018-04-27 2019-11-05 中兴通讯股份有限公司 数据发送保护方法、装置、***及计算机可读存储介质

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
See also references of EP4057576A4 *
ZHANG YAO XUE, WANG XIAO CHUN, CHEN HUA: "Design and Implementation of QoS Control Frames Based on RSVP for Internet", ACTA ELECTRONICA SINICA, vol. 28, no. 2, 25 February 2000 (2000-02-25), pages 39 - 42, XP009527877, ISSN: 0372-2112 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114386368A (zh) * 2022-03-23 2022-04-22 百芯智能制造科技(深圳)有限公司 一种封装规格项数据的处理方法以及处理装置
CN114386368B (zh) * 2022-03-23 2022-07-19 百芯智能制造科技(深圳)有限公司 一种封装规格项数据的处理方法以及处理装置

Also Published As

Publication number Publication date
EP4057576A1 (en) 2022-09-14
CN112787902B (zh) 2023-11-21
CN112787902A (zh) 2021-05-11
US20220393908A1 (en) 2022-12-08
EP4057576A4 (en) 2022-12-28

Similar Documents

Publication Publication Date Title
US20220078114A1 (en) Method and Apparatus for Providing Service for Traffic Flow
US11115339B2 (en) Network congestion control method, device, and system
WO2021088813A1 (zh) 报文封装方法及装置、报文解封装方法及装置
CN110086578B (zh) 数据传输方法、装置和***
US9894003B2 (en) Method, apparatus and system for processing data packet
US8320374B2 (en) Method and apparatus for improved multicast routing
WO2018210213A1 (zh) 一种实现ioam封装的方法及装置、存储介质
US20070147363A1 (en) Network edge device configured for adding protocol service header identifying service encoding of IP packet payload
CN108111523A (zh) 数据传输方法和装置
US20090207860A1 (en) Method, apparatus and system for transferring data
US9445384B2 (en) Mobile device to generate multiple maximum transfer units and data transfer method
CN101360046B (zh) 一种带宽资源的节约方法
CN107370654B (zh) 一种伪线数据报文的封装、解封装方法和相关装置
CN108282391B (zh) 一种vxlan报文分片方法和装置
CN108075991B (zh) 报文转发方法及装置
CN112769738A (zh) DetNet数据包处理方法及装置
CN105763659A (zh) 一种IPv6隧道报文封装方法及***
CN102907046B (zh) 用于处理消息的方法
WO2021031092A1 (zh) 报文处理方法及网络设备
WO2015096734A1 (zh) 一种业务数据的下行传输方法及分组数据网关
US8583822B2 (en) Method and system for minimum frame size support for a communication protocol encapsulated over Ethernet
EP3913865B1 (en) Message decapsulation method and device, message encapsulation method and device, electronic device, and storage medium
US10256992B2 (en) Tunnel encapsulation
CN113055268A (zh) 隧道流量负载均衡的方法、装置、设备及介质
WO2023231428A1 (zh) IPv4报文的封装方法、电子设备和计算机存储介质

Legal Events

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

Ref document number: 20884959

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020884959

Country of ref document: EP

Effective date: 20220608