UIP (software)

Last updated
UIP
Stable release
1.0 [1] / 27 March 2013;10 years ago (27 March 2013)
Repository
Platform embedded systems
Type TCP/IP stack
License BSD

The uIP is an open-source implementation of the TCP/IP network protocol stack intended for use with tiny 8- and 16-bit microcontrollers. It was initially developed by Adam Dunkels of the Networked Embedded Systems group at the Swedish Institute of Computer Science, licensed under a BSD style license, and further developed by a wide group of developers.

Contents

uIP can be very useful in embedded systems because it requires very small amounts of code and RAM. It has been ported to several platforms, [2] [3] [4] including DSP platforms. [5]

In October 2008, Cisco, Atmel, and SICS announced a fully compliant IPv6 extension to uIP, called uIPv6. [6]

Implementation

uIP makes many unusual design choices in order to reduce the resources it requires. uIP's native software interface is designed for small computer systems with no operating system. It can be called in a timed loop, and the call manages all the retries and other network behavior. The hardware driver is called after uIP is called. uIP builds the packet, and then the driver sends it, and optionally receives a response.

It is normal for IP protocol stack software to keep many copies of different IP packets, for transmission, reception and to keep copies in case they need to be resent. uIP is economical in its use of memory because it uses only one packet buffer. First, it uses the packet buffer in a half-duplex way, using it in turn for transmission and reception. Also, when uIP needs to retransmit a packet, it calls the application code in a way that requests for the previous data to be reproduced.

Another oddity is how uIP manages connections. Most IP implementations have one task per connection, and the task communicates with a task in a distant computer on the other end of the connection. In uIP, no multitasking operating system is assumed. Connections are held in an array. On each call, uIP tries to serve a connection, making a subroutine call to application code that responds to, or sends data. The size of the connection array is a number that can be adjusted when uIP is recompiled.

uIP is fully compliant with the RFCs that define TCP, UDP and IP. It also implements the mandatory maintenance protocol ICMP.

Versions

uIP 0.9 [7] is the version with the least dependence on operating systems, the smallest resource use, and the only version that presents a pure event loop API, but in its original form does not support IP version 6, only the older, more common IPv4. It may be used in embedded systems with very small amounts of resources.

It was delivered with a set of examples of higher-level protocols that also run on an event loop system, including HTTP (a simple web server), SMTP (simple mail transmission protocol), FTP (file transfer protocol), telnet (terminal emulation), and others. Despite the examples and its small size, uIP 0.9 can be difficult to apply because it does not use any form of socket API. [8]

uIP is widely used code with well-known weaknesses. The design minimizes and separates 32-bit arithmetic so that it can be adjusted or optimized for 8 and 16-bit CPUs. Also, 16-bit software timers (common on small microcontrollers) can overflow and cause defective operation. This can be fixed with a timer system that does not overflow (e.g. the timers count down or use modular arithmetic).

Another issue is that its single packet buffer can have substantial throughput problems because a PC host usually delays the "ACK" packet, waiting for more packets. In slow, serial port implementations, the ack-throughput can be fixed by modifying uIP to send every packet as two half-packet fragments. uIP systems with fast ethernet or WiFi can modify the hardware driver to send every packet twice. [5]

Some PCs do not correctly respond to a fast uIP system on a local ethernet, because the uIP system can start a responding packet before the PC is ready to receive it.[ dubious ] The solution is to call the uIP system less frequently in the main loop (Windows PCs are designed for a response time of about 1 millisecond). Typical implementations of uIP have a fixed IP address, which can make them impractical in real networks, although some have implemented DHCP. [9] [10]

Later versions of uIP, including the reference version of uIPv6, are integrated with Contiki, an operating system that uses coroutines for cooperative multitasking. Contiki provides the multitasking needed by a simplified socket API, simplifying the use of uIP. These versions may be less popular than 0.9 however. Many examples of embedded code do not use them. [11] [12] [13]

See also

Related Research Articles

An Internet Protocol address is a numerical label such as 192.0.2.1 that is connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions: network interface identification and location addressing.

The Internet Control Message Protocol (ICMP) is a supporting protocol in the Internet protocol suite. It is used by network devices, including routers, to send error messages and operational information indicating success or failure when communicating with another IP address, for example, an error is indicated when a requested service is not available or that a host or router could not be reached. ICMP differs from transport protocols such as TCP and UDP in that it is not typically used to exchange data between systems, nor is it regularly employed by end-user network applications.

The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the set of communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suite are the Transmission Control Protocol (TCP), the User Datagram Protocol (UDP), and the Internet Protocol (IP). Early versions of this networking model were known as the Department of Defense (DoD) model because the research and development were funded by the United States Department of Defense through DARPA.

In computer networking, Point-to-Point Protocol (PPP) is a data link layer communication protocol between two routers directly without any host or any other networking in between. It can provide loop connection authentication, transmission encryption, and data compression.

The Transmission Control Protocol (TCP) is one of the main protocols of the Internet protocol suite. It originated in the initial network implementation in which it complemented the Internet Protocol (IP). Therefore, the entire suite is commonly referred to as TCP/IP. TCP provides reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications running on hosts communicating via an IP network. Major internet applications such as the World Wide Web, email, remote administration, and file transfer rely on TCP, which is part of the Transport Layer of the TCP/IP suite. SSL/TLS often runs on top of TCP.

In computer networking, the User Datagram Protocol (UDP) is one of the core communication protocols of the Internet protocol suite used to send messages to other hosts on an Internet Protocol (IP) network. Within an IP network, UDP does not require prior communication to set up communication channels or data paths.

