Thursday, 21 November 2019

MQTT and CoAP


MQTT (Message Queue Telemetry Transport)
Message Queue Telemetry Transport is the most common protocol that used to IoT projects. MQTT protocol is based on publish/subscribe architecture. The publish/subscribe architecture consists of three major components: publishers, subscribers, and a broker.  As the concept Messages are published to topics. Clients can subscribe to a topic or a set of related topics called as subscription and Clients can subscribe to topics or publish to topics called as the publish.
Features:
  •          Work on TCP/IP protocol
  •          Machine to Machine (M2M) IoT context.
  •          Easy to implementation and minimized data packets.
  •          Can run on any kind of transport (Bluetooth, Wi-Fi).
  •      SSL/TLS security connection
CoAP (Constrained Application Protocol)
CoAP is an application layer protocol. It developed by the IETF coRE working group. the protocol considers the various objects in the network as resources (Ali, 2018). It is designed to use devices on the same constrained network between devices and general nodes on the Internet.
Features
·     Asynchronous message exchange.
·    Proxy and caching capabilities.
  • Machine to Machine (M2M) IoT context.
  • UDP/IP connection
  • DTLS Security for connection



IoT Architecture

IoT Architecture

Sensors and Devices - are the devices that are able to emit, accept and process data over the network. These sensors or actuators may be connected either through wired or wireless. This contains GPS, Electrochemical, Gyroscope, RFID, etc. Most of the sensors need connectivity through sensors gateways. The connection of sensors or actuators can be through a Local Area Network (LAN) or Personal Area Network.
Gateway and network – when having large number of data and devices in the system we should have high speed gateway and network in order to transfer the data over the internet. That network can be Local Area Network, Wide Area Network.
Cloud management – it is management part of the system. when we gather the data from the system (Sensors) it should have storage to store the data. also, cloud can be transferring the data to the end user’s applications.
Application layer – end point of the data, that means humans interactions comes to this stage humans work on this stage with IoT stuffs.

IoT Development Life Cycle


IoT Development Life Cycle with IoT functionalities


IoT paradigm open the new doors to the innovation of the future. When consider about all the inventions, those system developed within the IoT Eco system also known as the IoT development Life cycle. This Eco system encompasses the models and methodologies that the development teams use to develop systems, in which the methodologies form the framework for planning and controlling the entire development process. Before examine our system first we should understand steps in IoT development Life cycle (IoT eco system).

Design hardware – this stage is very important stage when comes to the IoT developments. If we fail to design the system properly that mean we plan to fail entire project at the beginning stage. in this stage we should decide the tools and hardware. if not, final outcome might be different according to the design.

Develop Software – this can be defined as the development of program function inside the IoT system. Basically, there are two parts in this stage which are automation part and the communication part of the user applications. In this stage we directly use the frameworks, protocols and Application Programming Interfaces (API) in order to develop the software. There are some stages in this develop software. Because when test the program there might be some changes in the existing one. So that changes should done according to the user requirements. Therefore, software develops have some review stages to do those changes.

Pre-production testing – when develop the software (configurations of the system). As a next stage we should test all the functions that we programed in earlier stage. we use platforms as well as the API to do the pre-production testing. Platform is multi-layer technology that enables straight forward provisioning, management, and automation of connected devices within the Internet of Things universe. These platforms help to do managed the connection, monitor and control IoT devices. when we do the pre-production testing, we should test that all the functions using this platform. This also have some reviewing stages whole system cannot be test at the same time so we should categorized review the part by part in the system. If something has to be changed, it will send to the develop software stages.


Production - after the pre-production testing we can make the productions and provide into the users. That is the final outcome of the entire system. 

Model evaluation – also know as the analysis part of the system. When located the system we should analyses the system outcome and user feed back to the devolved IoT system. It helps to find the best model that represents our data and how well the chosen model will work in the future.




Network Simiulators


Network Simulators

Network simulation is a technique that are used to design the network and calculate the interaction between the different network devices such as routers, switches, nodes, servers etc. (wikipedia.org, 2018). It provides the opportunity to create network topologies and imitate modern computer networks. We can very easily study the behavior of a node having high velocity and how it should be by using a simulator. Below is explain different types of simulators and their features.

1.      Ns-3 (Network simulator) simulator

Ns3 simulator research and educational model by and for the research community (nsnam.org, 2016). Ns3 simulator is network simulator that developed by using C++ and Python programming languages. We can used that Ns3 in Windows, Linux and MAC OS platforms and also that software is free and GNU general public license. Ns3 is not an officially supported software product of any company. That software support to three types of networks (ns3simulation.com, 2017).
I.                    Wired network
II.                 Wireless network
III.              Wireless sensor network
Ns3 has scalability factures,
-          Packets can have virtual zero bytes, that means there is no memory allocated in to the zero bytes.
-          Nodes have optional features. That means no memory waste in IPV4 stack
-          Allow the packet tagging – small units of information can be attached to the packets.

2.      OPNET (Optimize Network Engineering Tool) simulator

This simulator provides possibilities to simulate the large networks and various protocols. Basically it that software was design in to the military usage but eventually it became to the commercials. OPNET is very expensive software. But there are some free tiers given to for the education usage by restricting some features in the software.
OPNET software creates by using C and C++ languages. That software support to Hewlett-Packard, Sun-4 SPARCVarious, Solaris 2.6, 7 8Microsoft Windows NT 4.0/Windows 2000Required System Patches platforms and as mentioned earlier it is commercial network simulator (nsnam.org, 2016). OPNET simulator are simulate entire heterogeneous networks with various protocols (ukessays.com, 2003).
Factures,
-          Have different network modeling applications
-          Huge range of predefined network protocols in their libraries
-          3 types of model development tools (network editor, node editor, process editor)
-          Integration GUI debugging and analysis
-          Support for parallel and distribution simulation.

3.      Cisco packet tracer

Cisco packet tracer developed by Cisco organization. There are some versions in the cisco packet tracer simulator and some of versions are free and open source. It is very useful software to the beginners and the CCNA students. There are more features available in this simulator. The software allows users to simulate the configuration of Cisco routers and switches using a simulated command line interface. WindowsLinuxAndroid (operating system)IOS are the plat forms in this simulator and available in English, Russian, German, Portuguese, Spanish and French. Usually license is proprietary.
Features,
-          Has two work spaces logical and physical
-          Easy to process
-          Provide two operating modes to visualize the behavior of a network (real-time mode and simulation mode.)
-          Lab grading functions
-          International language support

Cloud models


Cloud computing models


Cloud services model is how cloud services are made available to client. When we used the cloud services, the needs of each person is different. Therefore we should understand the how that services are running. Following are explain how types of cloud services and their features.

Deployment model

Defines the purpose of the cloud and the nature of how the cloud is located and management of the cloud’s platform. There are four types of deployment models

1.      Private cloud
Private cloud infrastructure is suitable for single organization comprising with multiple consumers. That private cloud can be formed as internally or externally. The private cloud allows for increased security, reliability, performance, and service. Private Cloud is mostly suited for sensitive data, where the customer is dependent on security of the data. And also it suited for core systems (Johnson, 2017).
Main features: - Maximum level of reliability and scalability
                        - Generator control over cloud infrastructure
                                    - Design for businesses and enterprises (hackernoon.com, 2017)

2.      Public cloud
Now a day’s most common cloud model is public cloud. It is publically shared virtualized resource. Public Cloud is always hosted by a professional Cloud supplier. Public clouds most commonly interested in the function of collaboration, social network, CRM (customer portals) and the storage (Vold, 2012), (www.google.lk, n.d.).
Main features: - Reasonable levels of security
-          Ease of implementation process
-          Cost effective and low operational cost (hackernoon.com, 2017)

3.      Community cloud

Community cloud model is a cloud infrastructure shared by a group of organizations of similar industries and backgrounds with similar requirements (ishabhsoft.com, 2013). This type of clouds can be host on or off sites.
Main features –     private template creation and distribution
-          app exchange integration
-          improved usability


4.      Hybrid cloud
Hybrid cloud is combination of two or more models. That combinations can be private cloud, public cloud and community cloud. Hybrid clouds ensure the safety, scalability and performance in system. Hybrid is allowed BYOD (Bring Your Own Device policy).

            Main features: - smooth migration across multiple cloud providers
-          High availability across multiple clouds
-          Automatic scaling for load spikes.
                                   

Service model

It defines the services that you can access by using   cloud platform and their features. There are main three type of service models,

1.      IaaS (Infrastructure as a Service)
Provides ability to use software application demand over the internet

2.      PaaS (Platform as a Service)
Provides the environment to develop, run and manage web applications

3.      SaaS (Software as a Service)
Provides resources including server, storage, network, load balancers, firewall, IP addresses and etc.

Tuesday, 19 November 2019

Classes of IP and Type of IP address


Internet Protocol (IP)

Basically IP used to locate the data packets over the network from source to destination and it identifying number for a piece of network hardware. Internet protocol is main protocol in the protocol suit.
Furthermore, when locating the data packets to one end to another end, there is no confirmation of between them. Therefore, IP is not reliable protocol. Due to the send the data without set in the path, IP is connection less and also IP cannot control the errors and flows. World-wide IP addresses decided by IANA (Internet Assigned Numbers Authority) 


The class of address defines which bits are used for the Host ID and Network ID. In early network usage is low. Therefore, the bits for the network are 8. But when network are increases, the mount of bits to be added to the above network section (Network ID) was increased. In this way based on the number of bits per network, the IP addresses were divided into three classes 


1.      Class A
2.      Class B
3.      Class C

Class A
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

     
        Network bits                                                              Host Bits
               27                                                                             224

In class A IP first bit of the network side is not used. It used to identify the class. In this way there are 7 bits for the network partition. Accordingly, we can create 128 network within the class A IP range. By avoiding the 1 and 0 status of the range, useable network is reduced to 126 networks. There 224 devices can be connecting to this Host part. But practically we did not connect this much of devices per one network. therefore, most of IP addresses wasted in this class. 127 IP address used for testing (Loop-Nack IP).

  Range of class A IP: 0 – 126   
  Ex IP address: 124.100.3.30


  Class B

1 0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1



                              Network bits                                                          Host Bits
                                    214                                                                                      216

Between 128- 191 bits are considered in class B IP addresses. First and second bits are considered 1 and 0. Therefore network part have only 214 networks and for Host section we can connect the   216 devices. By avoiding the 0 and 1 value of the network section we can get the 16,382 number of possible network IDs.

  Range of class B IP: 128 – 191  
  Ex IP address: 191.25.2.3

  
Class C
 

1 1 0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

                                                                                                     

                                   Network bits                                                       Host Bits
                                        221                                                                                        28

If the first part of IP 192- 223, it is a class C IP. 1st, 2nd and 3rd bits defined by 1,1,0 bits. It used for determined to the class of C IP addresses. Available networks is a 221 and Host devices can be connected to the network. By avoiding the 0 and 1 value of the network section we can get the 2,097,150 number of possible network IDs.

  Range of class C IP: 192 – 223  
  Ex IP address: 192.168.1.3
  Where class C IPs use –  LAN networks.

Summary of the IP classes


Class of IP
Total number of Bits in Network ID / Host ID
Identification of Class of IP
Bits of network part that used to identify the class
Usable number of network IP bits
Number of possible network IDs
Number of host IPs per network ID
Class A
8/24
0xxxxxxx
       1
8-1 = 7
27-2 = 126
224-2 = 16,277,214
Class B
16/16
10xxxxxx
       2
16-2 = 14
214-2 = 16,382
216-2 = 65,534
Class C
24/8
110xxxxx
       3
24-3 =21
221-2 = 2,097,150
28-2 = 254



When assigned IP address to the devise in statically, the address will not be changed. Routers, phones, desktop, laptops and any other devices that can use an IP address can be can be configured to have static IP address. This address is assigned in manually from the user to the device 



Dynamic IP is a temporary IP address assigned to a device when connected to the network. It is temporary numeric identification assigned to a node in a TCP/IP network. Dynamic Host Configuration Protocol (DHCP) server is assigned dynamic IP address for devices. DHCP can provide the IP address automatically to the devices. There are some advantages

·         On local networks the user population changes frequently.
·         It reduces the burden on network support staff.
·         A virtually eliminates IP address errors.