Sunday, January 4, 2015

Concise UPnP

I had to sit for an exam last Saturday and I did a case study about few protocols during my preparation. One protocol that I was reading about is Universal Plug and Play (UPnP), to be precise its a protocol stack. Meantime I'm thinking of writing a post about potential of UPnP in IoT. So, here I'm summarizing UPnP.

XBox 360, PS4, Wii and Azureus usesUPnP

UPnP allows networked devices to search other devices on the network and establish connections among them.
UPnP supports Zero-Configuration networking. For instance when a UPnP compatible device connects to a network, it assigns an IP address, announces it and provide information about its capabilities upon requests and learn the availability and capabilities of other connected devices.
UPnP uses a concept called Control Points (CP), which are the devices use UPnP protocols to control other connected devices. Each device multicast requests to discover others using HTTP and UDP. UDP is used to avoid acknowledgements from receivers and retransmission in interrupts.
When a device first connects to a network it should search for a DHCP Server (Dynamic Host Control Protocol) and request for an IP address. If there aren't any DHCP servers, device must assign itself an IP address. This is known as AutoIP.
After establishing an IP addresses devices can inform the services they are offering and register them in control points on the network. The protocol used in UPnP to do this is called Simple Service Discovery Protocol (SSDP).
Even though devices are resisted with CPs it is required to get to know how devices are providing their services. Therefore CPs has to request device description, which contains device details, vendor specific details, and services and actions offered by the device. Device descriptions are in form of XML data. Having received device descriptions, CPs can invoke devices actions by sending a control message to the control URL.
A main drawback in UPnP is that it doesn't have a device authentication mechanism. Therefore UPnP systems assumes all connected devices are trustworthy.

References:
  • George F. Coulouris (2012) Distributed systems: concepts and design, 5th edn., Boston: Addison-Wesley.
  •  UPnP Forum (2014) UPnP AV The technology basis of DLNA, United States of America: UPnP Forum.

Saturday, January 3, 2015

Genetic Algorithms

Genetic algorithms are a major topic in evolutionary computing. It is based on the evolutionary process of the nature.
Basically a genetic algorithms is a search function where its objective is to find a good solution; technically a very fit chromosome. A chromosome is usually a set of bits or a complex data structure that represents a state of a system.
A set of chromosomes can be referred as a population where a generation in genetics algorithms in one reproductive cycle of replacing existing chromosome with new chromosomes generated by genetic crossover operations and mutation.
The advantage of genetic algorithms in search functions is that search result won't stuck in a local minimum. Because genetic crossover process produces radically different chromosomes in each generation and occasional mutations causes small changes within population.
Genetic algorithm's search can perform in very large and multidimensional search spaces. If there are N dimensions, N parameters should be encoded in each chromosome. 
For example, maximum value of the function F with one dependent variable x in execution.


F(x) = sin(x) * sin(0.4 * x) * sin(0.3 * x)

Lets find a good value for x where F(x) has its nearly possible maximum value.
References:
  •  Russel, S. J., 2009. Artificial Intelligence: A Modern Approach. 3rd ed. Uncertain Knowledge and Reasoning: Printice Hall.