[ell-i-developers] Ethernet/ARP/IP/UDP/CoAP status

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Thu, 20 Mar 2014 09:04:48 +0200

I am now happy with the size of the Ethernet/ARP/IP/UDP/CoAP implementation in 
the feature-coap-temp branch.  I will do one more round, trying to fix a couple 
of structural problems (i.e. hacks) there without increasing the size, and push 
the result as a single large commit to feature-coap-wip.  I'll send a note once 
that is done.

The next thing after that is the somewhat slower process of cleaning up the 
code and merging it in pieces to the master branch.  That will take some time, 
as each step will need to be tested, including test case writing.

Anyway, the first step of the Ethernet/ARP/IP/UDP/CoAP is now feature complete. 
 The next feature is to move from the temporary, fixed Ethernet address of 
00:00:00:00:00:00 to a temporary but real one, generated by default from the 
chip ID.  It will be also possible to define the Ethernet address as a 
compile-time option.  I will implement these features while cleaning up the 

At the moment, the stack implements the Ethernet driver, ARP server, 
more-or-less full IPv4 (checksums implemented, no fragments), UDP server 
(checksums implemented but not enabled or tested yet, no client support), and 
CoAP server.  DHCP client functionality is still needed, but we won't implement 
it before the threading code works enough so that we have well-working timers.

The total size of the library is now 1800 bytes, down from some 3000 bytes.  
The size of the hello_world program is about 4850 bytes, down from about 5500 
bytes.  The reason why the binary has not shrunk so much is in some inlined 
code, which does not appear in the library but does appear in final binaries.  
There are still a couple of places where we could save maybe 200 bytes total, 
but analysing the situations in detail and fixing them appears challenging.  I 
don't consider that important at the moment.  The size is small enough, for 
now.  My current guesstimate is that DHCP will take 500-800 bytes of flash and 
maybe 16 bytes of SRAM.

Approximating from this we can state, roughly, that our stack will implement 
the IP/UDP/CoAP functions in about 2500 bytes of flash (including DHCP); the 
SRAM usage is heavily dominated by the packet buffer.  As the basic runtime 
takes about 2500 bytes, we should be able run a fully functional CoAP server in 
5000 bytes, leaving 3000 bytes for the application code in the very smallest 
MCUs.  That should be fine for relatively complex applications, especially 
since we will be able to push some time-critical tasks to the FPGA.  Not bad 
for an essentially $1 BOM (for MCU + FPGA).


Other related posts:

  • » [ell-i-developers] Ethernet/ARP/IP/UDP/CoAP status - Pekka Nikander