1 / 38

距離向量路由協定

距離向量路由協定. 王振生. 實驗的架構圖. 路由器介面設定 -porsche. porsche(config)# int erface f0/0 porsche(config-if)# ip addr ess 172.5.1.1 255.255.0.0 porsche(config-if)# no shut down porsche(config-if)# int erface s0/1/0 porsche(config-if)# ip addr ess 172.3.1.1 255.255.0.0 porsche(config-if)#clock rate 56000

Télécharger la présentation

距離向量路由協定

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 距離向量路由協定 王振生

  2. 實驗的架構圖

  3. 路由器介面設定-porsche • porsche(config)#interface f0/0 • porsche(config-if)#ipaddress 172.5.1.1 255.255.0.0 • porsche(config-if)#noshutdown • porsche(config-if)#interface s0/1/0 • porsche(config-if)#ipaddress 172.3.1.1 255.255.0.0 • porsche(config-if)#clock rate 56000 • porsche(config-if)#noshutdown • porsche(config-if)#interface s0/1/1 • porsche(config-if)#ipaddress 172.1.1.2 255.255.0.0 • porsche(config-if)#noshutdown

  4. 路由器介面設定-ferrari • ferrari(config)#interface f0/0 • ferrari(config-if)#ipaddress 172.2.1.1 255.255.0.0 • ferrari(config-if)#noshutdown • ferrari(config-if)#interface s0/1/0 • ferrari(config-if)#ipaddress 172.1.1.1 255.255.0.0 • ferrari(config-if)#clock rate 56000 • ferrari(config-if)#noshutdown

  5. 路由器介面設定-lotus • lotus(config)#interface f0/0 • lotus(config-if)#ipaddress 172.4.1.1 255.255.0.0 • lotus(config-if)#noshutdown • lotus(config-if)#interface s0/1/1 • lotus(config-if)#ipaddress 172.3.1.2 255.255.0.0 • lotus(config-if)#noshutdown

  6. 路由器靜態路由設定 • porsche(config)#ip route 172.2.0.0 255.255.0.0 s1 • porsche(config)#ip route 172.4.0.0 255.255.0.0 172.3.1.2 • ferrari(config)#ip route 172.3.0.0 255.255.0.0 s0 • ferrari(config)#ip route 172.4.0.0 255.255.0.0 s0 • ferrari(config)#ip route 172.5.0.0 255.255.0.0 s0 • lotus(config)#ip route 0.0.0.0 0.0.0.0 172.3.1.1

  7. 路由協定的分類(一) • 路由協定的一個主要分類方法,就是看它們究竟是在組織內部路由交換(IGP;Interior Gateway Protocol),還是在組織之間路由交換(EGP;External Gateway Protocol)。 • 外部路由協定是在不同組織的路由器之間路由交換。Border Gateway Protocol (BGP) 和 Exterior Gateway Protocol (EGP) 就是兩種外部路由協定。

  8. 路由協定的分類(二) • 鏈路狀態(Link State)協定在每一個路由器上建立一個拓撲資料庫;描述每一個路由器之間的鏈路及相鄰路由器的路由項目都包括在資料庫中,也就是說每個路由器都建立一個網絡的完整地圖。然後用一個Dijkstra Shortest Path First (SPF) 的演算法來處理資料庫,選擇一個最佳路徑放置到路由表中。詳細的拓撲訊息交換和Dijkstra演算法,使得鏈路狀態協議能夠避免循環和快速收斂。 • 距離向量(Distance Vector)路由協定是另外一種路由類型,也是CCNA2的重點

  9. 距離向量路由協定如何工作 • 藉由和直接相鄰路由器交換路由訊息,動態學習加入網路中全部子網路的路由。 • 如果到一個子網路有多條有效路由,那麼將最好的一條放到路由表中。 • 如果路由是從某個路由器交換得到,永遠相信該路由器對那條路由的更新 • 如果一條路由被從路由表中刪除,並且另外一個通過相鄰路由器的路由是有效的,那麼在路由表中加入新的路由。 • 盡快加入新的路由,或者用更好的路由替代失去的路由。從失去一個路由到找到一個替代路由的時間叫做收斂時間。 • 阻止循環路由(Routing Loop)。

  10. 內部IP路由協定和類型

  11. 內部IP路由協定和類型 • RIPv2包括了很多對RIPv1的擴充,例如和廣播路由相關的子網路遮罩被包含在路由更新中。遮罩使得路由器可以使用可變長度子網路路遮罩(VLSM)和路由組合(Aggregation)特性。

  12. 距離向量路由協定 • 一個使用RIP v1或IGRP距離向量路由協定具有下列的行為: • 路由器廣播直接相連的子網路。 • 路由更新在許多情況下是廣播(或群播),使得所有的相鄰路由器通過一個廣播(或群播)封包就能學習路由。 • 監聽路由更新,所以路由器能夠學習到新路由。 • 在更新中有一個路由的權值(metric)欄位。權值欄位顯示一個路由的好壞;如果到一個子網路有多個路由,較低權值的路由將被採用。

  13. 距離向量路由協定 • 路由更新中包括子網路和下個路由器位址欄位。 • 定期更新被預期從相鄰路由器在指定時間內被接收。如果在一定時間內沒有從鄰居中接收到更新,將刪除從鄰居學習到的路由。 • 一個從鄰居學習到的路由被假定通過那台路由器。 • 一個無效路由被給予一個「無窮大」距離。這個路由被認為是不可到達的。(RIP是16)

  14. 距離向量路由協定 Router A 162.11.5.0 1 S0 S1 162.11.9.0 162.11.8.0 S0 S0 Router C Router B E0 E0 162.11.7.0 162.11.10.0 路由器 A將路由訊息更新給直接相鄰的路由器 B

  15. 距離向量路由協定 收到Router A 的路由訊息後,Router B 的路由表

  16. 距離向量路由協定 Router A Routing Update 162.11.5.0 2 S0 S1 162.11.9.0 162.11.8.0 1 S0 S0 Router C Router B E0 E0 Routing Update 162.11.7.0 162.11.10.0 路由器 A將從路由器 C 得到的路由更新廣播給直接相鄰的路由器 B

  17. 距離向量路由協定 收到Router A 的路由更新後,Router B 的路由表

  18. 距離向量路由協定的問題 當存在多台路由器擁有到同一網路的路由存在時的可能問題

  19. 多個路由到同一子網路 Router A 162.11.5.0 1 S0 S1 162.11.9.0 162.11.8.0 S1 S0 S1 S0 Router C Router B 162.11.6.0 E0 2 E0 162.11.7.0 162.11.10.0 Router A and C Advertising to Router B

  20. 多個路由到同一子網路 Router B Receives Update From A Router B Receives Update From C

  21. Split-horizon, Hold-down, and Poison Reverse • 當使用距離向量路由協定時可能會因為無效的路由訊息而產生迴路。Split-horizon、Hold-down timer及 Poison Reverse是常用的防止迴路的方法。

  22. Counting to infinity Router G2 162.11.5.0 S0 S1 162.11.9.0 1 2 162.11.8.0 S0 S0 Routing Update Router G3 Router G1 E0 E0 162.11.7.0 162.11.10.0

  23. Counting to infinity Router G2 162.11.5.0 S0 S1 162.11.9.0 1 2 162.11.8.0 S0 S0 Routing Update Router G3 Router G1 E0 E0 162.11.7.0 162.11.10.0

  24. Use Hold-down timer to Solve Routing Loop • Hold-down timer 定義為: • 當學習到一個無效路由時,在hold-down時間內忽略到這個子網路的任何路由更新信息。

  25. Use Split-horizon to Solve Routing Loop Advertisements Passing on Serial Link for Subnet 162.11.7.0 S0 S0 Router C Router B 162.11.6.0 E0 1 1 E0 162.11.7.0 162.11.10.0

  26. Use Split-horizon to Solve Routing Loop Advertisements Passing on Serial Link for Subnet 162.11.7.0 S0 S0 Router C Router B 162.11.6.0 E0 1 1 E0 162.11.7.0 162.11.10.0

  27. Use Split-horizon to Solve Routing Loop • 當162.11.7.0不可到達時,Router B將向Router C發出162.11.7.0權值16的更新,但是同時Router C向Router B發出162.11.7.0權值2的更新。Router B會採用162.11.7.0通過Router C權值2的路由同時又向Router C發出162.11.7.0權值為3的更新,這樣將循環下去,直到B、C到162.11.7.0的權值都為16。

  28. Use Split-horizon to Solve Routing Loop • Split-horizon簡單的說就是從介面S更新的路由不向介面S廣播。 • Split-horizon解決的問題有時候叫做counting to infinity(計數到無窮大)。 • Poison Reverse是另外一種防止迴路和加速收斂的方法。 • 當一個距離向量路由協定注意到一個特定路由無效時,它有兩個選擇。一個是簡單的停止廣播那個子網路;另外一種是還廣播路由,但是使用一個無窮大的權值,標識那條路由是壞的。Poison Reverse使用第二種方式。

  29. Use Poison Reverseto Solve Routing Loop Advertisements Passing on Serial Link for Subnet 162.11.7.0 S0 S0 Router C Router B 162.11.6.0 E0 1 1 E0 162.11.7.0 162.11.10.0 With Poison Reverse

  30. Split-horizonand Poison Reverse Router D Router A 162.11.5.0 S0 S0 S1 S1 162.11.9.0 162.11.8.0 S0 S0 Router C Router B 162.11.6.0 E0 E0 162.11.7.0 162.11.10.0

  31. Flash (Trigger) Updates • Flash Updates,也就是觸發更新,加速了收斂的速度。當一個路由器注意到一個直接相連的子網路無效後,它立刻在它介面發出路由更新,而不是等待到更新的時間到。這使得無效路由快速廣播,和更快的計算hold-down時間,其他的相鄰居路由器也同樣做。

  32. RIP和IGRP比較

  33. RIP和IGRP的設定 IP RIP and IGRP Configuration Commands

  34. RIP和IGRP的設定 IP RIP and IGRP EXEC Commands

  35. RIP的設定 - porsche porsche(config)#router rip porsche(config-router)# network 172.1.0.0 porsche(config-router)# network 172.3.0.0 porsche(config-router)# network 172.5.0.0

  36. RIP的設定 - ferrari porsche(config)#router rip porsche(config-router)# network 172.1.0.0 porsche(config-router)# network 172.2.0.0

  37. RIP的設定 - lotus porsche(config)#router rip porsche(config-router)# network 172.3.0.0 porsche(config-router)# network 172.4.0.0

  38. IGRP的設定 interface ethernet 0 ip address 10.1.2.3 255.255.255.0 interface ethernet 1 ip address 172.16.1.1 255.255.255.0 interface ethernet 2 ip address 172.16.2.1 255.255.255.0 ! Router(config)#router igrp 10 Router(config-router)#network 10.0.0.0 Router(config-router)#network 172.16.0.0 Router(config-router)#passive-interface ethernet 2

More Related