14

I am not particularly internet savvy, and IoT technologies are especially confusing for me. I was reading this Stanford white paper on internet structure. In Diagram 2, it shows a representation of the software "stack" that a computer (PC) would use to create, process, and send a message, across the internet, to another computer.

  • Do all kinds of computers - smartphones/tv's/gameconsoles, etc use this format?

  • Does the OS matter?

  • (In this regard) is there any difference between cellular internet and Wifi/Ethernet?

  • What about single-function devices that don't appear to have an "Application" layer - e.g. web connected camera, light switches, or thermostats.

  • Related iot.stackexchange.com/questions/1119 – Sean Houlihane Apr 19 '17 at 11:19
  • 3
    It's much better to only ask a single question per question - however that is kind of hard for these very basic questions. If you have an follow-up questions, be sure to try and make them more specific. – Sean Houlihane Apr 19 '17 at 11:20
  • All devices have an application layer. The application layer for a web connected lightswitch is the software that turns the light on and off when it receives a command. – immibis Apr 19 '17 at 22:01
  • @immibis this is going to sound horribly pedantic, but protocol stack layers are not properties that a device can possess. In TCP/IP, the application layer contains the communications protocols and interface methods used in process-to-process communications across an IP computer network. A device may host a system and that system may be executing applications, but a device does not have an application layer. TCP/IP itself is a conceptual model. – julian Apr 19 '17 at 23:24
  • @SYS_V When I say "the device has an application layer" I mean "the device has some software component that implements what TCP/IP describes as the application layer" – immibis Apr 19 '17 at 23:41
26

There are some potential misconceptions or misunderstandings in the question that will be addressed in this post.

  • In Diagram 2, it shows a representation of the software "stack" that a computer (PC) would use to create, process, and send a message, across the internet, to another computer

  • Do all kinds of computers - smartphones/tv's/gameconsoles, etc use this format?

  • (In this regard) is there any difference between cellular internet and Wifi/Ethernet?

  • What about single-function devices that don't appear to have an "Application" layer - e.g. web connected camera, lightswitches, or thermostats.

The presence of these misconceptions necessitates the inclusion of an explanation of the following (in order to provide context for subsequent discussion):

  • What the Internet is
  • What the TCP/IP protocol suite is
  • What an application is

Then the questions will be addressed directly.

Note that given their importance and complexity, entire series of books have been written on the TCP/IP protocol suite. The definitions and explanations here will be drawn primarily from Wikipedia, TCP/IP Illustrated Volume 1 Second edition: The Protocols by Stevens and Fall, and IBM's TCP/IP Tutorial and Technical Overview.

1. The Internet

The Internet is technically a Wide Area Network (WAN), but a more helpful way to think of it is as a kind of supernetwork (a network of networks) or an aggregate of many different interconnected networks. Here is a picture of routing paths through a portion of the Internet:

Route path visualization

  • The Internet consists of many connected networks
  • A network may consist of 1 or more systems (host)
  • A connected system typically runs on some kind of hardware platform
  • there is significant variance in the types of systems connected to networks and the hardware that they run on

A fun read on how the Internet works can be found in the Arstechnica article How the Internet works: Submarine fiber, brains in jars, and coaxial cables.

So how are different systems running on different hardware platforms connected to different networks able to communicate with each other? How is communication between such a vast, heterogeneous array of systems and networks possible? How can all of this take place simultaneously?

2. The Internet Protocol Suite

The answer is provided by the Internet protocol suite, a.k.a the TCP/IP protocol suite. These questions were considered during the design process of the architecture of the Internet (TCP/IP Illustrated, Section 1.1: Architectural Principles):

Several goals guided the creation of the Internet architecture. In [C88], Clark recounts that the primary goal was to “develop an effective technique for multiplexed utilization of existing interconnected networks.” The essence of this statement is that the Internet architecture should be able to interconnect multiple distinct networks and that multiple activities should be able to run simultaneously on the resulting interconnected network.

From Internet Protocol Suite (Wikipedia):

The Internet protocol suite is the conceptual model and set of communications protocols used on the Internet and similar computer networks.

The Internet protocol suite provides end-to-end data communication specifying how data should be packetized, addressed, transmitted, routed and received. This functionality is organized into four abstraction layers which are used to sort all related protocols according to the scope of networking involved.

One way to think of the TCP/IP protocol suite is as a specification for how processes running on different systems and different networks can communicate with each other. In essence, the TCP/IP protocol suite provides a standard for inter-process communication.

