Skip to contentSkip to conversation

Getting the current RTT for an active connection

DISCUSSION Alfonso Presa 2 participants 2 messages Apr 27, 2004 – Apr 28, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

Hi,

I'm trying to develop an iptables extension that needs to get the rtt for an already established connection. Is there any "eassy" way to do this through a conntrack module, or do I have to meassure the delay time between each packet and it's ACK?

I'm newie in programming modules for the kernel, so I would apreciate any kind of help ,explanations and advices you can give me.

Thanks a lot.

Alfonso

#1 lore raw
Quoted 4 lines · Alfonso Presa

I'm trying to develop an iptables extension that needs to get the rtt for an already established connection. Is there any "eassy" way to do this through a conntrack module, or do I have to meassure the delay time between each packet and it's ACK?

conntrack does not care about the RTT, just that packets is flowing.

further, measuring the delay between data and ACK won't really give you the RTT due to the delayed ack feature of TCP. But I suppose that if you keep a running average with high weight to smaller values then you should end up in a good approximate.

Also you need to pair data packet to it's ACK. Not just any data packet to any ACK. This requires a small memory of what data packets (or their last sequence number) has been seen when. Don't forget about window scaling option.

Quoted 2 lines

I'm newie in programming modules for the kernel, so I would apreciate any kind of help ,explanations and advices you can give me.

It is not very different from any other C programming, except that making errors have bigger effects..

UML <http://user-mode-linux.sf.net/> is a great tool to even out the differences while developing.

Regards
Henrik