Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compression: Minimize Pcap header size #15

Open
pflarr opened this issue Aug 2, 2017 · 0 comments
Open

Compression: Minimize Pcap header size #15

pflarr opened this issue Aug 2, 2017 · 0 comments

Comments

@pflarr
Copy link
Contributor

pflarr commented Aug 2, 2017

Expected Savings: 0.94%
Difficulty: Easy

Pcap headers are 128 bytes per packet.

typedef struct pcaprec_hdr_s {
        guint32 ts_sec;         /* timestamp seconds */
        guint32 ts_usec;        /* timestamp microseconds */
        guint32 incl_len;       /* number of octets of packet saved in file */
        guint32 orig_len;       /* actual length of packet */
} pcaprec_hdr_t;
  • The length of the packet is used, but for pcapdb the orig length should never be.
  • Unlike with standard pcaps, we should also know the starting time, and can base all of our times on that. The usec field, if used as an offset instead, can give us up to 71 minutes of usec accuracy, far
    longer than an fcap file should ever last.
  • The absolute max packet size should be around 19kb, so we really only need two bites for the length field.
  • A typical 1 TB pcap contains about 10^6 packets per GB, so this should save us about 0.94%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant