C S Chapter 6 Delivery Forwarding of IP






















































- Slides: 54
C S Chapter 6 Delivery & Forwarding of IP Packets 4 6 2 2 Dr. Clincy 1
C S 4 6 2 2 ROUTING METHODS There are various routing methods: • Next-Hop Routing – table only holds the address of the next hop (instead info regarding the entire route) – routing table for each host • Network-Specific Routing – instead of an entry for each host (on the same network), only one entry for the network is defined • Host-Specific Routing – for a specific destination host, you might want to control the exact route – in this case, the actual Rx is listed in the routing table and the desired next hop is listed • Default Routing – instead of listing all of the various networks in the Internet, Tx host would use one entry called the Default (network address 0. 0) Dr. Clincy 2
C S Next-hop routing Next-Hop Routing – table only holds the address of the next hop (instead info regarding the entire route) 4 6 2 2 Show more routers in better illustrating the routing table Dr. Clincy 3
C S Network-specific routing Network-Specific Routing – instead of an entry for each host on the same physical network, only one entry for the network is defined 4 6 2 2 Dr. Clincy 4
C S Host-specific Routing Host-Specific Routing – for a specific destination host, you might want to control the exact route – in this case, the actual Rx is listed in the routing table and the desired next hop is listed 4 6 2 2 R 1 In this case, you want every packet traveling to Host B to traverse through R 3. For the other hosts on N 2 and N 3, the Network-specific routing approach is used. Dr. Clincy 5
C S Default Routing • Default Routing – instead of listing all of the various networks in the Internet, Tx host would use one entry called the Default (network address 0. 0) 4 6 2 2 In this case, R 1 sends to a specific network however, R 2 sends to the remainder of the Internet (default) Dr. Clincy 6
C S Simplified forwarding module in classful address without subnetting 4 6 2 2 Using the next-hop address and interface number, ARP searches for the physical address in facilitating the actual hop For the Classful case, per router, a table was needed for each class – this made the searching simple Dr. Clincy 7
C S Configuration for routing for R 1, Classful Case 4 6 2 2 Dr. Clincy 8
C S Simplified forwarding module in classful address with subnetting 4 6 2 2 Recall for the Classful case, subnetting is done within the organization Dr. Clincy 9
C S Configuration for the Classful and Subnetting Case Doesn’t know what network is connected to router here 4 6 2 2 Dr. Clincy 10
Simplified forwarding module in classless address C S 4 6 2 2 Dr. Clincy 11
C S Routing Table for R 1 in the Illustrated Configuration – Classless Case 4 6 2 2 Dr. Clincy 12
Address aggregation C S 4 6 2 2 With the classless approach, routing tables increased – in reducing the size of some tables, use a router to represent multiple blocks – address aggregation Dr. Clincy 13
C S 4 6 2 2 STATIC VERSUS DYNAMIC ROUTING • Host or router uses a routing table • Table can be either static or dynamic in nature • A static routing table contains information entered manually. • A dynamic routing table is updated periodically using one of the dynamic routing protocols such as RIP, OSPF, or BGP • Regarding dynamic routing table: if fiber cut or router failure, the tables are updated Dr. Clincy 14
C S Router’s Table Logistics When the router is looking for the route, it: First check for direct delivery 4 6 2 2 Then host-specific delivery, The network-specific delivery, and Finally, default delivery This order can be organized with in the routing table Dr. Clincy 15
Routing Table C S 4 6 2 2 Mask: used to extract the net id of the Rx. For Host-Specific Routing - the mask is 255 and for Default Routing – the mask is 0. 0. Destination Address: either the destination host address or destination network address Next-hop Address: next hop router address Flags U - The router is up and running. If router is down, the packet discarded G - The destination is in another network. If G flag present, indirect delivery (if not, direct delivery) H – If H flag present, destination field contains Host-specific address (if not present, network address) D – If D flag present, routing info added to host routing table via ICMP’s redirection (cover later) M - If M flag present, routing info was modified via ICMP’s redirection (cover later) Reference count: # of users using this route at any moment Use: # of packets transmitted through this router for the corresponding Rx Interface: name of the interface Dr. Clincy 16
A routing example C S 4 6 2 2 Router R 1 receives 500 packets for destination 192. 16. 7. 14 - how does Router R 1 uses it’s routing table ? ? ? Dr. Clincy 17
C S Mask Dest. 255. 0. 0. 0 111. 0. 0. 0 Next Hop I. -- m 0 U case 255. 224 193. 14. 5. 160 - m 2 UGH case 255. 224 193. 14. 5. 192 - m 1 UG case 4 6 2 2 -------------------------------------255. 255 194. 17. 21. 16 111. 20. 18. 14 m 0 --------------------------------------255. 0 192. 16. 7. 0 111. 15. 17. 32 m 0 255. 0 194. 17. 21. 0 111. 20. 18. 14 m 0 --------------------------------------the router applies the masks to the destination address until a match with the second column Dr. Clincy 0. 0 111. 30. 31. 18 m 0 Direct delivery 192. 16. 7. 14 & 255. 0. 0. 0 192. 0. 0. 0 no match 192. 16. 7. 14 & 255. 224 192. 16. 7. 0 no match 18
C S U case UGH case UG case Mask Dest. Next Hop I. 255. 0. 0. 0 111. 0. 0. 0 -- m 0 255. 224 193. 14. 5. 160 - m 2 255. 224 193. 14. 5. 192 - m 1 -------------------------------------255. 255 194. 17. 21. 16 111. 20. 18. 14 m 0 -------------------------------------- 4 6 2 2 255. 0 192. 16. 7. 0 111. 15. 17. 32 m 0 255. 0 194. 17. 21. 0 111. 20. 18. 14 m 0 --------------------------------------0. 0 111. 30. 31. 18 m 0 Host-specific 192. 16. 7. 14 & 255 192. 16. 7. 14 no match Router stops when match is made Dr. Clincy Network-specific 192. 16. 7. 14 & 255. 0 192. 16. 7. 0 match 19
C S Example 2 Make the routing table for router R 1 in the Figure 4 6 2 2 U UG Dr. Clincy Mask Destination Next Hop I. 255. 0. 0 134. 18. 0. 0 -- m 0 255. 0. 0 129. 8. 0. 0 222. 13. 16. 40 m 1 255. 0 220. 3. 6. 0 222. 13. 16. 40 m 1 0. 0 134. 18. 5. 2 m 0 20
C STRUCTURE OF A ROUTER S 4 6 2 2 We represent a router as a black box that accepts incoming packets from one of the input ports (interfaces), uses a routing table to find the departing output port, and sends the packet from this output port. The topics discussed in this section include: Components Dr. Clincy 21
Router components C S 4 6 2 2 Performs layer 1 and 2 functions: signal to bits, packet decapsulated from frame, error control performed on bits, buffers packets before going to the switching fabric Dr. Clincy This is where delay is incurred Performs layer 1 and 2 functions: bits to signal, packet encapsulated into frame, error control overhead added 22
Crossbar Switching Fabric C S 4 6 2 2 Cross Point Dr. Clincy 23
A banyan switch C S Uses a binary string to route across the switch 4 6 2 2 Example Given a packet came in on port 1 and needed to go out of port 6, the binary string of 110 will be used – explain this Dr. Clincy 24
C S 4 6 2 2 Chapter 11 Unicast Routing Protocols (RIP, OSPF, BGP) (How the routers’ tables are filled in) Dr. Clincy 25
C S 4 6 2 2 Routing Protocols • At this stage, we understand how a router uses a routing table in making a next hop decision • However, what dictates HOW the routing tables are filled in ? • Tables are concerned about the next hop only • What’s responsible for looking across the entire path or route – what makes the decision of the best route ? • Routing Protocols and Algorithms are used • Routing protocols allow routers to share info with one another dynamically - as the Internet makes changes, the routing protocols allow routers to inform other routers • Routers communicate to their neighboring routers - gossip • Routing protocols implement the procedures for combining info received from other routers • Routing Algorithms – decision making analysis – the “brains” – using the info provided Dr. Clincy 26
C S Autonomous systems • Because the Internet is so large, one protocol cannot handle all of the updating of tables – create groups and networks and routers called Autonomous Systems • Routing within the autonomous system is called “interior routing” • Routing between the autonomous systems is called “exterior routing” 4 6 2 2 NOTE: different interior routing protocols can be used for each autonomous systems HOWEVER, only one exterior routing protocol is used R 1, R 2, R 3 and R 4 use an interior and exterior routing protocol – all other routers only use an interior routing protocol Dr. Clincy 27
C S 4 6 2 2 Tx How does it work ? • A certain “cost” or “metric” is assigned each network Rx • In figuring out the best route from Tx to Rx, the set of networks with the smallest sum is chosen • More generically, the set of networks best • If #hops was the metric, we would want to traverse meeting the least number of networks in going from Tx to Rx “metric’s” objective is chosen • If max throughput was the metric, a fiber optic network would have a better metric than a coaxial network. Dr. Clincy 28
C S Explain routing using your street/highway analogy 4 6 2 2 • Autonomous systems • Default routing Dr. Clincy 29
Popular Unicast Routing protocols C S 4 6 2 2 • RIP – Routing Information Protocol – treats each network the same (assigns the same cost for each network) • OSPF – Open Shortest Path First protocol – assigns a cost for passing through a network based on the type of service required – routes through the network can have different cost – each router would have several tables • BGP – Border Gateway Protocol – is an exterior routing protocol that uses a policy that defines what paths should be chosen Dr. Clincy 30
C S RIP Algorithm Distance Vector Algorithm built from Bellman-Ford Algorithm Recall: each router sends message to it’s neighbor 4 6 2 2 For the router receiving a RIP response 1 st – add one to hop count for each destination advertised 2 nd – repeat the following steps for each advertised destination 1. If destination is not in table add destination to table 2. Else if destination is in table 1. If next-hop field is the same replace entry in table with advertised one 2. Else next-hop different Dr. Clincy 31 replace entry if advertised hop count is less
Explain RIP in Simple English C S 4 6 2 2 Dr. Clincy 32
C S Example RIP Algorithm • Router receives RIP message for some router C • The RIP message list destination networks, corresponding hop count and next hop (not listed in diagram) • 1 st step: increment hop count • Net 1: no news, don’t change • Net 2: same next hop, so replace 2 with 5 • Net 3: new router, so add 4 6 2 2 • Net 6: different next hop, new hop count less, so replace • Net 8: different next hop, new hop count the same, don’t change • Net 9: different next hop, new hop count larger, do not change Dr. Clincy 33
Initial routing tables in a small autonomous system C S Initial tables are created from config file (and hop counts are set to 1) – next hop fields are empty initially because all networks are directly connected 4 6 2 2 Dr. Clincy 34
C S Final routing tables for the previous figure For example, suppose packet hitting Router A first had a destination of Net 66 ? 4 6 2 2 Dr. Clincy 35
RIP message format C S 4 6 2 2 • Command – 8 -bit field specifying the type of message: response (2) or request (1) • Version – 8 -bit field specifying RIP version • Family – 16 -bit specifying protocol family (TCP/IP=2) • Network Address – address of the destination network • Distance – 32 -bit field defining the hop count from advertising router to destination network NOTE: Request can be issued by a newly added router or by a router seeking certain info NOTE: 2 response types: Solicited – response to request, Unsolicited – periodic updates Gray fields repeated for each destination network Dr. Clincy 36
C Example 1 S What is the periodic response sent by router R 1 in the figure below. Assume R 1 knows about the whole autonomous system. 4 6 2 2 Dr. Clincy 37
C S Solution R 1 can advertise three networks 144. 2. 7. 0, 144. 2. 9. 0, and 144. 2. 12. 0. The periodic response (update packet) is shown below 4 6 2 2 Dr. Clincy 38
RIP timers C S 4 6 2 2 • Periodic Timer – each router has timer set to 25 -35 secs and when the timer counts down, an update message is sent • Expiration Timer – governs the validity of the next-hop – when router receives next-hop update, timer is set to 180 sec. If there is a problem and the router doesn’t receive it’s 30 sec update, the route info expires (invalid) after the 180 sec count down – then the hop count is set to 16 (infinity) • Garbage Collection Timer – once the route expires, this timer is set to 120 sec and counts downs – allows neighbors time to become aware of invalidity – after count down, info is purged Dr. Clincy 39
Problems with RIP C S • Slow Convergence – the time it takes a change in the 4 6 2 2 Internet to propagate through the rest of the Internet – recall the periodic updates with neighbors. DEPENDING ON THE DATA RATE, millions or billions of bits could be sent in that time – therefore possibly lost nx 15 s Dr. Clincy 40
RIP Problem - Instability C S • RA and RB has hop counts 1 and 2, respectively for Net 1 • Net 1 goes down – RA can update fast due to direct connection – sets hop count to 16 4 6 2 2 • RA has to wait 30 sec to update RB (this is the problem) • In meanwhile, RB sends update to RA with hop count 2 for Net 1 (incremented to 3) • Now when RA finally send the update to RB, it sends a hop count of 3 (incremented to 4) – RA thinks it’s another route to Net 1 • This INSTABILITY (back-andforth) continues until both set hop count to 16 Dr. Clincy 41
C S Chapter 11 Unicast Routing 4 Protocols 6 2 (RIP, OSPF, BGP) 2 (How the routers’ tables are filled in) Dr. Clincy 42
Popular Unicast Routing protocols C S 4 6 2 2 • RIP (already covered) – Routing Information Protocol – treats each network the same (assigns the same cost for each network) • OSPF – Open Shortest Path First protocol – assigns a cost for passing through a network based on the type of service required – routes through the network can have different cost – each router would have several tables • BGP – Border Gateway Protocol – is an exterior routing protocol that uses a policy that defines what paths should be chosen Dr. Clincy 43
C S OSPF: Open Shortest Path First • Similar to RIP however, divide autonomous system into areas • Routers with in an area floods the area with routing info – router sends to all it’s neighbors and each neighbor sends to all it’s neighbors and etc. . • At the border of an area, special routers called area border routers are used to (1) summarize info about an area and (2) send info amongst areas 4 6 2 2 • A special area called the backbone is used to tie together all of the areas – backbone is primary area and all other areas are secondary areas – backbone area uses backbone routers • Note: backbone router can also be an area border router • Each area has an ID (backbone’s Id is 0) Explain Current Real World Practices relating to this topic Dr. Clincy 44
C Recall OSPF: Open Shortest Path First S • The OSPF is similar to RIP however, it allows the admin the • 4 6 2 2 • • ability to assign a cost or metric to each route. The metric can be based on a type of service (ie. Min delay, max throughput, etc. . ) For OSPF, a router will have multiple routing tables – one for each TOS Unlike RIP, sharing or updating is done when there is a change (not periodically) For OSPF, the objective is for the routers to contain the full picture or topology of the Internet – by having this, the router can figure out the “shortest path” or “least cost” route between itself and each network To do this, the Internet is represented by a graph – set of edges and nodes Dr. Clincy 45
C S 4 6 2 2 Defining edges or connections/links Point-to-point link Virtual link Direct connection between two routers, no IP address needed Bi-directional Edge When link between two routers are broken, admin creates a new route across multiple routers Transient link Stub link Represents the network Dr. Clincy Connects to only one router – packets enter and leave through this same router 46
C Graphical representation of an internet S 4 6 2 2 Dr. Clincy 47
C S OSPF uses Dijkstra’s Shortest Path Algorithm 4 6 2 2 Dr. Clincy 48
Dijkstra’s Algorithm Cont. . C S 4 6 2 2 Dr. Clincy 49
C S Dijkstra’s Algorithm Continued 4 6 2 2 At this point, we would have the least cost path from A to all other nodes Note: to find the least cost paths from E to all other nodes, Disjkstra’s algorithm has to run again Dr. Clincy 50
C S 4 6 2 2 Answer in Hyphen Format A-D-N 3 -F-N 5 A-N 1 -B-E-N 4 A-N 1 -C-N 2 A-N 1 Dr. Clincy A-N 1 -B 51
C S 4 6 2 2 A re-occurring theme How do the OSPF packets travel across the network(s) ? ? ? ? Dr. Clincy 52
C S 4 6 2 2 OSPF packets are encapsulated in IP datagrams. Dr. Clincy 53
C S 4 6 2 2 BGP: Border Gateway Protocol BPG is an interautonomous system routing protocol that makes use of path vector routing For BPG, each routing entry contains (1) destination network, (2) next router (hop) and (3) entire path to reach destination Path is an ordered list of autonomous systems that the packet should travel through to make it to the destination Dr. Clincy 54