Giter Club home page Giter Club logo

processing-of-distributed-collections-of-data's Introduction

####Application's Report ####Running the application: In order to run our application we will need to install several tools for that:

  1. NodeJS as a JavaScript environment.
  2. Node.js modules: net; json-socket; underscore; fs; dgram.
  3. To run more nodes(servers) on once machine we need to set up more local host addresses on lo0 interface. For this we need to write the following Linux command in our terminal (sudo ifconfig lo0 alias 127.0.0.N 255.255.255.0), were in stead of N any number between 0-254.

After the installation of the JavaScript environment, modules and setting up more localhost addresses we are ready to go. First we need to start our node.js several times to simulate our graphs nodes. Starting our node.js requires to give some parameters (HOST, PORT, Neighbours HOST, data_file.json).

Example of the command to start one node together with parameters ( node node.js 127.0.0.2 3000 '["127.0.0.5", "127.0.0.3"]' data_node_2.json ).

After starting several nodes that have logical settings between them we can run our client.js. The purpose of the client in this application is to find the MAVEN node and further to communicate with it using TCP for requesting it's won data plus his neighbours once.

MAVEN node is the node that have the biggest number of neighbours and also the biggest number of data.

After starting the client.js the client sends a UDP multicast message(command) asking for some information(what is the nodes address that listening on multicast address, how many nodes neighbours they have and how many data they have as well ) from all nodes. Each node sends back using UDP unicast protocol their address, number of neighbours and number of data they have.

After the client receives the answers from all nodes it process them for finding the MAVEN node.

After the MAVEN node was found our client sends a TCP message.command to him(MAVEN) asking for the information they have plus its neighbours one. The MAVEN node starts collecting the information from it's neighbours and append all to it's own. After it finished to collect data from it's neighbours, it send's back using TCP protocol to the client.

After the client receives the data from the MAVEN node and it's neighbours once, the client start to filter, sort and group it with the specific criteria.

After filtering, sorting and grouping client saves the result to a file.

#####Here is an example: We have a graph with 4 nodes:

alt tag

Each node have some data that is stored in data files (data_node_2.json, data_node_3.json,...,data_node_5.json). alt tag

Using our logic we understand that the MAVEN node is node number 3 because it have the biggest number of neighbours and the biggest data (data entry).

alt tag

Once we have imagined our graph we can start to create it.

First we need to create 4 localhost address on lo0 interface. For this we can write the following command in our terminal: sudo ifconfig lo0 alias 127.0.0.2 255.255.255.0 sudo ifconfig lo0 alias 127.0.0.3 255.255.255.0 sudo ifconfig lo0 alias 127.0.0.4 255.255.255.0 sudo ifconfig lo0 alias 127.0.0.5 255.255.255.0

After we created our virtual localhost address we run 4 times our node.js file with the logical parameters:

(node node.js HOST, PORT, Neighbours HOST, data_file.json).

  1. node node.js 127.0.0.2 3000 '["127.0.0.5", "127.0.0.3"]' data_node_2.json

alt tag

  1. node node.js 127.0.0.3 3000 '["127.0.0.2", "127.0.0.4"]' data_node_3.json

alt tag

  1. node node.js 127.0.0.4 3000 '["127.0.0.3" ]' data_node_4.json

alt tag

  1. node node.js 127.0.0.5 3000 '["127.0.0.2" ]' data_node_5.json

alt tag

Once we have created our graph and settled up, we can run our client.js by the command node client.js

alt tag

As we see the client.js found the correct MAVEN (node 3) that have the address 127.0.0.3 and further collected the data that was filtered and saved.

processing-of-distributed-collections-of-data's People

Contributors

cristianchris avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.