Monday, January 16, 2017

What is Fog Computing ?

Cloud models for IoT are not designed for the volume, variety and velocity of data that the IoT generates. Billions of connected IoT devices generate a huge amount of data every day. Moving all the data to the cloud for analysis would require bandwidth and time. By the time the data goes to the cloud for analysis, the opportunity to act on it may not remain. And, to address that concern fog computing is developed.

What is Fog Computing ?


The term fog computing refers to extending cloud computing to the edge of an enterprise’s network. As said above, IoT devices consume cloud services and generate a huge amount of data. Using fog computing, the data gathered by the IoT devices can be processed close to where the data is generated up to certain extent, instead of analyzing the whole of it in the clouds.

For computing does the following:

  • Instead of sending the vast amount of data collected by the IoT devices to the cloud, it analyzes the most time-sensitive data nearer to the devices.
  • It sends selected data to the cloud for historical analysis and longer-term storage.

The fog brings the cloud closer to the IoT devices that collect the data. The devices called fog nodes can analyze the data collected up to a certain extent. Any device with computing, storage and network connectivity like an industrial controller, switch, router, embedded server and video surveillance camera can be a fog node. And, these fog nodes can be deployed anywhere with a network connection, like on a factory floor, on top of a power pole, in a vehicle etc. These fog nodes run IoT enabled applications & can respond in milliseconds. They can also provide a transient storage for a couple of hours.

These fog nodes can analyze almost 40 percent of data being collected. As a result, it minimizes the latency of the IoT devices, offloads traffic from the core network and can keep sensitive data inside the network, instead of transferring it to the cloud for analysis.

Fog nodes get the data collected from the IoT devices and then directs different types of data to different places for analysis.

  • The most time-sensitive data is analyzed on the fog node closest to the IoT devices that collect the data.
  • If the data can wait for seconds or minutes, they are sent to aggregation nodes for analysis.
  • Less time sensitive data is sent to the cloud for historical analysis, big data analytics and long term storage.

Advantages of Fog Computing

There are a number of advantages of using fog computing.

  • As said earlier, as fog applications can monitor and analyze data collected by IoT devices in real-time, it can enable the devices to respond immediately and initiate an action, like locking a door, changing equipment settings, zooming cameras, opening a valve etc in real-time.
  • As fog computing can speed up response of IoT devices, it can improve output of the devices and increase safety. For example, if oil pipelines experience a change in pressure, pumps can automatically slow down to avoid disaster.
  • Fog applications can analyze collected sensitive data locally instead of sending it to the cloud for analysis. As a result, they can provide better privacy controls.
  • As fog applications process selected data locally, they can conserve network bandwidth and lower operating cost.

Applications of Fog Computing

There are several applications of fog computing.

Smart Grids

A smart grid is an electricity distribution network, with smart meters deployed at various locations to measure real-time status information. These information collected by the smart devices can be analyzed in real time by the fog nodes and enable real-time responses, like stabilizing a power grid in response to a change in demand or other emergency.

Smart Vehicles

Fog computing can be integrated into vehicular networks. Fog nodes can be deployed along the roadside and send or receive information to or from the running vehicles. It can also utilize vehicles on-the-fly to form a fog and cloud and support real-time events like traffic light scheduling, congestion mitigation, parking facility management etc.


Health data collected from the patients are by the IoT devices are sensitive and private in nature. With fog computing, the collected data can be analyzed in real-time locally, instead of sending it to the cloud for analysis. As a result, fog applications can maintain privacy of data in a better way.

Smart Cities

Fog computing can be used efficiently in smart cities. Data collected by the smart devices can be analyzed by the fog nodes to control traffic congestion, public safety, high energy use and municipal services in real-time. Moreover, cellular networks often have bandwidth limits which does not meet the requirements all the time. In fog computing, data can be analyzed by fog nodes locally up to a certain extent and thus can optimize network usage.

Smart Buildings

A smart building may contain thousands of sensors to measure various parameters like temperature, keycard readers, parking space occupancy etc. Using fog computing to analyze the data can enable real-time actions like controlling lighting, triggering alarms or addressing other emergency situations.


