OSPF Network type
OSPF chạy trên nhiều loại media khác nhau . Đối với OSPF , media có thể chia ra làm 4 loại
sau :
- Multiaccess media
- Point-to-point media
- Nonbroadcast multi-access media
- Demand on Circuits
Multiacces media :
Multiaccess media bao gồm các loại sau : Ethernet ,Fast Ethernet , Gigabit Ethernet ,
FDDI , TokenRing , …. Đối với các media loại này , default OSPF sẽ gán network type là
broadcast . Do vậy , ta không cần cấu hình gì thêm , ví dụ :
3 Router A , B , C chạy OSPF trên mạng multi-access , OSPF sẽ default gán default network
là broadcast . Qua trình bầu chọn DR , BDR sẽ diễn ra . DR/BDR sẽ lắng nghe địa chỉ
multicast 224.0.0.6 ( all DR routers ) , các router khác sẽ lắng nghe địa chỉ multicast 224.0.0.5
( all DR others ) . Router A có priority cao nhất à DR . Router B, C có cùng priority nên sẽ
xét tiếp highest ip address . Router B có ip address cao hơn à BDR .
Point-to-point media :
Bao gồm các loại sau : HDLC và PPP encapsultation links , FrameRelay/ATM point-to-point
subinterfaces ,…Tương tự OSPF sẽ default gán cho các media loại này là point-to-point . Quá
trinh bầu chọn DR/BDR sẽ không cần thiết nữa . Các router sẽ trao đổi thông tin qua địa chỉ
multicast 224.0.0.5
Nonbroadcast Multiaccess media :
Bao gồm các loại sau : FrameRelay , X25 , ATM , SMDS . Default , OSPF sẽ gán media loại
này là nonbroadcast . Đối với media loại này , tuy rằng hỗ trợ kết nối nhiều router lại với nhau
nhưng không hỗ trợ broadcast . à OSPF không tự động detect ra được neighbors . è ta phải
cấu hình làm sao đó cho OSPF mô phỏng NBMA thành các loại network model khác mà nó có
thể hoạt động được như :
- Broadcast model
- Point-to-point model
- Point-to-multipoint model
Broadcast model : đối với model này môi trường broadcast được mô phỏng . DR và BDR
được bầu chọn . Có 2 phương pháp để mô phỏng cho model này :
- Cấu hình bằng câu lệnh : ip ospf network-type broadcast
- Cấu hình chỉ ra neighbor cho các router bang câu lệnh : neighbor
Ex1 : ip ospf network-type broadcast .
Đây là một topology broadcast multi-access . Broadcast model chỉ làm việc khi các router đấu
nối full-meshed với nhau . OSPF giả sử topology trên được đấu nối full-meshed . Và để thực
hiện điều này , sử dụng câu lệnh :”ip ospf network-type broadcast”. Câu lệnh này phải được
thực hiện trên tất cả router’s frame relay interfaces .
RouterA#
interface serial 0
encapsualtion frame-relay
ip ospf network-type broadcast
Đối với dạng network khong full-meshed trên , chạy broadcast model là not
recommened .
Ex2 : thực hiện câu lệnh neighbor command .
RouterA#
interface serial 0
encapsulation frame-relay
ip address 141.108.1.1 255.255.255.0
ip ospf priority 10
!
router ospf 1
neighbor 141.108.1.2
neighbor 141.108.1.3
neighbor 141.108.1.4
neighbor 141.108.1.5
Đối với dạng network khong full-meshed trên , chạy broadcast model là not recommened .
Ex2 : thực hiện câu lệnh neighbor command .
RouterA#
interface serial 0
encapsulation frame-relay
ip address 141.108.1.1 255.255.255.0
ip ospf priority 10
!
router ospf 1
neighbor 141.108.1.2
neighbor 141.108.1.3
neighbor 141.108.1.4
neighbor 141.108.1.5
Router A cấu hình với priority cao nhất để luôn là DR . HUB router nên làm DR .
Chú ý : trong trường hợp framerelay chạy full-meshed , nếu ta để inverse ARP chạy thì không
cần cấu hình thêm câu lệnh nào cả . Tại sao ? vì inverse ARP sẽ học được tất cả các DLCI và
đưa vào interface của mình nên OSPF lúc này hoạt động như là một mạng broadcast multi-
access .
Nếu ta map static dlci bằng câu lênh frame-relay map thì lúc này ta phải chỉ ra neighbor cho
routers vì lúc này OSPF hoạt động dưới dạng non-broadcast.
Point-to-point model :
Nếu model này được sử dụng , mỗi PVC sẽ là point-to-point subinterfaces , ứng với mỗi
subinterfaces 1 subnet sẽ được dùng . Không cần cấu hình câu lệnh network type , OSPF sẽ
default gán mỗi subinterface network type là point-to-point .
Cái lợi của model này là Virtual circuit cost có thể được config trên mỗi subinterface . Bất lợi
ở chỗ tiêu tốn không gian địa chỉ trên mỗi point-to-point subinterface và kích thước của packet
LSA gửi bởi router A trở nên khá lớn do phải mang theo Type 3 stublink cho mỗi
subinterfaces .
RouterA#
Interface Serial 0.1 point-to-point
ip address 141.108.1.1 255.255.255.252
!
Interface Serial 0.2 point-to-point
ip address 141.108.1.5 255.255.255.252
Cấu hình tương tự cho các router khác .
Ex :
Router A
interface Loopback0
ip address 1.1.1.1 255.255.255.255
interface Serial0/0
bandwidth 64
no ip address
encapsulation frame-relay
!
interface Serial0/0.1 point-to-point
ip address 10.1.1.1 255.255.255.252
frame-relay interface-dlci 101
!
interface Serial0/0.2 point-to-point
ip address 10.1.1.5 255.255.255.252
frame-relay interface-dlci 102
!
router ospf 1
network 1.1.1.1 0.0.0.0 area 1
network 10.1.1.0 0.0.0.3 area 0
network 10.1.1.4 0.0.0.3 area 0
Router B
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Serial0
ip address 10.1.1.2 255.255.255.252
encapsulation frame-relay
bandwidth 64
frame-relay map ip 10.1.1.1 110 broadcast
no frame-relay inverse-arp
frame-relay lmi-type ansi
!
router ospf 1
network 2.2.2.2 0.0.0.0 area 2
network 10.1.1.0 0.0.0.3 area 0
Router C
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Serial0
bandwidth 64
no ip address
encapsulation frame-relay
no frame-relay inverse-arp
!
interface Serial0.1 point-to-point
ip address 10.1.1.6 255.255.255.252
frame-relay interface-dlci 120
!
router ospf 1
network 3.3.3.3 0.0.0.0 area 3
network 10.1.1.4 0.0.0.3 area 0
Neighbor relationship giữa A và C được thiết lập . Có gì bất ổn ở cấu hình này khiến B và A không thể
trở thành neighbor . Ta nhận thấy trong cấu hình của router B không hề cấu hình ở dạng sub point-to-
point interface à default OSPF sẽ cư xử như là dạng nonbroadcast à mismatch hello .
Ta phải chuyển câu hình của B sao cho OSPF cư xử với interface của Router B như là mạng point-to-
point :
Router B
interface Serial0
ip address 10.1.1.2 255.255.255.252
encapsulation frame-relay
ip ospf network point-to-point
bandwidth 64
frame-relay map ip 10.1.1.1 110 broadcast
no frame-relay inverse-arp
frame-relay lmi-type ansi
Hoặc có thể cấu hình B với câu lênh neighbor
Router B
interface Serial0
ip address 10.1.1.2 255.255.255.252
encapsulation frame-relay
frame-relay map ip 10.1.1.1 110 broadcast
no frame-relay inverse-arp
frame-relay lmi-type ansi
!
router ospf 1
network 2.2.2.2 0.0.0.0 area 2
network 10.1.1.0 0.0.0.3 area 0
neighbor 10.1.1.1
Tuy đã chỉ ra cho router B biết neighbor của nó nhưng Router A cho rằng network type nối với routerB
là point-to-point , trong khi đó RouterB lại cho rằng network type nối với routerA lại là nonbroadcast à
hello mismatch . Do đó ta phải cấu hình ip ospf hello interval sao cho match về mặt timer trong toàn
area .
Point-to-multipoint model : được phân ra làm 2 dạng
- point-to-multipoint ( broadcast )
- point-to-multipoint nonbroadcast
Point-to-multipoint ( broadcast ) :
Point-to-multipoint là một tập hợp gồm các point-to-point links , trong đó các router
nhận ra được neighbors của nó nhưng không diễn ra quá trình bầu chọn DR/BDR . Điều
lợi ở đây là nó không cần thêm các traffic dùng để lựa chọn DR/BDR , cũng như không
cần thêm các virtual circuit cần được thiết lập . Point-to-multipoint commonly được sử
dụng trong partial mesh hoặc star topology .
( HÌNH B )
RouterA#
interface serial 0
encapsulation frame-relay
ip address 172.16.0.129 255.255.255.128
ip ospf network-type point-to-multipoint
Cấu hình trên tất cả router B , C , D .
Chú ý nếu bạn cấu hình ở dạng mix ( cả multipoint và point-to-point ) Ví dụ :
Xem hình A .
Router A
interface Serial0/0
ip address 10.1.1.1 255.255.255.248
encapsulation frame-relay
ip ospf network point-to-multipoint
Router B
interface Serial0
ip address 10.1.1.2 255.255.255.248
encapsulation frame-relay
ip ospf network point-to-point
Router C
interface Serial0
ip address 10.1.1.3 255.255.255.248
encapsulation frame-relay
ip ospf network point-to-point
Đối với router A , network type la multipoint nên hello interval=30s . Đối với B , C network type lại là
point-to-point nên hello interval =10s . Do đó dẫn đến hello mismatch . à phải cấu hình lại hello
interval sao cho match .
Router A
interface Serial0/0
ip address 10.1.1.1 255.255.255.248
encapsulation frame-relay
ip ospf network point-to-multipoint
ip ospf hello-interval 30
Router B
interface Serial0
ip address 10.1.1.2 255.255.255.248
encapsulation frame-relay