<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>False detection of replay protection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118451/false-detection-of-replay-protection</link><description>Hello. 
 I am developing using nRF5340DK and nRF Connect SDK v2.9.0. However, this PR has been applied. I connected one smartphone app and two boards(nRF5340DK) to the mesh network. When I sent multiple messages requiring a response from the smartphone</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jan 2025 23:51:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118451/false-detection-of-replay-protection" /><item><title>RE: False detection of replay protection</title><link>https://devzone.nordicsemi.com/thread/520798?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 23:51:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b8c5320-b7ae-441e-bb3f-2ea8a6954d09</guid><dc:creator>a.da</dc:creator><description>&lt;p&gt;Hi&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;Terje&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;Thank you once again.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;a.da&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: False detection of replay protection</title><link>https://devzone.nordicsemi.com/thread/520746?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 14:23:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f2b678d-7a87-4803-8a20-546b191771df</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="a.da"]When the order is reversed, do any issues or errors other than replay protection occur?&lt;br /&gt;Is the intention for the reversal of the order to be detected by the replay protection logic?[/quote]
&lt;p&gt;The issue is that replay protection leads to out-of-order packets getting discarded at the receiving node. If the application tolerates missing packets, then there should not be further issues or errors.&lt;/p&gt;
&lt;p&gt;The purpose of the replay protection logic is to not accept replays of old messages which were previously recorded by a malicious actor. The purpose is not to discard valid messages which happens to arrive out-of-order.&lt;/p&gt;
[quote user="a.da"]Is there a debug log that confirms when a packet is dropped?&lt;br /&gt;The two boards are approximately 1 meter apart. The boards are not covered, and there are no obstacles in between. &lt;br /&gt;Is it possible to distinguish whether the packet was actually dropped or if it was not transmitted at all?[/quote]
&lt;p&gt;Packets dropped from replay protection is logged by the target at the &amp;quot;warning&amp;quot; log level. The following line is one example of this log line, found in your target log file:&lt;/p&gt;
&lt;p&gt;[00:53:25.676,483] &amp;lt;wrn&amp;gt; bt_mesh_transport: Replay: src 0x1000 dst 0x148d seq 0x002d27&lt;/p&gt;
&lt;p&gt;When packets are lost due to packet collision, or due to the receiving node not scanning at the moment, then there is no log trace of that packet at the receiving node. Depending on log level, there may be traces in the logs from the originating node and from relay nodes.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: False detection of replay protection</title><link>https://devzone.nordicsemi.com/thread/520642?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 06:15:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1dcf740-65a2-4fd1-ab63-1fb31d12e2ea</guid><dc:creator>a.da</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;Terje&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;Thank you for your thorough explanation.&amp;nbsp;If reliable sending is necessary, I will try segmented messages.&lt;/p&gt;
&lt;p&gt;Let me confirm two additional points.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;When the order is reversed, do any issues or errors other than replay protection occur?&lt;br /&gt;Is the intention for the reversal of the order to be detected by the replay protection logic?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Is there a debug log that confirms when a packet is dropped?&lt;br /&gt;The two boards are approximately 1 meter apart. The boards are not covered, and there are no obstacles in between. &lt;br /&gt;Is it possible to distinguish whether the packet was actually dropped or if it was not transmitted at all?&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;a.da&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: False detection of replay protection</title><link>https://devzone.nordicsemi.com/thread/520561?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2025 14:06:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66dc3e4e-8517-4905-9d81-f927d442c8dd</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When the packets of a Bluetooth Mesh message are transmitted and relayed, they are not sent only once. Rather, they are repeated, according to a configuration for the number of repeats.&lt;/p&gt;
&lt;p&gt;From the node sending the message, the packets will be sent 1 + Network Transmit Count number of times.&lt;/p&gt;
&lt;p&gt;From the relay node, the packets will be sent 1 + Relay Retransmit Count number of times. Further, the intervals between those retransmissions are controlled by Network Transmit Interval and Relay Retransmit Interval, for originating node and relay nodes respectively.&lt;/p&gt;
&lt;p&gt;If you send a message B shortly after a message A, you may end up with the first transmission of the packet containing message B being sent before the last retransmissions of the packet containing message B. Typically this can happen at the relay, especially if the first original transmission for packet A was lost, so that the relay starts relaying after receiving the second or third transmission for that packet.&lt;/p&gt;
&lt;p&gt;The following figure shows one example of message order inversion. In this case there is a lot of packet loss. Depending on parameters and timing, as little as one dropped packet might in some situations be enough to cause out-of-order message reception.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Message-order-inversion.png" /&gt;&lt;/p&gt;
&lt;p&gt;To reliably send multiple messages in a row, you can use segmented messages. With segmented messages, the sender is only allowed to send one message at the time. The transmission is considered completed when the message has been ACKed, and then the next message can be sent. Therefore, there is no message order inversion when using segmented messages, regardless of number of relays and amount of packet loss along the way. ACKing of segmented messages is handled by the Bluetooth Mesh stack at the lower transport layer.&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/connectivity/bluetooth/api/mesh/sar_cfg.html"&gt;Segmentation and reassembly (SAR)&lt;/a&gt; for details on segmented messages.&lt;/p&gt;
&lt;p&gt;Please note that the maximum payload for the first segment of a segmented message (8 bytes including opcode) is three bytes less than the maximum payload for an unsegmented message (11 bytes including opcode). This means some messages that originally fits in one unsegmented packet will require two packets when segmented, and therefore take slightly longer to transmit. On the other hand, in the case of a unicast destination, retransmissions are cancelled when ACKed, which means less time is typically spent at the sender end for sending the message.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>