Thread is a secure, wireless, simplified IPv6-based mesh networking protocol developed by industry leading technology companies, including Freescale, for connecting devices to each other, to the internet and to the cloud. Before starting a Thread Network implementation, users should be familiar with some concepts and how they are related to Thread protocol.
Devices in the Thread stack support IPv6 addressing
IPv6 addresses are 128-bit identifiers (IPv4 is only 32-bit) for interfaces and sets of interfaces. Thread supports the following types of addresses:
Unicast: An identifier for a single interface. A packet sent to a unicast address is delivered to the interface identified by that address.
Multicast: An identifier for a set of interfaces (typically belonging to different nodes). A packet sent to a multicast address is delivered to all interfaces identified by that address.
There are no broadcast addresses in IPv6, their function being superseded by multicast addresses.
Each device joining the Thread Network is also assigned a 16-bit short address as specified in IEEE 802.15.4.
All Thread devices use 6LoWPAN
6LoWPAN stands for “IPv6 over Low Power Wireless Personal Networks”. 6LoWPAN is a set of standards defined by the Internet Engineering Task Force (IETF), which enables the efficient use of IPv6 over low-power, low-rate wireless networks on simple embedded devices through an adaptation layer and the optimization of related protocols. Its main goal is to send/receive IPv6 packets over 802.15.4 links. Next figure compares IP and 6LoWPAN protocol stacks:
The following concepts would explain the transport layer.
Thread devices support the ICMPv6 (Internet Control Message Protocol version 6) protocol and ICMPv6 error messages, as well as the echo request and echo reply messages.
The Internet Control Message Protocol (ICMP) is an error reporting and diagnostic utility and is considered a required part of any IP implementation. ICMPs are used by routers, intermediary devices, or hosts to communicate updates or error information to other routers, intermediary devices, or hosts. For instance, ICMPv6 is used by IPv6 nodes to report errors encountered in processing packets, and to perform other internet-layer functions, such as diagnostics.
ICMPdiffers from transport protocols such as TCP and UDPin that it is not typically used to exchange data between systems, nor is it regularly employed by end-user network applications. The ICMPv6 messages have the following general format:
The type field indicates the type of the message. Its value determines the format of the remaining data.
The code field depends on the message type. It is used to create an additional level of message granularity.
The checksum field is used to detect data corruption in the ICMPv6 message and parts of the IPv6 header.
ICMPv6 messages are grouped into two classes: error messages and informational messages. Error messages are identified as such by a zero in the high-order bit of their message Type field values. Thus, error messages have message types from 0 to 127; informational messages have message types from 128 to 255.
The Thread stack supports UDP for messaging between devices.
This User Datagram Protocol (UDP) is defined to make available a datagram mode of packet-switched computer communication in the environment of an interconnected set of computer networks, assuming that the Internet Protocol (IP) is used as the underlying protocol.
With UDP, applications can send data messages to other hosts on an IP network without prior communications to set up special transmission channels or data paths. UDP is suitable for purposes where error checking and correction is either not necessary or is performed in the application, avoiding the overhead of such processing at the network interface level.
The UDP format is as follows:
Source Port is an optional field, when meaningful, it indicates the port of the sending process, and may be assumed to be the port to which a reply should be addressed in the absence of any other information. If not used, a value of zero is inserted.
Destination Port has a meaning within the context of a particular internet destination address.
Length is the length in octets of this user datagram including this header and the data. (This means the minimum value of the length is eight.)
Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.