Network Traffic Monitoring & Analysis with GPUs Wenji - - PowerPoint PPT Presentation

network traffic monitoring analysis with gpus
SMART_READER_LITE
LIVE PREVIEW

Network Traffic Monitoring & Analysis with GPUs Wenji - - PowerPoint PPT Presentation

Network Traffic Monitoring & Analysis with GPUs Wenji Wu, Phil DeMar wenji@fnal.gov, demar@fnal.gov GPU Technology Conference 2013 March 18-21, 2013


slide-1
SLIDE 1

Network ¡Traffic ¡Monitoring ¡& ¡ Analysis ¡with ¡GPUs ¡

Wenji ¡Wu, ¡Phil ¡DeMar ¡ wenji@fnal.gov, ¡demar@fnal.gov ¡

¡

GPU ¡Technology ¡Conference ¡2013 ¡ March ¡18-­‑21, ¡2013 ¡SAN ¡JOSE, ¡CALIFORNIA ¡ ¡

slide-2
SLIDE 2

Background ¡

  • Main ¡uses ¡for ¡network ¡traffic ¡monitoring ¡& ¡analysis ¡tools: ¡

– OperaWons ¡& ¡management ¡ – Capacity ¡planning ¡ – Performance ¡troubleshooWng ¡

  • Levels ¡of ¡network ¡traffic ¡monitoring ¡& ¡analysis: ¡

– Device ¡counter ¡level ¡(snmp ¡data) ¡ – Traffic ¡flow ¡level ¡(flow ¡data) ¡ – At ¡the ¡packet ¡inspecWon ¡level ¡(The ¡Focus ¡of ¡this ¡work) ¡

  • security ¡analysis ¡
  • applicaWon ¡performance ¡analysis ¡
  • traffic ¡characterizaWon ¡studies ¡

2 ¡

slide-3
SLIDE 3

CharacterisWcs ¡of ¡packet-­‑based ¡network ¡monitoring ¡& ¡ analysis ¡applicaWons ¡

¡

  • Time ¡constraints ¡on ¡packet ¡processing. ¡
  • Compute ¡and ¡I/O ¡throughput-­‑intensive ¡
  • High ¡levels ¡of ¡data ¡parallelism. ¡ ¡

– Each ¡packet ¡can ¡be ¡processed ¡independently ¡

  • Extremely ¡poor ¡temporal ¡locality ¡for ¡data ¡ ¡

– Typically, ¡data ¡processed ¡once ¡in ¡sequence; ¡ ¡rarely ¡reused ¡

Background ¡(cont.) ¡

3 ¡

slide-4
SLIDE 4

Packet-­‑based ¡traffic ¡monitoring ¡& ¡analysis ¡tools ¡face ¡ performance ¡& ¡scalability ¡challenges ¡within ¡high-­‑ performance ¡networks. ¡

– High-­‑performance ¡networks: ¡

  • 40GE/100GE ¡link ¡technologies ¡
  • Servers ¡are ¡10GE-­‑connected ¡by ¡default ¡
  • ¡400GE ¡backbone ¡links ¡& ¡40GE ¡host ¡connecWons ¡loom ¡on ¡the ¡
  • horizon. ¡

– Millions ¡of ¡packets ¡generated ¡& ¡transmiced ¡per ¡sec ¡ ¡

The ¡Problem ¡

4 ¡

slide-5
SLIDE 5
  • Requirements ¡on ¡compuWng ¡pladorm ¡for ¡high ¡

performance ¡network ¡monitoring ¡& ¡analysis ¡ applicaWons: ¡

– High ¡Compute ¡power ¡ – Ample ¡memory ¡bandwidth ¡ – Capability ¡of ¡handing ¡data ¡parallelism ¡inherent ¡with ¡ network ¡data ¡ – Easy ¡programmability ¡

Monitoring ¡& ¡Analysis ¡Tool ¡Pladorms ¡(I) ¡

5 ¡

slide-6
SLIDE 6
  • Three ¡types ¡of ¡compuWng ¡pladorms: ¡

– NPU/ASIC ¡ – CPU ¡ – GPU ¡

Monitoring ¡& ¡Analysis ¡Tool ¡Pladorms ¡(II) ¡

Features ¡ NPU/ASIC ¡ CPU ¡ GPU ¡

High ¡compute ¡power ¡

Varies ¡ ✖ ¡ ✔ ¡

