cisco presentation guide - vsb.czwh.cs.vsb.cz/sps/images/7/77/routeoptimization.pdf ·...

28
© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks 1 Route Optimization Route Optimization (intra-AS) (intra-AS) Petr Gryg Petr Gryg á á rek rek

Upload: vanhanh

Post on 09-May-2019

220 views

Category:

Documents


0 download

TRANSCRIPT

© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks 1

Route OptimizationRoute Optimization(intra-AS)(intra-AS)

Petr GrygPetr Grygáárekrek

2© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Goal of route optimizationGoal of route optimization• StaticStatic routing: routing:

• More predictable and saferMore predictable and safer• DynamicDynamic routing: routing:

• AutomaticAutomatically reacts on topology changes ally reacts on topology changes • Lower administrationLower administration• Higher Higher CPU CPU and memory utilizationand memory utilization• Consumes bandwidthConsumes bandwidth

By using route optimization, we influence the process of By using route optimization, we influence the process of best routes selectionbest routes selection• selection from routes learned from various routing selection from routes learned from various routing

protocolsprotocols• policy-based routingpolicy-based routing• controlled redistributioncontrolled redistribution• ......

3© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

How can we influence routing decision ?How can we influence routing decision ?• Selection of proper routing protocolSelection of proper routing protocol

• Metric, load balancing support, ...Metric, load balancing support, ...

• Configuration of routing protocol and link parametersConfiguration of routing protocol and link parameters• setting of link costssetting of link costs• creating router areas, summarizationcreating router areas, summarization• default route propagation, route filteringdefault route propagation, route filtering• ……

• Local definition of packet forwarding rules for Local definition of packet forwarding rules for particular router (policy routing)particular router (policy routing)

• AD manipulationAD manipulation• For whole routing protocol of for particular routesFor whole routing protocol of for particular routes

4© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

MetricMetric• Metric of link/path determines the preference of that link/pathMetric of link/path determines the preference of that link/path

• Lower metric is preferredLower metric is preferred

• Various metrics reflect current link propertiesVarious metrics reflect current link properties• Scalar metricScalar metric• Composite metricComposite metric

• We need to compare metric valuesWe need to compare metric values• Transformed to scalar metric (coefficients)Transformed to scalar metric (coefficients)• The same transformation method should be used at every routerThe same transformation method should be used at every router

• Static and dynamic metricStatic and dynamic metric• Dynamic metric incorporate instant link parameters (may change rapidly)Dynamic metric incorporate instant link parameters (may change rapidly)• Commonly, only static metric is usedCommonly, only static metric is used• Risk of route flapping when dynamic metric of a link changes too oftenRisk of route flapping when dynamic metric of a link changes too often

• Dynamic measurements of link characteristics (load, error rate) needs to be Dynamic measurements of link characteristics (load, error rate) needs to be averaged over timeaveraged over time

5© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Load balancingLoad balancing• How many routes to the same network are maintained in How many routes to the same network are maintained in

routing table ?routing table ?• Equal-cost load balancing – limited by maximum paths allowedEqual-cost load balancing – limited by maximum paths allowed• Unequal-cost – limited by variance (and max. paths)Unequal-cost – limited by variance (and max. paths)

• Based on utilized loop-free path calculation algorithm, routing Based on utilized loop-free path calculation algorithm, routing protocol does not guarantee to provide ALL alternate pathsprotocol does not guarantee to provide ALL alternate paths

• Load balancing methodLoad balancing method• Per-packet – round-robin, slower implementation (SW)Per-packet – round-robin, slower implementation (SW)• Per-source/Per-destination/Combination of bothPer-source/Per-destination/Combination of both

• faster (easier HW implementation when using route cache)faster (easier HW implementation when using route cache)• load balancing efficiency depends on traffic patternload balancing efficiency depends on traffic pattern

6© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Usage of Default RoutesUsage of Default Routes• Default route limits number of records in routing tablesDefault route limits number of records in routing tables• Denoted as 0.0.0.0/0Denoted as 0.0.0.0/0

• Matches every packetMatches every packet

• Static defaultStatic default• Possibly more floating static defaultsPossibly more floating static defaults

