Segment Routing Production Setup Guide —
Segment Routing Production

Segment Routing SR-MPLS SRv6 Traffic Engineering ISIS OSPF Node SID Adjacency SID TI-LFA SR Policy Production Network SRGB Performance Measurement
| Technology | Protocol | Complexity | Scale | Future |
|---|---|---|---|---|
| SR-MPLS | MPLS + IGP | ต่ำ | สูงมาก | Current |
| SRv6 | IPv6 + SRH | ปานกลาง | สูงมาก | Next-gen |
| RSVP-TE | RSVP + MPLS | สูง | ปานกลาง | Legacy |
| LDP | LDP + MPLS | ปานกลาง | สูง | Legacy |
SR-MPLS Configuration
=== Segment Routing MPLS Setup ===
Cisco IOS-XR — ISIS SR Configuration
router isis CORE
is-type level-2-only
net 49.0001.0000.0000.0001.00
address-family ipv4 unicast
metric-style wide
segment-routing mpls
segment-routing prefix-sid-map advertise-local
!
interface Loopback0
passive
address-family ipv4 unicast
prefix-sid index 1
!
interface GigabitEthernet0/0/0/0
point-to-point
address-family ipv4 unicast
fast-reroute per-prefix
fast-reroute per-prefix ti-lfa
!
SRGB Configuration
เนื้อหาเกี่ยวข้อง — ทำความเข้าใจ Apollo Server Disaster Recovery Plan
segment-routing
global-block 16000 23999
!
SR Policy (Traffic Engineering)
segment-routing
traffic-eng
segment-list PATH-TO-PE2
แนะนำเพิ่มเติม — อีบุ๊กการลงทุน SiamCafeBook
index 10 mpls label 16002
index 20 mpls label 16005
!
policy LOW-LATENCY
color 100 end-point ipv4 10.0.0.2
candidate-paths
preference 100
explicit segment-list PATH-TO-PE2
!
Juniper JunOS
set protocols isis interface lo0.0 passive
set protocols isis source-packet-routing
node-segment ipv4-index 1
set protocols isis source-packet-routing srgb start-label 16000 index-range 8000
from dataclasses import dataclass
เนื้อหาเกี่ยวข้อง — อ่านต่อ: งาน passive income มีอะไรบ้าง
from typing import List
@dataclass
class RouterConfig:
hostname: str
role: str
loopback: str
node_sid: int
isis_level: str
ti_lfa: bool
routers = [
RouterConfig("PE1", "Provider Edge", "10.0.0.1", 16001, "L2", True),
RouterConfig("P1", "Provider", "10.0.0.2", 16002, "L2", True),
RouterConfig("P2", "Provider", "10.0.0.3", 16003, "L2", True),
RouterConfig("P3", "Provider", "10.0.0.4", 16004, "L2", True),
แนะนำเพิ่มเติม — เรียนเทรดกับ iCafeForex
RouterConfig("PE2", "Provider Edge", "10.0.0.5", 16005, "L2", True),
]
print("=== SR Network Topology ===")
for r in routers:
print(f" [{r.hostname}] {r.role} | Lo0: {r.loopback}")
print(f" Node SID: {r.node_sid} | ISIS: {r.isis_level} | TI-LFA: {r.ti_lfa}")
TI-LFA Fast Reroute
# === TI-LFA (Topology Independent LFA) ===
# TI-LFA ให้ Fast Reroute < 50ms
# ไม่ต้อง Pre-compute Backup Path ทุก Topology
# ใช้ SR Label Stack สร้าง Backup Path
# IOS-XR TI-LFA Verification
# show isis fast-reroute summary
# show isis fast-reroute detail
# show mpls forwarding
# show segment-routing mapping-server prefix-sid-map
# Failover Test
# interface GigabitEthernet0/0/0/0
# shutdown
# ! — Traffic should reroute in < 50ms
@dataclass
class TILFAResult:
prefix: str
primary_path: str
backup_path: str
backup_labels: str
convergence_ms: int
tilfa = [
TILFAResult("10.0.0.5/32", "PE1->P1->PE2", "PE1->P2->P3->PE2",
"[16003, 16004, 16005]", 35),
TILFAResult("10.0.0.3/32", "PE1->P1->P2", "PE1->P3->P2",
"[16004, 16003]", 28),
TILFAResult("10.0.0.4/32", "PE1->P2->P3", "PE1->P1->P3",
"[16002, 16004]", 42),
]
print("\n=== TI-LFA Backup Paths ===")
for t in tilfa:
print(f" [{t.prefix}]")
print(f" Primary: {t.primary_path}")
print(f" Backup: {t.backup_path}")
print(f" Labels: {t.backup_labels} | Convergence: {t.convergence_ms}ms")
Monitoring และ Verification
=== SR Monitoring ===
Verification Commands (IOS-XR)
show segment-routing mpls state
show segment-routing mpls connected-prefix-sid-map
show isis segment-routing prefix-sid-map active-policy
เนื้อหาเกี่ยวข้อง — อ่านต่อ: virtualization hypervisor server คือ
show mpls traffic-eng tunnels
show segment-routing traffic-eng policy all
SR Performance Measurement
performance-measurement
interface GigabitEthernet0/0/0/0
delay-measurement
!
delay-profile interfaces default
advertisement
accelerated minimum-change 500
periodic interval 30
!
Python — SR Monitoring Script
import paramiko
import re
def get_sr_status(host, username, password):
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host, username=username, password=password)
stdin, stdout, stderr = ssh.exec_command(
'show segment-routing mpls connected-prefix-sid-map'
)
output = stdout.read().decode()
เนื้อหาเกี่ยวข้อง — แนะนำให้อ่าน triangle wedge pattern — คู่มือฉบับสมบูรณ์ 2026
sids = re.findall(r'(\d+\.\d+\.\d+\.\d+/\d+)\s+(\d+)', output)
return sids
deployment_checklist = {
"IGP SR-enabled": "ISIS/OSPF ทุก Router เปิด segment-routing",
"SRGB Consistent": "Global Block เดียวกันทุกตัว (16000-23999)",
"Node SID Unique": "ทุก Loopback มี Unique prefix-sid index",
"TI-LFA Enabled": "เปิด TI-LFA ทุก Interface",
"SR Policy": "สร้าง SR Policy สำหรับ Traffic Engineering",
"Monitoring": "SR-PM วัด Delay ทุก Link",
"Failover Test": "ทดสอบ Shutdown Link ตรวจ Convergence < 50ms",
"Backup Verified": "ตรวจ TI-LFA Backup Path ทุก Prefix",
}
print("Production Deployment Checklist:")
for item, desc in deployment_checklist.items():