High ¡memory ¡bandwidth ¡

Varies ¡ ✖ ¡ ✔ ¡

Easy ¡programmability ¡

✖ ¡ ✔ ¡ ✔ ¡

Data-­‑parallel ¡execuEon ¡model ¡

✖ ¡ ✖ ¡ ✔ ¡

Architecture ¡Comparison ¡

6 ¡

slide-7
SLIDE 7

Our ¡SoluWon ¡

Use ¡GPU-­‑based ¡Traffic ¡Monitoring ¡& ¡Analysis ¡Tools ¡ Highlights ¡of ¡our ¡work: ¡

  • Demonstrated ¡GPUs ¡can ¡significantly ¡accelerate ¡network ¡

traffic ¡monitoring ¡& ¡analysis ¡

– 11 ¡million+ ¡pkts/s ¡without ¡drops ¡(single ¡Nvidia ¡M2070) ¡

  • Designed/implemented ¡a ¡generic ¡I/O ¡architecture ¡to ¡

move ¡network ¡traffic ¡from ¡wire ¡into ¡GPU ¡domain ¡

  • Implemented ¡a ¡GPU-­‑accelerated ¡library ¡for ¡network ¡

traffic ¡capturing, ¡monitoring, ¡and ¡analysis. ¡ ¡

– Dozens ¡of ¡CUDA ¡kernels, ¡which ¡can ¡be ¡combined ¡in ¡a ¡variety ¡of ¡ ways ¡to ¡perform ¡monitoring ¡and ¡analysis ¡tasks ¡

¡

7 ¡

slide-8
SLIDE 8

Key ¡Technical ¡Issues ¡

  • GPU’s ¡relaWvely ¡small ¡memory ¡size: ¡

– Nvidia ¡M2070 ¡has ¡6 ¡GB ¡Memory ¡ – Workarounds: ¡

  • Mapping ¡host ¡memory ¡into ¡GPU ¡with ¡zero-­‑copy ¡

technique? ¡ ¡

  • ParWal ¡packet ¡capture ¡approach ¡✔ ¡
  • Need ¡to ¡capture ¡& ¡move ¡packets ¡from ¡wire ¡into ¡

GPU ¡domain ¡without ¡packet ¡loss ¡

  • Need ¡to ¡design ¡data ¡structures ¡that ¡are ¡efficient ¡

for ¡both ¡CPU ¡and ¡GPU ¡

8 ¡

slide-9
SLIDE 9

System ¡Architecture ¡

...

  • 1. Traffic Capture
  • 2. Preprocessing

GPU Domain

Monitoring & Analysis Kernels Output

User Space

Output Output

  • 3. Monitoring & Analysis
  • 4. Output Display

Packet Buffer

Network Packets NICs

Packet Buffer Output

...

Capturing Captured Data Packet Chunks

  • Traffic ¡Capture ¡
  • Preprocessing ¡

Four ¡Types ¡of ¡Logical ¡EnWWes: ¡ ¡

  • Monitoring ¡& ¡Analysis ¡
  • Output ¡Display ¡

9 ¡

slide-10
SLIDE 10

Packet ¡I/O ¡Engine ¡

Free Packet Buffer Chunks

OS Kernel User Space

...

Capture Attach Recycle

Recv Descriptor Ring Packet Buffer Chunk

Incoming Packets NIC

...

Descriptor Segments

Processing Data

Key ¡techniques ¡

¡

  • Pre-­‑allocated ¡large ¡packet ¡buffers ¡
  • Packet-­‑level ¡batch ¡processing ¡
  • Memory ¡mapping ¡based ¡zero-­‑copy ¡

Key ¡OperaWons ¡

¡

  • Open ¡
  • Capture ¡
  • Recycle ¡
  • Close ¡

10 ¡

slide-11
SLIDE 11

GPU-­‑based ¡Network ¡Traffic ¡Monitoring ¡& ¡ Analysis ¡Algorithms ¡

  • A ¡GPU-­‑accelerated ¡library ¡for ¡network ¡traffic ¡

capturing, ¡monitoring, ¡and ¡analysis ¡apps. ¡

– Dozens ¡of ¡CUDA ¡kernels ¡ – Can ¡be ¡combined ¡in ¡a ¡variety ¡of ¡ways ¡to ¡perform ¡ intended ¡monitoring ¡& ¡analysis ¡operaWons ¡

