Reactive Discovery of P2P Routes in LLNs

Implementation of P2P-RPL. More...

Detailed Description

Implementation of P2P-RPL.

See also
RFC 6997

Files

file  p2p.h
 Definititions for P2P-RPL.
 
file  p2p_dodag.h
 DODAG-related functions for P2P-RPL.
 
file  p2p_structs.h
 P2P-RPL data structs.
 

Macros

#define GNRC_RPL_P2P_MOP   (0x04)
 P2P-RPL Mode of Operation.
 
#define GNRC_RPL_P2P_LIFETIME   (0x02)
 Default lifetime of the P2P-RPL DODAG, encoded. More...
 
#define GNRC_RPL_P2P_COMPR   (0)
 Number of elided prefix octets from the target field and address vector. More...
 
#define GNRC_RPL_P2P_MAX_RANK   (0)
 Maximum rank in the DODAG during the route discovery. More...
 
#define GNRC_RPL_P2P_OPT_RDO   (0x0A)
 P2P-RPL RDO DIO option type. More...
 
#define GNRC_RPL_P2P_ICMPV6_CODE_DRO   (0x04)
 DRO ICMPv6 code. More...
 
#define GNRC_RPL_P2P_ICMPV6_CODE_DRO_ACK   (0x05)
 DRO-ACK ICMPv6 code. More...
 
#define GNRC_RPL_P2P_DRO_DELAY   (4)
 Time in seconds to wait before sending a DRO.
 
#define GNRC_RPL_P2P_MSG_TYPE_DRO_HANDLE   (0x09A0)
 Message type for handling DRO sending.
 

Functions

gnrc_rpl_instance_tgnrc_rpl_p2p_root_init (uint8_t instance_id, ipv6_addr_t *dodag_id, ipv6_addr_t *target, bool gen_inst_id)
 Initialization of a P2P-RPL Instance as root node. More...
 
gnrc_pktsnip_tgnrc_rpl_p2p_rdo_build (gnrc_pktsnip_t *pkt, gnrc_rpl_p2p_ext_t *p2p_ext)
 Build an RDO. More...
 
void gnrc_rpl_p2p_rdo_parse (gnrc_rpl_p2p_opt_rdo_t *rdo, gnrc_rpl_p2p_ext_t *p2p_ext)
 Parse an RDO. More...
 
void gnrc_rpl_p2p_send_DRO (gnrc_pktsnip_t *pkt, gnrc_rpl_p2p_ext_t *p2p_ext)
 Send a DRO control message. More...
 
void gnrc_rpl_p2p_recv_DRO (gnrc_pktsnip_t *pkt, ipv6_addr_t *src)
 Receive and parse a DRO control message. More...
 
void gnrc_rpl_p2p_update (void)
 Updates the lifetime of the P2P Dodag and the delay of the DRO.
 

Variables

const uint8_t gnrc_rpl_p2p_lifetime_lookup [4]
 Lookup table used to decode/encode the lifetime values.
 

Trickle parameters

See also
RFC 6997, section 6.1, Setting a P2P Mode DIO
#define GNRC_RPL_P2P_DEFAULT_DIO_INTERVAL_MIN   (6)
 
#define GNRC_RPL_P2P_DEFAULT_DIO_REDUNDANCY_CONSTANT   (1)
 

Default parent and route entry lifetime

default lifetime will be multiplied by the lifetime unit to obtain the resulting lifetime

#define GNRC_RPL_P2P_DEFAULT_LIFETIME   (0xFF)
 
#define GNRC_RPL_P2P_LIFETIME_UNIT   (0xFFFF)
 

Macro Definition Documentation

◆ GNRC_RPL_P2P_COMPR

#define GNRC_RPL_P2P_COMPR   (0)

Number of elided prefix octets from the target field and address vector.

See also
RFC 6997, section 7, P2P Route Discovery Option (P2P-RDO)

Definition at line 54 of file p2p.h.

◆ GNRC_RPL_P2P_ICMPV6_CODE_DRO

#define GNRC_RPL_P2P_ICMPV6_CODE_DRO   (0x04)

DRO ICMPv6 code.

See also
RFC 6997, section 8, The P2P Discovery Reply Object (P2P-DRO)

Definition at line 98 of file p2p.h.

◆ GNRC_RPL_P2P_ICMPV6_CODE_DRO_ACK

#define GNRC_RPL_P2P_ICMPV6_CODE_DRO_ACK   (0x05)

◆ GNRC_RPL_P2P_LIFETIME

#define GNRC_RPL_P2P_LIFETIME   (0x02)

Default lifetime of the P2P-RPL DODAG, encoded.

See also
RFC 6997, section 7, P2P Route Discovery Option (P2P-RDO)

Definition at line 46 of file p2p.h.

◆ GNRC_RPL_P2P_MAX_RANK

#define GNRC_RPL_P2P_MAX_RANK   (0)

Maximum rank in the DODAG during the route discovery.

See also
RFC 6997, section 7, P2P Route Discovery Option (P2P-RDO)

Definition at line 62 of file p2p.h.

◆ GNRC_RPL_P2P_OPT_RDO

#define GNRC_RPL_P2P_OPT_RDO   (0x0A)

P2P-RPL RDO DIO option type.

See also
RFC 6997, section 7, P2P Route Discovery Option (P2P-RDO)

Definition at line 90 of file p2p.h.

Function Documentation

◆ gnrc_rpl_p2p_rdo_build()

gnrc_pktsnip_t* gnrc_rpl_p2p_rdo_build ( gnrc_pktsnip_t pkt,
gnrc_rpl_p2p_ext_t p2p_ext 
)

Build an RDO.

Parameters
[in,out]pktThe RDO will be added to the pkt
[in]p2p_extPointer to the P2P-RPL DODAG extension

◆ gnrc_rpl_p2p_rdo_parse()

void gnrc_rpl_p2p_rdo_parse ( gnrc_rpl_p2p_opt_rdo_t rdo,
gnrc_rpl_p2p_ext_t p2p_ext 
)

Parse an RDO.

Parameters
[in]rdoThe RDO to parse from.
[in]p2p_extPointer to the P2P-RPL DODAG extension

◆ gnrc_rpl_p2p_recv_DRO()

void gnrc_rpl_p2p_recv_DRO ( gnrc_pktsnip_t pkt,
ipv6_addr_t src 
)

Receive and parse a DRO control message.

Parameters
[in]pktThe ICMPv6 packet to parse.
[in]srcThe source address of the IPv6 packet.

◆ gnrc_rpl_p2p_root_init()

gnrc_rpl_instance_t* gnrc_rpl_p2p_root_init ( uint8_t  instance_id,
ipv6_addr_t dodag_id,
ipv6_addr_t target,
bool  gen_inst_id 
)

Initialization of a P2P-RPL Instance as root node.

Parameters
[in]instance_idId of the instance
[in]dodag_idId of the DODAG
[in]targetTarget of the P2P-RPL routes discovery
[in]gen_inst_idFlag indicating whether to generate a local instance id. If true, instance_id will be ignored
Returns
Pointer to the new Instance, on success.
NULL, otherwise.

◆ gnrc_rpl_p2p_send_DRO()

void gnrc_rpl_p2p_send_DRO ( gnrc_pktsnip_t pkt,
gnrc_rpl_p2p_ext_t p2p_ext 
)

Send a DRO control message.

Parameters
[in]pktThe ICMPv6 packet to send. Can be NULL.
[in]p2p_extPointer to the P2P-RPL DODAG extension