Skip to content
AnswerWell geo Documentation

Research · 9 min read · Answerwell

Packet Capture Diagnostics: Sample and Full PCAP, Buckets, and Remote Device Capture

How Cloudflare packet captures work: sample vs full network PCAP, bucket setup, DEX remote device captures, limits, and how to verify results.

This page summarises Cloudflare documentation on packet captures (PCAPs): recording network traffic so you can inspect it offline in tools such as Wireshark. The material spans traffic on Cloudflare’s network (for example Magic Transit) and remote captures from end-user devices via Digital Experience Monitoring (DEX). Availability differs by product—for example, network packet captures on the edge are tied to Cloudflare Advanced Network Firewall.

Packet captures: what they record and when to use them

Section titled “Packet captures: what they record and when to use them”

A packet capture is a recording of network traffic at the packet level. On Cloudflare’s network, PCAP output is one or more files in PCAP format; on clients, DEX can return PCAPs plus diagnostic logs. People usually reach for PCAPs when HTTP logs are not enough—for connection resets, packet loss, SSL handshake problems, or errors such as 520, 524, and 525 that reflect layers 3/4 behaviour, as described in Gathering information for troubleshooting sites.

Packet captures allow you to analyze the raw packet data your network sends to and receives from Cloudflare’s network.

— Cloudflare, Analytics (Cloudflare WAN)

Diagnostics (Network visibility) adds that PCAPs help diagnose connectivity, verify firewall rules, and investigate unexpected traffic patterns. Client packet capture positions remote PCAPs for troubleshooting network problems, security incidents, and performance bottlenecks on enrolled devices.

Sample vs full packet captures on Cloudflare’s network

Section titled “Sample vs full packet captures on Cloudflare’s network”

Cloudflare supports two PCAP types on the network edge. Both are documented in Packet captures (Network visibility) and Packet captures (Network Firewall).

Aspect Sample (type: simple in API) Full (type: full)
Traffic source Historical traffic already seen on Cloudflare’s network New traffic after the capture starts
Completes Immediately (queries history) Runs until limits/time; status moves from pending to success
Payload First 160 bytes per packet (headers) Complete packet data including payload
Where you view/download Cloudflare dashboard and/or API download Not in dashboard; files in your cloud bucket
Bucket required No Yes (Buckets)

Sample packet captures collect historical data on network traffic that has already passed through Cloudflare’s network. They will not collect any new traffic sent to Cloudflare’s network after the packet capture has started.

— Cloudflare, Diagnostics (Network visibility)

Full packet captures actively monitor Cloudflare’s network for packets that match the selected filters, and capture the complete packet data, including the payload. The matching packet data is saved to a cloud storage bucket that is owned and configured by you.

— Cloudflare, Diagnostics (Network visibility)

Use sample PCAP when you need a quick, global picture of recent traffic (headers only). Use full PCAP when you need payloads or traffic that appears rarely—Packet captures (Network Firewall) states that explicitly.

Network PCAP: system, filters, and collecting via API

Section titled “Network PCAP: system, filters, and collecting via API”

Edge collection is oriented around Magic Transit traffic unless your account configuration differs.

Currently, when a packet capture is requested, packets flowing at Cloudflare’s global network through the Magic Transit system are captured. The default API field for this is “system”: “magic-transit”, both for the request and response.

— Cloudflare, Collect PCAPs

The PCAPs API needs both system and type. A PCAP’s system is the product or subsystem where packets are captured; type is how captured packets are assembled into a file (Collect PCAPs).

How to pick a data center (colo) for a capture

Section titled “How to pick a data center (colo) for a capture”

For help choosing a colo, Cloudflare points to https://cloudflare.com/cdn-cgi/trace and the colo field. Regional names (for example ORD) and more specific names (for example ord02) can both be used (Collect PCAPs).

Packet capture limits and concurrency (API)

Section titled “Packet capture limits and concurrency (API)”

