[Twisted-Python] twisted and gprs

John Aherne johna at johnaherne.co.uk
Mon Jan 8 17:30:25 EST 2007

Andreas Kostyrka wrote:
> * John Aherne <johna at johnaherne.co.uk> [070108 22:28]:
>> I'm obviously missing some obvious point I think.
>> I need to be sure that the connection keeps on using the same source/destination ports for the duration, so the firewall lets the conversation carry on.
>> Provided I don't close the socket at either end will the PDA and server carry on using the same set of source/destination ports.
>> The test I did I purposely took note of the port used by the PDA as the network people told me to make sure I kept them the same. I then forced the server to send using that port as 
>> the destination. Over the time frame of about 40  minutes I did not need to issue any keepalives. I would rather not issue keepalives since this will cost money on a gprs network based 
>> on data usage.
> The huge problem here is, that there are no (repeat no) assertations
> how long firewalls keep their association. Worse, you cannot be even
> be sure that the IP addresses of your client are unique. Technically,
> they have to unique up to the NAT gateway.
> So basically, going the TCP way, with heart beats (that might need
> automatic/manual tuning, depending upon the network) is a safe
> conservative solution.
> Furthermore, GPRS is usually billed at 10/100KB increments. So doing a
> one byte keepalive message every minute, in both directions, would
> mean 5000 minutes or 50000 minutes before the keep alives cause real
> costs. While making the GPRS timeout implies a new connection, and
> lost money, because the payment increments start from zero.
> So sending a small keepalive packet is a sensible thing to do.
> Andreas
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Thanks for the info.

You are right. The IP addresses are not unique. It is the combination of 
IP/PortNo that is unique if I understand the network people correctly. 
They share about 10 IPs with everyone.

I'll run some more tests on how long the firewall is designed to keep 
its associations. And as well I'll check with the network operators.

I'll also check re the costings for keepalives.


John Aherne

More information about the Twisted-Python mailing list