TCP/IP The great unknow (I)

TCP/IP The great unknow (I)

Última edición 06 Aug 2018 Elephant

This series of technical articles about Internet of Things "IoT" protocols is started and it is an obligation to start with the most known and most and used on the Internet, TCP/IP. In addition to being part of many aspects of everyday life, it is a great unknown to the vast majority of users, since they normally use it without having knowledge of what is really happening when a message is sent over the network.

Embedded systems

As these articles are related to the IoT world, some concepts have to be introduced before going into the detail of the TCP/IP protocol.

When talking about embedded systems, it refers to small computers that do not necessarily have a keyboard, mouse and monitor. Are those computers contained in washing machines, televisions, refrigerators or cars to give some examples.

Small computers are inside these devices and can only work with a chip, usually a microcontroller. They have all the necessary I/O and have been designed to perform specific tasks, sometimes with quite complex conditions such as radioelectric emissions, high or low temperatures or vibrations among others.

Today, for almost any device in the IoT world a remote control is required. One of the most common implementations is a web server that is controlled from the web browser of the user's device, which performs the client part of the connection. The microcontrollers usually serve files stored in a ROM with quite a limitation in terms of size, 32 or 64 Kb. The ROM is a read-only memory so the difficulty to send dynamic content to the client is increased, creating the largest of the problems in these micro systems. In later articles we will see how we can solve this problem.



If you acquire hardware, you can find many TCP/IP implementations, but they will always have more funcionalities than if you build the hardware yourself. Building the hardware has the disadvantage of the development time, the possibility of introducing any errors and performing software maintenance, but it also has the great advantage of adjusting to the reduced space of the software by having only what is needed.

You can develop the software completely and put it in your own MCU or use a PHy, raising the cost of the hardware, but saving program memory space, vital in these reduced systems.



For the network we have the same previous case, you can build specific hardware to communicate and transport data to other devices through the cables or radio waves or use commercial hardware with a driver or developing your own.



In the case of the SBCs, as the capacity and resources are very high, you can count on an Operating System with an infinity of drivers and high-level programming languages ​​with software resources ready for use, or alternatively, opt for an MCU with or without Operating System. Without S.O. It is suitable for very small, static or running a looping program. With S.O you can use an alternative called RTOS (Real-time Operating System) which is a small operating system capable of running programs or processes in parallel optimizing resources very well.



Actually, there are several different protocols, although two of them can be highlighted.

  • TCP (Transmission Control Protocol), responsible for the transport of data.
  • IP (Internet Protocol), which assigns addresses and routes to networks.

The name TCP/IP comes from the importance of these two protocols within the set and it can be said that it is one of the most important protocols of what is now known as the Internet since they were created helping each other.



The TCP/IP protocol was developed thanks to the research carried out in DARPA (Defense Advanced Research Projects Agency) in the year 1960 and later in the year 1974 Vint Cerf, creator of the ARPANET network and Robert Kahn began to work together in the open protocol and published the first specification, having 4 versions and the latter one (TCP/IP v4) is still used today. In 1982, the US Department of Defense announced the use of TCP/IP as standard in all its communications and later the large hardware and software manufacturers implemented it in all its systems.



It consists of 4 basic pillars that are summarized below:

  • IP address system. As mentioned, TCP/IP includes a system to identify connected devices in both large and small networks. Assign a unique identifier to each device connected to the network to allow differentiation, making sure that all devices are identified and can communicate with each other. The size of an IPv4 identifier, henceforth an IP address, is 4 bytes (32 bits), which limits the use to more than four billion devices connected at the same time (0xFF 0xFF 0xFF 0xFF = 4,294,967,295). The specification that has been maintained until now is RFC 791 of the year 1981 and made obsolete the standard DOD of the year 1980. Without the help of the upper layers of TCP/IP, the IP protocol would not be reliable, as it has no data correction, does not provide warranty on delivery and does not take into account the order or duplicity of the packets.

  • Routing. The TCP/IP protocol has been designed to facilitate the passage of information and correct routing to the destination in complex networks. TCP/IP has been created with the concept of network interconnection in its base, although it is also given the utility of connecting devices. The routers are responsible for the two tasks: on the one hand deliver packets to their own internal network and on the other, if the destination of the packet is not in that internal network, it delivers it to another network, always jumping one by one.

  • Layer separation. TCP/IP works from layer 3 onwards of the OSI model therefore it can operate in all kinds of wired, wireless, local (LAN) or extended (WAN) networks. Also making possible the combined use of them, which makes it a very flexible protocol.

  • Scalability. It is its main characteristic and the reason why it continues to work today, more than 30 years after its creation. At the beginning there were only a few devices connected in a network and today there are millions, sharing data all over the world.

  • Open. TCP/IP is not owned by any company, it is a public standard and can be used freely. A main characteristic of the enormous success that it has had is that it was published in the RFC (Consensus-Based Standardization Using Requests for Comments), a standard that allows the development and improvement thanks to the consensus of all the parties involved. Being understood by parties, any person or organization that wishes to participate, can make a proposal or give their opinion and will be taken into account.

Previous PostNext Post