Routing

Routing table makes decision where to send packets

Contains set of routes

Each route describes gateway or interface router needs to reach specific network

4 main components of a route: Destination Value, Mask,Gateway or Interface Address, and Route cost or metric

A router directs message to correct destination by

Looking at destination IP Address in packet

Must find out bits representing network address

Looking for matching route in routing table

Dest. values in routing table = Destination network addresses

Router looks up subnet mask assigned to each potential route table

Applies each subnet mask to destination IP address in packet

Resulting network address compared to network address of route in table

Match is found = Packets forwarded out correct interface/ appropriate gateway

Netwk addr match >1 rt.= Routr uses route w/specif or longst, netwk addr. match from table

No Router entries match= Routr directs message to gateway specif by default route if configured

Directly Connected Routes

Routr powers up, configured interfaces are enabled

As interfaces beome opertionl = Routr stores directly attach loc. netwk addr's as connectd routs in routng tble

Automat. updtd when int is reconfiged or shutdwn

Ident. in routing tble with prefix 'C'

Static Routes

Admin manually configures static route to a specif. netwk

Doesn't change until Admin manually reconfigs it

Ident. with prefix 'S'

Dynamically-Updated Routes (Dynamic Routes)

Def. route = type of static rout specif gateway to use when ruting tble doesn't contain path to use to reach destina netwk

Common for default routes to point to next router in path to ISP

Subnet has only one router = that router automatically becomes default gateway

because all network traffic to and from that local network has no option but to travel through that router

Configuring Static Route

Router1(config) #ip route 192.168.16.0 255.255.255.0 192.168.15.1

larger networks generally use dynamic routing rather than static routes

Routing protocols

Dynamically manage information received from own interfaces and other routers

Can be configured to manage manually entered routes

Dynamic routing protocol

Learns all available routes

Places best routes into routing table

Removes routes when they are no longer valid

Routing Algorithm

Method routing protocol uses to determine best route to destin netwk = routing algorithm

Two main classes: 1. Distance Vector 2. Link State

Topology of network changes due to reconfiguration or failure, routing tables in all routers must change to reflect accurate view of new topology

All routers in a netwk have updated their tables to reflect the new route = Routers converged

For two routers to exchange routes, must be using same routing protocol and same routing algorithm

Distance Vector

Sends periodic copies of a routing table from router to router/communicate topology changes

Distance - How far away is network from this router?

Number of hops,Administrative cost,Bandwidth,Transmission speed,Likelihood of delays,Reliability

Vector - In what direction should packet be sent to reach this network?

Address of the next hop along the path to the network named in the route

Each router communicates routing information to its neighbors

Neighbor routers share a directly connected network

Interface leading to each directly connected network has a distance of 0

Each router receives a routing table from directly connected neighbor routers.

Each of network entries in the routing table has an accumulated distance vector to show how far away that network is in a given direction

As distance vector discovery process proceeds, routers discover the best path to destination networks based on information received from each neighbor

Best path = Path with shortest distance or smallest metric.

Topology change updates proceed step-by-step by sending copies of routing tables from router to router.

RIP - Routing Information Protocol (RFC 1058)

Distance Vector

Uses hop count as metric for path selection

Defines hop count greater than 15 as unreachable route

Sends routing table contents every 30 seconds, by default

When router receives routing update = Hop count value is increased by one on each router

Router uses local netwk address of directly connected router which sent update as next hop address

After updating routing table, router immediately begins transmittng routng updtes to inform other netwk routers of the change

These "triggered updates" are sent independently of regularly scheduled updates that RIP routers forward.

RIP is simple, easy to implement, and available free of cost with most routers

Disadvantages of RIP:

Allows a maximum of 15 hops - can only be used for networks that connect no more than 16 routers in series

Periodiclly sends complete copies of entire routng tble to directly conncted neighbors. In large netwk, this can cause signific. amt of netwk traffic for ea. updt

Converges slowly on larger networks, when network changes

