CN113872926A - Data transmission method and equipment - Google Patents

Data transmission method and equipment Download PDF

Info

Publication number
CN113872926A
CN113872926A CN202010625751.8A CN202010625751A CN113872926A CN 113872926 A CN113872926 A CN 113872926A CN 202010625751 A CN202010625751 A CN 202010625751A CN 113872926 A CN113872926 A CN 113872926A
Authority
CN
China
Prior art keywords
field
type
value
bits
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010625751.8A
Other languages
Chinese (zh)
Inventor
王闯
于德雷
陈哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010625751.8A priority Critical patent/CN113872926A/en
Publication of CN113872926A publication Critical patent/CN113872926A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • 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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/167Adaptation for transition between two IP versions, e.g. between IPv4 and IPv6

Landscapes

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

Abstract

The application discloses a data transmission method and equipment, wherein the method comprises the following steps: the sending end equipment sends a first message to the receiving end equipment, wherein the first message is a message coded according to a coding and decoding rule of a first protocol, and the coding and decoding rule of the first protocol specifies that the length of each field in the message is variable. The scheme is beneficial to realizing the adjustability of the length of the field and improving the convenience and the flexibility of message encoding and decoding.

Description

Data transmission method and equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method and device.
Background
The existing Internet Protocol (IP) protocols mainly include two types, namely, internet protocol version 4(internet protocol version 4, IPv4) and internet protocol version 6(internet protocol version 6, IPv6), each field in the design of the two protocols adopts a fixed length, and the sequence between the fields is also fixed, so that when an old version of a protocol (for example, IPv4) cannot meet the requirement, if the position and length of a field of a new version of the protocol (for example, IPv6) are changed, a new protocol cannot be compatible with a previous generation of the protocol, and the deployment of the interworking between the new and old versions of the protocol is very difficult.
Disclosure of Invention
The application provides a data transmission method and equipment, which can realize adjustability of field length and improve convenience and flexibility of message encoding and decoding.
In a first aspect, the present application provides a data transmission method, where the method includes:
the sending end equipment sends a first message to the receiving end equipment, wherein the first message is a message coded according to a coding and decoding rule of a first protocol, and the coding and decoding rule of the first protocol specifies that the length of each field in the message is variable.
In the method, a sending end device sends a first message to a receiving end device, where the first message is a message encoded according to an encoding and decoding rule of a first protocol, and the encoding and decoding rule of the first protocol specifies that the length of each field in the message is variable. Therefore, the first message coded by the variable length coding design through the first protocol is not limited in the width and the position of each field, and can be compatible and adaptive no matter whether protocol versions supported by the sending end equipment and the receiving end equipment are the same or not, so that the adjustability of the length of the field is realized, and the convenience and the flexibility of message coding and decoding are improved.
With reference to the first aspect, in a possible implementation manner of the first aspect, each field of the first packet includes N bits for indicating the first type, where N is a positive integer greater than 0 and less than or equal to 7 and is a fixed value.
With reference to the first aspect, in a possible implementation manner of the first aspect, each field of the first packet further includes V bits for indicating a field value, V is a positive integer greater than 0, and a value of V is associated with the field value.
With reference to the first aspect, in a possible implementation manner of the first aspect, each field of the first packet further includes L bits for indicating a field value length, where L is a positive integer greater than 0 and is a fixed value.
With reference to the first aspect, in a possible implementation manner of the first aspect, each field of the first packet includes at least one indication field, and a most significant bit MSB of each byte in the indication field is used to indicate whether a corresponding indication field ends.
With reference to the first aspect, in a possible implementation manner of the first aspect, the MSB is a first value indicating that the current byte is the last byte of the corresponding indication field.
With reference to the first aspect, in a possible implementation manner of the first aspect, the first packet includes a first field, the first type corresponding to the first field is a first preset type, the first field includes a first indication field and a second indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, M is a positive integer greater than 0, a value of M is associated with the second type, and the second indication field includes V bits for indicating a field value.
With reference to the first aspect, in a possible implementation manner of the first aspect, the first packet includes a second field, the first type corresponding to the second field is a second preset type, the second field includes a first indication field, a second indication field, and a third indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, the second indication field includes P bits for indicating a field value length, the third indication field includes V bits for indicating a field value, M is a positive integer greater than 0, a value of M is associated with the second type, P is a positive integer greater than 0, and a value of P is associated with the field value length.
With reference to the first aspect, in a possible implementation manner of the first aspect, the first packet includes at least one third field, where the at least one third field is used to indicate an identifier of at least one node, and if the node is a terminal node, the identifier is an IP address of the terminal node; and if the node is a transit node, the identification is the identification of the transit node.
With reference to the first aspect, in a possible implementation manner of the first aspect, a configuration file corresponds to the sending end device and the receiving end device, a plurality of keywords corresponding to the first type and/or a plurality of keywords corresponding to the second type are defined in the configuration file, and the first packet is a packet encoded according to the configuration file.
With reference to the first aspect, in a possible implementation manner of the first aspect, each defined arrangement order in the configuration file is associated with a forwarding field of the receiving end device, and the forwarding field is used for the receiving end device to forward the first packet.
With reference to the first aspect, in a possible implementation manner of the first aspect, a numerical length of the keyword corresponding to the second type in the configuration file is a variable length.
With reference to the first aspect, in a possible implementation manner of the first aspect, when the first packet passes through a domain network gateway, a source address and a destination address in the first packet are updated, the updated source address is added with a domain prefix corresponding to the domain network, and the updated destination address is reduced with the domain prefix corresponding to the domain network.
With reference to the first aspect, in a possible implementation manner of the first aspect, the first packet includes a fourth field, an MSB of each byte in the fourth field is used to indicate whether the fourth field is ended, and each bit except the MSB is used to indicate whether a field corresponding to the bit exists in the first packet.
In a second aspect, the present application provides a data transmission method, including:
receiving end equipment receives a first message sent by sending end equipment;
and the receiving end equipment analyzes the first message according to the coding and decoding rules of the first protocol, wherein the coding rules of the first protocol stipulate that the length of each field in the message is variable.
In the method, the receiving end equipment receives the first message sent by the sending end equipment and analyzes the first message according to the coding and decoding rules of the first protocol, the coding rules of the first protocol stipulate that the length of each field in the message is variable, and therefore, the first message is decoded by adopting a variable length coding and decoding design through the first protocol.
With reference to the second aspect, in a possible implementation manner of the second aspect, each field of the first packet includes N bit bits for indicating the first type, where N is a positive integer greater than 0 and less than or equal to 7 and is a fixed value.
With reference to the second aspect, in a possible implementation manner of the second aspect, each field of the first packet further includes V bits for indicating a field value, V is a positive integer greater than 0, and a value of V is associated with the field value.
With reference to the second aspect, in a possible implementation manner of the second aspect, each field of the first packet further includes L bits for indicating a field value length, where L is a positive integer greater than 0 and is a fixed value.
With reference to the second aspect, in a possible implementation manner of the second aspect, each field of the first packet includes at least one indication field, and a most significant bit MSB of each byte in the indication field is used to indicate whether a corresponding indication field ends.
With reference to the second aspect, in a possible implementation manner of the second aspect, the MSB is a first value indicating that the current byte is the last byte of the corresponding indication field.
With reference to the second aspect, in a possible implementation manner of the second aspect, the first packet includes a first field, the first type corresponding to the first field is a first preset type, the first field includes a first indication field and a second indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, M is a positive integer greater than 0, and a value of M is associated with the second type, and the second indication field includes V bits for indicating a field value.
With reference to the second aspect, in a possible implementation manner of the second aspect, the first packet includes a second field, the first type corresponding to the second field is a second preset type, the second field includes a first indication field, a second indication field, and a third indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, the second indication field includes P bits for indicating a field value length, the third indication field includes V bits for indicating a field value, M is a positive integer greater than 0, and a value of M is associated with the second type, P is a positive integer greater than 0, and a value of P is associated with the field value length.
With reference to the second aspect, in a possible implementation manner of the second aspect, the first packet includes at least one third field, where the at least one third field is used to indicate an identifier of at least one node, and if the node is a terminal node, the identifier is an IP address of the terminal node; and if the node is a transit node, the identification is the identification of the transit node.
With reference to the second aspect, in a possible implementation manner of the second aspect, a configuration file corresponds to the sending end device and the receiving end device, a plurality of the first types and/or a plurality of keywords corresponding to the second types are defined in the configuration file, and the first packet is a packet encoded according to the configuration file.
With reference to the second aspect, in a possible implementation manner of the second aspect, each defined arrangement order in the configuration file is associated with a forwarding field of the receiving end device, and the forwarding field is used for the receiving end device to forward the first packet.
With reference to the second aspect, in a possible implementation manner of the second aspect, a numerical length of the keyword corresponding to the second type in the configuration file is a variable length.
With reference to the second aspect, in a possible implementation manner of the second aspect, when the first packet passes through a domain network gateway, a source address and a destination address in the first packet are updated, the updated source address is added with a domain prefix corresponding to the domain network, and the updated destination address is reduced with the domain prefix corresponding to the domain network.
With reference to the second aspect, in a possible implementation manner of the second aspect, the first packet includes a fourth field, an MSB of each byte in the fourth field is used to indicate whether the fourth field is ended, and each bit except the MSB is used to indicate whether a field corresponding to the bit exists in the first packet.
In a third aspect, the present application provides a data transmission apparatus, including: a transceiver module: the method is used for sending a first message to receiving end equipment, wherein the first message is a message coded according to a coding and decoding rule of a first protocol, and the coding and decoding rule of the first protocol specifies that the length of each field in the message is variable.
In the above device, a sending end device sends a first message to a receiving end device, where the first message is a message encoded according to an encoding and decoding rule of a first protocol, and the encoding and decoding rule of the first protocol specifies that the length of each field in the message is variable. Therefore, the first message coded by the variable length coding design through the first protocol is not limited in the width and the position of each field, and can be compatible and adaptive no matter whether protocol versions supported by the sending end equipment and the receiving end equipment are the same or not, so that the adjustability of the length of the field is realized, and the convenience and the flexibility of message coding and decoding are improved.
With reference to the third aspect, in a possible implementation manner of the third aspect, each field of the first packet includes N bits for indicating the first type, where N is a positive integer greater than 0 and less than or equal to 7 and is a fixed value.
With reference to the third aspect, in a possible implementation manner of the third aspect, each field of the first packet further includes V bits for indicating a field value, V is a positive integer greater than 0, and a value of V is associated with the field value.
With reference to the third aspect, in a possible implementation manner of the third aspect, each field of the first packet further includes L bits for indicating a field value length, where L is a positive integer greater than 0 and is a fixed value.
With reference to the third aspect, in a possible implementation manner of the third aspect, each field of the first packet includes at least one indication field, and a most significant bit MSB of each byte in the indication field is used to indicate whether a corresponding indication field ends.
With reference to the third aspect, in a possible implementation manner of the third aspect, the MSB is a first value indicating that the current byte is the last byte of the corresponding indication field.
With reference to the third aspect, in a possible implementation manner of the third aspect, the first packet includes a first field, the first type corresponding to the first field is a first preset type, the first field includes a first indication field and a second indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, M is a positive integer greater than 0, a value of M is associated with the second type, and the second indication field includes V bits for indicating a field value.
With reference to the third aspect, in a possible implementation manner of the third aspect, the first packet includes a second field, the first type corresponding to the second field is a second preset type, the second field includes a first indication field, a second indication field, and a third indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, the second indication field includes P bits for indicating a field value length, the third indication field includes V bits for indicating a field value, M is a positive integer greater than 0, a value of M is associated with the second type, P is a positive integer greater than 0, and a value of P is associated with the field value length.
With reference to the third aspect, in a possible implementation manner of the third aspect, the first packet includes at least one third field, where the at least one third field is used to indicate an identifier of at least one node, and if the node is a terminal node, the identifier is an IP address of the terminal node; and if the node is a transit node, the identification is the identification of the transit node.
With reference to the third aspect, in a possible implementation manner of the third aspect, a configuration file corresponds to the sending end device and the receiving end device, a plurality of keywords corresponding to the first type and/or a plurality of keywords corresponding to the second type are defined in the configuration file, and the first packet is a packet encoded according to the configuration file.
With reference to the third aspect, in a possible implementation manner of the third aspect, each defined arrangement order in the configuration file is associated with a forwarding field of the receiving end device, and the forwarding field is used for the receiving end device to forward the first packet.
With reference to the third aspect, in a possible implementation manner of the third aspect, a numerical length of the keyword corresponding to the second type in the configuration file is a variable length.
With reference to the third aspect, in a possible implementation manner of the third aspect, when the first packet passes through a domain network gateway, a source address and a destination address in the first packet are updated, the updated source address is added with a domain prefix corresponding to the domain network, and the updated destination address is reduced with the domain prefix corresponding to the domain network.
With reference to the third aspect, in a possible implementation manner of the third aspect, the first packet includes a fourth field, an MSB of each byte in the fourth field is used to indicate whether the fourth field is ended, and each bit except the MSB is used to indicate whether a field corresponding to the bit exists in the first packet.
In a fourth aspect, the present application provides a data transmission apparatus, comprising: the receiving and sending module is used for receiving a first message sent by sending end equipment; and the processing module is used for analyzing the first message according to the coding and decoding rules of the first protocol, wherein the coding rules of the first protocol specify that the length of each field in the message is variable.
In the above device, the receiving end device receives the first message sent by the sending end device, and analyzes the first message according to the coding and decoding rules of the first protocol, the coding rules of the first protocol stipulate that the length of each field in the message is variable, and it is visible that the first message is decoded by adopting a variable length coding and decoding design through the first protocol.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, each field of the first packet includes N bits for indicating the first type, where N is a positive integer greater than 0 and less than or equal to 7 and is a fixed value.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, each field of the first packet further includes V bits for indicating a field value, V is a positive integer greater than 0, and a value of V is associated with the field value.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, each field of the first packet further includes L bits for indicating a field value length, where L is a positive integer greater than 0 and is a fixed value.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, each field of the first packet includes at least one indication field, and a most significant bit MSB of each byte in the indication field is used to indicate whether a corresponding indication field ends.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, the MSB is a first value indicating that the current byte is the last byte of the corresponding indication field.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, the first packet includes a first field, the first type corresponding to the first field is a first preset type, the first field includes a first indication field and a second indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, M is a positive integer greater than 0, and a value of M is associated with the second type, and the second indication field includes V bits for indicating a field value.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, the first packet includes a second field, the first type corresponding to the second field is a second preset type, the second field includes a first indication field, a second indication field, and a third indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, the second indication field includes P bits for indicating a field value length, the third indication field includes V bits for indicating a field value, M is a positive integer greater than 0, a value of M is associated with the second type, P is a positive integer greater than 0, and a value of P is associated with the field value length.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, the first packet includes at least one third field, where the at least one third field is used to indicate an identifier of at least one node, and if the node is a terminal node, the identifier is an IP address of the terminal node; and if the node is a transit node, the identification is the identification of the transit node.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, a configuration file corresponds to the sending end device and the receiving end device, a plurality of keywords corresponding to the first type and/or the second type are defined in the configuration file, and the first packet is a packet encoded according to the configuration file.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, each defined arrangement order in the configuration file is associated with a forwarding field of the receiving end device, and the forwarding field is used for the receiving end device to forward the first packet.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, a numerical length of the keyword corresponding to the second type in the configuration file is a variable length.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, when the first packet passes through a domain network gateway, a source address and a destination address in the first packet are updated, the updated source address is added with a domain prefix corresponding to the domain network, and the updated destination address is reduced with the domain prefix corresponding to the domain network.
With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, the first packet includes a fourth field, an MSB of each byte in the fourth field is used to indicate whether the fourth field is ended, and each bit except the MSB is used to indicate whether a field corresponding to the bit exists in the first packet.
In a fifth aspect, the present application provides a sender device, where the sender device includes a processor and a memory, where the memory is used to store program codes, and the processor is used to call the program codes in the memory to execute the method of any one of the first aspects.
In a sixth aspect, the present application provides a sink device, where the sink device includes a processor and a memory, where the memory is used to store program codes, and the processor is used to call the program codes in the memory to execute the method according to any one of the second aspects.
In a seventh aspect, the present application provides a sending end device, where the sending end device includes a processor; the processor is coupled to a memory, and the processor is configured to invoke program code in the memory to perform the method of any of the first aspects.
In an eighth aspect, the present application provides a receiving end device, including a processor; the processor is coupled to the memory, and the processor is configured to invoke the program code in the memory to perform the method of any of the second aspects.
In a ninth aspect, the present application provides a readable storage medium having stored therein instructions that, when executed on a transmitting end device, cause the transmitting end device to perform the method of any of the first aspects.
In a tenth aspect, the present application provides a readable storage medium having stored therein instructions that, when executed on a sink device, cause the sink device to perform the method of any one of the second aspects.
In an eleventh aspect, the present application provides a computer program product which, when run on a sender device, causes the sender device to perform the method of any one of the first aspects.
In a twelfth aspect, the present application provides a computer program product, which when run on a sink device, causes the sink device to perform the method of any one of the second aspects.
Drawings
Fig. 1 is a schematic diagram of a header format of an IPv4 protocol according to an embodiment of the present application;
fig. 2 is a schematic diagram of a header format of an IPv6 protocol according to an embodiment of the present application;
fig. 3 is a network architecture diagram of a communication system according to an embodiment of the present application;
fig. 4 is a schematic diagram of a data transmission method according to an embodiment of the present application;
fig. 5 is a schematic diagram of a message format of a first message according to an embodiment of the present application;
fig. 6 is a schematic diagram of an inter-router configuration file according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an inter-device domain network according to an embodiment of the present application;
fig. 8 is a schematic diagram of another packet format of a first packet according to an embodiment of the present application;
fig. 9 is a schematic diagram of a data transmission apparatus according to an embodiment of the present application;
fig. 10 is a schematic diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
To facilitate understanding of the present application, the concepts related to the present application are first explained:
the Internet Protocol (IP) internet protocol version 4 (IPv 4) protocol family is the most central protocol family in the transmission control protocol/internet protocol (TCP/IP) protocol family. This protocol network layer provides connectionless data transmission service, which is the most basic communication protocol of the internet, and the format of the header of the protocol is shown in fig. 1.
Since the IPv4 has only 32bits, at most 2^32 addresses can be used globally, i.e. about 40 hundred million addresses, the global population is 70 hundred million, and a large number of computers, mobile phone terminals and internet of things terminals are far from 40 hundred million addresses, so that an internet protocol version 6 (IPv 6) protocol appears, and the format of the message header is shown in fig. 2.
The IPv6 address is 4 times that of IPv4, and can have 2^128 addresses, which is a large space and calls that each sand in the universe can be allocated an IP address.
However, the challenge of upgrading the address of 32bits to 128bits is very large, because in the age of 32bits, the device already performs message analysis and route forwarding processing around 32bits according to protocol definition, and the modification from the end host to the router to 128bits supporting IPv6 requires a great change, and more difficult, between two devices, one device is modified to IPv6, and the other device does not support IPv6, and still cannot communicate, which is essentially incompatible.
Such problems also exist for other fields, such as the "protocol number" field in the protocol, which has only 8bits, and if the protocol number exceeds 256, the protocol number field also has such problems, like the type of service, the signature fields of the flow label, etc.
Illustratively, a communication system 100 applied in the embodiment of the present application is shown in fig. 3, and the embodiment of the present application is completely the same as the scenario and system applied in the conventional IPv4 and IPv6 protocols. The communication system 100 may include a sending end device 110, a receiving end device 120, and one or more routers 130, where the sending end device 110 and the receiving end device 120 may be network devices or terminal devices (or called communication terminals, or user devices). A network device may provide communication coverage for a particular geographic area and may communicate with terminal devices located within that coverage area. Alternatively, the network device may be a Base Transceiver Station (BTS) in a GSM system or a CDMA system, a base station (nodeb) in a WCDMA system, an evolved node B (eNB or eNodeB) in an LTE system, or a wireless controller in a Cloud Radio Access Network (CRAN), or the network device may be a mobile switching center, a relay station, an access point, a vehicle-mounted device, a wearable device, a hub, a switch, a bridge, a router, a network-side device in a 5G network, or a network device in a future evolved Public Land Mobile Network (PLMN), and the like, and the terminal device may be a Personal Digital Assistant (PDA), a handheld device with wireless communication function, a computing device, or other processing device connected to a wireless modem, An in-vehicle device, a wearable device, a user terminal device in a 5G network, or a user terminal device in a PLMN evolving in the future, etc.
Optionally, terminal-to-device (D2D) communication may be performed between the sending device and the receiving device.
Alternatively, the 5G system or the 5G network may also be referred to as a New Radio (NR) system or an NR network.
Fig. 3 exemplarily shows one sending end device and one receiving end device, and optionally, the communication system 100 may include multiple sending end devices or multiple receiving end devices, which is not limited in this embodiment.
Optionally, the communication system 100 may further include other network entities such as a network controller, a mobility management entity, and the like, which is not limited in this embodiment.
It should be understood that a device having a communication function in a network/system in the embodiments of the present application may be referred to as a communication device. Taking the communication system 100 shown in fig. 3 as an example, the communication device may include a sending end device 110, a receiving end device 120, and a router 130 having a communication function, where the sending end device 110, the receiving end device 120, and the router 130 may be the above-described specific devices, and are not described again here; the communication device may also include other devices in the communication system 100, such as other network entities, for example, a network controller, a mobility management entity, and the like, which is not limited in this embodiment.
It should be understood that the terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Referring to fig. 4, fig. 4 is a schematic diagram of a data transmission method according to an embodiment of the present application. Taking the network system shown in fig. 3 as an example, the data transmission method executed on the network system includes:
s101, sending a first message to receiving end equipment by sending end equipment, wherein the first message is coded according to a coding and decoding rule of a first protocol, and the coding and decoding rule of the first protocol specifies that the length of each field in the message is variable;
the first packet includes a plurality of fields, for example, a source IP address field, a destination port field, a source port field, and the like, which is not limited herein.
The length of each field in the message is specified to be variable by the codec rule of the first protocol, that is, the length of each byte is not fixed, so that the length of each field needs to be indicated specifically, and the specific implementation manner may be various:
in a possible implementation manner, each field of the first packet includes L bits for indicating a field value length, where L is a positive integer greater than 0 and is a fixed value, and for example, L is preset to be 8bits for indicating the field value length.
In another possible implementation manner, each field of the first packet includes at least one indication field, and a Most Significant Bit (MSB) of each byte in the indication field is used to indicate whether a corresponding indication field is finished.
The MSB is a first value and indicates that the current byte is the last byte of the corresponding indication field, and the MSB is a second value and indicates that the next byte of the current byte and the current byte belong to the same indication field.
The first value may be 0 or 1, and the second value may be 1 or 0, which is not limited herein.
For example, when the first value is 0 and the second value is 1, the method for representing an indicator field including a 1-bit binary string 1 is as follows: 00000001, the most significant MSB is 0, indicating that this field is over, whose content is 0000001;
one field of indication comprises a 14-bit binary string 00000100101100, expressed by the method: 1010110000000010, where 10101100, the MSB of this byte is 1, indicating that the next byte still belongs to the same indication field as this byte; 00000010 and the MSB of this byte is 0, indicating that the indication field is over.
Specifically, the length of each variable length field can be determined by the two methods.
S102, the receiving end equipment receives a first message sent by the sending end equipment;
s103, the receiving end equipment analyzes the first message according to a coding and decoding rule of a first protocol, wherein the coding rule of the first protocol specifies that the length of each field in the message is variable;
in the method, a sending end device sends a first message to a receiving end device, where the first message is a message encoded according to an encoding and decoding rule of a first protocol, and the encoding and decoding rule of the first protocol specifies that the length of each field in the message is variable. Therefore, the first message coded by the variable length coding design through the first protocol is not limited in the width and the position of each field, and can be compatible and adaptive no matter whether protocol versions supported by the sending end equipment and the receiving end equipment are the same or not, so that the adjustability of the length of the field is realized, and the convenience and the flexibility of message coding and decoding are improved.
In a possible implementation manner, each field of the first packet includes N bits for indicating the first type, where N is a positive integer greater than 0 and less than or equal to 7 and is a fixed value.
N is a preset fixed value, for example, may be 3, 4, and the like, and is not limited herein, and the N bits may be located in any N consecutive bits in the corresponding field, for example, the N bits may be located in the last 3bits of the first byte in each field, or located in the first 4bits of the first byte in each field, and is not limited herein.
Wherein, the N bits of the first type are indicated to be fixed N bits.
The first type may include 8 types, for example, as shown in table 1 below,
TABLE 1
Figure BDA0002563565870000091
As shown in table 1, when the first type is 101, the field includes two indication fields, when the first type is 110, the field includes three indication fields, and when the first type is 000, 001, or 010, the field includes only one field.
In a possible implementation manner, each field of the first packet further includes V bits for indicating a field value, V is a positive integer greater than 0, and a value of V is associated with the field value.
Optionally, each field includes N fixed bits indicating the first type, and V bits indicating a field value, where, in different field values, V takes different values, that is, the length of the field value is variable.
For example, when the first value is 0 and the second value is 1, according to table 1, taking the destination IP address as an example, the destination IP address includes only one indication field, yvvv 000 is an 8-bit byte, and when the last 3bits is 000, it indicates that this field indicates the destination IP address, where the specific value of the IP address is determined according to the "vvv" part, if the value of the IP address is below 15, it can be directly expressed by vvv, that is, y is 0, if the value of the IP address exceeds 15, it needs to be expressed by more than 2 bytes, y is 1, it indicates that the following bytes also belong to the destination IP address field, as follows:
11010000 01010101;
this 2-byte field, the IP address represented is 10101010101;
when the field is analyzed, the first byte is read firstly, 11010000, the field is definitely read firstly until the lowest 3bits is 000, the field can be judged to be the target IP address, then the field is read, 1010, the MSB is read to be 1, which indicates that the subsequent field has valid data, so that the second byte is continuously read to be 01010101, the MSB is 0, which indicates that the field is finished, and the 1010101 and the 1010 are spliced together, so that the target IP address is obtained.
Optionally, each field of the first packet further includes L bits for indicating a field value length, where L is a positive integer greater than 0, and L is a fixed value.
Specifically, each field includes N fixed bits indicating a first type, L bits for indicating a field value length, and V bits indicating a field value, as shown in table 2 below:
TABLE 2
First type (N bits) Length (L bits) Field value (V bytes)
For example, the first type may be fixed as the first N bits of the first packet, and the first type may be as shown in table 3:
TABLE 3
Keyword KEY of a first type Means of Explanation of the invention
0 Destination IP address Indicating an arriving network IP address
1 Source IP address Indicating the network IP address of the sender
2 Hop limit Indicating maximum experienced number of hops
The length indicates a specific length of a field value, and is calculated in bytes. For example, for the first type, destination IP address, with KEY of 0, the length value is 8, indicating that the field value is an 8-byte destination IP address.
Where the length is specified, it is not necessary to specify whether the corresponding indication field is ended by the MSB.
It can be seen that, in this example, a fixed N bit is defined for each field in the first packet to indicate the first type of the corresponding field, so that each field may not be fixed at the position in the packet, and thus, when the receiving end device parses the first packet, the receiving end device accurately obtains the indication meaning of the corresponding field, which is beneficial to improving the flexibility of packet encoding and decoding.
In a possible implementation manner, the first packet includes a first field, the first type corresponding to the first field is a first preset type, the first field includes a first indication field and a second indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, M is a positive integer greater than 0, and a value of M is associated with the second type, and the second indication field includes V bits for indicating a field value.
The first preset type may be a type corresponding to 101 in table 1.
Wherein, for different second types, the value of M is different, that is, the length of the bit of the second type is indicated to be variable, M may be, for example, 4, 11, etc., and without limitation, the M bits may be located in the corresponding field except for the most significant bit of each byte, and any M consecutive bits except for N bits indicating the first type, for example, when M is 4, the first indication field includes one byte, the M bits may be located in 4bits following the most significant bit in the first byte in each field, as shown in type 101 in table 1, when M is 1, the first indication field may include two bytes, for example, the first indication field is 1001010101010101, where, the first byte MSB ═ 1 indicates that the second byte belongs to the first indication field, the second byte MSB ═ 0 indicates that the first indication field ends, 101 indicates that the first type is the first preset type, m is 11 and the value is 00101010101.
Wherein the KEY represented by the M bits indicates a different second type.
For example, a plurality of second types may be defined as shown in Table 4.
TABLE 4
KEY Means of
0 Retention
1 Configuration file type
2 Source port
3 Destination port
4 Fragmentation identification
5 Slice offset
6 Head checksum
For example, when the first value is 0 and the second value is 1, the fields of an IP destination port value 16 can be as follows: 0001110100001000.
the first byte 00011101, MSB ═ 0, indicates that the first indication field includes only the first byte, the last 3bits in the first byte is 101, indicates that the first type is a variable length binary string type, the middle 0011 part indicates the value 3, as can be seen from table 2, the indication is an IP destination port, the second byte MSB ═ 0, indicates that the first indication field also includes only the first byte, 0001000 is 8, and indicates that the port value is 8.
It can be seen that, in this example, by defining the variable length binary string in the first type and defining the KEY in the variable length binary string, the first type can represent more requirements, which is beneficial to improving the comprehensiveness of defining the field type.
In a possible implementation manner, the first packet includes a second field, the first type corresponding to the second field is a second preset type, the second field includes a first indication field, a second indication field, and a third indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, the second indication field includes P bits for indicating a field value length, the third indication field includes V bits for indicating a field value, M is a positive integer greater than 0, a value of M is associated with the second type, P is a positive integer greater than 0, and a value of P is associated with the field value length.
The second preset type may be a type corresponding to 110 described in table 1 above.
The M bits for indicating the second type are as described above, and are not described herein.
Among the second preset types, a plurality of second types as shown in table 5 may be defined.
For example, the second preset type is typically used for expressing a field with a larger data size, such as Payload, wherein the length of the field value is determined by P bits, and P is different from one field value to another, i.e., the length of the field value is variable.
TABLE 5
Key Means of
0 Retention
1 Payload
For example, a payload type field is shown in the following example:
00001110 00011000 Payload
when the first value is 0 and the second value is 1, the first byte 00001110 and MSB equal to 0 indicate that the first indication field includes only the first byte, the last 3bits is 110 indicates that the first type is the variable length description type, the middle 4bits is 0001 indicates that KEY is 1, as shown in table 5 above, that is, the field value portion is a Payload, the second byte 00011000 and MSB equal to 0 indicates that the second indication field also includes only one byte, the value 11000, that is, the length is 48, indicates the length of the Payload, and the Payload portion stores a specific 48-byte Payload content.
For example, the first value is 0, and the second value is 1, the following example of the first message can be given:
01011000 01001001 00011101 00001000 00010101 00001000 00001110 00011000 Payload
wherein, according to the first type defined in table 1, field 1 comprises a first byte 01011000, representing the destination IP address 11; field 2 includes a second byte 01001001, representing the source IP address 9; according to the definitions of table 1 and table 4, field 3 includes a third byte and a fourth byte 0001110100001000, representing destination port 8; field 4 includes a fifth byte and a sixth byte 0001010100001000, representing source port 8; according to the definitions of table 1 and table 5, field 5 includes a seventh byte, an eighth byte, and a ninth byte, indicating that a specific 48-byte payload is stored.
Specifically, the sending device has a communication request, and sends 48 bytes of content to a receiving end with a destination IP address of 11 and a destination port of 8, while the sending device has its own source IP address of 9 and source port of 8.
Firstly, according to the above coding mode, the sender represents the decimal 11 as 1011, adds the main type of 000 as the lowest three bits, ends with the highest bit being 0, constructs a byte as the first field, and so on, constructs the whole first message, and sends it to the next hop.
Then, after receiving the first message, the intermediate router decodes according to the above format definition, when it receives the first byte, it first extracts the main type 000 to represent an IP address, then analyzes the following bit with variable length binary string to obtain 1011, i.e. the destination IP address of decimal 11, and uses this IP address for forwarding, and the analysis processing of other fields is similar.
Finally, the receiving end device finally receives the first message, finally extracts the source address 9, the destination address 11, the source port 8 and the destination port 8 by adopting the same decoding method as the intermediate router, extracts 48 bytes of content and completes one-time message communication.
Therefore, in this example, by defining the second preset type, the purpose of defining a field with a large data volume is achieved, the function of the first protocol is expanded, and the comprehensiveness and integrity of the first protocol are improved.
In a possible implementation manner, the first packet includes at least one third field, where the at least one third field is used to indicate an identifier of at least one node, and if the node is a terminal node, the identifier is an IP address of the terminal node; and if the node is a transit node, the identification is the identification of the transit node.
When multiple transit nodes pass between the sending end device and the receiving end device, the first message may include an address identifier of each transit node.
The identifier of each transfer node adopts a variable length representation method, namely variable length representation can be carried out through a first type of fixed N bits and MSB of each byte.
For example, the form of the message sent by the sending end device is shown in fig. 5.
It can be seen that, in this example, the identification length of each transit node completely depends on the network size, and if the network size is only 16, the number address of the transit node is represented by coding the variable length and needs only 1 byte for expression. If the network size is 4000, the coding of the variable-length address only needs 2 bytes to express, and compared with the existing IPv4 protocol and IPv6 protocol, the first protocol adopts a variable-length mode to reduce the byte consumption.
In a possible implementation manner, a configuration file corresponds to the sending end device and the receiving end device, a plurality of keywords corresponding to the first type and/or a plurality of keywords corresponding to the second type are defined in the configuration file, and the first packet is a packet encoded according to the configuration file.
As described in table 1, 000 represents the destination IP address, 001 represents the source IP address, and 010 represents the hop limit, but for a protocol, it may be that the protocol requires 000 to represent the source IP address and 001 to represent the destination IP address; similarly, for table 4, there is also a need for a change to the second type defined based on the KEY value under type 101; however, the meaning of one device randomly changing the type value between two devices will result in no interworking between the two devices.
Configuration file 1 may be corresponded between the sending end device and the receiving end device, for example, a corresponding type MainType may be described, as follows:
MainType-000;
MainType-001;
MainType-010;
MainType-011;
MainType-100;
Varbin;
Length-Delimited.
where, Vabin represents a variable Length binary string type, and Length-Delimited variable Length description type requires an explicit KEY value defining the second type.
For example, the structure of the message body corresponding to the configuration file is as follows:
Figure BDA0002563565870000131
where destIPAddr represents the destination IP address, srcIPAddr represents the source IP address, destPort represents the destination port, and srcPort represents the source port.
Where this profile defines destIPAddr as being represented by 000, destPort's KEY 20000.
Specifically, each defined arrangement order in the configuration file is associated with a forwarding field of the receiving end device, and the forwarding field is used for the receiving end device to forward the first packet.
For example, as shown in fig. 6, the router 2 uses srcIPAddr as a forwarding field, and if the srcIPAddr can be read in the first field, the parsing efficiency can be improved, and the corresponding configuration file 2 between the router 1 and the router 2 can be as follows:
Figure BDA0002563565870000132
Figure BDA0002563565870000141
specifically, the length of the value of the keyword corresponding to the second type in the configuration file 2 is variable length.
For example, as shown in fig. 6, the message overhead between the router 2 and the router 3 is small, and the lengths of the fields occupied by the KEY values of 2, 3 and 4 are smaller than those occupied by 20000, 30000 and 40000, so that the corresponding configuration files between the router 2 and the router 3 can be as follows:
Figure BDA0002563565870000142
specifically, when a configuration file is defined between the sending end device and the receiving end device, the sending end device needs to encode the first message according to the configuration file, when the receiving end device receives the first message, the receiving end device needs to decode according to the configuration file, and different description files can be used between every two-hop communication nodes.
It can be seen that, in this example, a configuration file is provided between the sending end device and the receiving end device, so that different first-type or second-type different expression modes can exist between every two hops of communication devices, and different field sequences can be flexibly allocated, which is beneficial to improving the flexibility of message encoding and decoding.
In a possible implementation manner, when the first packet passes through a domain network gateway, a source address and a destination address in the first packet are updated, where the updated source address is added with a domain prefix corresponding to the domain network, or the updated destination address is reduced with the domain prefix corresponding to the domain network.
Since each field is variable-length, the IP address can be variable-length, and then a mechanism for continuously increasing or decreasing the IP address in the sending process can be implemented, so as to implement a scheme for flexibly extending the network size, as shown in fig. 7:
the sending end equipment A and the router 1 form a domain, the address length is 4bits, the address of A is 1 in the domain, and when A sends a message to the router 1, the IP address of a message source is 1 of 7 bits.
Then the network scale is enlarged to the router 2, the address length is 11bits, wherein the added 7bits is corresponding to the address prefix of the router 1 is 2, and so on, and enlarged to the router 3, the address length is 18bits, wherein the added 7bits is corresponding to the address prefix of the router 2 is 3, the scale is enlarged to the receiving terminal device B, and is 25bits, wherein the added 7bits is corresponding to the address prefix of the router 3 is 4, and it is assumed that the IP address of B is 2.2.2.2, and each segment is 7 bits.
In this embodiment, the communication method is as follows:
1: a is sent to a router 1, and the format of a first message is { destIP:2.2.2.2, srcIP:1, Payload };
2: the router 1 receives the first message of A, adds a local prefix 2 to 1 of SrcIP to form 2.1, and forms a new message { destIP:2.2.2.2, srcIP:2.1, Payload };
3: the router 2 receives the first message of the router 1, and adds a local prefix 3 to 2.1 of the SrcIP to form 3.2.1, so as to form a new message { destIP:2.2.2, srcIP:3.2.1, Payload };
4: the router 3 receives the first message of the router 2, adds the local prefix 4 to 3.2.1 of the SrcIP, and sends the first message to the B to form 4.3.2.1, so that a new message { destIP:2.2.2, srcIP:4.3.2.1, Payload } is formed.
In the above processing step of the router 1/2/3, the source IP address part is expressed by a variable-length binary string, for example, the expression 4.3.2.1 is: 10001001100000101000001100000100.
in the first byte 10001001, the last 3bits001 indicates the source IP address, the middle 0001 indicates that the address in the domain formed by a and the router 1 is 1, the MSB 1 indicates that the field is not completed, the second byte 10000010 indicates that the field is not completed, the field value 0000010 indicates the prefix 2, the third byte 10000011 indicates that the field is not completed, the field value 0000011 indicates the prefix 3, the fourth byte 00000100 indicates that the MSB 0 indicates the field is completed, and the field value 0000100 indicates the prefix 4.
Similarly, if the message is sent from B to a, the process is:
1: b, sending the message to the router 3, wherein the message format is { srcIP:2.2.2.2, destIP:4.3.2.1, Payload };
2: the router 3 receives the message of B, deletes the local prefix 4 from 4.3.2.1 of SrcIP to form 3.2.1, and forms a new message { srcIP:2.2.2.2, destIP:3.2.1, Payload };
3: the router 2 receives the message of the router 3, deletes the local prefix 3 from 3.2.1 of the SrcIP to form 2.1, and forms a new message { srcIP:2.2.2.2, destIP:2.1, Payload };
4: the router 1 receives the message of the router 2, deletes the local prefix 2 from the 2.1 of the SrcIP to form a message 1, and a new message { srcIP:2.2.2.2, destIP:1, Payload } is formed and sent to the A.
It can be seen that, in this example, the source IP address and the destination IP address may be gradually increased or decreased in the process of sending the first packet, instead of being fixed to be the longest in the initial sending, which is beneficial to reducing byte consumption.
In a possible implementation manner, the first packet includes a fourth field, an MSB of each byte in the fourth field is used to indicate whether the fourth field is ended, and each bit except the MSB is used to indicate whether a field corresponding to the bit exists in the first packet.
In this embodiment, it may be indicated that a field corresponding to a bit exists in the first message when the bit is 1, and that a field corresponding to a bit does not exist in the first message when the bit is 0, that is, in this embodiment, it is no longer necessary for each byte to have a fixed bit indicating the first type, and each type may be indicated by each bit in the fourth field whether the field is located in the fourth field or not.
For example, as shown in fig. 8, the whole packet structure is formed by adding a fourth field at the top, which is a Bitmap field, and all fields from Bitmap to before the payload, including the destination IP address, the source IP address, the hop limit, the destination port, the source port, and the like, are all expressed by variable length binary string types; for example, the Bitmap field starts with a low Bit, Bit0 is 1, which indicates a destination IP address field, and Bit0 is 0, which indicates a non-destination IP address field; bit1 is 1, indicating an active IP address field, Bit1 is 0, indicating a passive IP address field; bit2 is 1, indicating that there is a hop limit field, Bit2 is 0, indicating that there is no hop limit field; bit3 is 1, indicating the destination port number field, Bit3 is 0, indicating the destination port number field; bit4 is 1 indicating an active port number field, Bit4 is 0 indicating a passive port number field, etc., and Bit 7: the MSB for the variable length binary string, if 0, indicates that the Bitmap is finished, 1, indicates whether there is the next byte or the Bitmap, which means that the Bitmap is also variable in length.
For example, in this embodiment, the method for representing the destination IP address in the first message as 01011000000010 is as follows: 1010110000000010, since there is a fourth field in the first packet, it is not necessary to indicate the first type, so the MSB of the first byte 10101100 in the destination IP address is 1, which indicates that the field is not ended, and the MSB of the second byte 00000010 is 0, which indicates that the field is ended, and besides 01011000000010 can be used to indicate the field value, i.e. the destination IP address.
It can be seen that in this example, since the field is expressed in a variable length, the shortest field can be achieved as required, and since the Bitmap is used, when a field is not required, the corresponding bit in the Bitmap is correspondingly set, so that the field which is not required can be deleted, and the compression effect is achieved.
Referring to fig. 9, fig. 9 is a schematic diagram of a data transmission device according to an embodiment of the present application, where the data transmission device 200 includes: a transceiver module 201 and a processing module 202.
In an implementation manner, when the data transmission apparatus is applied to a sending end device, the transceiver module 201 is configured to send a first message to a receiving end device, where the first message is a message encoded according to a coding and decoding rule of a first protocol, and the coding and decoding rule of the first protocol specifies that a length of each field in the message is a variable length.
In this embodiment, a sending end device sends a first message to a receiving end device, where the first message is a message encoded according to an encoding and decoding rule of a first protocol, and the encoding and decoding rule of the first protocol specifies that the length of each field in the message is variable. Therefore, the first message coded by the variable length coding design through the first protocol is not limited in the width and the position of each field, and can be compatible and adaptive no matter whether protocol versions supported by the sending end equipment and the receiving end equipment are the same or not, so that the adjustability of the length of the field is realized, and the convenience and the flexibility of message coding and decoding are improved.
In a possible implementation manner, each field of the first packet includes N bits for indicating the first type, where N is a positive integer greater than 0 and less than or equal to 7 and is a fixed value.
In a possible implementation manner, each field of the first packet further includes V bits for indicating a field value, V is a positive integer greater than 0, and a value of V is associated with the field value.
In a possible implementation manner, each field of the first packet further includes L bits for indicating a field value length, where L is a positive integer greater than 0 and is a fixed value.
In a possible implementation manner, each field of the first packet includes at least one indication field, and the most significant bit MSB of each byte in the indication field is used to indicate whether the corresponding indication field is finished.
In a possible implementation manner, the first packet includes a first field, the first type corresponding to the first field is a first preset type, the first field includes a first indication field and a second indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, M is a positive integer greater than 0, and a value of M is associated with the second type, and the second indication field includes V bits for indicating a field value.
In a possible implementation manner, the first packet includes a second field, the first type corresponding to the second field is a second preset type, the second field includes a first indication field, a second indication field, and a third indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, the second indication field includes P bits for indicating a field value length, the third indication field includes V bits for indicating a field value, M is a positive integer greater than 0, a value of M is associated with the second type, P is a positive integer greater than 0, and a value of P is associated with the field value length.
In a possible implementation manner, the first packet includes at least one third field, where the at least one third field is used to indicate an identifier of at least one node, and if the node is a terminal node, the identifier is an IP address of the terminal node; and if the node is a transit node, the identification is the identification of the transit node.
In a possible implementation manner, a configuration file corresponds to the sending end device and the receiving end device, a plurality of keywords corresponding to the first type and/or a plurality of keywords corresponding to the second type are defined in the configuration file, and the first packet is a packet encoded according to the configuration file.
In a possible implementation manner, each defined arrangement order in the configuration file is associated with a forwarding field of the receiving end device, and the forwarding field is used for the receiving end device to forward the first packet.
In a possible implementation manner, when the first packet passes through a domain network gateway, a source address and a destination address in the first packet are updated, the updated source address is added with a domain prefix corresponding to the domain network, and the updated destination address is reduced with the domain prefix corresponding to the domain network.
In a possible implementation manner, the first packet includes a fourth field, an MSB of each byte in the fourth field is used to indicate whether the fourth field is ended, and each bit except the MSB is used to indicate whether a field corresponding to the bit exists in the first packet.
It can be understood that the data transmission apparatus shown in fig. 9 may correspond to the sending end device in the data transmission method in the embodiment of the present application, and may implement the corresponding process of the data transmission method in the embodiment of the present application, and for brevity, no further description is given here.
In another implementation manner, when the data transmission apparatus is applied to a receiving end device, the transceiver module 201 is configured to receive a first packet sent from a sending end device;
the processing module 202 is configured to analyze the first packet according to a coding and decoding rule of a first protocol, where the coding rule of the first protocol specifies that a length of each field in the packet is a variable length.
In the embodiment of the application, the receiving end device receives a first message sent by the sending end device and analyzes the first message according to the coding and decoding rules of the first protocol, the coding rules of the first protocol stipulate that the length of each field in the message is variable, and it is visible that the first message is decoded by adopting a variable length coding and decoding design through the first protocol.
In a possible implementation manner, each field of the first packet includes N bits for indicating the first type, where N is a positive integer greater than 0 and less than or equal to 7 and is a fixed value.
In a possible implementation manner, each field of the first packet further includes V bits for indicating a field value, V is a positive integer greater than 0, and a value of V is associated with the field value.
In a possible implementation manner, each field of the first packet further includes L bits for indicating a field value length, where L is a positive integer greater than 0 and is a fixed value.
In a possible implementation manner, each field of the first packet includes at least one indication field, and the most significant bit MSB of each byte in the indication field is used to indicate whether the corresponding indication field is finished.
In a possible implementation manner, the first packet includes a first field, the first type corresponding to the first field is a first preset type, the first field includes a first indication field and a second indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, M is a positive integer greater than 0, and a value of M is associated with the second type, and the second indication field includes V bits for indicating a field value.
In a possible implementation manner, the first packet includes a second field, the first type corresponding to the second field is a second preset type, the second field includes a first indication field, a second indication field, and a third indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, the second indication field includes P bits for indicating a field value length, the third indication field includes V bits for indicating a field value, M is a positive integer greater than 0, a value of M is associated with the second type, P is a positive integer greater than 0, and a value of P is associated with the field value length.
In a possible implementation manner, the first packet includes at least one third field, where the at least one third field is used to indicate an identifier of at least one node, and if the node is a terminal node, the identifier is an IP address of the terminal node; and if the node is a transit node, the identification is the identification of the transit node.
In a possible implementation manner, a configuration file corresponds to the sending end device and the receiving end device, a plurality of keywords corresponding to the first type and/or a plurality of keywords corresponding to the second type are defined in the configuration file, and the first packet is a packet encoded according to the configuration file.
In a possible implementation manner, each defined arrangement order in the configuration file is associated with a forwarding field of the receiving end device, and the forwarding field is used for the receiving end device to forward the first packet.
In a possible implementation manner, when the first packet passes through a domain network gateway, a source address and a destination address in the first packet are updated, the updated source address is added with a domain prefix corresponding to the domain network, and the updated destination address is reduced with the domain prefix corresponding to the domain network.
In a possible implementation manner, the first packet includes a fourth field, an MSB of each byte in the fourth field is used to indicate whether the fourth field is ended, and each bit except the MSB is used to indicate whether a field corresponding to the bit exists in the first packet.
It can be understood that the data transmission apparatus shown in fig. 9 may correspond to a receiving end device in the data transmission method in the embodiment of the present application, and may implement a corresponding process of the data transmission method in the embodiment of the present application, which is not described herein again for brevity.
Referring to fig. 10, fig. 10 is a schematic diagram of another computer device 300 according to an embodiment of the present application. As shown in fig. 10, the computer apparatus 300 includes: a processor 310, a communication interface 320, and a memory 330, the processor 310, the communication interface 320, and the memory 330 being connected to each other by an internal bus 340.
The processor 310 may be formed by one or more general-purpose processors, such as a Central Processing Unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The bus 340 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one line is shown in FIG. 10, but not only one bus or type of bus.
Memory 330 may include volatile memory (volatile memory), such as Random Access Memory (RAM); the memory 330 may also include a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory (flash memory), a Hard Disk Drive (HDD), or a solid-state drive (SSD); memory 330 may also include combinations of the above. The memory 330 may be used to store programs and data to facilitate the processor 310 in invoking the program codes and data stored in the memory 330 to implement the functionality of the processing module 202 described above.
It can be understood that the sending end device shown in fig. 10 may correspond to the sending end device or the receiving end device in the data transmission method in the embodiment of the present application, and may implement the corresponding flow of the data transmission method in the embodiment of the present application, which is not described herein again for brevity.
An embodiment of the present application further provides a readable storage medium, where an instruction is stored in the readable storage medium, and when the instruction is executed on a sending end device, the sending end device is enabled to execute a flow related to the sending end device in the foregoing method embodiment.
An embodiment of the present application further provides a readable storage medium, where an instruction is stored in the readable storage medium, and when the instruction is executed on a receiving end device, the receiving end device is enabled to execute a flow related to the receiving end device in the foregoing method embodiment.
An embodiment of the present application further provides a computer program product, which, when running on a sending end device, enables the sending end device to execute a flow related to the sending end device in the foregoing method embodiment.
An embodiment of the present application further provides a computer program product, and when the computer program product runs on a receiving end device, the receiving end device executes a flow related to the receiving end device in the foregoing method embodiment.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It should be understood that the reference herein to first, second, third, fourth, and various numerical designations is merely a convenient division to describe and is not intended to limit the scope of the present application.
It should also be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (30)

