OSPF

OSPF Protokolü ( Open Shortest Path First ) ,geniş networklerde kullanılan ve sınırsız hop atlayan bir protokoldür.Classless çalışır ve tam anlamıyla bir Link State protokolüdür.Her 10 saniyede bir komşusuna hello paketi atar,Dead İntervali 40 saniyedir.OSPF protokolünün Administrative Distance ı default ta 110 dur.Dijkstra algoritmasını kullanarak hedefe gidecek en kısa yolu bulmaya çalışır.Dijkstra algoritması Hollandalı matematikçi ve bilgisayarcı Edsger DİJKSTRA olan kişi tarafından bulunduğu için bu adı almıştır.Dijkstra algoritması router ID yi kullanır.Router ID:Aktif interface deki en büyük ıp adıdır.Yanlış yapılan topolojilerde DR değerini gereken router a verebilmek için sanal interface i (loopback) uygularız ve area bağlantısı direk olan router ın ip değerini loopback le yükseltiriz.Eğer priority değerini sıfır verirsek o ip hiç bir zaman DR seçilemez.Sanal interface i tek tanıyan OSPF protokolüdür.

Tüm router ların bağlanabilmesi için oluşturulan ilk area ya backbone area denir ve area 0 olarak isimlendirilir.Her zaman area 0 yapılması gereken bir konfigurasyondur ve bütün router lar area 0 a bağlanmak zorundadırlar.
İki farklı IP kullanır; 224.0.0.5 tüm router ların haberleşmek için kullandığı multicast ip dir.224.0.0.6 DR (Designated Router)router ların haberleştiği ıp dir.OSPF işlemini başlatmak için kullanacağımız numara ise Process ID dir.1 ile 65535 arasında bir nuamara verilir,sıfır verilemez.Process ID lerin eşit olmasına gerek yoktur,herkes ayrı bir process ıd numarası kullanabilir.OSPF (
Open Shortest Path First ) sistemi haberleşmek için senkrosisazyon(eşit zamanlı)ister.

OSPF Paketleri

1- LSA =Advertisment: Tüm topoloji bilgilerinin bulunduğu pakettir.
2- LSR =Request : Topoloji bilgilerini istediğimiz pakettir.
3- LSU =Uptade : Herhangi bir değişiklik olduğunda kullandığımız pakettir.
4- LS Ack =Acknowledgement LSU veya LSA ya karşı atılan bilgi paketidir.

OSPF AŞAMALARI
1-DOWN
2-INİT
3-TWO-WAY
4-EXSTART(Master router seçimi) Hello paketini ilk kimin atacağını belirleriz.Router ID ye göre seçeriz.Hangi router ın ID si büyükse onu seçeriz.
5-EXCHANGE : DBD paketlerinin atıldığı yerdir.
6-LOADİNG :LSA paketlerini attığımız aşamadır.
7-FULL OSPF tamamdır.

Aşagıda yapmış oldugum OSPF konfigurasyon örnegi bulunmaktadır.

 istanbul#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route
 
Gateway of last resort is not set
 
C    192.168.1.0 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
 istanbul#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
istanbul(config)#router ospf 500
istanbul(config-router)#net 192.168.1.1 0.0.0.255 area 0
istanbul(config-router)#net 10.1.1.0 0.0.0.255 area 0
istanbul(config-router)#net 100.1.1.0 0.0.0.255 area 0
istanbul(config-router)#exit
istanbul(config)#exit
 istanbul#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route
 
Gateway of last resort is not set
 
C    192.168.1.0 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     172.168.0.0/24 is subnetted, 1 subnets
O       172.168.1.0 [110/64] via 10.1.1.2, 00:00:54, Serial0/0
     100.0.0.0/24 is subnetted, 1 subnets
O       100.1.1.0 [110/64] via 100.1.1.1, 00:00:39, Serial0/0
O    192.165.1.0 [110/192] via 10.1.1.2, 00:00:49, Serial0/0
 
 
 
 
 
 
Gateway of last resort is not set
 
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     172.168.0.0/24 is subnetted, 1 subnets
C       172.168.1.0 is directly connected, FastEthernet0/0
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Serial0/1

 

 izmir#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
izmir(config)#router ospf 600
izmir(config-router)#network 172.168.1.1 0.0.0.255 area 0
izmir(config-router)#network 10.1.1.0 0.0.0.255 area 0
izmir(config-router)#network 100.1.1.0 0.0.0.255 area 0
izmir(config-router)#exit
izmir(config)#exit
 izmir#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route
 
Gateway of last resort is not set
 
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     172.168.0.0/24 is subnetted, 1 subnets
C       172.168.1.0 is directly connected, FastEthernet0/0
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Serial0/1
O    192.168.1.0 [110/64] via 10.1.1.1, 00:02:13, Serial0/0
O    192.165.1.0 [110/64] via 100.1.1.2, 00:00:08, Serial0/1
 
 
Gateway of last resort is not set
 
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Serial0/0
C    192.165.1.0 is directly connected, FastEthernet0/0

 kayseri#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
kayseri(config)#router ospf 1000
kayseri(config-router)#network 192.165.1.1 0.0.0.255 area 0
kayseri(config-router)#network 100.1.1.0 0.0.0.255 area 0
kayseri(config-router)#network 10.1.1.0 0.0.0.255 area 0
kayseri(config-router)#exit
kayseri(config)#exit
kayseri#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route
 
Gateway of last resort is not set
 
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Serial0/0
C    192.165.1.0 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
O       10.1.1.0 [110/128] via 100.1.1.1, 00:00:19, Serial0/0
     172.168.0.0/24 is subnetted, 1 subnets
O       172.168.1.0 [110/64] via 100.1.1.1, 00:00:19, Serial0/0

 

Kaynak:Korhan Aydın(ciscotr.com)
Son Güncelleme ( Cumartesi, 13 Eylül 2008 )