Python Forum
how to count a retransmission packets from pcap file?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to count a retransmission packets from pcap file?
#1
How can count the retransmission packets from a pcap file without using pyshark please ?

I use this code with pyshark :


def pyshark_retran_packet(inputfile):
	    capture = pyshark.FileCapture(inputfile, display_filter='tcp.analysis.retransmission')
	    counter = 0
	    for packet in capture:
  		    counter = counter + 1
  		
	    print ("Total number of retransmitted frames found = " + str(counter))
This code works but I need to list the packets in interval of 2 seconds (if my pcap file is composed of 20 sec, I get 10 values for retransmission) or use another way to count other than pyshark which
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Row Count and coloumn count Yegor123 4 1,268 Oct-18-2022, 03:52 AM
Last Post: Yegor123
  all i want to do is count the lines in each file Skaperen 13 4,731 May-23-2021, 11:24 PM
Last Post: Skaperen
  How to use the count function from an Excel file using Python? jpy 2 4,370 Dec-21-2020, 12:30 AM
Last Post: jpy
  get two characters, count and print from a .txt file Pleiades 9 3,298 Oct-05-2020, 09:22 AM
Last Post: perfringo
  Count & Sort occurrences of text in a file oradba4u 7 3,006 Sep-06-2020, 03:23 PM
Last Post: oradba4u
  How to extract MSS (maximum size segment) from a pcap file ? salwa17 0 1,645 Jun-29-2020, 09:06 AM
Last Post: salwa17
  Counter of the duplicated packets from a pcap file salwa17 8 4,145 Jun-26-2020, 11:31 PM
Last Post: salwa17
  Splitting the audio file into smaller packets before transfer using UDP protocol in p MuhammadAli152 0 3,646 May-15-2020, 03:01 PM
Last Post: MuhammadAli152
  hex file to binary or pcap to binary baran01 1 5,630 Dec-11-2019, 10:19 PM
Last Post: Larz60+
  Copy a File & Increment File Count xingfang 1 1,830 Oct-29-2019, 03:58 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020