Any system that correctly implements the TCP/IP protocol suite may use the functionality it provides to allow its processes to communicate over the Internet. In fact, in order for processes to communicate over the Internet with other processes running on remote systems on other networks, a system must utilize standards-compliant TCP/IP suite protocols.

TCP/IP protocol suite

3. Applications

From Application Software (Wikipedia):

An application program (app or application for short) is a computer program designed to perform a group of coordinated functions, tasks, or activities for the benefit of the user. Examples of an application include a word processor, a spreadsheet, an accounting application, a web browser, a media player, an aeronautical flight simulator, a console game or a photo editor. The collective noun application software refers to all applications collectively. This contrasts with system software, which is mainly involved with running the computer.

Application software

An application can be thought of as a user-space process running on a system. In addition to the examples listed above, this can include programs such as (non-kernel mode) computer viruses, web servers, camera applications, and sensor data aggregation programs.

When an application transmits and receives data over the Internet, it must utilize its host system's TCP/IP protocol suite implementation. From Application layer (Wikipedia):

In TCP/IP, the application layer contains the communications protocols and interface methods used in process-to-process communications across an Internet Protocol (IP) computer network. The application layer only standardizes communication and depends upon the underlying transport layer protocols to establish host-to-host data transfer channels and manage the data exchange in a client-server or peer-to-peer networking model.

The application layer of the TCP/IP protocol suite includes protocols such as File Transfer Protocol (FTP), Domain Name System (DNS) and probably most famously, Hypertext Transfer Protocol (HTTP).

As an example, the application layer protocol HTTP specifies how data is transmitted between 2 processes running on (usually) different systems: the client application, a web browser, and the server application, the web server process.

Clarification of Potential Misconceptions

  1. In Diagram 2, it shows a representation of the software "stack" that a computer (PC) would use to create, process, and send a message, across the internet, to another computer.

The TCP/IP protocol suite is not a software stack. From Technopedia:

A software stack is a group of programs that work in tandem to produce a result or achieve a common goal. Software stack also refers to any set of applications that works in a specific and defined order toward a common goal, or any group of utilities or routine applications that work as a set. Installable files, software definitions of products and patches can be included in a software stack. One of popular Linux-based software stack is LAMP (Linux, Apache, MYSQL, Perl or PHP or Python) .WINS (Windows Server, Internet Explorer, .NET, SQL Server) is a popular Windows-based software stack.

Rather, it is a protocol stack, usually implemented by the kernel (also from Technopedia):

A protocol stack refers to a group of protocols that are runnning concurrently that are employed for the implementation of network protocol suite.

The protocols in a stack determine the interconnectivity rules for a layered network model such as in the OSI or TCP/IP models. To become a stack the protocols must be interoperable being able to connect both vertically between the layers of the network and horizontally between the end-points of each transmission segment.


  1. Do all kinds of computers - smartphones/tv's/gameconsoles, etc use this format?

The TCP/IP protocol suite is a hardware- and operating system- independent communications specification, not a format. If a process running on one hardware platform needs to communicate with a process running on a remote system on a different hardware platform and communication takes place over the Internet, then the systems must

  • correctly implement the TCP/IP protocol suite and
  • the appropriate protocols within this suite must be used to accomplish inter-process communication

  1. (In this regard) is there any difference between cellular internet and Wifi/Ethernet?

My interpretation of this question is "Is there a difference in the way a mobile device connects to a GSM network and the way a mobile device connects to a WiFi network?"

The difference is at the network interface layer.

This question exposes the poor depiction of the TCP/IP protocol suite in the diagram in the article linked to in the question. For reference, here is the diagram:

Shitty TCP/IP diagram

The lowest layer, referred to as "hardware", should be referred to as the link layer, media access control (MAC) layer or the network interface layer.

From IBM's "TCP/IP Tutorial and Technical Overview" page 34:

The network interface layer, also called the link layer or the data-link layer, is the interface to the actual network hardware. This interface may or may not provide reliable delivery, and may be packet or stream oriented. In fact, TCP/IP does not specify any protocol here, but can use almost any network interface available, which illustrates the flexibility of the IP layer. Examples are IEEE 802.2, X.25 (which is reliable in itself), ATM, FDDI, and even SNA.

Here is a correct and superior depiction (from The TCP/IP Guide):

Superior diagram of TCP/IP stack

The reason that discussion of the network interface layer is relevant is that it is at this layer that there is a difference in the way a cellular/mobile device connects to a GSM network vs. a WiFi network.

  • when connecting to a GSM network, the network interface layer protocol employed to handle the connection between the mobile device and the base transceiver station (BTS) is typically specified by 3G

  • when connecting to a WiFi wireless access point (WAP), the protocol used is specified by the IEEE 802.11 standard.


  1. What about single-function devices that don't appear to have an "Application" layer - e.g. web connected camera, light switches, or thermostats

