Académique Documents
Professionnel Documents
Culture Documents
A Presentation by
Tusharadri Sarkar
Tusharadri Sarkar
December 7, 2009
AGENDA
Delivery, Forwarding, Routing IP and Mask Routing Table Unicast Routing Protocols
Tusharadri Sarkar
December 7, 2009
What is routing? Why is routing required? At which layer is routing done? How does a router work?
Tusharadri Sarkar
December 7, 2009
What is routing?
Routing is the process of selecting a path in a
Tusharadri Sarkar
December 7, 2009
connections
For efficiently managing the network traffic For efficient usage of network resources For catering to different types of services For congestion control
5 Tusharadri Sarkar December 7, 2009
APPLICATION LAYER SOCKET LAYER ROUTING LAYER LINK LAYER DEVICE DRIVERs
December 7, 2009
Least expensive and complicated. No intelligence Just directs incoming packets from one port to other
More expensive and intelligent Knows which port is carrying the traffic from which host/interface
Most expensive and intelligent, Most complicated Learns about its neighboring conditions, manipulates data traffic
December 7, 2009
Packet arrives at the router for delivery Router reads destination IP address Router searches Routing Table Determines next hop of the packet
December 7, 2009
Delivery
The network layer supervises the
Tusharadri Sarkar
December 7, 2009
Direct
Destination
December 7, 2009
addressing scheme It uniquely defines the connection of a device/network to the Internet IPv4: 32 bit addressing scheme Address space: 232 = 4294967296 Notations: Dotted Decimal: 117.149.29.2 Notations: Binary: 01110101 1001010 00011101 00000010
December 7, 2009
11
Tusharadri Sarkar
2nd
3rd
4th
2nd
3rd
4th
Tusharadri Sarkar
Given an IP and its mask, one can calculate: First Address Last Address Range of Addresses
13 Tusharadri Sarkar December 7, 2009
block of addresses are assigned, provided the following restrictions are strictly followed
The addresses in the block must be contiguous The number of addresses must be a power of 2 The first address must be evenly divisible by the total
205.16.37.39/28 What are the first, last and the total number of addresses assigned?
14 Tusharadri Sarkar December 7, 2009
Network Address
When a organization is allocated a block of addresses,
normally (not always) the first address is treated as the network address It is not assigned to any device, it defines the organization itself to the rest of the world
REST of the WORLD Network Address: 205.16.37.32
205.16.39.33/28
All packets with receiver address 205.16.37.32 to 205.16.37.47 are routed to x.y.z.t/n 205.16.37.32/28
205.16.39.47/28
16 Tusharadri Sarkar
December 7, 2009
Routing Table
A host or a router maintains a routing table with
an entry for each specific destination The table can be STATIC or DYNAMIC Static Routing Table:
Contains information entered manually by the
administrator at the time of creation Cannot be modified automatically when there is any change in the Internet
Dynamic Routing Table: Capable of updating the table with the help of routing protocols and algorithms automatically Only option for managing any large network of today
17 Tusharadri Sarkar December 7, 2009
Routing Table
Mask Network Interface Next-hop address Interface Flags Reference Count Use
Mask: Defines the mask applied to that entry Network Address: Defines the network address to
which the packet is finally delivered. In host specific routing, this is the destination host address Next Hop Address: Defines the address of the hop for the packet Interface: Shows the name of the interfaces
18 Tusharadri Sarkar December 7, 2009
Routing Table
FLAGS: Defines up to five flags
U (Up): Router is up and running G (Gateway): Destination is in another network H (Host-specific): Network address is host-specific address.
Otherwise the network address is the destination address D (Added by redirection): Routing info is added to host routing table by redirection message from ICMP M (Modified by redirection): Routing info for destination is modified to host routing table by redirection message from ICMP
route at the moment Use: Defines number of packets transmitted through the router for a destination
19 Tusharadri Sarkar December 7, 2009
20
Tusharadri Sarkar
December 7, 2009
Mask
Flags
Eth0 Link encap:Ethernet Hwaddr 00:B0:D0:DF:09:5D Inet addr: 153.18.17.11 Bcast: 153.18.31.255 Mask:255.255.240.0
Default Router
22
Tusharadri Sarkar
December 7, 2009
Forwarding
It means placing the packet in its route to its
destination Requires a host or a router to have a routing table When the host has a packet to send or the router has received a packet, it looks up this routing table to determine route to the final destination Routing techniques caters to optimizing this table as maintain a full-fledged look-up table is impossible to maintain
23
Tusharadri Sarkar
December 7, 2009
Forwarding Techniques
Next-hop method Vs Route Method
Routing tables based on routing Destination Host B Destination Host B Destination Host B Route R1, R2, host B Route R2, host B Route Host B
Routing tables based on Next-hop Destination Host B Destination Host B Destination Host B Route R1 Route R2 Route Host B
Host A
R1
R2 Host B
N1
24 Tusharadri Sarkar
N2
N3
December 7, 2009
Forwarding Techniques
Network-Specific method Vs Host Specific method
Routing table for host S based on host-specific method Destination A B C D Next Hop R1 R1 R1 R1 Destination N2 Next Hop R1 Routing table for host S based on network-specific method
System R1 N1 N2
25
Tusharadri Sarkar
December 7, 2009
Forwarding Techniques
Default Method: Using a default router
Destination N2 Any other Next Hop R2 R1 Routing table for host A
R2
N2
Forwarding Process
In classless addressing, at least 4 columns are required The routing table is searched based on the network address
and mask
Forwarding Module
Extract Destination Address Search Table
Mask
Network Address
Next-hop Address
Interface
December 7, 2009
interface and mask are aggregated into one single block in routing table Several levels of aggregation are possible
140.24.7.0/26
m0 m1 m4 m0 m1
140.24.7.64/26
140.24.7.128/26 140.24.7.192/26
m2
R1
m3
R2
December 7, 2009
Tusharadri Sarkar
and router R2
For R2, any packet with destination addresses 140.24.7.0 to
3 Orgs? Can we still use Address Aggregation and assign the block 140.24.7.192/26 to Org. 4?
140.24.7.0/26
m0 m0 m1 m3
m2 m1
Org 1
140.24.7.64/26
R2
m2
m2
Org 2
140.24.7.128/26
R1
Org 4
R3
m1 m0
Org 3
30 Tusharadri Sarkar
140.24.7.192/26
December 7, 2009
shortest mask
Mask
/26 /26 /26 /0
NA
140.24.7.0 140.24.7.64 140.24.7.128 0.0.0.0
NHA
Default
Iface
m0 m1 m2 m3
NA
140.24.7.192 140.24.7.0 0.0.0.0
NHA
Default
Iface
m1 m0 m2
NHA
Default
Iface
m0 m2
December 7, 2009
Hierarchical Routing
Hierarchical routing can greatly minimize the size of
the routing tables For example, a regional ISP is granted a 16,384 (214) addresses starting from 120.14.64.0/18 It is divided in to 4 sub-blocks each of size 4096 for 3 local ISPs. For them the mask is /20 1st local ISP divides its assigns sub-blocks into 8 smaller blocks for small ISPs. For them the mask becomes /23 Each small ISPs divides them into 128 sub-blocks for households. For them the mask becomes /30, and so on
Tusharadri Sarkar December 7, 2009
32
Hierarchical Routing
The logical representation is displayed here
Total 4096 120.14.96.0/22 Total 4 Large Orgs. 120.14.112.0/24 Total 16 Small Orgs.
33 Tusharadri Sarkar
ISP 2.3
120.14.112.0/20
Total 4096
December 7, 2009
Geographical Routing
The same concept of hierarchical routing can be
extended in geographical routing To decrease the size of the routing tables further, segregation is done in geographical level as well For example, the entire address space is divided into few large blocks One block is assigned to North America, one to Asia, one to Africa, one to Europe and so on So, for all the routers of the ISPs outside Europe, every router will have one and only entry for all the addresses assigned to Europe
34
Tusharadri Sarkar
December 7, 2009
update dynamic routing tables A routing protocols is a combination of set of rules (algorithms) and procedures Unicast routing protocols applies where each incoming packet has to be delivered to one and only one destination Router decides the next hope of a packet in a Autonomous System based on Optimization 3 most popular and basic Unicast Routing Protocols are: RIP (Distance Vector routing), OSPF (Path Vector routing) and BGP (Link State routing)
Tusharadri Sarkar December 7, 2009
35
Autonomous Systems
An Autonomous System or AS is group of
networks and routers under the authority of a single administration Routing inside AS : Intra-domain routing Routing between AS : Inter-domain routing
AS1 AS2
AS3
AS4
36
Tusharadri Sarkar
December 7, 2009
37
Tusharadri Sarkar
December 7, 2009
Optimization
The router must always choose the optimum path
between two networks for the packets There is a cost associated with each packet for passing through a network, called Metric The metric is different depending on the routing protocols. For example: In RIP, the hop count is used as the metric In OSPF, the administrator can assign a cost for network based on the type of service required In BGP, the administrator can set the cost based on the policy of the network
38 Tusharadri Sarkar
December 7, 2009
is the route with minimum distance Each node maintains a vector (table) of minimum distance to every node known There are three steps involved: Initialization: At the beginning, each node knows the distance to its immediate neighbors Sharing: Periodically or in triggered time, the nodes share their vectors with other nodes Updating: Based on the shared info, nodes updates their vectors about path to indirectly connected nodes
39 Tusharadri Sarkar December 7, 2009
DVR: Initialization
To A B C D E Cost Next 0 5 2 3 _ _ _ _
A 2
5 4 C 3 4
To A Cost Next 2 4 0 4 _ _ _ _
To
Cost Next 5 0 4 3 _ _ _ _
A B C D E
Cost Next 3 0
Tusharadri Sarkar
Table of A To A B C D E
40
3
A B
_ _
D
_
B C D E
C D E
Table of D
Table of C
basis or triggered condition Full routing table needed not be shared. In our scenario, only column 1 and column 2 will be shared. Next Hop Address (column 3) will be calculated based on that Receiving a partial table from its neighbor, a node calculates a temporary updated table Then each row of the old and new table are compared based on the next node entry (col. 3)
If next node entry is different, the row with smaller cost is
chosen. If there is a tie, old entry is kept If next node entry is same, the new entry is chosen
41 Tusharadri Sarkar December 7, 2009
To A B C D E Cost 0 5 2 3 Next _ _ _ _ C
Cost Next 0 5 2 3 _ _ _ _
Compare
Modified Table of A
Old Table of A
New Table of A
December 7, 2009
A 2
5 4 C 3
To A Cost Next 2 4 0 5 4 _ _ _ A _
To
Cost 5 0 4 8 3
Next _ _ _ A _
A B C D E
Table of A To A B C D E
43
Cost Next 3 8 5 0 9 _ A A _ A
B C D E
C D E
Table of D
Tusharadri Sarkar
Table of E
December 7, 2009
Table of C
B
After B receives update from A
X _ After Failure
X 6 4
. . .
X _
10
X 6
X _
A
4
A
4
Tusharadri Sarkar
December 7, 2009
smaller number say, 100. In RIP Infinity is often defined as 16. So, the network cant have more than 15 hops anywhere. Split Horizon: Each node sends only part of its table through each interface. In our case, B would not advertize its part of the table to A which contains information about X (i.e. the route of X is through A, so A already knows). Split Horizon & Poison Reverse: While sharing its table with A, B will add a tag to the route information of X (i.e. I know this route comes from you. Please do not use this value).
45 Tusharadri Sarkar December 7, 2009
implementation of Distance Vector Algorithm with the following considerations: 1. In an autonomous system, we are dealing with routers and networks (links). Only routers have routing tables, networks not 2. The destination in a routing table is a network always 3. The metric used by RIP is the no of hops needed to reach the destination 4. Infinity is defined as 16 5. The next-node column defines the address of the router to which packet is to be sent
46 Tusharadri Sarkar December 7, 2009
an entire topology of the domain Link State: For each node, the number of other links and nodes, their connectivity type, cost (metric) and the condition of the links (Up or Down) constitutes link state Shortest Path Tree: Based on the link states, a node can use Dijkstras Algorithm to create a Shortest Path Tree which can used as the routing table There are four sets of operations required Creation of Link State Packets (LSPs) Flooding of LSPs Formation of shortest path tree Calculation of routing based on the tree
47 Tusharadri Sarkar December 7, 2009
Initial Condition:
A
State of Links for A
B
5 2
5 2
2
A
3
4 C
4
State of Links for C
5 4
B
3
3
State of Links for D
3
4 3
D
48 Tusharadri Sarkar
December 7, 2009
START
Set root to local node and move it to tentative list
YES STOP NO
Among nodes in tentative list, move the ones with shortest path to permanent list Add each unprocessed neighbor of last moved node to tentative list if it is not there already. If neighbor is in tentative list with larger cumulative cost, replace with new one
49 Tusharadri Sarkar December 7, 2009
Root
Root
2 3 D
Root
B 5
2 3 D
C E 6
Root
B B 5
2 3 D
C E 6
Root
B B 5
2 3 D
C E 6
Root
B B 5
2 3 D
C E 6
Node A B C D E
Cost 0 5 2 3 6
Next _ _ _ _ C
We can see that the routing table of A as deduced by Link State Routing is the same as Distance Vector Routing In real scenario, the routing table is determined by the cost assigned to each node by the administrator
December 7, 2009
contained within an autonomous system Area Border Routers: Summarizes all the information about an area and shares it across Backbone: A special area among all areas in an AS which all other areas must be connected to. The backbone always has area code 0 Backbone Routers: Routers in a backbone. A backbone router can also be area border router Virtual Link: If the connection between an area and backbone is broken the administrator can create an alternate connection between routers
Tusharadri Sarkar December 7, 2009
57
OSPF: Implementation
net net net net Area 2 net
net ABR
net
net
BR
net AS BR
BR
Area 0 (Backbone)
routing? Reason: Scalability DVR becomes instable and intractable for a large number of hops (even more than 16) LSR needs a huge amount of resource to calculate its shortest paths. It also causes heavy traffic in the network because of flooding of LSP How path vector routing eliminates them? Well, it is simply derived from DVR, but does not assign hop count as the metric/cost...
Tusharadri Sarkar
59
December 7, 2009
node acts on behalf on the entire AS. It summarizes all the information of that AS, creates a routing table and advertizes it to other ASs What is advertized? Not the metrics but the paths in an AS Policy: Every AS will have a well defined policy Paths are decided upon by the speaker nodes by consulting the policies in neighboring ASs Reason: Different ASs will have different policies & priorities associated with them
60
Tusharadri Sarkar
December 7, 2009
about all other nodes inside its AS Sharing: Just as in DVR, the speaker nodes will then share their tables with immediate neighbors periodically or on trigger Updating: On receiving a two column table from neighbor, a speaker node will update its table by adding the nodes not present in its routing table as well as adding its own AS and other ASs that sent the table
Loop Prevention Policy Routing Optimum Path
61 Tusharadri Sarkar December 7, 2009
Table of C1
Dest. C1 C2 C3
C2
Dest.
C3
D1 D2 D3 D4
A1
AS2
B3
C1
Dest. B1 B2 B3 B4
62
AS4
D1
D2 D3
D4
B1
B2
B4
Tusharadri Sarkar
December 7, 2009
Table of A1
63 Tusharadri Sarkar
Table of B1
Table of C1
Table of D1
December 7, 2009
PVR; upon receiving a message the router checks to see if its AS is in the path Policy Routing: Upon receiving a message a router checks the path with policy. If an AS in the path is against policy it can ignore that Optimum path: Router find the path that fits the organization best. A path from AS4 to AS1 can either be AS4->AS3->AS2->AS1 or AS4->AS3->AS1. Here we will choose the path with less number of ASs involved
This is not a general rule. There are complex criteria which
stub is either a source or a sink Multihomed AS: An AS which is connected to more than one AS, but it is only a sink or source. Example: A large corporation which is connected to more than one regional or national ASs Transit AS: A multihomed AS that allows flow of data traffic through it. Example: All national and international ISPs
65 Tusharadri Sarkar December 7, 2009
routers
Optional transitive attribute: It must be passed to the next router
by the router that has not implemented it Optional non-transitive attribute: It must be discarded if the receiving router has not implemented it
66 Tusharadri Sarkar December 7, 2009
between two BGP routers for the sake of exchanging router information A session in BGP is a connection at the TCP level.
External BGP Session (E-BGP): Takes place when two speaker
nodes exchange routing information Internal BGP Session (I-BGP): Takes place when a speaker node collects information from other nodes in the its own As
AS1
A2 A4
67 Tusharadri Sarkar
AS3
C2 C3
A3 A5
A1
C1
December 7, 2009
Reference
Data Communications and Networking
Behrouz A. Forouzen
68
Tusharadri Sarkar
December 7, 2009
Thank You
69
Tusharadri Sarkar
December 7, 2009