Title: TCPIP Solutions for Embedded Systems
1TCP/IP Solutions for Embedded Systems
2Disclaimer!
- The goal of this tutorial is to provide
participants with broad and comprehensive
information on the current state of the art in
Home Networking Technology. - In the course of this tutorial many industry
standards and proprietary products, both Hardware
and Software are presented and discussed in the
context of building Home Network solutions. - Please note that the inclusion of a particular
product or standard does not constitute an
endorsement of that product or standard. - Further note that the opinions expressed by the
presenters are their own and not those of the
IEEE Consumer Electronics Society, the ICCE
technical committee or their employers.
3Overview
- In this Presentation we are gong to take a look
at how to choose a TCP/IP stack in practice. - To do this we will consider and compare a number
of available commercial solutions - uP Specific Solutions Microchip PIC, Ubicom
IP2022 - Open Software Solutions uIP is a free
micro-TCP/IP stack - Hardware Solutions Seiko iReady is a TCP/IP LSI
chip - Enhanced Solutions NodEM TCP/IP from Yippee Inc
- Important aspects of a stack are
- ROM (program) and RAM (memory) usage
- Stack-type
- blocking or non-blocking
- single or multi-tasking
- Modularity how easy is it to customize to
end-user requirements - Portability how well does it work on different
hardware
4Agenda I
- We begin by comparing 2 uP specific stacks
- TCP/IP for the Ubicom Internet Processor IP2022
- Expensive on program size and memory requirements
- Single or Multitasking modes
- Very complete stack comprehensive configuration
options modular components easily configurable - TCP/IP for Microchip PIC microcontroller family
- Not all stack functions implemented
- Designed for co-operative multitasking
environment (Win 3.1) - Proprietary tasking modules integrated into stack
- Significantly reduced program size and memory
requirements
5Agenda II
- Then we consider three alternaives
- uIP a Free TCP/IP Stack for 8/16 bit Micros
- Good configuration options modular components
easily configurable commented source code
available - Multi-platform ports x86, 8051, Zilog, PIC, etc
- Very small program size moderate memory
requirements - Seiko iReady a TCP/IP stack in hardware
- Off-load TCP/IP processing from the micro
- TCP/IP stack configured by writing to control
registers - Contains a modem interface for PPP use
- Hardware limits the configurability and adds cost
6Agenda III
- Internet Enabling Firmware (IEF) from Yippee Inc.
an Enhanced TCP/IP stack which exports network
objects representing the state of an embedded
micro - More than a TCP/IP stack includes
application-oriented capabilities and good
development toolset - Proprietary per node licensing costs
- Allows rapid application development
- Scales to large network projects
- Very tight TCP/IP stack
- Supports PIC micros, 8051 and Motorola 68HC
series
7IP2022 - Ubicom Internet Processorhttp//www.ubic
om.com
8IP2022 TCP/IP Stack Software
- The key features of this TCP/IP stack include
- Supports both single-tasking and multi-tasking
modes - Zero data copy for fast performance
- Non-blocking versions of all functions
- Support for standard client machine, IP router or
multi-homed server - Unlimited connections (memory dependent)
- Nagle algorithm (slow start)
- Configurable Parameters
- Compliant with
- IP RFC791
- ICMP RFC792
- ARP RFC826
- UDP RFC768
- TCP RFC793, 1122
- Also complies with
- DNS, DHCP, SLIP, PPP, Ethernet MAC
9IP2022 TCP Memory Footprints (1)
10IP2022 TCP Memory Footprints (2)
11IP2022 TCP Memory Footprints (3)
12IP2022 TCP Memory Footprints (4)
13PIC TCP/IP Stack Software
- The key features of this TCP/IP stack include
- Stack is independent of application
- Designed for co-operative multi-tasking
environment - Adds two non-standard tasking modules Stacktask
and ARPtask
- Main application must be split into tasks or
implemented as FSM - Not all standard TCP modules implemented but may
be added as additional tasks by end user. - Supports Ethernet MAC or SLIP Phy interfaces
- Provided with example HTTP server application
14PIC TCP/IP Example Memory and RAM Usage
- As implemented with RTL8019AS
- Does not include the size of TX and RX buffers
which are user defined. - Internal program memory storage.
15uIP - A Free TCP/IP Stack for 8/16-bit
Microshttp//dunkels.com/adam/uip/
- uIP has the following features
- Very small code size.
- Very low RAM usage, configurable at compile time.
- Very tight stack usage.
- ARP, SLIP, IP, ICMP (ping) and TCP protocols.
- Configurable amount of concurrently active TCP
connections. - Configurable amount of passively listening
(server) TCP connections. - Well commented source code - nearly every other
code line is a comment. - Up-to-date documentation.
- Includes a tiny web (HTTP) server with simple
scripting abilities. - Free for both non-commercial and commercial use.
16uIP Memory and RAM Usage
17uIP Memory and RAM Usage example 1
A uIP configuration with 1 listening TCP port, 10
TCP connection slots, 10 ARP table entries, a
packet buffer of 160 bytes and the simple HTTP
server will have the properties shown in the
table below.
18uIP Memory and RAM Usage example 2
Another hypothetical uIP configuration with no
listening TCP ports, 2 TCP connection slots, 2
ARP table entries, a packet buffer of 400 bytes
and the the ability to actively open connections
from within uIP will use the amount of space
shown in the table below.
19uIP Examples of Available Ports
- Fabio Fumi has ported uIP to the Casio
Pocket-Viewer PDA. His port can be found at
http//digilander.iol.it/ffumi/. - Fajun Chen from Ericsson have succeeded porting
uIP to the 8051 platform, using the Dunfield
Micro-C compiler. His port is avaliable at
http//ucsu.colorado.edu/chenf/. - Andy Choi has ported uIP to his small
8051/RTL8019 device. - Serdar Akalin has ported uIP to the PIC18C452,
using Ethernet as the data link layer. He will
proceed with implementing it on the flash version
PIC18F452. - Fabio Giovanni has written a driver for the
CS8900a Ethernet chip in 8-bit mode. His code is
still in development, but will be available RSN.
20uIP Porting to Different Microcontrollers (1)
- There is no need to make any changes to the
actual TCP/IP code, but a device driver for the
target's network device (ethernet
controller/serial port/whatever) has to be
written. - The the actual system integration part (i.e.,
the main control loop, which should call the uIP
functions when data arrives and when the
periodical timer expires) also has to be done. - A step-though guide could look like this
- Read the documentation provided at
/http//dunkels.com/adam/uip/documentation.html. - Create a new directory for your port under the
uip-0.6/ directory (choose a name that gives a
short description of the CPU architecture and/or
C compiler used). - Copy the uip_arch.ch files from the unix/
subdirectory to the new directory. These are
generic C code for the checksum algorithm as well
as some other "helper" functions. - Copy the uipopt.h file from the unix/
subdirectory.
21uIP Porting to Different Microcontrollers (2)
- Edit the uipopt.h file to suit your project (the
file should be self-explanatory). - Write a device driver for your particular
hardware. (This is probably the hardest part.)
Look in unix/tapdev.c and cc65/rs232dev.c for
examples of how a device driver can look. - Write the main control loop so that the uIP
functions are called when they should be. Look in
the unix/main.c and cc65/main.c for examples of
how a main control loop can look. Ths unix/main.c
shows how ARP is used. - Write a makefile and compile the code. Be sure to
include the ../uip/uip.c file in your project
(and the .c files in your subdirectory, of
course). If you are using the web server
application, also include the files
../apps/httpd/httpd.c ../apps/httpd/cgi.c
../apps/httpd/fs.c. For ARP support, also include
the file ../uip/uip_arp.c. - Find and correct all bugs. (This can be the
really tricky part -)
22uIP A Simple Application
- This application listens to a port for incoming
connections and responds to data sent to it with
a single ok. - In addition this application prints out a
welcoming Welcome! message when the connection
has been established.
23S-7601A - Seiko TCP/IP Network Stack
LSIhttp//www.sii.co.jp/compo/chip/S7601a/S7601A_
Manual/S7601AHW_PR01aE.pdf
- A complete TCP/IP stack in a low-cost LSI chip
- Standard MPU Interface
- Modem Interface for direct connection to Internet
via POTS - Includes PPP Phy to simplify implementation of
a dial-up connection - Internal SRAM for TCP/IP and PPP functions
- Off-loads all of TCP stack processing from the MPU
24OT731 - Seiko LSI, PIC MCU 2400 Baud
Modemhttp//www.orlin.com
- A ready-to-go Internet Appliance perfect for
prototyping - 2400 Baud Modem for POTS Connection.
- RS-232 port for Bluetooth
- Expansion bus for other Phy connection
- LCD, buttons, etc
- Based on AN731 from Microchip dial-up PIC
Internet Appliance - Made in Ireland -)
25OT731 - Seiko LSI, PIC MCU 2400 Baud
Modemhttp//www.orlin.com
26Summary
- Review of 5 embedded TCP/IP solutions
- Different solutions for different needs
- Proprietary stack for specific MPU family
- Open-Source stack is less efficient/complete but
designed to be portable - Hardware stack
- requires implementation of configuration
functions - benefit is reduced load on CPU
- only supports PPP/dial-up connections
- Enhanced stack
- requirement for application-level support for
TCP/IP - Final choice will depend on YOUR application!