Home » NetFlow และ sFlow: Network Traffic Visibility และ Analysis
NetFlow และ sFlow: Network Traffic Visibility และ Analysis
NetFlow และ sFlow: Network Traffic Visibility และ Analysis
NetFlow และ sFlow เป็น flow-based monitoring technologies ที่ให้ visibility เกี่ยวกับ network traffic ว่าใครคุยกับใคร ใช้ bandwidth เท่าไหร่ application อะไร และเมื่อไหร่ ต่างจาก SNMP ที่บอกแค่ utilization NetFlow/sFlow บอก traffic composition ช่วยในการ capacity planning, security analysis และ troubleshooting
SNMP บอกแค่ว่า link utilization เท่าไหร่ แต่ไม่บอกว่า traffic มาจากไหน ไปไหน application อะไร NetFlow/sFlow เติมเต็มช่องว่างนี้โดยให้ flow-level visibility ทำให้รู้ว่า YouTube กิน 40% ของ bandwidth หรือ server X ส่ง traffic ผิดปกติไปยัง external IP
NetFlow vs sFlow vs IPFIX
| Feature |
NetFlow v5 |
NetFlow v9/IPFIX |
sFlow |
| Developer |
Cisco |
Cisco/IETF |
InMon (multi-vendor) |
| Sampling |
ไม่มี (ทุก flow) |
Optional |
Always sampled (1:N packets) |
| Template |
Fixed format |
Template-based (flexible) |
Fixed + extensions |
| Layer |
L3-L4 |
L2-L7 (extensible) |
L2-L7 (packet header sample) |
| Performance Impact |
สูง (process ทุก packet) |
ปานกลาง |
ต่ำ (sampling) |
| Accuracy |
สูง (100% flows) |
สูง |
Statistical (ขึ้นกับ sample rate) |
| Vendor Support |
Cisco |
Multi-vendor |
Multi-vendor (open standard) |
Flow Record Fields
| Field |
ความหมาย |
ใช้ทำอะไร |
| Source IP |
IP ต้นทาง |
ระบุ host ที่ส่ง traffic |
| Destination IP |
IP ปลายทาง |
ระบุ host ที่รับ traffic |
| Source Port |
Port ต้นทาง |
ระบุ application/session |
| Destination Port |
Port ปลายทาง |
ระบุ service (80=HTTP, 443=HTTPS) |
| Protocol |
IP protocol (TCP/UDP/ICMP) |
ระบุ protocol type |
| Bytes |
จำนวน bytes ใน flow |
วัด bandwidth usage |
| Packets |
จำนวน packets ใน flow |
วิเคราะห์ traffic pattern |
| Start/End Time |
เวลาเริ่ม/สิ้นสุด flow |
Duration analysis |
| TCP Flags |
SYN, ACK, FIN, RST |
Connection analysis, anomaly detection |
| ToS/DSCP |
QoS marking |
QoS verification |
NetFlow Architecture
| Component |
Role |
| Flow Exporter |
Router/switch ที่สร้าง flow records และส่งไป collector |
| Flow Collector |
Server ที่รับ + เก็บ flow data (database) |
| Flow Analyzer |
Application ที่วิเคราะห์ + แสดงผล flow data |
sFlow Detail
| Feature |
รายละเอียด |
| Sample Rate |
1:N (เช่น sample 1 ใน 1000 packets) |
| Counter Samples |
Interface counters ทุก polling interval |
| Flow Samples |
Sampled packet headers (first 128 bytes) |
| Transport |
UDP to sFlow collector |
| ข้อดี |
Low CPU impact, real-time, multi-vendor, L2 visibility |
| ข้อเสีย |
Statistical accuracy (ไม่ 100%), ต้อง tune sample rate |
Use Cases
| Use Case |
วิธีใช้ NetFlow/sFlow |
| Bandwidth Monitoring |
Top talkers, top applications, top destinations |
| Capacity Planning |
Traffic trends over time → forecast growth |
| Security (Anomaly Detection) |
DDoS detection, port scans, C2 communication, data exfiltration |
| Troubleshooting |
หา source ของ congestion, unexpected traffic |
| QoS Verification |
ตรวจว่า traffic ถูก classify/mark ถูกต้อง |
| Peering/Transit Analysis |
ISP: วิเคราะห์ traffic ratio สำหรับ peering |
| Compliance/Forensics |
เก็บ flow records สำหรับ audit trail |
Flow Collectors/Analyzers
| Tool |
Type |
จุดเด่น |
| ntopng |
Open-source |
Real-time flow analysis, web UI, DPI |
| ElastiFlow |
Open-source |
Elasticsearch + Kibana dashboards |
| PRTG |
Commercial |
All-in-one monitoring + flow analysis |
| SolarWinds NTA |
Commercial |
Enterprise flow analysis + alerting |
| ManageEngine NetFlow |
Commercial |
Affordable, good reporting |
| Kentik |
SaaS |
Cloud-based, AI-driven, SP-focused |
| nfdump/nfsen |
Open-source |
CLI tools + web frontend, lightweight |
Sample Rate Guidelines
| Link Speed |
sFlow Sample Rate |
หมายเหตุ |
| 100 Mbps |
1:200-500 |
Low speed → higher sample rate |
| 1 Gbps |
1:1000-2000 |
Standard |
| 10 Gbps |
1:2000-5000 |
Balance accuracy vs performance |
| 40-100 Gbps |
1:5000-10000 |
High speed → lower sample rate |
Best Practices
| Practice |
รายละเอียด |
| Enable บน key points |
WAN links, core switches, internet edge, DC gateways |
| ใช้ IPFIX ถ้าทำได้ |
IPFIX = standard, template-based, extensible (ดีกว่า NetFlow v5) |
| Tune sample rate |
sFlow: ปรับ sample rate ตาม link speed |
| Retention policy |
เก็บ detailed flows 7-30 วัน, aggregated 6-12 เดือน |
| Correlate กับ SNMP |
ใช้ SNMP สำหรับ utilization + flows สำหรับ composition |
| Security integration |
ส่ง flows ไป SIEM สำหรับ security analytics |
ทิ้งท้าย: Flows = Network Traffic Intelligence
NetFlow/sFlow = flow-based traffic visibility SNMP = how much? Flows = who, what, where, when? NetFlow = Cisco origin, IPFIX = standard, sFlow = sampled multi-vendor Use cases: bandwidth monitoring, security, capacity planning, troubleshooting Enable บน key links + tune sample rate + เก็บ retention ที่เหมาะสม
อ่านเพิ่มเติมเกี่ยวกับ Network Monitoring SNMP และ Network Capacity Planning ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com