emmericp / MoonGen

MoonGen is a fully scriptable high-speed packet generator built on DPDK and LuaJIT. It can saturate a 10 Gbit/s connection with 64 byte packets on a single CPU core while executing user-provided Lua scripts for each packet. Multi-core support allows for even higher rates. It also features precise and accurate timestamping and rate control.
MIT License
1.04k stars 234 forks source link

Nothing received in Rx device #263

Closed badr-bzh closed 4 years ago

badr-bzh commented 4 years ago

Hello,

I tried to execute the l2 and l3 latency-load examples, but I didn't receive anything in Rx device. Here is my output:


user@debian:~/MoonGen$
user@debian:~/MoonGen$ sudo ./build/MoonGen examples/l3-load-latency.lua 0 1
[INFO]  Initializing DPDK. This will take a few seconds...
EAL: Detected 4 lcore(s)
EAL: Probing VFIO support...
EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable clock cycles !
EAL: PCI device 0000:01:01.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
EAL: PCI device 0000:01:02.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
EAL: PCI device 0000:01:03.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
EAL: PCI device 0000:01:04.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
[INFO]  Found 4 usable devices:
   Device 0: 52:54:00:0A:11:99 (Red Hat, Inc Virtio network device)
   Device 1: 52:54:00:0A:11:9A (Red Hat, Inc Virtio network device)
   Device 2: 52:54:00:0A:11:9B (Red Hat, Inc Virtio network device)
   Device 3: 52:54:00:0A:11:9C (Red Hat, Inc Virtio network device)
[INFO]  Waiting for devices to come up...
[INFO]  Device 1 (52:54:00:0A:11:9A) is up: 10000 MBit/s
[INFO]  Device 0 (52:54:00:0A:11:99) is up: 10000 MBit/s
[INFO]  2 devices are up.
[WARN]  Per-queue rate limit is not supported on this device, setting per-device rate limit to 999 Mbit/s instead (note: this may fail as well if the NIC doesn't support any rate limiting).
[WARN]  global rate limiting is not supported by the hardware or driver
[INFO]  Performing ARP lookup on 10.1.0.10
[INFO]  Performing ARP lookup on 10.1.0.10
[WARN]  l2 filter error: Operation not supported
[WARN]  l2 filter error: Operation not supported
[INFO]  ARP lookup failed, using default destination mac address
[INFO]  ARP lookup failed, using default destination mac address
[WARN]  Packet size 60 is smaller than minimum timestamp size 84. Timestamped packets will be larger than load packets.
[FATAL] Lua error in task timerSlave
/home/user/MoonGen/build/../libmoon/lua/device.lua:477: tx timestamping is not supported by the hardware or driver
Stack Traceback
===============
(2) Lua function 'log' at file '/home/user/MoonGen/build/../libmoon/lua/log.lua:129' (best guess)
        Local variables:
         self = table: 0x40891f98  {DEBUG:0, fatal:function: 0x404cd000, writeToLog:function: 0x404ccfe0, INFO:1 (more...)}
         str = string: "tx timestamping is not supported by the hardware or driver"
(3) Lua method 'unsupported' at file '/home/user/MoonGen/build/../libmoon/lua/device.lua:477'
        Local variables:
         self = [Device: id=0]  {initialized:true, rxQueues:table: 0x406198c8, txQueues:table: 0x40619950 (more...)}
         operation = string: "tx timestamping"
         level = string: "fatal"
(4) Lua method 'enableTxTimestamps' at file '/home/user/MoonGen/build/../libmoon/lua/device.lua:502'
        Local variables:
         self = [Device: id=0]  {initialized:true, rxQueues:table: 0x406198c8, txQueues:table: 0x40619950 (more...)}
         queue = [TxQueue: id=0, qid=1]  {qid:1, dev:[Device: id=0], id:0}
(5) Lua method 'enableTimestamps' at file '/home/user/MoonGen/build/../libmoon/lua/device.lua:577'
        Local variables:
         self = [TxQueue: id=0, qid=1]  {qid:1, dev:[Device: id=0], id:0}
(6) Lua method 'newUdpTimestamper' at file '/home/user/MoonGen/build/../libmoon/lua/timestamping.lua:34'
        Local variables:
         self = table: 0x40600c90  {newUdpTimestamper:function: 0x40600db8, syncClocks:function: 0x40600e60 (more...)}
         txQueue = [TxQueue: id=0, qid=1]  {qid:1, dev:[Device: id=0], id:0}
         rxQueue = [RxQueue: id=1, qid=1]  {qid:1, dev:[Device: id=1], id:1}
         udp = boolean: true
         doNotConfigureUdpPort = nil
(7) Lua function 'timerSlave' at file 'examples/l3-load-latency.lua:113' (best guess)
        Local variables:
         txQueue = [TxQueue: id=0, qid=1]  {qid:1, dev:[Device: id=0], id:0}
         rxQueue = [RxQueue: id=1, qid=1]  {qid:1, dev:[Device: id=1], id:1}
         size = number: 84
         flows = number: 4
(8) global C function 'xpcall'
(9) Lua upvalue 'slave' at file '/home/user/MoonGen/build/../libmoon/lua/main.lua:128'
        Local variables:
         args = table: 0x406180c0  {1:2, 2:timerSlave, 3:[TxQueue: id=0, qid=1], 4:[RxQueue: id=1, qid=1], 5:60 (more...)}
         ok = boolean: true
         taskId = number: 2
         func = string: "timerSlave"
         (*temporary) = table: 0x4061bb60  {}
         (*temporary) = C function: select
         (*temporary) = number: 2
(10) Lua function 'main' at file '/home/user/MoonGen/build/../libmoon/lua/main.lua:148' (best guess)
        Local variables:
         task = string: "slave"
        /home/user/MoonGen/build/../libmoon/lua/device.lua:477: tx timestamping is not supported by the hardware or driver
[Device: id=0] TX: 1.01 Mpps, 582 Mbit/s (743 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 1.00 Mpps, 574 Mbit/s (733 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 1.01 Mpps, 581 Mbit/s (743 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 1.01 Mpps, 582 Mbit/s (744 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
^C[Device: id=0] TX: 1.01 (StdDev 0.01) Mpps, 579 (StdDev 5) Mbit/s (740 Mbit/s with framing), total 4563731 packets with 328588632 bytes (incl. CRC)
[Device: id=1] RX: 0.00 (StdDev 0.00) Mpps, 0 (StdDev 0) Mbit/s (0 Mbit/s with framing), total 0 packets with 0 bytes (incl. CRC)
user@debian:~/MoonGen$ sudo ./build/MoonGen examples/l2-load-latency.lua 0 1
[INFO]  Initializing DPDK. This will take a few seconds...
EAL: Detected 4 lcore(s)
EAL: Probing VFIO support...
EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable clock cycles !
EAL: PCI device 0000:01:01.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
EAL: PCI device 0000:01:02.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
EAL: PCI device 0000:01:03.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
EAL: PCI device 0000:01:04.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
[INFO]  Found 4 usable devices:
   Device 0: 52:54:00:0A:11:99 (Red Hat, Inc Virtio network device)
   Device 1: 52:54:00:0A:11:9A (Red Hat, Inc Virtio network device)
   Device 2: 52:54:00:0A:11:9B (Red Hat, Inc Virtio network device)
   Device 3: 52:54:00:0A:11:9C (Red Hat, Inc Virtio network device)
[INFO]  Waiting for devices to come up...
[INFO]  Device 1 (52:54:00:0A:11:9A) is up: 10000 MBit/s
[INFO]  Device 0 (52:54:00:0A:11:99) is up: 10000 MBit/s
[INFO]  2 devices are up.
[WARN]  Per-queue rate limit is not supported on this device, setting per-device rate limit to 10000 Mbit/s instead (note: this may fail as well if the NIC doesn't support any rate limiting).
[WARN]  global rate limiting is not supported by the hardware or driver
[WARN]  Per-queue rate limit is not supported on this device, setting per-device rate limit to 10000 Mbit/s instead (note: this may fail as well if the NIC doesn't support any rate limiting).
[WARN]  global rate limiting is not supported by the hardware or driver
[FATAL] Lua error in task timerSlave
/home/user/MoonGen/build/../libmoon/lua/device.lua:477: tx timestamping is not supported by the hardware or driver
Stack Traceback
===============
(2) Lua function 'log' at file '/home/user/MoonGen/build/../libmoon/lua/log.lua:129' (best guess)
        Local variables:
         self = table: 0x409a1f98  {DEBUG:0, fatal:function: 0x40efd000, writeToLog:function: 0x40efcfe0, INFO:1 (more...)}
         str = string: "tx timestamping is not supported by the hardware or driver"
(3) Lua method 'unsupported' at file '/home/user/MoonGen/build/../libmoon/lua/device.lua:477'
        Local variables:
         self = [Device: id=0]  {initialized:true, rxQueues:table: 0x405b93f0, txQueues:table: 0x405b92b0 (more...)}
        operation = string: "tx timestamping"
         level = string: "fatal"
(4) Lua method 'enableTxTimestamps' at file '/home/user/MoonGen/build/../libmoon/lua/device.lua:502'
        Local variables:
         self = [Device: id=0]  {initialized:true, rxQueues:table: 0x405b93f0, txQueues:table: 0x405b92b0 (more...)}
         queue = [TxQueue: id=0, qid=1]  {qid:1, dev:[Device: id=0], id:0}
(5) Lua method 'enableTimestamps' at file '/home/user/MoonGen/build/../libmoon/lua/device.lua:577'
        Local variables:
         self = [TxQueue: id=0, qid=1]  {qid:1, dev:[Device: id=0], id:0}
(6) Lua method 'newTimestamper' at file '/home/user/MoonGen/build/../libmoon/lua/timestamping.lua:34'
        Local variables:
         self = table: 0x405a11f8  {newUdpTimestamper:function: 0x403104d0, syncClocks:function: 0x4030e1e0 (more...)}
         txQueue = [TxQueue: id=0, qid=1]  {qid:1, dev:[Device: id=0], id:0}
         rxQueue = [RxQueue: id=1, qid=1]  {qid:1, dev:[Device: id=1], id:1}
         udp = nil
         doNotConfigureUdpPort = nil
(7) Lua function 'timerSlave' at file 'examples/l2-load-latency.lua:61' (best guess)
        Local variables:
         txQueue = [TxQueue: id=0, qid=1]  {qid:1, dev:[Device: id=0], id:0}
         rxQueue = [RxQueue: id=1, qid=1]  {qid:1, dev:[Device: id=1], id:1}
         histfile = string: "histogram.csv"
(8) global C function 'xpcall'
(9) Lua upvalue 'slave' at file '/home/user/MoonGen/build/../libmoon/lua/main.lua:128'
        Local variables:
         args = table: 0x405b8018  {1:4, 2:timerSlave, 3:[TxQueue: id=0, qid=1], 4:[RxQueue: id=1, qid=1], 5:histogram.csv (more...)}
         ok = boolean: true
         taskId = number: 4
         func = string: "timerSlave"
         (*temporary) = table: 0x405bb5e0  {}
         (*temporary) = C function: select
         (*temporary) = number: 2
(10) Lua function 'main' at file '/home/user/MoonGen/build/../libmoon/lua/main.lua:148' (best guess)
        Local variables:
         task = string: "slave"
        /home/user/MoonGen/build/../libmoon/lua/device.lua:477: tx timestamping is not supported by the hardware or driver
[Device: id=0] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 0.54 Mpps, 313 Mbit/s (400 Mbit/s with framing)
[Device: id=1] TX: 0.51 Mpps, 291 Mbit/s (372 Mbit/s with framing)
[Device: id=0] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 0.53 Mpps, 305 Mbit/s (389 Mbit/s with framing)
[Device: id=1] TX: 0.53 Mpps, 303 Mbit/s (387 Mbit/s with framing)
[Device: id=0] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 0.53 Mpps, 304 Mbit/s (388 Mbit/s with framing)
[Device: id=1] TX: 0.52 Mpps, 302 Mbit/s (386 Mbit/s with framing)
[Device: id=0] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 0.53 Mpps, 304 Mbit/s (388 Mbit/s with framing)
[Device: id=1] TX: 0.52 Mpps, 302 Mbit/s (386 Mbit/s with framing)
[Device: id=0] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 0.53 Mpps, 304 Mbit/s (388 Mbit/s with framing)
[Device: id=1] TX: 0.52 Mpps, 302 Mbit/s (386 Mbit/s with framing)
[Device: id=0] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 0.53 Mpps, 305 Mbit/s (389 Mbit/s with framing)
[Device: id=1] TX: 0.53 Mpps, 303 Mbit/s (387 Mbit/s with framing)
[Device: id=0] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 0.53 Mpps, 305 Mbit/s (390 Mbit/s with framing)
[Device: id=1] TX: 0.53 Mpps, 303 Mbit/s (387 Mbit/s with framing)
^C[Device: id=0] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 0.44 Mpps, 253 Mbit/s (323 Mbit/s with framing)
[Device: id=1] TX: 0.44 Mpps, 252 Mbit/s (322 Mbit/s with framing)
[Device: id=0] RX: 0.00 (StdDev 0.00) Mpps, 0 (StdDev 0) Mbit/s (0 Mbit/s with framing), total 0 packets with 0 bytes (incl. CRC)
[Device: id=1] RX: 0.00 (StdDev 0.00) Mpps, 0 (StdDev 0) Mbit/s (0 Mbit/s with framing), total 0 packets with 0 bytes (incl. CRC)
[Device: id=0] TX: 0.52 (StdDev 0.03) Mpps, 297 (StdDev 19) Mbit/s (379 Mbit/s with framing), total 4222134 packets with 303993648 bytes (incl. CRC)
[Device: id=1] TX: 0.51 (StdDev 0.03) Mpps, 295 (StdDev 19) Mbit/s (377 Mbit/s with framing), total 4155102 packets with 299167344 bytes (incl. CRC)
user@debian:~/MoonGen$

Do I need to hard write the Mac adresses manually in the scripts ?

Thanks for your efforts

badr-bzh commented 4 years ago

Another example, knowing that i hard written the MAC src and dst in the script:

user@debian:~/MoonGen$ sudo ./moongen-simple start tcp-syn-flood4:0:1:rate=1Mp/s
[INFO]  Initializing DPDK. This will take a few seconds...-flood4:0:1:rate=1Mp/s
EAL: Detected 4 lcore(s)
EAL: Probing VFIO support...
EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable clock cycles !
EAL: PCI device 0000:01:01.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
EAL: PCI device 0000:01:02.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
EAL: PCI device 0000:01:03.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
EAL: PCI device 0000:01:04.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 1af4:1000 net_virtio
[INFO]  Found 4 usable devices:
   Device 0: 52:54:00:0A:11:99 (Red Hat, Inc Virtio network device)
   Device 1: 52:54:00:0A:11:9A (Red Hat, Inc Virtio network device)
   Device 2: 52:54:00:0A:11:9B (Red Hat, Inc Virtio network device)
   Device 3: 52:54:00:0A:11:9C (Red Hat, Inc Virtio network device)
[INFO]  Flow tcp-syn-flood4 => 0x1
[INFO]  Waiting for devices to come up...
[INFO]  Device 1 (52:54:00:0A:11:9A) is up: 10000 MBit/s
[INFO]  Device 0 (52:54:00:0A:11:99) is up: 10000 MBit/s
[INFO]  2 devices are up.
[Device: id=0] TX: 0.96 Mpps, 554 Mbit/s (708 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Flow: dev=0 uid=0x1] TX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 0.99 Mpps, 570 Mbit/s (729 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Flow: dev=0 uid=0x1] TX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=0] TX: 1.00 Mpps, 576 Mbit/s (736 Mbit/s with framing)
[Flow: dev=0 uid=0x1] TX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
[Device: id=1] RX: 0.00 Mpps, 0 Mbit/s (0 Mbit/s with framing)
^C[Flow: dev=0 uid=0x1] TX: 0.00 (StdDev 0.00) Mpps, 0 (StdDev 0) Mbit/s (0 Mbit/s with framing), total 0 packets with 0 bytes (incl. CRC)
[Device: id=0] TX: 1.00 (StdDev 0.01) Mpps, 573 (StdDev 4) Mbit/s (732 Mbit/s with framing), total 3772544 packets with 271623168 bytes (incl. CRC)
[Device: id=1] RX: 0.00 (StdDev 0.00) Mpps, 0 (StdDev 0) Mbit/s (0 Mbit/s with framing), total 0 packets with 0 bytes (incl. CRC)
user@debian:~/MoonGen$
emmericp commented 4 years ago

VirtIO doesn't support counting packets without receiving them, so you need to actually receive and drop packets explicitly to count them, example: https://github.com/emmericp/MoonGen/blob/master/examples/device-statistics.lua#L179

This is obviously very unreliable and it's hard to distinguish between you dropping a packet and your DuT dropping a packet. It's usually not a good idea to run MoonGen on virtual NICs.