Earlier quoted context omitted.
Have you seen Richard W. Stevens book TCP/IP Illustrated? Specifically volume 2 'the Implementation', which is, I think what you're looking for (albeit slightly dated).
Yes I own the series but their focus is a little more on completeness. I know I'm getting picky :) but TCP is pretty complex so I keep looking out for the most minimal code and walk through to understand all the state management and other flow.
Also Jeremy Bentham's TCP/IP Lean: Web Servers for Embedded Systems is pretty good.