[ECOS] TCP/IP for eCos Porting

Jim Belton jhb@microplex.com
Tue Oct 12 09:48:00 GMT 1999

Hi all:

Prakash wrote:
> 1) Can somebody give me a very high level algorithm one can
> use to port a TCP/IP stack onto an OS?

1. Determine your reference implementation.
2. Determine your ethernet (or other) interface, one supported by the
3. Port the ethernet driver:
    a. Identify the OS specific calls it uses.
    b. Translate them to eCos calls or create an emulation layer.
    c. Get the driver working (receives broadcasts, and can send to a
LAN analyzer).
4. Port the stack:
    a. Identify the OS specific calls it uses.  The number in the BSD
stack is low.
    b. Translate them to eCos calls or create an emulation layer.
    c. Port ping and test it.  This tests ARP, IP and ICMP.
    d. Port inetd and test the "echo" protocol with both UDP and TCP.
    e. Port higher level protocols as desired (telnet, ftp, etc.).

The main design choice is whether to translate calls to eCos or to
create an
emulation layer.  For the stack in particular, I would strongly
recommend an
emulation layer.  This allows future advances in the stack to be more
incorporated.  The same is true to a lesser degree for the Ethernet

One this that is missing in the BSD stack (AFAIK, no flames if I'm
please) is a decent multiplexing layer.  Other OSs (e.g. Linux, Windows,

System V) allow multiple ethernet drivers and network protocols to share

eachother.  Last time I looked (BSD 4.2), BSD couldn't do this.

> 2) What level of expertise is required? I've been involved in
> development of Protocol stacks for Telecom, and I've been a
> user of TCP/IP. But I've just started looking into the
> internals of TCP/IP. (TCP/IP Illustrated, Vol 2, Stevens).

Good place to look, and it sounds lie you've got the right background.
BSD code is really gross (the 4.3 code is alot better than the 4.2 code,
hear).  You will need to hone your C skills.  They used alot of macros

Hope this helps - Jim.

More information about the Ecos-discuss mailing list