Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #56685

calculating download speed from .pcap file

Date 2013-10-11 16:25 +0200
From patrick <nocommercials45@yahoo.com>
Subject calculating download speed from .pcap file
Newsgroups comp.lang.python
Message-ID <mailman.1005.1381502016.18130.python-list@python.org> (permalink)

Show all headers | View raw


hi,

im looking for a way to calculate download speed for a http connection 
inside my .pcap file.
but doing even a simple read with dpkt doesnt really work.

import pcap, dpkt
import socket

pcapReader = dpkt.pcap.Reader(file("http-download.pcap"))
for ts, data in pcapReader:
     print ts, len(data)
     eth = dpkt.ethernet.Ethernet(data)
     print eth


according to this howto: 
http://jon.oberheide.org/blog/2008/10/15/dpkt-tutorial-2-parsing-a-pcap-file/
it should output something reable, but instead i get ascii art. nothing 
readable.

ts and len(data) work as expected, the first is the timestamp and the 
second the packet length.

any idea whats wrong?



ive had some progresss with scapy when working with icmp, but when 
reading the TCP sequence numbers output differs from wireshark/tcpdump. 
posted it here: 
http://thread.gmane.org/gmane.comp.security.scapy.general/4952


greets

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

calculating download speed from .pcap file patrick <nocommercials45@yahoo.com> - 2013-10-11 16:25 +0200

csiph-web