Unit 3
Unit 3
IPv4
      IP stands for Internet Protocol version v4 stands for Version Four (IPv4), is the most
       widely used system for identifying devices on a network.
      It uses a set of four numbers, separated by periods (like 192.168.0.1), to give each device
       a unique address. This address helps data find its way from one device to another over the
       internet.
IP Address
An IP address (Internet Protocol address) is a unique identifier assigned to each device connected
to a network that uses the Internet Protocol for communication. It serves two main purposes:
 Identification: It uniquely identifies a device on a network.
 Location Addressing: It indicates where a device is located within a network, making data
    routing possible.
   Binary Representation
   IPv4 is basically converted into binary form by computer although these are usually seen in
   decimal form for human readability. Each octet is converted into 8 bit binary number . For
   instance 185.107.80.231 in binary looks like:
185: 10111001
107: 01101011
80: 01010000
231: 11100111
Classes of IP Addressing
The 32-bit IP address is divided into five sub-classes. These are given below:
      Class A
      Class B
      Class C
      Class D
      Class E
Each of these classes has a valid range of IP addresses. Classes D and E are reserved for
multicast and experimental purposes respectively.
All the five classes are identified by the first octet of IP Address.
The first octet referred here is the left most of all. The octets numbered as follows depicting
dotted decimal notation of IP Address –
The number of networks and the number of hosts per class can be derived by
this formula
Class A Address
The first bit of the first octet is always set to 0 (zero). Thus the first octet ranges from 1 –
127, i.e.
Class A Addresses
Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range
127.x.x.x is reserved for loopback IP addresses.
The default subnet mask for Class A IP address is 255.0.0.0 which implies that Class A
addressing can have 126 networks (27-2) and 16777214 hosts (224-2).
Class B Address
An IP address which belongs to class B has the first two bits in the first octet set to 10, i.e.
Class B IP Addresses range from 128.0.x.x to 191.255.x.x. The default subnet mask for Class
B is 255.255.x.x. Class B has 16384 (214) Network addresses and 65534 (216-2) Host
addresses.        Class          B           IP         address            format            is:
10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
Class C Address
The first octet of Class C IP address has its first 3 bits set to 110, that is –
Class C IP addresses range from 192.0.0.x to 223.255.255.x. The default subnet mask for
Class C is 255.255.255.x. Class C gives 2097152 (2 21) Network addresses and 254 (2 8-2)
Host       addresses.       Class       C       IP        address       format        is:
110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH
Class D Address
   Very first four bits of the first octet in Class D IP addresses are set to 1110, giving a range of
   Class D has IP address range from 224.0.0.0 to 239.255.255.255. Class D is reserved for
   Multicasting. In multicasting data is not destined for a particular host, that is why there is no
   need to extract host address from the IP address, and Class D does not have any subnet mask.
Class E Address
   This IP Class is reserved for experimental purposes only for R&D or Study. IP addresses in
   this class ranges from 240.0.0.0 to 255.255.255.254. Like Class D, this class too is not
   equipped with any subnet mask.
             Unicast Addressing Mode: This addressing mode is used to specify single sender
              and single receiver. Example: Accessing a website.
             Broadcast Addressing Mode: This addressing mode is used to send messages to
              all devices in a network. Example: sending a message in local network to all the
              devices.
             Multicast Addressing Mode: This addressing mode is typically used within a local
              network or across networks and sends messages to a group of devices. Example:
              Streaming audio to multiple devices at once.
IPv6
      The next generation Internet Protocol (IP) address standard, known as IPv6, is meant to
       work in cooperation with IPv4.
      To communicate with other devices, a computer, smartphone, home automation
       component, Internet of Things sensor, or any other Internet-connected device needs a
       numerical IP address. Because so many connected devices are being used, the original IP
       address scheme, known as IPv4, is running out of addresses.
      This new IP address version is being deployed to fulfil the need for more Internet
       addresses. With 128-bit address space, it allows 340 undecillion unique address space.
       IPv6 support a theoretical maximum of 340, 282, 366, 920, 938, 463, 463, 374, 607, 431,
       768, 211, 456.
Representation of IPv6
An IPv6 address consists of eight groups of four hexadecimal digits separated by ‘ . ‘ and
each Hex digit representing four bits so the total length of IPv6 is 128 bits. Structure given
below.
The first 48 bits represent Global Routing Prefix. The next 16 bits represent the student ID
and the last 64 bits represent the host ID. The first 64 bits represent the network portion and
the last 64 bits represent the interface id.
      Global Routing Prefix: The Global Routing Prefix is the portion of an IPv6 address
       that is used to identify a specific network or subnet within the larger IPv6 internet. It
       is assigned by an ISP or a regional internet registry (RIR).
      Student Id: The portion of the address used within an organization to identify subnets.
       This usually follows the Global Routing Prefix.
         Host Id: The last part of the address, is used to identify a specific host on a network.
Example: 3001:0da8:75a3:0000:0000:8a2e:0370:7334
Now that we know about what is IPv6 address let’s take a look at its different types.
         Unicast Addresses : Only one interface is specified by the unicast address. A packet
          moves from one host to the destination host when it is sent to a unicast address
          destination.
         Multicast Addresses: It represents a group of IP devices and can only be used as the
          destination of a datagram.
         Anycast Addresses: The multicast address and the anycast address are the same. The
          way the anycast address varies from other addresses is that it can deliver the same IP
          address to several servers or devices. Keep in mind that the hosts do not receive the
          IP address. Stated differently, multiple interfaces or a collection of interfaces are
          assigned an anycast address.
Features of IPSec
Working of IPSec
IPSec works by creating secure connections between devices, making sure that the information
exchanged is kept safe from unauthorized access.
IPSec majorly operates in two ways i.e. Transport Mode and Tunnel Mode.
To provide security, IPSec uses two main protocols: AH (Authentication Header) and ESP
(Encapsulating Security Payload). Both protocols are very useful as Authentication Header
verifies the data that whether it comes from a trusted source and hasn’t been changed, and ESP
has the work of performing authentication and also encrypts the data so that it becomes
difficult to read.
For Encryption, IPSec uses cryptographic keys. It can be created and shared using a process
called IKE (Internet Key Exchange), that ensures that both devices have the correct keys to
establish a secure connection.
When two devices communicate using IPSec, the devices first initiate the connection by sending
a request to each other. After that, they mutually decide on protection of data using passwords or
digital certificates. Now, they establish the secure tunnel for communication. Once the tunnel is
set up, data can be transmitted safely, as IPSec is encrypting the data and also checking the
integrity of the data to ensure that data has not been altered. After the communication is finished,
the devices can close the secure connection.
IPSec Connection Establishment Process
IPSec is a protocol suite used in securing communication using the Internet Protocol such that
each packet communicated in the course of a particular session is authenticated and encrypted.
The process of establishing an IPSec connection involves two main phases:
In phase 1, the main aim is to establish the secure channel the IKE tunnel, which is used to
further negotiations. Phase 1 can operate in one of two modes:
Main Mode: Main Mode is a six-message exchange procedure that is more secure than Basic
Mode, although at the cost of a longer session, since identity information is transmitted during
negotiations.
Aggressive Mode: Aggressive Mode takes lesser time with the exchange of three messages and
is less secure since more information like identity is disclosed during the course of negotiation.
Phase 2 is called Quick Mode and its aim is to negotiate the IPSec Security Associations after
the construction of a secure IKE tunnel has been made. There are two modes in Phase 2.
Tunnel Mode: This mode encapsulates the whole of the original IP packet including the
header and data. It is mostly deployed in the site to site VPNs.
Transport Mode: By this mode, only the actual data to be transmitted is encrypted and the
header part of the IP packets remain unaltered. It is mainly employed in end to end
communication between hosts.
   Difference Between IPSec Tunnel Mode and IPSec Transport Mode
   The IPSec tunnel mode is appropriate for sending data over public networks because it improves
   data security against unauthorised parties. The computer encrypts all data, including the payload
   and header, and adds a new header to it.
   IPSec transport mode encrypts only the data packet’s payload while leaving the IP header
   unchanged. The unencrypted packet header enables routers to determine the destination address
   of each data packet. As a result, IPSec transport is utilized in a closed and trusted network, such
   as to secure a direct link between two computers.
   2. Authentication Header (AH): It also provides data integrity, authentication, and anti-replay
   and it does not provide encryption. The anti-replay protection protects against the unauthorized
   transmission of packets. It does not protect data confidentiality.
   EIGRP:
   Enhanced Interior Gateway Routing Protocol (EIGRP) is a dynamic routing protocol that is
   used to find the best path between any two-layer 3 devices to deliver the packet. EIGRP
   works on network layer Protocol of OSI model and uses protocol number 88. It uses metrics to
   find out the best path between two layer 3 devices (router or layer 3 switches) operating EIGRP.
   Administrative Distance for EIGRP are:-
   It uses some messages to communicate with the neighbour devices that operate EIGRP. These
   are:-
1. Hello message-These messages are kept alive messages which are exchanged between two
   devices operating EIGRP. These messages are used for neighbour discovery/recovery, if there
   is any device operating EIGRP or if any device (operating EIGRP) coming up again.
   These messages are used for neighbor discovery if multicast at 224.0.0.10. It contains values
   like AS (Autonomous System) number, k values, etc. These messages are used as
   acknowledgement when unicast. A hello with no data is used as the acknowledgement.
   RTO: If a multicast fails then unicast is being sent to that router. RTO is the time for which the
   local router waits for an acknowledgement of the packet.
3. Full Update – After exchanging hello messages or after the neighbourship is formed, these
   messages are exchanged. This message contains all the best routes.
4. Partial update-These messages are exchanged when there is a topology change and new links
   are added. It contains only the new routes, not all the routes. These messages are multicast.
5. Query message-These messages are multicast when the device is declared dead and it has no
   routes to it in its topology table.
6. Reply message – These messages are the acknowledgment of the query message sent to the
   originator of the query message stating the route to the network which has been asked in the
   query message.
7. Acknowledgement message
   It is used to acknowledge EIGRP updates, queries, and replies. Acks are hello packets that
   contain no data.
   Composite matrix-The EIGRP composite metric calculation can use up to 5 variables, but only
   2 are used by default (K1 and K3). The composite metric values are :
                                           K1 (bandwidth)
                                             K2 (load)
                                             K3 (delay)
                                           K4 (reliability)
                                             K5 (MTU)
   The lowest bandwidth, load, delay, reliability, MTU (maximum transmission unit) along the path
   between the source and the destination is considered in the composite matrix in order to calculate
   the                                                                                          cost.
   Note:- Generally, only k1 and k3 values are used for metric calculation by EIGRP. The values
   are 10100 for k1, k2, k3, k4, k5 respectively.
   Uses of ICMP
   ICMP is used for error reporting if two devices connect over the internet and some error
   occurs, So, the router sends an ICMP error message to the source informing about the error.
   Another important use of ICMP protocol is used to perform network diagnosis by making use
   of traceroute and ping utility.
        Traceroute: Traceroute utility is used to know the route between two devices
           connected over the internet. It routes the journey from one router to another, and a
           traceroute is performed to check network issues before data transfer.
        Ping: Ping is a simple kind of traceroute known as the echo-request message, it is used
           to measure the time taken by data to reach the destination and return to the source,
           these replies are known as echo-replies messages.
   Working of ICMP
          ICMP is the primary and important protocol of the IP suite, but ICMP isn’t associated
           with any transport layer protocol (TCP or UDP) as it doesn’t need to establish a
           connection with the destination device before sending any message as it is a
           connectionless protocol.
          The working of ICMP is just contrasting with TCP, as TCP is a connection-oriented
           protocol whereas ICMP is a connectionless protocol. Whenever a connection is
           established before the message sending, both devices must be ready through a TCP
           Handshake.
      ICMP packets are transmitted in the form of datagrams that contain an IP header
       with ICMP data. ICMP datagram is similar to a packet, which is an independent data
       entity.
    Type (8-bit): The initial 8-bit of the packet is for message type, it provides a brief
     description of the message so that receiving network would know what kind of message
     it is receiving and how to respond to it. Some common message types are as follows:
      Type 0 – Echo reply
      Type 3 – Destination unreachable
      Type 5 – Redirect Message
      Type 8 – Echo Request
      Type 11 – Time Exceeded
      Type 12 – Parameter problem
    Code (8-bit): Code is the next 8 bits of the ICMP packet format, this field carries some
     additional information about the error message and type.
    Checksum (16-bit): Last 16 bits are for the checksum field in the ICMP packet header.
     The checksum is used to check the number of bits of the complete message and
     enable the ICMP tool to ensure that complete data is delivered.
    The next 32 bits of the ICMP Header are Extended Header which has the work of
     pointing out the problem in IP Message.
    The last part of the ICMP packet is Data or Payload of variable length. The bytes
     included in IPv4 are 576 bytes and in IPv6, 1280 bytes.
Applications:
             Streaming – Multicast routing protocols are used for audio and video streaming
              over the network i.e., either one-to-many or many-to-many.
             Gaming – Internet group management protocol is often used in simulation games
              which has multiple users over the network such as online games.
             Web Conferencing tools – Video conferencing is a new method to meet people
              from your own convenience and IGMP connects to the users for conferencing and
              transfers the message/data packets efficiently.
The IGMP uses several types of messages to manage multicast group memberships:
      IGMP Membership Query: The Sent by routers to determine which multicast groups
       have members on a particular network segment. This query helps routers maintain
       accurate multicast group membership information.
      IGMP Membership Report: Sent by hosts to indicate their interest in joining a
       multicast group. This report informs the router of the presence of a host that wants to
       receive multicast traffic.
      IGMP Leave Group: Sent by hosts to indicate that they are leaving a multicast group.
       This message informs the router that the host no longer wants to receive traffic for that
       group.
     IGMP V3 Membership Report (in IGMPv3): This allows hosts to specify the exact
      multicast group addresses they want to join or leave and can include source-specific
      multicast (SSM) information.
Working of IGMP
     IGMP works on devices that are capable of handling multicast groups and dynamic
      multicasting. These devices allow the host to join or leave the membership in the
      multicast group. These devices also allow to add and remove clients from the group.
     This communication protocol is operated between the host and the local multicast router.
      When a multicast group is created, the multicast group address is in the range of class D
      (224-239) IP addresses and is forwarded as the destination IP address in the packet.
     L2 or Level-2 devices such as switches are used in between host and multicast router for
      IGMP snooping. IGMP snooping is a process to listen to the IGMP network traffic in
      controlled manner. Switch receives the message from host and forwards the membership
      report to the local multicast router.
     The multicast traffic is further forwarded to remote routers from local multicast routers
      using PIM (Protocol Independent Multicast) so that clients can receive the message/data
      packets. Clients wishing to join the network sends join message in the query and switch
      intercepts the message and adds the ports of clients to its multicast routing table.
Versions of IGMP
  IGMPv1 : The version of IGMP communication protocol allows all the supporting hosts to
  join the multicast groups using membership request and include some basic features. But,
  host cannot leave the group on their own and have to wait for a timeout to leave the
  group. The message packet format in IGMPv1:
          Version – Set to 1.
          Type – 1 for Host Membership Query and Host Membership Report.
          Unused – 8-bits of zero which are of no use.
          Checksum – It is the one’s complement of the sum of IGMP messages.
          Group Address – The group address field is zero when sent and ignored when
           received in membership query message. In a membership report message, the group
           address field takes the IP host group address of the group being reported.
IGMPv2 : IGMPv2 is the revised version of IGMPv1 communication protocol. It has added
functionality of leaving the multicast group using group membership. The message packet
format in IGMPv2:
Type:
0x11 for Membership Query
0x12 for IGMPv1 Membership Report
0x16 for IGMPv2 Membership Report
0x22 for IGMPv3 Membership Report
0x17 for Leave Group
 Max Response Time – This field is ignored for message types other than membership query.
   For membership query type, it is the maximum time allowed before sending a response
   report. The value is in units of 0.1 seconds.
 Checksum – It is the one’s complement of the sum of IGMP message. It determines the
   entire payload of the IP datagram in which IGMP message is encapsulated.
 Group Address – It is set as 0 when sending a general query. Otherwise, multicast address for
   group-specific or source-specific queries. The behavior of this field depends on the type of
   the message sent.
IGMPv3 : IGMPv2 was revised to IGMPv3 and added source-specific multicast and
membership report aggregation. These reports are sent to 224.0.0.22. The message packet format
in IGMPv3:
   Max Response Time – This field is ignored for message types other than membership query.
    For membership query type, it is the maximum time allowed before sending a response
    report. The value is in units of 0.1 seconds.
   Checksum – It is the one’s complement of the one’s complement of the sum of IGMP
    message.
   Group Address – It is set as 0 when sending a general query. Otherwise, multicast address for
    group-specific or source-specific queries.
   Resv – It is set zero of sent and ignored when received.
   S flag – It represents Suppress Router-side Processing flag. When the flag is set, it indicates
    to suppress the timer updates that multicast routers perform upon receiving any query.
   QRV – It represents Querier’s Robustness Variable. Routers keeps on retrieving the QRV
    value from the most recently received query as their own value until the most recently
    received QRV is zero.
   QQIC – It represents Querier’s Query Interval Code.
   Number of sources – It represents the number of source addresses present in the query. For
    general query or group-specific query, this field is zero and for group-and-source-specific
    query, this field is non-zero.
   Source Address[i] – It represents the IP unicast address for N fields.