From Collect PCAPs and Packet captures (Network visibility):

Parameter Sample Full
packet_limit 1–10,000 1–10,000
time_limit 1–300 s (visibility doc); up to 300 s in collect doc up to 86400 s in collect doc; visibility lists 1–300 s
byte_limit — 1 byte–1,000,000,000 bytes
Rate / concurrency One collect request per minute for sample Only one running or pending full PCAP at a time

Optional filter_v1 narrows traffic (for example IPv4 source address). Leave it empty to capture all packets (Collect PCAPs).

Start a sample or full capture (API sketch)

Section titled “Start a sample or full capture (API sketch)”

Full captures require destination_conf pointing at a validated bucket URI, plus colo and other fields described in Collect PCAPs.

curl https://api.cloudflare.com/client/v4/accounts/{account_id}/pcaps \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>" \
--header "Content-Type: application/json" \
--data '{
"filter_v1": {},
"time_limit": 300,
"packet_limit": 10000,
"byte_limit": 100000000,
"type": "full",
"colo": "ORD",
"system": "magic-transit",
"destination_conf": "${BUCKET}"
}'

For sample captures, use "type": "simple" (the API value for sample) per Packet captures (Network visibility). While collection runs, status is pending; when ready, it becomes success (Collect PCAPs).

Due to the nature of Cloudflare network, your traffic may traverse various physical machines within a single Cloudflare location.

— Cloudflare, Collect PCAPs

Merge files for a single Wireshark view using mergecap (linked from Cloudflare’s collect docs).

Dashboard path: Network health → Diagnostics → Network packet captures → Start a capture.

Full PCAP buckets: S3, GCS, R2, and ownership validation

Section titled “Full PCAP buckets: S3, GCS, R2, and ownership validation”

Before a full network capture, you must configure cloud storage. Sample captures do not need a bucket (Buckets).

Before you can begin a full packet capture, you must configure a cloud storage bucket where Cloudflare can write the captured traffic data. Setting up a bucket is not required for sample packet captures, which complete immediately and can be downloaded directly from the API.

— Cloudflare, Buckets

Supported targets include Amazon S3, Google Cloud Storage, and R2 (R2 via API per Buckets and PCAPs bucket setup).

How to register and prove bucket ownership

Section titled “How to register and prove bucket ownership”
  1. In Cloudflare One, open Network visibility → Diagnostics → Buckets → Add a bucket (see Buckets). On the Network Firewall path, use Network health → Diagnostics → Buckets (PCAPs bucket setup).

  2. Choose the provider, enter bucket details, and complete provider destination setup so Cloudflare can write to the bucket.

  3. Run the ownership challenge: Cloudflare writes a challenge file; copy its contents into the Ownership token field (dashboard) or call POST .../pcaps/ownership then POST .../pcaps/ownership/validate with ownership_challenge (Buckets).

  4. Confirm Status is Success before using destination_conf in full PCAP requests.

Bucket URI forms: s3://<bucket-name>/<directory>?region=<bucket-region> or gs://<bucket-name>/<directory> (Buckets).

Bucket status Meaning
Success Verified and ready
Pending Challenge submitted; may take 5–10 minutes
Failed Validation failed—check write access and challenge file contents

DEX remote captures: PCAP and logs from Cloudflare One Client devices

Section titled “DEX remote captures: PCAP and logs from Cloudflare One Client devices”

DEX Diagnostics lets administrators run remote captures on enrolled devices: PCAPs and/or Cloudflare One Client diagnostic logs (Client packet capture, Diagnostic logs).

Remote captures allow administrators to collect packet captures (PCAPs) and Cloudflare One Client diagnostic logs directly from end user devices.

— Cloudflare, Client packet capture

Packet captures (PCAP) on the device cover traffic on the default interface (outside the WARP tunnel) and on the WARP virtual interface. Device diagnostic logs cover the past 96 hours; optional Test all routes exercises Split Tunnel routes but can extend runtime and affect performance (Client packet capture).

