1 / 44

IP Routing

IP Routing. Routing is one of the most important functions of IP Datagrams to be routed can either be generated on the local host or on some other host If a machine is not configured as a router, datagrams received through network interfaces that are not addressed to the machine are dropped

Download Presentation

IP Routing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IP Routing • Routing is one of the most important functions of IP • Datagrams to be routed can either be generated on the local host or on some other host • If a machine is not configured as a router, datagrams received through network interfaces that are not addressed to the machine are dropped • Two general flavors of routing • Host Routing • Router Dynamic Routing

  2. Host Routing • Conceptually IP routing is easy, especially for a host • Remember the structure of an internet address • If the destination is directly connected to the host, or on a shared network, then the datagram is sent directly • Otherwise the host sends the datagram to a default router, and lets the router do all of the work Dynamic Routing

  3. IP routing Algorithm • The basic internet routing algorithm is used by both hosts and routers • The primary difference is that hosts never forward datagrams (except to a default router), whereas routers forward datagrams • The algorithm uses a routing table to make routing decisions Dynamic Routing

  4. A Typical Routing Table • Each entry in the routing table contains the following information • Destination IP address. • this can be either a host address or a network address • IP address of the next-hop router, or the IP address of a directly connected network • Flags that tell more about the entry • Which interface the datagram should be passed to for delivery Dynamic Routing

  5. IP routing • IP routing performs the following actions • search the routing table for an entry that matches the complete destination address. If found, send the packet as indicated • search the routing table for a matching destination network ID. If found, send the packet as indicated • search the routing table for a default entry. If found send the packet as indicated • If none of the steps work, the datagram is undeliverable Dynamic Routing

  6. IP Layer Routing Dynamic Routing

  7. IP Routing • The routing done by IP, when it searches the routing table and decides which interface to send a packet out, is a routing mechanism • A routing policy is a set of rules that determines which routes go into the routing table. • IP performs the routing mechanism while a routing daemon normally provides the routing policy. Dynamic Routing

  8. Initializing a Routing Table • One common way is to execute the route command explicitly from the initialization files when the system is being bootstrapped. • Some systems allow a default router to be specified in a file such, and this default is added to the routing table on every reboot. • Other ways to initialize a routing table are to run a routing daemon or to use the newer router discovery protocol. Dynamic Routing

  9. Routing Errors • What happens if there is no default route, and a match is not found for a given destination? • If the datagram was generated locally, an error is returned to the application that sent the datagram (either “host unreachable” or “network unreachable”) • What do I do if I am a router? • Sender should be notified of the error Dynamic Routing

  10. Dynamic Routing • Dynamic Routing occurs when routers talk to adjacent routers, informing each other of what networks each router is currently connected to • Routers communicate using a routing protocol • The process on the router that is running the routing protocol is usually called a routing daemon • Dynamic routing does not change the way the kernel performs routing at the IP layer. What changes is where the information comes from that is placed into the routing table. Dynamic Routing

  11. Routing in the Internet • The Global Internet consists of Autonomous Systems (AS) interconnected with each other: • Stub AS: small corporation • Multihomed AS: large corporation (no transit) • Transit AS: provider • Two-level routing: • Intra-AS: administrator is responsible for choice • Inter-AS: unique standard Dynamic Routing

  12. Internet AS Hierarchy Dynamic Routing

  13. Intra-AS Routing • Also known as Interior Gateway Protocols (IGP) • Most common IGPs: • RIP: Routing Information Protocol • OSPF: Open Shortest Path First • IGRP: Interior Gateway Routing Protocol Dynamic Routing

  14. Exterior Gateway Protocols • Exterior gateway protocols (EGPs), or inter-domain routing protocols, are used between routers in different autonomous systems. • The predominant EGP has been EGP. A newer EGP is the Border Gateway Protocol (BGP). Dynamic Routing

  15. Unix Routing Daemons • Unix systems often run the routing daemon routed. It is provided with almost every implementation of TCP/IP. • routed communicates using only RIP. It is designed for small to medium-size networks. • An alternative program is gated which supports both IGPs and EGPs. Dynamic Routing

  16. Routing Information Protocol (RIP) • Distance vector type scheme • Included in BSD-UNIX Distribution in 1982 • Distance metric: # of hops (max = 15 hops) • Distance vector: exchanged every 30 sec via a Response Message (also called Advertisement) • Each Advertisement contains up to 25 destination nets Dynamic Routing

  17. Distance Vector Routing Table • Same as what we have seen before but includes a hop count (or some other metric) • Periodically routers advertise their routes • I can get here and it will cost you X to use me • When an update is received • Add one to each hop count in the packet • For each destination advertised • If not in routing table  Add it • If next hop ≤ route in table  Replace it Dynamic Routing

  18. Example Dynamic Routing

  19. Example Dynamic Routing

  20. RIP • RIP messages are carried in UDP datagrams. The official specification for RIP is RFC1058 Dynamic Routing

  21. RIP Message Fields • A command of 1 is a request, and 2 is a reply. There are other obsolete commands (2 and 3), and two undocumented ones: poll(5) and poll-entry(6). • A request asks the other system for all or part of its routing table. A reply contains all of part of the sender's routing table. • The version is normally 1. Dynamic Routing

  22. RIP Address Entries • The next 20 bytes specify the address family, an IP address, and an associated metric. RIP metrics are hop counts. • Up to 25 routes can be advertised in a message. This keeps the size of the RIP message to 504 bytes which is less than 512. • With a limit of 25 routes per message, multiple messages are often required to send an entire routing table. Dynamic Routing

  23. RIP Initialization • When the daemon starts it determines all of the interfaces that are up and sends a request packet out each interface, asking for the other router's complete routing table • This request packet has a command of 1 but the address family is set to 0 and the metric is set to 16. This is a special request that asks for a complete routing table from the other end Dynamic Routing

  24. RIP Operation • Request received • If the request is the special case, then the entire routing table is sent to the requestor. Otherwise each entry in the request is processed: • if we have a route to the specified address, set the metric to our value, else set the metric to 16. The response is returned. • Response received • The response is validated and may update the routing table. New entries can be added,existing entries can be modified, or existing entries can be deleted Dynamic Routing

  25. Other Operations • Regular routing updates • Every 30 seconds, all or part of the router's entire routing table is sent to every neighbor router • Triggered updates • Whenever the metric for a route changes, the entire table need not be sent, only those entries that have changed must be transmitted • Each route has a timeout. If a route has not been updated for 3 minutes, that route's metric is set to infinity (16) and marked for deletion. Dynamic Routing

  26. RIP Hop Counts • The metrics used by RIP are hop counts. The hop count for all directly connected interfaces is 1. • If an adjacent router advertises a route to another network with a hop count of 1, then our metric for that network is 2, since we have to send a packet to that router to get to the network. • As each router sends its routing tables to its neighbors, a route can be determined to each network within the AS. Dynamic Routing

  27. RIP Hop Counts • As each router sends its routing tables to its neighbors, a route can be determined to each network within the AS. • If there are multiple paths within the AS from a router to a network, the router selects the path with the smallest hop count and ignores the other paths. Dynamic Routing

  28. RIP Problems • As simple as all this sounds, there are pitfalls. • RIP has no knowledge of subnet addressing • RIP takes a long time to stabilize after the failure of a router or a link. There are many subtle details in the implementation of RIP that must be followed (see RFC1058 for details) • The use of hop count as the routing metric omits other variables that should be taken into consideration • The maximum hop count of 15 limits the sizes of networks on which RIP can be used. Dynamic Routing

  29. RIP-2 • RFC1388 defines newer extensions to RIP, and the result is normally called RIP-2 Dynamic Routing

  30. RIP-2 Fields • The routing domain is an identifier of the routing domain to which this packet belongs. • The route tag exists to support exterior gateway protocols. It carries an autonomous number for EGP and BGP. • A simple authentication scheme is provided • RIP-2 supports multicasting in addition to broadcasting. Dynamic Routing

  31. OSPF • OSPF is a newer alternative to RIP as an interior gateway protocol. It overcomes all the limitations of RIP. OSPF version 2 is described in RFC1247. • OSPF is a link-state protocol, as opposed to RIP, which is distance-vector protocol • OSPF is different from RIP in that OSPF uses IP directly. That is, it does not use UDP or TCP Dynamic Routing

  32. Link State Protocols • In a link-state protocol a router does not exchange distances with its neighbors. Instead each router actively tests the status of its link to each of its neighbors, sends this information to its neighbors, which then propagate it throughout the AS. • Each router uses the link-state information to build a complete routing table. • A link-state protocol will always converge faster than a distance-vector protocol. Dynamic Routing

  33. Benefits of OSPF • OSPF can calculate a separate set of routes for each IP type-of-service • Each interface is assigned a dimensionless cost. • When several equal-cost based routes to a destination exist, OSPF distributes traffic equally among the routes • OSPF supports subnets: a subnet mask is associated with each advertised route Dynamic Routing

  34. Benefits of OSPF • Point-to-point links between routers do not need an IP address at each end. These are called unnumbered networks • A simple authentication scheme can be used. A cleartext password can be specified, similar to the RIP-2 scheme • OSPF uses multicasting, instead of broadcasting, to reduce load on systems not participating in OSPF Dynamic Routing

  35. Inter-AS routing Dynamic Routing

  36. Inter-AS routing • BGP (Border Gateway Protocol): the de facto standard • Path Vector protocol: and extension of Distance Vector • Each Border Gateway broadcast to neighbors (peers) the entire path (ie, sequence of ASs) to destination • For example, Gateway X may store the following path to destination Z: Path (X,Z) = X,Y1,Y2,Y3,…,Z Dynamic Routing

  37. Inter-AS routing • Now, suppose X send its path to peer W • W may or may not select the path offered by X, because of cost, policy or loop prevention reasons. • If W selects the path advertised by X, then: Path (W,Z) = w, Path (X,Z) • Note: path selection based not so much on cost (eg,# of AS hops), but mostly on administrative and policy issues (e.g., do not route packets through competitor’s AS) Dynamic Routing

  38. Inter-AS routing (cont) • Peers exchange BGP messages using TCP. • OPEN msg opens TCP connection to peer and authenticates sender • UPDATE msg advertises new path (or withdraws old) • KEEPALIVE msg keeps connection alive in absence of UPDATES; it also serves as ACK to an OPEN request • NOTIFICATION msg reports errors in previous msg; also used to close a connection Dynamic Routing

  39. Why different Intra- and Inter-AS routing ? • Policy: Inter is concerned with policies (which provider we must select/avoid, etc). Intra is contained in a single organization, so, no policy decisions necessary • Scale: Inter provides an extra level of routing table size and routing update traffic reduction above the Intra layer • Performance: Intra is focused on performance metrics; needs to keep costs low. In Inter it is difficult to propagate performance metrics efficiently (latency, privacy etc). Besides, policy related information is more meaningful. Dynamic Routing

  40. Classless Inter-domain Routing • The shortage of class B addresses requires sites with multiple networks to now obtain multiple class C network IDs, instead of a single class B network ID • Although this solves the problem of running out of class B addresses, it introduces another problem: every class C network requires a routing table entry Dynamic Routing

  41. CDIR • CDIR, also called supernetting, is a way to prevent an explosion in the size of the Internet routing tables. It is described in RFC1518 and RFC1519 • RFC1467 summarizes the state of CDIR deployment in the Internet • The basic concept is to allocate multiple addresses in such a way that allows summarization into a smaller number of routing table entries Dynamic Routing

  42. Summarization • Three features are needed: • Multiple IP addresses to be summarized together for routing must share the same high-order bits of their addresses • The routing tables and routing algorithms must be extended to base their routing decisions on a 32-bit address and a 32-bit mask • The routing protocols being used must be extended to carry the 32-bit mask in addition to the 32-bit address (OSPF and RIP-2 are both capable of doing this) Dynamic Routing

  43. Example • RFC1466 recommends that new class C addresses in Europe be in the range 194.0.0.0 through 195.255.255.255 (0x2000000 through 0xc3ffffff) • In countries other than Europe a single routing table entry with an IP address of 0x2000000 and a 32-bit mask of 0xfe000000 (254.0.0.0) could be used to route all of these 65535 network IDs to a single point Dynamic Routing

  44. Why Classless? • CIDR also uses a technique whereby the best match is always the one with the longest match: The one with the greatest number of one bits in the 32-bit mask • The term classless is used because routing decisions are now based on masking operations of the entire 32-bit address. Whether the IP address is class A, B, or C makes no difference. Dynamic Routing

More Related