Devia wrote:
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).