Open Shortest Path First
       Open Shortest Path First (OSPF) is an IP routing protocol that uses a mathematical
        algorithm to calculate the most efficient path to direct traffic on IP networks. OSPF is an
        open standard and designated by the Internet Engineering Task Force (IETF) as one of
        several Interior Gateway Protocols (IGPs) within the family of TCP/IP protocols.
       Based on link-state or shortest path first (SPF) technology, OSPF distributes routing
        information between routers in a single autonomous system (AS). This capability
        differentiates OSPF from older TCP/IP routing protocols, which were designed for less
        complex networks than those used today.
       Using Dijkstra's shortest path algorithm, OSPF calculates the shortest path for all
        routers in an area of the AS to efficiently use network bandwidth and ensure scalability.
        The AS may be divided into multiple interconnected networks, such as a wide area
        network (WAN). The topology is visible only to the routers in the same area.
       As a dynamic routing protocol, OSPF not only routes IP packets based on the
        destination IP address (given in the packet header), but it also detects topological
        changes in the AS. After detecting changes, OSPF calculates new, loop-free routes
        after a short period (known as convergence time) in which routing traffic is kept to a
        minimum.
       All the routers in the same area of the OSPF network maintain the same link-state
        database that describes the area topology. Each router receives link-state
        advertisement (LSA) messages containing information about neighboring routers and
        path costs from the other routers in that area. Using these LSAs, each router generates the
        link-state database and uses the SPF algorithm to calculate a shortest-path spanning tree.
   Areas are groups of routers in an AS, essentially forming a collection of zones with
    logical boundaries. Areas are typically identified with a number. Area 0 is always the
    backbone, to which all other areas connect.
     In OSPF, the routers do not need to send the entire routing table to neighboring routers
        every few seconds. Instead, information is sent only when a change has taken place.
  When an OSPF router in a given area of the AS that learns of a routing table change or
      detects a change in the network immediately multicasts the information to all other
      OSPF-enabled nodes in the area. Multicasting is a way to ensure every router in
      that area has the same information about the AS topology, a concept known
      as flooding. This information is used to calculate the best end-to-end path to the eventual
      destination in the AS.
  Notably, the multicast contains only the latest update. Routing tables can be incredibly
      large, and retransmitting them in full every time can degrade network performance. When
      routes change -- which can occur due to equipment failure or the addition of new devices
      -- the time it takes OSPF routers to reconcile these changes and identify the best new,
      loop-free path between endpoints is called convergence time.
RPL
     RPL stands for Routing Protocol for Low Power and Lossy Networks for heterogeneous
      traffic networks. It is a routing protocol for Wireless Networks. This protocol is based
      on the same standard as by Zigbee and 6 Lowpan is IEEE 802.15.4 It holds both many-
      to-one and one-to-one communication.
     It is a Distance Vector Routing Protocol that creates a tree-like routing topology called
      the Destination Oriented Directed Acyclic Graph (DODAG), rooted towards one or more
      nodes called the root node or sink node.
     The Directed Acyclic Graphs (DAGs) are created based on user-specified specific
      Objective Function (OF). The OF defines the method to find the best-optimized route
      among the number of sensor devices.
     RPL is based on the concept of a Directed Acyclic Graph (DAG). A DAG is Directed
      Graph where no cycle exists. This means that from any vertex or point in the graph, we
      cannot follow an edge or a line back to this same point. All of the edges are arranged in a
      path oriented toward and terminating at one or more root nodes.
     A basic RPL process involves building a Destination Oriented Directed Acyclic Graph
      (DODAG). A DODAG is a DAG rooted in one destination. In RPL this destination
      occurs at a border router known as the DODAG root. In a DODAG, three parents
      maximum are maintained by each node that provides a path to the root. Typically one of
      these parents is the preferred parent, which means it is the preferred next hop for upward
      roots towards the root. The routing graph created by the set of DODAG parents across all
      nodes defines the full set of upwards roots. RPL protocol information should ensure that
      routes are loop-free by disallowing nodes from selected DODAG parents positioned
      further away from a border router.
Main Features and Advantages of RPL
The IPv6 Routing Protocol for RPL, is an efficient and effective protocol for data routing in
resource-constrained scenarios, such Internet of Things devices as per requirement. Its many
essential features include the below points:
 Scalability: The protocol can accommodate such type of big networks with low power and
    lossy connectivity, which makes it appropriate for a range of Internet of Things applications.
 Multipoint-to-point traffic generation: RPL offers a way to send data to a single
    destination point from several devices within the LLN as per requirement.
 Quality of Service (QoS) – The protocol guarantees QoS by offering various types of
    methods for reliable packet delivery system and congestion control systetm.
 Adaptive – RPL modifies the required routes in response to link quality and energy
    availability changes in the network environment or system.
 Security system: To guarantee various types of secure communication within the LLN as
    per requirement, RPL incorporates techniques for integrity protection, authentication,
    confidentiality, and encryption for better performance.
