Site Information

 Loading... Please wait...

TCP/IP Application Layer Protocols For Embedded Systems

This is a work in progress, and we will update this section frequently.

ARM Cortex M-7 Embedded IoT Development Kit With Two CAN Bus Ports

We at Copperhill Technologies have concrete plans to create gateways for automotive networking, which includes serial protocols such as Automotive Ethernet, CAN (Controller Area Network), and LIN (Local Interconnect Network). The following focusses on the Ethernet part of the concept, where Ethernet also applies to Internet-of-Things (IoT) and Industrial-Internet-of-Things (IIoT) applications.

The basic idea is to build a generic hardware module that receives and transmits Ethernet data and communicates with an embedded system either per UART or SPI port. The module will complement embedded solutions, for instance, for the development of a  CAN-to-Ethernet gateway. 

Let’s face it, designing embedded hardware followed by firmware development is fun, and we know our stuff. Our decision (years ago) was to go with the NXP line of microprocessors, mainly because their integrated development environment (the MCUXpresso IDE) is free-of-charge, yet as powerful as any other commercially available similar software (e.g. KEIL). Over the years, we have developed and optimized a software library for a number of serial communication technologies, with focus on Controller Area Network (CAN).

The ultimate design, however, comes with embedded TCP/IP, because we see a great potential for a CAN to Ethernet gateway, may it be for industrial applications or, especially, automotive networking. Yes, there are some offers available in the marketplace, but they all come with their individual  idiosyncrasies, may it be limited functionality or a pricing that doesn’t reflect current hardware costs and performance.

However, any development involving Ethernet (TCP/IP) for embedded systems comes with some unique challenges. There are a number of free-of-charge source code options in the market, i.e. you don't need to invest any efforts developing the protocol stack. However, any development will fail without a deep knowledge of the TCP/IP and UDP/IP protocols and understanding socket programming. 

The questions we need to answer are:

  1. What TCP/IP layers do we need for our gateway application?
    The TCP/IP protocol supports a great number of protocol features. However, modules such as FTP, Mail Server, etc. are not mandatory for a gateway application, and they may increase the memory footprint.

  2. Do we need an operating system?
    Embedded Linux comes to mind or FreeRTOS. They both come with an integrated TCP/IP protocol, which would eliminate the need for implementation. However, some Linux systems come with a boot-up time that is unacceptable for our gateway application. And while there are many off-the-shelf LINUX options, FreeRTOS will require implementation into existing hardware.

In the following, I will refer to posts I wrote about Industrial Ethernet, which is based on TCP/IP. They represent the very basics of Ethernet with the intention of providing a quick and easy-to-read overview. For more detailed information on TCP/IP for embedded solutions, please refer to the literature references below.

Ethernet and TCP/IP Basics

Many of the characteristics that describe Ethernet and TCP/IP are common to most network technologies, specifically industrial networking (with or without Ethernet). Understanding how Ethernet addresses the issues at hand provides a foundation that will improve the understanding of networking in general and, most prominently, that of embedded Ethernet technologies.

Ethernet is a family of computer networking technologies for local area networks (LAN) that was commercially introduced in 1980. Standardized in IEEE 802.3, Ethernet has largely replaced other competing wired LAN technologies, and nowadays it represents not only the backbone of the Internet but also advanced industrial control.

Systems communicating over Ethernet partition a stream of data into individual packets called frames. Each frame contains source and destination addresses and error-checking data to ensure the detection of damaged data and initiate re-transmission when necessary.

In layman’s terms, Ethernet covers the physical medium (e.g., cables, RJ45 ports, LAN cards, routers, switches, hubs, etc.) plus some basic, low-level protocol features like, for instance, message collision detection, but while Ethernet represents an excellent transmission medium for data, it falls short of offering a complete protocol solution.

The TCP/IP model (Transmission Control Protocol/Internet Protocol) is a descriptive framework for the Internet Protocol Suite of computer network protocols created in the 1970s by DARPA, an agency of the United States Department of Defense. It defines a set of general design guidelines and implementations of specific networking protocols to enable computers to communicate over a network. TCP/IP provides end-to-end connectivity, specifying how data should be formatted, addressed, transmitted, routed, and received at the destination.

  • A Brief History of Ethernet and TCP/IP...
    The Ethernet technology came to life in 1972 at the Xerox Corporation’s Palo Alto Research Center, more commonly known as PARC, when researcher Bob Metcalfe designed and tested the first Ethernet network.

  • The OSI Reference Model...
    The OSI Reference Model is at the heart of serial networking technologies, including Industrial Ethernet. The understanding of the model is mandatory, when it comes to understanding Ethernet TCP/IP, the underlying technology of Industrial Ethernet.

  • Standard Ethernet TCP/IP...
    As the term Ethernet TCP/IP (Transmission Control Protocol / Internet Protocol) indicates, Ethernet TCP/IP is not a single protocol. It comprises of a full suite of protocols based on the two original protocols TCP and IP. In other words, Ethernet TCP/IP is a layered protocol, where each layer builds upon its lower layer, adding new functionality.

  • TCP/IP Protocol Positions Within OSI Reference Model...
    The TCP/IP layer model follows the OSI 7-Layer Reference Model to a certain degree as demonstrated in the image documenting the Ethernet TCP/IP protocol layers. The similarities to the OSI model are apparent.

  • Ethernet, CSMA/CD, TCP/IP, and UDP...
    This chapter explains, in brief, the functionality of Ethernet, CSMA/CD (Carrier-sense multiple access with collision detection), TCP/IP (Transmission Control Protocol / Internet Protocol), and UDP (User Datagram Protocol).

  • Client/Server Vs. Master/Slave...
    The distinct differences between a Client/Server and a Master/Slave network model have a significant impact on the design of Ethernet applications, not only in terms of device/process interaction but also the data traffic pattern.

  • Limitations of Ethernet...
    There are, in fact, only few limitations to Ethernet as a standard networking technology, and those that exist can be rectified easily.

Literature on TCP/IP

More Posts on the Subject

More Resources

Embedded Linux