11 ¡

slide-12
SLIDE 12

Packet-­‑Filtering ¡Kernel ¡

1 raw_pkts [ ] filtered_pkts [ ] filtering_buf [ ] scan_buf [ ]

index 1 2 3 4 5 6 7 1 2 3 4 5 6 7 index index 1 2 3

Filtering 1 Scan 2 Compact 3

p2 p1 p3 p5 p4 p6 p8 p7

1 1 1 1 1 2 3 3 3 4

p1 p3 p4 p7

x x x x

Advanced ¡packet ¡filtering ¡capabiliWes ¡at ¡wire ¡speed ¡are ¡necessary ¡ so ¡that ¡we ¡only ¡analyze ¡those ¡packets ¡of ¡interest ¡to ¡us. ¡ ¡

We ¡use ¡Berkeley ¡Packet ¡Filter ¡(BPF) ¡ as ¡the ¡packet ¡filter ¡ A ¡few ¡basic ¡GPU ¡operaWons, ¡such ¡ as ¡sort, ¡prefix-­‑sum, ¡and ¡compact. ¡

12 ¡

slide-13
SLIDE 13

Traffic-­‑AggregaWon ¡Kernel ¡

7 6 5 4 3 2 dst2 raw_pkts[ ] inc_scan_buf[ ] sorted_pkts[ ]

1 2 3 4 5 6 7 index

1 diff_buf[ ] 1 1 4 4 4 3 2 1 src1 dst1 1 src1 src2 dst4 src1 dst1 src1 dst1 src1 dst3 src2 dst4 src2 dst4 7 6 5 4 3 2 dst2 src1 dst1 1 src1 src2 dst4 src1 dst1 src1 dst1 src1 dst3 src2 dst4 src2 dst4 1 1 1 key_value[ ]

value key1 key2 value key1 key2

IP_Traffic [ ] stats stats stats stats

index 1 2 3

src1 dst1 dst2 src1 src1 dst3 src2 dst4

Reads ¡an ¡array ¡of ¡n ¡packets ¡at ¡pkts[] ¡and ¡aggregates ¡traffic ¡between ¡same ¡src ¡& ¡dst ¡IP ¡

  • addresses. ¡ ¡Exports ¡a ¡list ¡of ¡entries; ¡each ¡entry ¡records ¡a ¡src ¡& ¡dst ¡IP ¡address ¡pair, ¡with ¡

associated ¡traffic ¡staWsWcs ¡such ¡as ¡packets ¡and ¡bytes ¡sent ¡etc. ¡ ¡

Use ¡to ¡build ¡IP ¡conversaWons ¡

MulWkey-­‑Value ¡Sort ¡ Inclusive ¡Scan ¡

13 ¡

slide-14
SLIDE 14

Unique-­‑IP-­‑Addresses ¡Kernel ¡

1. ¡for ¡each ¡i∈[0,n-­‑1] ¡in ¡parallel ¡do ¡ ¡ ¡IPs[i] ¡≔ ¡src ¡or ¡dst ¡addr ¡of ¡pkts[i]; ¡ ¡ ¡end ¡for ¡

  • 2. ¡ ¡perform ¡sort ¡on ¡IPs[] ¡to ¡determine ¡sorted_IPs[]; ¡
  • 3. ¡ ¡diff_results[0] ¡=1; ¡

¡for ¡each ¡i∈[1,n-­‑1] ¡in ¡parallel ¡do ¡ ¡ ¡if(sorted_IPs[i] ¡≠sorted_IPs[i-­‑1]) ¡diff_buf[i]=1; ¡ ¡ ¡else ¡diff_buf[i]=0; ¡ ¡end ¡for ¡ 4. ¡perform ¡exclusive ¡prefix ¡sum ¡on ¡diff_buf[]; ¡ 5. ¡for ¡each ¡i∈[0,n-­‑1] ¡in ¡parallel ¡do ¡ ¡ ¡if(diff_buf[i] ¡==1) ¡Output[scan_buf[i]]=sorted_IPs[i]; ¡ ¡end ¡for ¡

It ¡reads ¡an ¡array ¡of ¡n ¡packets ¡at ¡pkts[] ¡ ¡and ¡outputs ¡a ¡list ¡of ¡ unique ¡src ¡or ¡dst ¡IP ¡addresses ¡seen ¡on ¡the ¡packets. ¡ ¡

14 ¡

