SiamCafe · Blog
Segment Routing Troubleshooting แก้ปัญหา — วิเคราะห์และแก้ไข SR Network
บทความ

Segment Routing Troubleshooting แก้ปัญหา — วิเคราะห์และแก้ไข SR Network

เผยแพร่ 28 พฤษภาคม 2569

Segment Routing

Segment Routing Troubleshooting SR-MPLS SRv6 ISIS OSPF Traffic Engineering Prefix SID Adjacency SID SRGB Label Policy Fast Reroute Service Chaining

FeatureSR-MPLSSRv6RSVP-TELDP
Label/SIDMPLS 20-bitIPv6 128-bitMPLSMPLS
IGP IntegrationISIS/OSPFISIS/OSPFSeparateSeparate
StateSource-routedSource-routedPer-hopPer-hop
Complexityต่ำปานกลางสูงปานกลาง
TE SupportSR PolicySR PolicyNativeไม่มี

SR-MPLS Troubleshooting

=== SR-MPLS Troubleshooting Commands ===

Step 1: Check IGP Adjacency

show isis neighbors

show ospf neighbor

show isis database detail

show isis segment-routing

Step 2: Verify SRGB (Segment Routing Global Block)

show segment-routing mpls state

show isis segment-routing global-block

! Default SRGB: 16000-23999

! All routers in domain MUST have same SRGB

Step 3: Check Prefix SID

show isis segment-routing prefix-sid-map

show isis route detail

! Verify Prefix SID is unique per prefix

! No SID conflicts across the network

Step 4: Verify Label Forwarding

show mpls forwarding-table

show mpls forwarding-table labels 16001

! Check SWAP/PUSH/POP actions

Step 5: Check SR Policy

show segment-routing traffic-eng policy all

show segment-routing traffic-eng policy name SR-POLICY-1

show segment-routing traffic-eng forwarding

Step 6: End-to-end Verification

traceroute mpls segment-routing 10.0.0.1/32

ping mpls segment-routing 10.0.0.1/32

traceroute sr-mpls 16001 16002 16003

IOS-XR Configuration

router isis CORE

address-family ipv4 unicast

segment-routing mpls

interface Loopback0

address-family ipv4 unicast

prefix-sid index 1

interface GigabitEthernet0/0/0/0

address-family ipv4 unicast

metric 10

segment-routing

global-block 16000 23999

from dataclasses import dataclass

@dataclass

class SRIssue:

issue: str

symptom: str

cause: str

command: str

fix: str

issues = [

SRIssue("No Prefix SID", "Label not in forwarding table", "SID not configured on Loopback", "show isis segment-routing prefix-sid", "Configure prefix-sid index under Loopback"),

SRIssue("SRGB Mismatch", "Label collision wrong forwarding", "Different SRGB on routers", "show segment-routing mpls state", "Align SRGB on all routers"),

SRIssue("SID Conflict", "Duplicate SID two prefixes", "Same SID index on different routers", "show isis segment-routing prefix-sid-map", "Assign unique SID per prefix"),

SRIssue("IGP Not Converged", "SR labels not learned", "ISIS/OSPF adjacency down", "show isis neighbors", "Fix IGP adjacency first"),

SRIssue("SR Policy Down", "Traffic not following TE path", "Segment list invalid or next-hop unreachable", "show sr traffic-eng policy", "Fix segment list or path"),

]

print("=== Common SR Issues ===")

for i in issues:

print(f" [{i.issue}]")

print(f" Symptom: {i.symptom}")

print(f" Cause: {i.cause}")

print(f" Command: {i.command}")

print(f" Fix: {i.fix}")

SRv6 Troubleshooting

=== SRv6 Troubleshooting ===

SRv6 Locator and SID

show segment-routing srv6 sid

show segment-routing srv6 locator

show segment-routing srv6 manager

SRv6 Configuration

segment-routing

srv6

locators

locator MAIN

micro-segment behavior unode psp-usd

prefix fc00:0:1::/48

SRv6 Functions

fc00:0:1:: — End (endpoint)

fc00:0:1:1:: — End.X (L3 cross-connect)

fc00:0:1:40:: — End.DT4 (decap to IPv4 VRF)

fc00:0:1:60:: — End.DT6 (decap to IPv6 VRF)

Verify SRv6 forwarding

show cef ipv6 fc00:0:1::/48

show route ipv6 fc00:0:1::/48

traceroute ipv6 fc00:0:2::1 source fc00:0:1::1

SRv6 VPN (L3VPN over SRv6)

vrf CUSTOMER-A

address-family ipv4 unicast

import route-target 100:1

export route-target 100:1

router bgp 65000

vrf CUSTOMER-A

address-family ipv4 unicast

segment-routing srv6

locator MAIN

alloc mode per-vrf

@dataclass

class SRv6Function:

function_name: str

behavior: str

use_case: str

sid_example: str

