Method for communication between first and second nodes in a network
11477692 ยท 2022-10-18
Assignee
Inventors
Cpc classification
H04L47/34
ELECTRICITY
H04L2209/34
ELECTRICITY
Y02D30/70
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
International classification
Abstract
Some protocols for the transmission of data on a communication network, such as the LoRaWAN protocol, use frames comprising payloads intended to transport useful data, the size of which may vary from one frame to another. A communication method is proposed in order to transmit data on this type of network. This method is based on a division of a payload packet into a set of blocks and then an insertion of the blocks thus formed into at least one segment. Each segment comprises a number of blocks suited to a payload size at the time of creation of the segment. The segments are next supplemented with verification information enabling an addressee of the data packet to determine whether it has received all the blocks. In the event of non-reception of all the blocks, the sender of the blocks retransmits at least the blocks not received.
Claims
1. A method for communication between first and second nodes in a network using a frame transmission protocol, each frame in accordance with said protocol, referred to as a protocol frame, comprising a payload intended to transport useful data, each payload having a size that may vary from one protocol frame to another protocol frame, wherein the method comprises steps executed by the first node comprising: obtaining a payload frame to be transmitted to the second node; dividing the payload frame into a set of blocks of predefined size, each block being associated with a number equal to a rank of said block in the payload frame; applying an encapsulation and transmission procedure to the blocks of said set comprising: running through the blocks in decreasing order of their number, and inserting the blocks in this order in at least one segment, the blocks being inserted in each segment until a segment size that is as close as possible to a current size of a payload is reached while remaining smaller than or equal to it; inserting verification information in each segment, said verification information comprising, in each segment comprising more than one block in which it is inserted, an identifier representing the number of the block that has the highest rank in said segment, and in addition comprising, when it is inserted in the segment containing the block with the lowest rank, an error identification code making it possible to determine whether the set of blocks has been received; and transmitting each segment to the second node in a protocol frame; and, in the case of reception of an acknowledgement of reception from the second node containing information representing at least one block not received by the second node, applying the encapsulation and transmission procedure to at least each block that was not received, the second node having used each item of verification information received in order to determine each block lost.
2. The method according to claim 1, wherein the network is a long-range wireless network affording low energy consumption based on LoRa technology, the protocol is the LoRaWAN protocol and the first node is a device suitable for communicating on a LoRa network using the LoRaWAN protocol, referred to as a LoRa endpoint, and the second node is a LoRa network server, or the first node is a LoRa network server and the second node is a LoRa endpoint.
3. The method according to claim 2, wherein the first node is a server and the second node is a LoRa endpoint functioning in class A according to the LoRaWAN protocol, when the second node has received a first segment comprising blocks in a set of blocks, at each reception of a segment the second node measures a time since the reception of said segment and, when said time is greater than a predefined maximum time without a frame having been transmitted to the first node, transmits a protocol frame representing a request for transmission of data to the first node in order to enable the first node of transmit a new segment.
4. The method according to claim 1, wherein if, following the transmission of each segment to the second node, the first node does not receive an acknowledgement of reception from the second node after a predefined time following the transmission of the last segment, the first node transmits to the second node a segment containing at least the block with the lowest rank, the error identification code and an identifier representing the number of the block that has the highest rank in said segment.
5. The method according to claim 1, wherein the verification information is included in a header of said segment, said header further comprising information representing a change of set of blocks a value of which is modified each time a new set of blocks is transmitted to the second node and/or information representing a request for acknowledgement of reception, making it possible to activate or not a reception acknowledgement mechanism, the first node awaiting an acknowledgement of reception for the set of blocks from the second node when said mechanism is activated.
6. The method according to claim 1, wherein the information representing at least one block not received by the second node is a series of bits, each bit in the series representing a block in the set of blocks, and, for each bit, a first value of said bit indicates a reception of the corresponding block and a second value of said bit indicates non-reception of the corresponding block.
7. The method according to claim 1, wherein the acknowledgement of reception comprises information for identifying to which set of blocks said acknowledgement of reception relates and/or information indicating if, when there is a verification of integrity of the blocks received using the error detection code, the second node has or has not detected an error.
8. A non-transitory storage medium, wherein said storage medium stores a computer program comprising instructions for the implementation, by a device, of the method according to any of claim 1, when said program is executed by a processor of said device.
9. A device, referred to as the first node, of the communication node type suitable for communicating with a second device of the communication node type, referred to as the second node, in a network using a frame transmission protocol, each frame in accordance with said protocol, referred to as a protocol frame, comprising a payload intended to transport useful data, each payload having a size that may vary from one protocol frame to another protocol frame, wherein the device comprises electronic circuitry configured for: obtaining a payload frame to be transmitted to the second node; dividing the payload frame into a set of blocks of predefined size, each block being associated with a number equal to a rank of said block in the payload frame; applying an encapsulation and transmission procedure to the blocks in said set comprising: running through the blocks in decreasing order of their number, and inserting the blocks in this order in at least one segment, the blocks being inserted in each segment until a segment size as close as possible to a current size of a payload is reached while remaining smaller than or equal to it; inserting verification information in each segment, said verification information comprising, in each segment comprising more than one block in which it is inserted, an identifier representing the number of the block that has the highest rank in said segment, and also comprising, when it is inserted in the segment containing the block with the lowest rank, an error identification code for determining whether the set of blocks has been received; transmitting each segment to the second node in a protocol frame; and receiving from the second node an acknowledgement of reception comprising information representing at least one block not received by the second node, applying an encapsulation and transmission procedure to at least each block not received in the case of reception of such an acknowledgement of reception from said second node, the second node having used each item of verification information received in order to determine each block lost.
Description
(1) The features of the invention mentioned above, as well as others, will emerge more clearly from a reading of the following description of an example embodiment, said description being given in relation to the accompanying drawings, among which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11) The invention is described hereinafter in a context of a LoRa network. The invention does however apply in other contexts for all types of network using a frame (or packet) transmission protocol in which each frame intended to transport a payload encapsulates this payload in a payload having a size that may vary from one frame to another frame.
(12) Moreover, it is known that the LoRaWAN protocol defines three classes of endpoint, referred to as LoRa endpoints (A, B and C), each class of endpoint being associated with a particular operating mode. Class A must be implemented in all the endpoints for reasons of compatibility. A terminal may change class in the course of operation.
(13) Class A is the most economical in terms of energy consumption for the endpoints. In this class, when a LoRa terminal has data to send it does so without any check since it opens two successive listening windows for any messages coming from the LNS server. These two windows are the only moments during which the LNS server can send to the endpoint the data that it has previously stored for its attention.
(14) Class B offers a compromise between energy consumption for the LoRa endpoint and a need for bidirectional communication between said endpoint and the LNS server. Class B equipment opens a reception window at intervals programmed by periodic messages sent by the LNS server.
(15) Class C is the least economical class in terms of energy consumption for the LoRa endpoints. On the other hand, this class allows bidirectional communications at all times since the LoRa endpoints are permanently listening out for the LNS server.
(16) As we shall see hereinafter, the invention is particularly well suited to functioning in classes C and B. However, we shall also show an operating mode that is particularly suited to class A.
(17)
(18) In the example in
(19) Moreover, each communication between the gateway 11 and the LoRa endpoint 12 uses a wireless communication link 13.
(20) The LNS server 10 comprises a processing module 100. The LoRa endpoint 12 comprises a processing module 120.
(21) It should be noted that, in the LoRa network 1, the communications between the endpoint 12 and gateway 11 use frames compatible with the LoRaWAN protocol. The LoRaWAN document 1.1 of October 2017 defines communications between the endpoints and the gateways of a LoRa network. Moreover, the communications between the gateway 11 and the LNS server 10 take place, for example, in the form of HTTP or HTTPS requests. In the invention, the gateway 11 fulfils a role of relay between the LoRa endpoint 12 and the LNS server 10. In a so-called uplink direction, that is to say for transmissions from the LoRa endpoint 12 to the LNS server 10, the gateway 11 encapsulates the LoRa frames that it receives in HTTP or HTTPS frames, and transmits the LoRa frames thus encapsulated to the LNS server 10. In a so-called downlink direction, that is to say for transmissions from the LNS server 10 to the LoRa endpoint 12, the gateway 11 extracts the LoRa frames that it receives in HTTP or HTTPS frames, and transmits the LoRa frames obtained to the terminal 12.
(22) We describe here an LNS server 10. In one embodiment, this LNS server 10 could just as well represent a set of servers comprising a first server intended to communicate with gateways such as the gateway 11 and at least one application server connected by a communication network to the first server. In this embodiment, the first server would serve as a relay between the gateways and the application server or servers, the LoRa frames generated by the LoRa endpoint 12 being intended for the application server or one of the application servers.
(23)
(24) According to the example of hardware architecture depicted in
(25) The processor 1001 is capable of executing instructions loaded in the RAM 1002 from the ROM 1003, from an external memory (not shown), from a storage medium (such as an SD card), or from a communication network. When the LNS server 10 is powered up, the processor 1001 is capable of reading instructions from the RAM 1002 and executing them. In one embodiment, these instructions form a computer program causing the complete or partial implementation, by the processor 1001, of the methods described below in relation to
(26)
(27) According to the example of hardware architecture depicted in
(28) The processor 1201 is capable of executing instructions loaded in the RAM 1202 from the ROM 1203, from an external memory (not shown), from a storage medium (such as an SD card), or from a communication network. When the endpoint 12 is powered up, the processor 1201 is capable of reading instructions from the RAM 1202 and executing them. In one embodiment, these instructions form a computer program causing the complete or partial implementation, by the processor 1201, of the methods described below in relation to
(29) The methods described in relation to
(30)
(31) In a step 300, the processing module 120 receives a payload frame to be transmitted to the LNS server 10. Hereinafter the payload frames are referred to as application frames.
(32) In a step 301, the processing module 120 divides the application frame into a set of blocks of predefined size L. In one embodiment, the predefined size L is equal to a minimum size B.sub.min of a LoRa payload. The minimum size B.sub.min is dependent on the implementation of the LoRaWAN protocol used and is supposed to be known to the processing module 120. In one embodiment B.sub.min=32 bytes. Each block in the set of blocks is associated with a number equal to a rank of said block in the application frame.
(33) In steps 302 to 306, the processing module applies an encapsulation and transmission procedure to the blocks in said set of blocks.
(34) During step 302, the processing module 120 obtains a current size l.sub.curr of a LoRa payload. As seen above, the size of a LoRa payload may vary from one LoRa frame to another LoRa frame. This size depends on the useful bitrate available for the communications between the endpoint 12 and the gateway 11 and the necessity or not of transmitting control data of the communications in accordance with the LoRaWAN protocol (i.e. also referred to as MAC (medium access control) commands. The processing module 120 knows at all times the current size l.sub.curr of a LoRa payload since it knows at all times what the useful bit rate is and whether control data must be transmitted.
(35) During step 303, the processing module 120 runs through the blocks by decreasing numbers (that is to say by decreasing rank in the application frame) and inserts a segment in each block. A segment comprises a header and at least one block.
(36)
(37) The header of a segment described in relation to
(38) A first field 400, coded in 1 bit, referred to as the FS (fragmentation session) field comprises information representing a change of set a value of which is modified each time a new set of blocks is transmitted. For example, when a first set of blocks is transmitted by the processing module 120, the FS field is at 1. If the first set of blocks is transmitted successfully, the FS field passes to 0 for a second set of blocks transmitted by the processing module 120. If the second set of blocks is transmitted successfully, the FS field goes to 1 again for a third set of blocks transmitted by the processing module 120.
(39) A second field 401, coded in 1 bit, referred to as the AR (acknowledge request) field, comprises information representing a request for acknowledgement of reception.
(40) The AR field 401 enables the processing module 120 to activate or not an acknowledgement of reception mechanism. When the acknowledgement of reception mechanism is activated, the processing module 120 awaits an acknowledgement of reception from the LNS server 10 following the transmission of a set of blocks. For example, the acknowledgement of reception mechanism is activated when the AR field 401 is at 1. In one embodiment, only the segment comprising block 0 comprises an AR field 401 at 1 in order to activate the acknowledgement of reception mechanism for the whole set of blocks.
(41) A third field 402, coded in 6 bits, comprises verification information. The verification information comprises an identifier representing the number of the block having the highest rank in said segment. As we shall see hereinafter, the verification information enables the LNS server 10 to check whether it has received all the blocks in the set of blocks transmitted and, if not, to determine which blocks have been lost.
(42) In one embodiment, the segment header could be longer and in particular the field 402 in order to take into account sets of blocks comprising more than 64 blocks.
(43) It should be noted that a segment is of a size (i.e. length) equal to a sum of the total sizes of each block included in said segment and of a size of the header of said segment.
(44)
(45) The header described in relation to
(46) The header in
(47) Returning to
(48) During step 304, the processing module 120 inserts the verification information in the segment thus formed.
(49) In a step 305, the processing module 120 inserts the segment thus formed in a payload of a LoRa frame and transmits said LoRa frame in the direction of the LNS server 10.
(50) In a step 306, the processing module 120 checks whether all the blocks in the set of blocks have been transmitted. If all the blocks have been transmitted and the reception acknowledgement mechanism is not activated, the processing module 120 ends the transmission of the set of blocks and for example awaits a new application frame.
(51) If all the blocks have been transmitted and the reception acknowledgement mechanism is activated, the processing module 120 awaits an acknowledgement of reception for the set of blocks transmitted.
(52) If blocks remain to be transmitted, the processing module 120 returns to step 302.
(53)
(54) Returning to
(55) As soon as it receives a segment containing a field 500, the processing module 100 executes a step 308.
(56) During step 308, the processing module 100 checks whether it has received all the blocks in the set of blocks transmitted using the error detection code. If no error is detected, the processing module 100, in a step 309, re-forms the application frame. The processing module 100 supplies for example this application frame to an application module that it executes.
(57) If the acknowledgement of reception mechanism is activated, the processing module 100 executes a step 310, during which the processing module 100 retransmits a positive acknowledgement of reception to the endpoint 12.
(58) In a step 311, the processing module 120 receives the positive acknowledgement of reception and ends the transmission of the current set of blocks during a step 312. The processing module 120 then for example awaits a new application frame.
(59) If during step 308 the processing module 100 detects that it has not received all the blocks using the error detection code, it determines, from the AR field of the segment comprising block 0, whether the acknowledgement of reception mechanism is activated. If this mechanism is not activated, the processing module 100, for example, rejects the received blocks considering that, if the set of blocks is not complete, it can re-form a usable application frame. In one embodiment, the processing module 100 can transmit an incomplete set of blocks to an application module, which it executes.
(60) If during step 308 the processing module 100 detects that it has not received all the blocks and the acknowledgement of reception mechanism is activated, it executes a step 313.
(61) During step 313, the processing module 100 determines which block or blocks have been lost. To do this, it uses the block number contained in the field 402 of each segment. For example, if the segment 71 is lost, the processing module 100 knows that the segment 70 contains the block 7 by reading the field 402 and that the segment 70 contained two consecutive blocks. It therefore deduces from this that the segment 70 also contained block 6. In addition, the processing module 100 knows that the segment 72 contained block 1 by reading the field 402 and that the segment 72 contains two consecutive blocks. It therefore deduces from this that the segment 72 also contained block 0. The processing module 100 also deduces that block 0 is situated in the segment 72 from the presence of the field 500 in the segment 72. The processing module 100 therefore deduces that blocks 5, 4, 3 and 2 are missing.
(62) In a step 314, the processing module 100 transmits a negative acknowledgement of reception containing information representing each block not received.
(63)
(64) The acknowledgement of reception described in relation to
(65) A positive acknowledgement of reception therefore comprises a C field 601 at 1 and a bitmap field 602 comprising non-significant bits, for example 6 bits at 1.
(66) A negative acknowledgement of reception therefore comprises a C field 601 at 0, and a bitmap field 602 in which all the bits corresponding to a received block are at 1, and all the bits corresponding to a lost block are at 0.
(67) Returning to
(68) Following reception of the negative acknowledgement of reception, the processing module determines which blocks have been lost using the bitmap field 602 in a step 317, and then returns to step 302 in order to retransmit at least the lost blocks. During this further execution of the encapsulation and transmission procedure, the processing module 120 takes into account the current size of the LoRa frame payloads. Thus, whereas blocks 5 to 2 had all been inserted in the same segment during the first transmission of these blocks, in this retransmission they could be transmitted in different segments if the current size of the payloads has decreased.
(69) In one embodiment, at each retransmission of blocks, the processing module 120 retransmits solely the lost blocks.
(70) In one embodiment, during each retransmission of blocks, the processing module 120 retransmits consecutive blocks. Thus, if non-consecutive blocks have been lost, the processing module 120 retransmits the lost blocks and also the blocks included between the two lost blocks, even if these blocks have been received.
(71) In step 307, the processing module 100 combines the blocks received following a retransmission with the blocks received during the initial transmission, keeping only one version of each block if it received blocks several times.
(72) During step 313, the processing module 100 determines the blocks that it had received (and therefore those that have been lost) according to the number of blocks contained in the field 402 of each segment, and numbers of blocks that it received previously.
(73) During step 315, if after a predefined time D the processing module 120 has received neither a negative acknowledgement of reception nor a positive acknowledgement of reception, it deduces from this that the segment containing block 0 and the field 500 has been lost. In this case, it forms a segment comprising at least block 0 and the field 500 and retransmits this segment in a LoRa frame to the LNS server 10 during a step 316. On reception of this segment, the processing module 100 returns to step 307. The time D is for example equal to five minutes.
(74) In one embodiment, the processing module 120 transmits the same block a maximum of N times. If at the end of a number N of transmissions, the processing module 120 still receives a negative acknowledgement of reception for the same set of blocks, it abandons the transmission of said set of blocks. The number N is for example equal to 8. In another embodiment, if at the end of a number N of transmissions the processing module 120 still receives a negative acknowledgement of reception for the same set of blocks, the processing module 120 retransmits all the blocks in the set of blocks. In this case, the processing module 120 changes the value of the field FS 400 in order to behave as if it transmitted a new set of blocks.
(75) If following a reception of segments containing blocks in a first set of blocks, the processing module 100 does not receive a segment containing block 0 and the field 500 relating to this set of blocks but blocks of another session, the processing module 100 rejects the blocks for which it has not received a frame containing block 0 and the field 500. It then considers that the corresponding set is definitively lost.
(76) In the description of the method in
(77) In the case of the class A operating mode, the method of
(78)
(79) In a step 800, the processing module 100 receives an application frame to be transmitted to the LoRa endpoint 12.
(80) In a step 801, the processing module 100 divides the application frame into a set of blocks of predefined size L. Each block in the set of blocks is associated with a number equal to a rank of said block in the application frame.
(81) In a step 802, the processing module 100 awaits reception of a LoRa frame from the LoRa endpoint 12. This is because in class A each communication from the LNS server 10 to the LoRa endpoint 12 must be done at the initiative of the LoRa endpoint 12. As soon as a LoRa frame is received from the LoRa endpoint 12, the processing module 100 executes a step 803.
(82) During step 803, the processing module 100 obtains the current size l.sub.curr of a LoRa payload.
(83) In a step 804, the processing module 100 runs through the blocks by decreasing numbers and inserts the blocks in this order in a segment until it reaches a segment size as close as possible to the current size l.sub.curr. The processing module 100 therefore maximises the number of blocks inserted in each segment while obtaining one (or more) segments of size less than or equal to the current size l.sub.curr. As in the method described in relation to
(84) In a step 805, the processing module 100 inserts the verification information in the segment thus formed.
(85) In a step 806, the processing module 100 inserts the segment thus formed in a LoRa payload and transmits the corresponding LoRa frame in the direction of the LoRa endpoint 12. The transmission is done in the reception windows of the LoRa endpoint 12 defined as from an instant of reception of the LoRa frame received during step 802.
(86) In a step 807, the processing module 100 checks whether all the blocks in the set of blocks have been transmitted.
(87) If some blocks have not been transmitted, the processing module 100 returns to step 802 and awaits reception of a LoRa frame coming from the LoRa endpoint 12 in order to continue.
(88) If all the blocks have been transmitted and the acknowledgement of reception mechanism is not activated, the processing module 100 ends the transmission of the set of blocks and for example awaits a new application frame.
(89) If all the blocks have been transmitted and the acknowledgement of reception mechanism is activated, the processing module 100 awaits an acknowledgement of reception from the LoRa endpoint 12.
(90) In a step 808, the processing module 120 of the LoRa endpoint 12 receives a certain number of LoRa frames and awaits reception of a LoRa frame comprising a segment containing a field 500 (and therefore an error detection code) and a block numbered 0.
(91) As soon as it receives a segment containing a field 500, the processing module 120 executes a step 809.
(92) During step 809, the processing module 120 checks whether it has received all the blocks in the set of blocks transmitted using the error detection code. If no error is detected, the processing module 120, during a step 810, re-forms the application frame. The processing module 120 supplies, for example, this application frame to an application module that it executes.
(93) If the acknowledgement of reception mechanism is activated, the processing module 120 executes a step 811 during which the processing module 120 transmits a positive acknowledgement of reception to the LNS server 10.
(94) In a step 812, the processing module 100 receives the positive acknowledgement of reception and ends the transmission of the current set of blocks in a step 813. The processing module 100 then, for example, awaits a new application frame.
(95) If during step 809 the processing module 120 detects that it has not received all the blocks, it determines, from the AR field whether the acknowledgement of reception mechanism is activated. If this mechanism is not activated, the processing module 120 for example rejects the blocks received considering that, if the set of blocks is not complete, it cannot re-form a usable application frame.
(96) If during step 809 the processing module 120 detects that it has not received all the blocks and the acknowledgement of reception mechanism is activated, it executes a step 814.
(97) During step 814, the processing module 120 determines which block or blocks have been lost.
(98) In a step 815, the processing module 120 transmits a negative acknowledgement of reception containing information representing each block not received.
(99) During a step 816, the processing module 120 receives a negative acknowledgement of reception.
(100) Following the reception of the negative acknowledgement of reception, the processing module determines which blocks have been lost using the bitmap field 602 in a step 818 and then returns to step 802 in order to retransmit at least the blocks lost. There also, the processing module 100 awaits reception of a LoRa frame coming from the LoRa endpoint 12 in order to continue the encapsulation and transmission procedure.
(101) In step 808, the processing module 120 combines the blocks received following a retransmission with the blocks received during the initial transmission, keeping only one version of each block if it receives blocks several times.
(102) In step 814, the processing module 120 determines the blocks that it has received (and therefore those that have been lost) according to the number of blocks contained in the field 402 of each segment, and the numbers of blocks that it received previously.
(103) In step 816, if after a predefined time D the processing module 100 has received neither negative acknowledgement of reception nor positive acknowledgement of reception, it deduces from this that the segment containing block 0 and the field 500 has been lost. In this case, it forms a segment comprising at least block 0 and the field 500 and transmits this segment in a LoRa frame to the endpoint 12 in a step 817. There also the processing module 100 waits to receive a LoRa frame coming from the LoRa endpoint 12 in order to execute step 817. When this segment is received, the processing module 120 returns to step 808. The time D is for example equal to five minutes.
(104) In one embodiment, the processing module 120 transmits the same block a maximum of N times. If at the end of a number N of transmissions of the same block, the processing module 100 still receives a negative acknowledgement of reception for the same set of blocks, it abandons the transmission of said set of blocks. The number N is for example equal to 8. In another embodiment, if at the end of a number N of transmissions the processing module 100 still receives a negative acknowledgement of reception for the same set of blocks, the processing module 100 retransmits all the blocks in the set of blocks. In this case, the processing module 100 changes the value of the FS field 400 in order to behave as if it transmitted a new set of blocks.
(105) If following reception of segments containing blocks in a first set of blocks, the processing module 100 does not receive a segment containing block 0 and the field 500 relating to this set of blocks but blocks of another set of blocks, the processing module 100 rejects the blocks for which it has not received a segment containing block 0 and the field 500. It then considers that the corresponding set of blocks is definitively lost.
(106) As seen above, steps of the method of
(107) In one embodiment, the processing module 120 reiterates the sending of a TR frame a number K of times as long as it does not once again receive a segment for the set of blocks in the course of transmission. For example, the number K=8. In one embodiment, the processing module 120 discards the blocks corresponding to the set of blocks in the course of transmission if after K transmissions of a TR frame the processing module 120 has not received a new segment.
(108) In an embodiment applicable in the case of the method described in