UNIT-4 Data Link Layer of IoT
UNIT-4 Data Link Layer of IoT
UNIT-4 Data Link Layer of IoT
3. Reader mode: Using NFC the device reads passive RFID device. The RF field is generated by an
active NFC device. This enables the passive device to communicate.
➔ The RFID reader is a network-connected device that can be portable or permanently attached.
➔ It uses radio waves to transmit signals that activate the tag.
➔ Once activated, the tag sends a wave back to the antenna, where it is translated into data.
➔ The transponder is in the RFID tag itself.
➔ The read range for RFID tags varies based on factors including the type of tag, type of reader,
RFID frequency and interference in the surrounding environment or from other RFID tags and
readers.
➔ Tags that have a stronger power source also have a longer read range.
➔ RFID tags can store a range of information from one serial number to several pages of data.
➔ Readers can be mobile so that they can be carried by hand, or they can be mounted on a post or
overhead.
➔ Reader systems can also be built into the architecture of a cabinet, room, or building.
Features of RFID:
➔ A unique ID: As automation and artificial intelligence become increasingly prevalent in business;
there needs to be a closer relationship between computers and the physical environment. RFID
provides the means to accurately identify individual components, batches of materials,
construction equipment, retail goods, or other items.
➔ Automatic recognition: Tags are attached to items and transmit the stored ID to readers. The
readers may be positioned at fixed points such as ‘goods out’ or ‘goods in’ or at specific locations
within a chemical processing plant, As each item passes by, the reader will automatically scan
the ID.
➔ No need for batteries: Passive RFID tags – the most common type – are activated by the reader’s
power source so they do not require batteries. This means that tags can be very small – tiny
enough for them to be embedded in miniature devices. They also have a very long life and some
can survive outdoors in all conditions for ten years and beyond. Typically, passive tags are used
for items that need to be read within a range from 1mm up to about 10m.
➔ Can detect ‘hidden’ objects: Unlike bar codes, with RFID the object being scanned does not
necessarily have to be within the direct line of sight. Files in racks or items moving on conveyor
belts, can be detected simply by positioning the reader correctly.
➔ Multiple tags can be read at once: One RFID reader can collect data from a large number of tags
simultaneously – unlike barcodes where each item has to be scanned separately. This makes it
possible to collect data en masse which can save a huge amount of time. The contents of an
entire pallet can be scanned as it leaves the warehouse, or a stock check of the contents of a
shelving rack can be carried out without removing each item.
➔ Rugged and weatherproof: RFID tags can be more robust than barcodes or other print labels
and can be used even in the most demanding environments.
➔ Tracking assets and managing inventory
➔ Saving time and money through automation
➔ Improving data accuracy and availability
An loT/M2M communication gateway can access a Wireless Wide Area Network (WWAN).
The network access may use a GPRS cellular network or a new-generation cellular network for
Internet access.
A mobile phone provision for a USB wired port, BT, and Wi-Fi connectivity. Wireless
connectivity for the Internet uses data connectivity using GSM, GPRS, UMTS/LTE, and WiMax
services of a mobile service provider or Wi-Fi using a modem. A phone, generally, provisions for a
number of sensors also; for example, acceleration, GPS, and proximity.
Wireless USB
Wireless USB is a wireless extension of USB 2.0 and it operates at ultra-wideband (UWB)
5.1 GHz to 10.6 GHz frequencies. It is for short-range personal area networks (high speed 480 Mbps
3 m or 110 Mbps 10 m chanrnel). FCC recommends a host wire adapter (HWA) and a device wire
adapter (DWA), which provides a wireless USB solution. Wireless USB also supports dual-role
devices (DRDs). A device can be a USB device as well as a limited-capability host.
➔ Maximum 127 devices can connect with a host. USB standard provides a fast (up to 12 Mbps) as
well as a low-speed (up to 1.5 Mbps) serial transmission and reception between the host and
serial devices. Both the host and device can function in a system.
➔ USB three standards are USB 1.1 (1.5 and 12 Mbps), 2.0 (mini size connector) 480 Mbps, 3.0
(micro size connector) 5 Gbps and 3.1 (super speed 10 Gbps).
Features of a USB are:
➔ USB data format and transfer serial signals are Non-Return to Zero (NRZI) and the clock is
encoded by inserting synchronous code (SYNC) field before each packet.
➔ The receiver synchronises bit recovery clock continuously.
➔ The data transfer is of four types-controlled data transfer, bulk data transfer, interrupt-driven
data transfer and isosynchronous transfer.
➔ USB is a polled bus.
➔ Polling mode functions as: A host controller regularly polls the presence of a device as scheduled
by the software. It sends a token packet. The token consists of fields for type, direction, USB
device address and device end-point number.
➔ The device does handshaking through a handshake packet, indicating successful or unsuccessful
transmission. A CRC field in a data packet permits error detection.
➔ A USB supports three types of pipes-Stream with no USB-defined protocol is used when the
connection is already established and the data flow starts,
➔ Default control ís for providing access. Message is for control functions of the device. The host
configures each pipe with the data bandwidth to be used, transfer service type and buffer sizes.
Ethernet
The most popular and oldest LAN technology is Ethernet Protocol, so it is more frequently
used in LAN environments and is used in almost all networks like offices, homes, public places,
enterprises, and universities. Ethernet has gained huge
popularity because of its maximum rates over longer
distances using optical media.
➔ Ethernet standard is IEEE 802.2 (ISO 8802.2)
protocol for local area networks of computers,
workstations, and device LANs. Each frame at a LAN
consists of a header.
➔ Ethernet enables the services of local device nodes, computers, systems, and local resources,
such as printers, hard disk space, software, and data.
➔ the main reason to use Ethernet widely is, simple to understand, maintain, and implement,
provides flexibility and permits less cost network implementation.
How Ethernet Protocol Works?
Ethernet protocol mainly works in the first two layers in the OSI network model data-link &
physical. Ethernet at the first layer uses signals, bitstreams that move on the media, physical
components that situate signals on media & different topologies.
➔ Ethernet plays a key role at Layer 1 in the communication that occurs between different devices,
however, every function of this has some limitations.
➔ The sub-layers of Data Link give significance to technological compatibility & computer
communications.
➔ Ethernet protocol simply divides the Data Link layer functions into two separate sublayers like
the Logical Link Control sublayer & the Media Access Control sublayer.
➔ The functions of the Data Link layer in the OSI model are allocated to both the sublayers like
LLC & MAC.
➔ The Logical Link Control (LLC) handles the communication between the upper layers & the
lower layers.
➔ The LLC layer uses the data of network protocol like IPv4 packet & adds control data to help in
delivering the packet toward the destination node.
➔ The second layer (Layer 2) interacts through the higher layers using LLC which can be
implemented within software & its implementation is independent of the physical devices.
Advantages
The advantages of Ethernet protocol include the following.
➔ Uses wired bus topology, and transmission speeds are 10 Mbps, 100 Mbps (unshielded and
shielded wires), 1 Gbps (high-quality coaxial cable), 4 Gbps (in twisted pair wiring mode), and 10
Gbps (fiber-optic cables).
➔ Uses MAC-based on CSMA/CD (Carrier Sense Multiple Access with Collision Detection). The
CSMA/CD mode is half-duplex (wired mode) which means transmit (Tx) and receive (Rx) signals
can be sent on the same wire or data path.
➔ Security, speed, efficiency, and reliability.
➔ The Gigabit Ethernet provides very fast speed like 1Gbps. Its speed mainly ranges from above 10
times as compared to Fast Ethernet.
➔ Less cost.
Applications
The applications of Ethernet protocol include the following.
➔ It is simply used for connecting several devices within a network through each other.
➔ It is also used for connecting Wi-Fi router to the entry port of an internet otherwise telephone
line.
➔ It can also be used to connect devices wirelessly that need a network or internet to work like
laptops, TV, electronic gadgets, etc.
➔ These are used in different organizations like hospitals. Companies, schools, etc
➔ These are very famous due to their security, dependability & speed.
Network is the OSI Level 3 layer and is the internet layer in the TCP-IP model. Like Physical
and MAC layers, the 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 the transport layer is encapsulated in data packets and delivered to their
destinations using IP addressing. IPv4 had been the standard protocol for the network layer until
now. The IPv4 has a limited address space which has already been exhausted and is incapable to
cope 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.
IPv4
An IP stands for internet protocol. An IP address is assigned to each device connected to a
network. Each device uses an IP address for communication. It also behaves as an identifier as this
address is used to identify the device on a network. It defines the technical format of the packets.
Mainly, both the networks, i.e., IP and TCP, are combined together, so together, they are referred to
as a TCP/IP. It creates a virtual connection between the source and the destination.
We can also define an IP address as a numeric address assigned to each device on a network.
An IP address is assigned to each device so that the device on a network can be identified uniquely.
To facilitate the routing of packets, TCP/IP protocol uses a 32-bit logical address known as
IPv4(Internet Protocol version 4).
An IP address consists of two parts, i.e., the first one is a network address, and the other one
is a host address.
Network part: The network part indicates the distinctive variety that’s appointed to the network.
The network part conjointly identifies the category of the network that’s assigned.
Host Part: The host part uniquely identifies the machine on your network. This part of the IPv4
address is assigned to every host.
IPv4
IPv4 is version 4 of IP. It is a current version and the most commonly used IP address. It is a
32-bit address written in four numbers separated by a 'dot', i.e., periods. This address is unique for
each device.
For example, 66.94.29.13
➔ The above example represents the IP address in which each group of numbers separated by
periods is called an Octet. Each number in an octet is in the range of 0-255.
➔ This address can produce 4,294,967,296 possible unique addresses.
Characteristics of IPv4
➔ IPv4 could be a 32-Bit IP Address.
➔ IPv4 could be a numeric address, and its bits are separated by a dot.
➔ The number of header fields is twelve and the length of the header field is twenty.
➔ It has Unicast, broadcast, and multicast styles of addresses.
➔ IPv4 supports VLSM (Virtual Length Subnet Mask).
➔ IPv4 uses the Post Address Resolution Protocol to map to the MAC address.
➔ RIP may be a routing protocol supported by the routed daemon.
➔ Networks ought to be designed either manually or with DHCP.
➔ Packet fragmentation permits from routers and causes host.
➔ Option: Optional information such as source route, record route. Used by the Network
administrator to check whether a path is working or not.
➔ Due to the presence of options, the size of the datagram header can be of variable length (20
bytes to 60 bytes).
IPv6
Protocol Version 6 is a network layer protocol that allows communication to take place over
the network. IPv6 was designed by Internet Engineering Task Force (IETF) in December 1998 with
the purpose of superseding the IPv4 due to the global exponentially growing number of internet
users.
The common type of IP address (is known as IPv4, for “version 4”). Here’s an example of what
an IP address might look like:
25.59.209.224
An IPv4 address consists of four numbers, each of which contains one to three digits, with a
single dot (.) separating each number or set of digits.
➔ Each of the four numbers can range from 0 to 255. This group of separated numbers creates the
addresses that let you and everyone around the globe send and retrieve data over our Internet
connections.
➔ The IPv4 uses a 32-bit address scheme allowing to store 2^32 addresses which is more than 4
billion addresses.
➔ To date, it is considered the primary Internet Protocol and carries 94% of Internet traffic. Initially,
it was assumed it would never run out of addresses but the present situation paves a new way to
IPv6, let’s see why? An IPv6 address consists of eight groups of four hexadecimal digits.
➔ Here’s an example IPv6 address:
3001:0da8:75a3:0000:0000:8a2e:0370:7334
➔ This new IP address version is being deployed to fulfill the need for more Internet addresses. It
was aimed to resolve issues which are associated with IPv4.
➔ With 128-bit address space, it allows 340 undecillion unique address spaces. IPv6 is also called
IPng (Internet Protocol next generation).
➔ IPv6 support a theoretical maximum of 340, 282, 366, 920, 938, 463, 463, 374, 607, 431, 768,
211, 456. To keep it straightforward, we will never run out of IP addresses again.
➔ Multicast addresses It represents a group of IP devices and can only be used as the destination
of a datagram.
➔ Anycast addresses It is assigned to a set of interfaces that typically belong to different nodes.
Advantages of IPv6
➔ Reliability
➔ Faster Speeds: IPv6 supports multicast rather than broadcast in IPv4.This feature allows
bandwidth-intensive packet flows (like multimedia streams) to be sent to multiple destinations
all at once.
➔ Stronger Security: IPSecurity, which provides confidentiality, and data integrity, is embedded into
IPv6.
➔ Routing efficiency
➔ Most importantly it’s the final solution for growing nodes in Global-network.
6LoWPAN
Internet layer IPv6 receives and transmits from/to the adaptation 6LoWPAN protocol layer.
The data stack uses 6LoWPAN (IPv6 Over Low is used at Adaptation Power Wireless Personal Area
Network) protocol at the adaptation layer before a data laver before the data stack transmits to IPv6
Internet layer. A stack transmits to IPv6 IEEE 802.15.4 WPAN device has a 6LowPAN interface serial
port Internet layer for connectivity.
➔ 6LoWPAN is an adaptation-layer protocol for IEEE 802.15.4 network devices. The devices are
the nodes having low speed and low power.
➔ They are the WPAN nodes of a multiple-device mesh network. Low-power devices need to limit
data size per instance.
➔ Data compression reduces data size. Fragmentation of data also reduces data size per instance.
Features of 6LoWPAN are header compression, fragmentation and reassembly.
➔ When data is fragmented before communication, the first fragment header has 27 bits which
include the datagram size (11 bits) and a datagram tag (16 bits).
➔ Subsequent fragments have header 8 bits which include the datagram size, datagram tag and
offset. Fragments reassembly time limit can be set equal to 60s.
➔ Figure (a) shows networked devices physical layer in IEEE 802.15.4 WPAN.
➔ Figure (b) shows data-link sublayer and adaptation layer 6LoWPAN protocol
➔ Figure shows that IPv6 over IEEE 802.15.4 standard network nodes uses the headers, security
and application data as follows: IPvó header = 40 B; UDP header = 8 B. device node MAC
address 25 B; AES-128 security = 21 B; Total device node frame size = 127 B (maximum).
Therefore, maximum 33 Octets are left for the application data from the device. MAC is data
communication protocol sublayer at the data-link layer.
➔ IPv6 Maximum Transmission Unit (MTU) at link layer 1280 B. Therefore, link-layer frame
fragmentation is needed in order to communicate a frame of 127 B over IEEE 802.15.4 nodes
(device). The frame MTU is 1280 B for transmission to the network layer. Fragments from frames
from the device of 127 B each reassemble into an IPv6 frame. Also, IPv6 MTU at data-link layer
1280 B fragments into frames of 127 B each for a single transfer to a device node.
➔ Specifies the IETF recommended methods for the reassembly of fragments and IPv6.
➔ 6LoWPAN can be implemented using Berkley IP implementation with the operating system
TinyOS or 3BSD or other implementations for IoT nodes from Sensinode or Hitachi or others.
IPv6 network layer has two options, viz. RH4 routing header and hop-to-hop header RPL option.
➔ It is used with IEEE 802.15,.4 in the 2.4 GHz band.
➔ Outdoor range: ~200 m (maximum)
➔ Data rate: 200kbps (maximum)
➔ a Maximum number of nodes: ~100
Advantages of 6LoWPAN:
➔ 6LoWPAN is a mesh network that is robust, scalable, and can heal on its own.
➔ It delivers low-cost and secure communication in IoT devices.
➔ It uses IPv6 protocol and so it can be directly routed to cloud platforms.
➔ It offers one-to-many and many-to-one routing.
➔ In the network, leaf nodes can be in sleep mode for a longer duration of time.
Applications of 6LoWPAN:
➔ It is a wireless sensor network.
➔ It is used in home automation,
➔ It is used in smart agricultural techniques, and industrial monitoring.
TCP/IP Suite
TCP/IP suite means a set of protocols with layers for the Internet. TCP/IP suite of Application
layers protocol examples are HTTPS, HTTP, protocols most used MQTT, XMPP, SOAP, FTP, TFTP,
Telnet, PoP3, SMTP, SSL/TLS protocols for the global and others for communication using TCP
stream. DNS, TFTP, Internet networking Bootpc, Bootps, SNMP, DHCP, CoAP, LWM2M and others
are for datagram communication using UDP Application layer security protocols are TLS and DTLS.
➔ TCP is a transport layer, connection-oriented protocol that enables acknowledged data flow.
➔ UDP is another transport layer protocol that is a connectionless protocol and is meant for
datagram communication.
➔ Other protocols in the TCP/IP suite for the transport layer are RSVP and DCCP. Internet layer
protocol is IPv4/1Pv6/RPL/ICMP/ICMPv6/IPSec or other. Data-link layer protocol is
PPP/ARP/RARP/NDP, MAC, or other.
➔ A MAC protocol is Ethernet or DSL or ISDN or other. Figure shows the protocol layers and
representative protocols at each layer.
TCP/UDP Transport Layer for the Data Stack from or to Application Layer Port Following
subsections describe the TCP and UDP transport layer protocols. TCP/IP transport layer receives or
transmits the data segment and datagram from or to a port at the application layer. Following
subsections describe TCP and UDP protocols.
➔ For example, When a user requests a web page on the internet, somewhere in the world, the
server processes that request and sends back an HTML Page to that user.
➔ The server makes use of a protocol called the HTTP Protocol. The HTTP then requests the TCP
layer to set the required connection and send the HTML file.
➔ Now, the TCP breaks the data into small packets and forwards it toward the Internet Protocol
(IP) layer. The packets are then sent to the destination through different routes.
➔ The TCP layer in the user’s system waits for the transmission to get finished and acknowledges
once all packets have been received.
Features of TCP/IP
Some of the most prominent features of Transmission control protocol are
1. Segment Numbering System: TCP keeps track of the segments being transmitted or being
received by assigning numbers to each and every single one of them. A specific Byte Number is
assigned to data bytes that are to be transferred while segments are assigned sequence numbers.
Acknowledgment Numbers are assigned to received segments.
2. Flow Control: Flow control limits the rate at which a sender transfers data. This is done to ensure
reliable delivery. The receiver continually hints to the sender on how much data can be received
(using a sliding window)
3. Error Control: TCP implements an error control mechanism for reliable data transfer
➔ Error control is byte-oriented
➔ Segments are checked for error detection
➔ Error Control includes – Corrupted Segment & Lost Segment Management, Out-of-order
segments, Duplicate segments, etc.
4. Congestion Control: TCP takes into account the level of congestion in the network. Congestion
level is determined by the amount of data sent by a sender
Advantages
➔ It is a reliable protocol
➔ It provides an error-checking mechanism as well as one for recovery
➔ It gives flow control
➔ It makes sure that the data reaches the proper destination in the exact order that it was sent
➔ Open Protocol, not owned by any organization or individual
➔ It assigns an IP address to each computer on the network and a domain name to each site thus
making each device site to be distinguishable over the network.
Disadvantages
➔ TCP is made for Wide Area Networks, thus its size can become an issue for small networks with
low resources
➔ TCP runs several layers so it can slow down the speed of the network
➔ It is not generic in nature. Meaning, it cannot represent any protocol stack other than the TCP/IP
suite. E.g., it cannot work with a Bluetooth connection.
UDP Header
➔ UDP header is an 8-bytes fixed and simple header, while for TCP it may vary from 20 bytes to 60
bytes.
➔ The first 8 Bytes contain all necessary header information and the remaining part consist of data.
➔ UDP port number fields are each 16 bits long, therefore the range for port numbers is defined
from 0 to 65535; port number 0 is reserved.
➔ Port numbers help to distinguish different user requests or processes.
➔ Source Port: Source Port is a 2 Byte long field used to identify the port number of the source.
➔ Destination Port: It is a 2 Byte long field, used to identify the port of the destined packet.
➔ Length: Length is the length of UDP including the header and the data. It is a 16-bits field.
➔ Checksum: Checksum is 2 Bytes long field. It is the 16-bit one’s complement of the one’s
complement sum of the UDP header, the pseudo-header of information from the IP header, and
the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.
Note: Unlike TCP, the Checksum calculation is not mandatory in UDP. No Error control or flow
control is provided by UDP. Hence UDP depends on IP and ICMP for error reporting.
Applications of UDP:
➔ Used for simple request-response communication when the size of data is less and hence there is
lesser concern about flow and error control.
➔ It is a suitable protocol for multicasting as UDP supports packet switching.
➔ UDP is used for some routing update protocols like RIP(Routing Information Protocol).
➔ Normally used for real-time applications which can not tolerate uneven delays between sections
of a received message.
➔ Following implementations use UDP as a transport layer protocol:
◆ NTP (Network Time Protocol)
◆ DNS (Domain Name Service)
◆ BOOTP, DHCP.
◆ NNP (Network News Protocol)
◆ Quote of the day protocol
◆ TFTP, RTSP, RIP.
➔ The application layer can do some of the tasks through UDP-
◆ Trace Route
◆ Record Route
◆ Timestamp
➔ UDP takes a datagram from Network Layer, attaches its header, and sends it to the user. So, it
works fast.