Often video cameras are used to monitor public places like parking lots, buildings etc for enforcing security. Data collected by those devices needs a large bandwidth to be able to be transported to the cloud for analysis. Using fog computing, the collected data can be analyzed in real-time to monitor and detect anomalies and respond to it accordingly.

Thursday, January 12, 2017

Smart Contracts and Blockchain

Smart contracts are computer protocols that can facilitate, verify or enforce the negotiation or performance of a contract or make a contractual clause unnecessary. They usually have a User Interface and can emulate the logic of contractual clauses. The can execute the terms of a contract in an automated way. They can make contractual clauses partially or fully self-executing and self-enforcing.

Usually users need to go to a lawyer or a notary and pay them to get the document. In case of smart contracts, one has to pay with cryptocurrency and the smart contract is created. A smart contract do not only define rules and penalties in an agreement, but also can enforce them in an automated way. It is usually written as code, that is placed in a blockchain. At triggering events like an expiration date etc the contract is executed according to the coded terms.

How is Blockchain used in Smart Contracts

Smart contracts are implemented using blockchain. Once a smart contract is created, it is placed in a blockchain. It typically works in the following way:

  • A user requests a transaction. The transaction can involve contracts, records or cryptocurrency.
  • The request is broadcast to a P2P network consisting of computers, called nodes.
  • The transaction and the user’s status are verified using known algorithms.
  • On successful verification, the verified transaction is added to a block along with other transactions.
  • The block is added to the blockchain.

Regulators can use the blockchain to learn about the current activities in the market. At the same time, the individuals involved can remain anonymous and maintain privacy.

An Example of using a Smart Contract

Let’s understand the whole concept with a very simple example.

Suppose Adam wants to rent a property from Bob. To do that, Adam would need to pay using cryptocurrency through blockchain. A smart contract would be created between Adam and Bob, where the terms will be written as a code. The smart contract would be placed in the blockchain.

Bob would then need to provide a digital key by the effective date of the agreement. On the effective date of the agreement, the appropriate terms would be executed and Adam would get the property, while Bob would get the payment. So, even if Bob releases the digital key before the effective date of the agreement, blockchain will hold the key and it will get released only the scheduled date. And, if Bob is unable to release the digital key, Adam would automatically get refunded. The terms of the smart contract will be automatically executed and the smart contract will get expired automatically after the scheduled period.

Advantages of Smart Contracts

There are a number of advantages of using a Smart Contract.

  • Smart Contracts eliminate the need of any intermediary like a broker, lawyer etc.
  • The documents are encrypted in blockchain, which makes it much more secure. Also, the involved parties can be anonymous and maintain privacy.
  • Usually a user has to spend lots of time for paperwork or to manually process documents. Smart contracts can automate the whole process, thereby saving time.
  • As smart contracts eliminate the need of intermediaries, it saves costs involved in the whole process.
  • As smart contracts are executed in an automated manner, it helps in avoiding errors that result from manual execution.

Applications of Smart Contracts

There are many applications of smart contracts.

  • One can use smart contracts for all sort of situations ranging from financial derivatives to insurance premiums, breach contracts, financial derivatives, credit enforcement, legal processes, property law or even crowd funding agreements.
  • Smart contracts can be used to facilitate business operations that usually go through lots of issues resulting from independent processing and lawsuits and settlement delays.
  • Smart contracts can be used in contracts involving shares, bonds or derivatives. It can also facilitate mortgage, which is often manual and confusing. Smart contracts can automate every aspect of the transaction including payment processing and signing mortgage agreements.
  • Smart contracts can be used in property transfers and can improve transaction integrity, efficiency and transparency.
  • Smart contracts can be used in supply chain along with IoT to track managed assets and products from factories.
  • Smart contracts can automate insurance claims and speed up processing, verification and payment.
  • Smart contracts can also be used in clinical trials and medical research studies to facilitate many sensitive agreements like involving cross-institutional data sharing.
  • Smart contracts can be used in cancer research automating patient data consent management and incentivizing data sharing.
  • Smart contracts can also be used in a blockchain protected voting system to facilitate secure voting and improve voter turnout.

Thus smart contracts can eliminate intermediaries in a contract and save time, extra costs and increase security in a negotiation. This was a short introduction to smart contracts. Hope it helped.