Dynamic Routing Dynamic Routing occurs when routers talk

  • Slides: 34
Download presentation
Dynamic Routing • Dynamic Routing occurs when routers talk to adjacent routers, informing each

Dynamic Routing • Dynamic Routing occurs when routers talk to adjacent routers, informing each other of what networks each router is currently connected to – the 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. 11/23/2020 Dynamic Routing 1

Routing in the Internet • The Global Internet consists of Autonomous Systems (AS) interconnected

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 11/23/2020 Dynamic Routing 2

Internet AS Hierarchy 11/23/2020 Dynamic Routing 3

Internet AS Hierarchy 11/23/2020 Dynamic Routing 3

Intra-AS Routing • Also known as Interior Gateway Protocols (IGP) • Most common IGPs:

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 11/23/2020 Dynamic Routing 4

Exterior Gateway Protocols • Exterior gateway protocols (EGPs), or interdomain routing protocols, are used

Exterior Gateway Protocols • Exterior gateway protocols (EGPs), or interdomain 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). 11/23/2020 Dynamic Routing 5

Unix Routing Daemons • Unix systems often run the routing daemon routed. It is

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. 11/23/2020 Dynamic Routing 6

Routing Information Protocol (RIP) • • Distance vector type scheme Included in BSD-UNIX Distribution

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 11/23/2020 Dynamic Routing 7

RIP • RIP messages are carried in UDP datagrams. The official specification for RIP

RIP • RIP messages are carried in UDP datagrams. The official specification for RIP is RFC 1058 11/23/2020 Dynamic Routing 8

RIP Message Fields • A command of 1 is a request, and 2 is

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. 11/23/2020 Dynamic Routing 9

RIP Address Entries • The next 20 bytes specify the address family, an IP

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. 11/23/2020 Dynamic Routing 10

RIP Initialization • When the daemon starts it determines all of the interfaces that

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 11/23/2020 Dynamic Routing 11

RIP Operation • Request received – If the request is the special case, then

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 11/23/2020 Dynamic Routing 12

Other Operations • Regular routing updates – Every 30 seconds, all or part of

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. 11/23/2020 Dynamic Routing 13

RIP Hop Counts • The metrics used by RIP are hop counts. The hop

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. 11/23/2020 Dynamic Routing 14

RIP Example 11/23/2020 Dynamic Routing 15

RIP Example 11/23/2020 Dynamic Routing 15

RIP Hop Counts • As each router sends its routing tables to its neighbors,

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. 11/23/2020 Dynamic Routing 16

RIP Example 11/23/2020 Dynamic Routing 17

RIP Example 11/23/2020 Dynamic Routing 17

RIP Problems • As simple as all this sounds, there are pitfalls. – RIP

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 RFC 1058 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. 11/23/2020 Dynamic Routing 18

RIP-2 • RFC 1388 defines newer extensions to RIP, and the result is normally

RIP-2 • RFC 1388 defines newer extensions to RIP, and the result is normally called RIP-2 11/23/2020 Dynamic Routing 19

RIP-2 Fields • The routing domain is an identifier of the routing domain to

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. 11/23/2020 Dynamic Routing 20

OSPF • OSPF is a newer alternative to RIP as an interior gateway protocol.

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 RFC 1247. • 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 11/23/2020 Dynamic Routing 21

Link State Protocols • In a link-state protocol a router does not exchange distances

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. 11/23/2020 Dynamic Routing 22

Benefits of OSPF • OSPF can calculate a separate set of routes for each

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 11/23/2020 Dynamic Routing 23

Benefits of OSPF • Point-to-point links between routers do not need an IP address

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 11/23/2020 Dynamic Routing 24

Inter-AS routing 11/23/2020 Dynamic Routing 25

Inter-AS routing 11/23/2020 Dynamic Routing 25

Inter-AS routing • BGP (Border Gateway Protocol): the de facto standard • Path Vector

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, Y 1, Y 2, Y 3, …, Z 11/23/2020 Dynamic Routing 26

Inter-AS routing • Now, suppose X send its path to peer W • W

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) 11/23/2020 Dynamic Routing 27

Inter-AS routing (cont) • Peers exchange BGP messages using TCP. – OPEN msg opens

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 11/23/2020 Dynamic Routing 28

Why different Intra- and Inter-AS routing ? • Policy: Inter is concerned with policies

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. 11/23/2020 Dynamic Routing 29

Classless Inter-domain Routing • The shortage of class B addresses requires sites with multiple

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 11/23/2020 Dynamic Routing 30

CDIR • CDIR, also called supernetting, is a way to prevent an explosion in

CDIR • CDIR, also called supernetting, is a way to prevent an explosion in the size of the Internet routing tables. It is described in RFC 1518 and RFC 1519 • RFC 1467 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 11/23/2020 Dynamic Routing 31

Summarization • Three features are needed: – Multiple IP addresses to be summarized together

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) 11/23/2020 Dynamic Routing 32

Example • RFC 1466 recommends that new class C addresses in Europe be in

Example • RFC 1466 recommends that new class C addresses in Europe be in the range 194. 0. 0. 0 through 195. 255 (0 x 2000000 through 0 xc 3 ffffff) • In countries other than Europe a single routing table entry with an IP address of 0 x 2000000 and a 32 -bit mask of 0 xfe 000000 (254. 0. 0. 0) could be used to route all of these 65535 network IDs to a single point 11/23/2020 Dynamic Routing 33

Why Classless? • CIDR also uses a technique whereby the best match is always

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. 11/23/2020 Dynamic Routing 34