Unicast Routing Protocols (RIP, OSPF, and BGP)
Total Page:16
File Type:pdf, Size:1020Kb
Unicast Routing Protocols (RIP, OSPF, and BGP) Chapter 11 Routing Protocols Routing Protocol is combination of rules and procedures lets routers in internet inform each other of route changes Autonomous System (AS) is group of networks and routers under authority of single administration Intradomain routing is routing inside AS Handled by interior routing protocol Interdomain routing is routing between AS’s Handled by exterior routing protocol 2 Autonomous Systems 3 Routing Protocols 4 Distance Vector Routing Uses Bellman-Ford algorithm for creating routing table for routers in AS Each node shares its routing table with its immediate neighbors periodically and when there is a change 5 Bellman-Ford Algorithm 6 Distance Vector Routing 7 Distance Vector Routing 4 3 2 Net5 , 1Net4 , 1Net2 , 1 8 Count to Infinity -- Two-Node Instability 9 Solutions to Instability Defining Infinity Define 16 as infinity Split Horizon If node B reaches X via A, then B does not need to advertise to A its (B's) distance to X Split Horizon and Poison Reverse If node B reaches X via A, then B will advertise to A that its (B's) distance to X is infinity 10 Three-Node Instability 11 Routing Information Protocol (RIP) Intradomain routing protocol Based on distance vector routing Uses hop count as metric (cost) Infinite distance defined as 16 hops 12 Example of a domain using RIP 13 RIP Message Format Command: Request (1), Response (2) Version: 1 Family: TCP/IP (2) 14 Requests and Responses Request Message Response (Update) Message Solicited response: sent only in answer to request Unsolicited response: sent periodically (every 30 sec) 15 Update Message – Example Update message from R1 to R2: 16 RIP Timers Periodic timer: How frequent to send update message Expiration timer: How long to wait for update message Garbage collection timer: How long to wait before purging route from table 17 RIP Version 2 Message Format Route tag: AS number Uses all-router multicast address to send RIP messages Supports classless addressing 18 RIP Version 2 Supports authentication 19 Encapsulation RIP messages encapsulated in UDP datagrams UDP uses well-known port (520) for RIP IP datagram UDP datagram IP UDP RIP message header header 20 bytes 8bytes 20 Link State Routing Each node advertises its links state to all other nodes (flooding) Link state packet (LSP) carries node identity, list of links, sequence number, and age Each node uses same topology to create its routing table Each node constructs its routing table using Dijkstra algorithm 21 Link State Routing 22 Dijkstra Algorithm: Forming Shortest Path Tree 23 Open Shortest Path First (OSPF) Protocol Intradomain routing protocol Based on link state routing Metric can be based on type of service (min delay, max throughput, …) Divides autonomous system into areas 24 Types of Links 25 Types of Links 26 Virtual Link When link between two routers is broken, virtual link created using path probably goes through several routers 27 Types of OSPF Packet 28 OSPF Common Header (Router ID) 64 Type: Defines the packet type (1 to 5) Checksum: On entire packet excluding authentication Authentication: None (0), Password (1) 29 Link State Update Packet Used by router to advertise its links states Each packet contains several different LSAs (LSA) 30 Link State Update Packet # of LSAs 31 LSA General Header Link State Type Link State ID Type 1: Router link Address of router Type 2: Network link Address of designated router Type 3: Summary link to network Address of network Type 4: Summary link to AS boundary router Address of AS boundary router Type 5: External link Address of external network 32 Router Link LSA Announce all router links 33 Router Link LSA 34 Router Link LSA Example 35 Router Link LSA Example 36 Network Link LSA Announce network and all routers connected to it Distributed by designated router on behalf of transient network 37 Network Link LSA 38 Network Link LSA Example 0 39 Network Link LSA Example Router-link LSA Network-link LSA R1 has two links (N1, N2) N1 advertised by R1 R2 has one link (N2) N2 advertised by designated R3 has two links (N2, N3) router (R1, R2, or R3) N3 advertised by R3 40 Summary Link to Network LSA Announce networks outside the area Flooded by area boarder router 41 Summary Link to Network LSA 42 Summary Link to AS Boundary Router LSA Announce AS boundary router Flooded by area boarder router 43 Summary Link to AS Boundary Router LSA 44 External Link LSA Announce networks outside AS Flooded by AS boundary router 45 External Link LSA 46 Hello Packet To create neighborhood relationships To test reachability of neighbors Determine the selection of designated router 47 Database Description Packet Sent by neighbors to new connected router Contains outline (LSA header) of each link in link-state database 48 Link State Request Packet Sent by router needs information about specific link Can be used by newly connected router to request more information after receiving database description packet 49 Link State Acknowledgment Packet To acknowledge receipt of every link state update packet 50 Encapsulation OSPF packets encapsulated in IP datagrams IP datagram IP OSPF packet header 20 bytes 51 Path Vector Routing Exterior routing protocol for inter-domain or inter-AS routing Router has list of networks can be reached with path (list of ASs to pass) Prevents looping using path information Allows routing based on router policy Optimum path is one that fits organization needs (security, safety, reliability, …) 52 Reachability 53 Routing Tables 54 Routing Tables After Aggregation 14 14 14 55 Loop Prevention 56 Border Gateway Protocol (BGP) Interdomain routing protocol Uses path vector routing Supports classless addressing (CIDR) Path is presented as list of attributes 57 Path Attributes AS_PATH Defines list of ASs to reach destination NEXT-HOP Defines next router to which packet sent ORIGIN Defines source of routing information (IGP: interior, EGP: exterior) 58 BGP Sessions External BGP (E-BGP) session Exchange information between BGP routers in different ASs Internal BGP (I-BGP) session Exchange information between BGP routers inside AS 59 Types of BGP Messages 60 BGP Packet Header Marker: reserved for authentication 61 Open Message To create neighborhood relationship Neighbor responds with keepalive message Hold time: waiting time until receiving keepalive or update message BGP identifier: defines sending router (its IP address) 62 Update Message To withdraw destinations advertised previously To announce route to new destination 63 Update Message Network layer reachability information Network to be advertised (Length, Prefix) tuple Length: number of bits in prefix Prefix: common part of network address Example: IP address 153.18.7.0/24 Length: 24 Prefix: 153.18.7 Withdrawn routes Destinations to be deleted from previously advertised list (Length, Prefix) tuple 64 Keepalive Message Exchanged between peers regularly before hold time expires 65 Notification Message Sent by router whenever error detected or to close connection Error Code: Message header error (1), Open message error (2), Update message error (3), Hold time expired (4). 66 Encapsulation BGP messages encapsulated in TCP segments TCP uses well-known port (179) for BGP 67 .