Sie sind auf Seite 1von 7

Difference Between OSPF and EIGRP

ospf has large scalabiliy, meaning you can expand the sieze of your network easily because it build hierarchy based on Area, unlike EIGRP where you can have maximum 255 hop.
in ospf, every router has a full visiblity / roadmap of entire network or route unlike eigrp where router only know or believe about the path / route which his neighbour told them.
Initially ospf/eigrp sends his full routing table to neighbor and after only send the exact changes in the update packet to the neigbors
ospf uses the concept of LSA to excahnge the route and Area
ospf version - OSPF has 3 version as of now, ospf v2 is what we used, If you are using IPv6, you will have to use ospf v3

OSPF is just like a navigation system, it has a complete map of the network and with that it just calculate the shortest path to all the destination.

OSPF is a Link state routing Protocol - what does it mean and How - We could think of a link as an interface on the router and the state means the description of that interface and how its
conneted to its neighboring routers. A description of the interface would include, the IP address of the interface, the mask, the type of network it is connected to, the routers connected to that network
and so on. The collection of all these link-states would form a link-state database. In ospf technically we do not advertise route, we advertise the connected interfaces or state of the link, in order
to develop a full or overall picture of topology, so that a single ospf router should know every single link of the topology

OSPF states - OSPF routers go through the seven states 'while building neighborship with other routers' or 'before the neighbor is considered fully adjacent';
DOWN - No Hello recived (heared) by R1/R2 interfaces. During the fully adjacent neighbor state, if a router (Rx) didn't receive hello packet from a neighbor (Ry) within the dead Interval, Rx will change
the neighbor state (Ry) from Full to Down, in its neighbor table (sh ip ospf neighbor).
ATTEMPT - Comes into picture on NBMA network only, where we configure neighbor manually. R1 sent an unicast hello on NBMA network but no hello received.
Once neighborship is built, OSPF (R1) uses hello packets as keep alive. If R2 does not receive a hello packet from any particular neighbor (R1) in dead interval, R2 will change that neighbor states from
full to down in its ospf nighbor table (sh ip ospf neighbor). After changing the state R2 will try to contact the neighbor by sending Hello packets. This effort is made in Attempt state.
INIT - means R2 has received a hello (sent by R1 on multicast ip), however his (R2) router ID is not listed in the neighbor field of that received hello. or bidirectional communication
has not been established yet with R1). If OSPF Hello parameters and values do not match here, ospf routers will never progress beyond this state.
2-WAY - means R2 has received a hello and found his own router id in the neighbor field of that received hello . So bidirectional communication has been established between R1 and R2, Two routers
will form neighbor adjacency and stay in this state if they are not the DR or BDR on the network segment.
And if R1 and R2 is connected over Ethernet link they will go for DR-BDR election now.
Ex-START - Master slave election is happening for the exchange of DBD packets, meaning once the DR and BDR are elected after 2-way state, the routers and their DR and BDR establish a master-
slave relationship for LSDB syncing (Routers who decided to build adjacency will form a master / slave relationship) . r1 send its DBD to r2, r2 will ignore that and say hey r1, i am the master because i
have the highest router id. r1 will accept that and says ok i am slave.
EXCHANGE - DBD Packets describing the entire link-state database (contains summary of LSDB) is being sent or exchanged by R1 & R2
LOADING - Exchange of LSR and LSU packet is happening based on the information provided by the DBD like R1 send LSR to neighbor for every network that it doesn't know about. R2 replies with
LSUs which contain information about requested networks. R2 does the same thing.
FULL - all the routers are fully adjacent with each other. All the router and network LSAs are exchanged and the routers' databases are fully synchronized and they have a adjacency now, meaning now
R2 can see the R1 routes in Router LSA / Network LSA,
Full state indicates that both routers has been exchanged all LSAs. Now they have identical LSDB. meaning if R1 LSDB has (A,B, C, X LSA), R2 will also have (A,B, C, X LSA) in his LSDB
Meaning at this point, the routing tables are calculated

Adjacent routers remain in the full state for life time. This state also referred as adjacency. If any change occurs in network, routers will go through this process again.
Maintaining adjacency - Routers will send hello messages in hello interval.If a router does not receive hello message from neighbor in dead interval, it will declare that neighbor as dead.Once a
neighbor is dead, router will flood this change to other connected neighbors. Beside this if router detect any change in network or receive any update, it will flood that change.A LSA has a default
lifetime of 30 minutes. Any unchanged LSAs must be reflooded in every 30 minutes.

Difference between ospf Neighbor and ospf Adjacency -


when 2 routers are up on a link they will exchange hello packets with each other and if their parameters match, they will become neighbor ( which is technically called 2WAY state, in which 2 routers
see each other as nieghbors)
you dont exchange/share anything with them untill you have formed a relationship, this relationship is called Adjancy, its represented by Full state, which means the routers are now capable of
exchanging their LSDB.
OSPF only do Two-way communication with its neighbors (using Hello Protocol), Two-way means the communication is Bidirectioanl between R1 & R2 because they have listed each others Router IDs in
their Hello packets, which means they are neighbor. If LSA have been exchanged between R1 and R2 it means they are adjacent.

Routers have to become neighbor first, in order to exchange their LSA with each other.

In ethernet network all routers have two-way adjacency with each other or neigbhbour routers and full adjacency with DR and BDR, means routers are neighbors but not adjacent.
On Point-to-point and Point-to-multipoint networks, a router becomes full with all connected routers.
Its also possible that 2 routers are neighbours and in FULL STATE but yet they are not trully adjacent meaning they won't exchange routes with each other. This happens when u have incompatible OSPF
network types between these two neighbors. Now what are compatible netwwork types???....Those which elect DR/BDR i.e broadcast and nonbroadcast are compatible with each other and those which
do not elect DR/BDR i.e p2multipoint, P2multipoint nonbroadcast and P2P are compatible among themselves.

If a Router stuck in following state what could be the reason


INIT - One side is blocking the hello packet with Access-list, One side is Translating or NATing OSPF Hello, One side is blocking the ospf multicast
EXSTART & EXCHANGE - MTU Mismatch, R1 & R2 router id is same, Access-list blocking unicast (Because after two-way state OSPF send unicast packet except p2p links),
If OSPF Adjacency is not coming up between R1 and R2
1. Use sh ip ospf neighbor - To check ospf neighbor and adjacency
2. Use sh ip ospf interface serial 0 - To make sure ospf is enabled on that interface, There is no mismatch in the Network Type like R1 (Point-to-Point) and R2 (Broadcast)
3. Use debug ip ospf adjacency - To make sure ospf hello parameters are matching like subnet mask, Area id, Area Type etc.
If SPF running constantly on a Router how can you check and what could be the reason
LSA Flaps due to Duplicate RID/IP address or constant link flapping in an area
sh ip ospf stat - To check how many times SPF algorithm executed in which area
show ip ospf stat detail - Also look foor LSID how frequent changing in case of link flapping or other reason
deb ip ospf mon - look for value like Change in LS ID 1.1.1.1, When SPF begin, Process time, End time etc
show ip ospf database - look for Age value infron of each Link id or Advertise Router

OSPF neighbor relationship packet capture in Ethernet Network


R1 send a ospf hello to multicast address 224.0.0.5, 1. IP Header [Src ip of R1, dst ip224.0.0.2, Protolcol - ospf (89), TTL 1] 2. ospf header [ospf version -2, Message Type (Hello),
src router id, area id, Authentication data] 3. OSPF Hello packet [ Network Mask, Hello time (10), Dead Time (40), DR IP, BDR IP, R1 priority (1) ]
R2 & R3 send a ospf hello to multicast address 224.0.0.5
R1 listen on mutlicast address, receive R2 and R3 hello and send another hello by putting [R2 and R3 router id in Active Neighbor field in hello packet], R2 and R3 does same thing

