Professional Documents
Culture Documents
ROLL NO : 211000007
BRANCH : CSE
Aim:
Problem Statement:
Theory:
The distance vector routing algorithm is sometimes called by other names, including
the distributed Bellman-Ford routing algorithm and the Ford-Fulkerson
algorithm, after the researchers who developed it (Bellman, 1957; and Ford and
Fulkerson, 1962). It was the original ARPANET routing algorithm and was also used
NAME : ALOK SINGH
ROLL NO : 211000007
BRANCH : CSE
in the Internet under the RIP and in early versions of DECnet and Novell’s IPX.
AppleTalk and Cisco routers use improved distance vector protocols. In distance
vector routing, each router maintains a routing table indexed by, and containing one
entry for, each router in the subnet. This entry contains two parts: the preferred
outgoing line to use for that destination, and an estimate of the time or distance to that
destination.
The metric used might be number of hops, time delay in milliseconds, total number of
packets queued along the path, or something similar. The router is assumed to know
the “distance” to each of its neighbors. If the metric is hops, the distance is just one
hop. If the metric is queue length, the router simply examines each queue. If the
metric is delayed, the router can measure it directly with special ECHO packets that
the receiver just timestamps and sends back as fast as possible.
Algorithm :
At each node x,
Initialization
loop
for each y in N:
Dx(y) = minv{c(x,v)+Dv(y)}
forever
NAME : ALOK SINGH
ROLL NO : 211000007
BRANCH : CSE
Code(cpp) :
#include<stdio.h>
#include<conio.h>
int main()
scanf("%d", &a[i]);
scanf("%d", &b[i]);
scanf("%d", &c[i]);
scanf("%d", &e[i]);
printf("%c\t", node[0]);
if(a[i] < ab[i] && a[i] < ac[i] &&a[i] < ad[i])
ao[i] = a[i];
ao[i] = ab[i];
ao[i] = ac[i];
else
ao[i] = ad[i];
NAME : ALOK SINGH
ROLL NO : 211000007
BRANCH : CSE
printf("%d\t", ao[i]);
if(b[i] < ba[i] && b[i] < bc[i] && b[i] < be[i])
bo[i] = b[i];
bo[i] = ba[i];
bo[i] = bc[i];
else
bo[i] = be[i];
printf("%d\t", bo[i]);
printf("\n%c\t", node[2]);
if(c[i] < ca[i] && c[i] < cb[i] && c[i] < ce[i])
co[i] = c[i];
co[i] = ca[i];
co[i] = cb[i];
else
co[i] = ce[i];
printf("%d\t", co[i]);
dop[i] = d[i];
else
dop[i] = da[i];
printf("%d\t", dop[i]);
NAME : ALOK SINGH
ROLL NO : 211000007
BRANCH : CSE
}
printf("\n%c\t", node[4]);
eo[i] = e[i];
eo[i] = ec[i];
else
eo[i] = eb[i];
printf("%d\t", eo[i]);
printf("\n\t--------------------------- \n");
printf("%d", ao[4]);
Output :
NAME : ALOK SINGH
ROLL NO : 211000007
BRANCH : CSE
Conclusion: