SiamCafe.net Blog
Technology

IS-IS Protocol Performance Tuning เพิ่มความเร็ว

is is protocol performance tuning เพมความเรว
IS-IS Protocol Performance Tuning เพิ่มความเร็ว | SiamCafe Blog
2026-03-22· อ. บอม — SiamCafe.net· 11,503 คำ

IS-IS Protocol คืออะไร

IS-IS (Intermediate System to Intermediate System) เป็น Link-state Routing Protocol ที่พัฒนาโดย ISO (International Organization for Standardization) เดิมออกแบบสำหรับ CLNS (Connectionless-mode Network Service) แต่ถูกขยายให้รองรับ IP ด้วย (Integrated IS-IS) ปัจจุบันใช้กันอย่างแพร่หลายใน ISP, Data Center และ Large Enterprise Network

จุดเด่นของ IS-IS คือทำงานบน Layer 2 โดยตรง ไม่พึ่ง IP Protocol จึงมีความยืดหยุ่นสูง รองรับ Multi-topology สำหรับ IPv4 และ IPv6 พร้อมกัน Scale ได้ดีกว่า OSPF สำหรับ Network ขนาดใหญ่ และมี Extension ที่รองรับ Segment Routing, Traffic Engineering และ MPLS

IS-IS Timer Tuning — ปรับ Timer ให้ Converge เร็วขึ้น

! === Cisco IOS-XR IS-IS Performance Tuning ===

router isis CORE
 is-type level-2-only
 net 49.0001.0000.0000.0001.00
 log adjacency changes
 log pdu drops

 ! SPF Timer Tuning (สำคัญที่สุด)
 ! initial-wait: รอก่อนรัน SPF ครั้งแรก (50ms)
 ! secondary-wait: รอก่อนรัน SPF ครั้งที่ 2 (200ms)
 ! max-wait: รอสูงสุดระหว่าง SPF runs (5000ms)
 address-family ipv4 unicast
  spf-interval initial-wait 50 secondary-wait 200 maximum-wait 5000
  spf prefix-priority critical tag 100
  spf prefix-priority high tag 200
  maximum-paths 16
  ! Incremental SPF — คำนวณเฉพาะส่วนที่เปลี่ยน
  ispf level 2
 !
 address-family ipv6 unicast
  spf-interval initial-wait 50 secondary-wait 200 maximum-wait 5000
  maximum-paths 16
 !

 ! LSP Generation Timer
 ! เร่งการสร้าง LSP เมื่อ Topology เปลี่ยน
 lsp-gen-interval initial-wait 50 secondary-wait 200 maximum-wait 5000

 ! LSP Refresh และ Lifetime
 lsp-refresh-interval 65000
 max-lsp-lifetime 65535

 ! LSP MTU — ตั้งให้ตรงกับ Interface MTU
 lsp-mtu 1492

 ! Overload Bit — ตั้งตอน Boot เพื่อไม่ให้ Transit Traffic ผ่านก่อนพร้อม
 set-overload-bit on-startup wait-for-bgp

 ! Interface Configuration
 interface GigabitEthernet0/0/0/0
  point-to-point        ! ลด DIS Election overhead
  hello-interval 1      ! Hello ทุก 1 วินาที (ปกติ 10)
  hello-multiplier 3    ! Dead interval = 3 วินาที (ปกติ 30)
  ! BFD สำหรับ Fast Failure Detection
  bfd minimum-interval 100
  bfd multiplier 3
  bfd fast-detect ipv4
  bfd fast-detect ipv6
  ! Metric
  address-family ipv4 unicast
   metric 10
  address-family ipv6 unicast
   metric 10
 !

 ! Loopback Interface
 interface Loopback0
  passive
  address-family ipv4 unicast
   prefix-sid index 1    ! Segment Routing SID
  address-family ipv6 unicast
   prefix-sid index 101
 !

! === BFD Configuration ===
bfd
 multipath include location 0/0/CPU0
 !
 interface GigabitEthernet0/0/0/0
  echo disable
 !

! ตรวจสอบ
show isis spf-log
show isis lsp-log
show isis adjacency detail
show bfd session

Juniper JunOS IS-IS Configuration

# === Juniper JunOS IS-IS Performance Tuning ===

