Chapterبەش 4 · Lectureوانە 4.6

OSPF: Cost, Router IDs and Link-State AdvertisementsOSPF: تێچوو، ناسێنەرەکانی ڕێدۆز و LSAـەکان

Why OSPF replaced RIP in real networks: an open-standard link-state protocol whose metric is a cost worked out from bandwidth (and why every link of 100 Mbit/s or more costs 1 until you raise the reference bandwidth), the cost of a whole route, how a router picks its router ID, the three steps of OSPF, LSAs, LSUs and the LSDB, the main LSA types, flooding and the 30-minute refresh, SPF, and why OSPF converges fast.

بۆچی لە ڕاستەقینەدا جێگەی گرتەوە: و کە تێچوویەکە لە حیساب دەکرێت (و بۆچی هەموو بەستەرێکی ⁦100 Mbit/s⁩ یان خێراتر تێچووی 1ـە تا پێوەر بەرز دەکەیتەوە)، تێچووی ڕێگەیەکی تەواو، چۆن هەڵدەبژێرێت، سێ هەنگاوی OSPF، ، LSU و ، جۆرە سەرەکییەکانی ، و نوێکردنەوەی ⁦30⁩ خولەکی، SPF و بۆچی خێرایە.

22 min read23 خولەک خوێندنەوە · 19 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Explain why OSPF suits bigger networks than RIP, and compare the two protocols.
  • Calculate the OSPF cost of an interface and of a whole route, and fix the reference-bandwidth problem.
  • Predict which router ID a router will use, and change it.
  • Describe LSAs, LSUs and the LSDB, the main LSA types, flooding and refresh.
  • Explain how SPF turns the LSDB into routes, and why OSPF converges fast.
  • ڕوون بکەیتەوە بۆچی لە بۆ گەورەتر گونجاوترە و هەردوو بەراورد بکەیت.
  • تێچووی و ڕێگەیەکی تەواو حیساب بکەیت و کێشەی پێوەر چارەسەر بکەیت.
  • پێشبینی بکەیت کام بەکار دەهێنێت و بیگۆڕیت.
  • ، LSU و ، جۆرە سەرەکییەکانی ، و نوێکردنەوە وەسف بکەیت.
  • ڕوون بکەیتەوە SPF چۆن LSDB دەکات بە ڕێگە و بۆچی خێرایە.

Why OSPF?بۆچی OSPF؟

RIP is easy to set up, but in a real network it has three weak points. It counts only hops, so a slow link and a fast link look the same to it. A path can have at most 15 hops. And every router sends its whole table every 30 seconds, so news of a change travels slowly. OSPF (Open Shortest Path First) was built for bigger networks: one OSPF network can hold hundreds or thousands of routers, it looks at the speed of every link, and it sends only what has changed. In the picture RIP and OSPF choose different paths from R1 to R4.

ئاسان ڕێک دەخرێت، بەڵام لە ڕاستەقینەدا سێ کەموکوڕیی گەورەی هەیە. تەنیا دەژمێرێت، بۆیە بەستەرێکی خاو و بەستەرێکی خێرا لای ئەو وەک یەکن. ڕێگەیەک دەتوانێت لانیزۆر ⁦15⁩ هەبێت. هەروەها هەموو هەر ⁦30⁩ چرکە جارێک هەموو خشتەکەی دەنێرێت، بۆیە هەواڵی گۆڕانێک بە هێواشی دەگات. (Open Shortest Path First) بۆ گەورەتر دروست کراوە: یەک OSPF دەتوانێت سەدان یان هەزاران لەخۆ بگرێت، سەیری خێرایی هەموو بەستەرێک دەکات و تەنیا ئەوە دەنێرێت کە گۆڕاوە. لە وێنەکەدا و لە ⁦R1⁩ـەوە بۆ ⁦R4⁩ دوو ڕێگەی جیاواز هەڵدەبژێرن.

Five routers. Top path R1–R2–R3–R4 over three 1 Gbit/s links (cost 1 each); bottom path R1–R5–R4 over two 10 Mbit/s links (cost 10 each). RIP counts hops (2 below, 3 above) and takes the slow bottom path. OSPF adds costs (20 below, 3 above) and takes the fast top path.پێنج ڕێدۆز. ڕێگەی سەرەوە R1–R2–R3–R4 بە سێ بەستەری 1 Gbit/s (هەریەکە تێچووی 1)؛ ڕێگەی خوارەوە R1–R5–R4 بە دوو بەستەری 10 Mbit/s (هەریەکە تێچووی 10). RIP بازەکان دەژمێرێت (خوارەوە 2، سەرەوە 3) و ڕێگە خاوەکەی خوارەوە دەگرێت. OSPF تێچووەکان کۆ دەکاتەوە (خوارەوە 20، سەرەوە 3) و ڕێگە خێراکەی سەرەوە دەگرێت.
RIP counts hops; OSPF adds up link costs. دەژمێرێت؛ تێچووی بەستەرەکان کۆ دەکاتەوە.CêIT

What OSPF isOSPF چییە

OSPF is a link-state routing protocol: every OSPF router learns the whole map of its area and calculates the best paths by itself. The general idea is explained in Link state: a map of the whole area. OSPF is an IGP (interior gateway protocol): it routes inside one autonomous system, such as a company or a university (IGP and EGP). It is an open standard, written by the IETF, so routers from any vendor can run OSPF together. Two versions are in use: OSPFv2 for IPv4 (RFC 2328, 1998) and OSPFv3, built for IPv6 (RFC 5340, 2008).

: هەموو OSPF نەخشەی تەواوی فێر دەبێت و خۆی باشترین ڕێگەکان حیساب دەکات. بیرۆکە گشتییەکە لە بارودۆخی بەستەر: نەخشەی هەموو ناوچەکە ڕوون کراوەتەوە. : لە ناو یەک دەکات، وەک کۆمپانیایەک یان زانکۆیەک (IGP و EGP). و IETF نووسیویەتی، بۆیە هەر کۆمپانیایەکی دروستکەر بن دەتوانن پێکەوە OSPF بەکار بهێنن. دوو وەشانی بەکار دێت: ⁦OSPFv2⁩ بۆ ⁦IPv4⁩ (ساڵی ⁦1998⁩، ⁦RFC 2328⁩) و ⁦OSPFv3⁩ کە بۆ ⁦IPv6⁩ دروست کراوە (ساڵی ⁦2008⁩، ⁦RFC 5340⁩).

Definitionپێناسە

Open Shortest Path First: the open-standard link-state routing protocol (OSPFv2, RFC 2328; OSPFv3 for IPv6). Routers flood LSAs, build the same LSDB and run Dijkstra's SPF on it; the metric is cost, the AD is 110, and large networks are split into areas.

Open Shortest Path First: و ستانداردی کراوەیە (⁦OSPFv2⁩، ⁦RFC 2328⁩؛ ⁦OSPFv3⁩ بۆ ⁦IPv6⁩). بڵاو دەکەنەوە، هەمان دروست دەکەن و SPFـی دایکسترای لەسەر ئەنجام دەدەن؛ ، ⁦110⁩ـە و ڕایەڵە گەورەکان دابەش دەکرێن بۆ .

OSPF at a glance: full name Open Shortest Path First; family link state; works inside one autonomous system (an IGP); standards OSPFv2 = RFC 2328 for IPv4 and OSPFv3 = RFC 5340 for IPv6; metric cost from the link bandwidth; algorithm SPF = Dijkstra’s algorithm; administrative distance 110; talks to 224.0.0.5 and 224.0.0.6 (IPv6 FF02::5 and FF02::6); carried in IP packets with protocol number 89, not TCP or UDP.OSPF بە یەک چاوپێداخشاندن: ناوی تەواو Open Shortest Path First؛ خێزان بارودۆخی بەستەر؛ لە ناو یەک سیستەمی سەربەخۆدا کار دەکات (IGP)؛ ستانداردەکان OSPFv2 = RFC 2328 بۆ IPv4 و OSPFv3 = RFC 5340 بۆ IPv6؛ پێوانە تێچووە لە پانایی باندی بەستەرەکەوە؛ ئەلگۆریزم SPF = ئەلگۆریزمی دایکسترا؛ مەودای بەڕێوەبەری 110؛ ناونیشانەکانی 224.0.0.5 و 224.0.0.6 (IPv6: FF02::5 و FF02::6)؛ لە ناو پاکێتەکانی IP بە ژمارەی پرۆتۆکۆڵ 89 دەگوازرێتەوە، نە TCP نە UDP.
Everything about OSPF on one card.هەموو شتێکی لەسەر یەک کارت.CêIT

