Introduction to Computer Networks Routing Ilam University By

Introduction to Computer Networks Routing Ilam University By: Dr. Mozafar Bag-Mohammadi 1

Routing Process n Question? How to populate the lookup table? n Primary solutions: q q Build the lookup table Manually? Is it practical? The answer is no. Flooding- Broadcast to all node except the one we have received the packet. n n Waste the bandwidth Does not scale well. 2

Overview n Network as a Graph n Problem: Find lowest cost, or shortest, path between two nodes The process is distributed and this makes it complicated, i. e, it may create loop. Factors n n q q static: topology dynamic: load 3

Distance Vector n Each node maintains a set of triples (Destination, Cost, Next. Hop) n Exchange updates with directly connected neighbors q q n periodically ( on the order of several seconds) whenever its table changes (called triggered update) Each update is a list of pairs: (Destination, Cost) n Update local table if receive a “better” route q q n smaller cost came from next-hop Refresh existing routes; delete if they time out 4

Example Destination A C D E F G Cost 1 1 2 2 2 3 Next. Hop A C C A A A • Distance of other nodes from Node B. • The cost between two nodes has been assumed 1. • All nodes keep a routing table from themselves. 5

The Bellman-Ford Algorithm • Bellman-Ford algorithm solve the distance Vector problem in general case. 1. Set: Xo = ( , , , …, ). 2. Send updates of components of Xn to neighbors 3. Calculate: Xn+1 = F(Xn) 4. If Xn+1 Xn then go to (2) 5. Stop 6

Bellman-Ford Algorithm Example: Calculate from R 8 1 R 1 1 R 2 4 R 6 3 2 R 3 2 4 R 4 2 4 3 R 7 2 2 R 8 2 step R 6 3 R 5 4 R 3 2 nd R 4 2 2 4 R 5 2 R 7 2 3 3 R 8 7

Bellman-Ford Algorithm 6 R 1 3 rd 4 R 2 1 4 5 R 1 Result: 4 1 R 7 2 3 5 R 5 2 R 4 R 6 3 2 4 R 6 R 8 2 R 3 4 R 4 2 1 R 2 4 2 3 2 R 5 4 R 3 6 3 2 2 step 1 2 R 7 3 2 R 8 8

Node Failure q q q F detects that link to G has failed F sets distance to G to infinity and sends update to A A sets distance to G to infinity since it uses F to reach G A receives periodic update from C with 2 -hop path to G A sets distance to G to 3 and sends update to F F decides it can reach G in 4 hops via A 9

Routing Loops q q q link from A to E fails A advertises distance of infinity to E B and C advertise a distance of 2 to E B decides it can reach E in 3 hops; advertises this to A A decides it can read E in 4 hops; advertises this to C C decides that it can reach E in 5 hops… 10

The count-to-infinity problem 11

Loop-Breaking Heuristics n Set infinity to a reasonably small number. For instance, RIP sets to 16 n Split horizon: Don’t announce the distance to the node the distance has been gotten from. n Split horizon with poison reverse: Instead of not announcing the distance put negative numbers. 12

Link State n Strategy q n send to all nodes (not just neighbors) information about directly connected links (not entire routing table) Link State Packet (LSP) q q id of the node that created the LSP cost of the link to each directly connected neighbor sequence number (SEQNO) time-to-live (TTL) for this packet 13

Link State (cont. ) n Reliable flooding q q q store most recent LSP from each node forward LSP to all nodes but one that sent it generate new LSP periodically n q q increment SEQNO start SEQNO at 0 when reboot decrement TTL of each stored LSP n discard when TTL=0 14

Route Calculation n n Dijkstra’s shortest path algorithm Let q N denotes set of nodes in the graph q l (i, j) denotes non-negative cost (weight) for edge (i, j) q s denotes this node q M denotes the set of nodes incorporated so far q C(n) denotes cost of the path from s to node n M = {s} for each n in N - {s} C(n) = l(s, n) while (N != M) M = M union {w} such that C(w) is the minimum for all w in (N - M) for each n in (N - M) C(n) = MIN(C(n), C (w) + l(w, n )) 15

Shortest Path Routing: Dijkstra Algorithm 16

Subnetting n n n Add another level to address/routing hierarchy: subnet Subnet masks define variable partition of host part Subnets visible only within site Network number Host number Class B address 1111111111 00000000 Subnet mask (255. 0. 0) Network number Subnet ID Host ID Subnetted address 17

Subnet Example Subnet Net host Subnet mask: 255. 128. Subnet number: 128. 96. 34. 0 128. 96. 34. 15 128. 96. 34. 1 111…. 1. 0 xxx…. x H 1 R 1 Subnet mask: 255. 128 Subnet number: 128. 96. 34. 130 128. 96. 34. 139 128. 96. 34. 129 R 2 H 3 128. 96. 33. 14 128. 96. 33. 1 Subnet mask: 255. 0 Subnet number: 128. 96. 33. 0 H 2 Forwarding table at router R 1 Subnet # 128. 96. 34. 0 128. 96. 34. 128. 96. 33. 0 Subnet Mask 255. 128 255. 0 Next Hop interface 0 interface 1 R 2 18

