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 refusedThis 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.
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.
Kyu / [email protected]