Open Shortest Path First (OSPF) is a routing protocol for Internet Protocol (IP) networks. It uses a link state routing (LSR) algorithm and falls into the group of interior gateway protocols (IGPs), operating within a single autonomous system (AS).

The Routing Information Protocol (RIP) is one of the oldest distance-vector routing protocols which employs the hop count as a routing metric. RIP prevents routing loops by implementing a limit on the number of hops allowed in a path from source to destination. The largest number of hops allowed for RIP is 15, which limits the size of networks that RIP can support.

<span class="mw-page-title-main">Network address translation</span> Protocol facilitating connection of one IP address space to another

Network address translation (NAT) is a method of mapping an IP address space into another by modifying network address information in the IP header of packets while they are in transit across a traffic routing device. The technique was originally used to bypass the need to assign a new address to every host when a network was moved, or when the upstream Internet service provider was replaced, but could not route the network's address space. It has become a popular and essential tool in conserving global address space in the face of IPv4 address exhaustion. One Internet-routable IP address of a NAT gateway can be used for an entire private network.

The Bootstrap Protocol (BOOTP) is a computer networking protocol used in Internet Protocol networks to automatically assign an IP address to network devices from a configuration server. The BOOTP was originally defined in RFC 951 published in 1985.

<span class="mw-page-title-main">Contiki</span> Real-time operating system

Contiki is an operating system for networked, memory-constrained systems with a focus on low-power wireless Internet of Things (IoT) devices. Contiki is used for systems for street lighting, sound monitoring for smart cities, radiation monitoring and alarms. It is open-source software released under the BSD-3-Clause license.

The Virtual Router Redundancy Protocol (VRRP) is a computer networking protocol that provides for automatic assignment of available Internet Protocol (IP) routers to participating hosts. This increases the availability and reliability of routing paths via automatic default gateway selections on an IP subnetwork.

Netfilter is a framework provided by the Linux kernel that allows various networking-related operations to be implemented in the form of customized handlers. Netfilter offers various functions and operations for packet filtering, network address translation, and port translation, which provide the functionality required for directing packets through a network and prohibiting packets from reaching sensitive locations within a network.

Nagle's algorithm is a means of improving the efficiency of TCP/IP networks by reducing the number of packets that need to be sent over the network. It was defined by John Nagle while working for Ford Aerospace. It was published in 1984 as a Request for Comments (RFC) with title Congestion Control in IP/TCP Internetworks in RFC 896.

lwIP is a widely used open-source TCP/IP stack designed for embedded systems. lwIP was originally developed by Adam Dunkels at the Swedish Institute of Computer Science and is now developed and maintained by a worldwide network of developers.

A network socket is a software structure within a network node of a computer network that serves as an endpoint for sending and receiving data across the network. The structure and properties of a socket are defined by an application programming interface (API) for the networking architecture. Sockets are created only during the lifetime of a process of an application running in the node.

Adam Dunkels is a Swedish computer scientist, computer programmer, entrepreneur, and founder of Thingsquare, an Internet of things (IoT) product development business.

In computing, Microsoft's Windows Vista and Windows Server 2008 introduced in 2007/2008 a new networking stack named Next Generation TCP/IP stack, to improve on the previous stack in several ways. The stack includes native implementation of IPv6, as well as a complete overhaul of IPv4. The new TCP/IP stack uses a new method to store configuration settings that enables more dynamic control and does not require a computer restart after a change in settings. The new stack, implemented as a dual-stack model, depends on a strong host-model and features an infrastructure to enable more modular components that one can dynamically insert and remove.

Ethernut is an open source hardware and software project for use as an embedded-Ethernet-system.

NicheStack is a closed source IPv4 network layer and application implementation for operating systems, written in ANSI "C" and is one of three available from InterNiche Technologies, Inc., designed for use in embedded systems. Its transport layer implementation has historical roots in BSD and the IP layer was derived from a Carnegie Mellon University (CMU) implementation.

References

  1. "Release 1.0". 27 March 2013. Retrieved 18 March 2019.
  2. Metzinger, Zach (March 25, 2008). "APPLICATION NOTE 4205 - Using the uIP Stack to Network a MAXQ Microcontroller". Maxim Integrated Products, Inc. Retrieved February 2, 2015.
  3. "AN057 – uIP V1.0 TCP/IP Stack for eCOG1k and eCOG1X, Version 1.0" (PDF). Cyan Technology Ltd. January 28, 2008. Archived from the original (PDF) on February 18, 2012. Retrieved February 18, 2012.
  4. Curtis, Paul. "Adam Dunkel's uIP on the Olimex EasyWeb2 and LPC-E2124". Rowley Associates Limited. Retrieved February 2, 2015.
  5. 1 2 Barnett, Drew; Massa, Anthony J. (February 1, 2005). "Inside the uIP Stack". Dr Dobbs Journal. Retrieved February 2, 2015.
  6. "Cisco, Atmel and the Swedish Institute of Computer Science (SICS) Collaborate to Support a Future Where Any Device Can Be Connected to the Internet". Cisco. October 14, 2008. Retrieved February 2, 2015.
  7. Dunkels, Adam. "Tagged releases". uIP tagged releases on GitHub . Retrieved February 2, 2015.
  8. See Dunkel's original web site, above, on the wayback machine.
  9. See Code-Red sample code for the RDB4078 PCB, 2012.
  10. Dunkel provided sample code for DHCP.
  11. Metzinger, above
  12. FreeRTOS web site examples, 2013
  13. Code-Red examples, above.