Chapterبەش 4 · Lectureوانە 4.2
Distance Vector and Link State: Bellman-Ford and Dijkstraمەودای ئاڕاستە و بارودۆخی بەستەر: بێڵمان-فۆرد و دایکسترا
The two big families of routing protocols: distance vector (a distance and a direction from the neighbours, whole tables sent regularly, the Bellman-Ford rule, worked rounds) and link state (hellos, flooded LSAs, one shared LSDB, Dijkstra’s algorithm run by every router), with Dijkstra step by step, the home-to-school exercise, a comparison table, and where path vector (BGP) and advanced distance vector (EIGRP) fit.
دوو بنەماڵە گەورەکەی : (مەودا و ئاڕاستە لە دراوسێکانەوە، ناردنی خشتەی تەواو بە ماوەیی، یاسای بێڵمان-فۆرد، نموونەی گەڕ بە گەڕ) و (سڵاو، بڵاوکردنەوەی ، یەک هاوبەش، کە هەموو جێبەجێی دەکات)، لەگەڵ دایکسترا هەنگاو بە هەنگاو، ڕاهێنانی ماڵ بۆ قوتابخانە، خشتەی بەراورد و شوێنی () و ().
What you will learnچی فێر دەبیت
- Explain what a distance-vector router knows and sends, and trace distance-vector tables as they fill.
- Apply the Bellman-Ford rule round by round.
- Describe the three steps of a link-state protocol (hellos, flooding LSAs into one LSDB, SPF).
- Run Dijkstra’s algorithm by hand on a weighted graph, including ties.
- Compare distance vector and link state, and place path vector (BGP) and advanced distance vector (EIGRP).
- ڕوون بکەیتەوە چی دەزانێت و چی دەنێرێت و پڕبوونەوەی خشتەکانی شوێن بکەویت.
- یاسای بێڵمان-فۆرد گەڕ بە گەڕ جێبەجێ بکەیت.
- سێ هەنگاوەکەی وەسف بکەیت (سڵاو، بڵاوکردنەوەی بۆ یەک ، SPF).
- بە دەست لەسەر جێبەجێ بکەیت، لەگەڵ یەکسانییەکان.
- و بەراورد بکەیت و () و () لە شوێنی خۆیان دابنێیت.
Two ways to learn a networkدوو ڕێگا بۆ ناسینی ڕایەڵەیەک
Almost every interior routing protocol belongs to one of two families, and they differ in what a router knows. In a distance-vector protocol a router knows only what its neighbours tell it: for each network, how far it is and which way to send. In a link-state protocol every router learns the whole map of its area and works out the routes itself. The first is like asking for directions at every junction; the second is like everyone holding the same city map.
نزیکەی هەموو ناوخۆیی سەر بە یەکێک لە دوو بنەماڵەن و جیاوازییان لەوەدایە کە چی دەزانێت. لە ـدا تەنیا ئەوە دەزانێت کە دراوسێکانی پێی دەڵێن: بۆ هەر ، چەند دوورە و بە کام لادا بنێرێت. لە ـدا هەموو نەخشەی تەواوی ناوچەکەی فێر دەبێت و خۆی ڕێگەکان حیساب دەکات. یەکەمیان وەک پرسیارکردنی ڕێگایە لە هەموو چواڕیانێک؛ دووەمیان وەک ئەوەیە کە هەمووان هەمان نەخشەی شاریان پێ بێت.
OSPF and IS-IS are link-state protocols; RIP is the classic distance-vector protocol. The family tree with EIGRP and BGP is in Routing protocols.
و IS-IS ؛ نموونەی کلاسیکی . داری بنەماڵەکە لەگەڵ و لە پرۆتۆکۆڵەکانی ڕێدۆزیدایە.
Distance vector: a distance and a directionمەودای ئاڕاستە: مەودایەک و ئاڕاستەیەک
The name says it. For every network a distance-vector router keeps a distance — the cost of the path, measured for example in hops or in delay — and a vector, a direction: the next hop and the interface towards it. It does not have a map; it asks its neighbours for directions and believes their answers. Every router sends its whole routing table to its neighbours at regular times — RIP every 30 seconds — even when nothing has changed, and builds its own table from what they send. The news moves through the network one neighbour at a time.
ناوەکە خۆی دەیڵێت. بۆ هەر مەودایەک هەڵدەگرێت — تێچووی ڕێگاکە، بۆ نموونە بە یان بە دەپێورێت — و ئاڕاستەیەک (vector): و ئەو بەرەو ئەو دەچێت. نەخشەی نییە؛ داوای ڕێنمایی لە دراوسێکانی دەکات و باوەڕ بە وەڵامەکانیان دەکات. هەموو لە کاتی دیاریکراودا هەموو بۆ دراوسێکانی دەنێرێت — هەموو 30 چرکە جارێک — تەنانەت ئەگەر هیچ شتێک نەگۆڕابێت. خشتەی خۆیشی لەوەی ئەوان دەینێرن دروست دەکات. هەواڵ دراوسێ بە دراوسێ بە دەڕوات.
Distance vector: a distance and a directionمەودای ئاڕاستە: مەودایەک و ئاڕاستەیەک
Watching the tables fillسەیرکردنی پڕبوونەوەی خشتەکان
Three routers A – B – C sit between four networks, 10.1.0.0/16 to 10.4.0.0/16. At the start each router knows only its two connected networks (0 hops). After the first exchange every router has heard its neighbours’ networks and added them with the neighbour’s hops + 1. After the second exchange news from two routers away arrives: for example B tells C “I know 10.1, 10.2 and 10.3”, and C adds 10.1 (2 hops) and keeps 10.2 (1 hop). Now every table lists all four networks — the network has converged.
سێ ، A – B – C، لە نێوان چوار ، 10.1.0.0/16 تا 10.4.0.0/16. لە سەرەتادا هەر تەنیا دوو بەستراوەکەی خۆی دەزانێت (0 ). دوای یەکەم ئاڵوگۆڕ، هەموو دراوسێکانی بیستووە و بە ژمارەی دراوسێ + 1 زیادی کردوون. دوای ئاڵوگۆڕی دووەم هەواڵی دوو دوورتر دەگات: بۆ نموونە B بە C دەڵێت «10.1، 10.2 و 10.3 دەناسم» و C ڕێگەی 10.1 (2 ) زیاد دەکات و 10.2 (1 ) دەهێڵێتەوە. ئێستا هەموو خشتەیەک هەر چوار تێدایە — گەیشتووەتە .