DR and BDR - Without DR/BDR every router should have a full adjacency or full mesh connectivity with every other router as per ospf design. so in case any update found every router will flood that
update to every router, so a lot of flooding will hapen which will increase routing traffic, Routing table laod, CPU processing load across the network/routers. DR cut down the no. of ospf adjacncy on the
LAN and reduces the amount of updates or LSA that we sent on the links, so after dr bdr election in case any update occurs or link goes down, drother router send that update to DR and DR sent that to
other routers. meaning Drother routers are in full state with dr bdr and in 2-way state with each other. 2-way state means i have sent you a hello and you have acknowledge by sending an hello so i
know you are available on the link or nework.
BDR is used for the redundency of DR.
DR BDR election - The router which is configured first in the network becomes DR regardless of priority and router id. Router with highest priority (255) wins default is 1 < If there is a tie then router
with highest router id wins < If no router id defined on any router then router with highest loopback address wins < If there is no loopback defined on any router then router with highest interface ip
wins. BDR is the router with second highest priority.
If you want to stop a router to becoming DR, just set that router priority to 0. Routers that are not DR or BDR show up as DROTHER.
If you attach a new router with highest priority, it won't become DR because there is no preemption in DR/BDR, so then you have to reset the ospf process to selct a new DR/BDR
DR's can also be elected on NBMA networks (Frame Relay or ATM), but not on point-to-point WAN networks.
How many DR/BDR - A DR is a router interface property not the router, meaning A physical router can have some interfaces that are DR, others that are BDR, and others that are non-designated,
however you can only have 1 DR and 1 BDR in an area.
Configuration - R1(config)# int f0/0 > ip ospf priority 255

OSPF Network Types - OSPF behaves differently in different network type in terms of discovering neighbor, sending update etc. Broadcast and Non-broadcast are the 2 network types that require a
DR / BDR election, other network types (point-to-point, Point-to-multipoint, Point-to-multipoint non broadcast) dont require DR/BDR or Each network type with word point in it does not require a
DR/BDR. Non-broadcast and point to multipoint are open standard, rest (point-to-point, Broadcast, Point-to-multipoint non broadcast) are cisco propritery.

Broadcast - Network like Ethernet, FDDI,Token Ring. DR and BDR are required in this kind of network. All routers (Drother) form full adjacencies with DR and BDR and
neighborship (2-way adjacency) with each other. In this DR send update on multicast address 224.0.0.5 to drother and Drother send update on 224.0.0.6 to DR.
Non-Broadcast (or NBMA) - Network like Frame relay, ATM, X.25 (Serial link). Since NBMA network does not have broadcast capability, dynamic network discovery will not be possible
meaning ospf neighbors must have to define statically and all ospf packets are unicast. DR/BDR can be used beacuse multiple routers are connected but make sure the hub router is
always set as a DR (because if we have 3 router and 2 pvc, R1+R2 and R1+R3, if R2 bacomes DR then, Since DR/BDR should have full connectivity with all other routers but in this case
R3 cannot reach R2, Hence we never have full adjacency between R2-R3).
ospf automatically chooses the network type once we enable it, depending up on the media and encapsulation type, However we can manually change it
r2/r3(config)# int s0/0 > encapsulation frame-relay > ip ospf network non-broadcast > ip ospf priority 0 (so that r2/r3 never become DR)
r1(config)# router ospf 10 > neighbor 1.1.1.2 priority 0 > neighbor 1.1.1.3 priority 0 (Can also be used on hub router to make sure spoke router never become DR)
r1/r2/r3(config)# To send multicast over a frame relay network, This has to be confgured in case of point-to-multipoint network as well

Point to point - Network like HDLC and PPP connection (serial link), There is no DR/BDR in this because ospf sees the whole network as a collection of point-to-point links. All routers form full
adjacencies with each other. Neighbors can be dicovered and adjacency can be establsihed automatically. Hello / update are sent on multicast address 224.0.0.5

