Shunze 學園 >資訊設備專區 >Extreme & Enterasys > 《分享》動態路由筆記 哈囉,還沒有註冊或者登入。請你[註冊|登入]
« 上一篇主題 下一篇主題 » 顯示成列印模式 | 增加到我的最愛
發表新主題 發表回覆
作者
主題
shunze
工友伯伯


註冊日期: 2002 04
來自: 潮汐終止之地
文章: 2392

shunze 離線
《分享》動態路由筆記引用回覆 編輯/刪除文章 搜尋由  發表的其他文章 回報給版主 IP 位置 回此頁最上方

動態路由RIP、OSPF與IS-IS以前在上CCNA時,老師有說過。
但時間久了,且之後就沒碰過,幾乎忘光了!?
最近有case會用到multicasting,而multicast又會用到RIP/OSPF,
趕緊上網找找資料,複習一下~



動態路由主要分為 Distance VectorLink State 兩種路由演算法,
其中 Distance Vector 的代表性protocol為RIP,
Link State 的代表性protocol為OSPF與IS-IS。


Distance Vector 路由演算法與 Link State 路由演算法最大的不同,
在於 Link State 演算法只會傳遞少部分更新的路由資料,並把這樣的更新資料傳遞到各個路由器設備內;
Distance Vector 路由演算法則會傳遞整份的資料,而且只會傳遞給鄰近的路由器設備而已。

即使路由資料沒有任何的改變,Distance Vector 也會將整份路由資料發送出來,
而這裡所謂的整份路由資料,指的就是發送端路由器設備中 Routing Table 的完整資料,
當鄰近的路由器設備收到這整份路由資料後,會開始比較已知的路由路徑,並把有更新過的資料同步至本地端路由器設備中,
因為這種方式都會假設接收到的資料一定是比自己還要新的資料,所以這種方式通常也被稱為「謠言路由方式」(Routing by rumor)。
就是因為這樣類似「以訛傳訛」的運作方式,所以會產生很多問題。

為此,出現了採用 Distance Vector 路由演算法和 Distance Vector 路由演算法的混合式路由協定。
而Cisco專屬的EIGRP路由協定正是使用這種混合式的作法。


Link State 路由演算法則是通過主動測試鄰接節點的狀態,定期地將相鄰節點的狀態信息傳送給所有節點,
每個節點都有完整的網絡拓撲信息,然後計算到每個節點的最佳路徑。
oscillation problem 是因為存在多個交通指揮中心而造成的問題。

解決方法:盡可能地善用雙層式網路架構,並且切割成多個Area,
這樣每個 Area 中的網路就會比較簡單,同一個 Area 中的Link-State 路由演算法計算次數也會比較少,
而且 Routing Table 和各種資料庫中的資料筆數也會比較少,但前提是這樣的網路設計會有很多的限制。


參考資料
林向毅的部落格



♥順子老婆的網拍,請多關照~

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!


2015-08-07, 10:46 shunze 的個人資料 把 shunze 加入好友列表 發送Email給 shunze 瀏覽 shunze 的網站 MSN : shunze@gmail.com
shunze
工友伯伯


註冊日期: 2002 04
來自: 潮汐終止之地
文章: 2392

shunze 離線
《分享》RIP (Routing Information Protocol)引用回覆 編輯/刪除文章 搜尋由  發表的其他文章 回報給版主 IP 位置 回此頁最上方

*RIP is available on platforms with an Edge, Advanced Edge or Core license.

RIP的最大優勢在於簡單、易讀,容易部署,是一個行之多年的路由標準。

此外,除了上述傳遞時將整份路由資料發佈出來,佔用較大頻寬的缺點外,RIP還有以下限制,
包括來源與目的間的hop只能有 15 個,
以及路由的計算是以hop count,而不是link cost或delay。
同時在計算上是以平面架構來考量,沒有areas或Boundaries的概念。


RIP預設每30秒和鄰居更新一次,當全域路由拓撲改變時也會進行更新(triggered updates)。
鄰居在預設的180秒週期未進行資訊交換的話,會被視為此連線已不存在。

此外,RIP有 Split HorizonPoison Reverse 兩個機制防止路由表被毒化亂改。