Windows, macOS, and Linux support remote capture (minimum client 2024.12.492.0 in Traffic/DNS or Traffic-only mode). iOS, Android, and ChromeOS are not supported (Client packet capture).

  1. Devices must be online and registered in your Zero Trust organization. In Cloudflare One, go to DEX → Remote captures (Client packet capture).

  2. Select up to 10 devices and choose Packet captures (PCAP), Device diagnostic logs, or both. For WARP troubleshooting, Cloudflare often recommends reproducing the issue during the capture window (WARP client troubleshooting).

  3. Select Run diagnostics. If the client is disconnected, the capture times out after 10 minutes (Client packet capture).

  4. Track status under Insights → Digital experience → Diagnostics (Success, Running, Pending Upload, Failed) (Client packet capture).

  5. On success, DEX → Remote captures → menu → Download (<capture-id>.zip) (Download remote captures).

The ZIP PCAP folder includes capture-default.pcap, capture-tunnel.pcap, and results.json (Client packet capture). For support on DEX, Cloudflare asks for a remote capture from the Zero Trust dashboard (Contact Cloudflare Support).

After client diagnostic logs are collected via the dashboard, View Device Diag can generate an AI summary of events and next steps (WARP client troubleshooting).

Limit Value
Time 600 seconds
File size 50 MB
Packet size 1500 bytes

Diagnostic logs have no file size cap for collection, but uploads larger than 100 MB cannot be sent to Cloudflare and must be shared directly with the admin (Client packet capture).

Additional constraints: no concurrent remote captures on Windows; conflicts with other tools using Windows Packet Monitor (pktmon); possible failures on non-English Windows locales (Client packet capture).

Troubleshooting with PCAP: empty captures, rules, and Ray ID

Section titled “Troubleshooting with PCAP: empty captures, rules, and Ray ID”

Diagnose traffic decisions recommends PCAP when analytics are inconclusive: configure a filter matching affected traffic, knowing the PCAP may be empty if packets were dropped.

When opening a support case for a specific HTTP problem, correlate the capture with a Ray ID and UTC time—Ray IDs are not guaranteed unique (Gathering information for troubleshooting sites).

A packet capture records the connection at the packet level. The Ray ID identifies one request within that connection. Provide both so that Support can match the frames in your capture to the request that was slow or failed.

— Cloudflare, Gathering information for troubleshooting sites

  • Starting a full capture without a bucket in Success state, or with wrong destination_conf URI format.
  • Expecting sample captures to include payloads or post-start traffic.
  • Using only a Ray ID without the UTC time window.
  • On Windows endpoints, running DEX PCAP while pktmon or another capture tool is active, or starting a second concurrent remote capture.
  • Assuming a single PCAP file per full capture at a busy colo without merging multi-server outputs.
Programmable Flow Protection: debug BPF with a PCAP file

Separate from live network capture, Programmable Flow Protection documents an API that runs a BPF program against an uploaded PCAP (max 5 MB) and returns an annotated PCAP with verdict comments (CF_EBPF_PASS, CF_EBPF_DROP, etc.). See Common API calls and the overview’s Debug Packet CAPture (PCAP) section.

  1. Confirm you have access to the right Cloudflare surface: Network health / Network visibility → Diagnostics for edge PCAP (Packet captures (Network visibility)), or DEX → Remote captures for client PCAP (Client packet capture).

  2. For a full edge capture, open Buckets and verify status Success before starting (Buckets).

  3. Run a sample capture with a narrow filter_v1, wait for success, and download via the dashboard or .../pcaps/{pcap_id}/download (Collect PCAPs).

  4. For client issues, run a remote capture while reproducing the problem, confirm Success, and inspect capture-default.pcap, capture-tunnel.pcap, and results.json in Wireshark (Client packet capture).

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.