Point to multipoint - Network like Frame relay, MPLS, VPLS, DMVPN. There is no DR/BDR election in this network because ospf sees the whole network as a collection of point-to-point links, however
neighbour can be discovered automatically and updates or hello can be sent on the multicast address.
r2/r3(config)# int s0/0 > encapsulation frame-relay > ip ospf network point-to-multipoint
Point to multipoint non broadcast - Network like MPLS, VPLS, DMVPN. Its the same as point-to-multipoint with the difference of Non broadcast, Means in this you have to manually define the
neighbors and ospf hello or updates cannot be sent on a multicast address. There is no DR/BDR
What is OSPF SPF alogrithm and how does it work
OSPF uses a shorted path first algorithm in order to build and calculate the shortest path to all known destinations.The shortest path is calculated with the use of the Dijkstra algorithm. The algorithm
by itself is quite complicated. This is a very high level, simplified way of looking at the various steps of the algorithm:
Upon initialization or due to any change in routing information, a router generates a link-state advertisement. This advertisement represents the collection of all link-states on that router.
All routers exchange link-states by means of flooding. Each router that receives a link-state update should store a copy in its link-state database and then propagate the update to other routers.
After the database of each router is completed, the router calculates a Shortest Path Tree to all destinations. The router uses the Dijkstra algorithm in order to calculate the shortest path tree. The
destinations, the associated cost and the next hop to reach those destinations form the IP routing table.
In case no changes in the OSPF network occur, such as cost of a link or a network being added or deleted, OSPF should be very quiet. Any changes that occur are communicated through link-state
packets, and the Dijkstra algorithm is recalculated in order to find the shortest path.

