+ All Categories
Home > Documents > 03 Introduction to OSPF v2

03 Introduction to OSPF v2

Date post: 06-Apr-2018
Category:
Upload: elaine-emileisi-cruz-heyer
View: 228 times
Download: 0 times
Share this document with a friend

of 68

Transcript
  • 8/3/2019 03 Introduction to OSPF v2

    1/68

    Campus Networking Workshop

    Introduction to OSPF

  • 8/3/2019 03 Introduction to OSPF v2

    2/68

    Agenda

    Basic Elements of OSPF

    OSPF in Service Provider Networks

    Best Common Practices in OSPF Network Aggregation

    OSPF Command Reference

  • 8/3/2019 03 Introduction to OSPF v2

    3/68

    Basic Elements of OSPF

  • 8/3/2019 03 Introduction to OSPF v2

    4/68

    OSPF

    Open ShortestPath First

    Link State or SPFtechnology

    Developed by the IETFsOSPF working group (RFC1247)

    Designed for TCP/IP Fast Convergence

    Variable length netmasks Non-contiguous subnets No need for periodic updates

    Route authentication OSPF is defined in RFC2328

  • 8/3/2019 03 Introduction to OSPF v2

    5/68

    Link-State

    Topology information is

    stored in a DB separate

    from the routing table

    AA

    BB

    CC

    22

    1313

    1313

    QQ

    ZZ

    XX

    Xs Link-state

    ZZ

    XX

    YYQQ

    Zs Link-state

    Qs Link-state

  • 8/3/2019 03 Introduction to OSPF v2

    6/68

    Link-State Routing

    Neighbor discovery

    Construct a Link State Packet (LSP)

    Distribute the LSP

    Link State Announcement LSA

    Route calculation

    If a link fails

    Flood new LSPs All routers recalculate their routing tables

  • 8/3/2019 03 Introduction to OSPF v2

    7/68

    FDDI

    Dual Ring

    Low Bandwidth Utilization

    Only propagate changes

    Use Multicast in multi-access networks

    R1

    LSA

    X

    LSA

  • 8/3/2019 03 Introduction to OSPF v2

    8/68

    FDDIDual Ring

    FDDIDual Ring

    Using the Optimal PathThe optimal path is determined by adding thecosts of the interfaces : Cost = 10^8/(Bandwidth)

    N1

    N2 N3

    N4

    N5R1

    R2

    R3

    R4

    Cost = 1 Cost = 1

    Cost = 10

    Cost = 10

  • 8/3/2019 03 Introduction to OSPF v2

    9/68

    Fast Convergence

    Detection plus LSA/SPF

    XR1 R3

    R2

    N2

    Alternate Path

    Primary Path

    N1

  • 8/3/2019 03 Introduction to OSPF v2

    10/68

    Fast Convergence

    Finding a new path

    Flood LSAs in the area

    Based in acknowledgements(Ack)

    Synchronized topology DB

    Each router calculates its routing

    table for each destination network

    LSA

    XR1

    N1

  • 8/3/2019 03 Introduction to OSPF v2

    11/68

    Uses IP Multicast to

    Send/Receive changes

    Multi-Access networks

    All routers must accept packets sent to the AllSPFRouters

    (224.0.0.5) address

    All DR and BDR routers must accept packets sent to the

    AllDRouters (224.0.0.6) address

    Hello packets are sent to the AllSPFRouters address

    (Unicast for point-to-point and virtual links)

  • 8/3/2019 03 Introduction to OSPF v2

    12/68

    OSPF Areas

    Group of contiguousnodes/networks

    Per area topology DB Invisible outside the area

    Reduces routing traffic

    Backbone Area is contiguous All others areas must connect to

    the backbone

    Virtual Links

    Area 1

    Area 4

    Area 0

    Backbone Area

    Area 2 Area 3

  • 8/3/2019 03 Introduction to OSPF v2

    13/68

    Router Classification

    Internal Router (IR)

    Area Border Router(ABR)

    Backbone Router (BR)

    Autonomous SystemBorder Router (ASBR)

    Area 1

    IR/BR

    Area 0

    Area 2 Area 3

    IR

    ABR/BR

    To another AS

    ASBR

  • 8/3/2019 03 Introduction to OSPF v2

    14/68

    OSPF Route Types

    Intra-Area Route All routes within an area

    Inter-Area Route Routes announced from area to

    another by an ABR

    External Route Routes imported into OSPF from

    another protocol or Static routes

    Area 0Area 2 Area 3

    ABR

    To Another AS

    ASBR

  • 8/3/2019 03 Introduction to OSPF v2

    15/68

    Inter-Area Route Summarization

    Prefix or all subnets

    Prefix or all networks

    Area range command

    1.A 1.B 1.C

    FDDI

    Dual Ring

    R1 (ABR)

    R2

    Network

    1

    Next Hop

    R1

    Network

    1.A

    1.B

    1.C

    Next Hop

    R1

    R1

    R1

    With

    Summarization

    Without

    Summarization

    Backbone

    Area 0

    Area 1

  • 8/3/2019 03 Introduction to OSPF v2

    16/68

    External Routes

    Redistributed into OSPF

    Flooded without changes throughout the AS

    OSPF supports two type of external metrics

    Type 1 Type 2 (Default)

    RIP

    IGRP

    EIGRP

    BGP

    etc.

    OSPF

    Redistribute

  • 8/3/2019 03 Introduction to OSPF v2

    17/68

    External Routes

    Type 1 external metric: metrics are added to

    the internal link cost

    Network

    N1

    N1

    Type 1

    11

    10

    Next Hop

    R2

    R3

    Cost = 10

    To N1

    External Cost = 1

    To N1

    External Cost = 2R2

    R3

    R1

    Cost = 8

    Selected

    Route

  • 8/3/2019 03 Introduction to OSPF v2

    18/68

    External Routes Type 2 external metric: metrics are compared

    without adding the internal link cost

    Network

    N1

    N1

    Type 2

    1

    2

    Next Hop

    R2

    R3

    Cost = 10

    To N1

    External Cost = 1

    To N1

    External Cost = 2R2

    R3

    R1

    Cost = 8

    Selected Route

  • 8/3/2019 03 Introduction to OSPF v2

    19/68

    Topology/Links-State DB

    A router has a separate DB for each area it

    belongs

    All routers within an area have an identical DB SPF calculation is done separately for each area

    LSA flooding is limited to the particular area

  • 8/3/2019 03 Introduction to OSPF v2

    20/68

    Protocol Functionality

    Bringing up adjacencies

    LSA Types

    Area Classification

  • 8/3/2019 03 Introduction to OSPF v2

    21/68

    The Hello Protocol

    Responsible to establish and maintain neighbor

    relationships

    Elects designated router in multi-access

    networks

    FDDIDual Ring

    Hello

    HelloHello

  • 8/3/2019 03 Introduction to OSPF v2

    22/68

    The Hello Packet

    Router Priority

    Hello Interval

    Router dead interval Network mask

    Options: T-bit, E-bit

    List of neighbors

    FDDI

    Dual Ring

    Hello

    HelloHello

  • 8/3/2019 03 Introduction to OSPF v2

    23/68

    Designated Router (DR)

    y One per multi-access network

    Generates network links advertisements

    Assists in DB synchronization

    DesignatedRouter

    Designated

    Router

    Backup

    Designated

    Router

    BackupDesignated

    Router

  • 8/3/2019 03 Introduction to OSPF v2

    24/68

    Designated Router by Priority

    Configured priority (per interface)

    Otherwise determined by the highest router ID

    The router ID is the loopback interface address, inconfigured otherwise is the highest IP address

    144.254.3.5

    R2 Router ID = 131.108.3.3

    131.108.3.2 131.108.3.3

    R1 Router ID = 144.254.3.5

    DR

  • 8/3/2019 03 Introduction to OSPF v2

    25/68

    Neighbor States

    2-way

    The router sees itself in other Hello packets

    DR is selected from neighbors in state 2-way or greater

    DR BDR

    2-way

  • 8/3/2019 03 Introduction to OSPF v2

    26/68

    Neighbor States

    Full Routers are fully adjacent

    DB is synchronized Relationship to the DR and

    BDR

    DR BDR

    Full

  • 8/3/2019 03 Introduction to OSPF v2

    27/68

    When to Become Adjacent

    Underlying network is point-to-point

    Underlying network type is virtual link

    The router itself is the DR

    The router itself is the BDR

    The neighboring router is the DR

    The neighboring router is the BDR

  • 8/3/2019 03 Introduction to OSPF v2

    28/68

    LSAs Propagate Along Adjacencies

    LSAs acknowledged along adjacencies

    DR BDR

  • 8/3/2019 03 Introduction to OSPF v2

    29/68

    Routing Protocol Packets

    Share a common protocol header Routing protocol packets are sent with a TOS of 0 Five types of OSPF routing protocol packets

    Hello packet type 1 DB Description packet type 2 Link-state request packet type 3 Link-state update packet type 4 Link-state Acknowledgment packet type 5

  • 8/3/2019 03 Introduction to OSPF v2

    30/68

    Different Types of LSAs

    Five LSA types

    Type 1 : Router LSA

    Type 2 : Network LSA Type 3 y 4: Summary LSA

    Type 5 y 7: External LSA

  • 8/3/2019 03 Introduction to OSPF v2

    31/68

    Router LSA (Type 1)

    Describes the state and cost of the routers link to

    the area All the routers links in an area must be described

    in a single LSA

    Flooded throughout the particular area and not

    beyond Router indicates whether it is an ASBR, ABR, or

    the end point of a virtual link

  • 8/3/2019 03 Introduction to OSPF v2

    32/68

    Network LSA (Type 2)

    Generated for every transit broadcast or NBMA

    network

    Describes all the routers attached to thenetwork

    Only the DR originates this type of LSA

    Flooded throughout the area and not beyond

  • 8/3/2019 03 Introduction to OSPF v2

    33/68

    Summary LSA (Type 3 y 4)

    Describes a destination outside the area but

    still within the AS

    Flooded throughout a single area

    Originated by an ABR

    Only intra-area routes are advertised into

    the backbone (Area 0) Type 4 is the information about the ASBR

  • 8/3/2019 03 Introduction to OSPF v2

    34/68

    External LSA (Type 5)

    Defines routes to destinations outside the AS

    Default route is also sent as external

    Two Types of external LSA: E1: Considers the total cost of to the external destination

    E2: Considers only the cost of the outgoing interface to theexternal destination

  • 8/3/2019 03 Introduction to OSPF v2

    35/68

    Not Summarized: Specific Link

    Specific link LSA advertised out Link state changes propagate out

    Backbone

    Area #0

    External Links

    1.A

    1.C

    1.B

    1.D

    TokenRing

    TokenRing

    TokenRing

    TokenRing

    3.D

    3.A

    3.C

    3.B

    1.A1.B1.C1.D

    3.A3.B3.C3.D

    2.A2.B2.C

    2.A

    2.C

    2.B

    TokenRing

    TokenRing

    ASBR

  • 8/3/2019 03 Introduction to OSPF v2

    36/68

    Summarized: Summary Links

    Only Summary LSA advertised out

    Link State changes do not propagate

    Backbone

    Area #0

    ASBR

    External Links

    1.A

    1.C

    1.B

    1.D

    TokenRing

    TokenRing

    TokenRing

    TokenRing

    3.D

    3.A

    3.C

    3.B

    2.A

    2.B

    TokenRing

    TokenRing

    1 3

    2

  • 8/3/2019 03 Introduction to OSPF v2

    37/68

    Backboen

    Area #0

    External Links

    1.A

    1.C

    1.B

    1.D

    TokenRing

    TokenRing

    TokenRing

    TokenRing

    3.D

    3.A

    3.C

    3.B

    2.A

    2.C

    2.B

    TokenRing

    TokenRing

    ASBR

    Not Summarized: Specific Links

    Specific Link LSA advertised in Links state changes propagate in

    2.A

    2.B

    2.C3.A

    3.B

    3.C

    3.D

    1.A1.B

    1.C

    1.D

    3.A

    3.B

    3.C

    3.D

    1.A

    1.B

    1.C

    1.D2.A

    2.B

    2.C

  • 8/3/2019 03 Introduction to OSPF v2

    38/68

    ASBR

    External Links

    1.A

    1.C

    1.B

    1.DTokenRing

    TokenRing

    TokenRing

    TokenRing

    3.C

    3.B

    2.ATokenRing

    TokenRing

    2,3

    1,3

    1,2

    Summarized: Summary Links

    Specific Link LSA advertised in Link state changes propagate in

    Backbone

    Area #0

    3.D

    3.A

    2.B

  • 8/3/2019 03 Introduction to OSPF v2

    39/68

    TokenRing

    TokenRing

    TokenRing

    TokenRing

    Regular Area (Not a stub)

    From area 1s point of view

    Summary networks from other areas injected

    External networks injected, for examplenetwork X.1

    ASBRExternal Networks

    1.A

    1.C

    1.B

    1.DTokenRing

    TokenRing

    3.C

    3.B

    2.A

    2,3

    1,3

    1,2

    X.1

    X.1

    X.1X.1

    2.D

    2.C

    2.B

    3.A

    3.D

  • 8/3/2019 03 Introduction to OSPF v2

    40/68

    TokenRing

    TokenRing

    TokenRing

    TokenRing

    Normal Stub Area

    From area 1s point of view Summary networks from other areas injected

    Default route injected into the area represent externallinks

    Default path to closest ABR

    Define all routers in the area as stub area x stub command ASBRExternal Networks

    1.A

    1.C

    1.B

    1.DTokenRing

    TokenRing

    3.C

    3.B

    2.A

    2,3 & Default

    1,3

    1,2

    X.1

    X.1

    X.1

    X.1

    2.D

    2.C

    2.B

    3.A

    3.D

  • 8/3/2019 03 Introduction to OSPF v2

    41/68

    TokenRing

    TokenRing

    TokenRing

    TokenRing

    Totally Stubby Area

    From area 1s point of view

    Only a default network is injected into the area Represents external networks and all inter-area routes

    Default route to the closest ABR

    Define all routers in the area as totally stubby area x stub no-summary command

    ASBR

    External Networks

    1.A

    1.C

    1.B

    1.DTokenRing

    TokenRing

    3.C

    3.B

    2.A

    Default 2&3

    1,3

    1,2

    X.1

    X.1

    X.1

    X.1

    2.D

    2.C

    2.B

    3.A

    3.D

  • 8/3/2019 03 Introduction to OSPF v2

    42/68

    TokenRing

    TokenRing

    TokenRing

    TokenRing

    Not-So-Stubby Area

    Capable of importing external routes in a limitedfashion

    Type-7 LSAs carry external information within anNSSA

    NSSA border routers translate selected type-7

    LSAs into type -5 external network LSAsASBR

    External Networks

    1.A

    1.C

    1.B

    1.DTokenRing

    TokenRing

    3.C

    3.B

    2.A

    Default 2&3

    1,3

    1,2

    X.1

    X.1, X.2

    X.1, X.2X.1

    2.D

    2.C

    2.B

    3.A

    3.D

    External

    NetworksX.2

  • 8/3/2019 03 Introduction to OSPF v2

    43/68

    Addressing

    Area 1

    Network 131.108.0.0

    Subnets 17-31

    Range 255.255.240.0

    Area 2

    Network 131.108.0.0

    Subnets 33-47

    Range 255.255.240.0

    area 3

    Network 131.108.0.0

    Subnets 49-63

    Range 255.255.240.0

    Area 0

    Network 192.117.49.0

    Range 255.255.255.0

    Try to assign contiguous subnet ranges to facilitate summarization

  • 8/3/2019 03 Introduction to OSPF v2

    44/68

    Summary

    Scalable OSPF Network Design

    Area hierarchy

    Stub areas

    Contiguous addressing

    Route summarization

  • 8/3/2019 03 Introduction to OSPF v2

    45/68

    OSPF Design Service

    Provider Networks

  • 8/3/2019 03 Introduction to OSPF v2

    46/68

    Backbone

    Router

    OSPF Areas and Rules

    Backbone area(0) must exist

    All other areasmust have

    connection tobackbone

    Backbone mustbe contiguous

    Do not partitionarea (0)

    Area 1

    Area 4

    Area 0

    Area 2 Area 3

    Ruteador

    Interno

    Area

    Border

    Router

    Autonomous

    System (AS)

    Border Router

    Internet

  • 8/3/2019 03 Introduction to OSPF v2

    47/68

    OSPF Design

    Figure out your addressing first OSPFand addressing go together The objective is to maintain a small link-state

    DB Create address hierarchy to match the

    network topology

    Separate blocks for infrastructure, customer

    interfaces, customers, etc.

  • 8/3/2019 03 Introduction to OSPF v2

    48/68

    OSPF Design

    Examine the physical topology

    Is it meshed or hub-and-spoke (star)

    Try to use as Stubby an area as possible

    It reduces overhead and LSA counts

    Push the creation of a backbone

    Reduces mesh and promotes hierarchy

  • 8/3/2019 03 Introduction to OSPF v2

    49/68

    OSPF Design

    One SPF per area, flooding done per area

    Try not to overload the ABRs

    Different types of areas do different flooding

    Normal areas

    Stub areas

    Totally stubby (stub no-summary)

    Not so stubby areas (NSSA)

  • 8/3/2019 03 Introduction to OSPF v2

    50/68

    OSPF Design

    Redundancy Dual links out of each area using metrics (cost) for traffic

    engineering Too much redundancy

    Dual links to backbone in stub areas must be the same otherwise sub-optimal routing will result

    Too much redundancy in the backbone area without

    good summarization will affect convergence in the area0

  • 8/3/2019 03 Introduction to OSPF v2

    51/68

    OSPF for ISPs

    OSPF features you should consider:

    OSPF logging neighbor changes OSPF reference cost

    OSPF router ID command

    OSPF Process Clear/Restart

  • 8/3/2019 03 Introduction to OSPF v2

    52/68

    OSPF Best Common

    Practices Adding Networks

  • 8/3/2019 03 Introduction to OSPF v2

    53/68

    OSPF Network Aggregation

    BCP Individual OSPF networkstatement for each infrastructurelink Have separate IP address blocks for

    infrastructure and customer links

    Use IP unnumbered interfaces orBGP to carry /30 to customers

    OSPF should only carryinfrastructure routes in an ISPsnetwork

    OC12c

    OC12c

    Customer Connections

    OC48

    ISP Backbone

  • 8/3/2019 03 Introduction to OSPF v2

    54/68

    OSPF Adding Networks

    Redistribute connected subnet

    Works for all connected interfaces on the

    router but sends networks as external types-

    2s which are not summarized router ospf 100

    redistribute connected subnets

    Not recommended

  • 8/3/2019 03 Introduction to OSPF v2

    55/68

    OSPF Adding Networks

    Specific network statements

    Each interface requires an OSPF network

    statement. Interfaces that should not betbroadcasting Hello packets need a passive-

    interface statement router ospf 100

    network 192.168.1.1 0.0.0.3 area 51 network 192.168.1.5 0.0.0.3 area 51

    passive interface Serial 1/0

  • 8/3/2019 03 Introduction to OSPF v2

    56/68

    OSPF Adding Networks

    Network statements - wildcard mask Every interface covered by a wildcard mask used

    in the OSPF network statement. Interfaces thatshould not be broadcasting Hello packets need apassive-interface statement ordefault passive-interface should be used router ospf 100

    network 192.168.1.0 0.0.0.255 area 51 default passive-interface default

    no passive interface POS 4/0

  • 8/3/2019 03 Introduction to OSPF v2

    57/68

    OSPF Adding Networks

    The key theme when selecting which

    method to use is to keep the links-state

    DB as small as possible

    Increases stability

    Reduces the amount of information in the

    LSAs

    Speeds up convergence time

  • 8/3/2019 03 Introduction to OSPF v2

    58/68

    OSPF Useful

    Features

    OSPF Logging Neighbor

  • 8/3/2019 03 Introduction to OSPF v2

    59/68

    OSPF Logging Neighbor

    Changes

    The router will generate a log messagewhenever an OSPF neighbor changes state

    Syntax: [no] ospf log[no] ospf log--adjacencyadjacency--changeschanges

    A typical log message: %OSPF%OSPF--55--ADJCHG: Process 1, NbrADJCHG: Process 1, Nbr

    223.127.255.223 on Ethernet0 from LOADING to223.127.255.223 on Ethernet0 from LOADING to

    FULL, Loading DoneFULL, Loading Done

  • 8/3/2019 03 Introduction to OSPF v2

    60/68

    Number of State Changes

    The number of state transitions is available viaSNMP (ospfNbrEvents) and the CLI:

    show ip ospf neighbor [type number]show ip ospf neighbor [type number][neighbor[neighbor--id] [detail]id] [detail] Detail(Optional) Displays all neighbors given in detail (list

    all neighbors).When specified, neighbor state transitioncounters are displayed per interface or neighbor ID

  • 8/3/2019 03 Introduction to OSPF v2

    61/68

    State Changes (Cont.)

    To reset OSPF related statistics, use the clear ipclear ip

    ospf countersospf counters EXEC command.

    clear ip ospf counters [neighbor [] [neighbor--id]]id]]

  • 8/3/2019 03 Introduction to OSPF v2

    62/68

    OSPF Cost: Reference Bandwidth

    Bandwidth used in metric calculation

    Cost = 10^8/BW

    Not useful for BW > 100 Mbps but can be

    changed Syntax:

    ospf autoospf auto--cost referencecost reference--bandwidth

    Default reference bandwidth is still100Mbps for

    backward compatibility

  • 8/3/2019 03 Introduction to OSPF v2

    63/68

    OSPF Router ID

    If the loopback interface exists and has an IPaddress, that is used as the router ID in routingprotocols - stability!

    If the loopback interface does not exist, or has no IPaddress, the router ID is the highest IP addressconfigured danger!

    Subcommand to manually set the OSPF router ID :

    router-id

  • 8/3/2019 03 Introduction to OSPF v2

    64/68

    OSPF Clear/Restart

    clear ip ospf [pid] redistributionThis command can clear redistribution based on OSPF routingprocess ID. If no PID is given, it assumes all OSPF processes

    clear ip ospf [pid] countersThis command clear counters based on OPSF routing processID. If no PID is given, it assumes all OSPF processes

    clear ip ospf [pid] processThis command will restart the specified OSPF process. If no PIDis given, it assumes all OSPF processes. It attempts to keep theold router-id, except in cases where a new router-id wasconfigured, or an old user configured router-id was removed. Itrequires user confirmation because it will cause network churn.

  • 8/3/2019 03 Introduction to OSPF v2

    65/68

    OSPF Command Summary

  • 8/3/2019 03 Introduction to OSPF v2

    66/68

    Redistributing Routes into OSPF

    ROUTER OSPF

    REDISTRIBUTE {protocol}

  • 8/3/2019 03 Introduction to OSPF v2

    67/68

    OSPF Router Sub-Commands

    NETWORK AREA

    AREA STUB {no-summary}

    AREA AUTHENTICATION AREA DEFAULT_COST

    AREA VIRTUAL-LINK ...

    AREA RANGE

  • 8/3/2019 03 Introduction to OSPF v2

    68/68

    Interface Sub-Commands

    IP OSPF COST

    IP OSPF PRIORITY

    IP OSPF HELLO-INTERVAL IP OSPF DEAD-INTERVAL

    IP OSPF AUTHENTICATION-KEY


Recommended