title: How do I test a custom TCP implementation on Linux?
body: <p>For learning purposes I'm implementing TCP (for now just RFC 793) but I have no
  idea how to test it. Most TUN/TAP stuff on the internet are out of date (e.g.
  Linux API calls no longer work) and just doesn't explain enough. In addition, I
  feel like a creating a device and forwarding packages etc. are not the best way
  for learning purposes. For example, I'd rather only override <code>socket()</code>,
  <code>listen()</code>, <code>connect()</code>, <code>accept()</code>, <code>send()</code>, <code>recv()</code> etc. in a program rather
  than forwarding <em>all</em> ethernet traffic to a device/program that does the
  bookeeping for the whole system rather than for a single program.</p>
  
  <p>I'm wondering if this is possible. If not, I'd like to know the simplest way to
  test a TCP implementation on Linux.</p>
  
  <p>Because I'm following RFC 793, it'd be great if I could have an IP (Internet
  Protocol as mentioned in the RFC) API in my application. Is this possible or do
  I have to mess with TUN/TAP stuff?</p>
  
  <p>Thanks..</p>