Tuesday, June 8, 2010

OSPF

Open Shortest Path First:
  • Dynamic routing protocol in IP networking. A link state routing protocol in the group of Interior gateway protocols (IGP), that operates in a single Autonomous system (AS). IPV4 uses OSPF V2
  • Gathers link state information from routers and constructs topology map of the network, this creates the routing table
  • Supports variable-length subnet masking (VLSM) or CIDR
  • Detects changes in topology and converges a new routing structure within seconds using a shortest path algorithm (Dijkstra's)
  • Link state info is maintained on each router as a link state database (LSDB), making a tree image of the network. Copies of this are updated through flooding on OSPF routers
  • Routing policies in OSPF are governed by link cost factors, this could be the distance (round trip time), network throughput of the link, or link availability and reliability, represented as unitless numbers. Load balancing can occur with traffic balancing between equal path costs.
  • OSPF networks can be divided into areas, which are identified as 32-bit numbers, in decimal or octet.
  • Area 0 (0.0.0.0) is the core or backbone region. Each additional area must have a direct or virtual connection to the backbone, these connections are maintained by a area border router (ABR). ABRs maintains separate link state databases for each area it serves and contains summarized routes for all areas in the network.
  • OSPF doesn't use a TCP/IP protocol (UDP or TCP), but is encapsulated into IP datagrams with port number 89.
  • OSPF uses multicast addressing for route flooding on broadcast network links, id a non-broadcast network exists special provisions allow neighbor discovery. OSPF IP packets never travel more than 1 hop, OSPF reserves the multicast address 224.0.0.5.
  • When multicast IP traffic needs to be routed, OSPF supports Multicast Open Shortest Path First (MOSPF), this is not used all the time as PIM is typically used in conjunction with OSPF or other IGPs are widely deployed.
  • OSPF can run securely between routers, using a variety of authentication methods to allow only trusted routers.
  • Version 3 (for IPV6) does not use authentication, instead it used IPSec, It runs per link, rather than subnet. IP prefix's has been removed from hello and link state adverts, area and router ID are still 32-bit values.
Neighbor Relationships:
  • Adjacent routers are formed when they are in the same broadcast domain or have a point to point link. This is identified by a hello OSPF packet, and a two-way state is formed (very basic). The routers in the network select a designated router (DR) and a backup designated router (BDR) which act as a hub to reduce traffic. OSPF uses unicast and multicast to send hello's and link state updates.
  • Neighbor tables are called adjacency databases. In order to form neighbor relationships between two routers, the interfaces must be in the same area, one interface can only belong to one area.
Areas:

  • Backbone is responsible for distributing info to non-backbone areas, and must be contiguous. If physical limitations exist, the configuration of virtual links can be used. As an example - 0.0.0.0 is physically connected to 0.0.0.1, 0.0.0.2 is not connected to .0 but it is connected to .1; .2 can use a virtual link through a transit area of .1 to reach the backbone.
  • Stub area - does not receive route adverts external to the AS and routing within the area is based on a default route.
  • Not so stubby area (NSSA)- A type of stub area that imports AS external routes and sends them to other areas, yet it itself (its own AS) does not receive AS external routes from other areas. In other words, its an injection of external routes in a limited fashion into the stub area.
  • Totally stubby area (TSA) - Like a stub area, but does not allow summary routes in addition to not having external routes, or Inter-area (IA) routes are not summarizes into totally stubby area. Only default routes are used in the area, thus being the only Type 3 LSA in the area.
  • NSSA TSA - Takes attributes of a TSA (Type 3 and 4 summary routs are not flooded into the area type). The area can receive only from the default route 0.0.0.0 but also contains the ASBR that accepts external routing info and injects it into the local area 0.0.0.0. LSA type 7 only exists in NSSA, the ASBR generates the LSA, and an ABR translated it into a type 5 LSA which is then propagated into the OSPF domain.
An area is called NSSA and TSA when a ASBR sends externals to a TSA, and are available to OSPF speakers in that area. The external routes are summarized before injecting them in the TSA, this would typically happen when a newly acquired subsidiary is on the edge of a TSA. Routers in TSA-NSSA send all traffic to ABR, but not routes by ASBR.
Path Preference:
Path cost is used as a basic routing metric, determined by speed of the interface. There are 4 types of metrics, with preference in order:
1.Intra-area
2.Inter-area
3.External type 1 - external path cost and sum of internal path cost to ASBR
4.External Type 2 - value of external path cost
OSPF-TE:
Traffic engineering uses opaque LSA type-length-value elements to obtain more information about topology. This can support OOB on data plane network, and can be used on non-IP, such as Optical networks.
Router Types:
The router type is an attribute of an OSPF process. A physical router can have one or more OSPF process - ex) A router connected to more than one area and receives routes from a BGP process connected to another AS, is both a ABR and an ASBR
  • Area Border Router (ABR): A router that connects one or more areas to the main backbone. Its a member of all areas its connected to, and keeps a link state DB in memory, one for each area its connected
  • Autonomous System Boundary Router (ASBR): A router that's connected to more than one routing protocol and exchanges routing information with other routers in other protocols. They typically run an exterior routing protocol like BGP. It is used to distribute routes from other external ASs throughout its own AS.
  • Internal Router: A router that has OSPF neighbor relationships interfaces in the same area.
  • Backbone router: Routers connected to the OSPF backbone.
Designated router: Router interface elected to be broadcast multiaccess. Nonbroadcast multiaccess (NBMA) media would require special techniques to support DR function, this is usually done via point to point lines.
DRs can be associated with other OSPF router types, A router can have a physical interface that are DR, others Backup (BDR), and others non-designated. DRs are elected on the following criteria:
  • If priority on OSPF is 0, it will never be DR or BDR
  • If DR fails and BDR takes over, another election will choose a new BDR
  • Highest priority hello packets win the election.
  • If two routers tie in priority setting, the highest Router ID (RID) wins (highest loopback IP configured on the router). If no loopback exists the highest interface IP wins.
  • Second highest priority becomes BDR
  • priority is between 0-255, higher numbers increase chances of becoming DR
  • If a new router with a higher priority comes online after a DR has been elected, it will not be a DR until current DR fails.
  • When DR goes down and BDR takes over, a new BDR is elected. If the scenario repeats the new BDR stays unchanged.

DRs are a source for routing updates, they maintain a complete topology table of the network and send multicast updates. All routers form a slave/master relationship with the DR. When updates are received they are sent to the DR and BDR on 224.0.0.6, and DR sends and update on 224.0.0.5. This reduces network load. Elections on NBMA (Frame Relay or ATM) can also occur. elections do not happen on p-to-p links because the routers must be adjacent and the bandwidth cannot be further optimized.

There are 5 OSPF Packet formats as follows:

Type Description
1 Hello
2 Database Description
3 Link State Request
4 Link State Update
5 Link State Acknowledgement





No comments:

Post a Comment