The Bellman-Ford ruleیاسای بێڵمان-فۆرد
Distance-vector protocols compute their routes with the Bellman-Ford algorithm, a piece of mathematics from the 1950s (Richard Bellman and Lester Ford). Its rule is short: my distance to a network is the smallest value of “a neighbour’s distance to it + the cost of my link to that neighbour”. Each router applies it to the tables its neighbours send, again and again, until nothing changes.
ڕێگەکانیان بە حیساب دەکەن، کە بیرۆکەیەکی بیرکاریی دەیەی 1950ـە (ڕیچارد بێڵمان و لێستەر فۆرد). یاساکەی کورتە: مەودای من بۆ بچووکترین بەهای «مەودای دراوسێیەک بۆی + تێچووی بەستەرەکەم بۆ ئەو دراوسێیە»ـیە. هەر ئەم یاسایە بەسەر ئەو خشتانەدا جێبەجێ دەکات کە دراوسێکانی دەینێرن، دووپاتە و دووپاتە، تا هیچ شتێک ناگۆڕێت.
D_x(y) is router x’s distance to network y; c(x,v) is the cost of the link from x to neighbour v; D_v(y) is what v reports.
D_x(y) مەودای x بۆ yـیە؛ c(x,v) تێچووی بەستەری x بۆ دراوسێی vـیە؛ D_v(y) ئەوەیە کە v ڕایدەگەیەنێت.
You want to reach the bazaar. One neighbour says “from my house it is 4 minutes”, and his house is 3 minutes from yours: 7 minutes that way. Another says “10 minutes from me”, and she lives 1 minute away: 11 minutes. You take the smaller total, 7, and go the first neighbour’s way. That is the whole Bellman-Ford rule.
دەتەوێت بگەیتە بازاڕ. دراوسێیەک دەڵێت «لە ماڵی منەوە 4 خولەکە» و ماڵەکەی 3 خولەک لە ماڵی تۆوە دوورە: بەو ڕێیەدا 7 خولەک. دراوسێیەکی تر دەڵێت «لە منەوە 10 خولەکە» و ئەو 1 خولەک دوورە: 11 خولەک. کۆ بچووکترەکە، 7، هەڵدەبژێریت و بە ڕێی دراوسێی یەکەمدا دەڕۆیت. ئەمە هەموو یاسای بێڵمان-فۆردە.
Where the analogy stops workingسنووری ئەم نموونەیە
The neighbours’ answers may be out of date — that is how distance vector gets its loops.
لەوانەیە وەڵامی دراوسێکان کۆن بێت — بەم شێوەیە تووشی دەبێت.
The Bellman-Ford ruleیاسای بێڵمان-فۆرد
Bellman-Ford step by stepبێڵمان-فۆرد هەنگاو بە هەنگاو
Here is a small network with link costs: A–B 5, A–C 2, C–B 1 and B–D 4. We compute every distance from A in rounds; in each round every node uses the values its neighbours had at the end of the round before, just as routers use the last table they received.
ئەمە بچووکە بە تێچووی بەستەرەکانەوە: A–B 5، A–C 2، C–B 1 و B–D 4. هەموو مەوداکان لە Aـەوە بە چەند گەڕێک حیساب دەکەین؛ لە هەر گەڕێکدا هەر ئەو بەهایانە بەکار دەهێنێت کە دراوسێکانی لە کۆتایی گەڕی پێشوودا هەیانبوو، وەک چۆن دوایین خشتەی وەرگیراو بەکار دەهێنن.
| Roundگەڕ | A | B | C | D |
|---|---|---|---|---|
| 0 | 0 | ∞ | ∞ | ∞ |
| 1 | 0 | 5 (via A)5 (لە ڕێی A) | 2 (via A)2 (لە ڕێی A) | ∞ |
| 2 | 0 | 3 (via C)3 (لە ڕێی C) | 2 (via A)2 (لە ڕێی A) | 9 (via B)9 (لە ڕێی B) |
| 3 | 0 | 3 (via C)3 (لە ڕێی C) | 2 (via A)2 (لە ڕێی A) | 7 (via B)7 (لە ڕێی B) |
Two lessons hide in the table. First, a path with more links can be cheaper: B is reached through C for 3, not directly for 5. Second, good news needs several rounds to travel — D’s best value, 7, appears only in round 3. In routing all link costs are positive; Bellman-Ford can also handle negative costs, but metrics are never negative.
دوو وانە لە خشتەکەدا شاراونەتەوە. یەکەم، ڕێگایەک بە بەستەری زیاتر دەتوانێت هەرزانتر بێت: B بە 3 لە ڕێی Cـەوە دەگەیەنرێت، نەک ڕاستەوخۆ بە 5. دووەم، هەواڵی باش چەند خولێکی پێویستە بۆ گەیشتن — باشترین بەهای D (کە 7ـە) تەنیا لە گەڕی 3دا دەردەکەوێت. لە هەموو تێچوویەکی بەستەر ئەرێنییە؛ بێڵمان-فۆرد دەتوانێت تێچووی نەرێنیش چارەسەر بکات، بەڵام هەرگیز نەرێنی نین.
The Bellman-Ford ruleیاسای بێڵمان-فۆرد
Why distance vector is slow and loop-proneبۆچی مەودای ئاڕاستە خاوە و مەترسیی ئەڵقەی ڕێدۆزیی هەیە
Distance vector is simple and needs little memory or CPU, but it has two weaknesses. Changes spread slowly: news crosses one router per exchange, and each exchange may wait for the 30-second timer. And because a router believes distances it cannot check, old news can create routing loops and counting to infinity, which need extra rules to stop (the five cures). That is why large and complex networks use link-state protocols such as OSPF and IS-IS.
سادەیە و بیرگە و CPUـی کەمی پێویستە، بەڵام دوو لاوازیی هەیە. گۆڕانەکان بە خاوی بڵاو دەبنەوە: هەواڵ لە هەر ئاڵوگۆڕێکدا تەنیا یەک دەبڕێت و لەوانەیە هەر ئاڵوگۆڕێک چاوەڕێی 30 چرکەیی بکات. هەروەها چونکە باوەڕ بەو مەودایانە دەکات کە ناتوانێت بیانپشکنێت، هەواڵی کۆن دەتوانێت و ژماردن تا دروست بکات، کە پێویستیان بە یاسای زیاترە بۆ وەستاندنیان (پێنج چارەسەرەکە). لەبەر ئەوە گەورە و ئاڵۆز وەک و IS-IS بەکار دەهێنن.
Link state: everyone has the mapبارودۆخی بەستەر: نەخشەکە لای هەمووانە
“Link” means a connection between two devices, wired or wireless; “state” means its condition — up or down, and its cost. A link-state router therefore knows the state of every link in its area. It gets there in three steps. 1. It meets its neighbours with small hello messages. 2. It describes its own links in a link-state advertisement (LSA) and floods it: every router passes each new LSA on to its other neighbours, so all routers in the area collect the same LSAs into the same link-state database (LSDB) — the map. 3. Each router runs Dijkstra’s algorithm, also called SPF (shortest path first), on that map, with itself as the root, and puts the result into its own routing table.
«بەستەر» (link) واتە پەیوەندییەک لە نێوان دوو ئامێردا، بە وایەر یان بێ وایەر؛ «بارودۆخ» (state) واتە دۆخەکەی — کارایە یان پچڕاوە — لەگەڵ تێچووەکەی. بۆیە بارودۆخی هەموو بەستەرێکی ناوچەکەی دەزانێت. بە سێ هەنگاو دەگاتە ئەوێ. 1. بە پەیامی بچووکی سڵاو دراوسێکانی دەناسێت. 2. بەستەرەکانی خۆی لە ـیەکدا (link-state advertisement) وەسف دەکات و دەکات: هەموو هەر نوێ بۆ دراوسێکانی تری دەنێرێت، بۆیە هەموو ناوچەکە هەمان لە هەمان ـدا کۆ دەکەنەوە — نەخشەکە. 3. هەر ، کە پێی دەگوترێت SPF (shortest path first)، بە خۆی وەک ڕەگ لەسەر ئەو نەخشەیە جێبەجێ دەکات و ئەنجامەکە دەخاتە ناو خۆیەوە.
When a link changes, only that news is flooded, at once — not whole tables every 30 seconds — and every router recalculates in parallel. So link state converges quickly. OSPF’s version of these three steps, with its LSAs, areas and cost, is in OSPF concepts.
کاتێک بەستەرێک دەگۆڕێت، تەنیا ئەو هەواڵە یەکسەر بڵاو دەکرێتەوە — نەک هەموو خشتەکان لە هەر 30 چرکەیەکدا — و هەموو هاوکات دووپاتە حیساب دەکاتەوە. بۆیە خێرا دەگاتە . ئەم سێ هەنگاوە لە ، لەگەڵ ، و تێچووەکەی، لە چەمکەکانی OSPFدایە.
Dijkstra's algorithmئەلگۆریزمی دایکسترا
Dijkstra’s algorithm finds the shortest paths from one node of a graph to all the others. The Dutch computer scientist Edsger Wybe Dijkstra worked it out in 1956 and published it in 1959. Each link of the graph carries a number, its weight, which can mean different things: the travel time between two places on a city map, how crowded a road is, or, in a social network such as Facebook, how strong a friendship is. In networking the weight is the metric: OSPF’s cost.
لە یەک بۆ هەموو ئەوانی تر دەدۆزێتەوە. کۆمپیوتەرزانی هۆڵەندی ئێدسخەر ویبە دایکسترا (Edsger Wybe Dijkstra) لە ساڵی 1956دا دایهێنا و لە 1959دا بڵاوی کردەوە. هەر بەستەرێکی ژمارەیەکی لەسەرە، کێشەکەی (weight)، کە دەتوانێت واتای جیاوازی هەبێت: کاتی گەشت لە نێوان دوو شوێن لەسەر نەخشەی شارێک، ئاستی قەرەباڵغیی ڕێیەک، یان لە تۆڕێکی کۆمەڵایەتیی وەک فەیسبووکدا، بەهێزیی هاوڕێیەتییەک. لە کێشەکە : تێچووی .
- Startدەستپێک
Give the start node distance 0 and every other node ∞ (infinity).
مەودای دەستپێک 0 دابنێ و هی هەموو تر .
- Pick the closestنزیکترین هەڵبژێرە
Visit the unvisited node with the smallest distance.
سەردانی ئەو بکە کە هێشتا سەردان نەکراوە و بچووکترین مەودای هەیە.
- Update the neighboursدراوسێکان نوێ بکەرەوە
For each of its neighbours, try the path through it: if “its distance + link weight” is smaller than the neighbour’s distance, write the new value and remember the way.
بۆ هەر دراوسێیەکی، ڕێگای پێیدا تاقی بکەرەوە: ئەگەر «مەودای ئەو + کێشی بەستەر» لە مەودای دراوسێکە بچووکتر بوو، بەها نوێیەکە بنووسە و ڕێگاکە لەبیر بکە.
- Repeatدووپاتەکردنەوە
Mark the node as done and repeat until every node is done (or until the destination is done).
وەک تەواو نیشان بکە و دووپاتەی بکەرەوە تا هەموو تەواو دەبێت (یان تا شوێنی مەبەست تەواو دەبێت).
Dijkstra’s algorithm runs inside OSPF and IS-IS. In AI the same algorithm is called uniform-cost search, and A* search adds a guess of the remaining distance.
لە ناو OSPF و IS-ISـدا کار دەکات. لە ژیریی دەستکرددا هەمان پێی دەگوترێت گەڕانی کەمترین کۆست و گەڕانی A* مەزەندەیەکی دووری تا ئامانج زیاد دەکات.
Dijkstra's algorithmئەلگۆریزمی دایکسترا
Dijkstra step by stepدایکسترا هەنگاو بە هەنگاو
Find the shortest path from B to F in a small graph with the weights B–E 6, B–D 5, D–E 3, E–F 1 and D–F 2. Watch the table: green rows are finished, the orange row is the node being visited.
لە Bـەوە بۆ F بدۆزەرەوە لە بچووکدا بە کێشەکانی B–E 6، B–D 5، D–E 3، E–F 1 و D–F 2. سەیری خشتەکە بکە: دێڕە سەوزەکان تەواون، دێڕە پرتەقاڵییەکە ئەو کە سەردانی دەکرێت.