RIP and OSPF side by sideRIP و OSPF لە تەنیشت یەکەوە

A classic exam task is to put the differences between RIP and OSPF in a table. Every row follows from one idea: RIP passes on the tables of its neighbours (RIP), while OSPF builds its own map and does its own calculation.

ئەرکێکی باوی تاقیکردنەوە ئەوەیە کە جیاوازییەکانی و لە خشتەیەکدا بخەیتە ڕوو. هەموو ڕیزێکی خشتەکە لە یەک بیرۆکەوە دێت: خشتەی دراوسێکانی دەگوازێتەوە (RIP)، بەڵام نەخشەی خۆی دروست دەکات و خۆی حیساب دەکات.

RIP compared with OSPFبەراوردی و
FeatureتایبەتمەندیRIPOSPF
Familyخێزانdistance vector: a distance (hops) and a direction: دوورییەک () و ئاڕاستەیەکlink state: knows every link of its area: هەموو بەستەرێکی دەزانێت
How the table is builtخشتە چۆن دروست دەبێتtakes its neighbours’ tables and adds one hopخشتەی دراوسێکانی وەردەگرێت و یەک زیاد دەکاتcollects LSAs into a map (the LSDB) and calculates its own table لە نەخشەیەکدا ⁦(LSDB)⁩ کۆ دەکاتەوە و خشتەی خۆی حیساب دەکات
Metrichop countژمارەی cost, from the bandwidthتێچوو، لە
Limitسنوور15 hops on a path (16 = unreachable)⁦15⁩ لە ڕێگەیەکدا (⁦16⁩ = ناگات)no hop limitسنووری نییە
Administrative distance120110
AlgorithmBellman-FordDijkstra (SPF) ⁦(SPF)⁩
Structureپێکهاتەflat: no areasتەخت: نییەareas inside one autonomous system, joined by the backbone area 0 لە ناو یەک ، بە ( ⁦0⁩) بەیەکەوە بەستراون
Configurationڕێکخستنsimpleسادەmore to learn and planزیاتر فێربوون و پلاندانانی دەوێت
Network sizeقەبارەی small networks بچووکsmall to very large networks بچووک تا زۆر گەورە
Convergenceslow: can take minutesهێواش: لەوانەیە چەند خولەکێک بخایەنێتfast: usually secondsخێرا: زۆرجار چەند چرکەیەک
Router memory and CPU و CPUـی littleکەمmore (the LSDB and SPF)زیاتر (LSDB و SPF)
Use of the linksبەکارهێنانی بەستەرەکانthe whole table every 30 sهەموو خشتەکە هەر ⁦30⁩ چرکەsmall updates only when something changes, plus a refresh every 30 minتەنیا کاتی گۆڕان بچووک، لەگەڵ نوێکردنەوەیەک هەر ⁦30⁩ خولەک
Timeline of two minutes on one link. RIP sends its whole routing table at 0, 30, 60, 90 and 120 seconds. OSPF sends one small LSA at 45 seconds, when a link changed; otherwise only small hellos every 10 seconds, and each LSA is refreshed once every 30 minutes.هێڵی کاتی دوو خولەک لەسەر یەک بەستەر. RIP هەموو خشتەی ڕێدۆزییەکەی لە 0، 30، 60، 90 و 120 چرکەدا دەنێرێت. OSPF لە چرکەی 45دا، کاتێک بەستەرێک گۆڕا، یەک LSAـی بچووک دەنێرێت؛ جگە لەوە تەنیا پاکێتەکانی سڵاو بچووک هەر 10 چرکە جارێک و هەر LSAـیەک 30 خولەک جارێک نوێ دەکرێتەوە.
RIP repeats everything; OSPF sends only news. هەموو شت دووپاتە دەکاتەوە؛ تەنیا هەواڵ دەنێرێت.CêIT

Cost: the OSPF metricتێچوو: پێوانەی OSPF

Bandwidth is how many bits a link can carry per second: 10 Mbit/s, 100 Mbit/s, 1 Gbit/s and so on (bandwidth and throughput). Every routing protocol has a metric (metrics); OSPF turns the bandwidth of each interface into a number, its cost. A faster link gets a lower cost, and the path with the lowest total cost is the best path. On Cisco routers:

ئەوەیە کە بەستەرێک لە یەک چرکەدا چەند دەگوازێتەوە: ⁦10 Mbit/s⁩، ⁦100 Mbit/s⁩، ⁦1 Gbit/s⁩ و هتد (پانایی باند و ڕێژەی تێپەڕین). هەموو هەیە (پێوانەکان)؛ هەر دەکات بە ژمارەیەک: تێچووەکەی. بەستەری خێراتر تێچووی کەمترە و ئەو ڕێگەیەی کەمترین کۆی تێچووی هەیە باشترین ڕێگەیە. لەسەر Cisco:

C=BrefBint,Bref=100 Mbit/sC = \dfrac{B_{\text{ref}}}{B_{\text{int}}}, \qquad B_{\text{ref}} = 100\ \text{Mbit/s}

CC is the cost, BrefB_{\text{ref}} the reference bandwidth (100 Mbit/s unless you change it) and BintB_{\text{int}} the bandwidth of the interface. The cost is a whole number: the decimals are dropped, and it is never less than 1.

CC تێچووە، BrefB_{\text{ref}} پێوەرە (⁦100 Mbit/s⁩، ئەگەر نەیگۆڕیت) و BintB_{\text{int}} . تێچوو : بەشی دەیی فڕێ دەدرێت و هەرگیز لە 1 کەمتر نابێت.

Example: a network has two paths to the destination network. The first crosses a 100 Mbit/s link, cost 100÷100=1100 \div 100 = 1. The second crosses a 10 Mbit/s link, cost 100÷10=10100 \div 10 = 10. OSPF sends the data over the first path, because 1 is less than 10.

نموونە: دوو ڕێگەی هەیە بەرەو مەبەست. یەکەمیان بە بەستەرێکی ⁦100 Mbit/s⁩ـدا دەڕوات، تێچووی 100÷100=1100 \div 100 = 1. دووەمیان بە بەستەرێکی ⁦10 Mbit/s⁩ـدا، تێچووی 100÷10=10100 \div 10 = 10. بە ڕێگەی یەکەمدا دەنێرێت، چونکە 1 لە ⁦10⁩ کەمترە.

Table of OSPF costs. With the default reference of 100 Mbit/s: serial 1544 kbit/s = 64, Ethernet 10 Mbit/s = 10, Fast Ethernet 100 Mbit/s = 1, Gigabit Ethernet = 1, 10 Gigabit Ethernet = 1 — three different speeds with the same cost. With reference 10000 Mbit/s: 6476, 1000, 100, 10 and 1 — every speed gets its own cost.خشتەی تێچووی OSPF. بە پێوەری بنەڕەت 100 Mbit/s: Serial 1544 kbit/s = 64، Ethernet 10 Mbit/s = 10، Fast Ethernet 100 Mbit/s = 1، Gigabit Ethernet = 1، 10 Gigabit Ethernet = 1 — سێ خێرایی جیاواز بە هەمان تێچوو. بە پێوەری 10000 Mbit/s: 6476، 1000، 100، 10 و 1 — هەر خێراییەک تێچووی خۆی هەیە.
The same links with the default reference and with reference 10000.هەمان بەستەرەکان بە پێوەری بنەڕەت و بە پێوەری ⁦10000⁩.CêIT

Cost is set, not measuredتێچوو دادەنرێت، ناپێورێت

OSPF does not watch the traffic. The cost comes only from the interface’s bandwidth setting — the BW number in show interfaces (show interfaces) — so a link that is full of traffic has exactly the same cost as an idle one. Congestion, delay and errors can make a link slower in real life, and OSPF does not notice them. You can change the cost by hand in two ways:

چاودێریی هاتوچۆ ناکات. تێچوو تەنیا لە ڕێکخستنی ـی دێت — ژمارەی BW لە show interfaces (show interfaces) — بۆیە بەستەرێک کە پڕە لە هاتوچۆ ڕێک هەمان تێچووی بەستەرێکی بێکاری هەیە. ، و هەڵەکان لە ژیانی ڕاستەقینەدا دەتوانن بەستەرێک خاوتر بکەن، بەڵام هەستیان پێ ناکات. دەتوانیت تێچوو بە دوو ڕێگە بە دەست بگۆڕیت:

Two ways to change a costدوو ڕێگە بۆ گۆڕینی تێچووTEXT
R1(config)#interface gigabitEthernet 0/1
R1(config-if)#ip ospf cost 50
R1(config-if)#exit
R1(config)#interface serial 0/0/0
R1(config-if)#bandwidth 64
R1(config-if)#end
R1#copy running-config startup-config
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 2

ip ospf cost sets the cost directly (1–65535). It wins over the formula.

ip ospf cost تێچوو ڕاستەوخۆ دادەنێت ⁦(1–65535)⁩. بەسەر هاوکێشەکەدا زاڵ دەبێت.

Lineدێڕی 5

bandwidth is in kbit/s. It changes only the number OSPF uses (here 100000÷64=1562100000 \div 64 = 1562), not the real speed of the link.

bandwidth بە ⁦kbit/s⁩ـە. تەنیا ئەو ژمارەیە دەگۆڕێت کە بەکاری دەهێنێت (لێرەدا 100000÷64=1562100000 \div 64 = 1562)، نەک خێرایی ڕاستەقینەی بەستەرەکە.

Lineدێڕی 7

Save the configuration at the end of every lab.

لە کۆتایی هەموو تاقیکردنەوەیەکدا پاشەکەوت بکە.

Why every fast link costs 1بۆچی هەموو بەستەرێکی خێرا تێچووی 1ـە

The default reference of 100 Mbit/s comes from a time when 100 Mbit/s was fast. Today almost every router port is 1 Gbit/s or faster. 100÷1000=0.1100 \div 1000 = 0.1, but a cost is never below 1, so a 100 Mbit/s, a 1 Gbit/s and a 10 Gbit/s link all cost 1. OSPF can no longer tell them apart, and it may even prefer a slow path, as the animation shows.

پێوەری بنەڕەتی ⁦100 Mbit/s⁩ لە سەردەمێکەوە ماوەتەوە کە ⁦100 Mbit/s⁩ خێرا بوو. ئەمڕۆ نزیکەی هەموو ⁦1 Gbit/s⁩ یان خێراترە. 100÷1000=0.1100 \div 1000 = 0.1، بەڵام تێچوو هەرگیز لە 1 کەمتر نییە، بۆیە بەستەرێکی ⁦100 Mbit/s⁩، ⁦1 Gbit/s⁩ و ⁦10 Gbit/s⁩ هەموویان تێچوویان 1ـە. ئیتر ناتوانێت لێکیان جیا بکاتەوە و لەوانەیە ڕێگەیەکی خاویش پێ باشتر بێت، وەک لە وێنە جووڵاوەکەدا دەبینیت.

Animation in four steps. 1: R1 and R2 have a 100 Mbit/s link (cost 1) and a 10 Mbit/s link (cost 10); OSPF uses the 100 Mbit/s link. 2: R1 reaches R3 directly over 100 Mbit/s (cost 1) or through R2 over two 1 Gbit/s links (1 + 1 = 2); with the default reference OSPF takes the slow direct link. 3: after auto-cost reference-bandwidth 10000 on every router the direct link costs 100 and the Gigabit path 10 + 10 = 20, so the Gigabit path wins. 4: rule: the same reference on every router, at least as fast as the fastest link.
Animation in four steps. 1: R1 and R2 have a 100 Mbit/s link (cost 1) and a 10 Mbit/s link (cost 10); OSPF uses the 100 Mbit/s link. 2: R1 reaches R3 directly over 100 Mbit/s (cost 1) or through R2 over two 1 Gbit/s links (1 + 1 = 2); with the default reference OSPF takes the slow direct link. 3: after auto-cost reference-bandwidth 10000 on every router the direct link costs 100 and the Gigabit path 10 + 10 = 20, so the Gigabit path wins. 4: rule: the same reference on every router, at least as fast as the fastest link.
With the default reference, two Gigabit links “cost more” than one 100 Mbit/s link.بە پێوەری بنەڕەت، دوو بەستەری Gigabit لە یەک بەستەری ⁦100 Mbit/s⁩ «گرانترن».CêIT

The cure — used again in Configuring OSPF — is to raise the reference on every OSPF router, to at least the speed of your fastest link. The number is in Mbit/s: 10000 for 10 Gbit/s links, 100000 for 100 Gbit/s links. IOS reminds you to keep it the same everywhere:

چارەسەر — کە لە ڕێکخستنی OSPFـدا دووپاتە بەکار دێتەوە — ئەوەیە پێوەرەکە لەسەر هەموو OSPF بەرز بکەیتەوە، لانیکەم بۆ خێرایی خێراترین بەستەرەکەت. ژمارەکە بە ⁦Mbit/s⁩ـە: ⁦10000⁩ بۆ بەستەری ⁦10 Gbit/s⁩ و ⁦100000⁩ بۆ بەستەری ⁦100 Gbit/s. IOS⁩ بیرت دەخاتەوە کە لە هەموو شوێنێک وەک یەک بێت:

Raise the reference bandwidth (repeat on every OSPF router)بەرزکردنەوەی پانایی باندی پێوەر (لەسەر هەموو ڕێدۆزێکی OSPF دووپاتەی بکەرەوە)TEXT
R1(config)#router ospf 1
R1(config-router)#auto-cost reference-bandwidth 10000
% OSPF: Reference bandwidth is changed.
        Please ensure reference bandwidth is consistent across all routers.
R1(config-router)#end
R1#copy running-config startup-config
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 2

Range 1–4294967 Mbit/s; the default is 100. no auto-cost reference-bandwidth returns to 100.

بەهاکەی لە 1 تا ⁦4294967 Mbit/s⁩ دەبێت؛ بنەڕەت ⁦100⁩ـە. no auto-cost reference-bandwidth دەیگەڕێنێتەوە بۆ ⁦100⁩.

Lineدێڕی 3-4

Not an error: a reminder that different values on different routers give inconsistent costs.

هەڵە نییە: بیرخستنەوەیەکە کە بەهای جیاواز لەسەر جیاواز تێچووی ناڕێک دروست دەکات.

The cost of a whole routeتێچووی ڕێگەیەکی تەواو

The cost of a route is the sum of the costs of the outgoing interfaces along the way, including the last one into the destination network. This is a favourite exam question: from R1 to subnet X there are three paths. Add up each one.

تێچووی ڕێگەیەک کۆی تێچووی دەرچوونە بە درێژایی ڕێگەکە، لەگەڵ دوایین کە دەچێتە ناو مەبەست. ئەمە پرسیارێکی خۆشەویستی تاقیکردنەوەیە: لە ⁦R1⁩ـەوە بۆ X سێ ڕێگە هەیە. تێچووی هەریەکەیان کۆ بکەرەوە.

R1 at the top, R8 at the bottom with subnet X behind it (cost 10). Left path R1–R7–R8 with link costs 10 and 180: total 10 + 180 + 10 = 200, only 2 hops. Middle path R1–R5–R6–R8 with costs 20, 30 and 40: total 20 + 30 + 40 + 10 = 100, the lowest cost. Right path R1–R2–R3–R4–R8 with costs 30, 60, 20 and 5: total 30 + 60 + 20 + 5 + 10 = 125.R1 لە سەرەوە، R8 لە خوارەوە و ژێرڕایەڵەی X لە پشتیەوە (تێچوو 10). ڕێگەی چەپ R1–R7–R8 بە تێچووی 10 و 180: کۆ 10 + 180 + 10 = 200، تەنیا 2 باز. ڕێگەی ناوەڕاست R1–R5–R6–R8 بە تێچووی 20، 30 و 40: کۆ 20 + 30 + 40 + 10 = 100، کەمترین تێچوو. ڕێگەی ڕاست R1–R2–R3–R4–R8 بە تێچووی 30، 60، 20 و 5: کۆ 30 + 60 + 20 + 5 + 10 = 125.
OSPF takes the middle path (100); RIP would take the left one (2 hops). ڕێگەی ناوەڕاست دەگرێت ⁦(100)⁩؛ ڕێگەی چەپ دەگرت (⁦2⁩ ).CêIT
  • Left, R1–R7–R8: 10+180+10=20010 + 180 + 10 = \mathbf{200}.
  • Middle, R1–R5–R6–R8: 20+30+40+10=10020 + 30 + 40 + 10 = \mathbf{100} — the lowest, so OSPF uses this path.
  • Right, R1–R2–R3–R4–R8: 30+60+20+5+10=12530 + 60 + 20 + 5 + 10 = \mathbf{125}.
  • If RIP ran here, it would choose the left path: R8 is only 2 hops away that way, although its 180 link is very slow.
  • چەپ، ⁦R1–R7–R8⁩: 10+180+10=20010 + 180 + 10 = \mathbf{200}.
  • ناوەڕاست، ⁦R1–R5–R6–R8⁩: 20+30+40+10=10020 + 30 + 40 + 10 = \mathbf{100} — کەمترینە، بۆیە ئەم ڕێگەیە بەکار دەهێنێت.
  • ڕاست، ⁦R1–R2–R3–R4–R8⁩: 30+60+20+5+10=12530 + 60 + 20 + 5 + 10 = \mathbf{125}.
  • ئەگەر لێرە کاری بکردایە، ڕێگەی چەپی هەڵدەبژارد: لەو ڕێگەیەوە ⁦R8⁩ تەنیا 2 دوورە، هەرچەندە بەستەرە ⁦180⁩ـییەکەی زۆر خاوە.