RIP的路由表裏記錄著以下資訊。

  • IP address of the destination network
  • Metric (hop count) to the destination network
  • IP address of the next router
  • Timer that tracks the amount of time since the entry was last updated


RIP發展至今,共有兩個版本,V2向下相容於V1;V2相較於V1多了以下功能。
  • Variable-length subnet masks (VLSMs).
  • Support for next-hop addresses, which allows for optimization of routes in certain environments.
  • Multicasting.(這是順子在接下來的工作有可能用到的東西!)



設定RIP的指令很簡單,只要把對應的VLAN加入RIP,最後再啟用RIP即可,其指令如下。
configure rip add {vlan} [all | VLAN-Name]
enable rip
enable ipforwarding


從上述指令可以看出,RIP是base on VLAN,
若有需要將預設路由也透過RIP傳送出去,其指令如下。
enable rip originate-default {always} cost <COST>

參數always表示不論default route能否到達,都要透過RIP協定傳送給臨近RIP router。
Cost值範圍為1-15。
但RIP只有hop count,沒有cost,所以這個cost對應的是hop count;
若設定為15的話,已達RIP hop count最大值,無法傳給臨近RIP router...

將其它種類的路由導入RIP domain,其指令如下。
enable rip export [bgp | direct | e-bgp | i-bgp | ospf | ospf-extern1 | ospf-extern2 | ospf-inter | ospfintra | static | isis | isis-level-1| isis-level-1-external | isis-level-2 | isis-level-2-external ] [cost <number> {tag <number>} | policy <policy-name>]

停止將其它種類的路由導入RIP domain,其指令如下。
disable rip export [bgp | direct | e-bgp | i-bgp | ospf | ospf-extern1 | ospf-extern2 | ospf-inter | ospfintra | static | isis | isis-level-1| isis-level-1-external | isis-level-2| isis-level-2-external ]


查詢RIP的指令如下。
show rip interface


↑由Flags欄位可以查看哪些VLAN已加入RIP。

另外也可以透過查看routing table來看RIP的路由。
show iproute


↑若是從鄰居router所學到的RIP路由,則最前面Ori欄位會顯示小寫字母 r



♥順子老婆的網拍,請多關照~

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!


2015-08-07, 13:58 shunze 的個人資料 把 shunze 加入好友列表 發送Email給 shunze 瀏覽 shunze 的網站 MSN : shunze@gmail.com
shunze
工友伯伯


註冊日期: 2002 04
來自: 潮汐終止之地
文章: 2392

shunze 離線
《分享》RIP範例練習引用回覆 編輯/刪除文章 搜尋由  發表的其他文章 回報給版主 IP 位置 回此頁最上方

示範環境

  • 兩台Switch分別建立三個VLAN;V12/V13/V24與V22/V23/V24。
    V12為172.16.16.0/24網段(SwitchA)
    V13為172.16.17.0/24網段(SwitchA)
    V22為192.168.1.0/24網段(SwitchB)
    V23為192.168.2.0/24網段(SwitchB)
    V24為10.0.0.0/24網段(SwitchA,B串接)

  • SwitchA上Port 22為V12,Port 23為V13,Port 24為V24。
  • SwitchB上Port 22為V22,Port 23為V23,Port 24為V24。
  • SwitchB上有Default route 192.168.2.254



RIP設定
  1. 建立VLAN
    SwitchA
    configure vlan default delete ports all
    create vlan V12
    configure vlan V12 tag 12
    configure vlan V12 add ports 22
    configure vlan V12 ipaddress 172.16.16.1/24

    create vlan V13
    configure vlan V13 tag 13
    configure vlan V13 add ports 23
    configure vlan V13 ipaddress 172.16.17.1/24

    create vlan V24
    configure vlan V24 tag 24
    configure vlan V24 add ports 24
    configure vlan V24 ipaddress 10.0.0.1/30

    SwitchB
    configure vlan default delete ports all
    create vlan V22
    configure vlan V22 tag 22
    configure vlan V22 add ports 22
    configure vlan V22 ipaddress 192.168.1.1/24

    create vlan V23
    configure vlan V23 tag 23
    configure vlan V23 add ports 23
    configure vlan V23 ipaddress 192.168.2.1/24

    create vlan V24
    configure vlan V24 tag 24
    configure vlan V24 add ports 24
    configure vlan V24 ipaddress 10.0.0.2/30


  2. 啟用Routing
    enable ipforwarding

    兩邊switch都要啟用routing,另外在SwitchB上啟用default route指向192.168.2.254。
    configure iproute add default 192.168.2.254


  3. 架設RIP
    SwitchA
    configure rip add vlan all
    enable rip

    RouterB
    configure rip add vlan all
    enable rip
    enable rip originate-default always cost 3