set protocols isis level 2 wide-metrics-only
set protocols isis level 1 disable
set protocols isis reference-bandwidth 1t
set protocols isis overload timeout 120

# SPF Timer Tuning
set protocols isis spf-options delay 50
set protocols isis spf-options holddown 200
set protocols isis spf-options rapid-runs 10

# LSP Generation Timer
set protocols isis lsp-lifetime 65535
set protocols isis lsp-refresh-interval 65000

# Interface Configuration
set protocols isis interface ge-0/0/0.0 point-to-point
set protocols isis interface ge-0/0/0.0 level 2 hello-interval 1
set protocols isis interface ge-0/0/0.0 level 2 hold-time 3
set protocols isis interface ge-0/0/0.0 level 2 metric 10
set protocols isis interface ge-0/0/0.0 bfd-liveness-detection minimum-interval 100
set protocols isis interface ge-0/0/0.0 bfd-liveness-detection multiplier 3

# Loopback
set protocols isis interface lo0.0 passive
set protocols isis interface lo0.0 level 2 metric 0

# Segment Routing
set protocols isis source-packet-routing srgb start-label 16000 index-range 8000
set protocols isis interface lo0.0 level 2 prefix-sid index 1

# Prefix Prioritization
set protocols isis prefix-export-limit 1000

# ตรวจสอบ
# show isis adjacency detail
# show isis spf log
# show isis database extensive
# show bfd session

Python Script วิเคราะห์ IS-IS Convergence

# วิเคราะห์ IS-IS Convergence Time จาก Log
import re
from datetime import datetime
from collections import defaultdict

def analyze_isis_convergence(log_file):
    """วิเคราะห์ IS-IS Convergence จาก Router Log"""

    events = []
    spf_runs = []

    # Pattern สำหรับ IS-IS Events
    adj_pattern = re.compile(
        r'(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+) '
        r'ISIS.*ADJ.*(?:UP|DOWN|INIT)\s+(\S+)\s+(\S+)'
    )
    spf_pattern = re.compile(
        r'(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+) '
        r'ISIS.*SPF.*duration\s+(\d+)ms.*nodes\s+(\d+)'
    )
    lsp_pattern = re.compile(
        r'(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+) '
        r'ISIS.*LSP.*(?:received|generated)\s+(\S+)'
    )

    with open(log_file) as f:
        for line in f:
            # Adjacency Events
            m = adj_pattern.search(line)
            if m:
                ts = datetime.strptime(m.group(1)[:23], "%Y-%m-%d %H:%M:%S.%f")
                events.append({
                    "time": ts,
                    "type": "adjacency",
                    "neighbor": m.group(2),
                    "state": m.group(3),
                })

            # SPF Runs
            m = spf_pattern.search(line)
            if m:
                ts = datetime.strptime(m.group(1)[:23], "%Y-%m-%d %H:%M:%S.%f")
                spf_runs.append({
                    "time": ts,
                    "duration_ms": int(m.group(2)),
                    "nodes": int(m.group(3)),
                })

    # วิเคราะห์ Convergence
    if spf_runs:
        durations = [s["duration_ms"] for s in spf_runs]
        print(f"=== IS-IS SPF Analysis ===")
        print(f"Total SPF Runs: {len(spf_runs)}")
        print(f"Avg Duration: {sum(durations)/len(durations):.1f} ms")
        print(f"Max Duration: {max(durations)} ms")
        print(f"Min Duration: {min(durations)} ms")
        print(f"P95 Duration: {sorted(durations)[int(len(durations)*0.95)]:.0f} ms")

    # Adjacency Events
    adj_downs = [e for e in events if e["state"] == "DOWN"]
    if adj_downs:
        print(f"\nAdjacency Down Events: {len(adj_downs)}")
        for e in adj_downs[-5:]:
            print(f"  {e['time']} - {e['neighbor']}")

    # Convergence Time = Adj Down → SPF Complete → RIB Updated
    for adj_down in adj_downs:
        next_spf = next(
            (s for s in spf_runs if s["time"] > adj_down["time"]),
            None
        )
        if next_spf:
            convergence = (next_spf["time"] - adj_down["time"]).total_seconds() * 1000
            convergence += next_spf["duration_ms"]
            print(f"\n  Adj Down: {adj_down['time']}")
            print(f"  SPF Start: {next_spf['time']}")
            print(f"  SPF Duration: {next_spf['duration_ms']}ms")
            print(f"  Total Convergence: {convergence:.0f}ms")