| Stepهەنگاو | Visitسەردان | What changesچی دەگۆڕێت |
|---|---|---|
| 1 | B (0) | D = 5, E = 6D = 5، E = 6 |
| 2 | D (5) | F = 5 + 2 = 7; E through D = 8 > 6, no changeF = 5 + 2 = 7؛ E لە ڕێی D = 8 > 6، ناگۆڕێت |
| 3 | E (6) | F through E = 7, equal: no changeF لە ڕێی E = 7، یەکسانە: ناگۆڕێت |
| 4 | F (7) | finished: B → F = 7 through Dتەواو: B بۆ F = 7 لە ڕێی D |
So the shortest path from B to F costs 7: B–D–F (5 + 2). Look closely, though: B–E–F (6 + 1) costs 7 too. There are two shortest paths. Dijkstra’s algorithm keeps the first one it found unless told otherwise; OSPF would put both into the routing table and share the traffic between them (equal-cost paths).
کەواتە لە Bـەوە بۆ F تێچووی 7ـە: B–D–F (5 + 2). بەڵام وردتر سەیر بکە: B–E–F (6 + 1)ـیش 7ـە. دوو هەن. یەکەمیان دەهێڵێتەوە مەگەر بە شێوەیەکی تر پێی بگوترێت؛ هەردووکیان دەخاتە ناو و هاتوچۆ لە نێوانیاندا دابەش دەکات (ڕێگەی تێچوو یەکسان).
Dijkstra's algorithmئەلگۆریزمی دایکسترا
Your turn: from home to schoolنۆرەی تۆیە: لە ماڵەوە بۆ قوتابخانە
The same idea guides map and navigation apps — Google Maps, Apple Maps, Maps.me, Sygic — as well as transport planning and the sharing out of resources. Real map apps use faster relatives of it, such as A* and pre-computed shortcuts, because a country’s road map is huge.
هەمان بیرۆکە ئەپەکانی نەخشە و ڕێنیشاندانیش ڕێنمایی دەکات — Google Maps، Apple Maps، Maps.me، Sygic — هەروەها پلاندانانی گواستنەوە و دابەشکردنی سەرچاوەکان. ئەپە ڕاستەقینەکانی نەخشە خزمە خێراترەکانی بەکار دەهێنن، وەک A* و کورتەڕێی پێشوەختە حیسابکراو، چونکە نەخشەی ڕێگاکانی وڵاتێک زۆر گەورەیە.
The picture is a small road map. Each number is how crowded that road is — the weight. Use Dijkstra’s algorithm to find the least crowded way from home to school.
وێنەکە نەخشەیەکی بچووکی ڕێگاکانە. هەر ژمارەیەک ئاستی قەرەباڵغیی ئەو ڕێیەیە — کێشەکە. بەکار بهێنە بۆ دۆزینەوەی کەمترین ڕێی قەرەباڵغ لە ماڵەوە بۆ قوتابخانە.
Run Dijkstra’s algorithm from Home. Write the order in which the places are finished with their distances, then give the shortest path and its cost.
لە ماڵەوە جێبەجێ بکە. ڕیزبەندیی تەواوبوونی شوێنەکان لەگەڵ مەوداکانیان بنووسە، پاشان و تێچووەکەی بڵێ.
Hintئاماژە
Start with Home = 0. The first place finished after Home is B (2).
بە ماڵ = 0 دەست پێ بکە. یەکەم شوێن کە دوای ماڵ تەواو دەبێت Bـە (2).
Show answerوەڵامەکە پیشان بدە
| Visitسەردان | Distanceمەودا | Changesگۆڕانەکان |
|---|---|---|
| Homeماڵ | 0 | A = 3, B = 2, C = 5 |
| B | 2 | D = 3, E = 8D = 3، E = 8 |
| A | 3 | none (D through A would be 6)هیچ (D لە ڕێی A دەبووە 6) |
| D | 3 | F = 7 |
| C | 5 | E = 7 (better than 8)E = 7 (لە 8 باشترە) |
| E | 7 | School = 11قوتابخانە = 11 |
| F | 7 | School = 9 (better than 11)قوتابخانە = 9 (لە 11 باشترە) |
| Schoolقوتابخانە | 9 | finishedتەواو |
Shortest path: Home → B → D → F → School, cost 2 + 1 + 4 + 2 = 9. The next best is Home → C → E → F → School with 10.
: ماڵ ← B → D → F ← قوتابخانە، تێچوو 2 + 1 + 4 + 2 = 9. باشترینی دوای ئەو ماڵ ← C → E → F ← قوتابخانەیە بە 10.
Distance vector and link state side by sideمەودای ئاڕاستە و بارودۆخی بەستەر لە تەنیشت یەکەوە
University courses compare the two families on the same points. The short version: link state means having a complete, accurate map; distance vector means sharing distances with your neighbours.
لە زانکۆکاندا هەردوو بنەماڵەکە لەسەر هەمان خاڵەکان بەراورد دەکرێن. کورتەکەی: واتە هەبوونی نەخشەیەکی تەواو و ورد؛ واتە بەشکردنی مەوداکان لەگەڵ دراوسێکانت.
| Pointخاڵ | ||
|---|---|---|
| What a router knows چی دەزانێت | distances and next hops from its neighboursمەودا و لە دراوسێکانییەوە | the state of every link in its areaبارودۆخی هەموو بەستەرێکی ناوچەکەی |
| What it sendsچی دەنێرێت | its whole routing tableهەموو | LSAs about its own links لەبارەی بەستەرەکانی خۆی |
| Whenکەی | periodically (RIP: every 30 s), even with no changeبە ماوەیی (: هەموو 30 چرکە)، تەنانەت بێ گۆڕان | when something changes (plus a slow refresh)کاتێک شتێک دەگۆڕێت (لەگەڵ نوێکردنەوەیەکی هێواش) |
| To whomبۆ کێ | its neighbours onlyتەنیا دراوسێکانی | every router in the area (flooding)هەموو ناوچەکە () |
| Algorithm | Bellman-Fordبێڵمان-فۆرد | Dijkstra (SPF)دایکسترا (SPF) |
| Convergence | slowخاو | fastخێرا |
| CPU and memoryCPU و بیرگە | littleکەم | more (the whole map + SPF)زیاتر (هەموو نەخشەکە + SPF) |
| Routing loops | prone; needs the five curesمەترسیی هەیە؛ پێویستی بە پێنج چارەسەرەکەیە | much less proneمەترسیی زۆر کەمترە |
| Configurationڕێکخستن | easyئاسان | more to plan (areas, costs)پلانی زیاتری دەوێت (، تێچوو) |
| Examplesنموونەکان | RIP | OSPF, IS-IS |
The other two families: path vector and advanced distance vectorدوو بنەماڵەکەی تر: ڕێڕەوی ئاڕاستە و مەودای ئاڕاستەی پێشکەوتوو
BGP is not a distance-vector protocol. It is a path-vector protocol: every route carries the list of autonomous systems it has passed through (the AS path). A router that finds its own AS number in that list refuses the route, so BGP cannot loop the way RIP does, and each network chooses routes by its own policy. EIGRP learns routes from its neighbours like a distance-vector protocol, but its DUAL algorithm keeps a loop-free backup route (a feasible successor) ready, so it switches at once when the best path fails. It is an advanced distance-vector protocol — not a link-state one.
نییە. : هەر ڕێگەیەک لیستی هەموو سەر ڕێگاکەی هەڵدەگرێت (ڕێڕەوی AS). کە ژمارەی ASـی خۆی لەو لیستەدا ببینێت ڕێگەکە ڕەت دەکاتەوە، بۆیە ناتوانێت وەک بسووڕێتەوە و هەر بەپێی سیاسەتی خۆی ڕێگەکان هەڵدەبژێرێت. وەک ڕێگەکان لە دراوسێکانییەوە فێر دەبێت، بەڵام DUALـی ڕێگەیەکی یەدەگی بێ ئەڵقە (feasible successor) ئامادە دەهێڵێتەوە، بۆیە کاتێک باشترین ڕێگە دەپچڕێت یەکسەر دەگۆڕێت. — نەک .
Both are taught in their own lessons: EIGRP and DUAL and BGP and autonomous systems.
هەردووکیان لە وانەی خۆیاندا دەخوێنرێن: EIGRP و DUAL و BGP و سیستەمە سەربەخۆکان.
Common mistakesهەڵە باوەکان
Exercisesڕاهێنانەکان
Links: S–X 4, S–Y 1, Y–X 2, X–T 1, Y–T 6. Using the Bellman-Ford rule, fill in the distances from S after each round until nothing changes.
بەستەرەکان: S–X 4، S–Y 1، Y–X 2، X–T 1، Y–T 6. بە یاسای بێڵمان-فۆرد مەوداکان لە Sـەوە دوای هەر گەڕێک پڕ بکەرەوە تا هیچ ناگۆڕێت.
Show answerوەڵامەکە پیشان بدە
| Roundگەڕ | S | X | Y | T |
|---|---|---|---|---|
| 0 | 0 | ∞ | ∞ | ∞ |
| 1 | 0 | 4 (via S)4 (لە ڕێی S) | 1 (via S)1 (لە ڕێی S) | ∞ |
| 2 | 0 | 3 (via Y)3 (لە ڕێی Y) | 1 (via S)1 (لە ڕێی S) | 5 (via X)5 (لە ڕێی X) |
| 3 | 0 | 3 (via Y)3 (لە ڕێی Y) | 1 (via S)1 (لە ڕێی S) | 4 (via X)4 (لە ڕێی X) |
Round 4 changes nothing. T is 4 away: S–Y–X–T = 1 + 2 + 1. Notice how T first gets 5 and only one round later its best value, 4.
گەڕی 4 هیچ ناگۆڕێت. T چوار دوورە: S–Y–X–T = 1 + 2 + 1. سەرنج بدە T سەرەتا 5 وەردەگرێت و تەنیا گەڕێک دواتر باشترین بەهای خۆی، 4.
OSPF costs: R1–R2 10, R1–R3 1, R3–R2 2, R2–R4 1, R3–R5 10, R4–R5 1. Run Dijkstra’s algorithm from R1 and give R1’s shortest path and cost to every router.
تێچووەکانی : R1–R2 10، R1–R3 1، R3–R2 2، R2–R4 1، R3–R5 10، R4–R5 1. لە R1ـەوە جێبەجێ بکە و و تێچووی R1 بۆ هەموو بڵێ.
Show answerوەڵامەکە پیشان بدە
| Visitسەردان | Changesگۆڕانەکان |
|---|---|
| R1 (0) | R2 = 10, R3 = 1 |
| R3 (1) | R2 = 1 + 2 = 3 (better than 10), R5 = 11R2 = 1 + 2 = 3 (لە 10 باشترە)، R5 = 11 |
| R2 (3) | R4 = 4 |
| R4 (4) | R5 = 5 (better than 11)R5 = 5 (لە 11 باشترە) |
| R5 (5) | finishedتەواو |
R3: 1 (R1–R3). R2: 3 (R1–R3–R2). R4: 4 (R1–R3–R2–R4). R5: 5 (R1–R3–R2–R4–R5). The direct R1–R2 link (10) is never used: four cheap links beat one expensive one.
R3: 1 (R1–R3). R2: 3 (R1–R3–R2). R4: 4 (R1–R3–R2–R4). R5: 5 (R1–R3–R2–R4–R5). بەستەری ڕاستەوخۆی R1–R2 (10) هەرگیز بەکار ناهێنرێت: چوار بەستەری هەرزان لە یەک بەستەری گران دەبەنەوە.
For each sentence, say which family it describes: (a) “I only know what my neighbours told me.” (b) “When a link fails I flood the news to the whole area at once.” (c) “I send my whole table every 30 seconds.” (d) “I run SPF with myself as the root.” (e) “I may count to infinity.”
بۆ هەر ڕستەیەک بڵێ کام بنەماڵە وەسف دەکات: (ئ) «تەنیا ئەوە دەزانم کە دراوسێکانم پێیان وتووم.» (ب) «کاتێک بەستەرێک دەپچڕێت، هەواڵەکە یەکسەر بە هەموو ناوچەکەدا بڵاو دەکەمەوە.» (ج) «هەموو خشتەکەم هەموو 30 چرکە دەنێرم.» (د) «SPF بە خۆم وەک ڕەگ جێبەجێ دەکەم.» (هـ) «لەوانەیە تا بژمێرم.»
Show answerوەڵامەکە پیشان بدە
Distance vector: (a), (c), (e). Link state: (b), (d).
: (ئ)، (ج)، (هـ). : (ب)، (د).
Router C’s table holds 10.3.0.0/16 (G0/0, 0) and 10.4.0.0/16 (G0/1, 0). An update arrives on G0/0 from B: 10.1.0.0/16 1 hop, 10.2.0.0/16 0 hops, 10.3.0.0/16 0 hops. What does C’s table look like afterwards?
لە خشتەی Cـدا 10.3.0.0/16 (G0/0، 0) و 10.4.0.0/16 (G0/1، 0) هەن. نوێکردنەوەیەک لەسەر G0/0 لە Bـەوە دەگات: 10.1.0.0/16 بە 1 ، 10.2.0.0/16 بە 0، 10.3.0.0/16 بە 0. دوای ئەوە خشتەی C چۆنە؟
Show answerوەڵامەکە پیشان بدە
10.3.0.0/16 G0/0 0 and 10.4.0.0/16 G0/1 0 stay (connected, nothing beats 0). New: 10.2.0.0/16 G0/0 1 and 10.1.0.0/16 G0/0 2 — B’s hops + 1, direction G0/0. B’s 10.3 (0 + 1 = 1) is worse than C’s own 0, so it is ignored.
10.3.0.0/16 G0/0 0 و 10.4.0.0/16 G0/1 0 دەمێننەوە (بەستراون، هیچ شتێک لە 0 باشتر نییە). نوێ: 10.2.0.0/16 G0/0 1 و 10.1.0.0/16 G0/0 2 — B + 1، ئاڕاستە G0/0. 10.3ـی B (0 + 1 = 1) لە 0ـی خودی C خراپترە، بۆیە پشتگوێ دەخرێت.
Summaryکورتە
- Distance vector: a router knows a distance and a direction for each network, learned from its neighbours, and sends its whole table regularly. It computes with Bellman-Ford: the minimum of “neighbour’s distance + link cost”.
- It is simple and light, but slow to converge and prone to loops and counting to infinity.
- Link state: routers meet with hellos, flood LSAs into the same LSDB, and each runs Dijkstra (SPF) with itself as the root. Fast convergence; more CPU and memory. OSPF and IS-IS.
- Dijkstra visits the closest unfinished node each time; the weights must be positive, and ties give equal-cost paths.
- BGP is path vector; EIGRP is advanced distance vector.
- : بۆ هەر مەودایەک و ئاڕاستەیەک دەزانێت کە لە دراوسێکانییەوە فێری بووە و بە شێوەی ماوەیی هەموو خشتەکەی دەنێرێت. بە بێڵمان-فۆرد حیساب دەکات: کەمترینی «مەودای دراوسێ + تێچووی بەستەر».
- سادە و سووکە، بەڵام خاو دەگاتە و مەترسیی و ژماردن تا هەیە.
- : بە سڵاو یەکتر دەناسن، بۆ هەمان بڵاو دەکەنەوە و هەریەکەیان دایکسترا (SPF) بە خۆی وەک ڕەگ جێبەجێ دەکات. خێرا؛ CPU و بیرگەی زیاتر. و IS-IS.
- دایکسترا هەر جارێک سەردانی نزیکترین تەواونەکراو دەکات؛ کێشەکان دەبێت ئەرێنی بن و یەکسانی ڕێگەی تێچوو یەکسان دەدات.
- ؛ .
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
RIP: The Simplest Routing ProtocolRIP: سادەترین پرۆتۆکۆڵی ڕێدۆزی
Related lecturesوانە پەیوەندیدارەکان
- RIP: The Simplest Routing ProtocolRIP: سادەترین پرۆتۆکۆڵی ڕێدۆزی
- OSPF: Cost, Router IDs and Link-State AdvertisementsOSPF: تێچوو، ناسێنەرەکانی ڕێدۆز و LSAـەکان
- EIGRP: Cisco’s Advanced Distance-Vector ProtocolEIGRP: مەودای ئاڕاستەی پێشکەوتووی Cisco
- BGP: Routing Between Autonomous SystemsBGP: ڕێدۆزی لە نێوان سیستەمە سەربەخۆکاندا
- Depth-Limited, Uniform-Cost, Iterative Deepening and Bidirectional Searchگەڕانی قووڵایی سنووردار، گەڕانی کەمترین کۆست، گەڕانی قووڵکردنەوەی پلەبەپلە و گەڕانی دووئاڕاستە
- A* Searchگەڕانی A*
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- UC Berkeley CS 168, Intro to the Internet, Fall 2026 — Routing 2: Distance-Vector; Routing 3: Link-State
- CS 168 textbook: Distance-Vector Protocols (distributed Bellman-Ford)
- CS 168 textbook: Link-State Protocols (hellos, flooding, each router computes its own paths, convergence)
- Kurose & Ross, Computer Networking: A Top-Down Approach, 9th ed. (Pearson) — routing algorithms: link-state (Dijkstra) and distance-vector (Bellman-Ford)
- RFC 2328: OSPF Version 2 — LSAs flooded through the area, identical databases, each router builds a shortest-path tree with itself as root
- RFC 2453: RIP Version 2 — distance vector based on Bellman-Ford, updates every 30 seconds
- RFC 4271: BGP-4 — AS_PATH and path-vector routing
- RFC 7868: EIGRP — DUAL, successors and feasible successors
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.