<< NL_R_AODVRTInit NL_R: Routing NL_R_AODVRouteReply >>

NARVAL >> NL_R: Routing > NL_R_AODVRouteError

NL_R_AODVRouteError

Adjust the routing table of a node after an Error discovery (AODV).

Calling Sequence

[N] = NARVAL_R_AodvRerr(I,N)

Arguments

I :

Node.

N :

List of unreachable nodes.

Description

NL_R_AODVRouteError adjusts the routing table of the node I after an error discovery (WEB). N provides the list of unreachable nodes. Whenever a Node receives a RERR packet, it looks at its routing table and then removes all the routes that contains the unreachable nodes. We can distinguish three cases. In the first one, if a data packet is propagated from its source towards its destination in respect with local decision in each crossed router, a problem occurs if an intermediate node does not know the next hop where the packet should be forwarded (no entries inside its routing table). In the second case, a node that receives a RERR has to remove its entries that became invalidated. In that case, the node will send a RERR with all the new nodes which are now unreachable. In the last case, if a node can not communicate with one of its neighbors (link break), it removes all related entries within its routing table and therafter sends a RERR with the neighbor and all invalid routes.

Examples

l=3;//number of lines
c=4;//number of columns
Lx=1000;//network area x-side
Ly=1000;//network area x-side
[g]=NL_T_Grid(l,c,Lx,Ly);//application of NARVAL_T_Grid
w=1;//window index
f1=NL_G_ShowGraphN(g,w);//graph visualization
for i=1:g.node_number
global ('rt'+string(i));//creation of empty routing tables
end
bss=10;//maximum buffer size
bs=bss*ones(1,g.node_number);//buffer matrix
NL_R_AODVRTInit(g,bs);//generation of routing tables
//rti=final routing table of node i
TTL=5;//research Time-To-Live
ID=1;//index of the route discovery
//update of routing table: node 1 to node 7
Source=1;//source node
Destination=7;//destination node
[mat,routemat]=NL_R_AODVRouteRequest(g,Source,Destination,TTL);//route discovery from the source node
NL_R_AODVRouteReply(g,Source,Destination,ID,routemat);//route reply from the destination node
//update of routing table: node 2 to node 7
Source=2;//source node
Destination=7;//destination node
ID=2;//route discovery index
[mat,routemat]=NL_R_AODVRouteRequest(g,Source,Destination,TTL);//route discovery from the source node
NL_R_AODVRouteReply(g,Source,Destination,ID,routemat);//route reply from the destination node
//update of routing table: node 1 to node 4
Source=1;//source node
Destination=4;//destination node
ID=5;//route discovery index
[mat,routemat]=NL_R_AODVRouteRequest(g,Source,Destination,TTL);//route discovery from the source node
NL_R_AODVRouteReply(g,Source,Destination,ID,routemat);//route reply from the destination node
[p1]=NL_R_AODVPath(1,7)//path between nodes 1 and 7 
[p2]=NL_R_AODVPath(2,7)//path between nodes 2 and 7
[p3]=NL_R_AODVPath(1,4)//path between nodes 1 and 4
//error in node 2
ni=2;//node index
rt2//routing table of the node 2
nerror=[6];//no connection between node 2 and 6
[nerror1]=NL_R_AODVRouteError(ni,nerror)//application of NL_R_AODVRouteError
rt2//new state of rt2

Report an issue
<< NL_R_AODVRTInit NL_R: Routing NL_R_AODVRouteReply >>