6LoWPAN Neighbor Discovery

Message types and helper functions for Neighbor Discovery Optimization for 6LoWPAN (6LoWPAN-ND)

SIXLOWPAN_ND_OPT_6CTX_LEN_MIN
1
(2U)
SIXLOWPAN_ND_OPT_6CTX_LEN_MAX
1
(3U)
SIXLOWPAN_ND_OPT_AR_LEN
1
(2U)
SIXLOWPAN_ND_OPT_ABR_LEN
1
(3U)
SIXLOWPAN_ND_OPT_ABR_LTIME_DEFAULT

Valid lifetime (in minutes) assumed if sixlowpan/nd.h::sixlowpan_nd_opt_abr_t::ltime is 0.

1
(10000U)
SIXLOWPAN_ND_STATUS_SUCCESS

success

1
(0)
SIXLOWPAN_ND_STATUS_DUP

duplicate address

1
(1)
SIXLOWPAN_ND_STATUS_NC_FULL

neighbor cache full

1
(2)
SIXLOWPAN_ND_OPT_6CTX_FLAGS_MASK
1
(0x1f)
SIXLOWPAN_ND_OPT_6CTX_FLAGS_C

valid for compression

1
(0x10)
SIXLOWPAN_ND_OPT_6CTX_FLAGS_CID_MASK

mask for CID

1
(0x0f)
SIXLOWPAN_ND_MIN_CTX_CHANGE_SEC_DELAY

MIN_CONTEXT_CHANGE_DELAY (in sec)

1
(300U)
SIXLOWPAN_ND_MAX_RA_NUMOF

MAX_RTR_ADVERTISEMENTS.

1
(3U)
SIXLOWPAN_ND_MIN_MS_DELAY_BETWEEN_RAS

MIN_DELAY_BETWEEN_RAS (in ms)

1
(10000U)
SIXLOWPAN_ND_MAX_RA_MS_DELAY

MAX_RA_DELAY_TIME (in ms)

1
(2000U)
SIXLOWPAN_ND_TENTATIVE_NCE_SEC_LTIME

TENTATIVE_NCE_LIFETIME (in sec)

1
(20U)
SIXLOWPAN_ND_MULTIHOP_HL

MULTIHOP_HOPLIMIT.

1
(64U)
SIXLOWPAN_ND_REG_TRANSMIT_NUMOF

Number of address registration retries.

1
(3U)

Note

Must not be greater than 7 for Generic (GNRC) network stack since gnrc/netif/ipv6.h::GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_TENTATIVE restricts it to that number.

SIXLOWPAN_ND_RS_MSEC_INTERVAL

RTR_SOLICITATION_INTERVAL (in msec)

1
(10000U)
SIXLOWPAN_ND_MAX_RS_NUMOF

MAX_RTR_SOLICITATIONS.

1
(3U)
SIXLOWPAN_ND_MAX_RS_SEC_INTERVAL

MAX_RTR_SOLICITATIONS_INTERVAL (in seconds)

1
(60U)
bool sixlowpan_nd_opt_6ctx_is_comp(const sixlowpan_nd_opt_6ctx_t * ctx_opt)

Checks if a 6LoWPAN context in an 6LoWPAN context option is valid for compression.

Parameters

ctx_opt:A 6LoWPAN context option.

Return values

  • true, if C bit is set in ctx_opt.
  • false, if C bit is unset in ctx_opt.
uint8_t sixlowpan_nd_opt_6ctx_get_cid(const sixlowpan_nd_opt_6ctx_t * ctx_opt)

Gets a CID (context identifier) from a 6LoWPAN context option.

Parameters

ctx_opt:A 6LoWPAN context option.

Return values

  • The CID in the 6LoWPAN context option ctx_opt.
void sixlowpan_nd_opt_6ctx_set_cid(sixlowpan_nd_opt_6ctx_t * ctx_opt, uint8_t cid)

Sets a CID (context identifier) for a 6LoWPAN context option.

Parameters

ctx_opt:A 6LoWPAN context option.
cid:The CID for the 6LoWPAN context option.

uint32_t sixlowpan_nd_opt_abr_get_version(const sixlowpan_nd_opt_abr_t * abr_opt)

Gets the version in correct order from an Authoritative Border Router option.

Parameters

abr_opt:An Authoritative Border Router option (ABRO).

Return values

  • The version of the ABRO
void sixlowpan_nd_opt_abr_set_version(sixlowpan_nd_opt_abr_t * abr_opt, uint32_t version)

Sets the version of an Authoritative Border Router option.

Parameters

abr_opt:An Authoritative Border Router option (ABRO).
version:Version for the ABRO.

struct sixlowpan_nd_da_t

Duplicate address request and confirmation message format.

uint8_t type

message type

uint8_t code

message code

byteorder.h::network_uint16_t csum

checksum

uint8_t status

indicates registration status in DAC; must be 0 in DAR.

uint8_t resv

reserved field

byteorder.h::network_uint16_t ltime

registration lifetime

eui64_t eui64

EUI-64.

ipv6_addr_t addr

registered address

struct sixlowpan_nd_opt_ar_t

Address registration option format.

uint8_t type

option type

uint8_t len

length in units of 8 octets

uint8_t status

indicates registration status in NA response; must be 0 in NS messages

uint8_t resv()

reserved fields

byteorder.h::network_uint16_t ltime

registration lifetime

eui64_t eui64

EUI-64.

struct sixlowpan_nd_opt_6ctx_t

6LoWPAN context option format

uint8_t type

option type

uint8_t len

length in units of 8 octets

uint8_t ctx_len

context length

uint8_t resv_c_cid

3-bit reserved, 1-bit c flag, 4 bit CID

byteorder.h::network_uint16_t resv

reserved field

byteorder.h::network_uint16_t ltime

valid lifetime

struct sixlowpan_nd_opt_abr_t

Authoritative border router option format.

uint8_t type

option type

uint8_t len

length in units of 8 octets

byteorder.h::network_uint16_t vlow

version low

byteorder.h::network_uint16_t vhigh

version high

byteorder.h::network_uint16_t ltime

valid lifetime

ipv6_addr_t braddr

6LoWPAN border router address