# analyze_isis_convergence("/var/log/router/isis.log")

Performance Tuning Checklist

ParameterDefaultRecommendedผลกระทบ
SPF Initial Wait5000ms50msลด Convergence Time หลัง Topology Change
SPF Secondary Wait5000ms200msลดเวลารอระหว่าง SPF Runs ต่อเนื่อง
SPF Max Wait10000ms5000msจำกัดเวลารอสูงสุดระหว่าง SPF Runs
LSP Gen Initial5000ms50msลดเวลาสร้าง LSP หลัง Topology Change
Hello Interval10s1sตรวจจับ Neighbor Down เร็วขึ้น
Hello Multiplier33Dead Interval = Hello × Multiplier
BFD IntervalN/A100msตรวจจับ Link Failure ใน 300ms
LSP Lifetime1200s65535sลดการ Refresh LSP ที่ไม่จำเป็น
LSP Refresh900s65000sลด Control Plane Overhead
Interface TypeBroadcastPoint-to-pointลด DIS Election, Converge เร็วขึ้น

Best Practices

IS-IS Protocol คืออะไร

IS-IS เป็น Link-state Routing Protocol ที่ทำงานบน Layer 2 โดยตรง ใช้กันมากใน ISP และ Data Center Network เพราะ Scale ได้ดี Converge เร็ว รองรับทั้ง IPv4 และ IPv6 ในตัว และมี Extension สำหรับ Segment Routing และ Traffic Engineering

IS-IS ต่างจาก OSPF อย่างไร

IS-IS ทำงานบน Layer 2 (CLNS) ส่วน OSPF ทำงานบน Layer 3 (IP) IS-IS Scale ได้ดีกว่า รองรับ Multi-topology ง่ายกว่า ไม่มี Area 0 Requirement และ Extensibility ดีกว่าผ่าน TLV OSPF มี Feature เฉพาะเช่น NSSA Area ที่ IS-IS ไม่มี

วิธีเพิ่มความเร็ว Convergence ของ IS-IS ทำอย่างไร

ปรับ SPF Timer (initial-wait 50ms), ลด LSP Generation Interval (50ms), เปิด Incremental SPF, ใช้ BFD (100ms interval) สำหรับ Fast Failure Detection, ลด Hello Interval เป็น 1 วินาที, ใช้ Point-to-Point Interface และตั้ง Prefix Prioritization สำหรับ Critical Routes

BFD คืออะไรและทำไมต้องใช้กับ IS-IS

BFD (Bidirectional Forwarding Detection) ตรวจจับ Link Failure ภายใน 300ms (100ms interval × 3 multiplier) แทนที่จะรอ IS-IS Hello Timer ที่ปกติ 10-30 วินาที ช่วยให้ IS-IS รู้ว่า Neighbor Down เร็วขึ้น 100 เท่าและ Converge ได้เร็วขึ้นมาก

สรุปและแนวทางปฏิบัติ

IS-IS Performance Tuning เป็นสิ่งจำเป็นสำหรับ Network ที่ต้องการ Fast Convergence สิ่งสำคัญที่สุดคือปรับ SPF Timer และ LSP Generation Timer ให้เร็ว เปิด BFD สำหรับ Sub-second Failure Detection ใช้ Point-to-Point Interface ลด DIS Overhead เปิด Incremental SPF ลดเวลาคำนวณ และ Monitor SPF Log เพื่อจับ Network Instability การปรับแต่งเหล่านี้สามารถลด Convergence Time จากหลายสิบวินาทีเหลือไม่ถึง 1 วินาที

📖 บทความที่เกี่ยวข้อง

Qwik Resumability Performance Tuning เพิ่มความเร็วอ่านบทความ → Tailwind CSS v4 Performance Tuning เพิ่มความเร็วอ่านบทความ → ACME Protocol Performance Tuning เพิ่มความเร็วอ่านบทความ → Airflow DAG Design Performance Tuning เพิ่มความเร็วอ่านบทความ → DALL-E API Performance Tuning เพิ่มความเร็วอ่านบทความ →

📚 ดูบทความทั้งหมด →