All FMADIO Packet capture systems can also uploaded raw 3rd party PCAP files into the system. This allows all FMADIO utilities to run on external and archived historical data. The upload functionality is heavily used internally for our own testing and regression frameworks, it runs at a maximum speed of about 3-5Gbps.
NOTE: Capture must be stopped while an upload is in progress
Uploading from local disk
To upload from the local disk
Step 1) Ensure Capture has stopped
confirm capture is not running using the GUI or FMADIO CLI, example below
fmadiocli "show capture status"
Confirm its false
Step 2) Pipe the PCAP into stream_upload
The utility stream_upload
ingests PCAP data from STDIN and uploads it into the FMADIO Storage system. How the PCAP data is generated could be anything thats valid on the bash command line.
Below example is a simple cat
of an existing PCAP file.
cat test.pcap | sudo stream_upload --name test-upload
Example output (shortend)
fmadio@fmadio100v2-228U:~$ cat test.pcap | sudo stream_upload --name test-upload
Stream Upload V3: Dec 10 2024 17:01:31
CaptureFileName [test-upload]
calibrating...
0 : 2095067430 2.0951 cycles/nsec offset:4.933 Mhz
Cycles/Sec 2095067430.0000 Std: 0 cycle std( 0.00000000) Target:2.10 Ghz
map 0x7f816fb87000
Control mapped : 0
CaptureRing IOBase 0000000100000000 IOSize:0000000100000000
CaptureIndex IOBase 0000000200000000 IOSize:0000000000400000
reset mem
CaptureRingStatus0: IO:0000002f40e80000 1234567
CaptureRingStatus1: IO:0000002f40e80000 1234567
CaptureRingStatus2: IO:0000002f40e80000 1234567
CaptureRingStatus3: IO:0000002f40e80000 1234567
CaptureRing IOBase 0000004100000000 IOSize:0000000100000000
CaptureIndex IOBase 0000004200000000 IOSize:0000000000400000
reset mem
CaptureRingStatus0: IO:0000002f3bdc0000 1234567
CaptureRingStatus1: IO:0000002f3bdc0000 1234567
.
.
.
0.00GB : 0.00MB 0.00MB 0.00MB 0.000Gbps 0.00Mpps Pkts:0 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 8946 0 0 0 Drop: 0
0.63GB : 0.00MB 0.26MB 0.00MB 4.560Gbps 1.16Mpps Pkts:1291960 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 444431 0 0 0 Drop: 0
1.23GB : 0.00MB 0.00MB 0.00MB 4.319Gbps 1.35Mpps Pkts:2793063 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 890702 0 0 0 Drop: 0
1.80GB : 0.00MB 0.00MB 0.00MB 4.073Gbps 0.85Mpps Pkts:3738136 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 1303885 0 0 0 Drop: 0
2.32GB : 0.00MB 0.00MB 0.00MB 3.720Gbps 0.89Mpps Pkts:4723557 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 1683701 0 0 0 Drop: 0
2.86GB : 0.00MB 0.00MB 0.00MB 3.886Gbps 1.13Mpps Pkts:5980242 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 2076485 0 0 0 Drop: 0
3.32GB : 0.00MB 0.00MB 0.00MB 3.317Gbps 0.31Mpps Pkts:6323337 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 2445826 0 0 0 Drop: 0
3.82GB : 0.00MB 0.00MB 0.00MB 3.608Gbps 0.33Mpps Pkts:6693433 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 2811723 0 0 0 Drop: 0
4.25GB : 0.00MB 0.00MB 0.00MB 3.071Gbps 0.31Mpps Pkts:7040380 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 3126263 0 0 0 Drop: 0
4.71GB : 0.00MB 0.00MB 0.00MB 3.298Gbps 0.84Mpps Pkts:7981321 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 3466935 0 0 0 Drop: 0
5.10GB : 0.00MB 0.00MB 0.00MB 2.828Gbps 0.25Mpps Pkts:8255635 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 3753915 0 0 0 Drop: 0
5.51GB : 0.00MB 0.00MB 0.00MB 2.895Gbps 0.25Mpps Pkts:8535492 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 4052955 0 0 0 Drop: 0
5.92GB : 0.00MB 0.26MB 0.00MB 3.009Gbps 0.26Mpps Pkts:8828919 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 4355274 0 0 0 Drop: 0
6.41GB : 0.00MB 0.00MB 0.00MB 3.505Gbps 0.80Mpps Pkts:9721311 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 4738129 0 0 0 Drop: 0
.
.
.
Exit : rx_block_lock[3] : 1
Exit : rx_fec_lock[0] : 1
Exit : rx_fec_lock[1] : 1
Exit : rx_fec_lock[2] : 1
Exit : rx_fec_lock[3] : 1
Exit : tx_bram_over : 0
Exit : rx_bram_over : 0
Exit : fsm_reset : 0
Exit : mod_rst_o : 0
Exit : rx_hi_ber : 0
Exit : port_linkup_cnt : 1445
Exit : port_state : 2
Exit : link_uptime : 0 ( 0 min)
Found 7 WARNINGS
[Exit]
RxPoll exit
Join RxIndex0
Exteranl Bytes: 1354741088 Packets: 901321
Total Drop: 0
Total Pkt : 900661
[test-upload_20241218_1459] total packets: 901321 Bytes:1354741088
done
fmadio@fmadio100v2-228U:~$
Step 3) Confirm the upload is good
Confirm the upload is good using fmadiocli
fmadiocli "show capture list" | grep test-upload
Output:
fmadio@fmadio100v2-228U:~$ fmadiocli "show capture list" | grep test-upload
fmad fmadlua Dec 10 2024 (/opt/fmadio/bin/fmadiolua --nocal /opt/fmadio/bin/fmadiocli show capture list )
Disable cycle calibration
[Wed Dec 18 15:01:08 2024] [test-upload_20241218_1459 ] 1,373,634,560 B (Tue . 22:17:55 . 10-12-2024)
done 0.122600Sec 0.002043Min
fmadio@fmadio100v2-228U:~$
Replicating from an adjacent FMADIO
In addition to generic uploads, it can be useful to replicate the captured data from an adjacent FMADIO appliance for testing, troubleshooting and other purposes.
NOTE: physical capture port meta information will be lost in the upload, PCAP format does not include it. Packet broker header/footer information is kept.
Step 1) Generate a URL link for download
This can be done using the GUI. right click on the PCAP icon and “copy link”, similar to below.
Alternatively can also plug in the IP and capture name directly. The format is as follows
<ip address> replace with the FMADIOs ip addres
<capture name> replace with the full capture name (https://docs4.fmad.io/docs/fmadiocli-configure-capture#show-capture-list )
curl -s -u fmadio:**** "http://<ip address>/api/v1/pcap/single?StreamName=<capture name>"
Step 2) Confirm download (optional)
Alot of times its best to confirm the receiving FMADIO device can download / reach correctly. In this case we are using TCPDUMP to confirm. Example here is
<ip address> replace with the FMADIO IP address of the download system
<capture name> replace with the full capture name
NOTE: the URL must be encapsulated in double quotes
curl -s -u fmadio:**** "http://<ip address>/api/v1/pcap/single?StreamName=<capture name>" | tcpdump -r - -nn | head
Example output looks like
fmadio@fmadio100v2-228U:~$ curl -s -u fmadio:100g "http://192.168.2.145/api/v1/pcap/single?StreamName=fmad-sg2_20241211_0000&" | tcpdump -r - -nn | head
reading from file -, link-type EN10MB (Ethernet), snapshot length 16384
23:59:59.763269931 IP 192.168.90.1.60766 > 192.168.90.60.9000: Flags [.], seq 3696064108:3696065556, ack 2653027544, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 1448
23:59:59.763271160 IP 192.168.90.1.60766 > 192.168.90.60.9000: Flags [.], seq 0:1448, ack 1, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 1448
23:59:59.763273477 IP 192.168.2.225.60766 > 192.168.90.60.9000: Flags [P.], seq 3696068452:3696069589, ack 2653027544, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 1137
23:59:59.763274462 IP 192.168.2.225.60766 > 192.168.90.60.9000: Flags [P.], seq 0:1137, ack 1, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 1137
23:59:59.763286917 IP 192.168.2.225.60766 > 192.168.90.60.9000: Flags [P.], seq 1137:1183, ack 1, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 46
23:59:59.763287032 IP 192.168.2.225.60766 > 192.168.90.60.9000: Flags [P.], seq 1137:1183, ack 1, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 46
23:59:59.763311181 IP 192.168.90.1.60766 > 192.168.90.60.9000: Flags [.], seq 1448:2896, ack 1, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 1448
23:59:59.763312410 IP 192.168.90.1.60766 > 192.168.90.60.9000: Flags [.], seq 1448:2896, ack 1, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 1448
23:59:59.763313645 IP 192.168.90.1.60766 > 192.168.90.60.9000: Flags [.], seq 2896:4344, ack 1, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 1448
23:59:59.763314624 IP 192.168.90.1.60766 > 192.168.90.60.9000: Flags [P.], seq 4344:5481, ack 1, win 1031, options [nop,nop,TS val 1244313520 ecr 2158343360], length 1137
tcpdump: Unable to write output: Broken pipe
fmadio@fmadio100v2-228U:~$
Step 3) Download and Upload simultanously
The trick here is using CURL to download the PCAP, then pipe the STDOUT PCAP data to STDIN of the upload process. It works well as many times the total byte size of the capture exceeds the working space of the local disk / jump boxs.
Template of the command is
<ip address> replace with the download FMADIOs IP address
<capture name> replace with the download FMADIO full capture name
<upload name> replace with a short capture name on the upload FMADIO device
curl -s -u fmadio:**** "http://<ip address>/api/v1/pcap/single?StreamName=<capture name>" | sudo stream_upload --name <upload name>
Example output below:
fmadio@fmadio20v4-682-lite:~$ curl -s -u fmadio:100g "http://192.168.91.145/api/v1/pcap/single?StreamName=fmad-sg2_20241214_0000" | sudo stream_upload --name sg2-fullday
Stream Upload V3: Sep 24 2024 17:47:29
CaptureFileName [sg2-fullday]
calibrating...
0 : 3000024570 3.0000 cycles/nsec offset:0.025 Mhz
Cycles/Sec 3000024570.0000 Std: 0 cycle std( 0.00000000) Target:3.00 Ghz
map 0x7faf67e11000
Control mapped : 0
CaptureRing IOBase 0000000500000000 IOSize:0000000080000000
CaptureIndex IOBase 0000000600000000 IOSize:0000000000400000
reset mem
CaptureRingStatus0: IO:00000004ef940000 1234567
CaptureRingStatus1: IO:00000004ef940000 1234567
CaptureRingStatus2: IO:00000004ef940000 1234567
CaptureRingStatus3: IO:00000004ef940000 1234567
CaptureRing IOBase 0000000700000000 IOSize:0000000080000000
CaptureIndex IOBase 0000000800000000 IOSize:0000000000400000
reset mem
CaptureRingStatus0: IO:00000004f0080000 1234567
CaptureRingStatus1: IO:00000004f0080000 1234567
.
.
Prefetch Ring done: 119.875ms : 10101010045fc200
Prefetch Chunk...
FSPrefetch
FSPrefetch Chunk: 5.240ms 5ms
Prefetch Chunk Done
Index Start: 0 : 00000000
Upload: ignoring port enables
Capture Start
0.00GB : 0.00MB 0.00MB 0.00MB 0.000Gbps 0.00Mpps Pkts:0 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 8946 0 0 0 Drop: 0
0.63GB : 0.00MB 0.26MB 0.00MB 4.560Gbps 1.16Mpps Pkts:1291960 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 444431 0 0 0 Drop: 0
1.23GB : 0.00MB 0.00MB 0.00MB 4.319Gbps 1.35Mpps Pkts:2793063 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 890702 0 0 0 Drop: 0
1.80GB : 0.00MB 0.00MB 0.00MB 4.073Gbps 0.85Mpps Pkts:3738136 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 1303885 0 0 0 Drop: 0
2.32GB : 0.00MB 0.00MB 0.00MB 3.720Gbps 0.89Mpps Pkts:4723557 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 1683701 0 0 0 Drop: 0
2.86GB : 0.00MB 0.00MB 0.00MB 3.886Gbps 1.13Mpps Pkts:5980242 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 2076485 0 0 0 Drop: 0
3.32GB : 0.00MB 0.00MB 0.00MB 3.317Gbps 0.31Mpps Pkts:6323337 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 2445826 0 0 0 Drop: 0
3.82GB : 0.00MB 0.00MB 0.00MB 3.608Gbps 0.33Mpps Pkts:6693433 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 2811723 0 0 0 Drop: 0
4.25GB : 0.00MB 0.00MB 0.00MB 3.071Gbps 0.31Mpps Pkts:7040380 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 3126263 0 0 0 Drop: 0
4.71GB : 0.00MB 0.00MB 0.00MB 3.298Gbps 0.84Mpps Pkts:7981321 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 3466935 0 0 0 Drop: 0
5.10GB : 0.00MB 0.00MB 0.00MB 2.828Gbps 0.25Mpps Pkts:8255635 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 3753915 0 0 0 Drop: 0
5.51GB : 0.00MB 0.00MB 0.00MB 2.895Gbps 0.25Mpps Pkts:8535492 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 4052955 0 0 0 Drop: 0
5.92GB : 0.00MB 0.26MB 0.00MB 3.009Gbps 0.26Mpps Pkts:8828919 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 4355274 0 0 0 Drop: 0
6.41GB : 0.00MB 0.00MB 0.00MB 3.505Gbps 0.80Mpps Pkts:9721311 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 4738129 0 0 0 Drop: 0
7.19GB : 0.00MB 0.00MB 0.26MB 5.642Gbps 0.60Mpps Pkts:10386243 Drop (MFIFO:0 Ring:0) Log:0 FIFO: 0KB Credit:0 : Port: 5291063 0 0 0 Drop: 0
.
.
Once completed the capture can can be use don the uploaded system.
Options
Additional options for uploading PCAP files to the syste,
Generate FCS on upload
In some cases the source PCAP has no FCS frame attached to the packet, this is the standard behavior when using tcpdump on a commodity network card (the NIC will strip the FCS before sending to the kernel).
The FMADIO system assumes every packet has an FCS frame at the end of the packet.
To generate and attach an FCS to every packet add the
--append-fcs
Command line option when uploading a PCAP
Example command shown below
cat test_no_fcs.pcap | sudo stream_upload --name test_new_fcs --append-fcs
Example output, note the hilight