[4 pages — 3521 words]

INTRODUCTION

The push to incorporate Industrial Ethernet or even "plain vanilla" Ethernet into control networks implies that by making that choice completes the selection process. As mentioned in a previous lesson, Ethernet II and IEEE 802.3 are strictly data link layer technologies which do not guarantee the delivery of messages over a network or between networks. Protocol stacks such as TCP/IP or SPX/IPX provide that functionality and without them Ethernet would be useless. With the immense interest in the Internet and the potential of attaching control networks to the Internet, the protocol stack of choice is TCP/IP because it provides the foundation for the Internet. This lesson addresses issues related to the IP portion of the TCP/IP stack as it applies to control networks.


THE TCP/IP STACK

Actually TCP/IP is a set of protocols defined by a series of RFCs (request for comments) that have evolved over the years. In general the Internet Protocol (IP) is used to route messages between networks and, therefore, properly resides at the network layer of the OSI Reference Model. Transmission Control Protocol (TCP) sits on top of IP and is used to guarantee the delivery of messages. Above TCP is the application layer. The services of the presentation and session layers of the OSI Reference Model are incorporated into the application layer. Therefore, the reference model for TCP/IP-based systems actually consists of only five layers. Technologies such as Ethernet II and IEEE 802.3 reside at the lower data link and physical layers of the same model.



Figure 1 — The TCP/IP stack is actually a set of protocols.
IP resides at the network layer of the OSI Reference Model shown on the left.

DATA ENCAPSULATION

The data sent over wires is represented as frames. An Ethernet II frame consists of a preamble, source and destination addresses, type field, data field and a frame sequence check field. You can lump these fields into Ethernet header, data and trailer fields The IP data sits above the data link layer and its data, called a datagram, is inserted into the data field of the Ethernet frame. The datagram has it own header and data fields but no trailer field. Above the IP layer is the transport layer where TCP and User Datagram Protocol (UDP) reside. Data from this layer is likewise applied to the data portion of the IP datagram. TCP applies segments while UDP applies datagrams. Both TCP and UDP have headers as well. Finally above the transport layer is the application layer which needs to insert its own data into the data portion of the transport layer as well as its own header. This application data is simply referred to as data since there is no defined structure in terms of the TCP/IP stack. That is why if two application data structures are different, communication between these applications will not be effective even with strict adherence to TCP/IP standards

This wrapping of data within the data field of the next immediate lower layer of the protocol stack is called encapsulation while the unwrapping of the same data at the receiving side is called demultiplexing. In order to reduce confusion on what is the actual data we will say that frames are sent over the data link layer. The IP sends out datagrams to the data link layer in the form of packets. A packet can be a datagram or a fragment of a datagram. The TCP sends segments while the UDP sends datagrams. Finally, the application sends data. To further add to the confusion, the terms packet and frame are sometimes used interchangeably.



Figure 2 — The wrapping of data into the data field of the next immediate lower layer is called encapsulation.

(No part of this article may be reproduced without the written consent of the Industrial Ethernet University.)