The router IDناسێنەری ڕێدۆز

Every OSPF router needs a name that no other router in the OSPF network has, just as people have names to tell them apart: its router ID (RID). It is a 32-bit number written like an IPv4 address, for example 1.1.1.1. Neighbours know each other by router ID, every LSA carries the router ID of the router that made it, and the DR election uses it. It does not have to be an address anyone can ping.

هەموو OSPF پێویستی بە ناوێکە کە هیچ تری ناو OSPF نەیبێت، وەک چۆن خەڵک ناویان هەیە بۆ ئەوەی لێک جیا بکرێنەوە: ⁦(RID)⁩. ژمارەیەکی ⁦32⁩ کە وەک ناونیشانێکی ⁦IPv4⁩ دەنووسرێت، بۆ نموونە ⁦1.1.1.1⁩. دراوسێکان بە یەکتر دەناسن، هەموو ئەو پێیە کە دروستی کردووە و هەڵبژاردنی DRیش بەکاری دەهێنێت. پێویست نییە ناونیشانێک بێت کە کەس بتوانێت بکات.

Definitionپێناسە

A 32-bit number, written like an IPv4 address, that names an OSPF (or EIGRP or BGP) router. It is taken from the router-id command, or else the highest loopback address, or else the highest active interface address.

ژمارەیەکی ⁦32⁩ بیتییە کە وەک ناونیشانێکی ⁦IPv4⁩ دەنووسرێت و ناوی OSPF (یان EIGRP و BGP) دیاری دەکات. لە فەرمانی router-id وەردەگیرێت؛ ئەگەر نەبوو لە بەرزترین ناونیشانی ، ئەگەر ئەویش نەبوو لە بەرزترین ناونیشانی کارا.

Decision chart, checked once when the OSPF process starts. 1: is there a router-id command? yes: use that number (router-id 1.1.1.1). 2: no: is there a loopback with an IPv4 address? yes: the highest loopback address (Loopback0 = 2.2.2.2). 3: no: is an interface up with an IPv4 address? yes: the highest active interface address (G0/0 = 192.168.1.1). No: there is no router ID and OSPF does not start. To change it later: clear ip ospf process.نەخشەی بڕیار کە تەنیا یەک جار، کاتی دەستپێکردنی پرۆسەی OSPF، پشکنینی بۆ دەکرێت. 1: فەرمانی router-id هەیە؟ بەڵێ: ئەو ژمارەیە (router-id 1.1.1.1). 2: نەخێر: نێوبەستەی خۆگەڕانەوە بە IPv4 هەیە؟ بەڵێ: بەرزترین ناونیشانی loopback (Loopback0 = 2.2.2.2). 3: نەخێر: نێوبەستەیەک up هەیە بە IPv4؟ بەڵێ: بەرزترین ناونیشانی نێوبەستەی کارا (G0/0 = 192.168.1.1). نەخێر: ناسێنەری ڕێدۆز نییە و OSPF دەست پێ ناکات. بۆ گۆڕینی دواتر: clear ip ospf process.
A Cisco router takes the first answer that is “yes”. Cisco یەکەم وەڵامی «بەڵێ» وەردەگرێت.CêIT

The router ID is chosen when the OSPF process starts. If you type router-id while OSPF is already running with neighbours, IOS keeps the old ID until you reset the OSPF process (or reload the router). Resetting drops the neighbourships for a moment, so do it in a quiet minute. The same step in a full lab: Step 2: give the router an ID.

کاتێک هەڵدەبژێردرێت کە OSPF دەست پێ دەکات. ئەگەر router-id لە کاتێکدا بنووسیت کە OSPF پێشتر لەگەڵ دراوسێکانی کار دەکات، IOS IDـە کۆنەکە دەهێڵێتەوە تا OSPF ڕیسێت دەکەیتەوە (یان دووپاتە دادەگیرسێنیتەوە). ڕیسێتکردن بۆ چەند چرکەیەک دراوسێیەتییەکان دەپچڕێنێت، بۆیە لە کاتێکی ئارامدا بیکە. هەمان هەنگاو لە تاقیکردنەوەیەکی تەواودا: هەنگاوی 2: ناسێنەری ڕێدۆز دابنێ.

Set the router ID by handناسێنەری ڕێدۆز بە دەست دابنێTEXT
R1#show ip protocols | include Router ID
  Router ID 192.168.1.1
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
% OSPF: Reload or use "clear ip ospf process" command, for this to take effect
R1(config-router)#end
R1#clear ip ospf process
Reset ALL OSPF processes? [no]: yes
R1#show ip protocols | include Router ID
  Router ID 1.1.1.1
R1#copy running-config startup-config
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 1-2

R1 took its highest interface address. In Packet Tracer, if | include is not accepted, type show ip protocols and find the Router ID line.

⁦R1⁩ بەرزترین ناونیشانی وەرگرتووە. لە Packet Tracerـدا، ئەگەر | include قبووڵ نەکرا، show ip protocols بنووسە و دێڕی Router ID بدۆزەرەوە.

Lineدێڕی 7

The new ID waits until the process is reset.

IDـە نوێیەکە چاوەڕێی ڕیسێتکردنی دەکات.

Lineدێڕی 9-10

If R1 already has neighbours, log messages appear here: each neighbour goes Down and comes back to Full.

ئەگەر ⁦R1⁩ دراوسێی هەبێت، لێرەدا پەیامی تۆمار دەردەکەون: هەر دراوسێیەک دەچێتە Down و دەگەڕێتەوە بۆ Full.

Loopbacks give a stable router IDنێوبەستەکانی خۆگەڕانەوە ناسێنەری ڕێدۆزێکی جێگیر دەدەن

A loopback interface is a virtual interface inside the router. It has no cable, so it stays up as long as the router runs. That makes it a good source for the router ID. Give it a /32 mask (a single address):

گریمانەییە لە ناو . کێبڵی نییە، بۆیە تا کار بکات هەر کارا دەمێنێتەوە. ئەمە وای لێ دەکات سەرچاوەیەکی باش بێت بۆ . /32ـی پێ بدە (تەنیا یەک ناونیشان):

A loopback for the router IDنێوبەستەی خۆگەڕانەوە بۆ ناسێنەری ڕێدۆزTEXT
R1(config)#interface loopback 0
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#end
R1#copy running-config startup-config
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 1-3

The loopback is created and comes up at once. This is Packet Tracer’s output; a real IOS router also puts a timestamp in front of every log message.

دروست دەبێت و دەستبەجێ کارا دەبێت. ئەمە دەرچوونی Packet Tracerـە؛ ڕاستەقینەی IOS کاتیش دەخاتە پێش هەموو پەیامێکی تۆمار.

R1 has no router-id command. Its interfaces: GigabitEthernet0/0 192.168.1.1 up, GigabitEthernet0/1 10.0.0.1 up, Serial0/0/0 172.16.0.1 down, Loopback0 1.1.1.1 up and Loopback1 2.2.2.2 up. The router ID is 2.2.2.2: loopbacks come before physical interfaces, even if 192.168.1.1 is a higher number.R1 فەرمانی router-idـی نییە. نێوبەستەکانی: GigabitEthernet0/0 192.168.1.1 up، GigabitEthernet0/1 10.0.0.1 up، Serial0/0/0 172.16.0.1 down، Loopback0 1.1.1.1 up و Loopback1 2.2.2.2 up. ناسێنەری ڕێدۆز 2.2.2.2ـە: نێوبەستەکانی خۆگەڕانەوە پێش نێوبەستەکانی فیزیکی دێن، با 192.168.1.1 ژمارەیەکی گەورەتریش بێت.
Rule 2 beats rule 3: the highest loopback wins.یاسای 2 بەسەر یاسای 3دا زاڵە: بەرزترین loopback دەباتەوە.CêIT

The loopback does not even have to run OSPF to give its address. Best practice is still rule 1: set the router ID by hand, so you always know it and it never changes by surprise.

پێویست ناکات OSPF بەکار بهێنێت تا ناونیشانەکەی بدات. باشترین ڕێگە هێشتا یاسای 1ـە: بە دەست دابنێ، بۆ ئەوەی هەمیشە بیزانیت و هەرگیز لەناکاو نەگۆڕێت.