狀態查看
show rip interface


於SwitchB上查看,可發現V22、V23與V24均已加入RIP table中。

show iproute


於SwitchA上檢視路由,發現由SwitchB所傳過來的路由192.168.1.0/24與192.168.2.0/24已加入路由表;
此外default route也指向SwitchB上的192.168.2.254,Metric由設定的cost 3再加1變成4,符合預期~



♥順子老婆的網拍,請多關照~

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!


2015-08-08, 23:23 shunze 的個人資料 把 shunze 加入好友列表 發送Email給 shunze 瀏覽 shunze 的網站 MSN : shunze@gmail.com
shunze
工友伯伯


註冊日期: 2002 04
來自: 潮汐終止之地
文章: 2392

shunze 離線
《分享》OSPF (Open Shortest Path First)引用回覆 編輯/刪除文章 搜尋由  發表的其他文章 回報給版主 IP 位置 回此頁最上方

*OSPF is available on platforms with an Advanced Edge or Core license.

OSPF為Link State Protocol,Link是指router向外連結的介面,而State是指此router介面的特性及和其相鄰router間之關係,
其中最重要的,就是兩個 router 間的距離。

在OSPF中,router間可以互相傳送資訊給對方,
每個router在收集了足夠資訊之後,就可以建立起自己的「網路地圖」(Routing Table),進而知道要往哪個方向走才到得了目的地。

兩router間的距離我們可用Metric (或Cost)來量度,而Metric的定義如下,

也就是說,頻寬越大的線路其Metric越小,可視為距離越近。
去到目的網段時,若有多條路由可選,也會因Metric的不同,而在routing上有著先後順序的不同。

相較於RIP純粹以hop conut來計算,且每條路徑不能超過15顆router的限制,
OSPF有著較複雜的計算、具有較大彈性,可適用於大型網路。
而這一整個大型網路可以把它看成一個domain,也就是OSPF概念中的自治系統(Autonomous System)。

但在較大型的自治系統中,其計算的速度會因要交換的訊息過多,導致收斂太慢。
為解決此問題,OSPF採用hierarchical(層級式)的網路架構,
先依照網路本身的區域性,將之劃分為幾個較小的Area,在Area內部router會交換彼此間完整訊息,
而多個Area之間再採用summarization(摘要)的方式來交換資訊。

Area內部的router叫做IR(Internal Router)
而位在區域網路邊界,負責與其它區域網路交換摘要訊息的router叫做ABR(Area Border Router)

在OSPF的定義中,Area又分為以下幾種不同類型。

  • Backbone Area骨幹區域
    在OSPF網路中,只要有大於一個的Area,就必需有一個Backbone Area,每一個Area的ABR於此區域交換其它區域的摘要。
    在XOS的規範上,Backbone Area預設就存在,且無法被刪除或修改;Backbone Area被定義為Area 0.0.0.0

  • Stub Area末稍區域
    Stub Area是一種最末端的區域,只和一個Area連接(Backbone Area)。
    外部的路由訊息無法傳入此Stub Area,用以減少router的資源消耗。
    建立Stub Area的指令如下。
    create ospf area <area-identifier>
    configure ospf area <area-identifier> stub [summary | nosummary] stub-default-cost <cost>

  • Not-So-Stubby-Areas次末稍區域
    次末稍區域跟末稍區域很類似,增加了以下能力,
    包括外部路由訊息可以傳入此區域,得到的外部路由訊息可再傳遞給其它區域(包含Backbone Area)。
    建立NSSA的指令如下。
    create ospf area <area-identifier>
    configure ospf area <area-identifier> nssa [summary | nosummary] stub-default-cost <cost> {translate}

  • Normal Area一般區域
    非Backbone Area、Stub Area及NSSA的區域。
    建立Normal Area的指令如下。(其實就是不再加上stub/nssa等參數)
    create ospf area <area-identifier>


