54
TDC 363 Introduction to LANs Greg Brewster DePaul University OSPF TDC 363 Greg Brewster, DePaul University 1

Introduction to LANs - JustAnswer(1).pdf · ITE PC v4.0 Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public. 3. Link-State Routing Link state routing protocols-Also

  • Upload
    dokhanh

  • View
    230

  • Download
    0

Embed Size (px)

Citation preview

  • TDC 363Introduction to LANs

    Greg BrewsterDePaul University

    OSPF

    TDC 363 Greg Brewster, DePaul University 1

  • Link State Routing Algorithms Open Shortest Path First (OSPF)

    Message Types Operations Configuration and Verification

    OSPF

    Greg Brewster, DePaul University 2TDC 363

  • ITE PC v4.0Chapter 1 3 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State Routing Link state routing protocols

    -Also known as shortest path first algorithms

    -These protocols built around Dijkstras SPF

  • ITE PC v4.0Chapter 1 4 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State RoutingLink-State Routing Process How routers using Link State Routing Protocols reach

    convergence-Each routers learns about its own directly connected networks

    -Link state routers exchange Hello packet to meet other directly connected link state routers.

    -Each router builds its own Link State Packet (LSP) which includes information about links and neighbors such as neighbor ID, link type, & bandwidth.

    -After the LSP is created the router floods it to all neighbors who then store the information and then forward it until all routers have the same information.

    -Once all the routers have received all the LSPs, the routers then construct a topological map of the entire network which is used to determine the best routes to all destinations.

  • ITE PC v4.0Chapter 1 5 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State RoutingSending Hello Packets to

    Neighbors Connected interfaces that are using

    the same link state routing protocols will exchange hello packets.

    Once routers learn it has neighbors they form an adjacency

    -2 adjacent neighbors will exchange hello packets

    -These packets will serve as a keep alive function

  • ITE PC v4.0Chapter 1 6 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State RoutingBuilding the Link State Packet

    Each router builds its own Link State Packet (LSP)

    Contents of LSP:

    -State of each directly connected link

    -Includes information about neighbors such as neighbor ID, link type, & bandwidth.

  • ITE PC v4.0Chapter 1 7 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State Routing LSPs are sent out under the following conditions

    -Initial router start up or routing process-When there is a change in topology

  • ITE PC v4.0Chapter 1 8 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State RoutingConstructing a link state data base

    Routers use a database to construct a topology map of the network

  • ITE PC v4.0Chapter 1 9 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State Routing

  • ITE PC v4.0Chapter 1 10 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State Routing Determining the shortest path

    The shortest path to a destination determined by adding the costs & finding the lowest total path cost

  • ITE PC v4.0Chapter 1 11 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State Routing Once the SPF algorithm has determined the shortest

    path routes, these routes are placed in the routing table.

  • ITE PC v4.0Chapter 1 12 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State Routing Protocols

    Routingprotocol

    BuildsTopological

    map

    Router can independently determine the

    shortest path to every network.

    ConvergenceA periodic/

    event driven routing updates

    Useof

    LSP

    Distance vector

    No No Slow Generally No No

    Link State Yes Yes Fast Generally Yes Yes

    Advantages of a Link-State Routing Protocol

  • ITE PC v4.0Chapter 1 13 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Link-State Routing ProtocolsRequirements for using a link state routing protocol Memory requirements

    Typically link state routing protocols use more memory

    Processing RequirementsMore CPU processing is required of link state routing protocols

    Bandwidth RequirementsInitial startup of link state routing protocols can consume lots of bandwidth

  • 1. A Link State Internal Gateway Protocol used within most Autonomous Systems on the Internet

    2. Advantages over RIP (distance-vector protocol) a) Supports many distance metrics, including physical distance, transmission

    delay, queueing delay, etc. b) Adapts to changes in topology quickly. c) Supports multiple types of service such as least delay, highest throughput,

    etc. d) Does load balancing over multiple paths to the same destination. e) Supports hierarchical systems:

    i) Autonomous Systems ii) Areas iii) Networks iv) Subnets

    f) Improved security.

    Open Shortest Path First (OSPF)

    Greg Brewster, DePaul University 14TDC 363

    1. A Link State Internal Gateway Protocol used within most Autonomous Systems on the Internet

    2. Advantages over RIP (distance-vector protocol)

    a) Supports many distance metrics, including physical distance, transmission delay, queueing delay, etc.

    b) Adapts to changes in topology quickly.

    c) Supports multiple types of service such as least delay, highest throughput, etc.

    d) Does load balancing over multiple paths to the same destination.

    e) Supports hierarchical systems:

    i) Autonomous Systems

    ii) Areas

    iii) Networks

    iv) Subnets

    f) Improved security.

  • OSPF Link State Database Each OSPF router maintains a Link State

    Database containing, for each link in the network: The Link Type Router IDs of routers connected to this link IP subnet address for this link IP subnet mask for this link Link cost Link status (up or down)

    Greg Brewster, DePaul University 15TDC 363

  • ITE PC v4.0Chapter 1 16 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Basic OSPF Configuration

    Router IDThis is a single IP address used to identify a router3 methods for determining the router IDConfigure with OSPF router-id command

    -Takes precedence over other methodsIf router-id command not used then router chooses highest IP address of any loopback interfaces Commonly set up Loopback0 IP to become Router ID

    If no loopback interfaces are configured then the highest IP address on any active interface is used Using active interface IP address is not best practice because Router ID may change if interface goes down.

  • ITE PC v4.0Chapter 1 17 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Basic OSPF ConfigurationOSPF Router ID Commands used to verify current router ID

    Show ip protocolsShow ip ospfShow ip ospf interface

  • OSPF Hierarchical Networks Autonomous Systems

    Owned by single organization Areas

    Collection of subnets and routers within an AS. Each area has an Area Number.

    Routers inside an area flood information to all other routers in area

    Area border routers summarize area information to pass to another area

    All areas connect to backbone area (0). For TDC 363, we only study single-area OSPF all

    subnets and routers will be in Area 0.Greg Brewster, DePaul University 18TDC 363

  • Figure 13-17

    OSPF Hierarchical Networks

    Backbone router: connect only to networks in the backbone area (Area 0)

    Area border router: attaches to multiple areas.

    Internal router: all interfaces connected to networks in the same area.

    AS boundary router (Also known as Border Router): connect to other ASes

    Greg Brewster, DePaul University 19TDC 363

  • ITE PC v4.0Chapter 1 20 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Introduction to OSPFOSPF Packet Types

  • OSPF HELLO Packet

    When router first powers up or comes online, it will first discover neighbors Multicast HELLO messages on all its

    interfaces Listen for HELLO messages in response

    from neighbor routers Store neighbor router information in

    Adjacency Database.

    Greg Brewster, DePaul University 21TDC 363

  • Chapter 322 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public

    OSPF Router Tables / Databases

    OSPF maintains three databases which are used to create three tables.

    Database Table Description

    Adjacency Database

    Neighbor Table

    List of all neighbors routers to which a router has established bidirectional communication.

    This table is unique for each router. Can be viewed using the show ip ospf neighbor command.

    Link-state Database

    Topology Table

    List of information about all other routers in the network. The database shows the network topology. All routers within an area have identical link-state databases. Can be viewed using the show ip ospf database command.

    Forwarding Database

    Routing Table

    List of routes generated when an algorithm is run on the link-state database.

    Each routers routing table is unique and contains information on how and where to send packets to other routers.

    Can be viewed using the show ip route command.

  • ITE PC v4.0Chapter 1 23 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Introduction to OSPF Hello Packets

    Maintain adjacencies and set Designated Router

    OSPF Hello IntervalsUsually multicast (224.0.0.5)Sent every 10 seconds in generalSent every 30 seconds for NBMA

    OSPF Dead IntervalsThis is the time that must transpirebefore the neighbor is considered down

    Default time is 4 timesthe hello interval

  • OSPF DATABASE DESCRIPTION Message

    When other routers receive the HELLO message: If this is the first time they have heard from

    this router, they will send DATABASE DESCRIPTION message

    This message gives a summary outline of all information in the Link State Database of the router

    Greg Brewster, DePaul University 24TDC 363

  • OSPF LINK STATE REQUEST Message

    When a router wants more information about a particular set of links, it will send a LINK STATE REQUEST message to its neighbor.

    Neighbor will respond with LINK STATE UPDATE message containing requested information

    Greg Brewster, DePaul University 25TDC 363

  • OSPF LINK STATE UPDATE Message

    When any link state changes (link goes up or down, cost changes, etc.) a router will flood a LINK STATE UPDATE message to all other routers in the Area. Link State Update contains one or more

    Link State Advertisements (LSAs) from the router.

    Greg Brewster, DePaul University 26TDC 363

  • LSU Flooding When any router receives a Link State

    Update message, it checks whether this is a new update message If it is a New LSU message, then this router

    will flood the message (transmit a copy out all interfaces except the one it arrived on)

    If it is an Old LSU message (seen before), then this router will drop the message

    Greg Brewster, DePaul University 27TDC 363

  • New or Old? A router determines whether an arriving LSU

    message is new or old using two header fields Sequence Number

    Each router remembers the Sequence Number of the last LSU seen from every other router

    Each router increments Sequence Number when sending out a new LSU

    Age Routers update Age field with estimated transit

    time. Messages dropped when Age gets too large

    Greg Brewster, DePaul University 28TDC 363

  • OSPF Types of Links Point-to-Point Link

    Directly connects two routers with no other host or router inbetween.

    Transient Link A Link with multiple routers on it (example: a

    LAN) Stub Link

    A link with only one router on it Virtual Link

    A multi-hop connection between two routers (a tunnel) used for backup if direct link goes down.

    Greg Brewster, DePaul University 29TDC 363

  • Point-to-Point Links Each of the two routers measures the

    metric from itself to its neighbor. Result: there are 2 metrics for each point-

    to-point link one for data sent in each direction. May be same value or different.

    Greg Brewster, DePaul University 30TDC 363

  • Transient Links and DRs Many routers connect to the same link

    (multiaccess link), such as in a LAN. Problem: Its too much work to measure metrics

    between all possible pairs of routers Solution:

    Choose one router to be designated router (DR) Other routers only form adjacencies with DR. Cost metric is assigned from each router to designated

    router. No cost from designated router to others. Designated Router is elected based on Priority value. Backup Designated Router is also elected and takes over

    if DR fails.

    Greg Brewster, DePaul University 31TDC 363

  • ITE PC v4.0Chapter 1 32 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    OSPF in Multiaccess Networks Solution to LSA flooding issue

    is the use of Designated router (DR)Backup designated router (BDR)

    DR & BDR selectionRouters are elected to send & receive LSA

    Sending & Receiving LSADRothers send LSAs via multicast 224.0.0.6 to DR & BDRDR forward LSA via multicast address 224.0.0.5 to all other routers

  • ITE PC v4.0Chapter 1 33 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    OSPF in Multiaccess Networks

    Criteria for getting elected DR/BDR1. DR: Router with the highest OSPF

    interface priority.2. BDR: Router with the second highest

    OSPF interface priority. 3. If OSPF interface priorities are equal, the

    highest router ID is used to break the tie.

  • ITE PC v4.0Chapter 1 34 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    OSPF in Multiaccess Networks

    Timing of DR/BDR ElectionOccurs as soon as 1st router has its interface enabled on multiaccess networkWhen a DR is elected it remains as the DR until one of the following occurs

    -The DR fails.-The OSPF process on the DR fails.-The multiaccess interface on the DR fails.

  • ITE PC v4.0Chapter 1 35 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    OSPF in Multiaccess NetworksOSPF Interface Priority Manipulating the DR/BDR election process continued

    Use the ip ospf priority interface command.Example:Router(config-if)#ip ospf priority {0 - 255}Priority number range 0 to 255

    0 means the router cannot become the DR or BDR1 is the default priority value

  • Stub Links A stub link is just a special case of a

    transient network where the number of routers on the network is 1

    Stub links are advertised in LSAs sent by connected router.

    Greg Brewster, DePaul University 36TDC 363

  • OSPF Protocol Overview When router first powers up, it will

    Determine who its neighbor routers are. Download a complete Link State Database

    from a neighbor router When something changes in the network

    (link goes up or down, cost metric changes, etc.) Discovering router will flood Link State

    Advertisements (LSAs) to all other routers in the Area to update their databases

    Greg Brewster, DePaul University 37TDC 363

  • Link State Advertisement

    An LSA packet announces the state of all links connected to a router

    Four types of LSAs: Router Link LSA Network Link LSA Summary Link LSA (multi-area OSPF) External Link LSA (multi-area OSPF)

    Greg Brewster, DePaul University 38TDC 363

  • Router Link LSA Advertises the state of the links connected

    to a true router Can be any of the 4 link types

    Greg Brewster, DePaul University 39TDC 363

    Figure 13-25

  • Network Link LSA Advertises the state of the links connected

    to a designated router

    Greg Brewster, DePaul University 40TDC 363

  • Summary Link LSA

    Two Types (not required for TDC 363): Summary Link to Network LSA

    Used to provide a summary of all link information for one particular Area to all routers in another Area in the same Autonomous System

    Summary Link to AS Boundary Router LSA Advertises a path to an AS Boundary router so that

    Area routers can learn how to get outside of their own Autonomous System

    Greg Brewster, DePaul University 41TDC 363

  • ITE PC v4.0Chapter 1 42 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    OSPF Metric OSPF uses path cost as metric for determining best route.

    Path Cost = sum of link costs on path to destination. -Link Cost is based on bandwidth of link interfaceInterface bandwidth parameter can be changed by admin. It is not affected by clock rate command.Link Cost is calculated using the formula

    Link Cost = 108 / (Interface Bandwidth)Default Link Costs

    Eth interface: 10FastEth interface: 1GigEth interface: 1Serial Interface: 64

    (regardless of clock rate)

  • ITE PC v4.0Chapter 1 43 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    OSPF Metric COST of an OSPF route

    Is the accumulated value from one router to the next

  • ITE PC v4.0Chapter 1 44 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

    Basic OSPF ConfigurationModifying the Cost of a link Both sides of a serial link should be configured with the

    same bandwidthCommands used to modify bandwidth valueBandwidth command

    Example: Router(config-if)#bandwidth bandwidth-kbpsip ospf cost command allows you to directly specify interface cost

    -Example:R1(config)#interface serial 0/0/0R1(config-if)#ip ospf cost 1562

  • OSPF Configuration router ospf (global config)

    Creates OSPF route database, starts OSPF routing process number that manages OSPF messages, maintains database, and copies routes from database into routing table.

    network netmask area Causes OSPF to advertise Subnet ID with wildcard

    (inverse subnet mask) in OSPF area number and to send/receive OSPF Hellos and LSUs on all interfaces that directly connect to this subnet.

    The subnet specified in the network command should be directly connected to this router.

    Two routers connected to same link will only become OSPF neighbors if both of them execute network statements for the common link subnet in their OSPF configurations.

    Greg Brewster, DePaul University 45TDC 363

  • Presentation_ID 46 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential

    Configure Single-area OSPFv2The network Command

    This activates OSPF (sends out HELLOs) on interfaces connected to subnets 172.16.1.0/24, 172.16.3.0/30 and 192.168.10.4/30. It also includes these 3 subnets in OSPF database and OSPF Update messages.

  • Specific Network Statements Type a separate specific OSPF network statement for

    each directly-connected subnet on the router. Do not type a network statement for any remote subnet that is

    not directly connected. Do not combine multiple subnets into a single network

    statement. Example: 172.16.5.0/24 &172.16.6.0/24 are directly attached:

    Correct: network 172.16.5.0 0.0.0.255 area 0 network 172.16.6.0 0.0.0.255 area 0

    Wrong: (this will work in some cases, not others - you lose points in any case) network 172.16.0.0 0.0.255.255 area 0

    It will always be wrong to type: network 0.0.0.0 255.255.255.255 area 0 Sometimes this works, sometimes it messes things up. But it is always sloppy and

    not acceptable.

    Greg Brewster, DePaul University 47TDC 363

  • Basic OSPF Configurationenableconfigure terminalinterface loopback0 ! For OSPF IDip address 10.1.1.1 255.255.255.255no shutdowninterface ethernet0/0ip address 130.88.55.1 255.255.255.0no shutdowninterface serial0/0ip address 130.88.56.1 255.255.255.0no shutdownrouter ospf 1network 130.88.55.0 0.0.0.255 area 0network 130.88.56.0 0.0.0.255 area 0exitexit

    Greg Brewster, DePaul University 48TDC 363

  • OSPF Configuration - Optional router ospf (global config)

    passive-interface Disables sending route updates out the specified interface

    router-id A.B.C.D Sets OSPF router-id to A.B.C.D

    ospf log-adjacency-changes Shows a message on router console any time an OSPF

    neighbor goes up or down.

    Greg Brewster, DePaul University 49TDC 363

  • Presentation_ID 50 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential

    By default, OSPF messages are forwarded out all OSPF-enabled interfaces. However, these messages really only need to be sent out interfaces connecting to other OSPF-enabled routers.

    Sending out unneeded messages on a LAN affects the network in three ways: Inefficient Use of Bandwidth Inefficient Use of Resources Increased Security Risk

    OSPF messages are not sent out a Passive Interface, but its IP subnet is included in OSPF database and in Update messages sent out other interfaces.

    The Passive Interface feature helps limit the scope of routing update advertisements.

    Configure Single-Area OSPFv2Passive Interface

  • Presentation_ID 51 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential

    Configure Single-area OSPFv2Configuring Passive Interfaces

    Use the passive-interface router configuration mode command to prevent the transmission of routing messages through a router interface, but still allow that network to be advertised to other routers.

  • OSPF Interface Configuration(optional)

    ip ospf cost Sets the cost for the link connected to this interface to

    ip ospf retransmit-interval Sets the time between Link State Advertisement retransmissions

    to seconds.

    ip ospf priority Sets the OSPF priority of this interface to . Highest

    priority interface on transient network will be designated router.

    ip ospf hello-interval Sets the time between HELLO packets to seconds.

    ip ospf dead-interval If no HELLO packets seen for seconds, then neighbor

    router is declared down.Greg Brewster, DePaul University 52TDC 363

  • OSPF Interface Configuration

    enableconfigure terminalinterface ethernet0/0ip address 130.88.55.1 255.255.255.0ip ospf cost 10ip ospf priority 5no shutdowninterface serial0/0ip address 130.88.56.1 255.255.255.0no shutdownrouter ospf 1network 130.88.55.0 0.0.0.255 area 0network 130.88.56.0 0.0.0.255 area 0exitexit

    Greg Brewster, DePaul University 53TDC 363

  • OSPF Verification/Debug show ip protocols show ip ospf interface show ip ospf database show ip ospf router debug ip ospf ? adj - OSPF adjacency events events - OSPF events flood - OSPF flooding lsa-generation - OSPF lsa generation packet - OSPF packets retransmission - OSPF retransmission events tree - OSPF database tree

    2-64

    Greg Brewster, DePaul University 54TDC 363

    TDC 363Introduction to LANsLink-State RoutingLink-State RoutingLink-State RoutingLink-State RoutingLink-State RoutingLink-State RoutingLink-State RoutingLink-State RoutingLink-State RoutingLink-State Routing ProtocolsLink-State Routing ProtocolsOpen Shortest Path First (OSPF)OSPF Link State DatabaseBasic OSPF ConfigurationBasic OSPF ConfigurationOSPF Hierarchical NetworksSlide Number 19Introduction to OSPFOSPF HELLO PacketOSPF Router Tables / DatabasesIntroduction to OSPFOSPF DATABASE DESCRIPTION MessageOSPF LINK STATE REQUEST MessageOSPF LINK STATE UPDATE MessageLSU FloodingNew or Old?OSPF Types of LinksPoint-to-Point LinksTransient Links and DRsOSPF in Multiaccess NetworksOSPF in Multiaccess NetworksOSPF in Multiaccess NetworksOSPF in Multiaccess NetworksStub LinksOSPF Protocol OverviewLink State AdvertisementRouter Link LSANetwork Link LSASummary Link LSAOSPF MetricOSPF MetricBasic OSPF ConfigurationOSPF Configuration Configure Single-area OSPFv2The network CommandSpecific Network StatementsBasic OSPF ConfigurationOSPF Configuration - OptionalConfigure Single-Area OSPFv2Passive Interface Configure Single-area OSPFv2Configuring Passive InterfacesOSPF Interface Configuration(optional)OSPF Interface ConfigurationOSPF Verification/Debug