• Aucun résultat trouvé

Master 2 RES – Networks ANET – Autonomous Networks Robust Algorithms

N/A
N/A
Protected

Academic year: 2022

Partager "Master 2 RES – Networks ANET – Autonomous Networks Robust Algorithms"

Copied!
4
0
0

Texte intégral

(1)

Master 2 RES – Networks ANET – Autonomous Networks

Robust Algorithms

S´ebastien Tixeuil

For this practical class, you will use the simulator jbotsim (https://jbotsim.io/). The topic is the Byzantine robustness. Before proceeding with the exercices, install jbotsim and run the default application (as described in the tutorial athttps://jbotsim.io/) to make sure all is set up on your side.

1 Problem Definition

The network consists in nodes that are spread in a rectangular area. Each node has a color.

Two nodes can communicate if the distance between them is smaller than a given communication range. Two nodes that can communicate are called neighbors. The time is discrete and at each time instant (every call of the onClock event), a node checks whether its color is unique in its neighborhood. If it is not the case, the node chooses a new color, not taken by any of its neighbors.

Some of the nodes may be Byzantine and do not follow the protocol, they have arbitrary behavior and can take as colors some color that is already taken by a neighbor.

2 Implementation

You start with two classes: theColorNode and theByzantine.

The classByzantine is as follows:

importio.jbotsim.core.Topology;

importio.jbotsim.ui.JViewer;

public classByzantine {

public static voidmain(String[]args){ Topology tp=newTopology();

tp.setDefaultNodeModel(ColorNode.class);

newJViewer(tp);

tp.start();

} }

The classColorNode is as follows:

firstname.lastname@lip6.fr

1

(2)

importio.jbotsim.core.Node;

importio.jbotsim.core.Color;

importio.jbotsim.ui.icons.Icons;

importjava.util.∗;

importjava.lang.∗;

public classColorNode extends Node{ // array of predefined jbotsim colors

private static finalColor all_colors[] = {Color.black,Color.white,Color.gray,Color.

lightGray,Color.pink,Color.red,Color.darkGray,Color.orange,Color.yellow, Color.magenta,Color.cyan,Color.blue,Color.green };

private static final intnb_colors =all_colors.length;

// the node current color private intcolor = 0;

// Convert internal color to jBotSim color Color toColor(inti) {

returnall_colors[i%nb_colors];

}

// change node color and adjust graphics void setColor(inti) {

color=i%nb_colors;

setColor(toColor(i));

}

// returns true if the node has a color conflict with a neighbor boolean isConflict(List<Node>l) {

for(Node node:l) {

if(color == ((ColorNode)node).color){ return true;

} }

return false;

}

// finds a new color for the node among available colors

// if the node has more neighbors than max nb of colors, the node may not change its color void findColor(List<Node>l) {

intlast =color;

while(isConflict(l)) {

color += 1 %nb_colors;

if(color ==last) { break;

} }

setColor(color);

}

@Override

2

(3)

public void onStart(){

// JBotSim executes this method on each node upon initialization setColor(0);

}

@Override

public void onSelection() {

// JBotSim executes this method on a selected node (middle−click) }

@Override

public void onClock(){

// JBotSim executes this method on each node in each round if(isConflict(getNeighbors())) {

findColor(getNeighbors());

} } }

After downloading and installing the jbotsim library (https://jbotsim.io/), compile and run the provided code. A window should pop up, a left click on the mouse creates a new node, and drag-and-drop can move a node, a right click on the mouse on a node deletes the node.

The main function (located in theByzantine class) just starts the simulation.

Question 1 Looking at the result of the simulation and at the implementation of theColorNode, does the system seem self-stabilizing? What happens if you move nodes to change the induced topology?

3 Adding Byzantine Nodes

Modify the source code to enable thepossibility for a node to beByzantine. For example, you can implement the following behavior:

• if no neighbor of a Byzantine node has a color in conflict, the Byzantine node randomly selects a neighbor and takes its color.

• if a middle click is performed with the mouse on a node (method onSelection), then the node changes its behavior: if the node was correct, it becomes Byzantine, if the node was Byzantine, it becomes correct.

Question 2 What do you observe when a Byzantine node exists in the network?

Question 3 What if several nodes are Byzantine?

4 Adding mobility

Modify the source code to enable either correct or Byzantine nodes to move randomly in the area.

Question 4 What do you observe when considereing these two mobility patterns?

3

(4)

5 Minimal colorings

Modify the coloring algorihtm as follows: instead of changing its color when there is an observed conflict, the node should change its color whenever it is not minimal in its neighborhood, and take the minimal available colors (according to the usual order on integers).

Question 5 What do you observe when no Byzantine node exists in the networks and correct nodes all execute the minimal coloring algorithm?

Question 6 What do you observe when a Byzantine node exists in the network? What about several nodes?

4

Références

Documents relatifs

DRF N : Detection and replacement approach of a failing node for connectivity maintenance in the wireless sensors networks If a sensor node Sn fails (because of a lack of energy on

For each project, there exists a unique activity network without redundant arcs but since there îs an infinité numher of different sized eventnetworks, the problem is tofind an

Thus in the main study participants performed tasks using four visu- alizations: cloneLink and splitLink (links between duplicates are faint grey lines of large Width - Figure

We interpret those results as following: TemporalNode2vec captures bet- ter the global temporal structures than the local ones, as edge reconstruc- tion/prediction tasks focus on

This paper aims to enhance the throughput as well as delay end to end of the wireless sensor network deployed for forest fire monitoring with considering the possibility of

Our coloring algorithm contributes to maximize network lifetime by reducing the activity period as well as allowing any node to sleep in this period (in the slots that are not

At the beginning of this step, these nodes had 3 choices (the color of 3 1-hop neighbors of u), but as their 2-hop neighbors are now colored, only one choice remains valid: we take

We also perform a cluster analysis, which reveals that, in all three networks, one can distinguish two types of nodes exhibiting different behaviors: a very small group of active