Sunday, April 12, 2009

Happy Passover!

Hey everyone, I wanted to wish you all happy passover! enjoy your holiday, We didnt update the blog with any new articles lately, that's due to the reason we are a bit busy right now and we gotta take care for couple other things :) (such life? heh)

Just wanted to let you know we are still here, and we got some plans for the coming week. The next article would be about VTP - Virtual Trunking Protocol.
We've got few people asking how they can register to the exam, I'll add an article about how to do that soon. stay patient :)

Also we are about to publish the second QuestionPack of CCNA-Certified! be sure if you answer those, you will be ready to answer any question you might receive on your exam :)
In addition, the questions about the STP article are about to be published either in the next few days..

You are still welcome to comments your questions, feedbacks, compliments and complains (hope there are none) :)

So, alot of updates are planned for the next few weeks.. stay tuned!


CCNA-Certified Staff.


Read more...

Thursday, April 2, 2009

The OSPF Process

So, whats OSPF?
OSPF stands for Open Shortest Path First, its a link-state routing protocol. Link-state protocols don't exchange routers or metrics, they exchange the state of the links
and their costs (metric) associated with those links (LSA packets).
A link is actually a router's interface, and the state is few parameters regarding that link, including: IP of the interface, subnet mask, type of network (Ethernet / NBMA Frame-Relay..), the routers that connected to that link.

Each router collects link-state information (like routing updates in RIP) to construct its own loop-free paths to every network in the same area.

OSPF is based on the Dijkstra Shortest Path First (SPF) algorithm (a complex mathematical calculations) and it builds 'SPF tree' which is how the router see's the network topology from its point-of-view, or an overall picture of all the routers in the same area.

Link-state protocols remove the limit of hop count in distance vector protocols (RIP). actually, OSPF got infinite hop count!

As networks grows real fast, routing protocols must be able to react quickly to topology changes, and converge the network quick so there will be almost no interruptions.



The Advantages of OSPF:
- Supports VLSM / CIDR
- Infinite hop count
- Allows scalability
- Multi-Vendor (can work on NON-Cisco routers)
- Minimize routing updates

- Converge REAL quick
- Allow authentication
- Using areas

What & Why are we using areas in OSPF?
Areas actually allows you to use an hierarchical network design, seperate your whole network into smaller groups, which makes network convergence faster and delimit network instability to a single area in your network, prevent it from propagating to the whole production network.


For example, if the 'Sales Dept.' having a problem with their router, and they are in their own area, it won't affect 'Marketing Dept.' at all.

The topology of an area is unkown outside of the area, this decreases the routing overhead and
saves uneeded SPF calculations by the router and additional bandwidth.
Each area has its own link-state database, its own picture of the inside area network.

- What is the backbone area? this area known as area 0 (or 0.0.0.0) and thats the core of the OSPF network. All other areas are connected to it (might be more than a single link to the backbone), and routing between different areas must go through the backbone area routers.

OSPF router types:
Backbone Router: the backbone router provides connectivity between areas. routers that belongs only to area 0, are the backbone routers.

Area Border Router (ABR): those are multiple areas routers. routers that are connected to more than 1 area.
Internal Router: routers that are not connected directly to the backbone. means, routers that are part of only single area, and this area is different than 0 (the backbone area).
Autonomous System Boundary Router: router that is also connected to external AS or routing domain.

Lets demonstrate it:


All the interfaces are in area 0, besides the link that marked in RED, which is part of area 1
So, all the routers expect router 1 are backbone routers - because they are connected only to the backbone!
Router 1 is a ABR, becuase it connected to more than a single area. its like a border between the backbone to area 1.

How do our routers become adjacencies?
For OSPF routers to become adjacencies and exchange LSA's they must agree upon two parameters.
both the subnet address and the subnet mask must match. if they dont match, the routers won't become adjacencies
they also must match hello & dead timers. both values has to be the same on both routers.
- pay attention: ospf defaults hello & dead timers is different on ethernet and nbma networks. make sure the network type is configured correctly.
after routers become neighbors, they start to exchange LSA's. the Hello packets are used to maintain that neighborship.
Also, if there is a OSPF authentication requirement, the password also must match ofcourse.

Whats RID?
The router ID is a number that uniquely identifies the router. The highest
IP address on an active interface is chosen by default, unless a loopback interface or the router
ID is configured; This identification is important in establishing and troubleshooting neighbor relationships.
So, the RID will be chosen by: The RouterID command, if not set -> by the highest loopback interface ip address, and last by the highest physical interface ip.

