Professional Documents
Culture Documents
Routing: We First Need To Know What Is A Route
Routing: We First Need To Know What Is A Route
We first need to know what is a route Come on we all know what is a route!!! A path that leads us to our destination is known as a route. Just think Mac needs to go to his school. If does not know how will he find out the route? He will ask somebody isn't it?
Lets say he has police men to ask at some crossings who know about some of the places near them and other policemen standing at other crossings. The next slide displays such a situation. The arrows indicate the places and policemen, a policeman knows. Lets see how Mac finds out the route to his school!!!
I want to go to R2 school
R4
Go this way
Where is my school
I dont know any one other than R4 I will send him via R4
R5
R3
This way R1
I want to go to school
So, we can see that Mac has ultimately found out the route!!! We can also see that a path has been established from Macs starting place to his school. Now let us figure out the various components involved in this model. Mac Analogous to Data Packet Blocks Analogous to Distinct Networks Police Men Analogous to routers.
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 V1 E3 V2 E4 V3 E5 Thus the sets E and V may be defined as V = {V1, V2, V3, V4} E = { (v1,v2), (v3, v1), (v1,v4), (v2,v3), (v4, v3) }
E2
V4
Weighted Graph This is a kind of graph where the element of E are triples with two vertices and a number representing the weight (cost) of the edge.
E1, 2
V2
E2, 5
E4, 4
Thus the sets E and V may be defined as V3 V = {V1, V2, V3, V4} E = { (v1,v2, 2), (v3, v1, 5), (v1,v4, 1), (v2,v3, 4), (v4, v3, 2) }
V1
E3, 1
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
V1 E3
V2 E2
E4 V3
E5
V4
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.
E1, 2
V2
E2, 5
V1
E3, 1
V3
E5, 2
V4
Spanning Tree A tree that covers all the vertices of the graph or network is called a spanning tree.
E1 V1 E3
V2
E2 V4
E4 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.
Step 6 Update working values (no change) Step 7 Choose smallest working value (D), label.
Step 8 Update working values (No change) Step 9 Choose and label smallest working value, unlabelled, vertex. It is C, so C's final working value is To find the path: 7-5=2 and 7-1=6 so the path can either be ADC or ABC (it doesn't matter which we choose).
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).
Table updating can also be done manually in some routers. However in a vast network like the internet, we would like automatic configurations.
There are many protocols that define rules for the communication between routers. E.g. RIP, BGP etc.
Two important definitions 1. Routing Protocols The protocols that govern how the routing should be managed 2. Routed Protocols The protocols that govern the data flow.