• Dynamic default (propagated by/learned from IGP protocols)Dynamic default (propagated by/learned from IGP protocols)• Propagated as 0.0.0.0/0 or as specially-tagged recordsPropagated as 0.0.0.0/0 or as specially-tagged records• Receiving router chooses from candidate defaults based on normal metricReceiving router chooses from candidate defaults based on normal metric• Origination of default route:Origination of default route:

• Redistribution of static defaultRedistribution of static default• Router itself is the source of default Router itself is the source of default

• router itself doesn’t have to have default in it’s routing table, but a set of specific router itself doesn’t have to have default in it’s routing table, but a set of specific routes insteadroutes instead

7© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Multiprotocol RoutingMultiprotocol Routing

8© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Multiprotocol Multiprotocol RRoutingouting - Principle - Principle

• Route table (RIB) filled-in with routes by more Route table (RIB) filled-in with routes by more routing processes (protocols)routing processes (protocols)• even multiple instances of the same routing protocoleven multiple instances of the same routing protocol

• Routes learned from multiple routing protocols Routes learned from multiple routing protocols are uncomparableare uncomparable• vvarious routing protocols use iarious routing protocols use incompatiblencompatible metrics metrics

• If multiple (potentially different) paths to some If multiple (potentially different) paths to some network are learned from multiple routing network are learned from multiple routing protocols, router must decide which one to protocols, router must decide which one to place into routing tableplace into routing table

9© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Reasons for multiprotocol routing Reasons for multiprotocol routing • History of particular networkHistory of particular network• Limited rLimited routing protocol support in routers andouting protocol support in routers and/or/or

host host operating systemsoperating systems• Different routing protocols feasible in various partsDifferent routing protocols feasible in various parts

of of interinternetworknetwork• fast fast LANsLANs• slow WAN linksslow WAN links• dial-on demand circuitsdial-on demand circuits• large ISP networklarge ISP network• ad-hoc wireless networkad-hoc wireless network• Inter-AS linkInter-AS link• ……

10© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Multiprotocol routingMultiprotocol routingAdministrative distance Administrative distance

• Administrative distanceAdministrative distance (AD) – specifies preference of (AD) – specifies preference of particular routing protocolparticular routing protocol• AD is Cisco term, but the concept is generalAD is Cisco term, but the concept is general• Route with lower AD is Route with lower AD is always always better better

• Regardless of metric valuesRegardless of metric values• Only routeOnly route metrics metrics with the same mask with the same mask can becan be compared compared

• Rememer, longest match always winsRememer, longest match always wins• AD has only local scope (not propagated between routers)AD has only local scope (not propagated between routers)

• If a path is learned by multiple routing protocols, path from If a path is learned by multiple routing protocols, path from more preferred routing protocol is placed into routing tablemore preferred routing protocol is placed into routing table• Only if multiple paths are learned from the same routing protocol, Only if multiple paths are learned from the same routing protocol,

protocol metric is used to choose between themprotocol metric is used to choose between them

11© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Administrative Distance settingsAdministrative Distance settings

• Common AD settings:Common AD settings:• Connected < Static < OSPF < RIPConnected < Static < OSPF < RIP

• (lower is more preferred)(lower is more preferred)

• Cisco AD default values:Cisco AD default values:• Connected: Connected: 0 (cannot be changed)0 (cannot be changed)• StaticStatic 11• IGRP (Cisco)IGRP (Cisco) 100100• OSPFOSPF 110110• IS-ISIS-IS 115115• RIPRIP 120120

12© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Tricks with AD settingTricks with AD setting• Set AD for Set AD for routes to specific networks onlyroutes to specific networks only• Set AD for (some) routes Set AD for (some) routes received fromreceived from some some

neighborneighbor• LSA originator in case of OSPFLSA originator in case of OSPF

• Set AD=255: do not use that routeSet AD=255: do not use that route• Set different AD for protocol's internal and Set different AD for protocol's internal and

external routesexternal routes• OSPF: intra-area are ALWAYS preferred “inside” OSPF, but OSPF: intra-area are ALWAYS preferred “inside” OSPF, but

resulting route calculated by OSPF may be compared with resulting route calculated by OSPF may be compared with same route from other protocol(s) using ADsame route from other protocol(s) using AD

• ……

13© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Floating Static RoutesFloating Static Routes• Floating static routeFloating static route = static route with worse = static route with worse

administrative metric than normally used routeadministrative metric than normally used route• Becomes active (“floats up”) when the route normally Becomes active (“floats up”) when the route normally

used is lostused is lost• routing protocol removes routerouting protocol removes route• next hop specified in primary static route becomes next hop specified in primary static route becomes

unreachableunreachable

• Often used with dial-on-demand linksOften used with dial-on-demand links• floating static route forwards packet via dial-on-demand floating static route forwards packet via dial-on-demand

circuitcircuit

14© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Routing ProcessesRouting Processes• Router can run multipleRouter can run multiple separate routing processes separate routing processes

(of various or the same routing protocols)(of various or the same routing protocols)• EveryEvery process process works with subset of routerworks with subset of router’s interfaces’s interfaces

• multiple routing protocols on the same interface may be useful sometimes alsomultiple routing protocols on the same interface may be useful sometimes also• Cisco IOS: can support up to 30 routing processes (instances)Cisco IOS: can support up to 30 routing processes (instances)

• More instances of the same routing protocol possibleMore instances of the same routing protocol possible• Cisco IOS: RIP is an exception, but RIP “contexts” may serve as workaroundCisco IOS: RIP is an exception, but RIP “contexts” may serve as workaround

• Routing table filled by all routing processesRouting table filled by all routing processes• But even DV routing processes have to maintain separate data structures (routing But even DV routing processes have to maintain separate data structures (routing

tables learned just by that protocol)tables learned just by that protocol)• Routing processes don’t interchange information mutually if not Routing processes don’t interchange information mutually if not

explicitly instructed to do soexplicitly instructed to do so• Information interchange can be configured using redistributionInformation interchange can be configured using redistribution

15© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

RedistributionRedistribution• Redistribution = interchange of information Redistribution = interchange of information

between routing processes (and appropriate between routing processes (and appropriate protocols)protocols)• Redistribution of static routes or connected Redistribution of static routes or connected

networks into routing protocol is a special (but networks into routing protocol is a special (but frequent) casefrequent) case

• Possibility to filter routes during redistributionPossibility to filter routes during redistribution• One-way and Two-way redistributionOne-way and Two-way redistribution

16© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Problems with Redistribution (1)Problems with Redistribution (1)• Redistribution from classless to classful protocolRedistribution from classless to classful protocol

• Distributing Distributing subnetssubnets (subnetted (subnetted major major networks) from networks) from classless into classful protocolclassless into classful protocol cause problems on some cause problems on some routesroutes• See See http://www.http://www.ciscocisco..comcom//warpwarp/public/105/52./public/105/52.htmlhtml• CiscoCisco: When redistributing from classful routing protocol into : When redistributing from classful routing protocol into

OSPF, only classful routes are redistributed by default. Use : OSPF, only classful routes are redistributed by default. Use : „subnets“ keyword in redistribute command to override this„subnets“ keyword in redistribute command to override this behaviorbehavior..

• Uncompatible metricUncompatible metric• Route are redistributed with “default” metricRoute are redistributed with “default” metric

• (“default” metric value may be specified)(“default” metric value may be specified)

17© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Problems with Redistribution (2)Problems with Redistribution (2)• Circular redistribution Circular redistribution

• when redistribution takes place on more routerswhen redistribution takes place on more routers• redistributed routes have to be filtered to prevent loopsredistributed routes have to be filtered to prevent loops• Bad AD setting may cause problemsBad AD setting may cause problems

• See http://www.cisco.com/warp/public/105/redist.html#adSee http://www.cisco.com/warp/public/105/redist.html#ad

• Intra-AS traffic goes through other AS’s routesIntra-AS traffic goes through other AS’s routes• may be resolved by manual incresing of redistributed may be resolved by manual incresing of redistributed

routes’ metricroutes’ metric

• Suboptimal routing or even routing loopsSuboptimal routing or even routing loops• AS topology: A=B-CAS topology: A=B-C• Traffic from B to C via ATraffic from B to C via A

18© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Redistribution – advanced issuesRedistribution – advanced issues

• Possible to specify protocol-dependent parameters Possible to specify protocol-dependent parameters and/or filtering criteriaand/or filtering criteria• metric-type (OSFP: E1metric-type (OSFP: E1,E2),E2)• tagtag• ……

• If protocol tags external routes, it will not export them If protocol tags external routes, it will not export them again out of ASagain out of AS

• Recommended usage of redistribution if configured on Recommended usage of redistribution if configured on more than one router:more than one router:• oneway redistribution + default route propagated in opposite oneway redistribution + default route propagated in opposite

directiondirection

19© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Redistribution examplesRedistribution examples• RIP and EIGRP on single routerRIP and EIGRP on single router• RIP and OSPF on single router (external routes)RIP and OSPF on single router (external routes)• Multiple independent routing processes of the same Multiple independent routing processes of the same

protocol on single routerprotocol on single router• Default routing loop prevention mechanism Default routing loop prevention mechanism

• Different AD for external routesDifferent AD for external routes• Preventing circular redistribution with route filteringPreventing circular redistribution with route filtering• Typical scenario:Typical scenario:

• Static routes Static routes intointo stub stub networks redistributed into backbone networks redistributed into backbone routing protocolrouting protocol

• Dynamic routing protocol in backbone.Dynamic routing protocol in backbone.• Stub networks reach other networks using default.Stub networks reach other networks using default.

20© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Route taggingRoute tagging• Some routing protocols allow to append tag to routeSome routing protocols allow to append tag to routess

thatthat they advertisethey advertise• Usage:Usage:

• Candidate default routeCandidate default route• External routeExternal route

• Internal routes always preferred over external (internal traffic Internal routes always preferred over external (internal traffic shouldnshouldn’t leave AS’t leave AS))

• External routes should not be advertised back out of ASExternal routes should not be advertised back out of AS

• Custom route taggingCustom route tagging • route froute filtering iltering and/and/or redistribution or redistribution control may be control may be based on based on these these

user-defined route user-defined route tagstags

21© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Route FilteringRoute Filtering• Distance Vector Protocols: filtering of routes in routing Distance Vector Protocols: filtering of routes in routing

updatesupdates• Networks if advertised/received updates filtered (out/in)Networks if advertised/received updates filtered (out/in)• Based on destination network or neighbor (update source)Based on destination network or neighbor (update source)

• Link State Protocols:Link State Protocols:• calculation of SPF always based on entire topology database (no calculation of SPF always based on entire topology database (no

filtering of LSAs!)filtering of LSAs!)• filtering only on area/AS boundaryfiltering only on area/AS boundary• filtering possible when placing routes into routing table (anywhere)filtering possible when placing routes into routing table (anywhere)

• used sporadicallyused sporadically• Filtering during redistributionFiltering during redistribution• Cisco: redistribution filtering implemented by distribute lists Cisco: redistribution filtering implemented by distribute lists

• distribute lists use ACL or prefix list to define routes to be filtereddistribute lists use ACL or prefix list to define routes to be filtered• per routing protocol/per interface/per neighborper routing protocol/per interface/per neighbor

22© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Metric manipulation in DV protocolsMetric manipulation in DV protocols

• Metric may be manipulated for networks Metric may be manipulated for networks advertised or received in routing updatesadvertised or received in routing updates

• May help toMay help to• give preference to particular routegive preference to particular route• avoid intra-AS traffic to leak out of the ASavoid intra-AS traffic to leak out of the AS• defend against circular redistributiondefend against circular redistribution

23© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Passive InterfacePassive Interface• Route updates are not sent out of passive interfaceRoute updates are not sent out of passive interface

• Received updates acceptedReceived updates accepted

• Hellos are not sent – adjacencies not establishedHellos are not sent – adjacencies not established• Applied on Ethernet stub network, dial-up lines, Applied on Ethernet stub network, dial-up lines,

routing domain (AS) boundariesrouting domain (AS) boundaries• Network connected to passive interface is normally Network connected to passive interface is normally

