November 11, 2022

BSD TCP/IP for Kyu - Progress report 11-11-2022

This all started around October 21, so I have been working on this off and on for just under 3 weeks.

This morning I accomplished one of my first milestones. I have Kyu running the Berkeley TCP code and responding to a telnet request. It looks like this:

telnet levi 111
Trying 192.168.0.73...
telnet: connect to address 192.168.0.73: Connection refused
This means that a packet has been received, processed, and a reply returned. The reply is just a RST packet (since no "bind" to port 111 has been done). But this is still significant. It is using the IP layer in Kyu to receive and send the packets in question and route them to the TCP protocol. Wireshark shows the SYN packet to Kyu and the RST packet returning.

What next?

A variety of code cleanup might be done before moving on to other things, in particular to unify my revision of mbuf handling routines. My revision might be viewed as a step backwards. I have simplified things, done away with "drain" handling and inline macros. I am more interested with simplicity and clarity than performance.

I could also rework my "alloc" routines, which are shaping up to be more like the "slab" allocator. I never return memory to the global memory pool, I just return objects to a linked list of the same sort to be allocated again for the same purpose. I should implement some statistics (number active, number on the free list, high water mark). A limit would also be could to avoid runaway scenarios.

The next goal would be to implement a "bind" along with a wired in response to some port (maybe returning "hello world\n" when a connection is established. Alternately a "connect" facility could be put together. I would do these in a quick and dirty fashion then think about the API to general code in Kyu later.


Have any comments? Questions? Drop me a line!

Kyu / [email protected]