Most imp. diff. btw RIPv1 and RIPv2 - RIPv2 can support classless routing, because it includes the subnet mask information in routing updates.

RIPv1 relies on classfull default subnet masks

EIGRP - Enhanced Interior Gateway Routing Protocol

Developed to address some limitations of other distance vector routing protocols such as RIP

Limitations include use of hop count metric and max netwk size of 15 hops

Cisco proprietary enhanced distance vector routing protocol

Advantages of EIGRP:

Uses a variety of metrics to calculate cost of a route

Combines next hop and metric features of distance vector protocols, with additional database and update features

Has maximum hop count of 224 hops

Unlike RIP, does not rely only on routing table in router to hold all information it needs to operate. EIGRP creates two additional database tables: the neighbor table and the topology table

Neighbor table

Stores data about neighboring routers on directly connected local networks.

Includes information like interface IP addresses, interface type, and bandwidth

Builds topology table from each advertisements of its neighbors

Topology table contains all routes advertised by the neighbor routers

Depends on routing algorithm called Diffused Update Algorithm (DUAL) to:

Calculate shortest path to a destination within a network and to install this route into routing table

Topology table enablesa router running EIGRP to find best alternate path quickly when network change occurs

If no alternate route exists in topology table, EIGRP queries its neighbors to find a new path to destination

EIGRP is ideal for larger, more complex networks up to 224 hops in size that require fast convergence

Link-State Routing

Routers useing distance vector routing algorithm have little information about distant networks and none about distant routers

Link-state routing algorithm maintains a full database of distant routers and how they interconnect

Link-state routing has following features:

Routing table - List of the known paths and interfaces

Link-state advertisement (LSA) - Small packet of routing information that is sent between routers

LSAs describe state of interfaces (links) of a router, and other info like IP address of each link

Topological database - Collection of information gathered from all LSAs received by router

SPF (Shortest Path First) algorithm - Calculation performed on database that results in SPF tree.

SPF tree is a map of network as seen from point of view of the router. Information in this tree is used to build the routing table

When LSAs are received from other routers SPF algorithm analyzes information in database to construct SPF tree

Based on SPF tree, SPF algorithm then calculates shortest paths to other networks

Each time a new LSA packet causes a change to link-state database; SPF recalculates best paths and updates routing table

OSPF - Open Shortest Path First (RFC 2328)

Advantages of OSPF:

Uses SPF algorithm to calculate lowest cost to destination

Sends routing updates only when topology changes; doesn't send periodic updates of entire routing table.

Provides fast convergence

Supports VLSM and discontiguous subnets

Provides route authentication

Routers send link state advertisements to each other when a change occurs

Ex: A new neighbor is added, a link fails, or a link is restored

Network topology changes, = routers affected by change send update LSAs to rest of the network.

All routers update their topology databases accordingly, regenerate their SPF trees to find new shortest paths to each network, and update their routing tables with changed routes

Routing within an Organization

Small networks with only one gateway to Internet can use static routes

As organization grows , RIPv2 can be used. Easy to config in small networks . Netwk exceed 15 routers,=RIP no longer good choice.

For larger networks, EIGRP and OSPF are common

3 main criterias for choosing protocol:

Ease of management - What information does protocol keep about itself? What show commands are available?

Ease of configuration - How many commands will average config require? Is it possible to config several routers in your network with same config?

Efficiency - How much bandwidth does routng protocol take up while in steady state, and how much could it take up, when converging in response to a major netwk event?

Configure and Verify RIP

Before configuring RIP:

Assign an IP address and enable all the physical interfaces that will participate in routing.

On serial links, set clock rate on master router.

Basic RIP configuration:

Router(config)#router rip

Router (config-router)#version 2

Router(config-router)#network [network-number]

After configuring RIP -Compare running config with an accurate topology diagram to verify netwk numbers and interface IP addresses

One way to verify that routing is working properly is to ping devices on remote networks.

