25
1 Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001 Local Area & IP Networking Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001 Course Overview Network Fundamentals (w1) Medium Access Control (w2-3) Local Area Networking (w4) Routing Protocols (w5) Transport Protocols (w6) Examples/Review (w7) TEST 1 IP Networking Support Protocols (w8) IP Design (w9-10) Group Presentations Application Support Protocols (w11-12) Network Security (w13) Makeup Week (w14) TEST 2 Final Project Due last week of class LAN WAN 425

L6 Routing

Embed Size (px)

DESCRIPTION

route

Citation preview

Page 1: L6 Routing

1

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Local Area & IP Networking

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Course Overview

Network Fundamentals (w1)Medium Access Control (w2-3)Local Area Networking (w4)Routing Protocols (w5)Transport Protocols (w6)Examples/Review (w7) TEST 1IP Networking Support Protocols (w8)IP Design (w9-10) Group PresentationsApplication Support Protocols (w11-12)Network Security (w13)Makeup Week (w14) TEST 2Final Project Due last week of class

LANWAN425

Page 2: L6 Routing

2

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Required Reading

Computer Communications & Networking Technologies

Ch 7 pp. 195-228

Routing Protocol Overviewhttp://www.freesoft.org/CIE/Topics/87.htm

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Lecture Outline

OverviewConcept of Routing

Classifications

Distance Vector vs. Link State

Routing AlgorithmsBellman-Ford-Moore

Dijkstra

Routing ProtocolsRIP

OSPF

BGP

Page 3: L6 Routing

3

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Router Overview

Routing: “forwarding packets based on logical addresses”

Router Functions:1. Path Selection (Routing):

The router is responsible for determining packet paths across a network. Routing Protocols specifies the method for determining an appropriate path.

2. Packet Switching (forwarding):Forwarding a packet based upon a chosen path. Requires:

– Entry of packet into router– Obtaining MAC address of received packet– Determining layer 2 destination– Modifying header and checksum– Transmitting packet/frame/cell toward its destination

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Routing Protocol Overview

• Routers communicate path information via their own dialog calledRouting Protocols

• Routers seek to send packets on the lowest cost path. This implies some sort of metric used to calculate path costs or weights.

What path would you choose here?

D

C

A

B

Routing Overview

Page 4: L6 Routing

4

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Routing Protocol Overview

• The costs are calculated using routing metrics• Different routing protocols use different routing metrics

– Number of networks between two terminals– Speed of networks between two terminals– How much $$$$ it costs to send data across a link…

56K

56K

100B-T

100B-T

D

C

A

B

Now what path would you choose?

Routing Overview

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Routing Metrics

Path selection is performed by an algorithm operating within a router. Most algorithms are based upon variants of the shortest-path algorithm, in which networks are connected by routers with each network containing a cost.

Many metrics can be used to asses the cost of a network (link between routers), depending on which function is to be optimized

Example Metrics:

– Cost ~1/capacity A high cost is associated to low BW links

– Cost ~packet delay A high cost is associated to long delay links

– Cost ~congestion A dynamic cost according to the load of a link

Routing Overview

Page 5: L6 Routing

5

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Minimum Cost Path

1 2

5

3

6

4

7

9 6

11

8 3

6

3

5

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Types of Routing Protocols

Interior ProtocolsProtocols that operate within an autonomous system. The most common routing protocols (RIP, OSPF…) are interior protocols.

Exterior ProtocolsProtocols that operate between autonomous systems and are of concern to service providers and other large or complex networks. The basic routable element is the Autonomous System (AS), a collection of CIDR prefixes identified by an AS number. A single exterior routing system manages the global Internet, based primarily on the BGP-4 exterior routing protocol (RFC 1771-1174).

Routing Overview

Page 6: L6 Routing

6

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Autonomous Systems

Autonomous systems are assigned 16-bit AS numbers by InterNIC which are used by BGP to implement routing.• A more enlightened view of AS is a collection of CIDR IP address

prefixes under common technical management. See RFC 1772 for a list of all Autonomous Systems (ex: AlterNet, CERFnet, SPRINTlink)

AS can be classified by they connection to other AS.• Stub AS: Only connected to one other AS. This type of AS can be

an extension of another AS and thus not contain its own AS number

• Transit AS: Connected to multiple AS and allows itself to route between other AS. Most large Internet Service providers are this.

• Multihomed AS: Connected to multiple AS (usually 2) but does NOT route between them. Used for large companies

Routing Overview

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Autonomous Systems

Page 7: L6 Routing

7

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Dynamic vs. Static Routing

Dynamic routing algorithms adjust, in real time, to the current network condition.– Network changes are conveyed through routing protocol update

messages

– Updates are propagated throughout the network according to the protocol.

– Can be augmented with a static ‘last resort’ route (default route)

Static routing algorithms us a mapping predefined by the network administrator to determine routes.– Routing tables do not change unless the administrator intervenes

– Simple to design and understand

– Only work well in environments where network traffic is predictable and the network design is simple

– Do not adjust for network outages

Routing Overview

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Flat vs. Hierarchical

Flat routing algorithms consider all routers as peers.– Path preferences are formed with technical data only (hop count,

link speed, delay…)

– Usually found within small networks.

Hierarchical routing algorithms have preferential peers– Path preference is a function of both technical data as well as

preferred paths

– Preference can be given to routers within the same AS (Sprint carries its own traffic…)

– Backbone routers can communicate between domains while other routers are restricted to within their domains

– Allows for controlled traffic paths between domains

Routing Overview

Page 8: L6 Routing

8

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Distance Vector and Link State Routing Algorithms

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Distance Vector (D-V)

Distance vector protocols are designed to map path cost to number of networks between two terminals. Therefore, all networks have the same cost and that cost is 1.– Each router simply informs its neighbors of its routing table

– For each network path, the receiving routers pick the neighbor advertising the lowest cost (number of networks between them)

• The router updates its own routing table with the new lowest costs.• The router advertises its new routing table

– Common enhancements to D-V algorithms include:• Split horizon

• Poison reverse

• Triggered updates

• Hold-down Timers

– A good description is located in RIP’s specification RFC 1058

Distance Vector

Page 9: L6 Routing

9

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Distance – Vector Routing

A

B

C

D

Send A’s Routing Table

Compute B’s Routing

Table

Send B’s Routing Table

Send B’s Routing Table

Compute C’s Routing Table

Compute D’s Routing Table

Distance Vector

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Updating a Routing TableDistance Vector

Page 10: L6 Routing

10

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Initial routing Table in Small Inter-NetworkDistance Vector

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Final routing Table in Small Inter-NetworkDistance Vector

Page 11: L6 Routing

11

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Link State (L-S)

Link state protocols are designed to allow routers to maintain at least a partial map of the network. Networks (or links between routers) can contain costs based upon any networking metric.– Updates are only sent upon network changes

• A network link goes up or down• A network link becomes congested…

– Updates, called a link state advertisement (LSA) are floodedthroughout the network.

• Routers do not need to alter the LSA, so it propagates very fast• All routers note the change and recompute their routes.

– So, L-S algorithms update faster than D-V and use less bandwidth (as moving entire routing tables can be troublesome)

Link State

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Link-State Routing

• All Routers calculate “Shortest paths” using Dijkstra Algorithm

A

B

C

D

A sends a link state update to

neighbors B sends THE link state update to

neighbors

Link State

Page 12: L6 Routing

12

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Routing Algorithms

Bellman-Ford-Moore (D-V)

Dijkstra (L-S)

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Bellman-Ford-Moore Algorithm

The Bellman-Ford-Moore algorithm is distance vector (D-V) based and iterates on the number of hops a source node is from a destination node. This algorithm relies upon estimates of neighboring nodes to the destination. The algorithm has been shown to converge even with bad initial estimates.

The basic idea of this algorithm is based on the principle that a node (G) on the shortest path between two nodes (A and Z) will have the shortest path to both nodes (A&Z) than any other node.

A

G

ZL

Routing Algorithms

Page 13: L6 Routing

13

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Bellman-Ford-Moore

Algorithm:– Form estimates for all nodes that are 1 hop from the source

• Dj = the current estimate of the minimum cost (distance) from node ‘j’ to the destination node (they can be wrong!!!)

– Form link costs from source to all neighbors• Cij = link cost from node ‘i’ to node ‘j’.

– Solve for Dsource = min {Dik + Dkj} over all ‘k’

– Iterate!

Routing Algorithms

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Example: Bellman-Ford-MooreRouting Algorithms

In the following network – solve for the optimal path between node 2 and node 6.

STEP 1: D1=3 (guess), D4=3 (guess), D5=2 (guess)

STEP 2: C21=3, C24=1, C25=4

STEP 3: D2= min { C21 + D1 , C24 + D4 , C25 + D5 }

{ 3 + 3 , 1 + 3 , 4 + 2 }