advertised into routing protocoladvertised into routing protocol

24© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Stub routingStub routing

• Dynamic routing to (dual attached) branch office Dynamic routing to (dual attached) branch office routersrouters

• Aviods transit path via branch office (stub) router Aviods transit path via branch office (stub) router in case of core router failure in case of core router failure

• Only routes from stub are propagated to Only routes from stub are propagated to backbone, but routes learned from first uplink are backbone, but routes learned from first uplink are never reflected back to second uplinknever reflected back to second uplink

25© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Route Summarization (1)Route Summarization (1)• Commonly recommended as a good practiseCommonly recommended as a good practise• AdvantagesAdvantages

• Fewer records in routing tablesFewer records in routing tables• Less bandwidth consumed by routing updatesLess bandwidth consumed by routing updates• Limits (hides) route flappingLimits (hides) route flapping• Increases routing protocol stabilityIncreases routing protocol stability

• RulesRules• Only router at boundary of the network which Only router at boundary of the network which „owns“ all subnets of the „owns“ all subnets of the

summarized address range may summarizesummarized address range may summarize that rangethat range• otherwiise blackholing may occurotherwiise blackholing may occur

• Need for hierarchical IP addressing plan Need for hierarchical IP addressing plan • Some routing protocols allows for summarization only at specific routers (OSPF: Some routing protocols allows for summarization only at specific routers (OSPF:

ABR, ASBR)ABR, ASBR)Keep in mind that routers still use the route with longest prefix matchKeep in mind that routers still use the route with longest prefix match

• Autosummarization – relates only to connected subnetsAutosummarization – relates only to connected subnets

26© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Route Summarization (2)Route Summarization (2)• Behavior of routing protocols:Behavior of routing protocols:

• Some routing protocols summarize by default at major Some routing protocols summarize by default at major networks' boundariesnetworks' boundaries• In some of them, it is possible to turn it off (RIPv2In some of them, it is possible to turn it off (RIPv2, BGP, BGP), in others ), in others

not (RIP)not (RIP)

27© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

Policy routingPolicy routing• Kind of extension of static routingKind of extension of static routing• Route decision based on SOURCE (instead of destination) address or Route decision based on SOURCE (instead of destination) address or

incoming interface of routed packetincoming interface of routed packet• may also depend on destination address and other parametersmay also depend on destination address and other parameters

• Defined statically by “route maps” on particular router(s)Defined statically by “route maps” on particular router(s)• Entry format: Entry format:

packet matching criteria packet matching criteria ==> outgoing interface |> outgoing interface | next hopnext hop• General format of route map entry: “match X set Y”General format of route map entry: “match X set Y”

• Route maps have higher priority than routing tablesRoute maps have higher priority than routing tables• But apply only when outgoing interface is upBut apply only when outgoing interface is up

• otherwise, routing table is used normally to determine next hopotherwise, routing table is used normally to determine next hop

• Examples:Examples:• Two parallel links, traffic sourced from one subnet not allowed to pass the faster Two parallel links, traffic sourced from one subnet not allowed to pass the faster

link (because of political reasons)link (because of political reasons)• Two links to different ISPs; some internal subnets communicate with Internet Two links to different ISPs; some internal subnets communicate with Internet

via ISP1, others via ISP2via ISP1, others via ISP2

• May cause packets to be routed by CPUMay cause packets to be routed by CPU

28© 2005 Petr Grygarek, VSB-TU Ostrava, Routed and Switched Networks

LabsLabsLoad balancing: RIP, OSPF (few notes about ISIS)Load balancing: RIP, OSPF (few notes about ISIS)Floating static routesFloating static routes

RIP-OSPF redistribution (two-way at single router) RIP-OSPF redistribution (two-way at single router) AD of routing protocolsAD of routing protocolsRIP-RIP RIP-RIP circular redistributioncircular redistribution, RIP-OSPF , RIP-OSPF circular circular

redistribution (harmless)redistribution (harmless)

OSPF-OSPF redistributionOSPF-OSPF redistributionPolicy routing: debug ip policy, sh route mapPolicy routing: debug ip policy, sh route map