Projecte

General

Perfil

CNAui-CNAd communication example » Historial » Revisió 3

Revisió 2 (Roger Pueyo Centelles, 02-06-2014 17:46) → Revisió 3/4 (Roger Pueyo Centelles, 03-06-2014 14:36)

h1. NCui-NCd communication example 

 This page shows an example of the communication process from the [[NCui|Network Characterization user interface]] (NCui) to the [[NCd|Network Characterization daemon]] (NCd) to retrieve information about the network to plot in on a graph. 

 h2. Description 

 The NCui only takes care of the interaction with the end user (displaying the network, nodes and links information on the browser and processing interaction requests), but does not fetch such data by itself. To retrieve these information, it relies on the NCd, that is able to search for and collect them. 

 h2. Example network 

 To illustrate the NCui-NCd communication example, the following network topology is used: 

 !={width:600px}Example_network.png! 
 See the full-size image "here":http://dev.qmp.cat/attachments/download/148/Example_network.png 

 The node on the top left corner (labeled node016) is used as the local node, where the plot is centered in the default view. 

 h2. Communication example 

 # *Get local node id* 
   
 The NCd needs to know the local node's id (a unique string to identify it) to later ask for more information regarding this node. By using this id, all the requests and responses, either about local or remote nodes, follow the same structure. 
   
 CNAui request: 
    <pre>cnad.node.id { "node" : "local" }</pre> 
 CNAd response: 
    <pre>{"id" : "node016"}</pre> 
 &nbsp; 




 
 # *Get local node's list of neighbours (1 hop)* 
 &nbsp; 
 To start retrieving the network graph, the CNAui needs to know which are the local node's neighbours. 
 &nbsp; 
 CNAui request: 
    <pre>cnad.node.neighbours { "node" : "node016" }</pre> 
 CNAd response: 
    <pre>{ "nodes" : [ "node011", "node400" ] }</pre> 
 At this point, the CNAui can start plotting, though uncomplete, the network graph. 
 &nbsp; 
 &nbsp; 




 
 # *Get local and neighbours' node names* 
 &nbsp; 
 The graph information is progressively completed, now by adding the names of the plotted nodes. 
 &nbsp; 
 CNAui request: 
    <pre>cnad.node.name { "nodes" : [ "node016", "node011", "node400" ] }</pre> 
 CNAd response: 
    <pre>{ "names" : [ "FT-NarrowStreet16-NSLM5", "FT-NarrowStreet11-RSM5", "FT-WideStreet400-NSM5" }</pre> 
 The nodes on the plot now are shown with their names instead of their ids. 
 &nbsp; 
 &nbsp; 




 
 # *Get the neighbour's list of neighbours (2 hops)* 
 &nbsp; 
 The default network graph plot shows the local node and the nodes at a distance of up to two physical hops. To represent them, the list of the neighbours' neighbours is needed. 
 &nbsp; 
 CNAui request: 
    <pre>cnad.node.neighbours { "nodes" : [ "node011", "node400" ] }</pre> 
 CNAd response: 
    <pre>{ "node011": [ "node094", "node400" ], "node400": [ "node011", "node094", "node017" ] }</pre> 
 With this, all the nodes that need to be plotted on the default view are known. Additionally, any links between the local node's neighbours are known, are known too.. 
 &nbsp; 
 &nbsp; 




 
 # *Get the neighbours' neighbours' (2 hops) node names* 
 &nbsp; 
 The remaining node names are added. 
 &nbsp; 
 CNAui request: 
    <pre>cnad.node.name { "nodes" : [ "node017", "node094"] }</pre> 
 CNAd response: 
    <pre>{ "names" : [ "FC-RiverStreet17-NSM5", "FT-FarAvenue94-NSLM5" }</pre> 
 The plot is updated with the nodes' names. 
 &nbsp; 
 &nbsp; 




 
 # *Get the neighbours' neighbours' neighbours (3 hops)* 
 &nbsp; 
 To determine if there are physical links between nodes at two hops distance from the local node, the following request is needed: 
 &nbsp; 
 CNAui request: 
    <pre>cnad.node.neighbours { "nodes" : [ "node017", "node094"] }</pre> 
 CNAd response: 
    <pre>{ "node011": [ "node104", "node400" ], "node094": [ "node011", "node400", "node017" ] }</pre> 
 In this case, there are no physical links between nodes at 2 hops from the local node, so the plot needs no updates. 
 &nbsp; 
 &nbsp; 




 
 # *Get the links information* 
 &nbsp; 
 [ To be added ] 
 &nbsp; 
 CNAui request: 
    <pre>[ To be added ]</pre> 
 CNAd response: 
    <pre>[ To be added ]</pre> 
 [ To be added ] 
 &nbsp; 
 &nbsp;