{ 6 , 4 , 6 } => Optimal path between 2 and 6 goes through node 4 (update routing table…)

2

3

4

1

5

63

2

5

1

4

3

21

2

Page 14: L6 Routing

14

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Problems and Solutions with BFM

Slow convergence– Changes in network links will only be passed to neighboring nodes

who are then responsible for passing this on to their neighboring nodes.

– While the message is propagating, distant nodes will be unaware of the network change.

Solution: Use another routing protocol

Instability– If nodes to not send update simultaneously then instability can

occur between two nodes causing a count-to-infinity loop.

Solutions:• Split horizon

• Split horizon with poison reverse• Hold down timers

Routing Algorithms

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

BFM Drawbacks - Slow Convergence

Page 15: L6 Routing

15

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

BFM Drawbacks - Instability

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Split Horizon

Page 16: L6 Routing

16

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Poison Horizon (example using RIP)

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Dijkstra Algorithm

The Dijkstra algorithm is a more efficient routing algorithm (than BFM) that requires each link cost to be positive. The algorithm operates by identifying the closest nodes from the source node in order of increasing path cost. – On the first iteration the algorithm finds the closest node from the

source node (a neighbor of the source node)– On the second iteration, the algorithm finds the second closest

node from the source node (either neighbor of the source node orthe closest node to the source node)

– At the third iteration, the third-closest node must be the nighbor of the first two closest nodes, and so on.

– So, on the ‘kth’ iteration the algorithm will have identified the ‘k’ closest nodes.

Routing Algorithms

Page 17: L6 Routing

17

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Dijkstra Algorithm

The algorithm can be implemented by maintaining a set N of permanently labeled nodes which consists of those nodes whose shortest paths have been determined. The set is increased using the algorithm until all nodes have been made permanent.

Algorithm:– Define Di = current minimum cost from the source (s) node to node ‘i’

– STEP 1: N={s}, Dj = Csj for all j≠s (find the first closest node)– STEP 2: Di = min { Dj } for all j∉N (find next closest node…)

Add ‘i’ to NIf N contains all the nodes stop, otherwise repeat

– STEP 3: Updating minimum costs: For each node j ∉NDj = min {Dj , Di + Cij} then go to step 2.

Routing Algorithms

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Dijkstra Algorithm

In the following network, solve for the routing table for Node A using the Dijkstra algorithm.

Iteration # N DB DC DD DE DF

1 {A} 3 2 (via A) 5 - -2 {A,C} 3 (via A) 2 4 (via C) - 3 (via C)3 {A,B,C} 3 2 4 7 (via B) 3 (via C)4 {A,B,C,F} 3 2 4 (via C) 5 (via C) 3

5 {A,B,C,F,D} 3 2 4 5 (via C) 36 {A,B,C,F,D,E} 3 (via A) 2 (via A) 4 (via C) 5 (via C) 3 (via C)

Routing Algorithms

B

C

D

A

E

F3

2

5

1

4

3

21

2

Page 18: L6 Routing

18

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Routing Protocols

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Interior Router Overview

TypesRIP:

The Routing Information Protocol (RIP) is one of the first routing protocols and has limited capabilities. RIP uses hop count or distance vector to determine path, where the count is limited to 15. Entire routing table is sent as an update every 30 seconds. Does not support VLSM. RFC 1058

OSPF:Open Shortest Path First (OSPF) is a ‘standards based’ routing protocol

based upon link state path determination. Updates are based upon link-state advertisements and do not incorporate an entire routing table. This leads to faster convergence. Distance vector routing allows for the bandwidth of a link to be factored into the routing decision. Supports VLSM. RFC 2328 (1583 & 1247 – bugged versions)

Routing Protocols

Page 19: L6 Routing

19

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Interior Router Overview

TypesRIPv2:

Version 2 of RIP supports VLSM and is still based upon hop count with a limit of 15 hops. RFC 1723

IGRP:Interior Gateway Routing Protocol (IGRP) is an early Cisco proprietary,

link-state routing protocol. It uses a composite metric of 24bits and offers faster convergence than RIP. It does not support VLSM, and sends entire routing table every 90 seconds.

EIGRP:Enhanced IGRP is an update to IGRP (still proprietary) that adds

support for VLSM, fast convergence, incremental routing table updates, support for IPX and AppleTalk.

Routing Protocols

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Exterior Router Overview

TypesOSPF:

Exterior version of the interior version. Operates very similar to interior version except it routes between Autonomous Systems (AS)

