MoonGen icon indicating copy to clipboard operation
MoonGen copied to clipboard

About Caida pcap

Open Scottbtang opened this issue 7 years ago • 7 comments

I use the replay-pcap.lua script to send the pcap file which download from CAIDA. But the terminal always print a error "unsupported link layer type", like this: [INFO] Found 2 usable devices: Device 0: 14:02:EC:89:ED:54 (Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection) Device 1: 14:02:EC:89:ED:55 (Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection) PMD: ixgbe_dev_link_status_print(): Port 0: Link Down [INFO] Waiting for devices to come up... [INFO] Device 0 (14:02:EC:89:ED:54) is up: 10000 MBit/s [INFO] 1 device is up. [FATAL] Lua error in task replay /root/dpdkovs/MoonGen/build/../libmoon/lua/pcap.lua:160: unsupported link layer type

So what should I do to fix this problem ? Thanks very much

Scottbtang avatar Dec 04 '17 01:12 Scottbtang

The error indicates that the pcap file claims to not contain ethernet packets but something else. The field is probably just 0, i'll change this to a warning later today.

Also checking if we have these traces somewhere so i can test it myself.

emmericp avatar Dec 04 '17 10:12 emmericp

As far as I recall, the CAIDA pcap traces contain raw IP packets (no Ethernet header). This is likely the reason you get this error. It would be nice if you could extend the script to account for such traces by e.g., prepending each packet with a fake Ethernet header.

gkatsikas avatar Dec 04 '17 12:12 gkatsikas

Thanks for getting back to me. So as the CAIDA pcap traces don't have the Ethernet header, I am not sure whether the Moongen has the ability to replay the traces (the trace without any modification), or the only way to solve the problem is to prepend a fake Ethernet header for each packet?

Scottbtang avatar Dec 04 '17 14:12 Scottbtang

looks like we don't have access the the caida traces here, i've requested access.

but in general the best way to do this is with a small patch in the pcap library modifying the offset where the packet is copied to. we can then use a pre-filled mempool with a header. i'll see what i can do, but probably not before tomorrow

emmericp avatar Dec 04 '17 15:12 emmericp

@scholzd you recently successfully replayed this trace, can you PR your changes?

emmericp avatar Jul 24 '18 22:07 emmericp

No, not a PR, I only hardcoded the offsets: https://github.com/scholzd/libmoon/commit/a79a908d2156777dad4dc87e507f21e007ede5cb

scholzd avatar Jul 25 '18 09:07 scholzd

According to ACC-Turbo, using tcprewrite to add ethernet headers helps me solve the problem.

tcprewrite --dlt=enet --enet-dmac=00:11:22:33:44:55 --enet-smac=66:77:88:99:AA:BB --infile=equinix-nyc.dirA.20180315-125910.UTC.anon.pcap --outfile=fixed_demo1.pcap

Notice

  • tcprewrite version should be 4.3.4
$ tcprewrite --version
tcprewrite version: 4.3.4 (build git:v4.3.4)
Copyright 2013-2018 by Fred Klassen <tcpreplay at appneta dot com> - AppNeta
Copyright 2000-2012 by Aaron Turner <aturner at synfin dot net>
The entire Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04
Not compiled with libdnet.
Compiled against libpcap: 1.9.1
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Fragroute engine: disabled

wujiahao15 avatar May 11 '23 07:05 wujiahao15