print(f" [ ] {item}: {desc}")
เคล็ดลับ
- SRGB: ใช้ SRGB เดียวกันทุก Router ป้องกัน Label Conflict
- TI-LFA: เปิด TI-LFA ทุก Interface สำหรับ Fast Reroute < 50ms
- Node SID: วางแผน Node SID Index ให้เป็นระบบ
- Test: ทดสอบ Failover ก่อน Production ทุกครั้ง
- Monitor: ใช้ SR-PM วัด Delay และ Loss ทุก Link
การนำความรู้ไปประยุกต์ใช้งานจริง
แหล่งเรียนรู้ที่แนะนำ ได้แก่ Official Documentation ที่อัพเดทล่าสุดเสมอ Online Course จาก Coursera Udemy edX ช่อง YouTube คุณภาพทั้งไทยและอังกฤษ และ Community อย่าง Discord Reddit Stack Overflow ที่ช่วยแลกเปลี่ยนประสบการณ์กับนักพัฒนาทั่วโลก
เปรียบเทียบข้อดีและข้อเสีย
จากตารางเปรียบเทียบจะเห็นว่าข้อดีมีมากกว่าข้อเสียอย่างชัดเจน โดยเฉพาะในแง่ของประสิทธิภาพและความสามารถในการ Scale สำหรับข้อเสียส่วนใหญ่สามารถแก้ไขได้ด้วยการเรียนรู้อย่างเป็นระบบและวางแผนทรัพยากรให้เหมาะสม
Segment Routing คืออะไร
Network Architecture Segments Labels SIDs Source Routing ไม่ต้อง LDP RSVP-TE SR-MPLS SRv6 Traffic Engineering ลดความซับซ้อน
SR-MPLS กับ SRv6 ต่างกันอย่างไร
SR-MPLS Label Stack MPLS Network Transition ง่าย SRv6 IPv6 SRH Native Network Programming อนาคต ต้อง IPv6
ทำไมใช้ SR แทน RSVP-TE
Stateless ไม่ต้อง State ทุก Router ลด Complexity ไม่ต้อง LDP RSVP IGP อย่างเดียว Scale ดี TI-LFA < 50ms
Production Deployment ต้องเตรียมอะไร
IGP SR-enabled SRGB เดียวกัน Node SID Unique TI-LFA SR Policy Monitoring SR-PM Failover Test Backup Verify
สรุป
Segment Routing SR-MPLS SRv6 Production ISIS OSPF Node SID Adjacency SID SRGB TI-LFA Fast Reroute SR Policy Traffic Engineering Performance Measurement Monitoring