1. A method of data transmission, the method comprising:
the sending end equipment sends a first message to the receiving end equipment, wherein the first message is a message coded according to a coding and decoding rule of a first protocol, and the coding and decoding rule of the first protocol specifies that the length of each field in the message is variable.
2. The method of claim 1, wherein each field of the first packet includes N bits for indicating the first type, where N is a positive integer greater than 0 and less than or equal to 7 and is a fixed value.
3. The method according to claim 1 or 2, wherein each field of the first packet further includes V bits for indicating a field value, V is a positive integer greater than 0, and a value of V is associated with the field value.
4. The method according to any one of claims 1 to 3, wherein each field of the first packet further includes L bits for indicating a field value length, where L is a positive integer greater than 0 and is a fixed value.
5. The method according to any of claims 1-3, wherein each field of the first packet comprises at least one indication field, and wherein the MSB of the highest bit of each byte in the indication field is used to indicate whether the corresponding indication field is finished.
6. The method according to claim 5, wherein the first packet includes a first field, the first type corresponding to the first field is a first preset type, the first field includes a first indication field and a second indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, M is a positive integer greater than 0, and a value of M is associated with the second type, and the second indication field includes V bits for indicating a field value.
7. The method according to claim 5, wherein the first packet includes a second field, the first type corresponding to the second field is a second preset type, the second field includes a first indication field, a second indication field and a third indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, the second indication field includes P bits for indicating a field value length, the third indication field includes V bits for indicating a field value, M is a positive integer greater than 0, and a value of M is associated with the second type, P is a positive integer greater than 0, and a value of P is associated with the field value length.
8. The method according to any of claims 1-7, wherein the first packet includes at least one third field, and the at least one third field is used to indicate an identifier of at least one node, and if the node is a terminal node, the identifier is an IP address of the terminal node; and if the node is a transit node, the identification is the identification of the transit node.
9. The method according to any one of claims 1 to 8, wherein a configuration file corresponds to the sending end device and the receiving end device, a plurality of keywords corresponding to the first type and/or a plurality of keywords corresponding to the second type are defined in the configuration file, and the first packet is a packet encoded according to the configuration file.
10. The method according to claim 8, wherein each defined permutation order in the configuration file is associated with a forwarding field of the sink device, and the forwarding field is used for the sink device to forward the first packet.
11. The method according to any of claims 5-10, wherein a source address and a destination address in the first message are updated when the first message passes through a domain network gateway, the updated source address is increased by a domain prefix corresponding to the domain network, and the updated destination address is decreased by the domain prefix corresponding to the domain network.
12. The method of claim 1, wherein the first packet comprises a fourth field, wherein the MSB of each byte in the fourth field is configured to indicate whether the fourth field is ended, and wherein each bit except the MSB is configured to indicate whether a field corresponding to the bit exists in the first packet.
13. A method of data transmission, the method comprising:
receiving end equipment receives a first message sent by sending end equipment;
and the receiving end equipment analyzes the first message according to the coding and decoding rules of the first protocol, wherein the coding rules of the first protocol stipulate that the length of each field in the message is variable.
14. The method of claim 13, wherein each field of the first packet includes N bits for indicating the first type, where N is a positive integer greater than 0 and less than or equal to 7 and is a fixed value.
15. The method according to claim 13 or 14, wherein each field of the first packet further includes V bits for indicating a field value, V is a positive integer greater than 0, and a value of V is associated with the field value.
16. The method as claimed in any one of claims 13 to 15, wherein each field of the first packet further includes L bits for indicating a field value length, where L is a positive integer greater than 0 and is a fixed value.
17. The method according to any of claims 13-15, wherein each field of the first packet comprises at least one indication field, and wherein the MSB of the highest bit of each byte in the indication field is used to indicate whether the corresponding indication field is finished.
18. The method according to claim 17, wherein the first packet includes a first field, the first type corresponding to the first field is a first preset type, the first field includes a first indication field and a second indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, M is a positive integer greater than 0, and a value of M is associated with the second type, and the second indication field includes V bits for indicating a field value.
19. The method according to claim 17, wherein the first packet includes a second field, the first type corresponding to the second field is a second preset type, the second field includes a first indication field, a second indication field, and a third indication field, the first indication field includes N bits for indicating the first type and M bits for indicating the second type, the second indication field includes P bits for indicating a field value length, the third indication field includes V bits for indicating a field value, M is a positive integer greater than 0, and a value of M is associated with the second type, P is a positive integer greater than 0, and a value of P is associated with the field value length.
20. The method according to any of claims 13-19, wherein the first packet includes at least one third field, and the at least one third field is used to indicate an identifier of at least one node, and if the node is a terminal node, the identifier is an IP address of the terminal node; and if the node is a transit node, the identification is the identification of the transit node.
21. The method according to any one of claims 13 to 20, wherein a configuration file corresponds to the sending end device and the receiving end device, a plurality of keywords corresponding to the first type and/or a plurality of keywords corresponding to the second type are defined in the configuration file, and the first packet is a packet encoded according to the configuration file.
22. The method according to claim 21, wherein each defined permutation order in the configuration file is associated with a forwarding field of the sink device, and the forwarding field is used for the sink device to forward the first packet.
23. The method according to any of claims 17-22, wherein a source address and a destination address in the first message are updated when the first message passes through a domain network gateway, wherein the updated source address is increased by a domain prefix corresponding to the domain network, and wherein the updated destination address is decreased by the domain prefix corresponding to the domain network.
24. The method of claim 13, wherein the first packet includes a fourth field, wherein the MSB of each byte in the fourth field is configured to indicate whether the fourth field is ended, and wherein each bit except the MSB is configured to indicate whether a field corresponding to the bit exists in the first packet.
25. A data transmission apparatus, characterized in that the data transmission apparatus comprises:
a transceiver module: the method is used for sending a first message to receiving end equipment, wherein the first message is a message coded according to a coding and decoding rule of a first protocol, and the coding and decoding rule of the first protocol specifies that the length of each field in the message is variable.
26. A data transmission apparatus, characterized in that the data transmission apparatus comprises:
the receiving and sending module is used for receiving a first message sent by sending end equipment;
and the processing module is used for analyzing the first message according to the coding and decoding rules of the first protocol, wherein the coding rules of the first protocol specify that the length of each field in the message is variable.
27. A sender device, comprising a memory and a processor, wherein the processor executes computer instructions stored by the memory to cause the sender device to perform the method of any of claims 1-12.
28. A sink device, wherein the sink device comprises a memory and a processor, and wherein the processor executes computer instructions stored in the memory to cause the sink device to perform the method of any one of claims 13-24.
29. A readable storage medium having stored therein instructions that, when executed on a sender device, cause the sender device to perform the method of any one of claims 1-12.
30. A readable storage medium having stored therein instructions that, when executed on a sink device, cause the sink device to perform the method of any one of claims 13-24.
CN202010625751.8A 2020-06-30 2020-06-30 Data transmission method and equipment Pending CN113872926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010625751.8A CN113872926A (en) 2020-06-30 2020-06-30 Data transmission method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010625751.8A CN113872926A (en) 2020-06-30 2020-06-30 Data transmission method and equipment

Publications (1)

Publication Number Publication Date
CN113872926A true CN113872926A (en) 2021-12-31

Family

ID=78981068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010625751.8A Pending CN113872926A (en) 2020-06-30 2020-06-30 Data transmission method and equipment

Country Status (1)

Country Link
CN (1) CN113872926A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024098948A1 (en) * 2022-11-09 2024-05-16 华为技术有限公司 Communication methods, storage medium and program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024098948A1 (en) * 2022-11-09 2024-05-16 华为技术有限公司 Communication methods, storage medium and program product

Similar Documents

Publication Publication Date Title
CN107534661B (en) Enhanced compression format for data compression
AU2018408054B2 (en) Wireless communication method, network device, and terminal device
EP1334560B1 (en) Communication method for shared context compression
US6883035B2 (en) System and method for communicating with temporary compression tables
CN108123870B (en) Message forwarding method and device
ES2267821T3 (en) METHOD AND APPARATUS OF PROCESSING OF DATA PACKAGES.
CN1278383A (en) Subnetwork dependent convergence protocol for mobile radio network
US8391148B1 (en) Method and apparatus for Ethernet data compression
CN108696492B (en) Method and device for processing IP message
US10044369B1 (en) Interleaved codes for dynamic sizeable headers
RU2767321C1 (en) Method and device for wireless communication
CN109526030B (en) Message processing method, device and equipment
Abdelfadeel et al. Lschc: Layered static context header compression for lpwans
CN113872926A (en) Data transmission method and equipment
US8767704B2 (en) Compressing header data
WO2017157023A1 (en) Method and system for transmitting soap message
CN113115361B (en) Method, device, chip and computer program for compressing Ethernet frame header
CN110120985B (en) Method and apparatus for communication
EP1334559A2 (en) Communication system and method utilizing request-reply communication patterns for data compression
US11343715B1 (en) Header compression for network
WO2023040668A1 (en) Encoding method, decoding method, and related apparatus
CN115208811A (en) Message processing method and related equipment
CN116073945A (en) Information processing method and communication device
WO2003015284A1 (en) Method for compression of data using variable length code

Legal Events

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