Skip to content

Commit 8160d86

Browse files
author
Mika Tervonen
committed
Added support for wisun multicast
Fixed trickle define Set MPL parameters for Wi-SUN multicast Subscribe to site local all routers and all nodes address Added trace for receving icmp echo packet
1 parent 35b39f4 commit 8160d86

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "6LoWPAN/MAC/mac_data_poll.h"
3434
#include "6LoWPAN/MAC/mpx_api.h"
3535
#include "6LoWPAN/MAC/mac_ie_lib.h"
36+
#include "MPL/mpl.h"
3637
#include "6LoWPAN/ws/ws_common_defines.h"
3738
#include "6LoWPAN/ws/ws_config.h"
3839
#include "6LoWPAN/ws/ws_common.h"
@@ -64,11 +65,11 @@
6465

6566
#ifdef HAVE_WS
6667

67-
#define TRIGLE_IMIN_60_SECS (60 * 10) //
68+
#define TRICKLE_IMIN_60_SECS (60 * 10) //
6869

6970
static const trickle_params_t trickle_params_pan_discovery = {
70-
.Imin = TRIGLE_IMIN_60_SECS, /* 60 second; ticks are 1s */
71-
.Imax = TRIGLE_IMIN_60_SECS << 4, /* 960 seconds 16 min*/
71+
.Imin = TRICKLE_IMIN_60_SECS, /* 60 second; ticks are 1s */
72+
.Imax = TRICKLE_IMIN_60_SECS << 4, /* 960 seconds 16 min*/
7273
.k = 1, /* 1 */
7374
.TimerExpirations = TRICKLE_EXPIRATIONS_INFINITE
7475
};
@@ -596,6 +597,7 @@ static int8_t ws_bootstrap_up(protocol_interface_info_entry_t *cur)
596597
if (ret_val) {
597598
goto cleanup;
598599
}
600+
599601
/* Disable SLLAO send/mandatory receive with the ARO */
600602
cur->ipv6_neighbour_cache.use_eui64_as_slla_in_aro = true;
601603
/* Omit sending of NA if ARO SUCCESS */
@@ -1326,6 +1328,25 @@ int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode)
13261328
set_req.value_size = sizeof(bool);
13271329
cur->mac_api->mlme_req(cur->mac_api, MLME_SET, &set_req);
13281330

1331+
// Set the default parameters for MPL
1332+
cur->mpl_proactive_forwarding = true;
1333+
1334+
cur->mpl_data_trickle_params.Imin = MPL_MS_TO_TICKS(DATA_MESSAGE_IMIN);
1335+
cur->mpl_data_trickle_params.Imax = MPL_MS_TO_TICKS(DATA_MESSAGE_IMAX);
1336+
cur->mpl_data_trickle_params.TimerExpirations = DATA_MESSAGE_TIMER_EXPIRATIONS;
1337+
cur->mpl_data_trickle_params.k = 8;
1338+
1339+
// Specification is ruling out the compression mode, but we are now doing it.
1340+
cur->mpl_seed = true;
1341+
cur->mpl_seed_id_mode = MULTICAST_MPL_SEED_ID_IPV6_SRC_FOR_DOMAIN;
1342+
cur->mpl_seed_set_entry_lifetime = MPL_SEED_SET_ENTRY_TIMEOUT;
1343+
1344+
cur->mpl_control_trickle_params.TimerExpirations = 0;
1345+
1346+
mpl_domain_create(cur, ADDR_ALL_MPL_FORWARDERS, NULL, MULTICAST_MPL_SEED_ID_DEFAULT, -1, 0, NULL, NULL);
1347+
addr_add_group(cur, ADDR_REALM_LOCAL_ALL_NODES);
1348+
addr_add_group(cur, ADDR_REALM_LOCAL_ALL_ROUTERS);
1349+
13291350
return 0;
13301351

13311352
//Error handling and free memory

source/6LoWPAN/ws/ws_config.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,15 @@ extern int8_t DEVICE_MIN_SENS;
8181
*/
8282
#define PCS_MAX 5
8383

84+
85+
/* Multicast MPL data message parameters
86+
* IMIN = 10 seconds, IMAX = 3 doublings
87+
*/
88+
89+
#define DATA_MESSAGE_IMIN (10 * 1000)
90+
#define DATA_MESSAGE_TIMER_EXPIRATIONS 3
91+
#define DATA_MESSAGE_IMAX (DATA_MESSAGE_IMIN)
92+
#define MPL_SEED_SET_ENTRY_TIMEOUT (DATA_MESSAGE_IMAX * 24 * 4 / 1000) // 10 seconds per hop making this 240 seconds
93+
94+
8495
#endif /* WS_CONFIG_H_ */

0 commit comments

Comments
 (0)