STILL WIP

Architecture

Node classes

How the NIB is constructed is greatly dependent on what role the node takes in a network. Analysis of the corresponding RFCs resulted in the following made-up of node classes:

Node classes

Depending on the node class certain features are compiled into the RIOT image of the node. This is marked with the corresponding color of the node class:

Note, that any node can have any of these classes at any point. This is why additional dynamic checks on an interface if it really is e.g. a 6LoWPAN interface are needed.

Additional to their role in the network there are certain features that are beyond orthogonal to these roles:

The reasoning for not including the NDP address resolution state-machine on non-routing 6LN is that on these kinds of nodes non-link-local addresses are always considered off-link and the link-layer addresses of link-local addresses are derived from their IID. So none of this information needs to be stored.

Furthermore, there are features the user can decide to de-/activate:

Lastly, there are the components related to 6LoWPAN’s two substitutable features:

API

NIB: API architecture

(RRQ = Reactive Routing Query, RRN = Reactive Routing Notification, NSC = NUD State Change Notification)

Implementation

NIB: Internal architecture

OnLinkEntry::addNC() treats the OnLinkEntry collection as a cache:

Activity diagram: OnLinkEntry::addNC()

Use-cases

Initialize interface

Sequence diagram: Interface initialization

Sequence diagram: Next-hop determination

(Search in OffLinkEntrys also on non-routers for prefix list)

Get link-layer address of route entry

Sequence diagram: Route entry address resolution

Address resolution

Sequence diagram: Address resolution

Probe neighbor

Sequence diagram: Probe neighbor

Become a router advertising interface

Sequence diagram: Become a router advertising interface

Cease to be a router advertising interface

Sequence diagram: Cease to be a router advertising interface TODO

Upper-layer reachability confirmation

TODO

Receive packet event

Sequence diagram: Receive packet event

Handle Neighbor Solicitation

Sequence diagram: Handle neighbor solicitation (nbr_sol_t::isValid(), see RFC4861) (flags see RFC4861)

Handle Neighbor Advertisement

Sequence diagram: Handle neighbor advertisement (nbr_adv_t::isValid(), see RFC4861)

Handle Router Solicitation

Sequence diagram: Handle router solicitation (rtr_sol_t::isValid(), see RFC4861)

Handle Router Advertisement

Sequence diagram: Handle router advertisement (rtr_adv_t::isValid(), see RFC4861) (remember changed router lifetime!) with persistent storage the ABRs should be stored afterwards

Handle Redirect

TODO

Sequence diagram: Handle advertised link-layer (TLLAO)

Handle Duplicate Address Request

TODO

Handle Duplicate Address Confirmation

TODO

Sequence diagram: Handle Source Link-Layer Address Option

Handle Prefix Information Option

Sequence diagram: Handle Prefix Information Option TODO: Add prefix to ABR

Handle Redirect Header Option

(TLLAO => if NCE created: set STALE) TODO

Handle MTU Option

TODO

Handle Address Registration Option

Sequence diagram: Handle Address Registration Option (nbr_sol_t::isValid(), see RFC6775) (x == ‘before the Lifetime expires’)

Register address upstream

Sequence diagram: Register address upstream

Handle 6LoWPAN Context Option

TODO

Handle Authoritative Border Router Option

Sequence diagram: Address registration timeout timer event Model assumes that abro_t::ltime is already converted to ms (and default is set on 0)

Search router

Sequence diagram: Search router

Sequence diagram: Advertise router

Retransmit Neighbor Solicitation timer event

Sequence diagram: Receive packet event (State should be none of the above [UNMANAGED == 0] when OnLinkEntry not in NIB because of previous deletion) (Two different types to differentiate in timer, otherwise the same) (PROBE behavior according to RFC7048)

Delayed Neighbor Advertisement timer event

Sequence diagram: Delayed Neighbor Advertisement timer event

Search router timer event

Sequence diagram: Search router timer event

Reconfirm router timer event

Sequence diagram: Reconfirm router timer event

Reachability timeout timer event

Sequence diagram: Reachability timeout timer event

Delay timeout timer event

Sequence diagram: Delay timeout timer event

Address registration timeout timer event

Sequence diagram: Address registration timeout timer event

6LoWPAN Context timeout timer event

TODO

Authoritive Border Router timeout timer event

TODO

Prefix timeout timer event

TODO

Route timeout timer event

TODO

Router timeout timer event

TODO

Send unsolicited Router Advertisement timer event

Sequence diagram: Send unsolicited Router Advertisement timer event sendRA() sets iface::lastMCRA to current time in milliseconds

Send solicited Router Advertisement timer event

Sequence diagram: Send solicited Router Advertisement timer event (sendRA(): calculate updated lifetimes on send!)

Recalculate Reachable Time

TODO (see https://tools.ietf.org/html/rfc4861#section-6.3.4)

Wake-up from sleep

TODO

Add address to interface

TODO

Remove address from interface

TODO

Set neighbor cache entry externally

TODO

Delete neighbor cache entry externally

TODO

Set prefix externally

TODO

Delete prefix externally

TODO

Add forwarding table entry

TODO

Delete forwarding table entry

TODO

Set reactive routing callback

TODO

Set 6LoWPAN compression context

TODO

Remove 6LoWPAN compression context

TODO