The algorithm places each router at the root of a tree and calculates the shortest path to each destination based on the cumulative cost required to reach that destination. Each router will have its own
view of the topology even though all the routers will build a shortest path tree using the same link-state database. The following sections indicate what is involved in building a shortest path tree.
LSA, LSR, LSU - Every OSPF router maintains a Link state database (LSDB), in which it keeps all LSA
are four LSA or netowrk A,B,C,D available inside of an area Then each router will have these four A,B,C
The LSAs (Link-State Advertisements) are used by OSPF routers to exchange routing and topology info
first send a list of all LSAs in their respective topology database to each other in a DBD packet [ Datab
routers is same or not ]. Then each router checks its topology database (LSDB) and sends LSR (Link S
Other router responds with the LSU (Link State Update) message that contains all LSAs requested by
meaning for every DBD//LSU/..packet sent by R1 an acknowldgement should come to R1. LSAs are ret
What other have is DBDs, What I have is LSDB, What I need to order is LSR

LSA Packet Capture

How OSPF fill the LSDB and keeps its link-state database up-to-date
Whenever a R1 received a new LSA, 1 > If that LSA isnt already in the LSDB of R1, it will add and sen
neighbors and then R1 run SPF to calculate new routing table and update that in R1 routing table. 2 >
If the seq. no is higher (or checksum no. is higher, or age set is max ager), it means this is the update
old LSA and we should help them, so R1 will send a LSU (which has th newer LSA of R1) to R2.

Each LSA has an aging timer of 30 minutes, so that each router recognizes it has the most current ver
(by increasing the seq no.) in a LSU. so when other router received it they process this LSA (follow ste
maximum age (max age) of 60 minutes, it would be discarded.

LSA Types
Type 1 - Router LSA - Each router within an area will generates a Type 1 LSA that contains (its active i
Generated by Drother to Advertise Intra Area routes (connected routes), Denoted by O, Flooded only w

Type 2 - Network LSA - Network LSA is created in multi access network like Broadcast or Non-broadcas
the segment that DR is adjacent to + DR own route.
Generated by DR to Advertise Intra Area routes, Denoted by O, Flooded only within the area (Not flood
Type 3 - Network Summary LSA - Generated by ABR to Advertise Inter Area routes, Denoted by O IA, F
Type 4 - ASBR Summary LSA - Generated by ABR, Advertise Inter Area routes or Redistributed routes,
Type 5 - External LSA - Generated by ASBR, Advertise Inter Area routes or external routes like redistrib
Flooded to all the Area except stub area, It contains routes
Type 6 - Multicast LSA
Type 7 - NSSA External LSA - Generated by ASBR, Advertise external routes like redistributed routes or
Type 8 - Opeque LSA, Type 9 - Opeque LSA, Type 10 - Opeque LSA, Type 11
OSPF Route Types - 1) Intra Area routes - O 2) Inter Area routes - 0 IA 3) External 1 & Externa 2 -
OSPF route selection according to preference - Intra-Area routes(0)> Inter-Area routes(0-IA)> External

What is the difference between Type-1 (E1) & Type-2 (E2) redistribution?
Type-2 is the default route type for routes learned via redistribution. The key with E2 routes is that the
Type-1 redistributed routes reflects cost to reach ASBR + redistributed cost. E1 = cost to reach ASBR +
OSPF Router Type - 1. Internal router - Are routers whose all interfaces belong to the same area.
2. Area border router - Connect one or more areas to the backbone and act as a gateway for inter-a
backbone, and maintain a separate LSDB for each of its connected areas. An ABR sends summary inf
summary information to the other areas.
3. Backbone router - Are routers with at least one interface attached to the backbone. An Internal Ro
area (0) is called Backbone Routers.
4. ASBR - Are gateways for external traffic like one ospf doamin traffic going to other routing domain
from other protocols like BGP / EIGRP. An ASBR can be Internal / Backbone / ABR router (Not Stub route

Area
Why we used Area in OSPF -
1 - Restrict the flooding domain of ASA - An area is a logical collection of OSPF networks, routers, and
maintain also grows large. Imagine a network with hundreds of routers and in case any changes happ
router updating it database, which increase the cpu and takes more time in spf path calculation(If you
delhi to mumbai). So to stop this we use Area, or to reduce the routing overhead and speed up the co
An area is a logical grouping of OSPF routers and links that effectively divide an OSPF domain into sub
topology outside of their area, meaning now each router will see the topology for the OSPF sub-domai
doamins), we reduce the size of routing table (save memory), fastest convergence (less CPU utilisatio

2- For Network scalability - ospf creates hi-erachy in the network by using area

Backbone Area - If you use OSPF without backbone area then only intra-area communication will be
Why all the are must be connected with Area 0, meaning if you want to go from Area 1 to 2 you
The backbone area (0) is responsible for summarizing the routing information (Topology) of each area
backbone areas cannot exchange packets directly.
If an ABR connecting two Area, It maintains two LSDB, one LSDB of Area 0 and another LSDB of area 1
id, age), Type 2 LSA or Net Link State (Interfaces ip of r1, Adv router id, age) and Type 3 LSA or Summ

Area Type - 1. Backbone Area (Area 0) 2.Non-backbone Area (Non Transit Area) 3.Stub Area 4. Not
Stub Area - A Stub area reduces the size of the routing table and the OSPF database for the routers w
areas. An ASBR learning external destinations will advertise those destinations by flooding External LS
LSAs may make up a large percentage of the LSAs in the databases of every router and Not every rou
large LSDB which can decrease the performance of routers. External LSA (Type 4 and Type 5 LSAs) are
Type 3 LSA is allowed in stub area.
Some restrictions of stub areas
i) one stub router will establish ospf adjacency with other stub router only, not with any other router in
ii) Virtual links cannot be configured within a stub area, nor transit a stub area.
iii) No router within a stub area can be an ASBR, because ASBRs produce type 5 LSAs, and type 5 LSA
iv)
Totally Stubby Area - is extension of Stub areas, Stub area save routers memory (reduce the LSDB s
type 5 and type 4 LSAs into an area. Totally Stubby Areas save more memory of router by blocking the
areas are not permitted into TSA however there is one exception that is A single type 3 LSA to adverti

The motivation behind NSSA is to allow OSPF stub areas to carry external routes. External routes are i
back into Type 5 LSA by ABR and injected into area 0.

Not-so-stubby Areas (NSSAs) - are a type of OSPF stub area that allows the injection of external ro
external routes to be advertised into the OSPF autonomous system or domain while retaining the char

The NSSA External LSA has a flag in its header known as the P-bit. The NSSA ASBR has the option of s
translate the type 7 LSA into a type 5 LSA and flood it throughout the other areas. If the P-bit is set to
outside of the NSSA.

NSSA router use Type 7 LSAs or accept Type 7 LSA to carry external information within the NSSA, The
4 and Type 5 LSAs are not allowed into Not-so-stubby Areas. Network Summary LSAs are allowed into

Totally-Not-So-Stubby Area -TNSSAs are an extension of NSSAs. Like NSSAs, Type 5 LSAs are not allowe
this, when a TNSSA is configured, the default route is injected into the area as a Type 7 LSA. TNSSAs h
Type 7 LSAs are converted into Type 5 LSAs at the NSSA ABR
They do not allow Network Summary LSAs
They do not allow External LSAs
The default route is injected as a Summary LSA
Unlike NSSA the ABR will generate a default route and advertise it into the TNSSA for all external route
OSPF Load Balancing
If a router running ospf find 4 path for singnle destination with same cost/metric, It will install all 4 rou
maximum of 16 path in the routing table for a single destination. How/ Commands
If we have 2 path with 10mb and 20mb link or interface and we want to send traffic via both link in os
equal after which ospf will send traffic via both link. How or commands

What is Route Redistribution?


Route redistribution is the process of taking routes learned via one routing protocol and injecting those
For example two companies might merge, one company is using Enhanced Interior Gateway Routing P
exchanging of routes between the two routing domains with a minimal amount of configuration and w

Explain OSPF Virtual Link?


OSPF requires the use of a backbone area (area 0) with each area connecting to area 0 through an AB
backbone area. In this case, OSPF uses virtual link to connect that regular area to backbone area virtu
neighbor relationship through that non-backbone area, even when separated by many other routers a
with that link inside area 0. The routers form a neighbor relationship, inside area 0, and flood LSAs ove

Router ID
Each router running ospf / bgp /eigrp routing protocol should have a unique router id, which can be de
If no router id is defined then any configured loopback address (highest) will become the router id , an
address of any active interface as a router id. Why loopback ip wins over active interface ip as a route
router crashes.
You can or cannot advertised router id in ospf, its all depend upon you, If you advertise then other rou

OSPF Authentication -
In ospf we can use 3 types of authentication, Auth 0 - Indicates no authentication, Auth 1 - indicates c
sh ip ospf int br To check ospf is enabled on which interface and
sh ip ospf neighbor To check all the neighbor of R1, Neighbor (router id, ip add
sh ip ospf adjacency To check ospf adjacency
sh ip route ospf To check ospf routes in the routing table

sh ip ospf events

clear ip ospf process To restart the ospf process, Use this command on R1 i) If you attach a

debug ip ospf adjacency To watch your ospf adjacency or To check where osp
debug ip ospf packet To check all the OSPF packet types (Hello,DBD,LSU,

sh ip ospf database To check R1 LSDB / ospf database / Topology; Displ


Seque
show ip ospf database database-summary To view count o
sh ip ospf database router To check Router LSA or Type 1 LSA
sh ip ospf database self-originate
sh ip ospf database network To check Network LSA or Type 2 LSA
sh ip ospf database summary To check Network summary LSA or Type 3 LSA
sh ip ospf database asbr-summary To check ASBR summary LSA or Type 4 LSA

(config-router) # network 1.0.0.0 0.255.255.255 area 0 To configure ospf


(config-if) # ip ospf 100 area 0 To configure o
(config-router) # passive-interface Gig0/1 To configure passi
(config-router) # shut To Disable o
(config-router) # area 10 virtual link 11.11.11.11 To configure virtua
(config-router) # area 1 stub To make area stub, we ha
(config-router)# area 1 stub no-summary To make area totally stubby
(config-router)# area 1 nssa To make area Not-So-S
(config-router)# area 1 nssa no-summary To make area Totally Not-So-S

R1(config)# router ospf 90 We can also use 100 / multiple process id on R1, but which network yo

OSPF configuration on R1 and R2 connected with 1.1.1.0/24 over serial link and R1 lan or fa0/0
r1(config)# router eigrp 100 (Enable eigrp service on the router) > no auto-summary > ne
interface of R1 with their subnet mask into eigrp domain that starts with 10.0.0.0/16 and 1.1.1.0/24
r2(config)# router ospf 10 > network 0.0.0.0 255.255.255.255 area 0 [Advertise any interface
R1) and also send ospf hello to establish neighbor from all interfaces] or
r2(config)# int s0/0 > ip eigrp 100 (To enable eigrp on a specific inetrface of a Router only)
r2(config) # int s0/0 > ip summary-address eigrp 100 172.16.0.0 255.255.248.0 - To configure
So R1 or other abc router will have a single summarize eigrp route instead of 8 different eigrp route
r1/r2(config-router)# passive-interface fa0/0 (Do not send ospf hello to establish NR from lan interf
a

Das könnte Ihnen auch gefallen