How is the IP address assigned to each of WSN/6LoWPAN devices in the network?
AD6LoWPAN, as per IPv6 specification, performs stateless Address Auto Configuration as a component of the Neighbor Discovery (ND) protocol. This helps in allocating the IP address for any 6LoWPAN device.
Typically, a router or a dedicated server broadcasts the configuration information to all interfaces by means of ND protocol routing prefix advertisements. This begins IP address assignment on the receiving interfaces for local or global routing purposes.
The IPv6 address is formed from its network/routing prefix and the Interface Identifier (IID). The interface identifier is nothing but the 64-bit MAC address of the interface.
In short, when any device is powered up, the following happens:
1. It generates Link Local IPv6 address based on the network prefix and IID (Interface Identifier). The 64-bit MAC address is used as Interface Identifier for IPv6 address.
2. Using the link local IPv6 Address, the node performs the Neighbor Discovery (ND) in order to derive its global IPv6 address. The Global IPv6 address is derived using the Prefix Information Option (PIO) information received from the Router Advertisement (RA) packet. This address is used by the node for sending the UDP messages.
For further information please refer to RFC4862.