Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6882939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:19:06+00:00 2026-05-27T05:19:06+00:00

I have some software that can emulate things like BER and delays on the

  • 0

I have some software that can emulate things like BER and delays on the network. I need a way to test the BER module of the software to make sure it actually works correctly. My solution is to create a program that sends out raw Ethernet frames with the type field set to an unused type. Inside the Ethernet frame is just random bits. For each frame sent out I need to log the frame to a pcap file. On the other side of the network link will be a receiving application that simply writes every packet it sees to its own pcap log. After the test is done running the two pcap logs will be compared to get the BER.

I’m using the python module Scapy and so far its done everything that I need. I can send out raw Ethernet frames with random data and see them in Wireshark. However, I don’t know how to get the wrpcap() method to append to the pcap file, instead of overwriting. I know I can write a list of packets to wrpcap, but this application needs to be able to run for an indefinite amount of time and I don’t want to have to wait until the application quits to write all of packets sent to the hard drive. As that would be a lot to store in memory, and if something happened I would have to start the test all over from scratch.

My question is: How do I append to a pcap file using scapy instead of overwriting the pcap file? Is it even possible? If not then what module can do what I need?

While looking for something with Scapy‘s capabilities I ran into dpkt, but I didn’t find a lot of documentation for it. Can dpkt do what I’m asking and if so where can I get some good documentation for it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:19:07+00:00Added an answer on May 27, 2026 at 5:19 am

    There is a way to do what you want, but it means either:

    • [Memory hog with one big pcap]: Read the existing pcap from disk with rdpcap() into a scapy PacketList() and then writing frames to the PacketList as they are received. You can selectively save intermediate PacketList to the pcap at will, but I don’t think there is anything like an append capability in scapy‘s wrpcap(). As you mentioned, this technique also means that you are keeping the entire PacketList in memory until completion.

    • [Glue individual pcap files together]: Only keep small snapshots of packets in memory… you should save pcap snapshots on a per-X-minute basis to disk, and then aggregate those individual files together when the script finishes.

    You can combine pcap files in linux with mergecap from the wireshark package… The following command will combine pak1.pcap and pak2.pcap into all_paks.pcap:

    mergecap -w all_paks.pcap pak1.pcap pak2.pcap
    

    As for dpkt, I looked through their source, and it might be able to incrementally write packets, but I can’t speak for how stable or maintained their code base is… it looks a bit neglected from the commit logs (last commit was January 9th 2011).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some files on our website that users of our software can download.
Say that I have made some software (which has both library form and can
I have some ideas for software that can create HDR images or panoramas. I'd
I have some software written in VB.NET that performs a lot of calculations, mostly
Hi I have some software written in VB6.0 that uses an SQL Server, but
I have a bash script that installs some software. I want to fail as
We have just purchased some software that provides an API into our phone system
We have software that have some features that are so sensitive that we want
I am using some software that requires me to have thread safety disabled. I
I have some (crappy) software that nevertheless works on all the installs I've done

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.