MoonGen A Scriptable High-Speed Packet Generator Sebastian Gallenm - - PowerPoint PPT Presentation

moongen
SMART_READER_LITE
LIVE PREVIEW

MoonGen A Scriptable High-Speed Packet Generator Sebastian Gallenm - - PowerPoint PPT Presentation

Chair for Network Architectures and Services Technical University of Munich (TUM) MoonGen A Scriptable High-Speed Packet Generator Sebastian Gallenm uller, Paul Emmerich October 31th, 2015 Chair for Network Architectures and Services


slide-1
SLIDE 1

Chair for Network Architectures and Services Technical University of Munich (TUM)

MoonGen

A Scriptable High-Speed Packet Generator Sebastian Gallenm¨ uller, Paul Emmerich

October 31th, 2015 Chair for Network Architectures and Services Department of Informatics Technical University of Munich (TUM)

Sebastian Gallenm¨ uller – MoonGen: A Scriptable High-Speed Packet Generator 1

slide-2
SLIDE 2

Chair for Network Architectures and Services Technical University of Munich (TUM)

Design goals Design goal of MoonGen Combine the advantages of software (cheap, flexible) and hardware (precise, accurate) packet generators.

Sebastian Gallenm¨ uller – MoonGen: A Scriptable High-Speed Packet Generator 2

slide-3
SLIDE 3

Chair for Network Architectures and Services Technical University of Munich (TUM)

Design goals Design goal of MoonGen Combine the advantages of software (cheap, flexible) and hardware (precise, accurate) packet generators.

◮ Fast: DPDK for packet I/O, explicit multi-core support ◮ Flexible: Craft all packets in user-controller Lua scripts ◮ Timestamping: Utilize hardware features found on modern

commodity NICs

◮ Rate control: Hardware features and a novel software

approach

Sebastian Gallenm¨ uller – MoonGen: A Scriptable High-Speed Packet Generator 2

slide-4
SLIDE 4

Chair for Network Architectures and Services Technical University of Munich (TUM)

Architecture

MoonGen Core DPDK Userscript MoonGen HW NIC NIC Port Q0 ... Qn Port Userscript

Lua VM

Userscript spawn Userscript

slave

Lua VM

Userscript

master

Lua VM

config API data API config API data API

Sebastian Gallenm¨ uller – MoonGen: A Scriptable High-Speed Packet Generator 3

slide-5
SLIDE 5

Chair for Network Architectures and Services Technical University of Munich (TUM)

Device Initilization

1

function master(txPort, rxPort, rate)

2

local tDev = device.config{port = txPort, txQueues = 2}

3

local rDev = device.config{port = rxPort, rxQueues = 2}

4

device.waitForLinks()

5

tDev:getTxQueue(0):setRate(rate)

6

mg.launchLua("loadSlave", tDev:getTxQueue(0))

7

mg.launchLua("timerSlave", tDev:getTxQueue(1),

8

rDev:getRxQueue(1))

9

mg.waitForSlaves()

10

end

Paul Emmerich – MoonGen: A Scriptable High-Speed Packet Generator 4

slide-6
SLIDE 6

Chair for Network Architectures and Services Technical University of Munich (TUM)

Measuring Latency

1

function timerSlave(txQ, rxQ)

2

rxQ.dev:filterTimestamps(rxQ)

3

local timestamper = ts:newUdpTimestamper(txQ, rxQ)

4

local hist = histogram:new()

5

while mg.running() do

6

hist:update(timestamper:measureLatency(function(buf)

7

local pkt = buf:getUdpPacket()

8

pkt.ip4.src:set(math.random(0, 2^32 - 1))

9

pkt.udp.src:set(math.random(0, 2^16 - 1))

10

end))

11

end

12

hist:save("histogram.csv")

13

end

Paul Emmerich – MoonGen: A Scriptable High-Speed Packet Generator 5

slide-7
SLIDE 7

Chair for Network Architectures and Services Technical University of Munich (TUM)

Generating Load

1

function loadSlave(queue)

2

local mempool = memory.createMemPool(function(buf)

3

buf:getUdpPacket():fill()

4

end)

5

local bufs = mempool:bufArray()

6

while mg.running() do

7

bufs:alloc(60)

8

for i, buf in ipairs(bufs) do

9

local pkt = buf:getUdpPacket()

10

pkt.ip4.src:set(math.random(0, 2^32 - 1))

11

pkt.udp.src:set(math.random(0, 2^16 - 1))

12

end

13

bufs:offloadUdpChecksums()

14

queue:send(bufs)

15

end

Paul Emmerich – MoonGen: A Scriptable High-Speed Packet Generator 6