Home > Products > TCP/IP Products > smxNet
TCP/IP Products


smxNet is a TCP/IP network stack, which has been optimized for use in real-time embedded systems. It offers RFC-compliant TCP and conforms to the Berkeley sockets API. smxNet is fully integrated with smx. Several higher-level protocols are also available and described herein.

smxNet works well for small ROM'ed hosts, as well as larger hosts. No disk services are required. It can configure itself after power up using BOOTP. ROM requirements are small and configurable to application requirements see table below. RAM requirements are tunable to the application and vary from about 35KB (PPP) or 60KB (Ethernet) to about 150KB (including optional packages) for x86. Use of smxNet with 16-bit processors and small memory is feasible. A no copy operating mode improves UDP and TCP performance. smxNet provides extensive error monitoring and reporting.


smxNet ROM Requirements (KB)
x86 rm PowerPC
37.4[1] 48[2]
52.3[1] 73[2]
7.3 5
4.2 4
2.6 2
1.0 1
FTP Client
5.7 15
FTP Server
15.9 22
29.0 26
NFS Client[3]
NFS Server[3]
35.7 40
DHCP Client
8.6 9
DHCP Server
6.3 6
DHCP Client and Server
14.9 14
MicroWeb Server
12.4 23
11.8 16
7.1 17
38.3 41
b. PPP (no CHAP)
28.5 35
13.4 10
d. Ethernet
1.3-6.0 3


1. Includes NE2000 Ethernet Driver
2. Includes 860 Ethernet Driver
3. FTP, TFTP, and NFS require file system support. A virtual file system is included in smxNet. Alternatively, smxFile may be used.

Simultaneous communications over multiple interfaces are supported. Several drivers are included in the package. A simple, table-driven, device driver interface is provided for custom drivers. smxNet includes the following protocols: IP, UDP, TCP, ARP, RARP, BOOTP, and ICMP.

smxNet provides a total of 66 services. (See table on pgs 3 & 4.) These are grouped into six categories as follows:

Basic System Services

These are a subset of the Berkeley Sockets API. They initialize smxNet, manage interfaces, and perform control functions.

Socket Services

