You can find the specifications for these two protocols on-line in RFC 791 (IP) and RFC 792 (ICMP). Additional information will be provided in the lectures.
You should use the code available in interface.c and interface.h to send/receive messages to/from the Linux kernel. (See test.c for an example program that uses this interface.) Note that this interface allows you to send/receive complete IP datagrams (your code attaches/removes the IP header), but the kernel is responsible for calling ARP and attaching the Ethernet header.
How one implements IP on a router is not necessarily the same as how one implements IP on an end host. You are responsible for an end-host implementation only. There is no need to support routing, except as required by an end host with a single network interface. One consequence of this restriction is that you can get by with a simple routing table.
You need not support any IP options. However, your implementation should not crash if it receives a datagram with one or more options turned on. Such messages should be delivered to the high-level protocol with the options removed.
You need to support a subset of ICMP. Specifically, you should respond to ECHO packets. This is one way we plan to test that your implementation interoperates with an existing IP host. All other ICMP packets should be printed to standard output. This output need not be pretty as it will only be used for debugging purposes.
We are providing a general-purpose hash table tool that your IP implementation can use if you choose. The object file is map.o, and map.h contains the interface. You will also need the file types.h. The tool has a small test program and some documentation.
Your implementation will be evaluated on its correctness, the elegance of its design, and its observable performance. Since memory copies are often a performance bottleneck in protocol implementations, to receive full credit on the assignment your IP should not copy incoming or outgoing message data.
Turn in a written report (postscript or PDF file, not an MS
Word .doc file) that briefly describes your design and evaluates your
implementation's performance. Also turn in the source code for your
implementation, a Makefile, and a README that explains how to invoke
your program.