Advanced OSPF: LSA Deep-Dive & SPF Tuning

CCIE Enterprise Infrastructure EVE-NG / GNS3

مقصدObjectiveObjective

اس سبق کے بعد آپ OSPF کے تمام اہم LSA اقسام سمجھ جائیں گے، SPF ٹائمرز ٹیون کرنا سیکھیں گے اور نیٹ ورک میں تیز convergence حاصل کر سکیں گے۔Is lesson ke baad aap OSPF ke tamam aham LSA types samajh jayenge, SPF timers tune karna seekhenge aur network mein fast convergence hasil kar sakenge.After this lesson you will understand all key OSPF LSA types, know how to tune SPF timers, and achieve fast convergence in your network.

آسان مثالSimple AnalogySimple Analogy

OSPF ایسا ہے جیسے ہر شہر کا ایک مکمل نقشہ سب کے پاس ہو — LSA وہ نقشے کے ٹکڑے ہیں جو ہر علاقہ (area) دوسروں کو بھیجتا ہے۔ SPF الگورتھم ہر کوئی اپنے نقشے پر سب سے چھوٹا راستہ خود حساب کرتا ہے۔OSPF aisa hai jaise har sheher ka mukammal map sab ke paas ho — LSA wo map ke tukray hain jo har area doosron ko bhejta hai. SPF algorithm har router apne map par sab se chhota rasta khud hisab karta hai.OSPF is like every city having a complete map — LSAs are the map pieces each area shares. Every router runs the SPF algorithm on its own copy of the map to compute the shortest path.

سیٹ اپLab SetupLab Setup

تین روٹرز (R1، R2، R3) کے ساتھ ایک مثلثی ٹوپولوجی بنائیں۔ تمام انٹرفیسز /30 پر۔ اسنیپ شاٹ لیں تاکہ SPF ٹائمرز کے تجربات کے بعد رول بیک کر سکیں۔Teen routers (R1, R2, R3) ke saath ek triangle topology banayein. Tamam interfaces /30 par. Snapshot lein taake SPF timer experiments ke baad rollback kar sakein.Build a three-router (R1, R2, R3) triangle topology. All interfaces /30. Take a snapshot so you can roll back after SPF timer experiments.

اقداماتStepsSteps

Step 1

R1 پر OSPF شروع کریں۔ Type-1 (Router LSA) ہر روٹر اپنے لنکس بتاتا ہے، Type-2 (Network LSA) DR منتخب شدہ نیٹ ورکس کے لیے بنتا ہے۔R1 par OSPF start karein. Type-1 (Router LSA) har router apne links batata hai, Type-2 (Network LSA) DR selected networks ke liye banta hai.Start OSPF on R1. Type-1 (Router LSA) advertises each router's own links; Type-2 (Network LSA) is built by the DR on multi-access networks.

router ospf 1
network 10.0.0.0 0.0.0.255 area 0

Step 2

Type-3 (Summary LSA) انٹر ایریا روٹس کے لیے ABR بناتا ہے۔ Type-5 (External LSA) ری ڈسٹریبیوٹڈ روٹس اور Type-7 (NSSA External) صرف NSSA ایریا کے لیے ہوتے ہیں۔Type-3 (Summary LSA) inter-area routes ke liye ABR banata hai. Type-5 (External LSA) redistributed routes aur Type-7 (NSSA External) sirf NSSA area ke liye hote hain.Type-3 (Summary LSA) is generated by the ABR for inter-area routes. Type-5 (External LSA) carries redistributed routes; Type-7 (NSSA External) is for NSSA areas only.

show ip ospf database

Step 3

ڈیٹابیس پڑھنا سیکھیں: کون سے LSA کس روٹر نے بنائے، ان کی عمر اور sequence number چیک کریں۔ اس سے OSPF troubleshooting آسان ہو جاتی ہے۔Database parhna seekhen: kaun se LSA kis router ne banaye, un ki age aur sequence number check karein. Is se OSPF troubleshooting asaan ho jati hai.Learn to read the database: which LSAs were originated by which router, their age and sequence numbers. This makes OSPF troubleshooting far easier.

show ip ospf database router
show ip ospf database network

Step 4

ڈیفالٹ SPF حساب 5 سیکنڈ بعد شروع ہوتا ہے۔ فاسٹ convergence کے لیے ایگزپوننشل بیک آف ٹائمرز استعمال کریں: پہلا حساب جلدی، پھر وقفہ بڑھتا جائے۔Default SPF calculation 5 seconds baad start hota hai. Fast convergence ke liye exponential backoff timers use karein: pehla calculation jaldi, phir gap barhta jaye.By default SPF waits 5 seconds. For fast convergence use exponential backoff timers: first calculation quickly, then the gap grows.

router ospf 1
timers throttle spf 50 5000 5000

Step 5

اسی طرح LSA generation کو بھی تھروٹل کریں تاکہ نیٹ ورک میں مسلسل تبدیلیوں (flapping) کی صورت میں CPU بچ جائے۔Isi tarah LSA generation ko bhi throttle karein taake network mein musalsal changes (flapping) ki soorat mein CPU bach jaye.Also throttle LSA generation so CPU is protected when the network flaps continuously.

router ospf 1
timers throttle lsa all 50 5000 5000

Step 6

