Saturday, January 4, 2020

OSPF

Open Shortest Path First
  • Link state protocol; supports large networks; has very fast convergence; messages are sent multicast; is an open standard; uses Dijkstra's Shortest Path First algorithm for best path determination
  • A router passes information to its directly connected neighbor, this information is then passed unchanged from one router to another (unlike Distance Vector Routing Protocols)
  • OSPF routers use LSA Link State Advertisements to pass routing updates; Packet Types:
    • Hello: after OSPF is enabled on an interface, it will send and listen for Hello packets to form adjacencies on the link
    • DBD - DataBase Description: adjacent routers will tell each other the networks they know about with the DBD packet
    • LSR - Link State Request: if a router is missing information about any of the networks in the received DBD, it will send the neighbor an LSR
    • LSA - Link State Advertisements: a routing update, and a replay to the LRS
    • LSU - Link State Update: Contains a list of LSA's which should be updated, used during flooding
    • LSAck: Receiving routers acknowledge LSA's
Standard Configuration:
  
    R1(config)#router ospf 1
  • Process ID (ospf 1) is only locally significant, as different interfaces can have different Process IDs running unique instances of OSPF
  • If different, each interface will have different Link State Databases within the router and will not share information with each other
  • However, adjacent routers can have different Process ID and they will share OSPF database information
   R1(config-router)#network 10.0.0.0  0.0.255.255  area 0
  • The network command uses a wildcard mask format which is the inverse of the subnet mask - subtract each octet by 255 to calculate.
    • subnet mast of 255.255.0.0 equals wildcard mask of 0.0.255.255
    • and 255.255.255.252 equals wildcard mask of 0.0.0.3
  • You must specify the wildcard mask, unlike eigrp
  • Network Command means:
    • look for interfaces that fall within this IP range then enable OSPF on those interfaces
    • Send out and listen for OSPF hello messages and peer with adjacent OSPF routers
    • advertise the network and mask which is configured on those interfaces
    • R1(config-router)#network 10.0.0.0  0.0.255.255 area 0
Verification Commands:

  R1#show run | section ospf
  R1#show ip protocols
  R1#show ip ospf interface brief
  R1#show ip ospf neighbor
  R1#show ip ospf database   (shows all the links in an area)
  R1#show ip route   ( (o) is the ospf designation)

Router ID
  • OSPF routers identify themselves to each other with an ID that looks like an IPv4 address
  • This ID will default itself to the highest loopback IP address and if none configured, to the highest interface address   
  • Loopback interfaces never go down, therefore, best practice is to have a loopback on your router or manually set the Router ID
    • R1(config)#router ospf 1
    • R1(config-router)#router-id 2.2.2.2
      • if other router interfaces are already up, you must disable/enable ospf for the ID to take effect or reboot router
Passive Interface Config
  • A Passive interface will be advertised in OSPF and other routers will be able to get to that network, however, the interface will not form any adjacencies or send out any internal information
  • R1(config)#router ospf 1
  • R1(config-router)#passive-interface loopback 0
  • R1(config-router)#passive-interface gi0/0
  •   Note: conversely, make all interfaces passive and undo the interfaces needed
  • R1(config-router)#passive-interface default
  • R1(config-router)#no passive-interface g0/0
Default Route Injection
  • R4(config)#ip route 0.0.0.0  0.0.0.0  203.0.113.2
  • R4(config)#router ospf 1
  • R4(config-router)#default-intformation originate

Notes:
  • Speed and Clock Rate- is the rate that the physical interface will transmit; change the Speed or Clock Rate ⇨ it changes the physical transmission speed.
    • GigabitE = 1000 mbps
    • FastE = 100 mbps
    • Serial = 1.544 mbps
  • Bandwidth - affects software policy on the router, like influencing EIGRP and OSPF path selection, or how much bandwidth will be guaranteed to a traffic type by Qos.
    • Normally, Speed and Bandwidth by default are the same
    • The 'Bandwidth' setting on an interface does not affect the physical transmission rate. 
Metric Calculation
  • The router will learn all the destinations in its area, and the links and their cost; then select the routes based on the lowest cost to a destination.
  • Cost is automatically derived from the interface bandwidth
    • Cost = Reference Bandwidth / Interface Bandwidth
    • Reference Bandwidth default is 100 Mbps
    • FE link cost by default is 1  (100/100)
    • T1 link cost by default is 64  (100/1.544)
    • GE default is 1  (100/1000) (1 is the smallest number)
  • Reference Bandwidth modification: affects all interfaces on router
    • R1(config)#router ospf 1
    • R1(config-router)#auto-cost reference-bandwidth 100000
      • FE cost would be 1000 (100000/100)
      • GE cost would be 100  (10000/100)
    • Set the same reference on all routers
  • Manipulating the OSPF Metric in two ways:
    • Change the bandwidth on an interface (not recommended)
      • R1(config)#interface serial1/0
      • R1(config-if)#bandwidth 768
    • Manually change the cost by overriding the automatic OSPF cost
      • R1(config)#interface fa0/0
      • R1(config-if)#ip ospf cost 50
      • R1#show ip ospf interface fa0/0   (for verification)
OSPF Areas - only for really large networks
  • This supports a hierarchical design that segments large networks into smaller areas. The router maintains full information about its own area, but only summary information about other areas.
    • Areas reduce router memory needs
    • Areas limit router updates to within the area and reduce CPU resources
  • Two-level hierarchy:
    • Transit area (backbone or area 0): generally does not contain users
    • Regular areas (nonbackbone area): used to connect end-users to  the Transit area, by default all traffic goes through the TA
  • R1(config-router)#network 10.0.0.0 0.0.255.255 area 0
    • The network command looks for interfaces inside this network range and addes that interface to area 0
    • For a router to form an adjacency, the neighbor will need to be in the same area
  • Area Border Routers (ABR)(R2 below) routers with interfaces in multiple areas
    • it separates LSA flooding zones
    • it functions regularly as the source for default routes
    • it maintains the LSDB for each area that it is connected to
    • ideally, the ABR is connected to 2 areas (the backbone and another), with three areas being the upper limit
    • it becomes the primary point for area address summarization
      • ABRS do not automatically summarise
      • If not manually summarized, the routes are flooded everywhere
    • #show ip route displays these routes as O IA
  • Autonomous System Boundary Routers (ASBR)
    • these redistribute into OSPF networks
    • they are running OSPF but may also be running other routing protocols that need to be redistributed into the network
    • #show ip route displays these routes as O*E1 or O*E2



No comments:

Post a Comment

Spanning Tree