Global Sources
EE Times-India
Stay in touch with EE Times India
EE Times-India > Embedded

Address issues in embedding TCP/IP (Part 2)

Posted: 10 Apr 2013     Print Version  Bookmark and Share

Keywords:TCP/IP  Ethernet  protocol  zero-copy architecture 

It is very important to understand that TCP/IP stack vendors may not use all of the Ethernet Controller capabilities, and will often implement a Memory Copy mechanism between the Ethernet Controller and the system's Main Memory. Memory Copy operations are substantially slower than DMA operations, and therefore have a major negative impact on performance.

Another important issue, especially for an embedded system design, is how the NIC driver (i.e., software) interfaces to the NIC controller. Certain TCP/IP stacks accomplish the task via polling (checking the NIC controller in a loop to see what needs to be done). This is not the best technique for an embedded system since every CPU cycle counts. The best interface mechanism is to use interrupts and have the NIC controller raise an interrupt when CPU attention is required.

Zero copy
TCP/IP stack vendors may qualify their stack as a zero-copy stack. A true zero-copy architecture refers to data in the memory buffers at every layer instead of moving the data between layers. Zero copy enables the network interface card to transfer data directly to or from TCP/IP stack network buffers. The availability of zero copy greatly increases application performance. It is easy to see that using a CPU that is capable of complex operations just to make copies of data is a waste of resources and time.

Techniques for implementing zero-copy capabilities include the use of DMA-based copying and memory mapping through a Memory Management Unit (MMU). These features require specific hardware support, not always present in microprocessors or microcontrollers used in embedded systems, and they often involve memory alignment requirements.

Use care when selecting a Commercial Off-the-Shelf (COTS) TCP/IP stack. Vendors may use the zero-copy qualifier for stacks that do not copy data between layers within the stack, but perform memcopy() between the stack and the Ethernet controller. Optimum performance can only be achieved if zero copy is used down to the Data Link Layer. Micriµm'sµC/TCP- IP is an example of a zero copy stack from the Data Link layer to the Transport layer. The interface between the Transport layer and the Application layer inµC/TCP-IP is currently not a zero copy interface.

Check sum
Another element which combines the CPU and data moves and which is frequently used in the stack is the checksum mechanism. Providing checksum assembly routines, replacing the C equivalent functions is another optimisation strategy that is effective.

As we are discovering, the IP protocol family is composed of several protocols. However, when developing an embedded system, ask yourself if you need them all. The answer is, probably not.

Another important question is: Is it possible to remove certain unused protocols from the stack? If the TCP/IP stack is well written, it should be possible to exclude protocols that are not required. Because an embedded system is often used in a private network, the embedded developer may decide not to implement protocols that are required on the public Internet. At this point, understanding each protocol's capabilities, as you will see in subsequent chapters, will help in deciding if that protocol is required for the application.

For any of the protocols listed below, if the feature is not required by the system, we may want to remove it from the target's build (assuming that this is allowed by the TCP/IP stack architecture). The figures provided are only an estimate based onµC/TCP-IP. Other TCP/IP stacks may have different footprints depending on how closely they follow RFCs and how many of the specification's features are actually included in each module.

Table 1: Protocols that can be 'compiled out' ofµC/TCP-IP.

Table 1 shows the candidate protocols that can be removed from a TCP/IP stack if allowed by the stack software architecture.

 First Page Previous Page 1 • 2 • 3 Next Page Last Page

Comment on "Address issues in embedding TCP/IP (..."
*  You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.


Go to top             Connect on Facebook      Follow us on Twitter      Follow us on Orkut

Back to Top