CS321: Computer Networks Unicast Routing Dr. Manas Khatua Assistant Professor Dept. of CSE IIT Jodhpur E-mail: manaskhatua@iitj.ac.in
Introduction The goal of the network layer is deliver a datagram from its source to its destination. An Internet as a Graph 10-02-2017 Dr. Manas Khatua 2
Least cost routing one of the ways to interpret the best route from the source router to the destination router is to find the least cost between the two. Distance vector approach Link state approach 10-02-2017 Dr. Manas Khatua 3
Distance Vector Routing a router continuously tells all of its neighbours what it knows about the whole internet (although the knowledge can be incomplete) each node creates its own Ieast-cost tree with the (incomplete) information it receives from neighbours It is iterative, asynchronous, and distributed The heart of distance-vector routing is Bellman-Ford equation: d x (y) = min v {c(x,v) + d v (y)} distance vector: a one-dimensional array to represent the least-cost tree 10-02-2017 Dr. Manas Khatua 4
Cont 10-02-2017 Dr. Manas Khatua 5
Problem in DVR Count to Infinity problem (for two nodes): Solutions: Split Horizon: each node sends only specific part of its table through each interface Route deleted problem due to timer Poison Reverse: Do not use this value; what I know about this route comes from you 10-02-2017 Dr. Manas Khatua 6
Link State Routing a router continuously tells all nodes what it knows about the neighbours 10-02-2017 Dr. Manas Khatua 7
Cont To create a least-cost tree for itself, each node needs to run the famous Dijkstra Algorithm. 10-02-2017 Dr. Manas Khatua 8
Path-Vector Routing LS and DV both are based on least-cost routing Does not allow the sender to apply its own policy PV based on best path according to desired policy mainly used in routing between ISPs Path is determined from source to destination using spanning tree (might not be least cost) Spanning trees are made gradually and asynchronously likewise DVR Follow Bellman-Ford, but not the least-cost concept 10-02-2017 Dr. Manas Khatua 9
Internet Structure 10-02-2017 Dr. Manas Khatua 10
Routing Protocols Each ISP is considered as Autonomous System (AS) Stub AS: connects to one other AS only Multihomed AS: connects more than one AS, but refuses to carry transit traffic Transit AS: connects more than one other AS, and carries local and transit traffic Two types of routing protocol: Intra-AS / intradomain / Interior Gateway Protocol (IGP) E.g., RIP (Routing Information Protocol) - use DVR OSPF (Open Shortest Path First) - use LSR Inter-AS / interdomain / Exterior Gateway Protocol (EGP) E.g., BGP (Border Gateway Protocol) - use PVR 10-02-2017 Dr. Manas Khatua 11
RIP Follow distance-vector routing with the following modifications Router advertise the cost to reach different networks instead of individual node Advertise forwarding table instead of distance-vector Cost is defined as number of hops 10-02-2017 Dr. Manas Khatua 12
Cont 10-02-2017 Dr. Manas Khatua 13
RIP Implementation RIP runs at the application layer but creates forwarding table for network layer Uses the service of UDP on port 520 Runs as background process Two processes : a client and a server RIP uses two types of messages: request and response Runs as background process 10-02-2017 Dr. Manas Khatua 14
RIP Algorithm RIP uses three timers: Periodic timer: for advertising update message regularly Expiration timer: governs the validity of a route 10-02-2017 Dr. Manas Khatua 15
Cont 10-02-2017 Dr. Manas Khatua 16
BGP AS2, AS3, AS4 : stub AS; AS1 : transient AS Each AS use RIP / OSPF for intra-domain routing BGP for inter-domain routing used by all AS ebgp: on each border router ibgp: on all routers 10-02-2017 Dr. Manas Khatua 17
External BGP (ebgp) 3 pairs: R1-R5, R4-R9, R2-R6 => 3 ebgp sessions (using TCP) Message 1 is sent by router R1 and tells router R5 that N1, N2, N3, and N4 can be reached through router R1. Then, R5 updates its table. 10-02-2017 Dr. Manas Khatua 18
Limitation in ebgp 1. Border router does not know how to route a packet destined for non-neighbour AS. E.g., R5 does not know about networks in AS3, AS4 2. None of the non-border routers know how to route a packet destined for any network in other ASs. E.g., R3 does not know about networks in AS2, AS3, AS4 Solution: Internal BGP (ibgp) 10-02-2017 Dr. Manas Khatua 19
Internal BGP (ibgp) No message for R3, R7, R8 No ibgp session for single router in an AS. For n router in an AS: n(n-1)/2 sessions Message 1 sent by R1 tells that N8 and N9 are reachable through the path AS1-AS2, but the next router is R1. 10-02-2017 Dr. Manas Khatua 20
Finalizing BGP path table R1 receives: 10-02-2017 Dr. Manas Khatua 21
Cont 10-02-2017 Dr. Manas Khatua 22
Injection of Information into Forwarding Table The role of BGP is to help the routers inside the AS to augment their routing table Cost update problem for mixing of RIP and OSPF For stub AS: 10-02-2017 Dr. Manas Khatua 23
Cont For transient AS: 10-02-2017 Dr. Manas Khatua 24
Messages BGP uses 4 types of messages Open Message : for creating neighbourhood relationship. Router creates a TCP connection with neighbour router and sends Open message. Update Message: to withdraw destinations that have been advertised previously or to announce a route to a new destination Keepalive Message: BGP peers exchange this message to tell each other that they are alive Notification: when an error is detected or the router wants to close the session 10-02-2017 Dr. Manas Khatua 25
Path Attributes In RIP/OSPF a destination has two associated with two information: next hop and cost But, inter-domain routing needs more information In BGP, those information are called path attributes Destination can be associated with 7 attributes Two types of attribute: mandatory and optional Mandatory attributes must be present in each UPDATE message Optional attributes type: transitive and nontransitive 10-02-2017 Dr. Manas Khatua 26
Cont ORIGIN (Type 1): This is mandatory attribute. Value=1: path information comes from RIP/OSPF Value=2: information comes from BGP Value=3: information comes from other sources MULTI-EXIT-DISC (Type 4): This is optional intransitive attribute discriminates among multiple exit paths to a destination This is intransitive as the best exit path (e.g. shortest path) is different from one AS to other 10-02-2017 Dr. Manas Khatua 27
Route Selection 10-02-2017 Dr. Manas Khatua 28
10-02-2017 Dr. Manas Khatua 29