Detecting mesh retransmitted packets at the application layer in Zephyr

I have a custom model that subscribes to messages from other devices. I'd like to detect if a  mesh message that is received, is the original or a retransmission so I can filter out duplicates
I saw in the log that this info is available at the mesh stack level  but is it possible to access it at the application level?
Thanks

  • Hi,

    Filtering out duplicates should be an already implemented. To avoid messages being repeatedly forwarded by the same relays, all mesh devices maintain a message cache. This cache is used for filtering out packets that the device has already handled. 

  • That's not what I'm seeing

    The custom model has an opcode defined as follows

    const struct bt_mesh_model_op _vnd_model_ops[] = {
        {BT_MESH_MODEL_OP_3(0x11, COMPANY_CID), BT_MESH_LEN_EXACT(8),  vnd_set_unack},
        BT_MESH_MODEL_OP_END,
    };
    int vnd_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx,struct net_buf_simple *buf)
    {
       
        LOG_DBG("Got packet from %x",ctx->addr);
     
        return 0;
    }
    ------------------------
    I provision 1 device and configure it to publish to a certain address with the publish period of 10 seconds, TTL 300 and retransmit count 3
    Provision the second device to subscribe to the same address
    On the second device the function vnd_set_unack is invoked  every 10 seconds 3 times and  I see 3 debug messages in the log. I'm working on setting up the test to provide the log. 
    In the meantime question
    Are there any hooks into the message cache at the application level?
    Thanks
  • Here is a log from a device receiving duplicates from 0x001c

    0x001c  is configured  to publish with retransmit count 2 and ttl 7

    There are " Duplicate found in Network Message Cache" messages  followed by  "bt_mesh_net: bt_mesh_net_decode: Unable to find matching net for packet"

    Perhaps this is a clue ?

    Thanks

    -----------------------------------------------------------------

    00> [00:00:08.416,076] <inf> main_c: version=v_255.255.255, commit=d2d707d+, build date=2022-06-23T08:49:18-0700

    00> [00:00:08.423,431] <inf> fs_nvs: 3 Sectors of 4096 bytes
    00> [00:00:08.423,461] <inf> fs_nvs: alloc wra: 0, fe8
    00> [00:00:08.423,461] <inf> fs_nvs: data wra: 0, 0
    00> [00:00:08.423,492] <wrn> flash_data_c: read failed (-2), writing defaults.
    00> [00:00:08.423,522] <wrn> flash_data_c: reset defaults
    00> [00:00:08.432,189] <inf> fs_nvs: 8 Sectors of 4096 bytes
    00> [00:00:08.432,220] <inf> fs_nvs: alloc wra: 0, fe8
    00> [00:00:08.432,220] <inf> fs_nvs: data wra: 0, 0
    00> [00:00:08.438,354] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    00> [00:00:08.438,385] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    00> [00:00:08.438,415] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.7 Build 99
    00> [00:00:08.438,720] <inf> bt_hci_core: No ID address. App must call settings_load()
    00> 0m
    00> [0m
    00>
    00>
    00>
    00> [00:01:56.325,439] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -62 net_if 0
    00> [00:01:56.325,531] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 68f618ff178f4c48fb737892a5fe62912cb186b97955e74da92a85a1c8
    00> [00:01:56.325,531] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:01:56.325,531] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:01:56.325,561] <dbg> bt_mesh_net: net_decrypt: src 0x001c
    00> [00:01:56.325,653] <dbg> bt_mesh_net: bt_mesh_net_decode: Decryption successful. Payload len 25
    00> [00:01:56.325,683] <dbg> bt_mesh_net: bt_mesh_net_decode: src 0x001c dst 0xc002 ttl 7
    00> [00:01:56.325,714] <dbg> bt_mesh_net: bt_mesh_net_decode: PDU: 6807000166001cc0026328667b4cea9f2196adfa74b397031c
    00> [00:01:56.325,744] <dbg> bt_mesh_transport: bt_mesh_trans_recv: src 0x001c dst 0xc002 seq 0x00000166 friend_match 0
    00> [00:01:56.325,775] <dbg> bt_mesh_transport: bt_mesh_trans_recv: Payload 6328667b4cea9f2196adfa74b397031c
    00> [00:01:56.325,805] <dbg> bt_mesh_transport: trans_unseg: AFK 1 AID 0x23
    00> [00:01:56.325,836] <dbg> bt_mesh_transport: sdu_recv: AKF 1 AID 0x23
    00> [00:01:56.325,927] <dbg> bt_mesh_transport: sdu_recv: Decrypted (AppIdx: 0x000)
    00> [00:01:56.325,927] <dbg> bt_mesh_access: bt_mesh_model_recv: app_idx 0x0000 src 0x001c dst 0xc002
    00> [00:01:56.325,958] <dbg> bt_mesh_access: bt_mesh_model_recv: len 11: d10a0a6400194006b85c2e
    00> [00:01:56.325,988] <dbg> bt_mesh_access: bt_mesh_model_recv: OpCode 0x00d10a0a
    00> [00:01:56.467,102] <dbg> bt_mesh_net: bt_mesh_net_relay: TTL 7 CTL 0 dst 0xc002
    00> [00:01:56.467,132] <dbg> bt_mesh_net: bt_mesh_net_relay: Relaying packet. TTL is now 6
    00> [00:01:56.467,437] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -63 net_if 0
    00> [00:01:56.467,498] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -73 net_if 0
    00> [00:01:56.467,559] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 6864900b1cb2d6e1f6b5b1ae19024b022c82af640e26d05297bc8de8fa
    00> [00:01:56.467,590] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:01:56.467,590] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:01:56.467,620] <dbg> bt_mesh_net: net_decrypt: Duplicate found in Network Message Cache
    00> [00:01:56.467,620] <dbg> bt_mesh_net: bt_mesh_net_decode: Unable to find matching net for packet
    00> [00:01:56.467,712] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -73 net_if 0
    00> [00:01:56.467,773] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -64 net_if 0
    00> [00:01:56.625,457] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -64 net_if 0
    00> [00:01:56.625,549] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 680356b387a9a34d74347a7444146254c0501ee52a4e88d384c81b7666
    00> [00:01:56.625,549] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:01:56.625,579] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:01:56.625,610] <dbg> bt_mesh_net: net_decrypt: src 0x001c
    00> [00:01:56.625,701] <dbg> bt_mesh_net: bt_mesh_net_decode: Decryption successful. Payload len 25
    00> [00:01:56.625,701] <dbg> bt_mesh_net: bt_mesh_net_decode: src 0x001c dst 0xc002 ttl 7
    00> [00:01:56.625,762] <dbg> bt_mesh_net: bt_mesh_net_decode: PDU: 6807000167001cc0026328015869ce9eea3d48d994103903ef
    00> [00:01:56.625,762] <dbg> bt_mesh_transport: bt_mesh_trans_recv: src 0x001c dst 0xc002 seq 0x00000167 friend_match 0
    00> [00:01:56.625,823] <dbg> bt_mesh_transport: bt_mesh_trans_recv: Payload 6328015869ce9eea3d48d994103903ef
    00> [00:01:56.625,823] <dbg> bt_mesh_transport: trans_unseg: AFK 1 AID 0x23
    00> [00:01:56.625,885] <dbg> bt_mesh_transport: sdu_recv: AKF 1 AID 0x23
    00> [00:01:56.625,946] <dbg> bt_mesh_transport: sdu_recv: Decrypted (AppIdx: 0x000)
    00> [00:01:56.625,946] <dbg> bt_mesh_access: bt_mesh_model_recv: app_idx 0x0000 src 0x001c dst 0xc002
    00> [00:01:56.626,007] <dbg> bt_mesh_access: bt_mesh_model_recv: len 11: d10a0a6400194006b85c2e
    00> [00:01:56.626,007] <dbg> bt_mesh_access: bt_mesh_model_recv: OpCode 0x00d10a0a
    00> [00:01:56.767,456] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> --- 4 messages dropped ---
    00> [00:01:56.767,486] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:01:56.767,517] <dbg> bt_mesh_net: net_decrypt: Duplicate found in Network Message Cache
    00> [00:01:56.767,517] <dbg> bt_mesh_net: bt_mesh_net_decode: Unable to find matching net for packet
    00> [00:01:56.767,761] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -64 net_if 0
    00> [00:01:56.767,852] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -70 net_if 0
    00> [00:01:56.767,913] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -60 net_if 0
    00> [00:01:56.768,005] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -73 net_if 0
    00> [00:01:56.768,096] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -63 net_if 0
    00> [00:01:56.768,157] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 68a686f7e1deeee6021e2f6a38c8d74a318fb5ccaf6d1813df45a4aeb2
    00> [00:01:56.768,157] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:01:56.768,157] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:01:56.768,218] <dbg> bt_mesh_net: net_decrypt: src 0x001c
    00> [00:01:56.768,280] <dbg> bt_mesh_net: bt_mesh_net_decode: Decryption successful. Payload len 25
    00> [00:01:56.768,310] <dbg> bt_mesh_net: bt_mesh_net_decode: src 0x001c dst 0xc002 ttl 7
    00> [00:01:56.768,341] <dbg> bt_mesh_net: bt_mesh_net_decode: PDU: 6807000168001cc00263e06871ff8ac6b8e40513b4456cd1f8
    00> [00:01:56.768,371] <dbg> bt_mesh_transport: bt_mesh_trans_recv: src 0x001c dst 0xc002 seq 0x00000168 friend_match 0
    00> [00:01:56.768,432] <dbg> bt_mesh_transport: bt_mesh_trans_recv: Payload 63e06871ff8ac6b8e40513b4456cd1f8
    00> [00:01:56.768,432] <dbg> bt_mesh_transport: trans_unseg: AFK 1 AID 0x23
    00> [00:01:56.768,463] <dbg> bt_mesh_transport: sdu_recv: AKF 1 AID 0x23
    00> [00:01:56.768,524] <dbg> bt_mesh_transport: sdu_recv: Decrypted (AppIdx: 0x000)
    00> [00:01:56.768,554] <dbg> bt_mesh_access: bt_mesh_model_recv: app_idx 0x0000 src 0x001c dst 0xc002
    00> [00:01:56.768,585] <dbg> bt_mesh_access: bt_mesh_model_recv: len 11: d30a0affffff647d702d0d
    00> [00:01:56.768,615] <dbg> bt_mesh_access: bt_mesh_model_recv: OpCode 0x00d30a0a
    00> [00:01:56.922,790] <dbg> bt_mesh_net: bt_mesh_net_relay: TTL 7 CTL 0 dst 0xc002
    00> [00:01:56.922,821] <dbg> bt_mesh_net: bt_mesh_net_relay: Relaying packet. TTL is now 6
    00> [00:01:56.975,158] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -63 net_if 0
    00> [00:01:56.975,250] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 6877ad6a80c08e54521f078744ddc51bcd3d0df8a39659b194d238fa22
    00> [00:01:56.975,250] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:01:56.975,250] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:01:56.975,280] <dbg> bt_mesh_net: net_decrypt: src 0x001c
    00> [00:01:56.975,372] <dbg> bt_mesh_net: bt_mesh_net_decode: Decryption successful. Payload len 25
    00> [00:01:56.975,372] <dbg> bt_mesh_net: bt_mesh_net_decode: src 0x001c dst 0xc002 ttl 7
    00> [00:01:56.975,433] <dbg> bt_mesh_net: bt_mesh_net_decode: PDU: 6807000169001cc00263ba76104a78665ffe063e96cb0357ed
    00> [00:01:56.975,463] <dbg> bt_mesh_transport: bt_mesh_trans_recv: src 0x001c dst 0xc002 seq 0x00000169 friend_match 0
    00> [00:01:56.975,524] <dbg> bt_mesh_transport: bt_mesh_trans_recv: Payload 63ba76104a78665ffe063e96cb0357ed
    00> [00:01:56.975,524] <dbg> bt_mesh_transport: trans_unseg: AFK 1 AID 0x23
    00> [00:01:56.975,555] <dbg> bt_mesh_transport: sdu_recv: AKF 1 AID 0x23
    00> [00:01:56.975,616] <dbg> bt_mesh_transport: sdu_recv: Decrypted (AppIdx: 0x000)
    00> [00:01:56.975,646] <dbg> bt_mesh_access: bt_mesh_model_recv: app_idx 0x0000 src 0x001c dst 0xc002
    00> [00:01:56.975,677] <dbg> bt_mesh_access: bt_mesh_model_recv: len 11: d30a0affffff647d702d0d
    00> [00:01:56.975,708] <dbg> bt_mesh_access: bt_mesh_model_recv: OpCode 0x00d30a0a
    00> [00:01:57.129,791] <dbg> bt_mesh_net: bt_mesh_net_relay: TTL 7 CTL 0 dst 0xc002
    00> [00:01:57.129,821] <dbg> bt_mesh_net: bt_mesh_net_relay: Relaying packet. TTL is now 6
    00> [00:01:57.129,974] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -72 net_if 0
    00> [00:01:57.130,035] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 6832c5fb0cb76a77289e0e442a5b2ba7c8081ac4dff9fb26c596ce95e7
    00> [00:01:57.130,065] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:01:57.130,065] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:01:57.130,096] <dbg> bt_mesh_net: net_decrypt: Duplicate found in Network Message Cache
    00> [00:01:57.130,126] <dbg> bt_mesh_net: bt_mesh_net_decode: Unable to find matching net for packet
    00> [00:01:57.130,249] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -73 net_if 0
    00> [00:01:57.130,340] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -63 net_if 0
    00> [00:01:57.130,401] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -72 net_if 0
    00> [00:02:03.551,025] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -76 net_if 0
    00> [00:02:03.551,086] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 689634563295c96ada01945e79ab3c64996c8997529c293f7c4b30a72e
    00> [00:02:03.551,116] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:02:03.551,116] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:02:03.551,147] <dbg> bt_mesh_net: net_decrypt: src 0x0064
    00> [00:02:03.551,239] <dbg> bt_mesh_net: bt_mesh_net_decode: Decryption successful. Payload len 25
    00> [00:02:03.551,239] <dbg> bt_mesh_net: bt_mesh_net_decode: src 0x0064 dst 0xc002 ttl 7
    00> [00:02:03.551,300] <dbg> bt_mesh_net: bt_mesh_net_decode: PDU: 680700050f0064c00263b091da413afd75848a5f2864f67168
    00> [00:02:03.551,330] <dbg> bt_mesh_transport: bt_mesh_trans_recv: src 0x0064 dst 0xc002 seq 0x0000050f friend_match 0
    00> [00:02:03.551,361] <dbg> bt_mesh_transport: bt_mesh_trans_recv: Payload 63b091da413afd75848a5f2864f67168
    00> [00:02:03.551,391] <dbg> bt_mesh_transport: trans_unseg: AFK 1 AID 0x23
    00> [00:02:03.551,422] <dbg> bt_mesh_transport: sdu_recv: AKF 1 AID 0x23
    00> [00:02:03.551,483] <dbg> bt_mesh_transport: sdu_recv: Decrypted (AppIdx: 0x000)
    00> [00:02:03.551,513] <dbg> bt_mesh_access: bt_mesh_model_recv: app_idx 0x0000 src 0x0064 dst 0xc002
    00> [00:02:03.551,544] <dbg> bt_mesh_access: bt_mesh_model_recv: len 11: d30a0affffff647d702d0d
    00> [00:02:03.551,544] <dbg> bt_mesh_access: bt_mesh_model_recv: OpCode 0x00d30a0a
    00> [00:02:03.707,794] <dbg> bt_mesh_net: bt_mesh_net_relay: TTL 7 CTL 0 dst 0xc002
    00> [00:02:03.707,824] <dbg> bt_mesh_net: bt_mesh_net_relay: Relaying packet. TTL is now 6
    00> [00:02:03.708,007] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -64 net_if 0
    00> [00:02:03.708,068] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 6827eb2af47d4a4d66a34a743d07e8ff3d095e2a0761a7815c3b0e06bf
    00> [00:02:03.708,068] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:02:03.708,099] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:02:03.708,129] <dbg> bt_mesh_net: net_decrypt: Duplicate found in Network Message Cache
    00> [00:02:03.708,129] <dbg> bt_mesh_net: bt_mesh_net_decode: Unable to find matching net for packet
    00> [00:02:03.708,190] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -64 net_if 0
    00> [00:02:03.708,404] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -71 net_if 0
    00> [00:02:03.708,465] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -61 net_if 0
    00> [00:02:03.850,616] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -74 net_if 0
    00> [00:02:03.850,677] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 688b5a07ee6d470e6987c258fe014ef4e2ec1d3072b971ea619b8a0172
    00> [00:02:03.850,708] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:02:03.850,708] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:02:03.850,738] <dbg> bt_mesh_net: net_decrypt: src 0x0064
    00> [00:02:03.850,830] <dbg> bt_mesh_net: bt_mesh_net_decode: Decryption successful. Payload len 25
    00> [00:02:03.850,830] <dbg> bt_mesh_net: bt_mesh_net_decode: src 0x0064 dst 0xc002 ttl 7
    00> [00:02:03.850,891] <dbg> bt_mesh_net: bt_mesh_net_decode: PDU: 68070005100064c00263745611252816528460bdb3b33bd12f
    00> [00:02:03.850,921] <dbg> bt_mesh_transport: bt_mesh_trans_recv: src 0x0064 dst 0xc002 seq 0x00000510 friend_match 0
    00> [00:02:03.850,952] <dbg> bt_mesh_transport: bt_mesh_trans_recv: Payload 63745611252816528460bdb3b33bd12f
    00> [00:02:03.850,982] <dbg> bt_mesh_transport: trans_unseg: AFK 1 AID 0x23
    00> [00:02:03.851,013] <dbg> bt_mesh_transport: sdu_recv: AKF 1 AID 0x23
    00> [00:02:03.851,074] <dbg> bt_mesh_transport: sdu_recv: Decrypted (AppIdx: 0x000)
    00> [00:02:03.851,104] <dbg> bt_mesh_access: bt_mesh_model_recv: app_idx 0x0000 src 0x0064 dst 0xc002
    00> [00:02:03.851,135] <dbg> bt_mesh_access: bt_mesh_model_recv: len 11: d30a0affffff647d702d0d
    00> [00:02:03.851,135] <dbg> bt_mesh_access: bt_mesh_model_recv: OpCode 0x00d30a0a
    00> [00:02:04.007,324] <dbg> bt_mesh_net: bt_mesh_net_relay: TTL 7 CTL 0 dst 0xc002
    00> [00:02:04.007,354] <dbg> bt_mesh_net: bt_mesh_net_relay: Relaying packet. TTL is now 6
    00> [00:02:04.007,598] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -74 net_if 0
    00> [00:02:04.007,659] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -71 net_if 0
    00> [00:02:04.007,720] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 680b3b89fea003747a674ed66785c8ee780a9a4ab997facad15307895b
    00> [00:02:04.007,751] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:02:04.007,751] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:02:04.007,781] <dbg> bt_mesh_net: net_decrypt: Duplicate found in Network Message Cache
    00> [00:02:04.007,781] <dbg> bt_mesh_net: bt_mesh_net_decode: Unable to find matching net for packet
    00> [00:02:04.007,934] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -61 net_if 0
    00> [00:02:04.007,995] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -70 net_if 0
    00> [00:02:06.325,042] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -61 net_if 0
    00> [00:02:06.325,103] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 68a1368b0c0d6f5ef625851600fd1344e4eb417ebe266ad6f1e182dfd7
    00> [00:02:06.325,134] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:02:06.325,134] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:02:06.325,164] <dbg> bt_mesh_net: net_decrypt: src 0x001c
    00> [00:02:06.325,256] <dbg> bt_mesh_net: bt_mesh_net_decode: Decryption successful. Payload len 25
    00> [00:02:06.325,256] <dbg> bt_mesh_net: bt_mesh_net_decode: src 0x001c dst 0xc002 ttl 7
    00> [00:02:06.325,317] <dbg> bt_mesh_net: bt_mesh_net_decode: PDU: 680700016a001cc00263000446128e8abb57032d094e5ceb85
    00> [00:02:06.325,347] <dbg> bt_mesh_transport: bt_mesh_trans_recv: src 0x001c dst 0xc002 seq 0x0000016a friend_match 0
    00> [00:02:06.325,378] <dbg> bt_mesh_transport: bt_mesh_trans_recv: Payload 63000446128e8abb57032d094e5ceb85
    00> [00:02:06.325,378] <dbg> bt_mesh_transport: trans_unseg: AFK 1 AID 0x23
    00> [00:02:06.325,439] <dbg> bt_mesh_transport: sdu_recv: AKF 1 AID 0x23
    00> [00:02:06.325,500] <dbg> bt_mesh_transport: sdu_recv: Decrypted (AppIdx: 0x000)
    00> [00:02:06.325,500] <dbg> bt_mesh_access: bt_mesh_model_recv: app_idx 0x0000 src 0x001c dst 0xc002
    00> [00:02:06.325,561] <dbg> bt_mesh_access: bt_mesh_model_recv: len 11: d10a0a6400194006b85c2e
    00> [00:02:06.325,561] <dbg> bt_mesh_access: bt_mesh_model_recv: OpCode 0x00d10a0a
    00> [00:02:06.466,583] <dbg> bt_mesh_net: bt_mesh_net_relay: TTL 7 CTL 0 dst 0xc002
    00> [00:02:06.466,613] <dbg> bt_mesh_net: bt_mesh_net_relay: Relaying packet. TTL is now 6
    00> [00:02:06.466,796] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -70 net_if 0
    00> [00:02:06.466,857] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 681687bf0298cd38ea5834f6964a98a544ed7d3ffe629b0376412bc028
    00> [00:02:06.466,857] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:02:06.466,888] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:02:06.466,918] <dbg> bt_mesh_net: net_decrypt: Duplicate found in Network Message Cache
    00> [00:02:06.466,918] <dbg> bt_mesh_net: bt_mesh_net_decode: Unable to find matching net for packet
    00> [00:02:06.466,979] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -73 net_if 0
    00> [00:02:06.467,376] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -73 net_if 0
    00> [00:02:06.467,468] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -68 net_if 0
    00> [00:02:06.626,220] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -63 net_if 0
    00> [00:02:06.626,281] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 682b3a7b160892c6f8efe4f17b5281c2fa15dac79a47b4dc3594c74c1c
    00> [00:02:06.626,312] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:02:06.626,312] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:02:06.626,342] <dbg> bt_mesh_net: net_decrypt: src 0x001c
    00> [00:02:06.626,434] <dbg> bt_mesh_net: bt_mesh_net_decode: Decryption successful. Payload len 25
    00> [00:02:06.626,434] <dbg> bt_mesh_net: bt_mesh_net_decode: src 0x001c dst 0xc002 ttl 7
    00> [00:02:06.626,495] <dbg> bt_mesh_net: bt_mesh_net_decode: PDU: 680700016b001cc002631e80f6091f4f79d7167bf3b1db7753
    00> [00:02:06.626,525] <dbg> bt_mesh_transport: bt_mesh_trans_recv: src 0x001c dst 0xc002 seq 0x0000016b friend_match 0
    00> [00:02:06.626,556] <dbg> bt_mesh_transport: bt_mesh_trans_recv: Payload 631e80f6091f4f79d7167bf3b1db7753
    00> [00:02:06.626,586] <dbg> bt_mesh_transport: trans_unseg: AFK 1 AID 0x23
    00> [00:02:06.626,617] <dbg> bt_mesh_transport: sdu_recv: AKF 1 AID 0x23
    00> [00:02:06.626,678] <dbg> bt_mesh_transport: sdu_recv: Decrypted (AppIdx: 0x000)
    00> [00:02:06.626,708] <dbg> bt_mesh_access: bt_mesh_model_recv: app_idx 0x0000 src 0x001c dst 0xc002
    00> [00:02:06.626,739] <dbg> bt_mesh_access: bt_mesh_model_recv: len 11: d10a0a6400194006b85c2e
    00> [00:02:06.626,739] <dbg> bt_mesh_access: bt_mesh_model_recv: OpCode 0x00d10a0a
    00> [00:02:06.767,791] <dbg> bt_mesh_net: bt_mesh_net_relay: TTL 7 CTL 0 dst 0xc002
    00> [00:02:06.767,822] <dbg> bt_mesh_net: bt_mesh_net_relay: Relaying packet. TTL is now 6
    00> [00:02:06.768,005] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -73 net_if 0
    00> [00:02:06.768,066] <dbg> bt_mesh_net: bt_mesh_net_decode: 29 bytes: 68332c35924d2fd74693a6509f73d62928c69deb4caa0f076c778e795a
    00> [00:02:06.768,066] <dbg> bt_mesh_net: net_decrypt: NID 0x68
    00> [00:02:06.768,096] <dbg> bt_mesh_net: net_decrypt: IVI 0 net->iv_index 0x00000000
    00> [00:02:06.768,127] <dbg> bt_mesh_net: net_decrypt: Duplicate found in Network Message Cache
    00> [00:02:06.768,127] <dbg> bt_mesh_net: bt_mesh_net_decode: Unable to find matching net for packet
    00> [00:02:06.768,188] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -72 net_if 0
    00> [00:02:06.768,280] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -67 net_if 0
    00> [00:02:06.768,402] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -73 net_if 0
    00> [00:02:06.768,676] <dbg> bt_mesh_net: bt_mesh_net_recv: rssi -61 net_if 0
    (Connection lost)

  • Hi,

    I have talked to our developer and it seems the message cache will not catch retransmissions done by the access layer. As per BT SIGs website, all actions which are consequences of receiving mesh messages should be idempotent. www.bluetooth.com/.../

    If the action by its nature is not idempotent, the common way to make it idempotent is to include a TID field in the custom message payload.

    The details will be up to the application, but it is the responsibility of the application (and custom model) to ensure idempotence. The actual filtering of the duplicates is something you have to implement yourself.

  • Is there any API that would allow the application to query the access layer  to find out if a packet is a duplicate?

    Thanks

Related