Monday, March 24, 2008

Haiku Project Proposal

Below is part of my project proposal for Haiku. I have removed the first part of the application that has personal information I would rather not post on this blog. Also this post expands on the content within the application with graphics and more detailed explanation.

Project Idea

What I will be trying to achieve this summer is to implement ICMP and an error-handling mechanism for the network stack. I have been reading the network stack code and already have a good understanding of how it works internally.

The main goals for this project are to:

Implement the ICMP module (for IPv4) as described in RFC792: This will require minor modifications to the IPv4, TCP and UDP modules. Right now the IPv4 header is being removed from the net_buffer before it is being passed to the other protocols (TCP, UDP or ICMP). Some ICMP messages require (in some cases) that the original IPv4 header + 64 bytes of the upper layer header (TCP/UDP in this case) be sent back as part of the ICMP header so that the receiving host can identify which packet caused the error.

Create an error-handling mechanism for IPv4, TCP and UDP: I will use the functions already set for the net_modules. Specifically error() and error_reply(). This will be implemented in such a way that the TCP and UDP modules are independent from the ICMP module and all messages are transmitted through the IPv4 module, like so:

The error-reporting mechanism will work as follows:

  • An ICMP message is received from a remote host and is passed to the ICMP module from the IPv4 module.

  • If the message is regarding a previously-sent packet by either the IPv4, TCP or UDP layers, the message will be sent to the IPv4 module using the error() function.

  • If the message is regarding a previously-sent packet by either the TCP or UDP layers, they are sent to these modules using their error() function and the message is handled accordingly. Otherwise they are processed and handled by the IPv4 module.

  • To reply to a message the TCP and UDP module will use the IPv4's reply_error() function to pass the reply message down to the ICMP module using the send_data() function.

Below is a graphic representation of this process:

Document the work described above: I plan to document all the work that I do. I will use this blog so that people can track my progress and also to show step-by-step how I implemented the work described above. I will also prepare a separate document which will more likely be based on the contents of this blog by the end of the summer. If time permits I would also like to document the whole inner-workings of the network stack based on this document.
I’m not sure who the author is, so I might have to start from scratch to avoid copyright issues.

First Post + GSoC 2008

I set up a blog once before, but never really posted much to it since I didn't have much stuff to talk about that other people would even care about.

Now things have changed since I'm planning on applying for Google Summer of Code 2008 and (I think) I have a good chance of getting accepted.

I'll be using this blog mainly so that other people can track my progress on whichever project I get accepted.

As of right now I'm planning on applying for two projects. One is to implement a resource (basically a backend plugin) to Akonadi. The resource I would be implementing in the event that I get picked up is an OpenChange resource to allow users to interact with MS Exchange Servers.

I will also be applying to implement ICMP and an error-handling mechanism for the Haiku network stack. This will also include Path MTU discovery.

I already have a pretty good idea of how to do this since I've spent a couple of hours looking at the network stack code and I must say that Haiku has one of the cleanset network stack implementation I've ever seen in my life. It was relatively easy to follow the code. I think this might have to do wit the fact that it's written in C++. Some might argue that having C++ in the kernel is stupid. I think otherwise, and Haiku has definitely proven those people to be wrong.

For anyone interested here is a basic explanation of the internal design of the Haiku Network Stack that I (unfortunetly) found after I already knew the how things worked. It did help clarify one or two things afterwards though.

As you have seen both projects I've chosen to apply for are in C++. C++ is my native (programming) language. It's the first one I learned (except for BASIC in like 4th grade) and it's the one I have the most experience on. It also happens to be the one I like the best. I've started to appreciate python lately however, but that's another story.