OSPF in three stepsOSPF بە سێ هەنگاو

Like every routing protocol, OSPF learns, shares and decides (what a routing protocol does). It works in three steps:

وەک هەموو ، فێر دەبێت، هاوبەشی دەکات و بڕیار دەدات (پرۆتۆکۆڵی ڕێدۆزی چی دەکات). بە سێ هەنگاو کار دەکات:

  1. Neighbour discovery. A router that starts OSPF first finds the other OSPF routers on its links. It sends hello packets every 10 seconds; if a neighbour’s hellos stop for the dead interval (by default four times the hello interval, 40 seconds), it is declared down. (Learning who is there.)
  2. Database exchange. Neighbours send each other the link-state information they have until their databases are the same; the second router answers with what it knows in the same way. (Advertising what each one knows.)
  3. Route computation. Each router runs SPF on its database and puts the best routes into its routing table. (The routing decision.)
  1. دۆزینەوەی دراوسێکان. کە OSPF دەست پێ دەکات سەرەتا تری OSPF لەسەر بەستەرەکانی دەدۆزێتەوە. هەر ⁦10⁩ چرکە جارێک دەنێرێت؛ ئەگەر دراوسێیەک بۆ کاتی Dead (بە بنەڕەت چوار ئەوەندەی کاتی Hello، واتە ⁦40⁩ چرکە) ڕاوەستان، بە کوژاوە دادەنرێت. (ناسینی ئەوەی کێ لەوێیە.)
  2. ئاڵوگۆڕی . دراوسێکان ئەو زانیارییانەی کە هەیانە بۆ یەکتری دەنێرن تا وەک یەک دەبن؛ دووەم بە هەمان شێوە ئەوەی دەیزانێت دەینێرێتەوە. (ڕاگەیاندنی ئەوەی هەریەکە دەیزانێت.)
  3. ژماردنی ڕێگەکان. هەر SPF لەسەر ئەنجام دەدات و باشترین ڕێگەکان دەخاتە ناو . (بڕیاری .)
Three panels with arrows between them. 1 Neighbour discovery: R1 and R2 exchange Hello packets every 10 s to 224.0.0.5, learning who is there. 2 Database exchange: LSA cards go into the LSDB using DBD, LSR, LSU and LSAck packets, advertising what each knows. 3 Route computation: SPF on the LSDB builds a tree and fills the routing table with O routes, the routing decision.سێ بەش بە تیر لە نێوانیاندا. 1 دۆزینەوەی دراوسێکان: R1 و R2 هەر 10 چرکە پاکێتەکانی سڵاو بۆ 224.0.0.5 ئاڵوگۆڕ دەکەن، ناسینی کێ لەوێیە. 2 ئاڵوگۆڕی بنکەدراوە: کارتەکانی LSA بە پاکێتەکانی DBD، LSR، LSU و LSAck دەچنە ناو LSDB، ڕاگەیاندنی ئەوەی هەریەکە دەیزانێت. 3 ژماردنی ڕێگەکان: SPF لەسەر LSDB دارێک دروست دەکات و خشتەی ڕێدۆزی بە ڕێگەی O پڕ دەکات، بڕیاری ڕێدۆزی.
Find neighbours, copy the database, compute the routes.دراوسێکان بدۆزەرەوە، کۆپی بکە، ڕێگەکان حیساب بکە.CêIT

Steps 1 and 2 — hellos, neighbour states and the database exchange — are the next lesson: OSPF neighbours, DR and BDR. This lesson goes on with what they carry, the LSAs, and with step 3.

هەنگاوەکانی 1 و 2 — ، دۆخەکانی دراوسێ و ئاڵوگۆڕی — وانەی داهاتوون: دراوسێکانی OSPF، DR و BDR. ئەم وانەیە باسی دەکات کە ئەو هەنگاوانە دەیانگوازنەوە، هەروەها باسی هەنگاوی 3 دەکات.

LSA, LSU and LSDBLSA، LSU و LSDB

An LSA (link-state advertisement) is one router’s description of its own links: which networks it is connected to, whether each link is up, and what each one costs. An LSA is information, not a packet. LSAs travel between neighbours inside LSU packets (link-state update), and each router keeps every LSA it has received in its LSDB (link-state database). The LSDB is a map of the area — routers, links and costs — not a list of routes. All routers of one area hold the same LSDB.

⁦(link-state advertisement)⁩ وەسفی بۆ بەستەرەکانی خۆی: بە کام بەستراوە، هەر بەستەرێک کارایە یان نا و تێچووی هەریەکەیان چەندە. زانیارییە، نەک . لە ناو LSU ⁦(link-state update)⁩ لە نێوان دراوسێکاندا دەڕۆن و هەر هەموو وەرگیراو لە ⁦(link-state database)⁩ هەڵدەگرێت. LSDB نەخشەی — ، بەستەرەکان و تێچووەکان — نەک لیستی ڕێگەکان. هەموو یەک هەمان LSDBـیان هەیە.

Three parts. One LSA, part of R8’s: router ID 8.8.8.8, link 172.16.3.0/24, interface 172.16.3.1, state UP, cost 10 — one card in which a router describes its own links. An LSU envelope carrying cards to neighbours. The LSDB, a box holding the cards R1 to R8, the same in every router of the area. An LSA is information, not a packet: it travels inside LSU packets and is kept in the LSDB.سێ بەش. یەک LSA، بەشێک لەهی R8: ناسێنەری ڕێدۆز 8.8.8.8، بەستەر 172.16.3.0/24، نێوبەستە 172.16.3.1، دۆخ UP، تێچوو 10 — یەک کارت کە ڕێدۆزێک بەستەرەکانی خۆی تێدا وەسف دەکات. زەرفێکی LSU کە کارتەکان بۆ دراوسێکان دەبات. LSDB، سندووقێک کە کارتەکانی R1 تا R8ـی تێدایە و لە هەموو ڕێدۆزەکانی ناوچەکەدا وەک یەکە. LSA زانیارییە نەک پاکێت: لە ناو پاکێتەکانی LSUـدا دەڕوات و لە LSDBـدا هەڵدەگیرێت.
Cards, envelopes and the box of cards.کارت، زەرف و سندووقی کارتەکان.CêIT
A box of index cardsسندووقێکی کارت

Think of the LSDB as a box of index cards. Every router writes one card about itself (its LSA) and posts copies in envelopes (LSUs) to its neighbours, who post them on. In the end every router has the same box of cards — and each draws its own map from it.

LSDB وەک سندووقێکی کارت وێنا بکە. هەر کارتێک لەبارەی خۆی دەنووسێت () و کۆپییەکانی لە زەرفدا ⁦(LSU)⁩ بۆ دراوسێکانی دەنێرێت و ئەوانیش دەینێرنەوە. لە کۆتاییدا هەموو هەمان سندووقی کارتی هەیە — و هەریەکە نەخشەی خۆی لێی دەکێشێت.

Where the analogy stops workingسنووری ئەم نموونەیە

Real routers write several kinds of card (next screen), and every card also carries an age and a sequence number.

ڕاستەقینە چەند جۆرێک کارت دەنووسن (شاشەی داهاتوو) و هەموو کارتێک تەمەن و پێیە.

The main LSA typesجۆرە سەرەکییەکانی LSA

OSPF has several kinds of LSA. In a single-area network you mostly meet types 1 and 2; types 3 and 5 come with several areas and with routes from outside OSPF (OSPF areas). The letters in show ip route tell you which kind a route came from.

چەند جۆرێک هەیە. لە یەک زۆرتر جۆری 1 و 2 دەبینیت؛ جۆری 3 و 5 لەگەڵ چەند و لەگەڵ ڕێگەکانی دەرەوەی OSPF دێن (ناوچەکانی OSPF). پیتەکانی show ip route پێت دەڵێن ڕێگەیەک لە کام جۆرەوە هاتووە.

The four LSA types you meet firstئەو چوار جۆرە سەرەتا دەیانبینیت
TypeجۆرNameناوMade byدروستکەرDescribesچی وەسف دەکاتFlooded toبۆ کوێ بڵاو دەبێتەوەRoute codeکۆدی ڕێگە
1Router LSAevery routerهەموو its own links and their costsبەستەرەکانی خۆی و تێچوویانits own area خۆیO
2Network LSAthe DR of a multi-access segment بڕێکی فرەدەستڕاگەیشتنthe routers attached to that segmentئەو بەو بڕەوە بەستراونits own area خۆیO
3Summary LSAan ABRnetworks of another area ترthe other areas ترO IA
5AS external LSAan ASBRroutes from outside OSPF, e.g. a default route to the ISPڕێگەکانی دەرەوەی OSPF، بۆ نموونە بەرەو the whole OSPF network (not stub areas)هەموو OSPF (جگە لە stub)O E2

