Skip to content

Commit b2bf24c

Browse files
author
Arto Kinnunen
committed
Merge branch 'release_internal' into release_external
* release_internal: (31 commits) Fix errors found from coverity scan (#2386) Added IID for border router info structure LLC secure data duplicate check update and EAPOL relay duplicate fix Remove Thread-protocol from README (#2383) EAPOL relay agent rx filter from joiner side Removed dead code part RPL new parent accept update and NUD operation ETX API update and RPL ETX threshold callback update. Wi-sun keep all candidates alive by NUD. Key storage settings are no longer cleared on delete Changed EAPOL initial-Key retries from 2 to 4 on large NW WS bootstrap: Default CCA threshold to -60dBm (#2377) Created extra large network setup for Wi-SUN Corrected PTK and PMK lifetime handling Cleared EAPOL temporary trace print's. Timed parent selection is now imim-imin*2 earlier there was just 5 seconds randomize. Added check for network name and DODAG ID IID (EUI-64) (#2373) Updated initial key trickles Fixed parent target address set. Updated Discovery and RPL setup large & medium size network ...
2 parents 9a21668 + 0ed25a7 commit b2bf24c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+892
-487
lines changed

README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,29 @@ ARM Mesh networking stack
33

44
This repository contains the ARM mesh networking stack that provides support for the following mesh protocols:
55

6-
* 6LoWPAN with Neighbor Discovery (ND) and Mesh Link Establishment (MLE)
7-
* Thread
8-
* Wi-SUN
6+
* 6LoWPAN with Neighbor Discovery (ND) and Mesh Link Establishment (MLE)
7+
* Wi-SUN
98

10-
All networking stacks are using IEEE 802.15.4 based radios.
9+
All networking stacks are using IEEE 802.15.4 based radios.
1110

1211
The full documentation is hosted in [Mbed OS documentation](https://os.mbed.com/docs/mbed-os/latest/reference/mesh-tech.html).
1312

14-
On mbed OS, mesh networking stacks can be used through [Mbed Mesh API](https://os.mbed.com/docs/mbed-os/latest/apis/mesh-api.html) and [Network Socket API](https://os.mbed.com/docs/mbed-os/v5.11/apis/network-socket.html).
13+
On mbed OS, mesh networking stacks can be used through [Mbed Mesh API](https://os.mbed.com/docs/mbed-os/latest/apis/mesh-api.html) and [Network Socket API](https://os.mbed.com/docs/mbed-os/latest/apis/network-socket.html).
1514

1615
To see, how the mesh networking stack works, check the example application [mbed-os-example-mesh-minimal](https://github.com/ARMmbed/mbed-os-example-mesh-minimal).
1716

18-
19-
##6LoWPAN with ND and MLE
17+
18+
## 6LoWPAN with ND and MLE
2019

2120
This networking stack is using standard 6LoWPAN and uses:
2221

2322
* Neighbor Discovery Protocol ([RFC4861](https://tools.ietf.org/html/rfc4861)) to locate other devices in the mesh network.
2423
* Mesh-Link-Establishment ([draft-kelsey-intarea-mesh-link-establishment-06](https://tools.ietf.org/html/draft-kelsey-intarea-mesh-link-establishment-06)) is used for establishing and configuring secure radio links.
25-
26-
##Thread
27-
Thread is standardized by [Thread group](https://www.threadgroup.org/).
28-
29-
![](docs/img/thread_certified.png)
3024

31-
mbed OS is now a Thread Certified Component. Using IPv6 with 6LoWPAN as the foundation, Thread technology provides a low-power, self-healing mesh network designed for the home.
3225

33-
##Wi-SUN
26+
## Wi-SUN
3427
Wi-SUN (Smart Utility Networks) specification is standardized by [Wi-SUN Alliance](https://www.wi-sun.org/).
3528

36-
Mbed OS release 5.12 contains the initial Mbed Wi-SUN FAN implementation. Functionality of the Mbed Wi-SUN network stack will be updated when the Wi-SUN protocol is specified further.
3729

3830
## License
3931

docs/img/thread_certified.png

-9.92 KB
Binary file not shown.

nanostack/ws_bbr_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ typedef struct bbr_information {
4040
uint8_t dodag_id[16];
4141
/** Address prefix given to devices in network set to 0 if not available*/
4242
uint8_t prefix[8];
43+
/** Address IID of the border router set to 0 if not available*/
44+
uint8_t IID[8];
4345
/** Amount of devices in the network. */
4446
uint16_t devices_in_network;
4547
/** Border router instance identifier defined in RPL */

nanostack/ws_management_api.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,16 @@ extern "C" {
7575
#define CHANNEL_SPACING_100 0x03 // 100 khz
7676
#define CHANNEL_SPACING_250 0x04 // 250 khz
7777

78-
#define NETWORK_SIZE_CERTIFICATE 0x00
79-
#define NETWORK_SIZE_SMALL 0x01
80-
#define NETWORK_SIZE_MEDIUM 0x08
81-
#define NETWORK_SIZE_LARGE 0x10
78+
/*
79+
* Network Size definitions are device amount in hundreds of devices.
80+
* These definitions are meant to give some estimates of sizes. Any value can be given as parameter
81+
*/
82+
83+
#define NETWORK_SIZE_CERTIFICATE 0x00 // Network configuration used in Wi-SUN certification
84+
#define NETWORK_SIZE_SMALL 0x01 // Small networks
85+
#define NETWORK_SIZE_MEDIUM 0x08 // 100 - 800 device networks are medium sized
86+
#define NETWORK_SIZE_LARGE 0x0F // 800 - 1500 device networks are large
87+
#define NETWORK_SIZE_XLARGE 0x19 // 2500+ devices
8288
#define NETWORK_SIZE_AUTOMATIC 0xFF
8389

8490
/** Temporary API change flag. this will be removed when new version of API is implemented on applications
@@ -229,9 +235,9 @@ int ws_management_regulatory_domain_validate(
229235
*
230236
* timing parameters follows the specification example from Wi-SUN specification
231237
*
232-
* Default value: medium
233-
* small network size: hundreds of devices
234-
* Large network size: thousands of devices
238+
* Default value: medium 100 - 800 device
239+
* small network size: less than 100 devices
240+
* Large network size: 800 - 1500 devices
235241
* automatic: when discovering the network network size is learned
236242
* from advertisements and timings adjusted accordingly
237243
*

source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan_bootstrap.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ static void mle_neigh_entry_update_by_mle_tlv_list(int8_t interface_id, mac_neig
588588
uint8_t link_idr;
589589
uint8_t iop_flags;
590590
if (mle_link_quality_tlv_parse(mac64, short_address, mle_tlv_info.dataPtr, mle_tlv_info.tlvLen, &iop_flags, &link_idr)) {
591-
etx_remote_incoming_idr_update(interface_id, link_idr, entry_temp->index);
591+
etx_remote_incoming_idr_update(interface_id, link_idr, entry_temp->index, entry_temp->mac64);
592592

593593
if ((iop_flags & MLE_NEIGHBOR_PRIORITY_LINK) == MLE_NEIGHBOR_PRIORITY_LINK) {
594594
entry_temp->link_role = CHILD_NEIGHBOUR;
@@ -965,9 +965,9 @@ int protocol_6lowpan_router_synch_to_new_router(protocol_interface_info_entry_t
965965
static uint8_t mle_calculate_idr(int8_t interface_id, mle_message_t *mle_msg, mac_neighbor_table_entry_t *entry_temp)
966966
{
967967
if (!entry_temp) {
968-
return etx_lqi_dbm_update(-2, mle_msg->lqi, mle_msg->dbm, 0) >> 3;
968+
return etx_lqi_dbm_update(-2, mle_msg->lqi, mle_msg->dbm, 0, NULL) >> 3;
969969
}
970-
return etx_lqi_dbm_update(interface_id, mle_msg->lqi, mle_msg->dbm, entry_temp->index) >> 3;
970+
return etx_lqi_dbm_update(interface_id, mle_msg->lqi, mle_msg->dbm, entry_temp->index, entry_temp->mac64) >> 3;
971971

972972
}
973973

@@ -1609,7 +1609,7 @@ static void lowpan_neighbor_entry_remove_notify(mac_neighbor_table_entry_t *entr
16091609
}
16101610
mac_helper_devicetable_remove(cur_interface->mac_api, entry_ptr->index, entry_ptr->mac64);
16111611
//Removes ETX neighbor
1612-
etx_neighbor_remove(cur_interface->id, entry_ptr->index);
1612+
etx_neighbor_remove(cur_interface->id, entry_ptr->index, entry_ptr->mac64);
16131613
//Remove MLE frame counter info
16141614
mle_service_frame_counter_entry_delete(cur_interface->id, entry_ptr->index);
16151615

source/6LoWPAN/Thread/thread_bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static void thread_neighbor_remove(mac_neighbor_table_entry_t *entry_ptr, void *
141141

142142
thread_reset_neighbour_info(cur, entry_ptr);
143143
//Removes ETX neighbor
144-
etx_neighbor_remove(cur->id, entry_ptr->index);
144+
etx_neighbor_remove(cur->id, entry_ptr->index, entry_ptr->mac64);
145145
//Remove MLE frame counter info
146146
mle_service_frame_counter_entry_delete(cur->id, entry_ptr->index);
147147
}

source/6LoWPAN/adaptation_interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static void lowpan_adaptation_etx_update_cb(protocol_interface_info_entry_t *cur
155155
// Gets table entry
156156
mac_neighbor_table_entry_t *neigh_table_ptr = mac_neighbor_table_address_discover(mac_neighbor_info(cur), buf->dst_sa.address + PAN_ID_LEN, buf->dst_sa.addr_type);
157157
if (neigh_table_ptr) {
158-
etx_transm_attempts_update(cur->id, 1 + confirm->tx_retries, success, neigh_table_ptr->index);
158+
etx_transm_attempts_update(cur->id, 1 + confirm->tx_retries, success, neigh_table_ptr->index, neigh_table_ptr->mac64);
159159
// Updates ETX statistics
160160
etx_storage_t *etx_entry = etx_storage_entry_get(cur->id, neigh_table_ptr->index);
161161
if (etx_entry) {

source/6LoWPAN/ws/ws_bbr_api.c

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "ns_types.h"
2121
#include "ns_trace.h"
2222
#include "net_interface.h"
23+
#include "socket_api.h"
2324
#include "eventOS_event.h"
2425
#include "NWK_INTERFACE/Include/protocol.h"
2526
#include "6LoWPAN/Bootstraps/protocol_6lowpan.h"
@@ -94,7 +95,16 @@ static void ws_bbr_rpl_version_timer_start(protocol_interface_info_entry_t *cur,
9495
//stable version for RPL so slow timer update is ok
9596
cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME;
9697
} else {
97-
cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME_RESTART;
98+
if (cur->ws_info->cfg->gen.network_size <= NETWORK_SIZE_SMALL) {
99+
// handles also NETWORK_SIZE_CERTIFICATE
100+
cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME_RESTART_SMALL;
101+
} else if (cur->ws_info->cfg->gen.network_size <= NETWORK_SIZE_MEDIUM) {
102+
cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME_RESTART_MEDIUM;
103+
} else if (cur->ws_info->cfg->gen.network_size <= NETWORK_SIZE_LARGE) {
104+
cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME_RESTART_LARGE;
105+
} else {
106+
cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME_RESTART_EXTRA_LARGE;
107+
}
98108
}
99109
}
100110

@@ -232,7 +242,10 @@ static if_address_entry_t *ws_bbr_slaac_generate(protocol_interface_info_entry_t
232242

233243
static void ws_bbr_slaac_remove(protocol_interface_info_entry_t *cur, uint8_t *ula_prefix)
234244
{
235-
icmpv6_slaac_prefix_update(cur, ula_prefix, 64, 0, 0);
245+
if (cur) {
246+
icmpv6_slaac_prefix_update(cur, ula_prefix, 64, 0, 0);
247+
}
248+
236249
addr_policy_table_delete_entry(ula_prefix, 64);
237250
}
238251

@@ -361,14 +374,16 @@ static void ws_bbr_dhcp_server_start(protocol_interface_info_entry_t *cur, uint8
361374
}
362375
static void ws_bbr_dhcp_server_stop(protocol_interface_info_entry_t *cur, uint8_t *global_id)
363376
{
377+
if (!cur) {
378+
return;
379+
}
364380
uint8_t temp_address[16];
365381
memcpy(temp_address, global_id, 8);
366382
memset(temp_address + 8, 0, 8);
367383
tr_debug("DHCP server deactivate %s", trace_ipv6(temp_address));
368384
DHCPv6_server_service_delete(cur->id, global_id, false);
369385
//Delete Client
370386
dhcp_client_global_address_delete(cur->id, NULL, temp_address);
371-
372387
}
373388

374389
static void ws_bbr_routing_stop(protocol_interface_info_entry_t *cur)
@@ -632,6 +647,11 @@ uint16_t test_pan_size_override = 0xffff;
632647
uint16_t ws_bbr_pan_size(protocol_interface_info_entry_t *cur)
633648
{
634649
uint16_t result = 0;
650+
651+
if (!cur || !cur->rpl_domain) {
652+
return 0;
653+
}
654+
635655
if (test_pan_size_override != 0xffff) {
636656
return test_pan_size_override;
637657
}
@@ -710,7 +730,6 @@ void ws_bbr_stop(int8_t interface_id)
710730
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
711731

712732
ws_bbr_routing_stop(cur);
713-
714733
backbone_interface_id = -1;
715734
current_instance_id++;
716735

@@ -764,6 +783,13 @@ int ws_bbr_info_get(int8_t interface_id, bbr_information_t *info_ptr)
764783
memcpy(info_ptr->dodag_id, current_dodag_id, 16);
765784
memcpy(info_ptr->prefix, current_global_prefix, 8);
766785

786+
// Get the Wi-SUN interface generated address that is used in the RF interface.
787+
const uint8_t *wisun_if_addr = addr_select_with_prefix(cur, current_global_prefix, 64, SOCKET_IPV6_PREFER_SRC_PUBLIC);
788+
789+
if (wisun_if_addr) {
790+
memcpy(info_ptr->IID, wisun_if_addr + 8, 8);
791+
}
792+
767793
info_ptr->devices_in_network = ws_bbr_pan_size(cur);
768794
info_ptr->instance_id = current_instance_id;
769795
info_ptr->version = dodag_info.version_num;

0 commit comments

Comments
 (0)