Raw sockets
Steven Majewski
sdm7g at Virginia.EDU
Wed Dec 19 19:35:13 EST 2001
On 13 Dec 2001, Ben Ainsworth wrote:
> Is there a good intro to using raw sockets with python on the web? I
> want to try writing a variant of traceroute using tcp instead of icmp.
[1] If you're going to use tcp, then why do you need raw sockets?
[2] Since traceroute relies on the icmp messages returned when the
TTL goes to zero, I'm not sure how you could write a traceroute
without icmp.
[3] Raw sockets using Python are pretty much the same as raw sockets
using C or any other language -- you need to manually wrap your
data up in the headers that the tcp/ip layers normally wrap for
you (including checksums). I think there's a 'ping' in python
floating around that uses raw sockets to make icmp packets.
You might search the archives.
[4] Other than that, it was a good question!
-- Steve
More information about the Python-list
mailing list