slide-15
SLIDE 15

A ¡Sample ¡Use ¡Case ¡

Using ¡our ¡GPU-­‑accelerated ¡library, ¡we ¡developed ¡a ¡ sample ¡use ¡case ¡to ¡monitor ¡network ¡status: ¡ ¡

  • Monitor ¡networks ¡at ¡different ¡levels: ¡

– ¡from ¡aggregate ¡of ¡enWre ¡network ¡down ¡to ¡one ¡node ¡ ¡

  • Monitor ¡network ¡traffic ¡by ¡protocol ¡
  • Monitor ¡network ¡traffic ¡informaWon ¡per ¡node: ¡ ¡

– Determine ¡who ¡ ¡is ¡sending/receiving ¡the ¡most ¡traffic ¡ ¡ – For ¡both ¡local ¡and ¡remote ¡addresses ¡ ¡

  • Monitor ¡IP ¡conversaWons: ¡

– Characterizing ¡by ¡volume, ¡or ¡other ¡traits. ¡ ¡

15 ¡

slide-16
SLIDE 16

A ¡Sample ¡Use ¡Case ¡– ¡Data ¡Structures ¡ ¡

Three ¡key ¡data ¡structures ¡were ¡created ¡at ¡GPU: ¡ ¡

  • protocol_stat[] ¡

– ¡an ¡array ¡that ¡is ¡used ¡to ¡store ¡protocol ¡staWsWcs ¡for ¡network ¡ traffic, ¡with ¡each ¡entry ¡associated ¡with ¡a ¡specific ¡protocol. ¡ ¡

  • ip_snd[] ¡and ¡ip_rcv[] ¡ ¡

– arrays ¡that ¡are ¡used ¡to ¡store ¡traffic ¡staWsWcs ¡for ¡IP ¡ conversaWons ¡in ¡the ¡send ¡and ¡receive ¡direcWons, ¡respecWvely. ¡

  • ip_table ¡

– a ¡hash ¡table ¡that ¡is ¡used ¡to ¡keep ¡track ¡of ¡network ¡traffic ¡ informaWon ¡of ¡each ¡IP ¡address ¡node. ¡ ¡

These ¡data ¡structures ¡are ¡designed ¡to ¡reference ¡themselves ¡ and ¡each ¡other ¡with ¡relaWve ¡offsets ¡such ¡as ¡array ¡indexes. ¡ ¡

16 ¡

slide-17
SLIDE 17

A ¡Sample ¡Use ¡Case ¡– ¡Algorithm ¡

  • 1. Call ¡Packet-­‑filtering ¡kernel ¡to ¡filter ¡packets ¡of ¡

interest ¡

  • 2. Call ¡Unique-­‑IP-­‑addresses ¡kernel ¡to ¡obtain ¡IP ¡

addresses ¡

  • 3. Build ¡ ¡the ¡ip_table ¡with ¡a ¡parallel ¡hashing ¡algorithm ¡
  • 4. Collect ¡traffic ¡staWsWcs ¡for ¡each ¡protocol ¡and ¡each ¡

IP ¡node ¡

  • 5. Call ¡Traffic-­‑AggregaWon ¡kernel ¡to ¡build ¡IP ¡

conversaWons ¡

17 ¡

slide-18
SLIDE 18

Prototyped ¡System ¡

P0 P1 I O H I O H 10G-NIC M2070 Mem Mem QPI QPI QPI QPI PCI-E 10G-NIC PCI-E

Node 0 Node 1

PCI-E

Prototyped ¡System ¡

  • Our ¡applicaWon ¡is ¡developed ¡on ¡Linux. ¡
  • CUDA ¡4.2 ¡programming ¡environment. ¡
  • The ¡packet ¡I/O ¡engine ¡is ¡implemented ¡
  • n ¡Intel ¡82599-­‑based ¡10GigE ¡NIC ¡
  • A ¡two-­‑node ¡NUMA ¡system ¡
  • Two ¡8-­‑core ¡2.67GHz ¡Intel ¡X5650 ¡processors. ¡
  • Two ¡Intel ¡82599-­‑based ¡10GigE ¡NICs ¡
  • One ¡Nvidia ¡M2070 ¡GPU. ¡

18 ¡

slide-19
SLIDE 19

Performance ¡EvaluaWon ¡ Packet ¡I/O ¡Engine ¡

!"# $!"# %!"# &!"# '!"# (!!"# ($!"# ()&#*+,# $)!#*+,# $)%#*+,#

  • ./012#3.42561#7.21#

3-8#961:51;/<1=#

  • ./012>?.@16#

A12B.4# *-8CDEF# !"# $!"# %!"# &!"# '!"# (!!"# ($!"# ()&#*+,# $)!#*+,# $)%#*+,#

  • ./#/0123#
  • ./#45367389:30#

.19;3<=>1?35# @3<A1B# *./CDEF#

Packet ¡Capture ¡Rate ¡ CPU ¡Usage ¡

  • ¡Our ¡Packet ¡I/O ¡engine ¡(GPU-­‑I/O) ¡and ¡PacketShader ¡achieve ¡

nearly ¡100% ¡packet ¡capture ¡rate; ¡Netmap ¡suffers ¡significant ¡ packet ¡drops. ¡

  • Our ¡Packet ¡I/O ¡engine ¡requires ¡least ¡CPU ¡usage ¡

19 ¡

slide-20
SLIDE 20

!" #!!" $!!" %!!" &!!" '!!!" '#!!" '$!!" '%!!" '&!!" #!!!" '" #" (" $" )*+,-./0"123+"450267"82992:+,/0;<" )*=+>23+06"?@6@"A+6" :6@0;@>;BC=-B+*=" 33@=BC=-B+*=" ,=-B+*=B'D%E" ,=-B+*=B#D!E" ,=-B+*=B#D$E"

Performance ¡EvaluaWon ¡ ¡ GPU-­‑based ¡Packet ¡Filtering ¡Algorithm ¡

20 ¡

slide-21
SLIDE 21

!" #!!" $!!!" $#!!" %!!!" %#!!" &!!!" &#!!" '(" )*(" +,)"$&$-%%#-$!." +,)"$%/-$#-&!" ,0123456")781"9:67;<"=7>>7?1256@A" B(C"C7>;1D?" EF3G10F" 2F3G10FG$-HI" 2F3G10FG%-!I" 2F3G10FG%-JI"

Performance ¡EvaluaWon ¡ ¡ GPU-­‑based ¡Sample ¡Use ¡Case ¡

21 ¡

slide-22
SLIDE 22

50 100 150 200 250 300 0.4 0.6 0.8 1 Packet Size (Byte) Packet Ratio One NIC Experiments 50 100 150 200 250 300 0.4 0.6 0.8 1 Packet Size (Byte) Packet Ratio Two NIC Experiments 1.6GHz 2.0GHz 2.4GHz OnDemand 1.6GHz 2.0GHz 2.4GHz OnDemand

Performance ¡EvaluaWon ¡– ¡Overall ¡System ¡ Performance ¡

In ¡the ¡experiments: ¡ Generators ¡transmiced ¡packets ¡at ¡wire ¡rate. ¡ ¡ Packet ¡sizes ¡are ¡varied ¡across ¡the ¡experiments. ¡ ¡ Prototype ¡system ¡run ¡in ¡full ¡operaWon ¡with ¡sample ¡use ¡case. ¡ ¡

22 ¡

slide-23
SLIDE 23

Conclusion ¡

  • We ¡demonstrate ¡that ¡GPUs ¡can ¡significantly ¡

accelerate ¡network ¡traffic ¡monitoring ¡& ¡analysis ¡in ¡ high-­‑performance ¡networks. ¡

– 11 ¡million+ ¡pkts/s ¡without ¡drops ¡(single ¡Nvidia ¡M2070) ¡ ¡

  • We ¡designed/implemented ¡a ¡generic ¡I/O ¡

architecture ¡to ¡move ¡network ¡traffic ¡from ¡wire ¡into ¡ GPU ¡domain. ¡

  • We ¡implemented ¡a ¡GPU-­‑accelerated ¡library ¡for ¡

network ¡traffic ¡capturing, ¡monitoring, ¡and ¡analysis. ¡ ¡

– Dozens ¡of ¡CUDA ¡kernels, ¡which ¡can ¡be ¡combined ¡in ¡ various ¡ways ¡to ¡perform ¡monitoring ¡and ¡analysis ¡tasks. ¡

23 ¡

slide-24
SLIDE 24

QuesWon? ¡

Email: ¡wenji@fnal.gov ¡and ¡demar@fnal.gov ¡

Thank ¡You! ¡

24 ¡