Two more in one line: a type 4 LSA (ASBR summary) tells routers in other areas how to reach the ASBR, and a type 7 LSA carries outside routes inside an NSSA; the ABR turns it into type 5.

دوو جۆری تر بە یەک دێڕ: جۆری 4 ⁦(ASBR summary)⁩ بە تر دەڵێت چۆن بگەنە ASBR و جۆری 7 ڕێگەکانی دەرەوە لە ناو NSSAـدا دەگوازێتەوە؛ ABR دەیکات بە جۆری 5.

Four cards. Type 1 Router LSA: made by every router, says its own links and costs, stays in its area, route code O. Type 2 Network LSA: made by the DR of a segment, says the routers on one Ethernet, stays in its area, O. Type 3 Summary LSA: made by an ABR, says the networks of another area, goes into other areas, O IA. Type 5 External LSA: made by an ASBR, says routes from outside OSPF, floods the whole OSPF domain, O E2. Also: type 4 tells where the ASBR is; type 7 carries outside routes inside an NSSA.چوار کارت. جۆری 1 Router LSA: هەموو ڕێدۆزێک دروستی دەکات، بەستەر و تێچووی خۆی دەڵێت، لە ناوچەی خۆیدا دەمێنێتەوە، کۆدی ڕێگە O. جۆری 2 Network LSA: ڕێدۆزی دیاریکراوی بڕەکە دروستی دەکات، ڕێدۆزەکانی سەر یەک Ethernet دەڵێت، لە ناوچەی خۆیدا دەمێنێتەوە، O. جۆری 3 Summary LSA: ڕێدۆزی سنوورەناوچە دروستی دەکات، ڕایەڵەکانی ناوچەیەکی تر دەڵێت، دەچێتە ناوچەکانی ترەوە، O IA. جۆری 5 External LSA: ASBR دروستی دەکات، ڕێگەکانی دەرەوەی OSPF دەڵێت، بە هەموو ڕایەڵەی OSPFـدا بڵاو دەبێتەوە، O E2. هەروەها: جۆری 4 دەڵێت ASBR لە کوێیە؛ جۆری 7 ڕێگەی دەرەوە لە ناو NSSAـدا دەگوازێتەوە.
Who writes which card, and how far it travels.کێ کام کارت دەنووسێت و تا کوێ دەڕوات.CêIT

Flooding: how one change reaches everyoneلافاوکردن: گۆڕانێک چۆن دەگاتە هەمووان

When something changes — a link goes up or down, or a cost changes — the router next to it writes a new LSA and floods it: it sends an LSU to every neighbour. Each neighbour answers with an LSAck, stores the LSA in its LSDB and sends it on to its own neighbours, but not back to where it came from. Within moments every router in the area has the same new LSA. The name comes from a flood of water: the news pours out in every direction at once.

کاتێک شتێک دەگۆڕێت — بەستەرێک کارا یان کوژاوە دەبێت، یان تێچوویەک دەگۆڕێت — ئەو لە تەنیشتیەتی نوێ دەنووسێت و بڵاوی دەکاتەوە (): LSUـێک بۆ هەموو دراوسێیەک دەنێرێت. هەر دراوسێیەک بە LSAck وەڵام دەداتەوە، لە LSDBـەکەیدا هەڵدەگرێت و بۆ دراوسێکانی خۆی دەینێرێتەوە، بەڵام نەک بۆ ئەو لایەی لێیەوە هاتووە. لە چەند ساتێکدا هەموو هەمان نوێیان هەیە. ناوەکەی لە لافاوی ئاو وەرگیراوە: هەواڵەکە لە یەک کاتدا بە هەموو لایەکدا دەڕژێت.

Animation of eight routers in one area. 1: R8’s LAN 172.16.3.0/24 comes up and R8 writes a new LSA (router ID 8.8.8.8, link 172.16.3.0/24, state UP, cost 10). 2: R8 sends it in an LSU to its neighbours R5, R6 and R7; each answers LSAck. 3: they pass it on to R1, R2, R3 and R4. 4: every router has the same copy and runs SPF; every routing table gains O 172.16.3.0/24, each with its own best path.
Animation of eight routers in one area. 1: R8’s LAN 172.16.3.0/24 comes up and R8 writes a new LSA (router ID 8.8.8.8, link 172.16.3.0/24, state UP, cost 10). 2: R8 sends it in an LSU to its neighbours R5, R6 and R7; each answers LSAck. 3: they pass it on to R1, R2, R3 and R4. 4: every router has the same copy and runs SPF; every routing table gains O 172.16.3.0/24, each with its own best path.
One new LSA, flooded router by router through the area.یەک نوێ، بە بە ناو بڵاو دەبێتەوە.CêIT

Flooding stays inside one area; that is one reason big networks are split into areas. The LSUs go to the multicast address 224.0.0.5, which every OSPF router hears; on an Ethernet segment with a DR, the other routers send them to 224.0.0.6 (the DR and the BDR) and the DR passes them on (the DR’s job).

لە ناو یەک دەمێنێتەوە؛ ئەمە یەکێکە لە هۆکارەکانی دابەشکردنی گەورە بۆ چەند . LSUـەکان بۆ ناونیشانی ⁦224.0.0.5⁩ دەچن کە هەموو OSPF گوێی لێ دەگرێت؛ لەسەر بڕێکی Ethernet کە DRـی هەیە، تر بۆ ⁦224.0.0.6⁩، واتە DR و BDR، دەینێرن و DR بڵاویان دەکاتەوە (کاری DR).

Quiet, but refreshed every 30 minutesبێدەنگ، بەڵام هەر ⁦30⁩ خولەک نوێ دەکرێتەوە

If nothing changes, OSPF is quiet: there are no tables every 30 seconds, only small hellos. But every router re-sends (refreshes) its own LSAs every 30 minutes with a higher sequence number, so the others know the information is still true. An LSA that nobody refreshes grows old; when its age reaches 60 minutes (MaxAge) it is removed from every LSDB. When two copies of one LSA meet, the one with the higher sequence number is newer and wins.

ئەگەر هیچ نەگۆڕێت، بێدەنگە: هەر ⁦30⁩ چرکە خشتە نانێرێت، تەنیا بچووک. بەڵام هەموو هەر ⁦30⁩ خولەک جارێک خۆی بە گەورەتر دووپاتە دەنێرێتەوە (نوێیان دەکاتەوە)، بۆ ئەوەی ئەوانی تر بزانن زانیارییەکە هێشتا ڕاستە. کە کەس نوێی نەکاتەوە پیر دەبێت؛ کاتێک تەمەنی دەگاتە ⁦60⁩ خولەک (MaxAge) لە هەموو LSDBـێک لادەبرێت. کاتێک دوو کۆپیی یەک بەیەک دەگەن، ئەوەی گەورەترە نوێترە و دەباتەوە.

Timeline from 0 to 60 minutes. While R8 is up, its LSA with sequence 0x80000001 is replaced at 30 minutes by a new copy with sequence 0x80000002 (refresh: a new copy, sequence + 1). If R8 is gone, its LSA 0x80000001 is never refreshed and is removed at MaxAge, 60 minutes. The higher sequence number is the newer LSA; every router keeps only the newest copy.هێڵی کات لە 0 تا 60 خولەک. تا R8 کار بکات، LSAـەکەی بە زنجیرەی 0x80000001 لە خولەکی 30دا بە کۆپییەکی نوێ بە زنجیرەی 0x80000002 دەگۆڕدرێت (نوێکردنەوە: کۆپییەکی نوێ، ژمارەی زنجیرە + 1). ئەگەر R8 نەمابێت، LSAـی 0x80000001ـی هەرگیز نوێ ناکرێتەوە و لە MaxAge، واتە 60 خولەک، لادەبرێت. ژمارەی زنجیرەی گەورەتر LSAـی نوێترە؛ هەموو ڕێدۆزێک تەنیا نوێترین کۆپی دەهێڵێتەوە.
Refresh at 30 minutes; removal at 60 minutes.نوێکردنەوە لە ⁦30⁩ خولەک؛ لابردن لە ⁦60⁩ خولەک.CêIT

SPF: from the map to the routing tableSPF: لە نەخشەوە بۆ خشتەی ڕێدۆزی

With the LSDB complete, each router runs SPF (shortest path first), which is Dijkstra’s algorithm, on it. The routers are the nodes of a graph, and the links with their costs are its edges. The router puts itself at the root and grows a shortest-path tree to every other router and network. The best routes go into its routing table with the code O. Every router has the same LSDB, but each builds its own tree, from its own place. Dijkstra step by step is in Dijkstra’s algorithm; the same idea in AI search is uniform-cost search.

