Network Layer Protocols: IOT Part 8

The network is the OSI Level 3 layer and is the Internet layer in the TCP-IP model. Just like the Physical and MAC layers, the network layer is also part of the infrastructure layer in the IOT reference architecture.
This layer is responsible for addressing and routing data packets. In this layer, transport layer datagrams are encapsulated into data packets and delivered to their destinations using IP addressing. IPv4 was the standard protocol for the network layer until now. IPv4 has a limited address space that is already exhausted and unable to handle the scalability of IOT applications. The new IPv6 standard was developed to accommodate enough address space to enable addressing billions of IoT devices. There are also many protocol stacks based on IPv6 addressing developed considering the IOT scenario. The popular network layer protocols are as follows –
• IPv4
•IPv6
• 6LoWPAN
• 6TiSCH
• 6Lo
• IPv6 over Bluetooth Low Energy
• IPv6 over G.9959
IP version 4 (IPv4) –
IPv4 is still the widely used network layer protocol for networked computers. IPv4 addresses are expressed as dotted decimal numbers. The address consists 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 the 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 identify the exact location of the host device. 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 delivered to the destination network first. 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. Classes A, B and C are the most commonly used. Class D is reserved for multicasting and class E for experimental purposes.
In class A IPv4 address, the first octet is used to identify the network and the remaining three octets are used to identify the host. This addressing class is generally used in networks with a 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 the range 1 to 127. The value 127 for the first octet in the class A address remains reserved for loopback or local host IP address , therefore only values ​​1 to 126 remain available. The default subnet mask for class A is 255.0.0.0. With this addressing scheme, a maximum of 126 networks and a maximum of 16777214 host devices on each network can be uniquely identified.
In IPv4 class B address, the first two octets are used to identify the network and the last two octets are used to identify the host device. The first two bits in the first octet of the Class B address are always set to 10, so the network address can range from 128.0.XX to 191.255.XX. The default subnet mask for class B address is 255.255.0.0. With this addressing scheme, a maximum of 16,384 networks and a maximum of 65,534 host devices on each network can be uniquely identified.
In IPv4 class C address, the first three octets are used to identify the network and the last octet is used to identify the host device. The first three bits of the first octet of the Class C address are always set to 110, so their 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, a maximum of 2,097,152 networks and a maximum of 254 host devices on each network can be uniquely identified.
Suppose a Class C IPv4 address is 192.168.8.1 and a subnet mask is 255.255.255.0. The subnet mask in binary is converted to 11111111.11111111.11111111.00000000, which implies that the first three octets are the network address and the last octet is the host address. So in 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 the IPv4 standard. This address space has already been exhausted and is not scalable to accommodate billions of IoT devices. Therefore, IPv6 was introduced to expand the address space for IOT.
IP version 6 (IPv6) –
IP Version 6 is an interoperable successor to IPv4. The address space in IPv4 is limited to approximately 4.3 billion devices. There will be 20 billion IOT devices by the year 2020 alone. Therefore, an IP addressing standard that was scalable to meet 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 semicolons. Therefore, a typical IPv6 address would look like 77AD:45DF:A23D:8:2D:76DF:245:AF. There are eight blocks at 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 the IPv6 standard –
1) Unicast Address – address to identify a single interface
2) Multicast address – address to identify multiple interfaces grouped on different nodes
3) Anycast Address – address to identify a 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), which equates to approximately 667 sextillion (667X1021) devices per square meter on Earth. This is more than enough for the more distant future of IOT.
6LoWPAN –
IPv6 Low Power Wireless Personal Area Network (6LoWPAN) is a network layer protocol based on the IPv6 standard for wireless personal area networks. Based on the 802.15.4 protocol at the physical layer, the standard was developed for addressing sensors and IOT devices in a Wireless Sensor Network (WSN). This protocol is a modified version of IPv6 with the intention of implementing the Internet protocol for each and every device (constrained devices as well as large devices) and low power devices with limited capabilities such as less memory, network with losses, etc. IPv6 operates only in 2.4 GHz frequency band with data transfer rate of 250 Kbps.
6LoWPAN networks connect to the Internet through a gateway (WiFi or Ethernet), which performs some protocol conversion process so that the device can communicate with the Internet. Specifically, the adaptation layer performs the following three optimizations to reduce communication overhead –
1) Header Compression – IPv6 supports packet header length of 127 bytes. Therefore, 6loWPAN defines IPv6 packet header compression to decrease IPv6 overhead.
2) Fragmentation – The minimum MTU (maximum transmission unit) size 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 needs to be fragmented. This is done by the adaptation layer.
3) Link Layer Routing – 6LoWPAN also supports mesh routing, which is done at the link layer using short link-level addresses. This feature can be used for communication on a 6LoWPAN network.
6TiSCH –
Developed by the IETF, 6TiSCH is an IPv6 standard for 802.15.4 MAC layer protocols. The standard allows IPv6 addresses to pass through the Time-Slotted Channel Hopping (TSCH) mode of the IEEE 802.15.4e MAC layer, so that the IPv6 adaptation layer can be used for industrial automation and low power loss networks (LLN).
6Lo –
Developed by the IETF group, IPv6 over resource-limited node networks (6Lo) is an IPv6-based network access protocol for data links that were 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 adaptation layer standard for the Bluetooth 4.0 MAC layer protocol. The standard excludes the fragmentation feature of 6LoWPAN, as a Logical Link Control and Adaptation Protocol (L2CAP) packet segmentation and reassembly feature already exists in the BLE stack.
IPv6 over G.9959 –
This is an IPv6 addressing standard for the 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).
Therefore, IPv6 and 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.

Back to the blog

Leave a comment

Comments need to be approved before publication.