Network is the OSI Level 3 layer and is the internet layer in the TCP-IP model. Like Physical and MAC layers, network layer is also part of the infrastructure layer in IOT reference architecture.
This layer is responsible for addressing and routing of data packets. At this layer, the datagram from transport layer are encapsulated to data packets and delivered to their destinations using IP addressing. IPv4 had been the standard protocol for network layer until now. The IPv4 has a limited address space which has been already exhausted and incapable to cope up with the scalability of the IOT applications. The new IPv6 standard has been developed to accommodate address space sufficient to enable addressing the billions of IOT devices. There are also many protocol stacks which are based on IPv6 addressing that are developed considering IOT scenario. The popular network layer protocols are as follow –
• IPv6 over Bluetooth Low Energy
• IPv6 over G.9959
IP version 4 (IPv4) –
IPv4 is still the widely used network layer protocol used for networking computers. IPv4 addresses are expressed as dotted decimal numbers. The address consist of four octets (32-bit number) divided into two parts – network address to uniquely identify a TCP-IP or IOT network and host address to identify host within the identified network. A subnet mask is used along with the 32-bit IP address to uniquely identify a host (computer or IOT device). The subnet mask is also a 32-bit number. The subnet mask helps in identifying the exact location of the host device. The routers extract the network address from the IPv4 address and compare it with a route table to identify the network and the data packet is first delivered to the target network. Then, the subnet mask is used to uniquely identify the host and deliver the data packet to the host device.
In the standard, there are five IPv4 classes – A, B, C, D and E. The class of an IPv4 address is identified by the first octet of the IP address. The classes A, B and C are most commonly used. The class D is reserved for multi-casting and Class E for experimental purposes.
In class A IPv4 address, first octet is used to identify network and remaining three octet are used to identify the host. This addressing class is generally used in networks having large number of host devices. The first bit of the first octet is always set to 0, so, the first octet can have a decimal value in range from 1 to 127. The value of 127 for first octet in class A address remains reserved for loopback IP address or localhost, so values only from 1 to 126 remains available. The default subnet mask for class A is 255.0.0.0. With this addressing scheme, maximum 126 networks and maximum 16777214 host devices in each network can be uniquely identified.
In class B IPv4 address, first two octet are used to identify network and last two octet are used to identify host device. The first two bits in first octet of Class B address is always set to 10, so the network address can range from 128.0.X.X to 191.255.X.X. The default subnet mask for class B address is 255.255.0.0. With this addressing scheme, maximum 16384 networks and maximum 65534 host devices in each network can be uniquely identified.
In class C IPv4 address, first three octet are used to identify network and last octet is used to identify host device. The first three bits in first octet of Class C address is always set to 110, so its value can range from 192 to 223. The network address can range from 192.0.0.X to 223.255.255.X. The default subnet mask for class B address is 255.255.255.0. With this addressing scheme, maximum 2097152 networks and maximum 254 host devices in each network can be uniquely identified.
Suppose, a class C IPv4 address be 192.168.8.1 and a subnet mask be 255.255.255.0. The subnet mask in binary converts to 11111111.11111111.11111111.00000000, which implies that first three octet are the network address and the last octet is the host address. So, in the IP address 192.168.8.1, 192.168.8.0 will be the network address and 000.000.000.1 will be the host address.
There is only address space for 4,294,967,296 addresses in IPv4 standard. This address space has already exhausted and is not scalable to accommodate the billions of IOT devices. So, IPv6 has been introduced to expand address space for the IOT.
IP version 6 (IPv6) –
IP Version 6 is an interoperable successor of IPv4. The address space in IPv4 is limited to roughly 4.3 billion devices. There will be 20 billion IOT devices alone by the year 2020. So, an IP addressing standard that would be scalable to cater to the future IOT infrastructure was the need of the time.
Compared to 32-bit addresses in IPv4, there are 128-bit addresses in IPv6. The address is divided into eight 16-bit blocks where each block can be represented by a 4-digit hexadecimal number. each block in the IPv6 address is separated by a semi-colon. So, a typical IPv6 address would look like 77AD:45DF:A23D:8:2D:76DF:245:AF. There are eight blocks in the address – 77AD, 45DF, A23D, 8, 2D, 76DF, 245 and AF.
Each block is separated by a semicolon in the address.
There can be three types of addresses in IPv6 standard –
1) Unicast address – address to identify a single interface
2) Multicast address – address to identify multiple interfaces grouped into different nodes
3) Anycast address – address to identify single interface in a set of interfaces belonging to different nodes
With 128-bit addresses, IPv6 can be used to identify 340 trillion trillion trillion (38X1038) devices which is roughly 667 sextillion (667X1021) devices per square meter on earth. This is more than enough for the farthest future of the IOT.
IPv6 Low Power Wireless Personal Area Network (6LoWPAN) is an IPv6 standard based network layer protocol for Wireless Personal Area Networks. Based on 802.15.4 protocol at physical layer, the standard has been developed for addressing of IOT sensors and devices in a Wireless Sensor Network (WSN). This protocol is a modified version of IPv6 with intention to implement Internet protocol to each and every devices (constrained devices as well as large devices) and the low power devices with limited capabilities like less memory, lossy network etc. IPv6 operates only at 2.4 GHz frequency range with 250 Kbps transfer data rate.
6LoWPAN networks connect to the Internet via a gateway (WiFi or Ethernet), which does some process for protocol conversion so that device can communicate with Internet. Specifically, the adaptation layer performs the following three optimizations in order to reduce communication overhead –
1) Header Compression – Ipv6 supports packet header length of 127 byte. So, 6loWPAN defines header compression of IPv6 packets for decreasing the overhead of IPv6.
2) Fragmentation – The minimum MTU size (maximum transmission unit) of IPv6 is 1280 bytes. On the other hand, the maximum size of a frame in IEEE 802.15.4 is 127 bytes. Therefore, the IPv6 packet need to be fragmented. This is done by the adaptation layer.
3) Link Layer Forwarding – 6LoWPAN also supports mesh under routing, which is done at the link layer using link level short addresses. This feature can be used to communicate within a 6LoWPAN network.
Developed by IETF, 6TiSCH is a IPv6 standard for 802.15.4 MAC layer protocols. The standard allows IPv6 addresses to pass through Time-Slotted Channel Hopping (TSCH) mode of IEEE 802.15.4e MAC layer, so that the IPv6 adaption layer can be used for industrial automation and Low Power Lossy Networks (LLN).
Developed by IETF group, IPv6 over Networks of Resource-constrained Nodes (6Lo) is IPv6 based network access protocol for data links that were left excluded by 6LoWPAN and 6TiSCH. For example, IPv6 standardization over BLE, NFC, IEEE 802.11ah and many other MAC layer protocols will be included in this standard.
IPv6 over Bluetooth Low Energy –
This is an IPv6 adaption layer standard for Bluetooth 4.0 MAC layer protocol. The standard excludes the fragmentation feature of 6LoWPAN as there is already segmentation and reassembly feature of Logical Link Control and Adaptation Protocol (L2CAP) packets within BLE stack.
IPv6 over G.9959 –
This is an IPv6 addressing standard for G.9959 MAC layer protocol. G.9959 is a network access protocol stack designed for wireless networking of low power devices in a Personal Area Network (PAN).
So, the IPv6 and the protocol stacks based on it are the future of IOT applications. It has enough address space for any futuristic IOT infrastructure. In the next tutorial, transport layer protocols will be discussed.