functions = [

SRv6Function("End", "Endpoint SRH processing", "Transit node", "fc00:0:1::"),

SRv6Function("End.X", "L3 cross-connect to next-hop", "Adjacency SID", "fc00:0:1:1::"),

SRv6Function("End.DT4", "Decap and lookup IPv4 VRF", "L3VPN PE", "fc00:0:1:40::"),

SRv6Function("End.DT6", "Decap and lookup IPv6 VRF", "L3VPN PE IPv6", "fc00:0:1:60::"),

SRv6Function("End.DX4", "Decap and forward IPv4", "Per-CE VPN", "fc00:0:1:41::"),

SRv6Function("End.B6.Encaps", "Encap with new SRH", "TE Policy binding", "fc00:0:1:b6::"),

SRv6Function("H.Encaps", "Headend encap SRH", "SR Policy headend", "N/A (headend)"),

]

print("\n=== SRv6 Functions ===")

for f in functions:

print(f" [{f.function_name}] {f.behavior}")

print(f" Use Case: {f.use_case} | SID: {f.sid_example}")

Traffic Engineering

# === SR Traffic Engineering ===

# SR Policy Configuration
# segment-routing
# traffic-eng
# policy SR-LOW-LATENCY
# color 10 end-point ipv4 10.0.0.5
# candidate-paths
# preference 100
# explicit segment-list LOW-LAT-PATH
# constraints
# segments
# dataplane mpls
# segment-list LOW-LAT-PATH
# index 10 mpls label 16002
# index 20 mpls label 16004
# index 30 mpls label 16005

# Flex-Algo Configuration
# router isis CORE
# flex-algo 128
# metric-type delay
# advertise-definition
# interface GigabitEthernet0/0/0/0
# address-family ipv4 unicast
# metric 10
# performance-measurement
# interface GigabitEthernet0/0/0/0
# delay-measurement

# On-Demand Next-hop (ODN)
# segment-routing
# traffic-eng
# on-demand color 10
# dynamic
# pcep
# metric type latency

@dataclass
class TEPolicy:
 name: str
 policy_type: str
 constraint: str
 path_type: str
 use_case: str
 status: str

policies = [
 TEPolicy("LOW-LATENCY", "Color 10", "Min Latency", "Dynamic PCEP", "VoIP Video", "Active"),
 TEPolicy("HIGH-BW", "Color 20", "Min Available BW", "Dynamic PCEP", "Backup Streaming", "Active"),
 TEPolicy("EXPLICIT-DC", "Color 30", "Explicit Path", "Static Segment List", "DC Interconnect", "Active"),
 TEPolicy("FLEX-ALGO-128", "Flex-Algo", "Delay Metric", "IGP Algo 128", "Latency-sensitive", "Active"),
 TEPolicy("DISJOINT", "Color 40", "Path Disjointness", "PCE Computed", "Redundancy", "Standby"),
]

print("SR-TE Policies:")
for p in policies:
 print(f" [{p.name}] Type: {p.policy_type} | Status: {p.status}")
 print(f" Constraint: {p.constraint} | Path: {p.path_type}")
 print(f" Use Case: {p.use_case}")

monitoring = {
 "IGP Adjacency": "show isis neighbors | include Up",
 "SR Labels": "show mpls forwarding-table | count",
 "SR Policy Status": "show sr traffic-eng policy all | include Active",
 "FRR Coverage": "show isis fast-reroute",
 "Link Delay": "show performance-measurement interfaces",
 "BFD Sessions": "show bfd session | include Up",
}

print(f"\n\nMonitoring Commands:")
for k, v in monitoring.items():
 print(f" [{k}]: {v}")

เคล็ดลับ

  • SRGB: ตรวจ SRGB ทุก Router ต้องตรงกัน ก่อน Troubleshoot อื่น
  • Unique SID: ทุก Prefix SID ต้อง Unique ทั้ง Domain
  • IGP First: แก้ IGP Adjacency ก่อน แล้ว SR จะตามมา
  • Traceroute: ใช้ traceroute mpls sr ตรวจ Label Path
  • Flex-Algo: ใช้ Flex-Algo สำหรับ Multiple Topology ง่ายกว่า TE Policy

Segment Routing คืออะไร

Network Architecture Segment SID Label SR-MPLS SRv6 IGP ISIS OSPF ไม่ต้อง LDP RSVP-TE Traffic Engineering Fast Reroute Service Chaining

Troubleshoot SR-MPLS อย่างไร

IGP Adjacency SRGB Prefix SID Label Table SR Policy traceroute mpls show isis segment-routing forwarding-table End-to-end

SRv6 ต่างจาก SR-MPLS อย่างไร

SR-MPLS Label 20-bit MPLS Infrastructure Migration SRv6 IPv6 128-bit SRH Network Programming End End.X End.DT4 Overhead มากกว่า ยืดหยุ่นกว่า

Traffic Engineering ด้วย SR ทำอย่างไร

SR Policy Explicit Path Segment List Controller Dynamic Constraint Bandwidth Latency Flex-Algo ODN BGP Color Binding SID Scalability

สรุป

Segment Routing Troubleshooting SR-MPLS SRv6 ISIS OSPF SRGB Prefix SID Label Traffic Engineering Flex-Algo SR Policy Fast Reroute Production Network