I figured it would take me long enough to shake out all the bugs in getting the packet sequencing and acknowledgement right

Disclaimer: I haven't looked at your code!

Just for info, I once did a very handicapped TCP implementation which would simply do RST if anything came out of order or when a FIN came in.. as it turned out all the PC side stuff was very happy with that approach. On modern LANs packets very rarely come in non-sequential sequences.

Just for info, I once did a very handicapped TCP implementation which would simply do RST if anything came out of order or when a FIN came in.

cool - what was the platform & language? Any interesting applications?

Devia wrote:

On modern LANs packets very rarely come in non-sequential sequences.

Agree. What you will get though is retransmissions and very occasional packet loss. So by "sequencing" I really meant is checking whether an incoming packet is a duplicate and discarding (although acking( if it's already been seen, and outgoing data is periodically resent until it is ACKed.

What I'm not doing is reassembling IP fragments, or re-ordering TCP packets - if things really did arrive out of order, the packet that arrived 'early' would get dropped, on the basis that the other end will timeout and resend, hopefully after the 'late' packet has arrived. That way I avoid needing any kind of buffer in the ip stack itself - the client apps get a pointer to the TCP data directly in the ethernet frame, and can either act on it immediately or buffer if desired (e.g. the gopher client needs to assemble multiple tcp packets into a complete file, but it can do that knowing it well get each byte in the correct order, and once only).

I believe that's exactly how uIP does it when compiled without IP Defragmentation. So you should be good. Btw, that's how i've compiled uIP for GuruTerm, so that's kind of proved to work well in mixed environments by now

as far as I can tell, about the only ways that you could get IP fragmentation is 1) if someone had an ethernet LAN hooked up to the internet via PPP or SLIP connection (e.g. on a linux box or something) and you were connecting to a computer on the LAN side of that connection (i.e. something other than the router/gateway itself).2) if someone had enabled 'jumbo frames' on their LAN for some reason.

Anyway I have connected to a reasonable number of hosts of varying flavours and vintage and not had any issues with frgamentation, although I have certainly found (and mostly fixed) plenty of issues with the rest of the tcp stack.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum