1.. _bluetooth_mesh_core:
2
3Core
4####
5
6The core provides functionality for managing the general Bluetooth mesh
7state.
8
9Low Power Node
10**************
11
12The Low Power Node (LPN) role allows battery powered devices to participate in
13a mesh network as a leaf node. An LPN interacts with the mesh network through
14a Friend node, which is responsible for relaying any messages directed to the
15LPN. The LPN saves power by keeping its radio turned off, and only wakes up to
16either send messages or poll the Friend node for any incoming messages.
17
18The radio control and polling is managed automatically by the mesh stack, but
19the LPN API allows the application to trigger the polling at any time through
20:c:func:`bt_mesh_lpn_poll`. The LPN operation parameters, including poll
21interval, poll event timing and Friend requirements is controlled through the
22:kconfig:`CONFIG_BT_MESH_LOW_POWER` option and related configuration options.
23
24Replay Protection List
25**********************
26
27The Replay Protection List (RPL) is used to hold recently received sequence
28numbers from elements within the mesh network to perform protection against
29replay attacks.
30
31To keep a node protected against replay attacks after reboot, it needs to store
32the entire RPL in the persistent storage before it is powered off. Depending on
33the amount of traffic in a mesh network, storing recently seen sequence numbers
34can make flash wear out sooner or later. To mitigate this,
35@ref CONFIG_BT_MESH_RPL_STORE_TIMEOUT can be used. This option postpones
36storing of RPL entries in the persistent storage.
37
38This option, however, doesn't completely solve the issue as the node may
39get powered off before the timer to store the RPL is fired. To ensure that
40messages can not be replayed, the node can initiate storage of the pending
41RPL entry (or entries) at any time (or sufficiently before power loss)
42by calling @ref bt_mesh_rpl_pending_store. This is up to the node to decide,
43which RPL entries are to be stored in this case.
44
45Setting @ref CONFIG_BT_MESH_RPL_STORE_TIMEOUT to -1 allows to completely
46switch off the timer, which can help to significantly reduce flash wear out.
47This moves the responsibility of storing RPL to the user application and
48requires that sufficient power backup is available from the time this API
49is called until all RPL entries are written to the flash.
50
51Finding the right balance between @ref CONFIG_BT_MESH_RPL_STORE_TIMEOUT and
52calling @ref bt_mesh_rpl_pending_store may reduce a risk of security
53volnurability and flash wear out.
54
55API reference
56**************
57
58.. doxygengroup:: bt_mesh
59