As described earlier, protocols in the application layer of the TCP/IP protocol suite provide a standard for how application data is exchanged between processes.

The layers are conceptual. They do not reside in a system or on a hardware platform.

Web connected cameras, light switches and thermostats may have processes running on them that communicate over the Internet with processes running on remote systems (checking for firmware updates, data exchange with a server, etc.). These processes, or applications, will utilize the implementation of the TCP/IP protocol suite to accomplish this inter-process communication.

The TCP/IP protocol suite and Embedded Systems ("IoT")

While there are a variety of different applications utilizing different application-layer protocols running on traditional PCs or servers, there is not that much variance in terms of how the hardware platforms connect to their respective access points (network interface/data link layer). It is primarily accomplished wired or wirelessly via Ethernet.

The situation somewhat different when it comes to the wide variety of embedded systems that communicate via TCP/IP. Here is an illustration of this (from Postscapes):

IoT and TCP/IP 1

IoT and TCP/IP 2

For more info, see these articles:

Understanding The Protocols Behind The Internet Of Things

IoT Standards and Protocols

IoT Technology Guidebook

  • At this level of details my netadmin side is sad that there is not a word about TCP/IP meaning TCP on IP, TCP is not bound to IP at all, it has been implemented on IPX networks also (an de even if the sigle is near, they were 2 very different protocols) – Tensibai Apr 19 '17 at 19:20
  • 1
    @Tensibai Wouldn't TCP on IPX be mostly the same as SPX (i.e., the reliable and port-based transport version)? -- But that reminds me that the the claim that two host that want to communicate over the internet (i.e., across different networks) must implement TCP/IP is not strictly true: Host A on net 1 and host B on net 3 might speak e.g. IPX/SPX evenif the connecting net 2 is pure TCP/IP, provided there are tunnel gateways in net 1 and 3 ... – Hagen von Eitzen Apr 19 '17 at 19:55
  • 2
    @hagen nope, SPX was the equivalent of TCP, but absolutely not interconnectable with a TCP system, hence why TCP over IPX has been developed, to allow end to end TCP communications for systems on IP and IPX with a simple layer 3 router in between. And yes internet rely on IP, MPLS and routing protocols mainly (I probably forget some), TCP plays nothing in the overall routing, it just circulate over it ateotd. – Tensibai Apr 19 '17 at 20:03
  • @Tensibai If I have made an error or errors, please let me know and I will do my best to correct them – julian Apr 19 '17 at 21:18
  • @SYS_V not really an error, some shortcuts bother me a little. let's say it's ok in a TCP communication point of view :) There is all necessary information for someone willing to dig the problem. I feel you're a little rude for the OP in your first paragraph, I'll try to propose an edit tomorrow (from a computer) to address my concerns :) – Tensibai Apr 19 '17 at 21:26
12

Do all kinds of computers - smartphones/tv's/gameconsoles, etc use this format?

For something to exchange on the internet, it will have to go through an IP stack somewhere.

Does the OS matter?

The IP protocol is defined by a the RFC 791, so the OS/Firmware has to comply to it, whatever it is.

(In this regard) is there any difference between cellular internet and Wifi/Ethernet?

Simplifying a bit, the difference here will be at the layer 1 (Physical) radio signal vs electrical signal on wires. More details on the Open Systems Interconnection model (OSI model) wikipedia page.

They all serve to transpose the layer 3 (Network), IP in the case here, on their specific mediums.

What about single-function devices that don't appear to have an "Application" layer - e.g. web connected camera, lightswitches, or thermostats.

The Application Layer relate to a specific communication protocol (HTTP, SSH, etc.), it doesn't have to be an application as Chrome or Firefox for example.
Usually those protocols will be implemented on top of TCP, some are on top of UDP when there's a wish to not block waiting the acknowledgement or when getting an outdated packet makes no sense (voice calls, streaming). There's others layer 4 protocols but usually for specific usages, like ICMP for ping. TCP is the protocol of choice when you wish to ensure some data is arrived to destination.

