GASPP: A GPU-Accelerated Stateful Packet Processing Framework - - PowerPoint PPT Presentation

gaspp a gpu accelerated stateful packet processing
SMART_READER_LITE
LIVE PREVIEW

GASPP: A GPU-Accelerated Stateful Packet Processing Framework - - PowerPoint PPT Presentation

GASPP: A GPU-Accelerated Stateful Packet Processing Framework Giorgos Vasiliadis, FORTH-ICS, Greece Lazaros Koromilas, FORTH-ICS, Greece Michalis Polychronakis,


slide-1
SLIDE 1

GASPP: ¡A ¡GPU-­‑Accelerated ¡Stateful ¡ Packet ¡Processing ¡Framework ¡ ¡

Giorgos ¡Vasiliadis, ¡FORTH-­‑ICS, ¡Greece ¡ Lazaros ¡Koromilas, ¡FORTH-­‑ICS, ¡Greece ¡ Michalis ¡Polychronakis, ¡Columbia ¡University, ¡USA ¡ So5ris ¡Ioannidis, ¡FORTH-­‑ICS, ¡Greece ¡

¡

slide-2
SLIDE 2

Network ¡Packet ¡Processing ¡

  • Computa5onally ¡and ¡memory-­‑intensive ¡ ¡
  • High ¡levels ¡of ¡data ¡parallelism ¡

– Each ¡packet ¡can ¡be ¡processed ¡in ¡parallel ¡

  • Poor ¡temporal ¡locality ¡for ¡data ¡

– Typically, ¡each ¡packet ¡is ¡processed ¡only ¡once ¡

slide-3
SLIDE 3

GPU ¡= ¡Graphics ¡Processing ¡Units ¡

  • Highly ¡parallel ¡manycore ¡devices ¡
  • Hundreds ¡of ¡cores ¡
  • High ¡memory ¡bandwidth ¡
  • Up ¡to ¡6GB ¡of ¡memory ¡
slide-4
SLIDE 4

GPUs ¡for ¡Network ¡Packet ¡Processing ¡

  • Gnort ¡[RAID’08] ¡
  • PacketShader ¡[SIGCOMM’10] ¡
  • SSLShader ¡[NSDI’11] ¡ ¡
  • MIDeA ¡[CCS’11], ¡Kargus ¡[CCS’12] ¡
  • … ¡
slide-5
SLIDE 5

GPUs ¡for ¡Network ¡Packet ¡Processing ¡

  • Gnort ¡[RAID’08] ¡
  • PacketShader ¡[SIGCOMM’10] ¡
  • SSLShader ¡[NSDI’11] ¡ ¡
  • MIDeA ¡[CCS’11], ¡Kargus ¡[CCS’12] ¡
  • … ¡

Independent/Monolithic ¡Designs ¡

¡

  • 1. A ¡lot ¡of ¡CPU-­‑side ¡code ¡even ¡for ¡simple ¡apps ¡
  • 2. Explicit ¡batching ¡
  • 3. Explicit ¡data ¡copies ¡and ¡PCIe ¡transfers ¡
slide-6
SLIDE 6

Need ¡a ¡framework ¡for ¡developing ¡GPU ¡ accelerated ¡packet ¡processing ¡applica5ons ¡

slide-7
SLIDE 7

TCP ¡Flow ¡State ¡ Management ¡ Packet ¡Scheduling ¡ Packet ¡Decoding ¡

GASPP ¡Framework ¡

Packet ¡ Reordering ¡

AES ¡ Regex ¡Match ¡ String ¡Match ¡ Firewall ¡

slide-8
SLIDE 8

GASPP ¡Framework ¡

  • Fast ¡user-­‑space ¡packet ¡capturing ¡
  • Modular ¡and ¡flexible ¡
  • Efficient ¡packet ¡scheduling ¡mechanisms ¡
  • TCP ¡processing ¡and ¡flow ¡management ¡support ¡
slide-9
SLIDE 9

GASPP ¡Framework ¡

  • Fast ¡user-­‑space ¡packet ¡capturing ¡
  • Modular ¡and ¡flexible ¡
  • Efficient ¡packet ¡scheduling ¡mechanisms ¡
  • TCP ¡processing ¡and ¡flow ¡management ¡support ¡
slide-10
SLIDE 10

Fast ¡user-­‑space ¡packet ¡capturing ¡

Use ¡a ¡single ¡user-­‑space ¡buffer ¡ between ¡the ¡NIC ¡and ¡the ¡GPU ¡ Stage ¡packets ¡back-­‑to-­‑back ¡to ¡ a ¡separate ¡buffer ¡

GPU NIC

DMA Buffer DMA Buffer

Main Memory CPU

DMA Buffer

Main Memory NIC GPU

slide-11
SLIDE 11

Fast ¡user-­‑space ¡packet ¡capturing ¡

Packets ¡size ¡ (#bytes) ¡ Gbit/s ¡ 64 ¡ 13.76 ¡ 128 ¡ 18.21 ¡ 256 ¡ 20.53 ¡ 512 ¡ 19.21 ¡ 1024 ¡ 19.24 ¡ 1518 ¡ 20.04 ¡ Packets ¡size ¡ (#bytes) ¡ Gbit/s ¡ 64 ¡ 2.06 ¡ 128 ¡ 4.03 ¡ 256 ¡ 8.07 ¡ 512 ¡ 16.13 ¡ 1024 ¡ 32.26 ¡ 1518 ¡ 47.83 ¡

>

GPU NIC

DMA Buffer DMA Buffer

Main Memory CPU

DMA Buffer

Main Memory NIC GPU

slide-12
SLIDE 12

Fast ¡user-­‑space ¡packet ¡capturing ¡

Packets ¡size ¡ (#bytes) ¡ Gbit/s ¡ 64 ¡ 13.76 ¡ 128 ¡ 18.21 ¡ 256 ¡ 20.53 ¡ 512 ¡ 19.21 ¡ 1024 ¡ 19.24 ¡ 1518 ¡ 20.04 ¡ Packets ¡size ¡ (#bytes) ¡ Gbit/s ¡ 64 ¡ 2.06 ¡ 128 ¡ 4.03 ¡ 256 ¡ 8.07 ¡ 512 ¡ 16.13 ¡ 1024 ¡ 32.26 ¡ 1518 ¡ 47.83 ¡

<

GPU NIC

DMA Buffer DMA Buffer

Main Memory CPU

DMA Buffer

Main Memory NIC GPU

slide-13
SLIDE 13

Why ¡staging ¡is ¡be_er ¡than ¡zero-­‑copy ¡

(for ¡small ¡packets) ¡

NIC’s ¡ Packet ¡ Buffer: ¡ ¡

0 ¡ 1536 ¡

Staging ¡buffer: ¡

Be1er ¡space ¡u6liza6on ¡=> ¡No ¡redundant ¡transfers ¡

slide-14
SLIDE 14

Selec5ve ¡scheme ¡

  • Packets ¡are ¡are ¡copied ¡back-­‑to-­‑back ¡to ¡a ¡separate ¡

buffer, ¡if ¡the ¡buffer ¡occupancy ¡is ¡sparse ¡

  • Otherwise, ¡they ¡are ¡transferred ¡directly ¡to ¡the ¡GPU ¡

GPU NIC

DMA Buffer DMA Buffer

Main Memory CPU

DMA Buffer

Main Memory NIC GPU

slide-15
SLIDE 15

GASPP ¡Framework ¡

  • Fast ¡user-­‑space ¡packet ¡capturing ¡
  • Modular ¡and ¡flexible ¡
  • Efficient ¡packet ¡scheduling ¡mechanisms ¡
  • TCP ¡processing ¡and ¡flow ¡management ¡support ¡
slide-16
SLIDE 16

Modular ¡and ¡Flexible ¡

  • Basic ¡abstrac5on ¡of ¡processing: ¡``modules’’ ¡

– processPacket(packet){ ... }

  • Modules ¡are ¡executed ¡sequen5ally ¡or ¡in ¡

parallel ¡

Module ¡1: ¡

IP-­‑learn ¡

Module ¡3: ¡

Encryption ¡

RX ¡

processPacket(…) processPacket(…)

TX ¡

processPacket(…)

Module ¡2: ¡

Content ¡ Inspection ¡

slide-17
SLIDE 17

Batch ¡Processing ¡Pipeline ¡

RX ¡ Module1 ¡ TX ¡ Module2 ¡

[me ¡

slide-18
SLIDE 18

Batch ¡Processing ¡Pipeline ¡

RX ¡ Module1 ¡ TX ¡ Module2 ¡ RX ¡ batch ¡

[me ¡

slide-19
SLIDE 19

Batch ¡Processing ¡Pipeline ¡

RX ¡ Module1 ¡ TX ¡ Module2 ¡ RX ¡ batch ¡ Batch ¡ processing ¡

[me ¡

copy ¡ to ¡GPU ¡

slide-20
SLIDE 20

Batch ¡Processing ¡Pipeline ¡

RX ¡ Module1 ¡ TX ¡ Module2 ¡ RX ¡ batch ¡ Batch ¡ processing ¡

[me ¡

copy ¡ to ¡GPU ¡

slide-21
SLIDE 21

Batch ¡Processing ¡Pipeline ¡

RX ¡ Module1 ¡ TX ¡ Module2 ¡ RX ¡ batch ¡ TX ¡batch ¡ Batch ¡ processing ¡

[me ¡

copy ¡ to ¡GPU ¡ copy ¡ to ¡CPU ¡

slide-22
SLIDE 22

GASPP ¡Framework ¡

  • Fast ¡user-­‑space ¡packet ¡capturing ¡
  • Modular ¡and ¡flexible ¡
  • Efficient ¡packet ¡scheduling ¡mechanisms ¡
  • TCP ¡processing ¡and ¡flow ¡management ¡support ¡
slide-23
SLIDE 23

Single ¡Instruc5on, ¡Mul5ple ¡Threads ¡

  • Threads ¡within ¡the ¡same ¡warp ¡have ¡to ¡execute ¡

the ¡same ¡instruc5ons ¡

  • Great ¡for ¡regular ¡computaEons! ¡

SIMT ¡group ¡ (warp) ¡

slide-24
SLIDE 24

Parallelism ¡in ¡packet ¡processing ¡ ¡

  • Network ¡packets ¡are ¡processed ¡in ¡batches ¡

– More ¡packets ¡=> ¡more ¡parallelism ¡

Batch ¡Size ¡ (#packets) ¡

Network ¡traffic ¡

slide-25
SLIDE 25

Dynamic ¡Irregulari5es ¡

  • Received ¡network ¡packets ¡mix ¡is ¡very ¡dynamic ¡ ¡

Batch ¡Size ¡ (#packets) ¡

slide-26
SLIDE 26

Dynamic ¡Irregulari5es ¡

  • Received ¡network ¡packets ¡mix ¡is ¡very ¡dynamic ¡ ¡

– Different ¡packet ¡lengths ¡

Batch ¡Size ¡ (#packets) ¡

slide-27
SLIDE 27

Dynamic ¡Irregulari5es ¡

  • Received ¡network ¡packets ¡mix ¡is ¡very ¡dynamic ¡ ¡

– Different ¡packet ¡lengths ¡ – Divergent ¡parallel ¡module ¡processing ¡

Batch ¡Size ¡ (#packets) ¡

¡ ¡ ¡

module ¡1 ¡ module ¡2 ¡ module ¡3 ¡

slide-28
SLIDE 28

Dynamic ¡Irregulari5es ¡

[me ¡

¡ ¡ ¡

module ¡1 ¡ module ¡2 ¡ module ¡3 ¡

warp ¡1 ¡ warp ¡2 ¡ warp ¡3 ¡ warp ¡4 ¡ warp ¡5 ¡ warp ¡6 ¡ warp ¡7 ¡

slide-29
SLIDE 29

Dynamic ¡Irregulari5es ¡

[me ¡

¡ ¡ ¡

module ¡1 ¡ module ¡2 ¡ module ¡3 ¡

warp ¡1 ¡ warp ¡2 ¡ warp ¡3 ¡ warp ¡4 ¡ warp ¡5 ¡ warp ¡6 ¡ warp ¡7 ¡

slide-30
SLIDE 30

Dynamic ¡Irregulari5es ¡

[me ¡

¡ ¡ ¡

module ¡1 ¡ module ¡2 ¡ module ¡3 ¡

warp ¡1 ¡ warp ¡2 ¡ warp ¡3 ¡ warp ¡4 ¡ warp ¡5 ¡ warp ¡6 ¡ warp ¡7 ¡

slide-31
SLIDE 31

Dynamic ¡Irregulari5es ¡

[me ¡

¡ ¡ ¡

module ¡1 ¡ module ¡2 ¡ module ¡3 ¡

warp ¡1 ¡ warp ¡2 ¡ warp ¡3 ¡ warp ¡4 ¡ warp ¡5 ¡ warp ¡6 ¡ warp ¡7 ¡

slide-32
SLIDE 32

Dynamic ¡Irregulari5es ¡

[me ¡

¡ ¡ ¡

module ¡1 ¡ module ¡2 ¡ module ¡3 ¡

warp ¡1 ¡ warp ¡2 ¡ warp ¡3 ¡ warp ¡4 ¡ warp ¡5 ¡ warp ¡6 ¡ warp ¡7 ¡

Low ¡warp ¡occupancy ¡

slide-33
SLIDE 33

Packet ¡grouping ¡

Batch ¡Size ¡ Batch ¡Size ¡

slide-34
SLIDE 34

Packet ¡grouping ¡

Ø Harmonized ¡execu5on ¡ Ø Symmetric ¡processing ¡

warp ¡1 ¡ warp ¡2 ¡ warp ¡3 ¡ warp ¡4 ¡ warp ¡5 ¡ warp ¡6 ¡ warp ¡7 ¡

[me ¡

slide-35
SLIDE 35

GASPP ¡Framework ¡

  • Fast ¡user-­‑space ¡packet ¡capturing ¡
  • Modular ¡and ¡flexible ¡
  • Efficient ¡packet ¡scheduling ¡mechanisms ¡
  • TCP ¡processing ¡and ¡flow ¡management ¡support ¡
slide-36
SLIDE 36

TCP ¡Flow ¡State ¡Management ¡

  • Maintain ¡the ¡state ¡of ¡TCP ¡connec5ons ¡

HtoD Tx GPU DtoH Rx Tx Rx HtoD GPU DtoH

Hash key : 4 bytes Connection Table State : 1 byte Seq CLIENT : 4 bytes Seq SERVER: 4 bytes Next : 4 bytes Connection Record Connection Records

slide-37
SLIDE 37

TCP ¡Stream ¡Reassembly ¡

Batch ¡Size ¡

¡ ¡ ¡

connec5on1 ¡ connec5on2 ¡ connec5on3 ¡

slide-38
SLIDE 38

TCP ¡Stream ¡Reassembly ¡

Batch ¡Size ¡ Sequen6al ¡processing ¡

¡ ¡ ¡

connec5on1 ¡ connec5on2 ¡ connec5on3 ¡

slide-39
SLIDE 39

TCP ¡Stream ¡Reassembly ¡

Batch ¡Size ¡ Sequen6al ¡processing ¡

¡ ¡ ¡

connec5on1 ¡ connec5on2 ¡ connec5on3 ¡

slide-40
SLIDE 40

TCP ¡Stream ¡Reassembly ¡

Sequen6al ¡processing ¡ Packet-­‑level ¡ parallel ¡processing ¡ Batch ¡Size ¡

¡ ¡ ¡

connec5on1 ¡ connec5on2 ¡ connec5on3 ¡

slide-41
SLIDE 41

TCP ¡Stream ¡Reassembly ¡

  • Key ¡insight ¡

– Packets ¡<A, B> ¡are ¡consecu5ve ¡if ¡SeqB = (SeqA+lenA)

Batch ¡Size ¡

A ¡ B ¡ C ¡

slide-42
SLIDE 42

TCP ¡Stream ¡Reassembly ¡

A ¡ A ¡

Batch ¡Size ¡

A ¡ B ¡ C ¡

H(Seq) ¡ H(seq+len) ¡

slide-43
SLIDE 43

TCP ¡Stream ¡Reassembly ¡

A ¡ A ¡ B ¡ B ¡

Batch ¡Size ¡

A ¡ B ¡ C ¡

H(Seq) ¡ H(seq+len) ¡

slide-44
SLIDE 44

TCP ¡Stream ¡Reassembly ¡

A ¡ A ¡ B ¡ B ¡ C ¡ C ¡

Batch ¡Size ¡

A ¡ B ¡ C ¡

H(Seq) ¡ H(seq+len) ¡

slide-45
SLIDE 45

TCP ¡Stream ¡Reassembly ¡

A ¡ A ¡ B ¡ B ¡ C ¡ C ¡

Batch ¡Size ¡

A ¡ B ¡ C ¡

Parallel ¡Processing ¡

slide-46
SLIDE 46

TCP ¡Stream ¡Reassembly ¡

A ¡ A ¡ B ¡ B ¡ C ¡ C ¡ next_packet: index: A ¡ B ¡ B ¡ C ¡ A ¡

Batch ¡Size ¡

A ¡ B ¡ C ¡

C ¡

  • ­‑ ¡
slide-47
SLIDE 47

Other ¡TCP ¡corner ¡cases ¡

  • TCP ¡sequence ¡holes ¡
  • Out-­‑of-­‑order ¡packets ¡
slide-48
SLIDE 48

Other ¡TCP ¡corner ¡cases ¡

  • TCP ¡sequence ¡holes ¡
  • Out-­‑of-­‑order ¡packets ¡
slide-49
SLIDE 49

Evalua5on ¡

  • Forwarding ¡
  • Latency ¡
  • Individual ¡Applica5ons ¡
  • Consolidated ¡applica5ons ¡
slide-50
SLIDE 50

Evalua5on ¡Setup ¡

  • GASPP ¡machine ¡has: ¡

– 2x ¡NUMA ¡nodes ¡(Intel ¡Xeon ¡E5520 ¡2.27GHz ¡quad-­‑core ¡CPUs) ¡ – 2x ¡banks ¡of ¡6GB ¡of ¡DDR3 ¡1066MHz ¡RAM ¡ – 2x ¡Intel ¡82599EB ¡network ¡adapters ¡(with ¡dual ¡10GbE ¡ports) ¡ – 2x ¡NVIDIA ¡GTX480 ¡graphics ¡cards ¡

Packet ¡generator ¡ (4x ¡10GbE ¡ports) ¡ GASPP ¡machine ¡ (4x ¡10GbE ¡ports) ¡

40 ¡Gbit/s ¡ generated ¡traffic ¡ forwarded ¡traffic ¡

slide-51
SLIDE 51

Basic ¡Forwarding ¡

Effective

Packet size (bytes)

64 128 256 512 1024 1518

Throughput (Gbit/s)

10 20 30 40

Rx+Tx Rx+GPU+Tx

Rx+Tx Rx+GPU+Tx Effective

CPU ¡(8x ¡cores) ¡ GASPP ¡

slide-52
SLIDE 52

Latency ¡

  • 8192 ¡batch: ¡

– CPU: ¡0.48 ¡us ¡ – GASPP: ¡3.87 ¡ms ¡

  • 1024 ¡batch: ¡0.49 ¡ms ¡

– Same ¡performance ¡for ¡basic ¡forwarding ¡ – …but ¡2x-­‑4x ¡throughput ¡slowdown ¡for ¡heavyweight ¡ processing ¡applica5ons ¡

slide-53
SLIDE 53

Individual ¡Applica5ons ¡

  • Each ¡applica5on ¡is ¡wri_en ¡as ¡a ¡GPU ¡kernel ¡

– No ¡CPU-­‑side ¡development ¡

  • Speedup ¡over ¡a ¡single ¡CPU-­‑core ¡ ¡

Applica[ons ¡ GASPP ¡ (8192 ¡batch) ¡ GASPP ¡ (1024 ¡batch) ¡ Firewall ¡ 3.6x ¡ 3.6x ¡ StringMatch ¡ 28.4x ¡ 9.3x ¡ RegExMatch ¡ 173.1x ¡ 36.9x ¡ AES ¡ 14.6x ¡ 6.5x ¡

slide-54
SLIDE 54

Consolida5ng ¡Applica5ons ¡

Firewall ¡ StringMatch ¡ RegExMatch ¡ AES ¡ Firewall ¡ StringMatch ¡ RegExMatch ¡ Firewall ¡ StringMatch ¡ Firewall ¡

1.19x ¡ 2.12x ¡ 1.93x ¡ GASPP: ¡

  • ­‑ ¡

GASPP ¡reduces ¡irregular ¡execu5on ¡by ¡1.19-­‑2.12X ¡

slide-55
SLIDE 55

Conclusions ¡

  • What ¡we ¡offer: ¡

– Fast ¡inter-­‑device ¡data ¡transfers ¡ – GPU-­‑based ¡flow ¡state ¡management ¡and ¡stream ¡ reconstruc5on ¡ – Efficient ¡packet ¡scheduling ¡mechanisms ¡

  • Limita5ons ¡

– High ¡packet ¡processing ¡latency ¡

slide-56
SLIDE 56

GASPP: ¡A ¡GPU-­‑Accelerated ¡Stateful ¡ Packet ¡Processing ¡Framework ¡ ¡

Giorgos ¡Vasiliadis, ¡FORTH-­‑ICS, ¡Greece ¡ Lazaros ¡Koromilas, ¡FORTH-­‑ICS, ¡Greece ¡ Michalis ¡Polychronakis, ¡Columbia ¡University, ¡USA ¡ So5ris ¡Ioannidis, ¡FORTH-­‑ICS, ¡Greece ¡

¡