<< NARVAL_R_FloodInit NARVAL NARVAL_R_FloydWarshall >>

NARVAL >> NARVAL > NARVAL_R_FloodIteration

NARVAL_R_FloodIteration

Perform the topology discovery propagation of the Flood algorithm.

Calling Sequence

[m,np]=NARVAL_R_FloodIteration(g,ne,nr,m,np)

Parameters

g :

network graph.

ne :

source node.

nr :

destination node.

m :

discovery packet storage matrix.

np :

quantity of discovery packets on the network.

Description

NARVAL_R_FloodIteration propagates discovery packets of the Flood algorithm on the graph g emitted from the source node ne towards the destination node nr.

The set of candidate routes is stored into the matrix m (route|arrival|TTL|route length). The current quantity of discovery packets rates np.

Examples

n=100;//network size
L=1000;//network square area side
dmax=100;//locality radius
[g]=NARVAL_T_LocalityConnex(n,L,dmax);//generation of a random topology in respect with the Locality method. 
nl=length(g.head);//quantity of network links
nf=length(g.node_x);//real network size
[ne nr]=NARVAL_F_Random_i_j(nf)//selection of the source and destination nodes
TTL=10;//initialization of TTL
[m,np]=NARVAL_R_FloodInit(g,ne,nr,TTL);//application of NARVAL_R_FloodInit
[m,np]=NARVAL_R_FloodIteration(g,ne,nr,m,np);//application of NARVAL_R_FloodIteration
EC=ones(1,nl);
EB=2*ones(1,nl);
D=5*ones(1,nf);
D(ne)=10;
v=[];//display the first step of the flood
for i=1:np
v=[v NARVAL_G_Nodes2Path(m(i,1:2),g)];
end
[v]=NARVAL_F_Unity(v);
EC(v)=5;
EB(v)=3;
D(m(:,2)')=8
v=[];//display the second step of the flood
for i=1:np
v=[v NARVAL_G_Nodes2Path(m(i,2:3),g)];
end
[v]=NARVAL_F_Unity(v);
EC(v)=2;
EB(v)=4;
D(m(:,3)')=6;
g.node_border=D;
g.edge_color=EC;
g.edge_width=EB;
ind=1;
f=NARVAL_G_ShowGraph(g,ind);
m
np

Dependency

NARVAL_G_NodeNeighbors, NARVAL_F_Distance

Author

http://wwwen.uni.lu/interdisciplinary_centre_for_security_reliability_and_trust

Contact

<< NARVAL_R_FloodInit NARVAL NARVAL_R_FloydWarshall >>