کاتێک LSDB تەواو بوو، هەر SPF (shortest path first)، واتە ، لەسەری ئەنجام دەدات. و بەستەرەکان لەگەڵ تێچوویان ئەو . خۆی دەخاتە ڕەگی دارەکە و دارێکی بۆ هەموو و تر گەورە دەکات. باشترین ڕێگەکان بە کۆدی O دەچنە ناو . هەموو هەمان LSDBـی هەیە، بەڵام هەریەکە لە شوێنی خۆیەوە داری خۆی دروست دەکات. هەنگاو بە هەنگاو لە ئەلگۆریزمی دایکسترادایە؛ هەمان بیرۆکە لە گەڕانی ژیریی دەستکرددا گەڕانی کەمترین کۆستـە.

R1’s shortest-path tree on the exam network. Tree links in green: R1–R7 (R7 at cost 10), R1–R5 (20), R1–R2 (30), R5–R6 (50), R6–R8 (90), R8–R4 (95), R2–R3 (90) and R8 to subnet X (100). The links R7–R8 (180) and R3–R4 (20) are dashed: they are not on any best path of R1. R4 is reached through R8 (95), not through R2 and R3 (110).داری کورتترین ڕێگەکانی R1 لەسەر ڕایەڵەی پرسیارەکەی تاقیکردنەوە. بەستەرەکانی دار بە سەوز: R1–R7 (R7 بە تێچووی 10)، R1–R5 (20)، R1–R2 (30)، R5–R6 (50)، R6–R8 (90)، R8–R4 (95)، R2–R3 (90) و R8 بۆ ژێرڕایەڵەی X (100). بەستەرەکانی R7–R8 (180) و R3–R4 (20) پچڕپچڕن: لەسەر هیچ کورتترین ڕێگەیەکی R1 نین. R4 لە ڕێگەی R8ـەوە (95) دەگەیەنرێت، نەک لە ڕێگەی R2 و R3ـەوە (110).
Each router is the root of its own tree.هەر ڕەگی داری خۆیەتی.CêIT

Look at R4: R1 reaches it through R8 (cost 95), not through R2 and R3 (110). SPF finds such paths by itself. Here each link costs the same in both directions; in real OSPF every router sets the cost of its own outgoing interface.

سەیری ⁦R4⁩ بکە: ⁦R1⁩ لە ڕێگەی ⁦R8⁩ـەوە دەیگاتێ (تێچووی ⁦95⁩)، نەک لە ڕێگەی ⁦R2⁩ و ⁦R3⁩ـەوە ⁦(110). SPF⁩ خۆی ئەم جۆرە ڕێگانە دەدۆزێتەوە. لێرەدا تێچووی هەر بەستەرێک لە هەردوو ئاڕاستەدا وەک یەکە؛ لە OSPFـی ڕاستەقینەدا هەر تێچووی دەرچوونی خۆی دادەنێت.

Why OSPF converges fastبۆچی پێکگەیشتنی OSPF خێرایە

Convergence is the moment when all routers agree on the network again after a change (convergence). If the best path breaks, OSPF quickly finds the next best one, for three reasons. The router next to the change floods a new LSA at once, instead of waiting for a timer. Only that small LSA crosses the network, not whole tables. And every router computes its new routes by itself in a moment, instead of waiting for its neighbours’ results. If a neighbour dies without a word, the dead interval (40 s) finds it. RIP, in contrast, passes news one router per update round and then waits in hold-down timers.

ئەو ساتەیە کە دوای گۆڕانێک هەموو دیسان لەسەر ڕێک دەکەونەوە (پێکگەیشتن). ئەگەر باشترین ڕێگە بپچڕێت، بە خێرایی باشترین ڕێگەی دواتر دەدۆزێتەوە، بە سێ هۆکار. ئەو لە تەنیشت گۆڕانەکەیە دەستبەجێ نوێ بڵاو دەکاتەوە، نەک چاوەڕێی بکات. تەنیا ئەو بچووکە بە دەڕوات، نەک خشتەی تەواو. هەروەها هەموو خۆی لە ساتێکدا ڕێگە نوێیەکانی حیساب دەکات، نەک چاوەڕێی ئەنجامی دراوسێکانی بکات. ئەگەر دراوسێیەک بێدەنگ بمرێت، کاتی Dead (کە ⁦40⁩ چرکەیە) دەیدۆزێتەوە. لە بەرانبەردا هەواڵ لە هەر خولێکی نوێکردنەوەدا تەنیا یەک دەباتە پێشەوە و پاشان لە چاوەڕێ دەکات.

Two lanes after a link fails. OSPF: a new LSA is flooded at once, every router gets the same news, each router runs SPF by itself — usually converged within seconds. RIP: the news waits for the next update, moves one router further each round, and hold-down timers wait before trusting a new path — it can take minutes.دوو هێڵ دوای تێکچوونی بەستەرێک. OSPF: LSAـی نوێ دەستبەجێ بڵاو دەبێتەوە، هەموو ڕێدۆزێک هەمان هەواڵ وەردەگرێت، هەر ڕێدۆزێک خۆی SPF ئەنجام دەدات — پێکگەیشتن زۆرجار لە چەند چرکەیەکدا تەواو دەبێت. RIP: هەواڵەکە چاوەڕێی نوێکردنەوەی داهاتوو دەکات، هەر جارێک یەک ڕێدۆز زیاتر دەڕوات و تایمەرەکانی ڕاگرتن پێش متمانەکردن بە ڕێگەیەکی نوێ چاوەڕێ دەکەن — لەوانەیە چەند خولەکێک بخایەنێت.
OSPF: seconds. RIP: possibly minutes.: چەند چرکەیەک. : لەوانەیە چەند خولەکێک.CêIT

Common mistakesهەڵە باوەکان

Exercisesڕاهێنانەکان

ExerciseڕاهێنانCosts, old and newتێچوو، کۆن و نوێ

Calculate the OSPF cost of these interfaces, first with the default reference bandwidth and then after auto-cost reference-bandwidth 10000: Serial (1544 kbit/s), Fast Ethernet, Gigabit Ethernet, 10 Gigabit Ethernet.

تێچووی ئەم حیساب بکە، سەرەتا بە پێوەری بنەڕەت و پاشان دوای auto-cost reference-bandwidth 10000: ⁦Serial (1544 kbit/s)⁩، Fast Ethernet، Gigabit Ethernet، ⁦10 Gigabit Ethernet⁩.

Hintئاماژە

Work in kbit/s: the default reference is 100000 kbit/s.

بە ⁦kbit/s⁩ کار بکە: پێوەری بنەڕەت ⁦100000 kbit/s⁩ـە.

Show answerوەڵامەکە پیشان بدە
InterfaceReference 100پێوەر ⁦100⁩Reference 10000پێوەر ⁦10000⁩
Serial 1544 kbit/s646476
Fast Ethernet1100
Gigabit Ethernet110
10 Gigabit Ethernet11

Divide and drop the decimals: 100000÷1544=64.8100000 \div 1544 = 64.8 → 64; 10000000÷1544=6476.710000000 \div 1544 = 6476.7 → 6476 (both in kbit/s). Anything below 1 becomes 1.

دابەش بکە و بەشی دەیی فڕێ بدە: 100000÷1544=64.8100000 \div 1544 = 64.8 ← ⁦64⁩؛ 10000000÷1544=6476.710000000 \div 1544 = 6476.7 ← ⁦6476⁩ (هەردووکیان بە ⁦kbit/s⁩). هەر شتێک لە 1 کەمتر بێت دەبێتە 1.

ExerciseڕاهێنانExam style: two paths to subnet Yشێوازی تاقیکردنەوە: دوو ڕێگە بۆ ژێرڕایەڵەی Y

Subnet Y (1 Gbit/s) is behind R3. Path A: R1–R2 (100 Mbit/s), R2–R3 (100 Mbit/s). Path B: R1–R3 directly (10 Mbit/s). With the default reference, which path does OSPF take, and which would RIP take?

⁦Y (1 Gbit/s)⁩ لە پشت ⁦R3⁩ـەوەیە. ڕێگەی ⁦A: R1–R2 (100 Mbit/s)⁩، ⁦R2–R3 (100 Mbit/s)⁩. ڕێگەی ⁦B: R1–R3⁩ ڕاستەوخۆ ⁦(10 Mbit/s)⁩. بە پێوەری بنەڕەت، کام ڕێگە دەگرێت و کامیان دەگرت؟