For a 'remote device', like the thermostat in your example, it may use already existing protocols like HTTP or use a proprietary one to send its data, that will still be at the Application layer usually as it won't be only a transport protocol.
It may be done at layer 4 only, but that needs creating a new protocol and the overhead usually doesn't worth it and makes the system incompatible with others, using open standards is a better approach in my humble opinion.

  • 3
    Maybe worth clarifying that TCP-IP is a fairly common 'must have' in any OS (from mbed/arduino up to MC Windows and Linux). – Sean Houlihane Apr 19 '17 at 11:24
  • Indeed, sounds so implied to me for higher level protocols that I forget it. – Tensibai Apr 19 '17 at 12:06
  • answer 1 and answer 2 are non-answers and answer 3 is explained using the OSI Reference Model rather than the TCP/IP protocol suite. None of the answers in this post address the conceptual errors being made in the question. – julian Apr 19 '17 at 17:31
  • 2
    @Sys_v I wasn't up to write a Novell :) – Tensibai Apr 19 '17 at 19:06
5

Although it is true that any internet connected device will use TCP/IP (or UDP) for communication, it's really the next level up in the stack where things get interesting.

Any modern IoT device will be using TLS to provide encryption and authentication. This prevents (in theory) anyone else from either observing or interfering with the messages which are being passed. An important consideration of the TCP/IP stack is that much of the information which is transmitted can be observed trivially - and this often leads very easily to security flaws.

Devices don't need to connect to the internet 'at source', so it's not necessary to implement TCP over bluetooth (as an example). You might also see IoT devices using mobile phone protocols (like regular SMS or texts) as their final hop. Eventually these protocols (selected in some way for the installed environment) are likely to be bridged to 'the internet' by a hub device.

  • Regarding the premise of the second paragraph, I am afraid that we may encounter even devices designed later than today and still ignoring crypto – Hagen von Eitzen Apr 19 '17 at 20:04
  • 1
    Modern meaning designed using today's best practice, not just whatever is easy. – Sean Houlihane Apr 19 '17 at 22:42
4

All devices which want to use TCP over IP need a TCP/IP stack.

The protocol is standardized, so that devices from different manufacturers, or using different operating systems, can understand each other.

Note that TCP ensures that data packets arrive, or the sender will be notified of their loss. TCP would be used when you can't afford to lose any data without being aware of it (e.g. communication with your bank).

There is also UDP, which sends packets and "hopes that they get there". This can be used, for instance, for streaming music or video, where the loss of a few frames is not fatal.

The important part is the standardization.

2

The stack itself is a virtual concept. Each layer in the stack modifies the final bits that are sent across the physical medium (radio waves or other electronic signals). There is no rule that says each layer in the stack must be engineered in a single discrete unit of code or hardware. For example, iEthernet Chips combine TCP, IP, MAC, and PHY layers, leaving developers with the task of implementing TLS and Application layer software.

That said, all of the bits must comply with the various protocols involved, and for this reason, it's usually easier to design each layer as a separate entity, so they can be independently tested and verified. Most devices, including smart phones, smart TVs, and game consoles typically buy their chips from third parties that have specialized in some area. For example, most phones use just one of a few different bluetooth chips; this means that the manufacturer doesn't have to worry about reinventing the wheel with each new product.

In theory, some small, specialized devices might have just a single processor with embedded SoC (Software on Chip) that handles all of the layers of networking (application, TLS, TCP, IP, PHY) as a single discrete unit of code. I can't find any concrete examples right now, but it would not surprise me if some small, low-power or dedicated function devices combined all of the layers of the stack into a single unit to reduce power consumption (extend battery life). Larger, more complicated products, like televisions, phones, and game systems probably have at least 3 layers (application, operating system, and hardware pieces), while a toaster might just have 1 or 2 layers.


Note: I'm not saying that the particular toaster I linked has 1 or 2 layers, just that it would be logical if it were designed that way, being a single-purpose device.

  • How would the Toaster be able to not have all layers? You can plug a network cable in it or it reacts to WiFi waves - hence it implements the PHY layer. In can communicate with local and remote devices (such as your iPhone) - hence it implements the IP layer. It requires secure transmission of data (the image) - hence it better implement TCP. Some part must make sense of the transmitted data, so we certainly have an application layer on top. --- (Well, possibly not if instead of networking they use bluetooth ...) – Hagen von Eitzen Apr 19 '17 at 20:11
  • @HagenvonEitzen The protocols dictate the layers that are place, but my point is that one "layer" in the TCP/IP "stack" might not be a single discrete "layer" in a software/hardware "stack." I gave an example of a chipset that implements four layers all by itself. In terms of hardware/software, this is just one "layer" in the "stack" that implements connectivity. Using that chip plus an application that implements its own TLS results in a two layer stack; the physical components do not align with the four logical layers described in the OP. – phyrfox Apr 19 '17 at 21:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.