在架構OSPF時,可依以下9個步驟來進行。
  1. Attach the physical connections.
  2. Create the VLANS.
  3. Configure the VLAN IP address
  4. Add ports, tagged or untagged.
  5. Enable IP Forwarding.
  6. Configure the RouterID for each router. (Recommended)
    configure ospf routerid [automatic | <router-identifier>]
    若採用automatic,則switch上最大的IP address會被拿來做為router-identifier使用。

  7. Create OSPF Areas as required.
    (Area 0.0.0.0 is already pre-configured on the switch.)
    create ospf area <area-identifier>
    configure ospf area <area-identifier> {Parameter}

  8. Configure the VLANs for OSPF and associate them with the correct area.
    configure ospf add vlan [all | <VLAN-Name>] area <area-identifier> {link-type [Auto | Broadcast | Point-to-point | Passive]}

  9. Enable OSPF globally on the switch.
    enable ospf


我們回過頭來看看Area與VLAN間的link-type
configure ospf add vlan [all | <VLAN-Name>] area <area-identifier> {link-type [Auto | Broadcast | Point-to-point | Passive]}


為什麼要特別來看link-type
那是因為Advanced Edge license下的router只支援4個active OSPF VLAN interface (neighbor);
但若是passive interface,則沒有限制。
所以Advanced Edge license的router可透過 Passive 的方式來設定哪些VLAN要加入OSPF,而哪些又不要;
這樣可以滅少佔用OSPF neighbor的數量。


若要修改OSPF交換訊息的各種時間參數,可用以下指令。(非標準的設定會影響OSPF的可靠性,請勿隨意修改!)
configure ospf area <area-identifier> timer <retransmit-interval> <transit-delay> <hello-interval> <dead-interval> {<wait-timer-interval>}
configure ospf virtual-link <router-identifier> <area-identifier> timer <retransmit-interval> <transitdelay> <hello-interval> <dead-interval>
configure ospf vlan [<vlan-name> | all] timer <retransmit-interval> <transit-delay> <hello-interval> <dead-interval> {<wait-timer-interval>}
retransmit-interval預設值是5
transit-delay預設值是1
hello-interval預設值是10
dead-interval預設值是40
wait-timer-interval沒有預設值。若要設定,需大於hello-interval。


跟RIP一樣,OSPF也可以將其它種類的路由導入OSPF,其指令如下。
enable ospf export [bgp | direct | e-bgp | i-bgp | rip | static | isis | isis-level-1 | isis-level-1-external | isis-level-2 | isis-level-2-external] [cost <cost> type [ase-type-1 | ase-type-2] {tag <number>} | <policy-map>]

停止將其它種類的路由導入OSPF,其指令如下。
disable ospf export [bgp | direct | e-bgp | i-bgp | rip | static | isis | isis-level-1| isis-level-1-external | isis-level-2 | isis-level-2-external]


查看OSPF Area配置,其指令如下。
show ospf area {detail | <area-identifier>}

查看OSPF Interface配置,其指令如下。
show ospf interfaces {vlan <vlan-name> | area <area-identifier> | enabled}

查看link-state database,其指令如下。
show ospf lsdb {detail | stats} {area [<area-identifier> | all]} {{lstype} [<lstype> | all]} {lsid <lsidaddress>{<lsid-mask>}} {routerid <routerid-address> {<routerid-mask>}} {interface[[<ipaddress>{<ip-mask>} | <ipNetmask>] | vlan <vlan-name>]}



參考資料
路由協定及網路架構研析
How to Configure OSPF Extreme Network Switch



♥順子老婆的網拍,請多關照~

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!


2015-08-27, 16:09 shunze 的個人資料 把 shunze 加入好友列表 發送Email給 shunze 瀏覽 shunze 的網站 MSN : shunze@gmail.com
  « 上一篇主題 下一篇主題 »
發表新主題 發表回覆
跳到:

Powered by: Burning Board 1.1.1 2001 WoltLab GbR