I'm using the socket module in Python to do some basic UDP client-server communication. What I would need to do is quite simple: client sends server a packet, server answers with client's public ip address, port and a number representing the TTL the UDP packet had when it got to the server. This is my main problem: is there any way to recieve a packet with recvfrom() or so, and read the TTL value it had when it reached my server?
Thank you very much!
Matteo Monti
Python 3.51 has the support for flags such as IP_RECVTTL or IP_RECVTOS. I gave it a try and it worked for me in a 3.x linux kernel.
Getting TTL of incoming UDP packet in Python