RPL¶
RPL implementation for GNRC.
Configuration¶
USEMODULE¶
- RPL (Storing Mode)
1
USEMODULE += gnrc_rpl
- RPL auto-initialization on interface
1
USEMODULE += auto_init_gnrc_rpl
Auto-Initialization¶
If the application defines only one interface (GNRC_NETIF_NUMOF == 1), then RPL will be initialized on this interface.
If the application defines several interfaces (GNRC_NETIF_NUMOF > 1), then RPL will be initialized on the interface GNRC_RPL_DEFAULT_NETIF. Your application is responsible for setting GNRC_RPL_DEFAULT_NETIF to a valid interface PID, e.g. via CFLAGS.
Initializing RPL on multiple interfaces automatically is currently not supported. Call gnrc_rpl_init() manually from your application for the desired interfaces in this case.
CFLAGS¶
- Exclude Prefix Information Options from DIOs
1
CFLAGS += -DGNRC_RPL_WITHOUT_PIO
- Modify trickle parameters
1 2 3
CFLAGS += -DGNRC_RPL_DEFAULT_DIO_INTERVAL_DOUBLINGS=20 CFLAGS += -DGNRC_RPL_DEFAULT_DIO_INTERVAL_MIN=3 CFLAGS += -DGNRC_RPL_DEFAULT_DIO_REDUNDANCY_CONSTANT=10
- Make reception of DODAG_CONF optional when joining a DODAG. This will use the default trickle parameters until a DODAG_CONF is received from the parent. The DODAG_CONF is requested once from the parent while joining the DODAG. The standard behaviour is to request a DODAG_CONF and join only a DODAG once a DODAG_CONF is received.
1
CFLAGS += -DGNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN
- Set interface for auto-initialization if more than one interface exists (
GNRC_NETIF_NUMOF > 1)1
CFLAGS += -DGNRC_RPL_DEFAULT_NETIF=6
- By default, all incoming control messages get checked for validation. This validation can be disabled in case the involved RPL implementations are known to produce valid messages.
1
CFLAGS += -DGNRC_RPL_WITHOUT_VALIDATION
USEMODULE¶
- RPL (Storing Mode)
1
USEMODULE += gnrc_rpl
- RPL auto-initialization on interface
1
USEMODULE += auto_init_gnrc_rpl
Auto-Initialization¶
If the application defines only one interface (GNRC_NETIF_NUMOF == 1), then RPL will be initialized on this interface.
If the application defines several interfaces (GNRC_NETIF_NUMOF > 1), then RPL will be initialized on the interface GNRC_RPL_DEFAULT_NETIF. Your application is responsible for setting GNRC_RPL_DEFAULT_NETIF to a valid interface PID, e.g. via CFLAGS.
Initializing RPL on multiple interfaces automatically is currently not supported. Call gnrc_rpl_init() manually from your application for the desired interfaces in this case.
CFLAGS¶
- Exclude Prefix Information Options from DIOs
1
CFLAGS += -DGNRC_RPL_WITHOUT_PIO
- Modify trickle parameters
1 2 3
CFLAGS += -DGNRC_RPL_DEFAULT_DIO_INTERVAL_DOUBLINGS=20 CFLAGS += -DGNRC_RPL_DEFAULT_DIO_INTERVAL_MIN=3 CFLAGS += -DGNRC_RPL_DEFAULT_DIO_REDUNDANCY_CONSTANT=10
- Make reception of DODAG_CONF optional when joining a DODAG. This will use the default trickle parameters until a DODAG_CONF is received from the parent. The DODAG_CONF is requested once from the parent while joining the DODAG. The standard behaviour is to request a DODAG_CONF and join only a DODAG once a DODAG_CONF is received.
1
CFLAGS += -DGNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN
- Set interface for auto-initialization if more than one interface exists (
GNRC_NETIF_NUMOF > 1)1
CFLAGS += -DGNRC_RPL_DEFAULT_NETIF=6
- By default, all incoming control messages get checked for validation. This validation can be disabled in case the involved RPL implementations are known to produce valid messages.
1
CFLAGS += -DGNRC_RPL_WITHOUT_VALIDATION
-
GNRC_RPL_MOP_NO_DOWNWARD_ROUTES¶ 1
(0x00)
-
GNRC_RPL_MOP_NON_STORING_MODE¶ 1
(0x01)
-
GNRC_RPL_MOP_STORING_MODE_NO_MC¶ 1
(0x02)
-
GNRC_RPL_MOP_STORING_MODE_MC¶ 1
(0x03)
-
GNRC_RPL_DEFAULT_MOP¶ default MOP set on compile time
1
GNRC_RPL_MOP_STORING_MODE_NO_MC
-
uint8_t
GNRC_RPL_COUNTER_INCREMENT(uint8_t counter)¶
-
bool
GNRC_RPL_COUNTER_IS_INIT(uint8_t counter)¶
-
bool
GNRC_RPL_COUNTER_GREATER_THAN_LOCAL(uint8_t A, uint8_t B)¶
-
bool
GNRC_RPL_COUNTER_GREATER_THAN(uint8_t A, uint8_t B)¶
-
GNRC_RPL_COUNTER_MAX¶ 1
(255)
-
GNRC_RPL_COUNTER_LOWER_REGION¶ 1
(127)
-
GNRC_RPL_COUNTER_SEQ_WINDOW¶ 1
(16)
-
GNRC_RPL_COUNTER_INIT¶ 1
(GNRC_RPL_COUNTER_MAX - GNRC_RPL_COUNTER_SEQ_WINDOW + 1)
-
GNRC_RPL_DEFAULT_DIO_INTERVAL_DOUBLINGS¶ 1
(20)
-
GNRC_RPL_DEFAULT_DIO_INTERVAL_MIN¶ 1
(3)
-
GNRC_RPL_DEFAULT_DIO_REDUNDANCY_CONSTANT¶ 1
(10)
-
GNRC_RPL_DEFAULT_LIFETIME¶ 1
(5)
-
GNRC_RPL_LIFETIME_UNIT¶ 1
(60)
-
GNRC_RPL_DAO_SEND_RETRIES¶ 1
(4)
-
GNRC_RPL_DAO_ACK_DELAY¶ 1
(3000UL)
-
GNRC_RPL_DAO_DELAY_LONG¶ Long delay for DAOs in milli seconds.
1
(60000UL)
-
GNRC_RPL_DAO_DELAY_DEFAULT¶ Default delay for DAOs in milli seconds.
1
(1000UL)
-
GNRC_RPL_DAO_DELAY_JITTER¶ Jitter for DAOs in milli seconds.
1
(1000UL)
-
GNRC_RPL_NORMAL_NODE¶ 1
(0)
-
GNRC_RPL_ROOT_NODE¶ 1
(1)
-
GNRC_RPL_LEAF_NODE¶ 1
(2)
-
GNRC_RPL_OPT_PAD1¶ 1
(0)
-
GNRC_RPL_OPT_PADN¶ 1
(1)
-
GNRC_RPL_OPT_DAG_METRIC_CONTAINER¶ 1
(2)
-
GNRC_RPL_OPT_ROUTE_INFO¶ 1
(3)
-
GNRC_RPL_OPT_DODAG_CONF¶ 1
(4)
-
GNRC_RPL_OPT_TARGET¶ 1
(5)
-
GNRC_RPL_OPT_TRANSIT¶ 1
(6)
-
GNRC_RPL_OPT_SOLICITED_INFO¶ 1
(7)
-
GNRC_RPL_OPT_PREFIX_INFO¶ 1
(8)
-
GNRC_RPL_OPT_TARGET_DESC¶ 1
(9)
-
GNRC_RPL_INSTANCE_ID_MSB¶ 1
(1 << 7)
-
GNRC_RPL_GLOBAL_INSTANCE_MASK¶ 1
(0x7F)
-
GNRC_RPL_LOCAL_INSTANCE_MASK¶ 1
(0x3F)
-
GNRC_RPL_INSTANCE_D_FLAG_MASK¶ 1
(1 << 6)
-
GNRC_RPL_DIS_SOLICITED_INFO_LENGTH¶ DIS Solicited Information option (numbers)
1
(19)
-
GNRC_RPL_DIS_SOLICITED_INFO_FLAG_V¶ 1
(1 << 7)
-
GNRC_RPL_DIS_SOLICITED_INFO_FLAG_I¶ 1
(1 << 6)
-
GNRC_RPL_DIS_SOLICITED_INFO_FLAG_D¶ 1
(1 << 5)
-
kernel_types.h::kernel_pid_tgnrc_rpl_pid¶ PID of the RPL thread.
-
const ipv6_addr_t
ipv6_addr_all_rpl_nodes¶ See also
-
kernel_types.h::kernel_pid_tgnrc_rpl_init(kernel_types.h::kernel_pid_tif_pid)¶ Initialization of the RPL thread.
Parameters
if_pid: PID of the interface Return values
- The PID of the RPL thread, on success.
- a negative errno on error.
-
structs.h::gnrc_rpl_instance_t*gnrc_rpl_root_init(uint8_t instance_id, ipv6_addr_t * dodag_id, bool gen_inst_id, bool local_inst_id)¶ Initialization of a node as root.
Parameters
instance_id: Id of the instance dodag_id: Id of the DODAG gen_inst_id: Flag indicating whether to generate an instance id. If true, instance_idwill be ignoredlocal_inst_id: Flag indicating whether a local or global instance id should be generatad Return values
- Pointer to the new RPL Instance, on success.
- NULL, otherwise.
-
void
gnrc_rpl_send_DIO(structs.h::gnrc_rpl_instance_t* instance, ipv6_addr_t * destination)¶ Send a DIO of the
instanceto thedestination.Parameters
instance: Pointer to the RPL instance. destination: IPv6 addres of the destination.
-
void
gnrc_rpl_send_DIS(structs.h::gnrc_rpl_instance_t* instance, ipv6_addr_t * destination, gnrc_rpl_internal_opt_t ** options,msp430_types.h::size_tnum_opts)¶ Send a DIS of the
instaceto thedestination.Parameters
instance: Pointer to the RPL instance, optional. destination: IPv6 addres of the destination. options: Pointer to the first option to be attached. num_opts: The number of options to attach.
-
void
gnrc_rpl_send_DAO(structs.h::gnrc_rpl_instance_t* instance, ipv6_addr_t * destination, uint8_t lifetime)¶ Send a DAO of the
dodagto thedestination.Parameters
instance: Pointer to the instance. destination: IPv6 addres of the destination. lifetime: Lifetime of the route to announce.
-
void
gnrc_rpl_send_DAO_ACK(structs.h::gnrc_rpl_instance_t* instance, ipv6_addr_t * destination, uint8_t seq)¶ Send a DAO-ACK of the
instanceto thedestination.Parameters
instance: Pointer to the RPL instance. destination: IPv6 addres of the destination. seq: Sequence number to be acknowledged.
-
void
gnrc_rpl_recv_DIS(gnrc_rpl_dis_t * dis,kernel_types.h::kernel_pid_tiface, ipv6_addr_t * src, ipv6_addr_t * dst, uint16_t len)¶ Parse a DIS.
Parameters
dis: Pointer to the DIS message. iface: Interface PID of the incoming DIS. src: Pointer to the source address of the IPv6 packet. dst: Pointer to the destination address of the IPv6 packet. len: Length of the IPv6 packet.
-
void
gnrc_rpl_recv_DIO(gnrc_rpl_dio_t * dio,kernel_types.h::kernel_pid_tiface, ipv6_addr_t * src, ipv6_addr_t * dst, uint16_t len)¶ Parse a DIO.
Parameters
dio: Pointer to the DIO message. iface: Interface PID of the incoming DIO. src: Pointer to the source address of the IPv6 packet. dst: Pointer to the destination address of the IPv6 packet. len: Length of the IPv6 packet.
-
void
gnrc_rpl_recv_DAO(gnrc_rpl_dao_t * dao,kernel_types.h::kernel_pid_tiface, ipv6_addr_t * src, ipv6_addr_t * dst, uint16_t len)¶ Parse a DAO.
Parameters
dao: Pointer to the DAO message. iface: Interface PID of the incoming DIO. src: Pointer to the source address of the IPv6 packet. dst: Pointer to the destination address of the IPv6 packet. len: Length of the IPv6 packet.
-
void
gnrc_rpl_recv_DAO_ACK(gnrc_rpl_dao_ack_t * dao_ack,kernel_types.h::kernel_pid_tiface, ipv6_addr_t * src, ipv6_addr_t * dst, uint16_t len)¶ Parse a DAO-ACK.
Parameters
dao_ack: Pointer to the DAO-ACK message. iface: Interface PID of the incoming DIO. src: Pointer to the source address of the IPv6 packet. dst: Pointer to the destination address of the IPv6 packet. len: Length of the IPv6 packet.
-
void
gnrc_rpl_delay_dao(structs.h::gnrc_rpl_dodag_t* dodag)¶ Delay the DAO sending interval.
Parameters
dodag: The DODAG of the DAO
-
void
gnrc_rpl_long_delay_dao(structs.h::gnrc_rpl_dodag_t* dodag)¶ Long delay the DAO sending interval.
Parameters
dodag: The DODAG of the DAO
-
structs.h::gnrc_rpl_instance_t*gnrc_rpl_root_instance_init(uint8_t instance_id, ipv6_addr_t * dodag_id, uint8_t mop)¶ Create a new RPL instance and RPL DODAG.
Parameters
instance_id: Id of the instance dodag_id: Id of the DODAG mop: Mode of Operation Return values
- Pointer to the new RPL instance, on success.
- NULL, otherwise.
-
void
gnrc_rpl_send(include/net/gnrc/pkt.h::gnrc_pktsnip_t* pkt,kernel_types.h::kernel_pid_tiface, ipv6_addr_t * src, ipv6_addr_t * dst, ipv6_addr_t * dodag_id)¶ Send a control message.
Parameters
pkt: gnrc_pktnsip_t to send iface: Interface PID to send this pkt to src: Source address of the packet dst: Destination address of the packet dodag_id: Id of the DODAG
-
uint8_t
gnrc_rpl_gen_instance_id(bool local)¶ Generate a local or global instance id.
Parameters
local: flag to indicate whether a local or global instance id is requested Return values
- Local instance id, if
localis true - Global instance id, otherwise.
- Local instance id, if
-
void
gnrc_rpl_config_pio(structs.h::gnrc_rpl_dodag_t* dodag, bool status)¶ (De-)Activate the transmission of Prefix Information Options within DIOs for a particular DODAG
Parameters
dodag: Pointer to the DODAG status: true for activating PIOs and false for deactivating them
-
GNRC_RPL_STACK_SIZE¶ Default stack size to use for the RPL thread.
1
(THREAD_STACKSIZE_DEFAULT)
-
GNRC_RPL_PRIO¶ Default priority for the RPL thread.
1
(GNRC_IPV6_PRIO + 1)
-
GNRC_RPL_MSG_QUEUE_SIZE¶ Default message queue size to use for the RPL thread.
1
(8U)
-
GNRC_RPL_ALL_NODES_ADDR¶ Static initializer for the all-RPL-nodes multicast IPv6 address (ff02::1a)
1
{{ 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1a }}
See also
-
GNRC_RPL_MSG_TYPE_LIFETIME_UPDATE¶ Message type for lifetime updates.
1
(0x0900)
-
GNRC_RPL_MSG_TYPE_TRICKLE_MSG¶ Message type for trickle.
1
(0x0901)
-
GNRC_RPL_MSG_TYPE_DAO_HANDLE¶ Message type for handling DAO sending.
1
(0x0903)
-
GNRC_RPL_INFINITE_RANK¶ Infinite rank.
1
(0xFFFF)
See also
-
GNRC_RPL_DEFAULT_MIN_HOP_RANK_INCREASE¶ Default minimum hop rank increase.
1
(256)
See also
-
GNRC_RPL_DEFAULT_MAX_RANK_INCREASE¶ Maximum rank increase.
1
(0)
-
GNRC_RPL_IMPLEMENTED_OFS_NUMOF¶ Number of implemented Objective Functions.
1
(1)
-
GNRC_RPL_DEFAULT_OCP¶ Default Objective Code Point (OF0)
1
(0)
-
GNRC_RPL_DEFAULT_INSTANCE¶ Default Instance ID.
1
(0)
-
GNRC_RPL_DEFAULT_PREFIX_LEN¶ Default prefix length for the DODAG id.
1
(64)
-
GNRC_RPL_DEFAULT_PREFIX_LIFETIME¶ Default prefix valid and preferred time for the DODAG id.
1
(0xFFFFFFFF)
Note
Currently not used, but needed for RIOs
See also
-
GNRC_RPL_GROUNDED¶ A DODAG can be grounded or floating.
1
(1)
See also
-
GNRC_RPL_CLEANUP_TIME¶ Cleanup interval in milliseconds.
1
(5 * MS_PER_SEC)
-
GNRC_RPL_ROOT_RANK¶ Rank of the root node.
1
(GNRC_RPL_DEFAULT_MIN_HOP_RANK_INCREASE)
-
GNRC_RPL_ICMPV6_CODE_DIS¶ DIS ICMPv6 code.
1
(0x00)
See also
-
GNRC_RPL_ICMPV6_CODE_DIO¶ DIO ICMPv6 code.
1
(0x01)
See also
-
GNRC_RPL_ICMPV6_CODE_DAO¶ DAO ICMPv6 code.
1
(0x02)
See also
-
GNRC_RPL_ICMPV6_CODE_DAO_ACK¶ DAO ACK ICMPv6 code.
1
(0x03)
See also
-
GNRC_RPL_LIFETIME_UPDATE_STEP¶ Update interval of the lifetime update function.
1
(2)
-
DAGRANK( rank, mhri)¶ Rank part of the DODAG.
1
(rank/mhri)
-
GNRC_RPL_PARENT_TIMEOUT_DIS_RETRIES¶ Number of DIS retries before parent times out.
1
(3)