Skip to content

Commit

Permalink
Wi-sun dublicate MPX ID filter support
Browse files Browse the repository at this point in the history
LLC layer will drop id it hear same ID again in 5sec period.

Change-Id: Idc86736d95b8298318144aebf61f77383ee85b2f
  • Loading branch information
Juha Heiskanen committed Jun 18, 2019
1 parent bd51f9f commit aaf2b39
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/6LoWPAN/ws/ws_llc_data_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@ static void ws_llc_mac_indication_cb(const mac_api_t *api, const mcps_data_ind_t
tr_debug("Drop message no neighbor");
return;
}
//Storage Time from Last Unicast rx time stamp
uint32_t time_from_last = data->timestamp - neighbor_info.ws_neighbor->fhss_data.uc_timing_info.utt_rx_timestamp;

ws_neighbor_class_neighbor_unicast_time_info_update(neighbor_info.ws_neighbor, &ws_utt, data->timestamp);
if (us_ie_inline) {
Expand Down Expand Up @@ -570,6 +572,19 @@ static void ws_llc_mac_indication_cb(const mac_api_t *api, const mcps_data_ind_t
}
}

//MPX Duplicate Address Detection
if (neighbor_info.ws_neighbor->mpx_stored) {

if (time_from_last < 5000000 && neighbor_info.ws_neighbor->mpx_id == mpx_frame.transaction_id) {
tr_debug("Drop message: Dublicate mpx id in short time");
return;
}
} else {
neighbor_info.ws_neighbor->mpx_stored = true;
}
//Store MPX
neighbor_info.ws_neighbor->mpx_id = mpx_frame.transaction_id;

// Discover MPX
mpx_user_t *user_cb = ws_llc_mpx_user_discover(&base->mpx_data_base, mpx_frame.multiplex_id);
if (user_cb && user_cb->data_ind) {
Expand Down
2 changes: 2 additions & 0 deletions source/6LoWPAN/ws/ws_neighbor_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ typedef struct ws_neighbor_class_entry {
uint16_t rsl_in; /*!< RSL EWMA heard from neighbour*/
uint16_t rsl_out; /*!< RSL EWMA heard by neighbour*/
uint16_t routing_cost; /*!< ETX to border Router. */
unsigned mpx_id: 5;
bool mpx_stored: 1;
bool candidate_parent: 1;
bool broadcast_timing_info_stored: 1;
bool broadcast_shedule_info_stored: 1;
Expand Down

0 comments on commit aaf2b39

Please sign in to comment.