show ip protocols command verifies that RIP routing is configured, tcorrect interfaces are sending and receiving RIP updates, and router is advertising correct networks

show ip route command shows routing table, which verifies that routes received by RIP neighbors are installed in routing table

Features of debug ip rip command:

Can be used to observe networks advertised in the routing updates as they are sent and received

Displays router activity in real time

Uses router processor resources, which can affect network operation

Autonomous Systems (AS)

r

See "Packets routed across Internet in several steps"

AS is a set of networks controlled by a single administrative authority using same internal routing policy throughou

Each AS is identified by a unique AS number (ASN)

Most common example of an AS is the ISP

AS is administered by ISP and therefore not only includes its own netwk routes, but also manages routes to all business and other customer netwks that are connected to it

Same ASN applies to all network devices within the AS routing domain

A private AS number is required when connecting to multiple ISPs

IGP - Interior Gateway Protocols

Used to exchange routing information within an autonomous system or individual organization

Purpose of an interior routing protocol is to find best path through internal network

IGPs run on the interior routers, that is, the routers inside an organization and exchange individual routes

Examples of interior gateway protocols are RIP, EIGRP and OSPF

EGP - Exterior Gateway Protocols

Exterior gateway protocols are designed to exchange routing information between different Autonomous Systems

Each AS is managed by a different administration and may use different interior protocols, networks must use a protocol that can communicate between diverse systems.

EGP serves as a translator for ensuring that external routing information gets successful interpreted inside each AS network

EGP protocols run on the exterior routers, the routers that are located at the border of an AS

Exterior routers are also called border gateways

Exterior routers exchange information about how to reach various networks using exterior protocols

Exterior routing protocols seek to find best path through Internet as a sequence of Autonomous Systems

The most common exterior routing protocol on Internet today is Border Gateway Protocol (BGP)

95% of Autonomous Systems use BGP

Most current version of BGP is version 4 (BGP-4) in RFC 4271

Exterior Routing Protocols and ISP

EGP allow traffic to be routed across the Internet to remote destinations

ISPS provide backup routes and routers in case the regular route fails

ISP advertises regular route to other Autonomous Systems.

Regular route fails, then ISP sends an exterior protocol update message to advertise backup route instead

EGP Povide method by which ISPs can set and enforce policies and local preferences so that traffic flow through ISP is efficient and none of the internal routes are overloaded with transit traffic

Flow of messages in the internet = TRAFFIC. Two types of traffic:

Local Traffic - Traffic carried within an AS that either originated in that same AS, or is intended to be delivered within that AS. This is like local traffic on a street.

Transit Traffic - Traffic that was generated outside that AS and can travel through internal AS network in route to be delivered to destinations outside AS. This is like through traffic on a street.

Can cause routers to overload and fail, if those routers do not have the capacity to handle large amounts of traffic.

Many Autonomous Systems are not willing to carry transit traffic

Flow of traffic between Autonomous Systems is carefully controlled.

It is important to be able to limit or even prohibit certain types of messages from going to or from an AS, for security reasons or to prevent overloading.

Configuring and Verifying BGP

When an ISP puts a border router at a customer location, they usually configure it with a default static route to the ISP

Sometimes an ISP may want router to be included in its autonomous system and to participate in BGP., so router must be configed to enable BGP

The first step in enabling BGP on a router is to configure the AS number

router bgp [AS number]

Identify ISP router that is the BGP neighbor with which the Customer Premise Equipment (CPE) router exchanges information

neighbor [IP Address] remote-as [AS number]

When an ISP customer has its own registered IP address block, may want routes to some of its internal networks to be known on Internet. To use BGP to advertise an internal route, a network command is needed.

network [network address]

Once all of customer premise equipment is installed and t routing protocols configured, customer has both local and Internet connectivity. Now the customer is able to fully participate in other services the ISP may offer

The IP addresses used for BGP are normally registered, routable addresses which identify unique organizations

In very large organizations private addresses may be used in the BGP

On the Internet, BGP should never be used to advertise a private network address