Skip to content

Commit

Permalink
Added support for wisun multicast
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mika Tervonen committed Oct 1, 2018
1 parent 35b39f4 commit 8160d86
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
27 changes: 24 additions & 3 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "6LoWPAN/MAC/mac_data_poll.h"
#include "6LoWPAN/MAC/mpx_api.h"
#include "6LoWPAN/MAC/mac_ie_lib.h"
#include "MPL/mpl.h"
#include "6LoWPAN/ws/ws_common_defines.h"
#include "6LoWPAN/ws/ws_config.h"
#include "6LoWPAN/ws/ws_common.h"
Expand Down Expand Up @@ -64,11 +65,11 @@

#ifdef HAVE_WS

#define TRIGLE_IMIN_60_SECS (60 * 10) //
#define TRICKLE_IMIN_60_SECS (60 * 10) //

static const trickle_params_t trickle_params_pan_discovery = {
.Imin = TRIGLE_IMIN_60_SECS, /* 60 second; ticks are 1s */
.Imax = TRIGLE_IMIN_60_SECS << 4, /* 960 seconds 16 min*/
.Imin = TRICKLE_IMIN_60_SECS, /* 60 second; ticks are 1s */
.Imax = TRICKLE_IMIN_60_SECS << 4, /* 960 seconds 16 min*/
.k = 1, /* 1 */
.TimerExpirations = TRICKLE_EXPIRATIONS_INFINITE
};
Expand Down Expand Up @@ -596,6 +597,7 @@ static int8_t ws_bootstrap_up(protocol_interface_info_entry_t *cur)
if (ret_val) {
goto cleanup;
}

/* Disable SLLAO send/mandatory receive with the ARO */
cur->ipv6_neighbour_cache.use_eui64_as_slla_in_aro = true;
/* Omit sending of NA if ARO SUCCESS */
Expand Down Expand Up @@ -1326,6 +1328,25 @@ int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode)
set_req.value_size = sizeof(bool);
cur->mac_api->mlme_req(cur->mac_api, MLME_SET, &set_req);

// Set the default parameters for MPL
cur->mpl_proactive_forwarding = true;

cur->mpl_data_trickle_params.Imin = MPL_MS_TO_TICKS(DATA_MESSAGE_IMIN);
cur->mpl_data_trickle_params.Imax = MPL_MS_TO_TICKS(DATA_MESSAGE_IMAX);
cur->mpl_data_trickle_params.TimerExpirations = DATA_MESSAGE_TIMER_EXPIRATIONS;
cur->mpl_data_trickle_params.k = 8;

// Specification is ruling out the compression mode, but we are now doing it.
cur->mpl_seed = true;
cur->mpl_seed_id_mode = MULTICAST_MPL_SEED_ID_IPV6_SRC_FOR_DOMAIN;
cur->mpl_seed_set_entry_lifetime = MPL_SEED_SET_ENTRY_TIMEOUT;

cur->mpl_control_trickle_params.TimerExpirations = 0;

mpl_domain_create(cur, ADDR_ALL_MPL_FORWARDERS, NULL, MULTICAST_MPL_SEED_ID_DEFAULT, -1, 0, NULL, NULL);
addr_add_group(cur, ADDR_REALM_LOCAL_ALL_NODES);
addr_add_group(cur, ADDR_REALM_LOCAL_ALL_ROUTERS);

return 0;

//Error handling and free memory
Expand Down
11 changes: 11 additions & 0 deletions source/6LoWPAN/ws/ws_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,15 @@ extern int8_t DEVICE_MIN_SENS;
*/
#define PCS_MAX 5


/* Multicast MPL data message parameters
* IMIN = 10 seconds, IMAX = 3 doublings
*/

#define DATA_MESSAGE_IMIN (10 * 1000)
#define DATA_MESSAGE_TIMER_EXPIRATIONS 3
#define DATA_MESSAGE_IMAX (DATA_MESSAGE_IMIN)
#define MPL_SEED_SET_ENTRY_TIMEOUT (DATA_MESSAGE_IMAX * 24 * 4 / 1000) // 10 seconds per hop making this 240 seconds


#endif /* WS_CONFIG_H_ */

0 comments on commit 8160d86

Please sign in to comment.