Supernetting n n n Assign block of contiguous network numbers to nearby networks Called CIDR: Classless Inter-Domain Routing Represent blocks with a single pair (first_network_address, count) n n n Restrict block sizes to powers of 2 Use a bit mask (CIDR mask) to identify block size All routers must understand CIDR addressing 19

Route Propagation n Know a smarter router q q n Autonomous System (AS) q q q n hosts know local routers know site routers know core routers know everything corresponds to an administrative domain examples: University, company, backbone network assign each AS a 16 -bit number Two-level route propagation hierarchy q q interior gateway protocol (each AS selects its own) exterior gateway protocol (Internet-wide standard) 20

Architecture of Routing Protocols Interior Gateway Protocols (IGP) : inside autonomous systems UUNet OSPF, IS-IS, RIP, EIGRP, . . . IGP Metric Based AS 701 P EG E IGP AS 6431 BGP Policy Based GP AT&T Research Exterior Gateway Protocols (EGP) : between autonomous systems EGP AT&T Common Backbone AS 7018 21

Interior Gateway Protocols n RIP: Route Information Protocol q q n developed for XNS distributed with Unix distance-vector algorithm based on hop-count OSPF: Open Shortest Path First q q recent Internet standard uses link-state algorithm supports load balancing supports authentication 22

The Most Common Routing Protocols BGP RIP Cisco proprietary TCP UDP IP OSPF IS-IS EIGRP (and ICMP) Routing protocols exchange network reachability information between routers. 23

BGP-4 n BGP = Border Gateway Protocol n Is a Policy-Based routing protocol n Is the de facto EGP of today’s global Internet n Relatively simple protocol, but configuration is complex and the entire world can see, and be impacted by, your mistakes. • 1989 : BGP-1 [RFC 1105] – Replacement for EGP (1984, RFC 904) • 1990 : BGP-2 [RFC 1163] • 1991 : BGP-3 [RFC 1267] • 1995 : BGP-4 [RFC 1771] – Support for Classless Interdomain Routing (CIDR) 24

BGP-4: Border Gateway Protocol n AS Types q stub AS: has a single connection to one other AS n q multihomed AS: has connections to more than one AS n q refuses to carry transit traffic transit AS: has connections to more than one AS n n carries local traffic only carries both transit and local traffic Each AS has: q q one or more border routers one BGP speaker that advertises: n n n local networks other reachable networks (transit AS only) gives path information 25

EGP: Exterior Gateway Protocol n Overview q q n designed for tree-structured Internet concerned with reachability, not optimal routes Protocol messages q q q neighbor acquisition: one router requests that another be its peer; peers exchange reachability information neighbor reachability: one router periodically tests if the another is still reachable; exchange HELLO/ACK messages; uses a k-out-of-n rule routing updates: peers periodically exchange their routing tables (distance-vector) 26

Policy-Based vs. Distance-Based Routing? Minimizing “hop count” can violate commercial relationships that constrain interdomain routing. Host 1 Cust 1 YES ISP 1 NO ISP 3 ISP 2 Cust 3 Host 2 Cust 2 27

Why not minimize “AS hop count”? National ISP 1 YES National ISP 2 NO Regional ISP 3 Cust 4 Regional ISP 2 Cust 3 Regional ISP 1 Cust 2 28

BGP Operations Simplified Establish Peering on TCP port 179 AS 1 BGP Peers Exchange All Routes Exchange Incremental Updates AS 2 While connection is ALIVE exchange route UPDATE messages 29

Two Types of BGP Neighbor Relationships AS 1 • External Neighbor (e. BGP) in a different Autonomous Systems • Internal Neighbor (i. BGP) in the same Autonomous System e. BGP i. BGP Physical Connection AS 2 Logical (TCP) Connection 30

Four Types of BGP Messages n Open : Establish a peering session. n Keep Alive : Handshake at regular intervals. n Notification : Shuts down a peering session. n Update : Announcing new routes or withdrawing previously announced routes. announcement = Network prefix + attributes 31

AS Path Attribute (cont. ) BGP at AS YYY will never accept a route whose AS Path contains YYY. This avoids interdomain routing loops. AS 702 UUnet 10. 22. 0. 0/16 AS Path = 1 333 702 877 Don’t Accept! 32

Local Preference Attribute Used only in i. BGP to prefer a point of exit Frank’s Upstream Provider AS 4 13. 0. 0/16 AS Path = 4 1 Loc pref = 80 Frank’s Internet Barn 13. 0. 0/16 AS Path = 3 1 Loc pref = 90 Frank’s Local Competition AS 3 13. 0. 0/16 AS Path = 2 1 Loc pref = 100 Frank’s Customer AS 2 Higher Local Preference Values are more preferred Customer of Frank’s Customer AS 1 13. 0. 0/16 33

IP Version 6 n Features q q q q n 128 -bit addresses (classless) multicast real-time service authentication and security autoconfiguration end-to-end fragmentation protocol extensions Header q q 40 -byte “base” header extension headers (fixed order, mostly fixed length) n n fragmentation source routing authentication and security other options 34

Tunneling 35

Routing for Mobile Hosts 1 - finding location of the mobile host 2 - hand-off 3 - security 36

Routing for Mobile Hosts (2) Packet routing for mobile users. 37
- Slides: 37