These are the standard Berkeley Socket Services. They permit creating, binding, and connecting sockets, sending and receiving data, and other socket functions. (A socket is the combination of a host's IP address and a port number at the host.)

High-Speed Services

Nine high-speed UDP and TCP services are provided. These utilize smx message facilities to pass messages from layer to layer of the stack without copying from buffer to buffer (as is done by the standard socket services such as recv() and send().) This significantly reduces processor loading and improves throughput.

DNS Services

Domain Name System services permit getting IP addresses and domain name information from a domain name server. (An example of a domain name is www.smxrtos.com)

Miscellaneous Services

These include getting protocol and service information and sending error information to the application.

Modem Control

Modem control for SLIP, CSLIP, and PPP.

smxNet Services

Basic System Services

Abort a TCP socket and sever any connections
Open an interface for serial communication
Call a BOOTP server to get this node's IP address
Close an interface
Return interface information
Open an interface for Ethernet or loopback
Install a receive multicast address list in an interface
Ping a host and wait for it to reply
Call a RARP server to get this node's IP address
Add a route to the routing table
Delete a route from the routing table
Perform cleanup before exiting
Initialize TCP/IP run-time environment
Restart TCPIP runtime environment
Set the IP address and IP network mask for an interface
Checks state of socket
Checks state of socket
Checks state of socket

High Speed UDP/TCP Services

Allocate a message buffer for the high-speed interface
Maximum number of bytes transferable per packet
Returns the address of the user area in a packet
Return count of valid user bytes in a received packet
Free a message buffer for the high-speed interface
Wait for next UDP packet at a port
Wait for next UDP packet at a port, and retrieve host address
Send UDP data directly to a port (unbuffered)
Send UDP data directly to a host

Domain Name Server Services

Add entry to global host table
Reinitialize the internal host cache
Delete entry from global host table
Set global name server list
Takes name string and return IP address
Take IP address and return name string

Socket Services

Accept a connection from any remote host (TCP only)
Bind a socket to a local port number and IP address
Close a socket and sever any connections
Establish a connection to a remote host
Get port # and IP address of remote host connected to a socket
Get port number and IP address of a local host
Get value of a socket option
Convert unsigned long from host to network byte order
Convert unsigned short from host to network byte order
Turn I/O blocking on or off
Establish a backlog queue for a socket (TCP only)
Convert unsigned long from network to host byte order
Convert unsigned short from network to host byte order
Receive data at a socket
Receive data at a socket and retrieve host address
Block until status (read or write ready or error status)
Send data to a socket
Send data to a host
Set a socket option
Disable receives and/or sends on a socket
Allocate a UDP or TCP socket port

Miscellaneous Services

Get protocol info from protocol name
Get protocol info from protocol number
Get service info from server name and protocol name
Get service info from server port and protocol name
Print status message for FTP
Write debug message to screen
Inform the application of an error
Processes an input char while in raw mode

Modem Control

xn_autoanswer Wait for remote login via modem and answer
xn_autologin Automate login to remote server over Hayes-compatible modem
xn_hangup Hang up modem
xn_scriptlogin Login to remote server using script

smxNet Included Protocols

ARP Address Resolution Protocol dynamically binds a high-level IP address to a low level physical hardware address (e.g. an Ethernet address). This is called an address mapping. A local ARP cache is maintained by smxNet. If a needed address mapping is not found in the cache, an ARP request is sent out on the network. The ARP reply (returned by the network) is used to update the cache. Information received in ARP requests from other hosts is also used to update the cache.

RARP Reverse Address Resolution Protocol allows a host to obtain its own IP address from a RARP server. This is done by sending the host's hardware address. This is useful for ROM'ed hosts. smxNet includes both a RARP client and a RARP server.

BOOTP Bootstrap Protocol is a better way than RARP to initialize a ROM'ed host. Data returned from the BOOTP server is used to set the host's IP address and network IP mask. Other data may also be returned such as the address of the nearest IP gateway and the address of an available file server.

DNS Domain Name Server Protocol obtains IP addresses and names from a domain name server.

ICMP Internet Control Message Protocol allows gateways or hosts to send error or control messages to other gateways or hosts. smxNet allows initiating ping requests and echoing received ping requests. It also supports standard ICMP functions such as source quench, redirect, etc.

IGMP Internet Group Management Protocol supports IP multicast addressing. smxNet allows hosts to inform routers which multicast addresses they are listening to.

RIP Routing Information Protocol allows sharing route information between directly connected gateways and hosts. smxNet supports both versions 1 and 2 of RIP.

SLIP Serial Line Internet Protocol permits a host to connect to a TCP/IP network via a telephone line. Includes UART driver and modem control.

CSLIP is SLIP with Van Jacobson compression.

Development Kit

The smxNet development kit includes full source code, a comprehensive demo, a simplified demo that smxNetworks with the smxintegrated product platform, and a reference manual. smxNetsupports the same tools as smx. It is available in real-mode, 16-bit protected mode, and 32-bit protected mode for x86 processors and also supports all ARM, ColdFire, PowerPC, and SH processors. It may be easily ported to other 16 and 32-bit processors. smxNet is sold royalty-free per developed product. One development kit may be shared by all programmers on a single project.

Included with smxNet Drivers

ISA Cards (10BaseT)

  • 3Com boards based upon 3C503, 9
  • NE2000 compatible boards
  • Western Digital boards based upon National 8390x


  • 3COM (Ethercard Plus) 3CFE574
  • Linksys and other NE2000 compatible PCMCIA cards
  • Ositech (4 of Diamonds)

PCI Cards (10/100BaseT)

  • 3COM 3C905C Etherlink
  • Accton Cheetah based upon Realtek 8139
  • Davicom DM9
  • Intel Ether Express Pro+ based upon 82558, 82559, 82559ER

Single chip solutions

  • AMD LANCE 7990, 79C960, 79C961 (ISA 10)
  • AMD LANCE 79C970 (PCI 10)
  • AMD PCnet 79C972, 79C973, 79C975 (PCI 10/100)
  • Crystal semiconductor CS8900 and CS8920 (processor bus 10)
  • Davicom DM9102A (PCI 10/100)
  • Intel 82559, 82559ER (PCI 10/100)
  • National Semiconductor 8390x and compatibles (Gavicom DM98008, UMC 9008) (ISA 10)
  • National Semiconductor DP83815 (PCI 10/100)
  • Novel NS83905 (ISA 10)
  • Realtek 8139 (PCI 10/100)
  • SMSC LAN91c90/2/4/6 (ISA 10)
  • SMSC LAN91c100/111 (processor bus 10/100)

System on a chip solutions

  • vAutomation Turbo186 (10)
  • IBM PowerPC 405GP 10/100 Ethernet MAC (10/100)
  • Freescale 68EN360 QUICC ethernet (10)
  • Freescale MPC860 QUICC ethernet (10)
  • Freescale MPC860T Fast Ethernet Controller (100)
  • Freescale ColdFire 5272/5282 Fast Ethernet Controller (100)

Asynch Device Support

  • SLIP and Compressed SLIP·
  • PPP with compression and CHAP and PAP authentication
  • Dial-up modem support answer and initiate modes
  • 16550 UART
  • 8250 UART

The simple device driver interface for smxNet permits adding new device drivers, easily. The device table entry for each driver has four entry points: open, close, send, and statistics. Standard services are provided to handle received packets from interrupt service routines. Please contact us for further custom driver quotations.



Dynamic Host Configuration Protocol, is a client server protocol for obtaining network parameters needed by a host. It is an extension of the BOOTP protocol, which allows clients to obtain network configuration parameters and an IP address. DHCP adds the capability to associate with an IP address a "lease", which specifies the amount of time a client is entitled to use the IP address before it becomes invalid. The specification for DHCP is set forth in RFC 1541, with additional information in RFC's 1533 and 1534.


File Transfer Protocol is a more extensive file transfer protocol than TFTP (see below). FTP client consists of 10 services. (See the ftpcli services, below.) An FTP client demo is included. The FTP server supports 18 commands from clients. If running with smx, multiple sessions can be supported by the FTP server.

FTP Client API

Connect to an FTP server
Change the current working directory
Perform a LIST or NLST command
Create a directory
Retrieve the current working directory
Close a connection
Remove a directory
Set the transfer type to ASCII or Binary
Remove a file
Perform GET or PUT command
Start a FTP server

FTP Server Commands Requested by a Client

Change a directory
Delete a file
Display help
Detailed directory list
Create a directory
Select mode (ignored)
Directory list files only
No operation
Set server to passive mode
Reassign data port
Query working directory
Quit the session
Upload a file
Delete a directory
Return file size
Download a file
System type
Set file transfer type
Log in with user name

smxFile, DOS, and the smxNet Virtual File System are supported by the FTP server.


Trivial File Transfer Protocol is a simplified protocol which supports only reading and writing files. It consists of three client services and one server service.

Connect to a TFTP server
Retrieve a file from a TFTP server
Send a file to a TFTP server
Start a TFTP server main program

smxFile, DOS, and the smxNet Virtual File System are supported by the TFTP server.


Internet Message Access Protocol. The purpose of IMAP is to allow a client to have server-based email management. With IMAP, a client does not need to download and store its own messages. All messages can be manipulated and stored on the server. The IMAP client establishes a TCP connection to port 143 on the IMAP server. The IMAP server responds with a banner greeting. The client then logs onto the server using a username/password LOGIN command. The client then selects a mailbox to work with. The server responds with the status of the mailbox. This shows the number of messages that exist, the number of new messages, and the first message that the client has not yet seen. The UIDVALIDITY field shows the unique identifier of the mailbox. FLAGS field displays flags that are legal for that mailbox. It also displays if the mailbox has been opened for reading and/or writing. The client then usually sends a command to retrieve particular data items from the message. The CLOSE command is used to close the mailbox.

MicroWeb Server

MicroWeb Server is an embedded web server for use with smxNet. This server relies on a set of user-defined web pages (written in HTML language) to provide HTML network output. It communicates with a remote web browser using the HTTP protocol.

The following HTTP requests from a remote WEB browser are supported:

GET: Get a file (i.e. a web page)
POST: Execute a POST function
PUT: Put a file

smxFile is used to retrieve web pages which are requested by GET commands from remote web browsers. If smxFile is not available, virtual files may be used, as described below.

Virtual File System

A virtual file system is provided to obtain and save web pages when smxFile is not present. When a GET command from a web browser is received for a web page, if the file name is defined in the virtual file table, it will be read from the virtual file system (i.e. the character array will be returned). No HTML compression is supported.

Server Side Includes (CGI)

Keywords can be included in a web page which, when the web page is requested, will cause the web server to execute the functions specified by the keywords. These functions will send data directly to the remote browser as part of the requested document. Using this feature, realtime data such as the current time or temperature from a sensor can be included directly into a transmitted HTML document.

Form Action Posts

A form action post consists of a keyword in the web page which instructs the remote browser to send a POST command back to the specified IP address (usually this web server's address). The command sent back is based upon input on the browser side. Upon receipt of the POST command, the web server will call a function which parses it and performs the desired action. The function http_get_line can be called to retrieve the input data to be parsed. This feature is useful if there are commands or specific settings that need to be sent to the server from the browser.

Server Push

Server push provides a means for MicroWeb server to continuously send data to a client without needing explicit refresh requests from the client. Server push relies on a variant of the MIME message format called "multipart/mixed" or "multipart/mixed-replace". With server push a MicroWeb server can keep the HTTP connection open indefinitely. Server push can be used for animation and dynamic updating of field data.


Two methods for security are provided: (1) Authentication based upon the IP address of requestor, and (2) authentication based upon user name and password (RFC1945).


Java is useful for developing interpreted "applets" that may be downloaded from a web server to a web browser and executed locally by the browser. Java is useful for developing graphic, windowed and network-enabled applications.

Some examples of how Java might be used:

  1. A device running smxNet and MicroWeb Server downloads a Java applet to a browser and then continuously sends data such as temperature to the applet. The applet graphically displays the data as a temperature guage.
  2. A device running smxNet and MicroWeb Server downloads a Java applet to a browser. The browser then displays controls such as sliders and radio buttons which may be used to control hardware managed by the embedded system running MicroWeb Server.

Java can be easily used with MicroWeb Server. To do so, simply develop the applet and reference it in the appropriate MicroWeb HTML page via the <applet> tag. The applet may reside on disk or may be compiled into a virtual file.


Network Address Translation permits connecting multiple modes to an IP network using a single IP address. All nodes must be on a single Local Area Network (LAN).


Network File System client provides a comprehensive API for accessing and manipulating a file system on a remote host. From the user's perspective, NFS is almost invisible. He can access arbitrary files for input and output. The file names, themselves, do not show whether the files are local or remote.

The NFS client API is reentrant, so multiple tasks may access a file system simultaneously. Drives a: through *: (user specified) are reserved for smxFile. Drives above *: are reserved for NFS. The NFS client provides 30 calls such as file open, read and write, directory create and delete, disk open and close, etc. NFS server performs client commands. It can be configured to use smxFile, DOS, or the smxNet Virtual File System.


Post Office Protocol allows a POP client to retrieve email messages from a POP server. The POP client establishes a TCP connection to TCP port 110 (the POP port) and the POP server sends back a greeting. The POP Client then sends login information via the USERand PASS commands. The POP server responds starting with "+OK" if the login was valid or "-ERR" if the login was invalid. The POP Client may then send the STAT command, in response to which, the POP server will send a reply of the form "+OK n m"where the n is the number of messages andm is the size of the mail file. The POP Client may then send the LIST command to which the POP server responds wiht a list of email and their sites. Following this, commands of the form "RETR n" and "DELE n"may be used to retrieve the delete messages, respectively, where n is the number of the message. Messages can have attachments.


Point to Point Protocol permits TCP/IP network access via a serial link. It is like SLIP (which is included with smxNet). However, PPP offers more features and better throughput. It can be used to interface with an ISP (Internet Service Provider) via a modem. PPP has the ability to negotiate several parameters, such as compression and security with another PPP host. Also, it provides better security than SLIP. Both client and server modes are supported and memory usage is configurable.

In opening a PPP connection, PPP progresses through five phases: It is initially in the DEAD phase and remains there until an open LCP (Link Control Protocol) is performed. PPP then transitions to the LCP phase. During the LCP phase, LCP options are negotiated. After this, if an authentication protocol was negotiated, PPP transitions to the AUTHENTICATION phase. If no authentication was negotiated, or after authentication has been performed, PPP transitions to the READY phase where IPCP (IP Control Protocol) options are negotiated. After this, PPP returns to the DEAD phase after a close command is performed. The PPP API provides 20 calls to open or close a PPP connection and to set negotiation parameters.

PPP supports two types of authentication: PAP (Password Authentication Protocol) and CHAP (Challenge-Handshake Authentication Protocol). Either, or both, may be configured. PPP includes a UART and modem control. PPP is compliant with RFC's 1661, 1172, 1332 & 4.


PPPoE permits using the PPP protocol over Ethernet.


Server Messaging Block is the network protocol used by all variants of Microsoft Windows to share files and printers over a network. It runs on top of TCP/IP as an application-level protocol. Embedding SMB server in a system makes it available as a disk or printer resource to any Windows PC as well as any Linux or Unix variant running Samba. Our SMB is designed from the bottom up for small real-time systems. It has high performance, a small footprint, and is robust and portable.





Open Files

Buffer Size


(Measurements are with no debugging information or optimization.)


Simple Mail Transfer Protocol allows an SMTP client to send an email message to an SMTP server. The client connects to TCP port 25 (the SMTP port) and sends a greeting of the form "HELO domain", where domain is the domain name of the client. The server response consists of a result code followed by any optional text and ending with a <CRLF> pair. The client then uses the "MAIL FROM:" command to specify the author of the message, and the "RCPT TO:" command to specify the recipients. Note that if the message has multiple recipients, this command may be used more than once for a single message. The client then sends the DATA command, which informs the server that what follows is the email message. Attachments may be included. The client then sends the message, terminated by "<CRLF> <CRLF>". The QUIT command is used to close the connection.

SNMP Agent v1, v2, and v3

Simple Network Management Protocol, provides for communication of information from managed devices to a centralized management station, as shown in the diagram. It supports communication in the form of queries (information requested by the management station) or traps (information provided by the managed device in response to pre-defined events). At the management station, software like HPOpenView (not included) requests, accepts, decifers, and displays the information. SNMP can be used to monitor and control embedded devices, as well as network devices.

An object, also known as a managed object, may be a variable or a table in the device. Objects are defined by a MIB (Management Information Base). The management station and the device have equivalent copies of the MIB. The MIB in the management information station allows identifying objects in order to processinformation sent by the device either by responses or by traps. The MIB in the device relates subrountine addresses to objects in order to read or write data from or to variables or tables in the device.

SNMP v1 agent accepts the following commands from the management station:

Retrieve an object
Retrieve the next object
Set an object to the specified value

It sends the following back:

Send value in response to a received command
Sent value due to occurance of a pre-defined event

SNMP v1 agent comes with all standard network objects defined. These comply with the MIB-II standard. In order to add device-specific objects to the MIB, it is necessary to use a MIB compiler to produce the management station MIB and to define the device MIB using C statements. Examples are provided doing this. SNMP v1 agent complies with RFC's: 1155, 1157, 1213, 1215, 1317, 1650, and 2089.

SNMP v2 agent supports both SNMPv2c (RFC's 1902-08) and SNMPv2u (RFC's 1909&10). The first adds the following command from the management station:

Retrieve a large number of objects

The second provides for message authentication and privacy using a user-based model.It is recommended only for secure (i.e. private) networks.

SNMP v3 agent adds strong security features including encription. These features are adequate for use over an insecure network, like the Internet. This is done through the use of a shared password key which is used to encript the data. With SNMPv3, secure device monitoring over the Internet is possible. SNMP v3 agent complies with: RFC's 2570-75. It adds the following command back to the management station:

Sychronizes with a remote management station


Simple Network Time Protocol provides services to obtain and set accurate date and time in network connected devices. SNTP provides for the following sources:
Gets time of day from an SNTP server and stores in a global variable.
Gets time of day from global variable.
Writes time of day in string format.


Secure Sockets Layer provides secure communications over networks that are not secure, such as the Internet. smxNet's SSL, snSSL, is a full SSL implementation support SSLv2, SSLv3, and TLSv1. SSL is appropriate in a situation where a central host is communicating with remote embedded units over a wide area network. The central host might be sending commands to remote central units or it might be obtaining confidential information from remote sensing units. Either way the need for security is obvious.

smxNet SSL supports symmetric Key encryption, using unbreakable Keys. This requires that each embedded unit and the central unit have the same Key. It is a workable scheme if Keys can be permanently and securely loaded into embedded units before they are shipped. However if a Key is stolen, security is compromised.

smxNet SSL also supports public Key encryption. In this case the central host generates a private key/public key pair. It retains the private Key and sends the public Key to the embedded units. They use the public key to encrypt the messages sent back to the central host. These messages can be decrypted only with the private key which only the central host possesses. This method appears secure, but what if an imposter poses as the central host? The embedded units will not know the difference.

This problem is resolved through authentication. smxNet SSL supports the use of certificates issued by trusted Certificate Authorities (e.g. Verisign). When the central host sends out a public Key in a certificate, each embedded unit can verify, from the CA, that the public Key came from the central host not from an imposter. smxNet SSL also supports message digests to assure that information received has not been tampered with.


Both Telnet server and client are available.The Telnet client permits connecting to a Telnet server in another host and transferring characters to or from it. The Telnet server can process multiple connections in an smx environment.

Start a Telnet client
Start a Telnet server
Initialize Telnet server daemon
Kill Telnet server daemon
Process one Telnet server session

802.11b Wireless Driver

The 802.11b driver permits embedded drivers to connect into wireless TCP/IP networks. It is implemented in the same fashion as other Ethernet drivers. Developers can test their device on a wired network using standard Ethernet drivers and later drop the final code into their wireless station. The 802.11b driver can be configured for:
  • One or more Chipsets
  • Performance Indexes
  • Continously Aware Mode (CAM)
  • Power Save Polling
  • Transmission Rate
  • Wired Equipment Privacy (WEP)
  • Cipher Key Length

Support is included for Wired Equivalent Privacy (WEP) as a security device to prevent inadvertent disclosure of transmitted data over the wireless system. The WEP encryption supports 64-bit and 128-bit encryption through the symmetric key cipher RC4.

This driver currently supports Intersil's PRISM WLAN chipsets as found in Symbol Technologies' Spectrum 24, and Proxim Corporation's ORiNOCO Goldcard (previously from Agere). Contact us for other chipsets.

* All optional packages require smxNet.

For more information

To learn more about the smxNS and smxNet TCP/IP stacks see:

1/15/04     back to top
  Register for More Info
smxNet Features

  • Designed for embedded systems
  • High performance, including no-copy mode
  • Compact footprint
  • Wide range of network protocols available
  • Extensive Ethernet drivers
  • Wireless support
  • Highly user configurable
  • ROMable and reentrant
  • Includes complete source code in ANSI C
  • No disk services required
  • Supports multiple interfaces simultaneously
  • Extensive error monitoring and reporting
  • Low-cost and royalty-free
  • Ported to SMX® RTOS
  • Runs stand-alone or portable to other RTOSs
  • Procesor independent