By Adam Taylor
Over the last two instalments of this blog we have looked at the Ethernet MACs (Media Access Controllers) within the Zynq SoC’s PS (processor system), including an in-depth exploration of a MAC usage example. The Ethernet MAC is a fundamental building block that allows us to implement an IP stack and thus create network-enabled solutions for our engineering challenges.
The IP stack, sometimes called the TCP/IP stack as the two are historically linked, is a series of protocols that are stacked on top of each other within an Ethernet frame. These protocols allow applications to communicate over a network. The IP stack therefore consists of a number of different protocols organized per the OSI protocol model. Should we deconstruct an IP stack, we would find the following protocols:
As with many concepts, the ISO stack best illustrated visually, as shown in the diagram below:
We have already discussed the Data link layer in detail. However we have not yet addressed TCP or IP in any great detail, so I will attempt to provide a simple introduction.
Starting at the highest level, the TCP protocol provides a reliable, error-protected link to the application layer. TCP acknowledges each received frame to ensure reliable reception. The protocol also uses sequence numbering to ensure that the data transmitted by the application layer is passed to the receiving application in the correct format. Data correction in the protocol ensures there are no errors.
The concept of ports is used to determine which application the data is meant for. This scheme allows multiple applications to transmit data over the connection and using the same protocol without confusion. However, TCP does not provide the network routing; it does not make sure the data gets to the right port on the right network node. Getting data to the right place is the domain of the network layer which implements the Internet Protocol, IP.
The IP address format is well known. For example, 192.168.0.1 is an IP address. IP currently comes in two versions: IPv4 and IPv6. IPv6 addressing is the latest adaptation, necessary because IPv4 ran out of addresses, proving the success of TCP/IP beyond doubt.
Detailed explanation of the IP stack and TCP /IP would take nearly as many blogs as I have already written for this series. (We’re on Part 79, in case you didn’t notice.) The IP stack is a very complex subject. However, I think it’s important to introduce the basics of the stack before we begin to use it in subsequent blog posts.
More detail on the IP stack can be found at http://www.tcpipguide.com/free/.
Due to the inherent complexity within a TCP/IP stack, there are a number of pre-built stack libraries available. The IP stack we will be using over the next few blog posts is the lightweight IP stack (lwIP), the libraries for which can be included and configured when we build the BSP.
Now, you can have convenient, low-cost Kindle access to the first year of Adam Taylor’s MicroZed Chronicles for a mere $7.50. Click here.
Please see the previous entries in this MicroZed Chronicles series by Adam Taylor: