1 點對點(p2p)網絡
PPP或HDLC鏈路默認爲P2P,或者ospf network point-to-point配置爲點對點鏈路,如圖所示(上面爲物理拓撲圖,下面爲OSPF有向邏輯圖)ide
2 傳輸網絡(TransNet)oop
Transnet類型網絡是指多路訪問(至少兩個節點),流量能夠通過TransNet傳遞,好比MA網絡。如圖所示(上面爲物理拓撲圖,下面爲OSPF有向邏輯圖)spa
R1到N1的cost爲10,但N1到R1的cost爲0,這樣引入了虛節點N1但沒有引入額外的cost,不影響路由計算。3d
3 末節網絡(StubNet)router
StubNet表明一個網絡,附在路由節點上,不表示任何鏈接關係,其實就是路由實節點上的網絡,路由器上的loopback接口的網絡,secondary地址網絡、無鄰居的以太網接口網絡及點到點鏈路上每一個節點(路由器)所連的網絡。blog
4 OSPF有向圖舉例接口
如圖:ip
1. 在R1和R2的P2P鏈路上,兩端的IP地址配置了不一樣子網,不影響OSPF創建,由於P2P不關注鏈路IP子網,所以OSPF能正常創建。路由
2. R1到R2爲P2P,開銷爲8,R1到本身的loopback1.1.1.1爲StubNet,開銷爲0,R1到直連1.1.1.0/24爲StubNet開銷爲8。
3. 同理R2到本身的loop2.2.2.2爲StubNet,開銷爲0, R2到直連1.1.1.0/26爲StubNet開銷爲8。
4. R1到1.1.1.0/26的開銷爲16
5. R2,R3,R4在TransNet上,R2到23.23.23.0的開銷爲10,其餘同理。
4.1 模擬器實驗:
R1與R2與爲P2P,R2/R3/R4互聯爲Broadcast.
4.1.1 配置
R1的配置
ospf 1 router-id 1.1.1.1
area 0.0.0.0
#
interface GigabitEthernet0/0/0
ip address 12.12.12.1 255.255.255.0
ospf cost 8
ospf network-type p2p
ospf enable 1 area 0.0.0.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ospf enable 1 area 0.0.0.0
R2的配置
ospf 1 router-id 2.2.2.2
area 0.0.0.0
#
interface GigabitEthernet0/0/0
ip address 12.12.12.2 255.255.255.192
ospf cost 8
ospf network-type p2p
ospf enable 1 area 0.0.0.0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
ospf enable 1 area 0.0.0.0
#
interface GigabitEthernet0/0/1
ospf cost 10
ip address 23.23.23.2 255.255.255.0
ospf enable 1 area 0.0.0.0
#
R3的配置
ospf 1 router-id 3.3.3.3
area 0.0.0.0
#
interface GigabitEthernet0/0/0
ip address 23.23.23.3 255.255.255.0
ospf cost 15
ospf enable 1 area 0.0.0.0
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
ospf enable 1 area 0.0.0.0
#
R4的配置
ospf 1 router-id 4.4.4.4
area 0.0.0.0
#
interface GigabitEthernet0/0/0
ip address 23.23.23.4 255.255.255.0
ospf cost 30
ospf enable 1 area 0.0.0.0
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
ospf enable 1 area 0.0.0.0
#
4.1.2 OSPF路由查看
R1,到本地的loopback1.1.1.1開銷是0,到P2P鏈路的本端開銷是8,到P2P的對端開銷是16(兩倍鏈路開銷).
R2同理到P2P鏈路本端的開銷是8,到對端的開銷是16(兩倍鏈路開銷)
R3,R4以下