Why loopback interface is stronger than regular interface? and what is it anyway?
The main reason loopbacks are used in OSPF is - reliability.
OSPF is more reliable with loopback interfaces configured because loopback interfaces are always active and cannot be in a down state like a physical interfaces can.
Also it ease the process of troubleshoting and debugging the network when there is a problem.
It is nuch easier recongize and figure which router is 2.2.2.2 rather than 192.168.1.10.. right?

Whats costs and how they are calculated?
Costs is the metric of OSPF. like we got hopcount on RIP, OSPF uses cost to measure the link priority. the lower the cost, the shorter the destination is.
Costs are figured by the interface bandwidth, so the higher the bandwidth will be - the lower the cost of it.
The SPF algorithm runs a series of calculations with each router as the root of the SPF tree, and finds the shortest path to each destination on the area.
LSA's are flooded all over the network to make sure all the routers have the same SPF database, the same topology picture of the network.
Although all the routers have the same database, each router has its own view of the network, and his routing table built upon that.
Here's an example of how costs are calculated:



Router1 cost to router0 is 10 (10Mbps link), and Router0 cost to Router3 is 64 (T1 link).
so in the routing table of router1, we will see an entry to reach router3 with the cost of 10+64 = 74. thats the cost of R1 to reach R3.



The DR / BDR election process!
a DR (Designated Router) and BDR (Backup Designated Router) routers are elected on multi-access networks, such as Ethernet, Frame-Relay, etc..
Its job is to maintain the OSPF database and inform everyone when there is a topology change.
Instead of everyone will forward LSA's to everyone, and when there is a change everyone will update the rest of the routers in the network about that change,
OSPF chose one router to do that. This saves alot of bandwidth.

It works like that:
a DR router is elected, all other routers sends LSA's only to him (and to the BDR ofcourse). when there is a topology change (lets say one of the routers link went down)
that router will send LSA only to the DR router! (the destination IP is a multicast IP that accepted only at the DR router) then, the DR router will process the LSA
and send an update to the rest of the network, with the changes occured.
The BDR is actually the backup of the DR. so if the DR goes down, there won't be a new election that will take time and resources and OSPF gives a fast solution to that issue,
by 'promoting' the BDR to the DR state. OSPF then making a new election, only to the BDR this time.
The election won by the router with the highest priority, and if priority is equal the RID is used as a tiebreaker.
- Note that there will NOT be a DR election on point-to-point networks!

EXAMPLE:



In our example we will choose Router0 as the DR router of the network.
The network includes 2 Ethernet links - to Router1 and Router2
and 1 Point-To-Point link to Router3
We've 2 options to do so,
The first option is to simply use the "ip ospf priority" and set it to a higher number than the default (which is 1), and this will affect the DR election process to elect
Router0 as our DR for the 2 Ethernet segments (links to R1 and R2). NOTE that on the link to R3 there won't be any DR or BDR! Routers are equal on that link and they
exchange LSA's with each other, just like they both are the DR.
The second option we have is to set Router0 with the highest IP address. so, we will configure all the routers with loopback IP's now:
Router0:

Router0(config)#int loopback0

%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
Router0(config-if)#ip address 11.1.1.1 255.255.255.255

I used an host subnet mask of 255.255.255.255 because we actually got only one device on that 'network'. you can use whatever subnet mask you want,
but remember using 255.255.255.255 actually saves you IP's.

Router1:

Router1(config)#int loopback0

%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
Router1(config-if)#ip address 2.2.2.2 255.255.255.255

Router2:

Router2(config)#int loopback0

%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
Router2(config-if)#ip address 3.3.3.3 255.255.255.255


Now if all the priorites are equal on all the routers (if you didnt change it, they are equal by default) - the DR will be elected upon the highest IP.
Router1's IP is the highest 11.1.1.1 is bigger than 2.2.2.2 or 3.3.3.3, so Router1 will be elected as the DR on both Ethernet network segments!

Lets sum the OSPF PROCESS:
- HELLO packets are sent between neighbors to form adjancy
- Routers verifing conditions that must match [hello and dead timers + subnet network + mask]
- DR election starts ONLY on Broadcast & NBMA networks. In case of PTP networks there won't be a DR election.
- to influence the DR election - use the "ip ospf priority" on the interface level
- On NBMA (Frame-Relay) remember the "neighbor " needs to be typed on the router's prompt (config-rtr).
- OSPF outside area learned routes aren't calculated for cost by SPF, and their metric is [110/1]

Read more...