Abstract communications image

Ethernet is a computer networking protocol designed to connect multiple computers, appliances or other electronic devices or products in a local area network (LAN). Typical applications include office PCs, industrial controllers / monitors, remote sensors and home automation controllers. Ethernet supports very fast data transfer rates (up to 100 Gbit/s) over relatively long distances. The Ethernet protocol is much more robust than simple short-distance protocols such as SPI, and incorporates source and destination addresses, automatic error-checking and retransmission of corrupted frames (short streams of data). It uses point-to-point links which can be connected together by Ethernet switches which intelligently forward the messages to their appropriate destinations. Each device on the network requires its own unique 48-bit MAC (Media Access Control) address which is a used to identify the source / destination of each message. The MAC address is typically hardcoded (built-in) by the manufacturer of the Ethernet hardware. MAC addresses are also used for other network technologies such as WiFi.

Ethernet is an excellent reliable method of connecting embedded systems to computer networks for remote sensing / monitoring, remote control or transferring large amounts of data. Typical data transfer rates for embedded systems are 10 or 100 Mbit/s. For some embedded systems it may be appropriate to design in a high-end microcontroller which directly incorporates an Ethernet MAC peripheral (although these still require an external physical interface (PHY) device); for other electronic products it may be more appropriate to design in a simpler and cheaper microcontroller which interfaces to a dedicated Ethernet Controller chip.

A Media-Independent Interface (MII) is used to connect MACs to a PHY device. This media-independent connection means that the physical hardware (e.g. fibre optic, twisted pair etc) can be interchanged without the need to alter anything in the MAC hardware.

TCP/IP (Transmission Control Protocol / Internet Protocol) is actually a suite (or stack) of protocols used to specify how data should be addressed, packetized, sent / received (and retransmitted) for internet transfers between clients and servers. Multiple layers of encapsulation are used as a method of abstraction so the end-user application software is shielded from the details and complexities of the data bits being transferred at the hardware level (e.g. via Ethernet or WiFi), and the lower levels of hardware are likewise not required to know anything about every different top-level application software. The top layer of encapsulation – the Application layer – is where all the high level protocols such as FTP, SSH, SMTP and HTTP sit so that different applications (processes) can pass messages to each other; port numbers are used to address different processes. Beneath this is the Transport layer, used to send data from one host to another on a local network (or different networks separated by routers) by the simple but fast User Datagram Protocol (UDP) or by TCP. UDP is suitable for quickly sending messages which do not require error checking, correction or retries, and hence can benefit from a reduced overhead. It can be useful for streaming real-time signals in which it is more acceptable to lose occasional pieces of data than to create a lag or bottleneck by spotting that data has gone missing and attempting to resend it. If, however, data integrity and guaranteed delivery is more important than speed then it is more appropriate to use TCP. The next layer down is the Internet Layer, which uses the Internet Protocol (IP) to exchange data across network boundaries, transferring data to a network closer to its final destination, using IP addresses to uniquely identify each device on the network. The bottom layer is the Link Layer which is used to send messages between different hosts on the same local network.

Various open source TCP/IP stacks are available which have been designed specifically for embedded systems and require minimal code space and RAM.