Show answerوەڵامەکە پیشان بدە

OSPF: A = 1+1+1=31 + 1 + 1 = \mathbf{3}, B = 10+1=1110 + 1 = \mathbf{11}, so OSPF takes path A. RIP: path B reaches R3 in 1 hop and path A in 2, so RIP takes the slow path B.

: A = 1+1+1=31 + 1 + 1 = \mathbf{3}، B = 10+1=1110 + 1 = \mathbf{11}، بۆیە ڕێگەی A دەگرێت. : ڕێگەی B بە 1 دەگاتە ⁦R3⁩ و ڕێگەی A بە 2، بۆیە ڕێگە خاوەکەی B دەگرێت.

ExerciseڕاهێنانWhich router ID?کام ناسێنەری ڕێدۆز؟

A router has Loopback0 10.10.10.10, Loopback1 5.5.5.5, G0/0 192.168.50.1 (up) and G0/1 172.31.0.1 (down), and no router-id command. (a) Which router ID does OSPF choose? (b) An engineer then types router-id 3.3.3.3. What must she do before it is used? (c) Why do many engineers prefer (b) to (a)?

⁦Loopback0 10.10.10.10⁩، ⁦Loopback1 5.5.5.5⁩، ⁦G0/0 192.168.50.1 (up)⁩ و ⁦G0/1 172.31.0.1 (down)⁩ـی هەیە و ⁦router-id⁩ـی نییە. (أ) OSPF کام هەڵدەبژێرێت؟ (ب) ئەندازیارێک پاشان router-id 3.3.3.3 دەنووسێت. پێش بەکارهاتنی دەبێت چی بکات؟ (ج) بۆچی زۆر ئەندازیار (ب) لە (أ) پێ باشترە؟

Show answerوەڵامەکە پیشان بدە
  • (a) 10.10.10.10: loopbacks come first, and it is the higher loopback — 192.168.50.1 does not matter.
  • (b) clear ip ospf process (or a reload), then check with show ip protocols; save with copy running-config startup-config.
  • (c) A manual ID is known in advance, easy to read in outputs, and never changes when addresses change.
  • (أ) ⁦10.10.10.10⁩: یەکەمن و ئەمە بەرزترین loopbackـە — ⁦192.168.50.1⁩ گرنگ نییە.
  • (ب) clear ip ospf process (یان دووپاتە داگیرساندنەوە)، پاشان بە show ip protocols بیپشکنە؛ بە copy running-config startup-config پاشەکەوتی بکە.
  • (ج) IDـی دەستی پێشوەختە زانراوە، لە دەرچوونەکاندا ئاسان دەخوێندرێتەوە و بە گۆڕینی ناونیشانەکان ناگۆڕێت.
ExerciseڕاهێنانRIP and OSPF from memoryRIP و OSPF لە یادەوەری

Without looking back, write a table with six differences between RIP and OSPF: family, metric, limit, administrative distance, algorithm and what is sent on the links.

بەبێ سەیرکردنەوەی شاشەکانی پێشوو، خشتەیەک بە شەش جیاوازیی نێوان و بنووسە: خێزان، ، سنوور، ، و ئەوەی بە سەر بەستەرەکاندا دەنێردرێت.

Show answerوەڵامەکە پیشان بدە
RIPOSPF
Familyخێزانdistance vectorlink state
Metrichopscost (bandwidth)تێچوو ()
Limitسنوور15 hops⁦15⁩ noneنییە
AD120110
AlgorithmBellman-FordDijkstra (SPF)
Sentنێردراوwhole table every 30 sهەموو خشتەکە هەر ⁦30⁩ چرکەsmall LSAs on change; refresh every 30 min بچووک کاتی گۆڕان؛ نوێکردنەوە هەر ⁦30⁩ خولەک
ExerciseڕاهێنانExplain in your own wordsبە وشەی خۆت ڕوونی بکەرەوە

(a) What is the difference between an LSA, an LSU and the LSDB? (b) Why does OSPF converge faster than RIP? Answer each in two or three sentences.

(أ) جیاوازیی نێوان ، LSU و LSDB چییە؟ (ب) بۆچی لەهی خێراترە؟ هەریەکە بە دوو یان سێ ڕستە وەڵام بدەوە.

Show answerوەڵامەکە پیشان بدە

(a) An LSA is one router’s description of its links; an LSU is the packet that carries LSAs between neighbours; the LSDB is the collection of all LSAs, the same map in every router of the area. (b) A change is flooded at once as a small LSA, and every router recalculates by itself with SPF; RIP waits for periodic updates that move one router per round, plus hold-down timers.

(أ) وەسفی بۆ بەستەرەکانی؛ LSU ئەو کە لە نێوان دراوسێکاندا دەگوازێتەوە؛ LSDB کۆی هەموو ، هەمان نەخشە لە هەموو . (ب) گۆڕانێک دەستبەجێ وەک بچووک بڵاو دەبێتەوە و هەموو خۆی بە SPF دووپاتە حیساب دەکات؛ چاوەڕێی هەر ⁦30⁩ چرکە جارێک دەکات کە هەر جارێک تەنیا یەک زیاتر دەڕۆن، لەگەڵ .

Summaryکورتە

  • OSPF is the open-standard link-state IGP (OSPFv2 RFC 2328; OSPFv3 RFC 5340 for IPv6), AD 110, for small to very large networks.
  • Cost = reference bandwidth ÷ interface bandwidth (default reference 100 Mbit/s, never below 1); a route’s cost is the sum of its outgoing interfaces. It is set, not measured from traffic.
  • Links of 100 Mbit/s and faster all cost 1 by default: set the same auto-cost reference-bandwidth on every router.
  • Router ID: router-id → highest loopback → highest active interface; chosen at start, changed with clear ip ospf process.
  • Three steps: neighbour discovery, database exchange, route computation (SPF = Dijkstra).
  • LSA = a router’s description of its links (types 1, 2, 3, 5; also 4 and 7), carried in LSUs, kept in the LSDB, the same in every router of the area; flooded on change, refreshed every 30 minutes, removed at 60.
  • OSPF converges fast: changes flood at once and every router computes its own routes.
  • IGPـی و (⁦OSPFv2 RFC 2328⁩؛ ⁦OSPFv3 RFC 5340⁩ بۆ ⁦IPv6⁩)، ⁦110⁩، بۆ بچووک تا زۆر گەورە.
  • تێچوو = پێوەر ÷ (پێوەری بنەڕەت ⁦100 Mbit/s⁩، هەرگیز لە 1 کەمتر نییە)؛ تێچووی ڕێگەیەک کۆی دەرچوونیەتی. دادەنرێت، لە هاتوچۆوە ناپێورێت.
  • بەستەرەکانی ⁦100 Mbit/s⁩ و خێراتر بە بنەڕەت هەموویان تێچوویان 1ـە: هەمان auto-cost reference-bandwidth لەسەر هەموو دابنێ.
  • : router-id ← بەرزترین loopback ← بەرزترین کارا؛ لە دەستپێکدا هەڵدەبژێردرێت و بە clear ip ospf process دەگۆڕێت.
  • سێ هەنگاو: دۆزینەوەی دراوسێکان، ئاڵوگۆڕی ، ژماردنی ڕێگەکان (SPF = ).
  • = وەسفی بۆ بەستەرەکانی (جۆری 1، 2، 3، 5؛ هەروەها 4 و ⁦7⁩)، لە ناو LSUدا دەگوازرێتەوە و لە هەڵدەگیرێت کە لە هەموو وەک یەکە؛ کاتی گۆڕان بڵاو دەکرێتەوە، هەر ⁦30⁩ خولەک نوێ دەکرێتەوە و لە ⁦60⁩ خولەکدا لادەبرێت.
  • خێرایە: گۆڕانەکان دەستبەجێ بڵاو دەبنەوە و هەموو خۆی ڕێگەکانی حیساب دەکات.

Next: how two OSPF routers become neighbours, from Down to Full, and why Ethernet segments elect a DR — OSPF neighbours, DR and BDR. Then the commands: Configuring OSPF.

دواتر: دوو OSPF چۆن لە Downـەوە تا Full دەبنە دراوسێ و بۆچی بڕەکانی Ethernet DR هەڵدەبژێرن — دراوسێکانی OSPF، DR و BDR. پاشان : ڕێکخستنی OSPF.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

OSPF Neighbours: From Down to Full; DR and BDRڕێدۆزە دراوسێکانی OSPF: لە Downـەوە بۆ Full؛ DR و BDR

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.

Appearanceڕووکار

Modeدۆخ
Styleشێواز
Coloursڕەنگەکان

Saved on this device only.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.