本章路線圖 / Learning path
- 1. What is a MANET?|甚麼是流動自組網絡?
- 2. Use a graph to reason|利用圖模型推理
- 3. First approach: flooding|第一個方法:泛洪
- 4. Proactive versus reactive|主動式與按需式
- 5. DSDV: maintain a route table|DSDV:維護路由表
- 6. AODV: discover a route|AODV:尋找路徑
- 7. DSR: carry the route|DSR:封包攜帶路徑
開啟補充筆記、計算與自測 / Open additional notes, calculations and quiz →
1. What is a MANET?|甚麼是流動自組網絡?
A MANET consists of mobile devices communicating without relying on fixed base stations for the ad hoc network. Each node can generate data and relay data for another node. Multi-hop means a packet reaches its destination through intermediate nodes.
MANET 由流動裝置組成,自組網絡本身不依賴固定基地站。每個節點既可產生資料,也可替其他節點轉發。多跳是指封包經中間節點到達目的地。
If A can reach B, B can reach C, but A cannot reach C directly, A→B→C is a two-hop route. / 若 A 可到 B、B 可到 C,但 A 不能直接到 C,A→B→C 就是兩跳路徑。
2. Use a graph to reason|利用圖模型推理
Draw each device as a vertex and each usable link as an edge. A route is a sequence of adjacent vertices; its hop count is the number of edges, not vertices. When nodes move, links appear or disappear. If a route breaks and no alternative path exists, the graph may be partitioned.
每個裝置畫成頂點,可用鏈路畫成邊。路徑是一連串相鄰頂點;跳數是邊數,不是頂點數。節點移動時鏈路可出現或消失;若路徑中斷且沒有替代路,圖可能分割。
For A→B→C→D, there are 4 nodes but 3 hops. If B−C disappears and no alternative exists, A and D become disconnected. / A→B→C→D 有 4 個節點、3 跳;若 B−C 消失且沒有替代路,A 與 D 不再連通。
3. First approach: flooding|第一個方法:泛洪
Source A broadcasts a uniquely identified message. Every node that sees it for the first time forwards it once; duplicate copies are discarded. It needs no precomputed route, but many simultaneous broadcasts can cause contention and collisions. Reducing rebroadcasts can save bandwidth but may reduce reachability.
來源 A 廣播帶唯一識別的訊息。每個節點首次收到時轉發一次,之後丟棄重複副本。它不需要預先計算路徑,但同時大量廣播會造成競爭及碰撞。減少重播可節省頻寬,但可能降低覆蓋。
In an exam, explain the sequence “many redundant transmissions → contention/collisions → lost packets and further overhead”, then name a remedy such as selected relays. / 考試應寫「大量冗餘傳送→競爭與碰撞→封包遺失及額外開銷」,再提出例如選定中繼的改善方法。
4. Proactive versus reactive|主動式與按需式
A proactive protocol keeps routes in advance, so a route can be immediately available, but periodic control traffic consumes resources even when unused. A reactive protocol starts discovery when required, reducing idle maintenance but adding delay and potentially flooding route requests.
主動式協定預先維護路徑,因此可能立即有路可用,但即使不使用也會產生週期控制流量。按需式協定在需要時才搜尋,可減少閒置維護,但增加首次延遲,並可能需要廣播路由請求。
AODV and DSR are reactive; DSDV is proactive. State the trade-off rather than claiming either class is always superior. / AODV、DSR 是按需式;DSDV 是主動式。要說明取捨,不能說其中一類永遠較好。
5. DSDV: maintain a route table|DSDV:維護路由表
Each node records destination, next hop, hop count and destination sequence number. Advertisements share route information. When comparing candidate entries, use the newer destination sequence number first; when equally fresh, a smaller metric is preferred under the protocol rules. Updates spread when topology changes.
每個節點記錄目的地、下一跳、跳數和目的地序號。通告用於分享路由資訊。比較候選項時先選較新的目的地序號;同樣新時按協定規則選較小度量。拓撲改變時更新資訊會傳播。
Route X has sequence 10, 2 hops; route Y has sequence 12, 4 hops. Y is newer and is preferred under the freshness-first rule despite more hops. / X 序號 10、2 跳;Y 序號 12、4 跳。新鮮度優先時選較新的 Y,雖然跳數較多。
6. AODV: discover a route|AODV:尋找路徑
Step 1: S broadcasts a route request RREQ when it lacks a route. Step 2: receivers discard duplicate requests and record a reverse route toward S. Step 3: D or an eligible node returns RREP. Step 4: intermediate nodes create forward next-hop entries as RREP travels back. Step 5: data follows those entries; a break triggers route error handling.
步驟 1:S 沒有路徑時廣播 RREQ。步驟 2:接收者丟棄重複請求並記錄往 S 的反向路徑。步驟 3:D 或合資格節點回覆 RREP。步驟 4:RREP 返回時,中間節點建立正向下一跳。步驟 5:資料依表轉發;斷鏈時處理路由錯誤。
For S→A→B→D, the RREP returns D→B→A→S, establishing entries toward D along the way. / 若路徑是 S→A→B→D,RREP 沿 D→B→A→S 返回,沿途建立往 D 的表項。
7. DSR: carry the route|DSR:封包攜帶路徑
DSR is also reactive, but its request records the traversed path and its data packet contains the source route. Each intermediate node reads the next hop from that route. A cache may avoid another discovery, but the route can become stale and the header grows with path length. AODV instead normally forwards using next-hop table entries.
DSR 也是按需式,但請求會記錄所經路徑,資料封包攜帶來源路徑。中間節點按路徑讀取下一跳。快取可避免再次搜尋,但路徑可能過時,標頭亦隨路徑增長。AODV 一般使用下一跳表轉發。
Exam comparison: AODV has a smaller route header on long data paths; DSR can cache and reuse complete routes. Both require handling breaks. / 考試比較:長路徑的 AODV 資料標頭通常較小;DSR 可快取及重用完整路徑;兩者均要處理斷鏈。