Re: Replay protection


Steve Brown
 

Hi Johan,

On Sat, 2017-12-09 at 22:19 +0200, Johan Hedberg wrote:
Hi Steve,

On Sat, Dec 09, 2017, Steve Brown wrote:
Is replay protection implemented?
Yes, take a look at is_replay() in transport.c

The reason for the question is that my server is receiving both the
initial publish transmit as well as the subsequent retransmits.
Are these network layer retransmits (Network Transmit state-induced)
or
caused by Publish Retransmit? If it's the latter, then the behavior
is
as expected since Publish Retransmit is supposed to encode a new
message
each time, i.e. each transmission has a new sequence number (I've had
to
double-check this with the Mesh Working Group since it's a bit
unclear
in the spec).

Johan
These are publish retransmits. However, the transaction ID's in the
received messages are all the same. It's the "trans_id" field in the
log in my earlier post.

An upper layer, like my server, getting multiple messages with the same
sequence number isn't what I'd expect. What am I missing?

I'll look further at is_replay().

Below is a more extensive log.

Steve

pin: 0x00001000
pin: 0x00001000 sw: 1 onoff: 00
button_send_pressed pub cli onoff: 0x0001 sw_idx: 0x0001
gen_onoff_set
gen_onoff_set_unack elem: 0x00 state: 0x01 trans_id: 0x0e src: 0x0101
gen_onoff_get elem: 0x0000 onoff: 0x01
Node 0x0101 received OnOff status from 0x0100 with state 0x01
gen_onoff_set
gen_onoff_set_unack elem: 0x00 state: 0x01 trans_id: 0x0e src: 0x0101
gen_onoff_get elem: 0x0000 onoff: 0x01
Node 0x0101 received OnOff status from 0x0100 with state 0x01
gen_onoff_set
gen_onoff_set_unack elem: 0x00 state: 0x01 trans_id: 0x0e src: 0x0101
gen_onoff_get elem: 0x0000 onoff: 0x01
Node 0x0101 received OnOff status fropin: 0x00001000
m 0x0100 with state 0x01
pin: 0x00001000 sw: 1 onoff: 01
button_send_pressed pub cli onoff: 0x0000 sw_idx: 0x0001
gen_onoff_set
gen_onoff_set_unack elem: 0x00 state: 0x00 trans_id: 0x0f src: 0x0101
gen_onoff_get elem: 0x0000 onoff: 0x00
Node 0x0101 received OnOff status from 0x0100 with state 0x00
gen_onoff_set
gen_onoff_set_unack elem: 0x00 state: 0x00 trans_id: 0x0f src: 0x0101
gen_onoff_get elem: 0x0000 onoff: 0x00
Node 0x0101 received OnOff status from 0x0100 with state 0x00
gen_onoff_set
gen_onoff_set_unack elem: 0x00 state: 0x00 trans_id: 0x0f src: 0x0101
gen_onoff_get elem: 0x0000 onoff: 0x00
Node 0x0101 received OnOff status from 0x0100 with state 0x00

Join devel@lists.zephyrproject.org to automatically receive all group messages.