BGP Deep Dive: Path Attributes, Route Selection, Communities, Confederation และ Route Reflector

BGP Deep Dive: Path Attributes, Route Selection, Communities, Confederation และ Route Reflector

BGP (Border Gateway Protocol) เป็น routing protocol ที่ขับเคลื่อน internet ทั้งหมด Path Attributes กำหนดลักษณะของ routes, Route Selection Algorithm เลือก best path จากหลาย paths, Communities ใช้ tag routes สำหรับ policy, Confederation แบ่ง AS ใหญ่เป็น sub-AS เพื่อ scalability และ Route Reflector ลด iBGP full-mesh requirement

BGP เชื่อมต่อ 70,000+ Autonomous Systems บน internet: ทุก ISP, cloud provider, enterprise ที่มี public IP ต้องใช้ BGP การเข้าใจ BGP อย่างลึกซึ้ง ทั้ง path attributes, route selection process, community-based policy และ scaling techniques เป็นสิ่งจำเป็นสำหรับ network engineers ที่ทำงานกับ service providers หรือ large enterprises

BGP Path Attributes

Attribute Type Description Selection Priority
Weight Cisco-specific (local) Higher = preferred (default 0, locally originated = 32768) 1st (highest priority)
Local Preference Well-known, discretionary Higher = preferred (default 100) — propagated within iBGP 2nd
Locally Originated Prefer routes originated by local router (network/redistribute) 3rd
AS Path Well-known, mandatory Shorter AS path = preferred (list of ASes traversed) 4th
Origin Well-known, mandatory IGP (i) > EGP (e) > Incomplete (?) 5th
MED (Multi-Exit Discriminator) Optional, non-transitive Lower = preferred — suggest entry point to neighboring AS 6th
eBGP over iBGP Prefer eBGP-learned routes over iBGP 7th
IGP Metric Lowest IGP metric to next-hop = preferred 8th
Router ID Lowest Router ID = tiebreaker 9th (last resort)

Route Selection Algorithm (Detail)

Step Check Action
0. Valid? Next-hop reachable? Synchronized? Invalid routes eliminated first
1. Weight Highest weight wins Cisco local only — use for local preference override
2. Local Pref Highest local preference wins Primary tool สำหรับ inbound traffic engineering
3. Locally Originated Prefer locally originated routes network/redistribute/aggregate
4. AS Path Length Shortest AS path wins Can be manipulated with AS path prepending
5. Origin IGP > EGP > Incomplete Rarely decisive
6. MED Lowest MED wins (same neighbor AS only) Suggest preferred entry to neighbor
7. Path Type eBGP > iBGP Prefer externally-learned routes
8. IGP Metric Lowest IGP cost to next-hop Hot-potato routing (exit as quickly as possible)
9. Tiebreakers Oldest route, lowest Router ID, shortest cluster-list Final tiebreaker

BGP Communities

Community Type Format Use
Standard Community ASN:Value (e.g., 65000:100) Tag routes สำหรับ policy (local pref, prepend, filter)
Extended Community Type:ASN:Value (8 bytes) Route Target (VPN), Site of Origin, OSPF route type
Large Community ASN:Value1:Value2 (12 bytes) สำหรับ 4-byte ASN (32-bit AS numbers)
Well-Known: NO_EXPORT 65535:65281 ไม่ advertise ออกนอก AS (keep within confederation)
Well-Known: NO_ADVERTISE 65535:65282 ไม่ advertise ให้ใครเลย (keep local)
Well-Known: NO_EXPORT_SUBCONFED 65535:65283 ไม่ advertise ออกนอก sub-AS (confederation)

Community-Based Policy Examples

Community Meaning Action at ISP
ISP:100 Customer route — full transit Set local-pref 150, advertise to all peers
ISP:200 Peer route Set local-pref 100, advertise to customers only
ISP:300 Transit route (upstream) Set local-pref 80, advertise to customers only
ISP:666 Blackhole route Set next-hop to null → drop traffic (DDoS mitigation)
ISP:1000 Do not advertise to peer X Filter out when advertising to specific peer
ISP:2000 Prepend 1x to all peers AS path prepend 1 time (make path less preferred)

Route Reflector

Feature รายละเอียด
Problem iBGP requires full mesh: N routers = N(N-1)/2 sessions (100 routers = 4,950 sessions)
Solution Route Reflector (RR) reflects routes → clients only peer with RR (not full mesh)
RR Rules Client → RR → reflect to all clients + non-clients | Non-client → RR → reflect to clients only
Cluster ID Identifies RR cluster → prevent loops (routes with own cluster-ID = discard)
Originator ID Original router that injected route → prevent loops
Redundancy Deploy 2 RRs per cluster (redundant — both reflect same routes)
Hierarchy RR hierarchy: RR → sub-RR → clients (for very large networks)
Placement ไม่ต้องอยู่ใน data path (out-of-band RR) — dedicated VM/container ได้

Confederation

Feature รายละเอียด
Problem Same as RR — iBGP full mesh ไม่ scale
Solution แบ่ง AS ใหญ่เป็น sub-AS → eBGP between sub-AS (no full mesh needed)
External View ภายนอกเห็นเป็น single AS (confederation AS stripped ก่อน advertise ออก)
Confederation ASN ใช้ private ASN (64512-65535) สำหรับ sub-AS ภายใน
vs Route Reflector Confederation: more config complexity, better path diversity | RR: simpler, potential suboptimal routing
Use Case Very large SPs ที่มีหลาย regions (แต่ละ region = sub-AS)

Traffic Engineering with BGP

Direction Tool How
Outbound (from your AS) Local Preference Set higher local-pref สำหรับ preferred exit path
Outbound Weight (Cisco) Per-router preference (local only, not propagated)
Inbound (to your AS) AS Path Prepending Make path longer → less preferred by neighbors
Inbound MED Suggest entry point to neighbor (lower = preferred)
Inbound Communities Ask ISP to adjust local-pref/prepend via community tags
Blackhole Blackhole Community Send /32 with blackhole community → ISP null-routes (DDoS mitigation)

ทิ้งท้าย: BGP = The Protocol That Runs the Internet

BGP Deep Dive Path Attributes: Weight → Local Pref → AS Path → Origin → MED → eBGP/iBGP → IGP Metric → Router ID Route Selection: 9-step algorithm → deterministic best path selection Communities: standard (ASN:Value), extended (RT), large (4-byte ASN) → policy tagging Route Reflector: eliminate iBGP full mesh → clients peer with RR only → 2 RRs per cluster Confederation: split AS into sub-AS → eBGP between sub-AS → external sees single AS Traffic Engineering: outbound (local-pref, weight) | inbound (AS prepend, MED, communities) Key: BGP is simple concept (path vector) but complex operation — mastering attributes and policy is essential

อ่านเพิ่มเติมเกี่ยวกับ MPLS Deep Dive Labels LSP LDP และ VXLAN EVPN Fabric BGP EVPN ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com

จัดส่งรวดเร็วส่งด่วนทั่วประเทศ
รับประกันสินค้าเคลมง่าย มีใบรับประกัน
ผ่อนชำระได้บัตรเครดิต 0% สูงสุด 10 เดือน
สะสมแต้ม รับส่วนลดส่วนลดและคะแนนสะสม

© 2026 SiamLancard — จำหน่ายการ์ดแลน อุปกรณ์ Server และเครื่องพิมพ์ใบเสร็จ

SiamLancard
Logo
Free Forex EA Download — XM Signal · EA Forex ฟรี
iCafeForex.com - สอนเทรด Forex | SiamCafe.net
Shopping cart