




已閱讀5頁,還剩52頁未讀, 繼續(xù)免費閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
計算機系 鄒瑞源,計算機網(wǎng)絡(luò)互聯(lián)技術(shù),ospf簡介,ospf是一種典型的鏈路狀態(tài)路由協(xié)議。采用ospf的路由器彼此交換并保存整個網(wǎng)絡(luò)的鏈路信息,從而掌握全網(wǎng)的拓撲結(jié)構(gòu),獨立計算路由。 ospf作為一種內(nèi)部網(wǎng)關(guān)協(xié)議(interior gateway protocol,igp),用于在同一個自治域(as)中的路由器之間發(fā)布路由信息。區(qū)別于距離矢量協(xié)議(rip),ospf具有支持大型網(wǎng)絡(luò)、路由收斂快、占用網(wǎng)絡(luò)資源少等優(yōu)點,在目前應(yīng)用的路由協(xié)議中占有相當重要的地位。,ospf簡介,開放的國際標準 shortest path first (spf最短路徑優(yōu)先) 算法 鏈路狀態(tài)路由協(xié)議,ospf 概述,通過交換hello數(shù)據(jù)包來創(chuàng)建鄰居關(guān)系 以傳播lsa( link-state advertisements )代替路由表更新. 鏈路(link):路由器接口 狀態(tài)(state):描述接口以及它與鄰居路由器的關(guān)系 lsas 泛洪到區(qū)域中的所有ospf路由器,而不僅僅是直連路由器 收集由ospf路由器生成的所有l(wèi)sa以創(chuàng)建ospf鏈路狀態(tài)數(shù)據(jù)庫. 使用spf算法計算到每個目的地的最短距離,并將其置于路由表中.,ospf術(shù)語,shortest path first algorithm,將每臺路由器放置在樹的根節(jié)點,并根據(jù)累計開銷計算到達每個目的地的最短路徑 開銷(cost) = 參考帶寬(108)/接口帶寬 (bps),ospf特點詳介,ospfopen shortest path first 使用cost(成本)作為其路由度量值,其默認成本基于介質(zhì)的傳輸帶寬來度量,ospf特點詳介,三大優(yōu)越性: 1、收斂時間快 2、支持vlsm和cidr 3、網(wǎng)絡(luò)的擴展性強 對跳數(shù)基本沒有限制,對于跳數(shù)過多的網(wǎng)絡(luò)可通過層次化的設(shè)計,將達的ospf網(wǎng)絡(luò)化分成小的、易管理的ospf域,ospf 層級示列,區(qū)域和自治系統(tǒng) 盡量減少路由表條目 使拓撲變化僅影響本區(qū)域內(nèi)部,ospf數(shù)據(jù)包類型(ospf packet types),ospf 的五種分組類型,類型1,問候(hello)分組。 類型2,數(shù)據(jù)庫描述(database description)分組。 類型3,鏈路狀態(tài)請求(link state request)分組。 類型4,鏈路狀態(tài)更新(link state update)分組, 用洪泛法對全網(wǎng)更新鏈路狀態(tài)。 類型5,鏈路狀態(tài)確認(link state acknowledgment) 分組。,ospf操作,1. 建立鄰接關(guān)系 2. 必要的進行dr選舉 3. 發(fā)現(xiàn)路由 4. 選擇相應(yīng)的路由 5. 維護路由信息,建立鄰接關(guān)系,*標記的在鄰居路由器上必須匹配,ospf網(wǎng)絡(luò)類型,frame relay x.25,廣播broadcast multiaccess,非廣播nonbroadcast multiaccess,點到點point-to-point,點到多點point-to-multipoint,點到點鏈路(point-to-point links),不進行dr選舉 ospf自動檢測這種接口類型,廣播型多路訪問網(wǎng)絡(luò),進行dr選舉 鄰居只與dr和dbr形成鄰接關(guān)系,必要時進行dr選舉,dr與bdr的選舉取決于路由器的優(yōu)先級 可通過接口配置模式 ip ospf priority 命令修改該路由器的優(yōu)先級 如果優(yōu)先級相同,則比較router id。 router id: 默認值:ospf過程啟動時活動接口上的最高ip地址 可以使用環(huán)回接口覆蓋:環(huán)回接口的最高ip地址(次優(yōu)先) 可以使用router-id命令手動設(shè)置(最優(yōu)先),選舉dr和bdr,最高接口優(yōu)先級的路由器被選成dr 最高路由器id的路由器被選舉成dr dr選舉不具有搶占性,建立雙向通信,建立雙向通信,建立雙向通信,建立雙向通信,查找網(wǎng)絡(luò)路由,查找網(wǎng)絡(luò)路由,增加鏈路狀態(tài)條目,增加鏈路狀態(tài)條目,增加鏈路狀態(tài)條目,維護路由信息,路由器用224.0.0.6通知dr,維護路由信息,dr利用組播地址224.0.0.5通知其它路由器,維護路由信息,維護路由信息,配置單區(qū)域的ospf,router(config-router)# network address wildcard-mask area area-id,將網(wǎng)絡(luò)分配到ospf 區(qū)域,router(config)# router ospf process-id,將 ospf定義為 ip 路由協(xié)議,ospf 配置示列,ospf配置實例,驗證ospf 配置,router# show ip protocols,檢驗是否已配置ospf,router# show ip route,顯示路由器所學習到的所有路由,router# show ip route codes: i - igrp derived, r - rip derived, o - ospf derived, c - connected, s - static, e - egp derived, b - bgp derived, e2 - ospf external type 2 route, n1 - ospf nssa external type 1 route, n2 - ospf nssa external type 2 route gateway of last resort is 10.119.254.240 to network 10.140.0.0 o e2 10.110.0.0 160/5 via 10.119.254.6, 0:01:00, ethernet2 e 10.67.10.0 200/128 via 10.119.254.244, 0:02:22, ethernet2 o e2 10.68.132.0 160/5 via 10.119.254.6, 0:00:59, ethernet2 o e2 10.130.0.0 160/5 via 10.119.254.6, 0:00:59, ethernet2 e 10.128.0.0 200/128 via 10.119.254.244, 0:02:22, ethernet2 . . .,router# show ip ospf,驗證ospf 配置,顯示ospf路由器、計時器和統(tǒng)計信息,router# show ip ospf routing process “ospf 1“ with id 172.16.6.1 start time: 00:38:41.540, time elapsed: 00:00:25.860 supports only single tos(tos0) routes supports opaque lsa supports link-local signaling (lls) supports area transit capability router is not originating router-lsas with maximum metric initial spf schedule delay 5000 msecs area backbone(0) (inactive) number of interfaces in this area is 1 area has no authentication spf algorithm last executed 00:00:07.368 ago spf algorithm executed 1 times ,router# show ip ospf interface,驗證ospf 配置,顯示區(qū)域 id 和鄰接信息,router# show ip ospf interface ethernet 0 ethernet 0 is up, line protocol is up internet address 192.168.254.202, mask 255.255.255.0, area 0.0.0.0 as 201, router id 192.168.99.1, network type broadcast, cost: 10 transmit delay is 1 sec, state other, priority 1 designated router id 192.168.254.10, interface address 192.168.254.10 backup designated router id 192.168.254.28, interface addr 192.168.254.28 timer intervals configured, hello 10, dead 60, wait 40, retransmit 5 hello due in 0:00:05 neighbor count is 8, adjacent neighbor count is 2 adjacent with neighbor 192.168.254.28 (backup designated router) adjacent with neighbor 192.168.254.10 (designated router),驗證ospf 配置,router# show ip ospf neighbor,顯示每個接口上的ospf鄰居信息,router# show ip ospf neighbor id pri state dead time address interface 10.199.199.137 1 full/dr 0:00:31 192.168.80.37 ethernet0 172.16.48.1 1 full/drother 0:00:33 172.16.48.1 fddi0 172.16.48.200 1 full/drother 0:00:33 172.16.48.200 fddi0 10.199.199.137 5 full/dr 0:00:33 172.16.48.189 fddi0,驗證ospf 配置,router# show ip ospf neighbor 10.199.199.137 neighbor 10.199.199.137, interface address 192.168.80.37 in the area 0.0.0.0 via interface ethernet0 neighbor priority is 1, state is full options 2 dead timer due in 0:00:32 link state retransmission due in 0:00:04 neighbor 10.199.199.137, interface address 172.16.48.189 in the area 0.0.0.0 via interface fddi0 neighbor priority is 5, state is full options 2 dead timer due in 0:00:32 link state retransmission due in 0:00:03 router# show ip ospf neighbor detail neighbor 192.168.5.2, interface address 10.225.200.28 in the area 0 via interface gigabitethernet1/0/0 neighbor priority is 1, state is full, 6 state changes dr is 10.225.200.28 bdr is 10.225.200.30 options is 0x42 lls options is 0x1 (lr), last oob-resync 00:03:08 ago dead timer due in 00:00:36 neighbor is up for 00:09:46 index 1/1, retransmission queue length 0, number of retransmission 1 first 0x0(0)/0x0(0) next 0x0(0)/0x0(0) last retransmission scan length is 1, maximum is 1 last retransmission scan time is 0 msec, maximum is 0 msec,ospf 調(diào)試命令,router# debug ip ospf events ospf:hello with invalid timers on interface ethernet0 hello interval received 10 configured 10 net mask received 255.255.255.0 configured 255.255.255.0 dead interval received 40 configured 30 router# debug ip ospf packet ospf: rcv. v:2 t:1 l:48 rid:200.0.0.117 aid:0.0.0.0 chk:6ab2 aut:0 auk: router# debug ip ospf packet ospf: rcv. v:2 t:1 l:48 rid:200.0.0.116 aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x0,實驗環(huán)境,a,b,192.168.1.64/27,192.168.1.32/27,192.168.1.104/29,ospf的基本配置,router_a#config terminal router_a(config)# router_a(config)#router ospf 1 /啟動ospf協(xié)議,其進程為1 router_a(config-router)#network 192.168.1.32 0.0.0.31 area 0 router_a(config-router)#network 192.168.1.64 0.0.0.31 area 0,router_b#config terminal router_b(config)# router_b(config)#router ospf 1 /啟動ospf協(xié)議,其進程為1 router_b(config-router)#network 192.168.1.32 0.0.0.31 area 0 router_b(config-router)#network 192.168.1.104 0.0.0.7 area 0,ospf身份驗證,ospf支持以下幾種類型的身份驗證: -空(無身份驗證) -明文(或簡單)口令身份驗證 -md5身份驗證 路由器生成并檢查每個ospf數(shù)據(jù)包。 路由器驗證接收到的每個路由更新數(shù)據(jù)包的來源。 配置“密鑰”(口令):每個參與的鄰居都必須配置相同的密鑰。,配置ospf身份驗證,步驟一:設(shè)定驗證的口令 1、設(shè)定明文口令 router(config-if)# ip ospf authentication-key password 分配用于鄰居路由器的口令(最長8個字符) 2、設(shè)定md5加密的口令 router(config-if)# ip ospf message-digest-key id md5 password 分配用于鄰居路由器的口令(md5加密,最長16個字符),配置ospf身份驗證,步驟二:啟用ospf身份驗證并指定驗證類型 方法1:在接口上直接指定(12.0版本以上提供) router(config-if)# ip ospf authentication message-digest | null 指定接口的身份驗證類型 message-digest :md5加密口令 null :空口令 方法2:整個ospf 區(qū)域指定驗證類型 router(config-router)# area area-id authentication message-digest message-digest :md5加密口令,使用ospf配置負載均衡,ospf負載均衡 路徑必須為等價路徑 默認情況下,最多可在路由表中加入4條等價路徑 通過更改配置,最多可以配置16條等價路徑 -(config-router)# maximum-paths 可更改鏈路的開銷以確保路徑等價進行負載均衡 -(config-if)# ip ospf cost ,修改鏈路成本,router# router#config terminal router(config)#interface f0/0 router(config-if)#ip ospf cost number /number為1到65535之間的值,internet互聯(lián)網(wǎng),局域網(wǎng): 內(nèi)部使用ospf 接入互聯(lián)網(wǎng)使用默認路由 內(nèi)部計算機如何使用默認路由?,?,默認路由,默認路由發(fā)布到ospf區(qū)域,將默認路由發(fā)布到ospf區(qū)域中,使用以下命令: router(config-router)# default-information originate,課堂作業(yè),e0,e0,s0,s0,思考題(questions),1. ospf是一種典型的_路由協(xié)議。 2. ospf路由協(xié)議的管理距離是_。 3. ospf路由協(xié)議采用_作為度量標準。 4. ospf路由器利用_算法,獨立地計算出到達任意目的地的路由。 5. 默認情況下,快速以太網(wǎng)的開銷是_。 6. ospf將網(wǎng)絡(luò)劃分為四種類型:_、_、_、_。 7. ethernet的hello interval為_秒,dead interval為_秒。 8. nbma網(wǎng)絡(luò)的hello int
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 衛(wèi)生招聘知識試題及答案
- 通信原理高校試題及答案
- 透析相關(guān)試題及答案
- 2025年水利基礎(chǔ)設(shè)施勞務(wù)分包協(xié)議
- 2025年技術(shù)監(jiān)管合作協(xié)議
- 人力資源管理中的風險防控機制
- 如何應(yīng)對股東糾紛與治理問題
- 2025年交易市場協(xié)議規(guī)范
- 企業(yè)法律權(quán)益保護風險管理評估
- 2025年城鄉(xiāng)基礎(chǔ)設(shè)施改善策劃合作協(xié)議
- 高苯丙氨酸(苯丙酮尿癥)血癥課件
- pet拉伸薄膜工藝
- 離心泵的結(jié)構(gòu)與工作原理通用課件
- 畜牧業(yè)的生物安全與疫情防控
- 關(guān)于皮膚科藥物知識講座
- 【小學心理健康教育分析國內(nèi)外文獻綜述4100字】
- 2025年日歷日程表含農(nóng)歷可打印
- 銳意進取開拓新市場
- 焊接施工流程圖
- 2023年貴州省六盤水市鐘山區(qū)數(shù)學六下期末達標檢測試題含解析
- 2023年黑龍江省高校畢業(yè)生三支一扶計劃招募考試真題
評論
0/150
提交評論