Home » OSPF Advanced: Areas, LSA Types, Stub/NSSA และ Route Summarization
OSPF Advanced: Areas, LSA Types, Stub/NSSA และ Route Summarization
OSPF Advanced: Areas, LSA Types, Stub/NSSA และ Route Summarization
OSPF (Open Shortest Path First) เป็น link-state routing protocol ที่ใช้กันมากที่สุดใน enterprise networks OSPF Advanced topics ครอบคลุม multi-area design ที่ลด LSDB size และ SPF calculations, LSA Types ที่แต่ละชนิดมีหน้าที่ต่างกัน, Stub/NSSA areas ที่ลด external routes และ Route Summarization ที่ลดจำนวน routes ใน routing table
Single-area OSPF ไม่ scale ดีเมื่อ network ใหญ่ขึ้น: ทุก router มี full LSDB เหมือนกัน, SPF calculation ทำบ่อยเมื่อ topology เปลี่ยน และ routing table ใหญ่ Multi-area design แก้ปัญหานี้: แบ่ง network เป็น areas เล็กๆ → ลด LSDB per area, ลด SPF frequency และ summarize routes ระหว่าง areas
OSPF Area Types
| Area Type |
LSA 1-3 |
LSA 4-5 (External) |
LSA 7 (NSSA) |
Default Route |
| Normal (Backbone Area 0) |
Yes |
Yes |
No |
Optional |
| Normal (Non-backbone) |
Yes |
Yes |
No |
Optional |
| Stub |
Yes |
No (blocked) |
No |
Auto (ABR injects default) |
| Totally Stubby |
Yes (LSA 1-2 only) |
No |
No |
Auto (only default route from ABR) |
| NSSA |
Yes |
No (LSA 5 blocked) |
Yes (local external → LSA 7) |
Optional |
| Totally NSSA |
Yes (LSA 1-2 only) |
No |
Yes |
Auto (default from ABR) |
OSPF LSA Types
| LSA Type |
Name |
Generated By |
Scope |
| Type 1 |
Router LSA |
Every router |
Within area (ไม่ข้าม ABR) |
| Type 2 |
Network LSA |
DR (Designated Router) |
Within area (multi-access networks) |
| Type 3 |
Summary LSA |
ABR (Area Border Router) |
Between areas (inter-area routes) |
| Type 4 |
ASBR Summary LSA |
ABR |
Between areas (path to ASBR) |
| Type 5 |
AS External LSA |
ASBR |
Entire OSPF domain (external routes) |
| Type 7 |
NSSA External LSA |
ASBR in NSSA |
Within NSSA (converted to Type 5 at ABR) |
LSA Type Details
| LSA |
Contains |
ตัวอย่าง |
| Type 1 (Router) |
Router’s links + costs within area |
Router R1 มี link ไป 10.1.1.0/24 cost 10 |
| Type 2 (Network) |
DR reports attached routers on segment |
DR บน VLAN 10 มี R1, R2, R3 attached |
| Type 3 (Summary) |
Inter-area prefix + cost |
ABR advertise: Area 1 มี 10.1.0.0/16 cost 20 |
| Type 4 (ASBR Summary) |
Path to ASBR (router ID + cost) |
ABR advertise: ASBR 3.3.3.3 reachable via cost 15 |
| Type 5 (External) |
External prefix + metric type + cost |
ASBR redistributes: 0.0.0.0/0 E1 cost 1 |
| Type 7 (NSSA External) |
Same as Type 5 but within NSSA only |
ASBR in NSSA: 192.168.0.0/16 N1 cost 20 |
Stub Area
| Feature |
รายละเอียด |
| Purpose |
Block external routes (LSA 4, 5) → ลด LSDB + routing table size |
| Default Route |
ABR inject default route (0.0.0.0/0) เข้า stub area แทน |
| Requirement |
ทุก router ใน area ต้อง config เป็น stub (ตกลงกันทั้ง area) |
| Restriction |
ไม่สามารถมี ASBR ใน stub area (ไม่มี redistribution) |
| Virtual Link |
ไม่สามารถ transit virtual link ผ่าน stub area |
NSSA (Not-So-Stubby Area)
| Feature |
รายละเอียด |
| Purpose |
เหมือน Stub แต่อนุญาตให้มี ASBR (redistribution) ภายใน area |
| LSA 7 |
ASBR ใน NSSA สร้าง LSA 7 (แทน LSA 5) |
| Type 7 → Type 5 |
ABR convert LSA 7 → LSA 5 เมื่อ flood ออกไปนอก NSSA |
| External from outside |
LSA 5 จากภายนอกถูก block (เหมือน stub) |
| Default Route |
ไม่ auto-inject (ต้อง config manually บน ABR ถ้าต้องการ) |
Route Summarization
| Type |
Where |
Command (Cisco) |
| Inter-Area Summary |
ABR (Area Border Router) |
area [id] range [network] [mask] |
| External Summary |
ASBR (AS Boundary Router) |
summary-address [network] [mask] |
Route Summarization Benefits
| Benefit |
รายละเอียด |
| Smaller routing table |
หลาย specific routes → 1 summary route |
| Reduced LSA flooding |
Topology change ใน area → ไม่ flood ออกนอก area (ถ้า summary ไม่เปลี่ยน) |
| Faster convergence |
SPF calculation เร็วขึ้น (fewer routes to process) |
| Stability |
Flapping routes ภายใน area ไม่ affect areas อื่น |
OSPF Design Best Practices
| Practice |
รายละเอียด |
| Area 0 = Backbone |
ทุก area ต้อง connect กับ Area 0 (directly หรือ virtual link) |
| Max 50 routers per area |
Guideline: ไม่เกิน 50 routers ต่อ area (SPF performance) |
| Summarize at ABR |
Summarize routes ที่ ABR ทุกครั้งที่เป็นไปได้ |
| Stub areas for branches |
Branch offices → stub/totally stubby (ลด external routes) |
| NSSA for redistribution |
ถ้า branch ต้อง redistribute → ใช้ NSSA |
| Contiguous address space |
Plan IP addresses ให้ summarize ได้ (e.g., 10.1.0.0/16 per area) |
| Reference bandwidth |
Set auto-cost reference-bandwidth ให้ match ความเร็วจริง (e.g., 100G) |
ทิ้งท้าย: OSPF Multi-Area = Scale + Stability
OSPF Advanced Multi-area: ลด LSDB size + SPF calculations + routing table LSA Types: 1 (Router), 2 (Network), 3 (Summary), 5 (External), 7 (NSSA) Stub: block external LSA 4/5 → inject default route NSSA: like stub + allow local redistribution (LSA 7) Summarization: ABR (inter-area) + ASBR (external) → fewer routes + stability ≤ 50 routers per area + summarize at ABR + contiguous addressing
อ่านเพิ่มเติมเกี่ยวกับ BGP Route Filtering และ BGP Communities ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com