AJN | 5 Aug 20:45 2011
Picon

packet response time

Hello,
Can scapy measure the response time individually for each return packet? or it
can be done only  manually:

t0 = time.time()
sr1...
t1 = time.time() - t0

Thank you in advance.

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Dmytro O. Redchuk | 17 Aug 17:05 2011
Picon

Re: packet response time

У пт., 05-го сер. 2011, о 18:45 AJN писали:
> Hello,
Hi,

> Can scapy measure the response time individually for each return packet? or it
> can be done only  manually:
> 
> t0 = time.time()
> sr1...
> t1 = time.time() - t0
> 
> Thank you in advance.

Sent packets have `sent_time', answered packets have `time' attribute.

I did something like that:
ans,unans = sr(IP(dst=ipaddr)/ICMP(id=os.getpid(),seq=RandShort())*5000,inter=1)

And then:
ans.plot( lambda x:( x[1].time - x[0].sent_time ) )

--

-- 
  Dmytro O. Redchuk

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Ulic | 2 Nov 15:08 2012
Picon

Re: packet response time

Dmytro O. Redchuk <brownian.box <at> gmail.com> writes:

> Sent packets have `sent_time', answered packets have `time' attribute.
> 
> I did something like that:
> ans,unans = sr(IP(dst=ipaddr)/ICMP(id=os.getpid(),
>                      seq=RandShort())*5000,inter=1)
> 
> And then:
> ans.plot( lambda x:( x[1].time - x[0].sent_time ) )
> 

It seems packet.time isn't reliable, many times you can see
packet_sent.sent_time bigger than packet_received.time

---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org

Riccardo Ravaioli | 6 Feb 17:44 2013
Picon

Re: Re: packet response time

On 2 November 2012 15:08, Ulic <dsoria <at> itrust.fr> wrote:

It seems packet.time isn't reliable, many times you can see
packet_sent.sent_time bigger than packet_received.time

I also occasionally noticed negative round-trip times for packets sent with `sr`. How is this possible?

I had a quick look at the source code, but I couldn't figure out who exactly attaches timestamps to packets. Is it tcpreplay? It actually looks like tcpreplay is only launched in `sendpfast`. Am I wrong?

Riccardo.

Gmane