TCP establishes a reliable connection between sender and receiver using the three-way
handshake (SYN, SYN-ACK, ACK) and it uses a four-step handshake (FIN, ACK, FIN, ACK)
to close connections properly.
     It ensures error-free, in-order delivery of data packets.
     It uses acknowledgments (ACKs) to confirm receipt.
     It prevents data overflow by adjusting the data transmission rate according to the
        receiver’s buffer size.
     It prevents network congestion using algorithms like Slow Start, Congestion Avoidance,
        Fast Retransmit, and Fast Recovery.
     TCP header uses checksum to detect corrupted data and requests retransmission if
        needed.
     It is used in applications requiring reliable and ordered data transfer, such as web
        browsing, email, and remote login.
Working of Transmission Control Protocol (TCP)
   Transmission Control Protocol (TCP) model breaks down the data into small bundles
     and afterward reassembles the bundles into the original message on the opposite
     end to make sure that each message reaches its target location intact. Sending the
     information in little bundles of information makes it simpler to maintain efficiency as
     opposed to sending everything in one go.
   After a particular message is broken down into bundles, these bundles may travel
     along multiple routes if one route is jammed but the destination remains the same.
   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
Some of the most prominent features of Transmission control protocol are mentioned below.
UDP Header
UDP header is an 8-byte 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
consists 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.
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.
 VoIP (Voice over Internet Protocol) services, such as Skype and WhatsApp, use UDP for
  real-time voice communication. The delay in voice communication can be noticeable if
      packets are delayed due to congestion control, so UDP is used to ensure fast and efficient
      data transmission.
     DNS (Domain Name System) also uses UDP for its query/response messages. DNS
      queries are typically small and require a quick response time, making UDP a suitable
      protocol for this application.
     DHCP (Dynamic Host Configuration Protocol) uses UDP to dynamically assign IP
      addresses to devices on a network. DHCP messages are typically small, and the delay
      caused by packet loss or retransmission is generally not critical for this application.
TCP vs UDP
        Basis           Transmission Control Protocol (TCP)          User Datagram Protocol (UDP)
    Acknowledgme
                       An acknowledgment segment is present.         No acknowledgment segment.
         nt
                                                               There is no retransmission of
                 Retransmission of lost packets is possible
                                                                 lost packets in the User
                         in TCP, but not in UDP.
Retransmission                                                  Datagram Protocol (UDP).
                 TCP has a (20-60) bytes variable length        UDP has an 8 bytes fixed-
Header Length                   header.                             length header.
   1. Smart Homes: IoT devices like smart thermostats, security cameras, and voice assistants
      communicate via Wi-Fi, Zigbee, or Bluetooth.
   2. Industrial IoT (IIoT): Wireless sensor networks (WSN) in manufacturing plants use
      industrial protocols like WirelessHART and ISA100.11a.
   3. Smart Agriculture: IoT sensors collect soil moisture and temperature data, transmitting
      it over LPWAN (LoRa, NB-IoT) for precision farming.
   4. Healthcare Monitoring: Wearable devices send real-time patient health data to cloud-
      based servers via 5G or Wi-Fi.
   5. Smart Cities: Traffic monitoring systems use cellular or LPWAN to send vehicle flow
      data for optimizing city traffic.
      Data Processing & Storage: Aggregates, filters, and stores IoT data for further analysis.
      Security & Authentication: Ensures only authorized devices and users access the IoT
       system.
      AI & Analytics Integration: Uses machine learning (ML) and artificial intelligence (AI)
       for predictive insights.
      Interoperability: Facilitates seamless communication between different IoT platforms
       and devices.
      Device & Service Management: Monitors device health, firmware updates, and fault
       detection.
      Data Aggregation & Filtering: Reduces redundant data and optimizes storage.
      Real-Time Processing: Enables instant decision-making in critical applications.
      Device Authentication & Security: Uses encryption, authentication, and role-based
       access control.
      Machine Learning & AI Integration: Predicts trends, detects anomalies, and optimizes
       operations.
      APIs for Application Development: Provides APIs for integrating IoT data into third-
       party apps