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 و بۆچی خێرایە.
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 دوو ڕێگەی جیاواز هەڵدەبژێرن.
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).
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ـە و ڕایەڵە گەورەکان دابەش دەکرێن بۆ .
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)، بەڵام نەخشەی خۆی دروست دەکات و خۆی حیساب دەکات.
| Featureتایبەتمەندی | RIP | OSPF |
|---|---|---|
| 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) کۆ دەکاتەوە و خشتەی خۆی حیساب دەکات |
| Metric | hop countژمارەی | cost, from the bandwidthتێچوو، لە |
| Limitسنوور | 15 hops on a path (16 = unreachable)15 لە ڕێگەیەکدا (16 = ناگات) | no hop limitسنووری نییە |
| Administrative distance | 120 | 110 |
| Algorithm | Bellman-Ford | Dijkstra (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 بچووک تا زۆر گەورە |
| Convergence | slow: 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 خولەک |
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:
is the cost, the reference bandwidth (100 Mbit/s unless you change it) and the bandwidth of the interface. The cost is a whole number: the decimals are dropped, and it is never less than 1.
تێچووە، پێوەرە (100 Mbit/s، ئەگەر نەیگۆڕیت) و . تێچوو : بەشی دەیی فڕێ دەدرێت و هەرگیز لە 1 کەمتر نابێت.
Example: a network has two paths to the destination network. The first crosses a 100 Mbit/s link, cost . The second crosses a 10 Mbit/s link, cost . OSPF sends the data over the first path, because 1 is less than 10.
نموونە: دوو ڕێگەی هەیە بەرەو مەبەست. یەکەمیان بە بەستەرێکی 100 Mbit/sـدا دەڕوات، تێچووی . دووەمیان بە بەستەرێکی 10 Mbit/sـدا، تێچووی . بە ڕێگەی یەکەمدا دەنێرێت، چونکە 1 لە 10 کەمترە.
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) — بۆیە بەستەرێک کە پڕە لە هاتوچۆ ڕێک هەمان تێچووی بەستەرێکی بێکاری هەیە. ، و هەڵەکان لە ژیانی ڕاستەقینەدا دەتوانن بەستەرێک خاوتر بکەن، بەڵام هەستیان پێ ناکات. دەتوانیت تێچوو بە دوو ڕێگە بە دەست بگۆڕیت:
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-configExplain the codeڕوونکردنەوەی کۆدەکە
- Lineدێڕی 2
ip ospf costsets the cost directly (1–65535). It wins over the formula.ip ospf costتێچوو ڕاستەوخۆ دادەنێت (1–65535). بەسەر هاوکێشەکەدا زاڵ دەبێت.- Lineدێڕی 5
bandwidthis in kbit/s. It changes only the number OSPF uses (here ), not the real speed of the link.bandwidthبە kbit/sـە. تەنیا ئەو ژمارەیە دەگۆڕێت کە بەکاری دەهێنێت (لێرەدا )، نەک خێرایی ڕاستەقینەی بەستەرەکە.- 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. , 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 یان خێراترە. ، بەڵام تێچوو هەرگیز لە 1 کەمتر نییە، بۆیە بەستەرێکی 100 Mbit/s، 1 Gbit/s و 10 Gbit/s هەموویان تێچوویان 1ـە. ئیتر ناتوانێت لێکیان جیا بکاتەوە و لەوانەیە ڕێگەیەکی خاویش پێ باشتر بێت، وەک لە وێنە جووڵاوەکەدا دەبینیت.


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 بیرت دەخاتەوە کە لە هەموو شوێنێک وەک یەک بێت:
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-configExplain the codeڕوونکردنەوەی کۆدەکە
- Lineدێڕی 2
Range 1–4294967 Mbit/s; the default is 100.
no auto-cost reference-bandwidthreturns 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 سێ ڕێگە هەیە. تێچووی هەریەکەیان کۆ بکەرەوە.
- Left, R1–R7–R8: .
- Middle, R1–R5–R6–R8: — the lowest, so OSPF uses this path.
- Right, R1–R2–R3–R4–R8: .
- 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: .
- ناوەڕاست، R1–R5–R6–R8: — کەمترینە، بۆیە ئەم ڕێگەیە بەکار دەهێنێت.
- ڕاست، R1–R2–R3–R4–R8: .
- ئەگەر لێرە کاری بکردایە، ڕێگەی چەپی هەڵدەبژارد: لەو ڕێگەیەوە 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یش بەکاری دەهێنێت. پێویست نییە ناونیشانێک بێت کە کەس بتوانێت بکات.
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 وەردەگیرێت؛ ئەگەر نەبوو لە بەرزترین ناونیشانی ، ئەگەر ئەویش نەبوو لە بەرزترین ناونیشانی کارا.
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: ناسێنەری ڕێدۆز دابنێ.
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-configExplain the codeڕوونکردنەوەی کۆدەکە
- Lineدێڕی 1-2
R1 took its highest interface address. In Packet Tracer, if
| includeis not accepted, typeshow ip protocolsand 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ـی پێ بدە (تەنیا یەک ناونیشان):
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-configExplain 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 کاتیش دەخاتە پێش هەموو پەیامێکی تۆمار.
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:
وەک هەموو ، فێر دەبێت، هاوبەشی دەکات و بڕیار دەدات (پرۆتۆکۆڵی ڕێدۆزی چی دەکات). بە سێ هەنگاو کار دەکات:
- 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.)
- 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.)
- Route computation. Each router runs SPF on its database and puts the best routes into its routing table. (The routing decision.)
- دۆزینەوەی دراوسێکان. کە OSPF دەست پێ دەکات سەرەتا تری OSPF لەسەر بەستەرەکانی دەدۆزێتەوە. هەر 10 چرکە جارێک دەنێرێت؛ ئەگەر دراوسێیەک بۆ کاتی Dead (بە بنەڕەت چوار ئەوەندەی کاتی Hello، واتە 40 چرکە) ڕاوەستان، بە کوژاوە دادەنرێت. (ناسینی ئەوەی کێ لەوێیە.)
- ئاڵوگۆڕی . دراوسێکان ئەو زانیارییانەی کە هەیانە بۆ یەکتری دەنێرن تا وەک یەک دەبن؛ دووەم بە هەمان شێوە ئەوەی دەیزانێت دەینێرێتەوە. (ڕاگەیاندنی ئەوەی هەریەکە دەیزانێت.)
- ژماردنی ڕێگەکان. هەر SPF لەسەر ئەنجام دەدات و باشترین ڕێگەکان دەخاتە ناو . (بڕیاری .)
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ـیان هەیە.
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 پێت دەڵێن ڕێگەیەک لە کام جۆرەوە هاتووە.
| Typeجۆر | Nameناو | Made byدروستکەر | Describesچی وەسف دەکات | Flooded toبۆ کوێ بڵاو دەبێتەوە | Route codeکۆدی ڕێگە |
|---|---|---|---|---|---|
| 1 | Router LSA | every routerهەموو | its own links and their costsبەستەرەکانی خۆی و تێچوویان | its own area خۆی | O |
| 2 | Network LSA | the DR of a multi-access segment بڕێکی فرەدەستڕاگەیشتن | the routers attached to that segmentئەو بەو بڕەوە بەستراون | its own area خۆی | O |
| 3 | Summary LSA | an ABR | networks of another area تر | the other areas تر | O IA |
| 5 | AS external LSA | an ASBR | routes 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.
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ـەکەیدا هەڵدەگرێت و بۆ دراوسێکانی خۆی دەینێرێتەوە، بەڵام نەک بۆ ئەو لایەی لێیەوە هاتووە. لە چەند ساتێکدا هەموو هەمان نوێیان هەیە. ناوەکەی لە لافاوی ئاو وەرگیراوە: هەواڵەکە لە یەک کاتدا بە هەموو لایەکدا دەڕژێت.


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ـێک لادەبرێت. کاتێک دوو کۆپیی یەک بەیەک دەگەن، ئەوەی گەورەترە نوێترە و دەباتەوە.
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ـی هەیە، بەڵام هەریەکە لە شوێنی خۆیەوە داری خۆی دروست دەکات. هەنگاو بە هەنگاو لە ئەلگۆریزمی دایکسترادایە؛ هەمان بیرۆکە لە گەڕانی ژیریی دەستکرددا گەڕانی کەمترین کۆستـە.
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 چرکەیە) دەیدۆزێتەوە. لە بەرانبەردا هەواڵ لە هەر خولێکی نوێکردنەوەدا تەنیا یەک دەباتە پێشەوە و پاشان لە چاوەڕێ دەکات.
Common mistakesهەڵە باوەکان
Exercisesڕاهێنانەکان
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وەڵامەکە پیشان بدە
| Interface | Reference 100پێوەر 100 | Reference 10000پێوەر 10000 |
|---|---|---|
| Serial 1544 kbit/s | 64 | 6476 |
| Fast Ethernet | 1 | 100 |
| Gigabit Ethernet | 1 | 10 |
| 10 Gigabit Ethernet | 1 | 1 |
Divide and drop the decimals: → 64; → 6476 (both in kbit/s). Anything below 1 becomes 1.
دابەش بکە و بەشی دەیی فڕێ بدە: ← 64؛ ← 6476 (هەردووکیان بە kbit/s). هەر شتێک لە 1 کەمتر بێت دەبێتە 1.
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 = , B = , 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 = ، B = ، بۆیە ڕێگەی A دەگرێت. : ڕێگەی B بە 1 دەگاتە R3 و ڕێگەی A بە 2، بۆیە ڕێگە خاوەکەی B دەگرێت.
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 withshow ip protocols; save withcopy 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ـی دەستی پێشوەختە زانراوە، لە دەرچوونەکاندا ئاسان دەخوێندرێتەوە و بە گۆڕینی ناونیشانەکان ناگۆڕێت.
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وەڵامەکە پیشان بدە
| RIP | OSPF | |
|---|---|---|
| Familyخێزان | distance vector | link state |
| Metric | hops | cost (bandwidth)تێچوو () |
| Limitسنوور | 15 hops15 | noneنییە |
| AD | 120 | 110 |
| Algorithm | Bellman-Ford | Dijkstra (SPF) |
| Sentنێردراو | whole table every 30 sهەموو خشتەکە هەر 30 چرکە | small LSAs on change; refresh every 30 min بچووک کاتی گۆڕان؛ نوێکردنەوە هەر 30 خولەک |
(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-bandwidthon every router. - Router ID:
router-id→ highest loopback → highest active interface; chosen at start, changed withclear 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زاراوە سەرەکییەکان
OSPF Neighbours: From Down to Full; DR and BDRڕێدۆزە دراوسێکانی OSPF: لە Downـەوە بۆ Full؛ DR و BDR
Related lecturesوانە پەیوەندیدارەکان
- OSPF Neighbours: From Down to Full; DR and BDRڕێدۆزە دراوسێکانی OSPF: لە Downـەوە بۆ Full؛ DR و BDR
- Configuring OSPF: Wildcard Masks, Networks and Passive Interfacesڕێکخستنی OSPF: ماسکە پێچەوانەکان، ڕایەڵەکان و نێوبەستە ناچالاکەکان
- Multi-Area OSPF and Virtual LinksOSPFـی فرەناوچەیی و بەستەرە گریمانەییەکان
- RIP: The Simplest Routing ProtocolRIP: سادەترین پرۆتۆکۆڵی ڕێدۆزی
- EIGRP: Cisco’s Advanced Distance-Vector ProtocolEIGRP: مەودای ئاڕاستەی پێشکەوتووی Cisco
- Your First Router: Interfaces and Addressesیەکەم ڕێدۆز: نێوبەستەکان و ناونیشانەکان
- Depth-Limited, Uniform-Cost, Iterative Deepening and Bidirectional Searchگەڕانی قووڵایی سنووردار، گەڕانی کەمترین کۆست، گەڕانی قووڵکردنەوەی پلەبەپلە و گەڕانی دووئاڕاستە
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- RFC 2328: OSPF Version 2 (IETF, 1998) — neighbour states, LSA types, LSRefreshTime 30 min, MaxAge 1 h, AllSPFRouters/AllDRouters
- RFC 5340: OSPF for IPv6 (OSPFv3, IETF, 2008)
- Cisco: OSPF Frequently Asked Questions — cost = reference bandwidth ÷ interface bandwidth, 100 Mbit/s reference, router ID, 1800-second LSA refresh
- Cisco IOS IP Routing: OSPF Command Reference (auto-cost reference-bandwidth: 1–4294967 Mbit/s, default 100; ip ospf cost overrides it)
- Cisco Networking Academy ENSA v7, Module 2: Single-Area OSPFv2 Configuration (router ID order and message, reference bandwidth, cost table)
- Cisco Press: Enterprise Networking, Security, and Automation Companion Guide (CCNAv7) — OSPFv2 chapters
- ipSpace.net: OSPF Router ID and Loopback Interface Myths (2025)
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.