Beruflich Dokumente
Kultur Dokumente
I want to
go to
R2 school
There you
are
This block
R4
Geeeeee!
!!!
I am here!!!
Where
is my
school
Go this
way
I dont know
any one
other than
R4 I will
send him via
R4
R6
R5
R3
R2 = 2 stops
R3 = 3 stops
so I will
send him via
R2
This
way
I want to
go to
school
R1
V2
E4
E2
V1
E3
V4
V3
E5
Other definitions
Directed Graph (or Digraph) When the elements of E
are ordered pairs then we call the graph a directed graph.
This means, that while traversing through the edge, we can
take only a fixed direction, as implied by arrows.
E1
V2
E4
E2
V1
E3
V4
E5
V2
E4, 4
E2, 5
V1
E3, 1
V3
V4
E5, 2
Path This is a part of the graph connecting two distinct vertices and has no loops.
More fundoo It consists of subsets of V and E where each element of V is associated
with some E.
E1
V2
E4
E2
V1
E3
V4
E5
Tree This is a graph or sub-graph where there exists maximum one path
between two nodes. This simply means that there is no loop in the graph.
V2
E1, 2
E2, 5
V1
E3, 1
V3
V4
E5, 2
Spanning Tree A tree that covers all the vertices of the graph or network is
called a spanning tree.
E1
V2
E4
E2
V1
E3
V4
V3
E5
Step 1 Label the start vertex's final value as 0 (as it is the origin), and label it 1.
Step 3 Choose the vertex with the lowest working value (B), and record its
working value as its final value and the order in which it was labelled
5 Label the smallest working value vertex with no label (E),final value=working value.
There are a number of similar algorithms for finding the shortest path.
There is another called Floyds Algorithm in which we use a matrix
formation to find out the shortest paths, but right now let us concentrate
on basics.
So how does the router take advantage of these algorithms?
The routers actually communicate with their neighbours to create a
table called routing table
This is how a routing table looks like.
Destination
127.0.0.1
default
172.16.12.0
172.16.2.0
172.16.1.0
172.16.3.0
172.16.4.0
Gateway
127.0.0.1
172.16.12.1
172.16.12.2
172.16.12.3
172.16.12.3
172.16.12.3
172.16.12.3
Flags
UH
UG
U
UG
UG
UG
UG
Ref
1
2
40
4
10
2
4
Use
Interface
298
lo0
50360
111379 le0
1179
1113
1379
1119
If we look at the above table closely, we will find that it has the next hop
information. For instance if some packet is destined for the network
172.16.12.0 then it will be sent to the gateway 172.16.12.2 . The rest of
the headache is to be taken by the later.
A question may be asked over here that how was this routing table
generated?.
The routers have communicated the costs of connecting to their
neighbours to all the other routers. Then the routers have used some or
other shortest path algorithms to determine the routing table for itself.
This communication may be done only once (The first time they are
connected Static Routing), Periodically (At fixed time intervals Dynamic) or in Triggered manner (Whenever there is some change in
the network new router is added or an existing one is removed etc. Triggered).