Merge pull request #52 from simonduq/pr/default-802.15.4-2015

802.15.4-2015 frames v2 as default
This commit is contained in:
Nicolas Tsiftes 2017-07-06 16:59:53 +02:00 committed by GitHub
commit dcc33984c2
14 changed files with 14 additions and 327 deletions

View File

@ -145,7 +145,7 @@ frame802154_has_panid(frame802154_fcf_t *fcf, int *has_src_pan_id, int *has_dest
return;
}
if(fcf->frame_version == FRAME802154_IEEE802154E_2012) {
if(fcf->frame_version == FRAME802154_IEEE802154_2015) {
/*
* IEEE 802.15.4-2015
* Table 7-2, PAN ID Compression value for frame version 0b10
@ -302,7 +302,7 @@ field_len(frame802154_t *p, field_length_t *flen)
/* IEEE802.15.4e changes the meaning of PAN ID Compression (see Table 2a).
* In this case, we leave the decision whether to compress PAN ID or not
* up to the caller. */
if(p->fcf.frame_version < FRAME802154_IEEE802154E_2012) {
if(p->fcf.frame_version < FRAME802154_IEEE802154_2015) {
/* Set PAN ID compression bit if src pan id matches dest pan id. */
if((p->fcf.dest_addr_mode & 3) && (p->fcf.src_addr_mode & 3) &&
p->src_pid == p->dest_pid) {

View File

@ -77,7 +77,7 @@
#ifdef FRAME802154_CONF_VERSION
#define FRAME802154_VERSION FRAME802154_CONF_VERSION
#else /* FRAME802154_CONF_VERSION */
#define FRAME802154_VERSION FRAME802154_IEEE802154_2006
#define FRAME802154_VERSION FRAME802154_IEEE802154_2015
#endif /* FRAME802154_CONF_VERSION */
#ifdef FRAME802154_CONF_SUPPR_SEQNO
@ -111,7 +111,7 @@
#define FRAME802154_IEEE802154_2003 (0x00)
#define FRAME802154_IEEE802154_2006 (0x01)
#define FRAME802154_IEEE802154E_2012 (0x02)
#define FRAME802154_IEEE802154_2015 (0x02)
#define FRAME802154_SECURITY_LEVEL_NONE (0)
#define FRAME802154_SECURITY_LEVEL_MIC_32 (1)

View File

@ -81,7 +81,7 @@ create_frame(int type, int do_create)
if(packetbuf_holds_broadcast()) {
params.fcf.ack_required = 0;
/* Suppress seqno on broadcast if supported (frame v2 or more) */
params.fcf.sequence_number_suppression = FRAME802154_VERSION >= FRAME802154_IEEE802154E_2012;
params.fcf.sequence_number_suppression = FRAME802154_VERSION >= FRAME802154_IEEE802154_2015;
} else {
params.fcf.ack_required = packetbuf_attr(PACKETBUF_ATTR_MAC_ACK);
params.fcf.sequence_number_suppression = FRAME802154_SUPPR_SEQNO;

View File

@ -69,7 +69,7 @@ tsch_packet_create_eack(uint8_t *buf, int buf_size,
memset(&p, 0, sizeof(p));
p.fcf.frame_type = FRAME802154_ACKFRAME;
p.fcf.frame_version = FRAME802154_IEEE802154E_2012;
p.fcf.frame_version = FRAME802154_IEEE802154_2015;
p.fcf.ie_list_present = 1;
/* Compression unset. According to IEEE802.15.4e-2012:
* - if no address is present: elide PAN ID
@ -201,7 +201,7 @@ tsch_packet_create_eb(uint8_t *buf, int buf_size,
memset(&p, 0, sizeof(p));
p.fcf.frame_type = FRAME802154_BEACONFRAME;
p.fcf.ie_list_present = 1;
p.fcf.frame_version = FRAME802154_IEEE802154E_2012;
p.fcf.frame_version = FRAME802154_IEEE802154_2015;
p.fcf.src_addr_mode = LINKADDR_SIZE > 2 ? FRAME802154_LONGADDRMODE : FRAME802154_SHORTADDRMODE;
p.fcf.dest_addr_mode = FRAME802154_SHORTADDRMODE;
p.fcf.sequence_number_suppression = 1;
@ -356,7 +356,7 @@ tsch_packet_parse_eb(const uint8_t *buf, int buf_size,
return 0;
}
if(frame->fcf.frame_version < FRAME802154_IEEE802154E_2012
if(frame->fcf.frame_version < FRAME802154_IEEE802154_2015
|| frame->fcf.frame_type != FRAME802154_BEACONFRAME) {
LOG_INFO("! parse_eb: frame is not a valid TSCH beacon. Frame version %u, type %u, FCF %02x %02x\n",
frame->fcf.frame_version, frame->fcf.frame_type, buf[0], buf[1]);

View File

@ -62,8 +62,8 @@
#include "net/mac/tsch/tsch-rpl.h"
#endif /* UIP_CONF_IPV6_RPL */
#if FRAME802154_VERSION < FRAME802154_IEEE802154E_2012
#error TSCH: FRAME802154_VERSION must be at least FRAME802154_IEEE802154E_2012
#if FRAME802154_VERSION < FRAME802154_IEEE802154_2015
#error TSCH: FRAME802154_VERSION must be at least FRAME802154_IEEE802154_2015
#endif
/* Log configuration */
@ -421,7 +421,7 @@ tsch_rx_process_pending()
uint8_t ret = frame802154_parse(current_input->payload, current_input->len, &frame);
int is_data = ret && frame.fcf.frame_type == FRAME802154_DATAFRAME;
int is_eb = ret
&& frame.fcf.frame_version == FRAME802154_IEEE802154E_2012
&& frame.fcf.frame_version == FRAME802154_IEEE802154_2015
&& frame.fcf.frame_type == FRAME802154_BEACONFRAME;
if(is_data) {

View File

@ -67,10 +67,6 @@
#undef NETSTACK_CONF_MAC
#define NETSTACK_CONF_MAC tschmac_driver
/* IEEE802.15.4 frame version */
#undef FRAME802154_CONF_VERSION
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
/* TSCH and RPL callbacks */
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval

View File

@ -62,10 +62,6 @@
#undef NETSTACK_CONF_MAC
#define NETSTACK_CONF_MAC tschmac_driver
/* IEEE802.15.4 frame version */
#undef FRAME802154_CONF_VERSION
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
/* TSCH and RPL callbacks */
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval

View File

@ -58,10 +58,6 @@
#define NETSTACK_CONF_MAC tschmac_driver
/* IEEE802.15.4 frame version */
#undef FRAME802154_CONF_VERSION
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
/* TSCH and RPL callbacks */
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval

View File

@ -139,9 +139,6 @@
#if WITH_TSCH
#undef FRAME802154_CONF_VERSION
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
/* Contiki netstack: MAC */
#undef NETSTACK_CONF_MAC
#define NETSTACK_CONF_MAC tschmac_driver

View File

@ -48,9 +48,6 @@
#undef NETSTACK_CONF_MAC
#define NETSTACK_CONF_MAC tschmac_driver
#undef FRAME802154_CONF_VERSION
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
#if CONTIKI_TARGET_COOJA
#define COOJA_CONF_SIMULATE_TURNAROUND 0
#endif /* CONTIKI_TARGET_COOJA */

View File

@ -32,9 +32,6 @@
#ifndef _PROJECT_TSCH_CONF_H
#define _PROJECT_TSCH_CONF_H
#undef FRAME802154_CONF_VERSION
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
#undef NETSTACK_CONF_MAC
#define NETSTACK_CONF_MAC tschmac_driver

View File

@ -181,7 +181,7 @@ setup_frame802154_2006_fcf(const panid_test_def *t, frame802154_fcf_t *fcf)
static void
setup_frame802154_2015_fcf(const panid_test_def *t, frame802154_fcf_t *fcf)
{
fcf->frame_version = FRAME802154_IEEE802154E_2012;
fcf->frame_version = FRAME802154_IEEE802154_2015;
setup_addr_mode(t->dest_addr_mode, &fcf->dest_addr_mode);
setup_addr_mode(t->src_addr_mode, &fcf->src_addr_mode);

View File

@ -230,7 +230,7 @@ test_parse_eb(const eb_test_vector_t *v)
#endif
if(frame.fcf.frame_type != FRAME802154_BEACONFRAME ||
frame.fcf.frame_version != FRAME802154_IEEE802154E_2012) {
frame.fcf.frame_version != FRAME802154_IEEE802154_2015) {
return FAILURE;
}
@ -315,7 +315,7 @@ test_parse_eack(const eack_test_vector_t *v)
#endif
if(frame.fcf.frame_type != FRAME802154_ACKFRAME ||
frame.fcf.frame_version != FRAME802154_IEEE802154E_2012) {
frame.fcf.frame_version != FRAME802154_IEEE802154_2015) {
return FAILURE;
}

View File

@ -1,292 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project EXPORT="discard">[APPS_DIR]/mrm</project>
<project EXPORT="discard">[APPS_DIR]/mspsim</project>
<project EXPORT="discard">[APPS_DIR]/avrora</project>
<project EXPORT="discard">[APPS_DIR]/serial_socket</project>
<project EXPORT="discard">[APPS_DIR]/collect-view</project>
<project EXPORT="discard">[APPS_DIR]/powertracker</project>
<simulation>
<title>My simulation</title>
<randomseed>123456</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
org.contikios.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
<interference_range>50.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx>
</radiomedium>
<events>
<logoutput>40000</logoutput>
</events>
<motetype>
org.contikios.cooja.contikimote.ContikiMoteType
<identifier>mtype110</identifier>
<description>Sender</description>
<source>[CONFIG_DIR]/code/sender-node.c</source>
<commands>make TARGET=cooja clean
make sender-node.cooja DEFINES=RPL_CONF_WITH_DAO_ACK=0 TARGET=cooja</commands>
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<motetype>
org.contikios.cooja.contikimote.ContikiMoteType
<identifier>mtype792</identifier>
<description>RPL root</description>
<source>[CONFIG_DIR]/code/root-node.c</source>
<commands>make TARGET=cooja clean
make root-node.cooja DEFINES=RPL_CONF_WITH_DAO_ACK=0 TARGET=cooja</commands>
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<motetype>
org.contikios.cooja.contikimote.ContikiMoteType
<identifier>mtype964</identifier>
<description>Receiver</description>
<source>[CONFIG_DIR]/code/receiver-node.c</source>
<commands>make TARGET=cooja clean
make receiver-node.cooja DEFINES=RPL_CONF_WITH_DAO_ACK=0 TARGET=cooja</commands>
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<mote>
<interface_config>
org.contikios.cooja.interfaces.Position
<x>7.772906112657773</x>
<y>86.396910401861</y>
<z>0.0</z>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
<id>1</id>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype964</motetype_identifier>
</mote>
<mote>
<interface_config>
org.contikios.cooja.interfaces.Position
<x>75.54361692539452</x>
<y>14.292026223193414</y>
<z>0.0</z>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
<id>2</id>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype110</motetype_identifier>
</mote>
<mote>
<interface_config>
org.contikios.cooja.interfaces.Position
<x>47.962513687652844</x>
<y>7.199742533488408</y>
<z>0.0</z>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
<id>6</id>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype964</motetype_identifier>
</mote>
<mote>
<interface_config>
org.contikios.cooja.interfaces.Position
<x>1.8626697045702818</x>
<y>47.783365869022624</y>
<z>0.0</z>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
<id>8</id>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype964</motetype_identifier>
</mote>
<mote>
<interface_config>
org.contikios.cooja.interfaces.Position
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
<id>3</id>
</interface_config>
<interface_config>
org.contikios.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype792</motetype_identifier>
</mote>
</simulation>
<plugin>
org.contikios.cooja.plugins.SimControl
<width>280</width>
<z>0</z>
<height>160</height>
<location_x>400</location_x>
<location_y>0</location_y>
</plugin>
<plugin>
org.contikios.cooja.plugins.Visualizer
<plugin_config>
<skin>org.contikios.cooja.plugins.skins.IDVisualizerSkin</skin>
<skin>org.contikios.cooja.plugins.skins.UDGMVisualizerSkin</skin>
<skin>org.contikios.cooja.plugins.skins.GridVisualizerSkin</skin>
<skin>org.contikios.cooja.plugins.skins.MoteTypeVisualizerSkin</skin>
<viewport>2.5379695437350276 0.0 0.0 2.5379695437350276 78.27260101976275 40.72727272727276</viewport>
</plugin_config>
<width>400</width>
<z>2</z>
<height>400</height>
<location_x>1</location_x>
<location_y>1</location_y>
</plugin>
<plugin>
org.contikios.cooja.plugins.LogListener
<plugin_config>
<filter />
<formatted_time />
<coloring />
</plugin_config>
<width>1184</width>
<z>3</z>
<height>240</height>
<location_x>402</location_x>
<location_y>162</location_y>
</plugin>
<plugin>
org.contikios.cooja.plugins.Notes
<plugin_config>
<notes>Enter notes here</notes>
<decorations>true</decorations>
</plugin_config>
<width>904</width>
<z>4</z>
<height>160</height>
<location_x>680</location_x>
<location_y>0</location_y>
</plugin>
<plugin>
org.contikios.cooja.plugins.ScriptRunner
<plugin_config>
<script>GENERATE_MSG(0000000, "add-sink");&#xD;
//GENERATE_MSG(1000000, "remove-sink");&#xD;
//GENERATE_MSG(2000000, "add-sink");&#xD;
&#xD;
lostMsgs = 0;&#xD;
&#xD;
TIMEOUT(100000000, if(lastMsg != -1 &amp;&amp; lostMsgs == 0) { log.testOK(); } );&#xD;
&#xD;
lastMsg = -1;&#xD;
packets = "_________";&#xD;
hops = 0;&#xD;
&#xD;
while(true) {&#xD;
YIELD();&#xD;
if(msg.equals("remove-sink")) {&#xD;
m = sim.getMoteWithID(3);&#xD;
sim.removeMote(m);&#xD;
log.log("removed sink\n");&#xD;
} else if(msg.equals("add-sink")) {&#xD;
if(!sim.getMoteWithID(3)) {&#xD;
m = sim.getMoteTypes()[1].generateMote(sim);&#xD;
m.getInterfaces().getMoteID().setMoteID(3);&#xD;
sim.addMote(m);&#xD;
log.log("added sink\n");&#xD;
} else {&#xD;
log.log("did not add sink as it was already there\n"); &#xD;
}&#xD;
} else if(msg.startsWith("Sending")) {&#xD;
hops = 0;&#xD;
} else if(msg.startsWith("#L") &amp;&amp; msg.endsWith("1; red")) {&#xD;
hops++;&#xD;
} else if(msg.startsWith("Data")) {&#xD;
data = msg.split(" ");&#xD;
num = parseInt(data[14]);&#xD;
if(lastMsg != -1) {&#xD;
if(num != lastMsg + 1) {&#xD;
numMissed = num - lastMsg - 1;&#xD;
lostMsgs += numMissed; &#xD;
log.log("Missed messages " + numMissed + " before " + num + "\n"); &#xD;
for(i = 0; i &lt; numMissed; i++) {&#xD;
packets = packets.substr(0, lastMsg + i + 1).concat("_"); &#xD;
}&#xD;
} &#xD;
}&#xD;
packets = packets.substr(0, num).concat("*");&#xD;
log.log("" + hops + " " + packets + "\n");&#xD;
lastMsg = num;&#xD;
}&#xD;
}</script>
<active>true</active>
</plugin_config>
<width>962</width>
<z>1</z>
<height>596</height>
<location_x>603</location_x>
<location_y>43</location_y>
</plugin>
</simconf>