5 ms·
I have actually implemented a TCP stack in python, unfortunately I can't share it publicly just yet. The authors problems are because she is not using RAW_IP_S
by kashif 12y ago
I have actually implemented a TCP stack in python, unfortunately I can't share it publicly just yet.
The authors problems are because she is not using RAW_IP_SOCKETS.
Making TCP packets using pythons struct module is a breeze. I can post specific examples in code if anyone is interested.
Finally you can write a proper TCP stack in python, there is no reason not to. Your user-space interpreted stack won't be as fast as a compiled kernel-space one - but it won't be feature short.
PS: I guess, Google is probably sending him a SSL/TLS handshake which he isn't handling.
Edit: Corrected author's gender as mentioned by kind poster.
- blutoot 12y agoI believe the author is a "she". It says at the banner of the blog.
- blutoot 12y agoI think this downvoting thing is out of control. What was even remotely offensive about this correction?
- dragonwriter 12y ago"offensive" isn't the only reason for downvoting. "Not a substantive addition to the conversation" is one (of many) other bases. If you are going to complain about downvoting [1] why do so based on the unwarranted assumption that the downmod must be for offensiveness? [1] And you shouldn't, see the Guidelines [2] under "In Comments" [2] https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- vacri 12y agoIn my opinion, if HN doesn't want puzzled people to ask why they've been downmodded, then instead of putting a line in the Guidelines saying "don't do this", they should separate the downmod into "I disagree" and "flag this as a bad comment", with the latter item the one that reduces the text weight. It's clearly broken - people have been doing this for as long as I've been here, and it's not going to change (sadly, 'it' means both the behaviour, and HN's braindead downmod mechanism).
- kashif 12y agoGoogle sends extra packets because it does not comply with TCP Slow Start(RFC 2581) - if the author implements a proper tcp state machine and buffer then she would be able to handle this.
- fivre 12y agoIf you have code examples already, I'd be grateful--I ran into server that had Python but not nmap or nc and while I was already familiar enough with socket to do what I needed, I wasn't so familiar with struct and wasn't able to make much headway manually building TCP/UDP packets before having to move onto other work.
- kashif 12y agodrop me an email, the address is in my profile. I will send you some examples.