Ins and Outs of TCP
Posted: Sat Sep 20, 2008 4:27 am
Hi guys,
I'm trying to implement TCP off the RFC and Wikipedia articles on the subject, and I'm not letting myself look at *any* other code - I want to write it myself. But, I've run into some problems with my understanding of it.
So far, I'm writing as a server. So I have been able to establish a connection to a client (so I have no problems getting to ESTABLISHED state). However, once here, I'm totally stuck . I've been able to receive data so far (which comes in as ACK) - my OS prints out the total packet data and I see a nicely formed HTTP request, all ready and fitting in the one packet. So, I ACK the incoming data like a good server and ensure there is no data sent in my ACK (because that'd be pointless). And then, I receive another packet. I *believe* something in this packet indicates the end of the data stream, but I have no idea what exactly. And then, of course, because I don't know when the incoming data steam ends, I have no idea when to start sending my data.
So you can see I'm a bit stuck, some help (preferably NOT code) would be greatly appreciated
I'm trying to implement TCP off the RFC and Wikipedia articles on the subject, and I'm not letting myself look at *any* other code - I want to write it myself. But, I've run into some problems with my understanding of it.
So far, I'm writing as a server. So I have been able to establish a connection to a client (so I have no problems getting to ESTABLISHED state). However, once here, I'm totally stuck . I've been able to receive data so far (which comes in as ACK) - my OS prints out the total packet data and I see a nicely formed HTTP request, all ready and fitting in the one packet. So, I ACK the incoming data like a good server and ensure there is no data sent in my ACK (because that'd be pointless). And then, I receive another packet. I *believe* something in this packet indicates the end of the data stream, but I have no idea what exactly. And then, of course, because I don't know when the incoming data steam ends, I have no idea when to start sending my data.
So you can see I'm a bit stuck, some help (preferably NOT code) would be greatly appreciated