BGP v-4 (eBGP):Exterior Border Gateway Protocol is the ‘de facto’ protocol of the

Internet backbone. Technically a path-vector protocol, it is primarily concerned with the relationships between autonomous systems (MCIvs. AT&T…). One benefit of BGP is its use of persistent TCP sessions for the exchange of routing information. RFC 1771

Routing Protocols

Page 20: L6 Routing

20

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Routing Information Protocol (RIP)

RIP version 1 is a distance-vector protocol based on a 1970s Xerox Network System’s (XNS) routing protocol also called RIP. RIP was bundled with BSD UNIX in 1982 as part of the TCP/IP protocol suite and became the de facto standard for IP routing. RIP has changed very little in the past decade and suffers from several limitations.– RIP keeps all routing tables within a network updated by

transmitting routing table update messages every 30 seconds.

– Neighboring routers update their tables upon receiving an updatemessage. They then send an updated routing table to their neighbors

– RIP uses timers to handle link or neighbor router failures.

– RIP imposes a 15-hop maximum distance.

Routing Protocols

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

RIP v-1

Protocol metricsRouting metrics– Hop count (distance-vector) 4-bit metric with 16=infinite distanceTimers– Update message 30 seconds– Invalid time 180 seconds (time till router is dead)– Flush time 120 seconds (route flush time)– Holddown not usedUpdates– Split-Horizon with Poison Reverse: Update messages set adjacent

networks at an infinite metric value.– Triggered Updates:Routers are required to send updates

immediately after they alter their own routing table

Routing Protocols

Page 21: L6 Routing

21

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

RIP v-1

Problems with RIP v-1Network Diameter

– RIP only allows a 15 hop maximum, thus limiting network size

Subnet Support

– RIP is a classful routing protocol with no support of VLSM Bandwidth Consumption

– Entire routing tables are sent with each update at least every 30 sec

Difficult Diagnosis

– Distance vector algorithms can have old (bad) routes propagated throughout the network due to the distributed nature of the protocol.

Security

– RIP has no security features (someone may propagate fictitious routes)

Routing Protocols

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

RIP v-1 Update Message

Page 22: L6 Routing

22

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Request Messages

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Response Messages

Page 23: L6 Routing

23

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

RIP Version 2

RIP version 2 (RIP v-2) is a backwards compatible update that contains support for subnet masks, update message multicasting and authentication. RIPv2 is specified in RFC 1723.– Protocol Extensions

Allows the routing update fields to be used for passing additional information such as subnet masks and net-hop as well as route tagsto indicate if the route is internal or external.

– Timers, Routing Metrics

Unchanged

– Authentication

Update messages for RIPv2 can contain a password.

Routing Protocols

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

RIPv2 Update Message

Routing updates are sent in groups of 25 with the following format (assuming authentication is used)

Routing Protocols

Command Version Unused0xFFFF (2) Authentication Type (2)

Authentication (16)

Family ID (2) Route Tag (2)IP Address (4)

Subnet Mask (4)Next Hop (4)

Metric (4)

24 sets max

NOTE: Without authentication, the update will contain up to 25 routes

Page 24: L6 Routing

24

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

RIPv2 Message Fields

Command: As defined in RFC 1058 (same as RIPv1)– 1 => request: A request for the responding system to send all or

part of its routing table

– 2 => response: A message containing all or part of the sender’srouting table.

Version: possible values {1,2}, where 2 is used for any update with authentication OR subnet mask/next hop info.

Authentication Type: currently set to {2} indicating a simple password

Authentication: A 16 character plain text password filled

Routing Protocols

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

RIPv2 Message Fields

Route Tag: A field that is to be preserved and readvertised with a route. For future use in separating ‘internal’ RIP routes from ‘external’ routes.

IP Address: The network addressSubnet Mask: series of 1’s indicating the network field

Next Hop: This field is ONLY sent if the address (network) is directly reachable on the logical subnet over which the advertisement is made. Used to avoid getting unnecessary traffic in multi-protocol networks.

Metric: A value between 1-16 indicating the number of networks between the router and the network.

Routing Protocols

Page 25: L6 Routing

25

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

RIPv2 Multicasting

An IP multicast address is used to for periodic broadcasts of RIPv2 updates. The IP multicast address is 224.0.0.9. Note that IGMP is unnecessary since the updates are not forwarded.

The use of a multicast ID, reduces the load on hosts not listening to RIPv2 messages.

Compatibility: READ RFC 1723 section 4

Routing Protocols

Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001

Open Shortest Path First (OSPF)Routing Protocols