[Twisted-Python] TCP and ICMP
Hiee All, I have very simple question. I have already implemented custom reactor for handling ICMP requests (reference: txnettools) . My problem is: i am implementing tcp traceroute. I have handled all icmp time exceed messages. But, i want to handle tcp syn-ack reply which i am getting from remote server. How can i do that ? Can i start listening to TCP syn req or replies on the same reactor on which i am listening to icmp replies ? or should i install new custom reactor for listening to tcp replies ? I want to parse SYN ACK request ONLY. Neither I want to make a new connection with remote server nor handling them! I just need syn ack replies to be parsed so that i can figure out whether i have reached my destination or not. thank you. Jay Shah (Technische Universität München, München, Deutschland Tel. +49 176 7266 7259 )
You might find something to use in http://twistedmatrix.com/documents/current/api/twisted.pair.html, or at least an idea of how to implement it from one of the existing components. On Sat, May 10, 2014 at 3:29 PM, Jay Shah <jayshah30392@gmail.com> wrote:
Hiee All,
I have very simple question. I have already implemented custom reactor for handling ICMP requests (reference: txnettools) . My problem is: i am implementing tcp traceroute. I have handled all icmp time exceed messages. But, i want to handle tcp syn-ack reply which i am getting from remote server. How can i do that ? Can i start listening to TCP syn req or replies on the same reactor on which i am listening to icmp replies ? or should i install new custom reactor for listening to tcp replies ? I want to parse SYN ACK request ONLY. Neither I want to make a new connection with remote server nor handling them! I just need syn ack replies to be parsed so that i can figure out whether i have reached my destination or not. thank you.
Jay Shah (Technische Universität München, München, Deutschland Tel. +49 176 7266 7259 )
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
On 05/11/2014 05:01 AM, Tom van Neerijnen wrote:
You might find something to use in http://twistedmatrix.com/documents/current/api/twisted.pair.html, or at least an idea of how to implement it from one of the existing components.
I believe the version of twisted.pair in 14.0 (or release candidates) is vastly improved: rewritten, has documentation, etc..
On May 11, 2014, at 5:35 AM, Itamar Turner-Trauring <itamar@itamarst.org> wrote:
I believe the version of twisted.pair in 14.0 (or release candidates) is vastly improved: rewritten, has documentation, etc..
I am pretty sure this only applies to TUN/TAP support, not all of twisted.pair. -glyph
On Mon, May 12, 2014 at 2:20 PM, Glyph <glyph@twistedmatrix.com> wrote:
On May 11, 2014, at 5:35 AM, Itamar Turner-Trauring <itamar@itamarst.org> wrote:
I believe the version of twisted.pair in 14.0 (or release candidates) is vastly improved: rewritten, has documentation, etc..
I am pretty sure this only applies to TUN/TAP support, not all of twisted.pair.
-glyph
This does appear to be the case. In fact the documentation gives the impression (to me at least) that twisted.pair is _only_ a TUN/TAP library. Still better than no documentation at all, though. -- Kevin Horn
Hi Jay Shah, I started (but never finished) to implement a tcp traceroute (with interesting features) for OONI (Open Observatory of Network Interference... a Tor Project project) probe. You might use parts of the ooniprobe api to capture your packets... It's written using Twisted and I'm fairly certain they've already implemented TCP traceroute... but you still may want to implement your own... because it's a fun thing to write, you'd learn a lot... and your traceroute might have interesting features. I think the ooni interface uses raw sockets to capture packets. Through my research I became aware of two other linux kernel interfaces of interest to capturing packets: - NFLOG - NFQUEUE You'd have to write twisted interfaces for these linux kernel interfaces... but you can also find some mediocre quality code examples of this on blog posts. I had a bit of trouble with dropped packets reusing a twisted interface I found for NFQUEUE; this might've been a problem with the queued packets not getting consumed quick enough before the queue limit was reached... not sure. Cheers, David On Sat, May 10, 2014 at 2:29 PM, Jay Shah <jayshah30392@gmail.com> wrote:
Hiee All,
I have very simple question. I have already implemented custom reactor for handling ICMP requests (reference: txnettools) . My problem is: i am implementing tcp traceroute. I have handled all icmp time exceed messages. But, i want to handle tcp syn-ack reply which i am getting from remote server. How can i do that ? Can i start listening to TCP syn req or replies on the same reactor on which i am listening to icmp replies ? or should i install new custom reactor for listening to tcp replies ? I want to parse SYN ACK request ONLY. Neither I want to make a new connection with remote server nor handling them! I just need syn ack replies to be parsed so that i can figure out whether i have reached my destination or not. thank you.
Jay Shah (Technische Universität München, München, Deutschland Tel. +49 176 7266 7259 )
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (6)
-
David Stainton
-
Glyph
-
Itamar Turner-Trauring
-
Jay Shah
-
Kevin Horn
-
Tom van Neerijnen