کنورجنس ٹیسٹ کریں: R2 کا ایک لنک بند کریں اور R1 پر دیکھیں کہ OSPF روٹ کتنی جلدی اپڈیٹ ہوتا ہے۔ پھر لنک واپس آن کریں۔Convergence test karein: R2 ka ek link band karein aur R1 par dekhen ke OSPF route kitni jaldi update hota hai. Phir link wapas on karein.Test convergence: shut a link on R2 and watch how fast the OSPF route updates on R1. Then bring the link back up.

shutdown
show ip ospf statistics
no shutdown

Step 7

آخر میں stub ایریاز کا اثر دیکھیں: Type-5 اور Type-7 کو فلٹر کر کے ڈیٹابیس چھوٹا ہوتا ہے، جس سے SPF اور بھی تیز چلتا ہے۔Aakhir mein stub areas ka asar dekhen: Type-5 aur Type-7 filter kar ke database chhota hota hai, jis se SPF aur bhi tez chalta hai.Finally, observe stub area effects: filtering Type-5 and Type-7 shrinks the database, making SPF even faster.

area 1 stub
show ip ospf database summary

تصدیقVerifyVerify

یقین کریں کہ تمام راؤٹرز full adjacency میں ہیں، ڈیٹابیس میں تمام LSA اقسام موجود ہیں، اور SPF ٹائمرز نئے values پر سیٹ ہیں۔Yaqeen karein ke tamam routers full adjacency mein hain, database mein tamam LSA types maujood hain, aur SPF timers naye values par set hain.Confirm all routers are in full adjacency, all LSA types appear in the database, and SPF timers are set to the new values.

show ip ospf neighbor
show ip ospf | include SPF
show ip route ospf

خرابی دور کرناTroubleshootingTroubleshooting

⚠️ OSPF neighbor 'EXSTART' حالت میں پھنس گیا ہے۔OSPF neighbor 'EXSTART' state mein phans gaya hai.OSPF neighbor stuck in EXSTART state.

✅ عام طور پر MTU mismatch ہوتا ہے۔ دونوں طرف انٹرفیس MTU چیک کریں اور برابر کریں۔Aam tor par MTU mismatch hota hai. Dono taraf interface MTU check karein aur barabar karein.Usually an MTU mismatch. Check interface MTU on both sides and make them equal.

⚠️ SPF بہت دیر سے چل رہا ہے، convergence سست ہے۔SPF bohot der se chal raha hai, convergence slow hai.SPF runs very slowly, convergence is sluggish.

✅ ڈیفالٹ 5 سیکنڈ delay ہے۔ timers throttle spf سے کم کریں اور LSA database کا سائز چیک کریں — stub areas مدد کرتی ہیں۔Default 5 second delay hai. timers throttle spf se kam karein aur LSA database ka size check karein — stub areas madad karti hain.The default 5-second delay is the cause. Lower it with timers throttle spf and check LSA database size — stub areas help.

⚠️ ایک روٹ ڈیٹابیس میں ہے لیکن routing table میں نہیں آ رہا۔Ek route database mein hai lekin routing table mein nahi aa raha.A route is in the database but not in the routing table.

✅ Forwarding address reachable ہے یا نہیں چیک کریں (Type-5 کا عام مسئلہ) — اگر forwarding address کا روٹ نہیں تو OSPF اسے install نہیں کرے گا۔Forwarding address reachable hai ya nahi check karein (Type-5 ka aam masla) — agar forwarding address ka route nahi to OSPF use install nahi karega.Check whether the forwarding address is reachable (the classic Type-5 issue) — OSPF won't install the route if the forwarding address has no route.

انٹرویو سوالاتInterview Q&AInterview Q&A

❓ Type-3 اور Type-5 LSA میں کیا فرق ہے؟Type-3 aur Type-5 LSA mein kya farq hai?What is the difference between Type-3 and Type-5 LSAs?

Type-3 ABR بناتا ہے اور انٹر ایریا روٹس بتاتا ہے۔ Type-5 ASBR بناتا ہے اور OSPF کے باہر سے ری ڈسٹریبیوٹڈ روٹس (جیسے EIGRP یا static) بتاتا ہے اور پورے AS میں flood ہوتا ہے۔Type-3 ABR banata hai aur inter-area routes batata hai. Type-5 ASBR banata hai aur OSPF ke bahar se redistributed routes (jaise EIGRP ya static) batata hai aur puray AS mein flood hota hai.Type-3 is generated by the ABR and describes inter-area routes. Type-5 is generated by the ASBR for routes redistributed from outside OSPF (e.g. EIGRP or static) and floods the whole AS.

❓ SPF throttle timers کیوں استعمال کرتے ہیں؟SPF throttle timers kyun use karte hain?Why use SPF throttle timers?

تاکہ پہلا SPF حساب فوراً ہو (تیز convergence) لیکن مسلسل تبدیلیوں پر ہر بار حساب نہ چلے — وقفہ بڑھتا جاتا ہے اور CPU محفوظ رہتی ہے۔Taake pehla SPF calculation foran ho (tez convergence) lekin musalsal changes par har baar calculation na chale — gap barhta jata hai aur CPU mehfooz rehti hai.So the first SPF runs immediately (fast convergence) but during instability the delay grows exponentially, protecting CPU.