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


Groups > comp.lang.python > #56685 > unrolled thread

calculating download speed from .pcap file

Started bypatrick <nocommercials45@yahoo.com>
First post2013-10-11 16:25 +0200
Last post2013-10-11 16:25 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#56685 — calculating download speed from .pcap file

Frompatrick <nocommercials45@yahoo.com>
Date2013-10-11 16:25 +0200
Subjectcalculating download speed from .pcap file
Message-ID<mailman.1005.1381502016.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web