Tiny TCP/IP Stack


TCP/IP has become the most widely used protocol for data communications. Although several free versions of software to send and receive data using TCP/IP are available, this code is too large to embed in small microcontroller-based products.

The purpose of this project is to write the smallest possible TCP/UDP/IP stack that is interoperable with most existing software (even if not necessarily standards-conformant).

You will be supplied with the relevant standards (RFCs) and a sample implementation (BSD 4.2) as a starting point. The success of the project will be measured by the size of your implementation (the target is approximately 2k of code and less than 1k of data). The code will be written in C. You will demonstrate your implementation by writing a very simple HTTP server operating over a SLIP link.

Project Status

We succeeded in getting a very small (about 1kB RAM, 2kB ROM) HTTP server. However, it ignored all IP options and only implemented the TCP protocol. The server could only serve two very simple HTML pages which were stored in ROM. It took two students a total of about 120 hours.
We used only SLIP over a 6850 serial port to keep the physical interface as simple as possible.
Due to the space constraints, the code "squashes" all layers of the protocol stack (SLIP/IP/TCP/HTTP) into one. It cannot be used as a general purpose stack. The code is not available.
UBC EE Home Page / Ed Casas / edc@ece.ubc.ca