Different Modelizations of Computer Networks
Tags: computerscience, webdev, tutorial, programming
Published: 2022-12-29 14:14:13

In the previous article, we walked through some basics of computer networking. In this article, we'll walk through two widely used representations of computer networking. We'll not go into the implementation or semantic details for each representation. We'll get a general visualization of each model with some examples.

## The Internet Protocol Suite (TCP/IP Model)

The Internet Protocol Suite, or the TCP/IP model, is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria. This representation provides a four-layered network stack.


![Modelization of layers in Internet Protocol Suite](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2kh1esoomy21vlav97mo.png)

Let's take a closer look at each layer, starting from the bottom.

### Link Layer

The link layer includes all hosts accessible without traversing a router. The size of the link is therefore determined by the networking hardware design. In principle, TCP/IP is designed to be hardware independent and may be implemented on virtually any link-layer technology. This includes hardware implementations and virtual link layers such as virtual private networks and networking tunnels.

### Internet Layer

This is the layer where two devices on different networks communicate. This is the layer you use when printing something from the fifth-floor printer while sitting on the first floor. You can achieve this even though your office network has no internet connection.

### Transport Layer

The transport layer provides the functional and procedural means of transferring variable-length data sequences from a source host to a destination host from one application to another across a network while maintaining the quality-of-service functions. This is the layer between your router and the application. It transports packages from your router to the application and vice-versa. This is the network layer you're using when printing something on your office printer while sitting on your couch at your home.

### Application Layer

Generally speaking, the application layer is an abstraction layer that specifies the shared communications protocols and interface methods used by hosts in a communications network. For the Internet Protocol Suite, the application network contains the communications protocols and interface methods used in process-to-process communications across an Internet Protocol (IP) computer network. This is the highest layer of computer networking, which most people are familiar with. Every time you use your Web browser or every time you use a mobile application on your phone, this is the layer that you're using.

## The OSI Model

The Open Systems Interconnection model (OSI) is a conceptual model that provides an everyday basis for coordinating ISO standards development for systems interconnection. Compared to the Internet Protocol Suite, the OSI model provides a network stack for more generic networking than Internet Protocol. This representation enumerates layers from bottom to top, starting from 1. Therefore in this representation, layers are often called by their number instead of their names. 
The OSI representation provides a 7 layered network stack in which two communicating devices exchange protocol data units (PDUs) using a network protocol. 

![OSI Representation of computer network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vx7h3vxxsna0j1bt0z7j.png)

### Layer 1: Physical Layer

The Physical Layer is responsible for the transmission and reception of unstructured raw data between a device, such as a network interface controller. This is the first layer that a device passes through. You can see this when you connect to a network for whatever reason. You must have a network interface to communicate with your router.

### Layer 2: Data Link Layer

The Link Layer is the layer where two directly connected nodes communicate. You can see this as the layer you're using when printing something on your printer, which is on the same Network as you. To print, you don't send anything to the Internet. You just communicate with your printer through your router. 

### Layer 3: Network Layer

This layer is the same as the Internet Layer of the IP Suite. The naming is different because the IP Suite conceptualizes a network stack for internet communications, and OSI conceptualizes a network stack more generically. So, generally speaking, the Internet becomes Network.

### Layer 4: Transport Layer

This layer has the same purpose as in the IP Suite model. The main difference in IP Suite is that it handles and controls the transport between Network Layer and the Session Layer.

### Layer 5: Session Layer

The Session layer establishes, manages, and terminates the local and remote application connections. The Session Layer creates the setup, controls the connections, and ends the teardown between two or more computers, called a session. We'll get into more detail when we look into the HTTP in this tutorial series.
 
### Layer 6: Presentation Layer

The Presentation Layer establishes data formatting and translation into a format specified by the application layer during the encapsulation of outgoing messages while being passed down the protocol stack and possibly reversed during the de-encapsulation of incoming messages when being passed up the protocol stack. The Presentation Layer handles protocol conversion, data encryption, data decryption, data compression, data decompression, incompatibility of data representation between OSs, and graphic commands. The presentation layer transforms data into the form that the application layer accepts to be sent across a network.

### Layer 7: Application Layer

Finally, the Application Layer is the layer that is closest to the end user. You can think of it as it's in the Internet Protocol Suite.

## Protocol Data Unit

A protocol data unit (PDU) is a single unit of information transmitted among peer entities of a computer network. It is composed of protocol-specific control information and user data. In the layered architectures of communication protocol stacks, each layer implements protocols tailored to the specific type or mode of data exchange.

For example, the Transmission Control Protocol (TCP) implements a connection-oriented transfer mode, and the PDU of this protocol is called a segment, while the User Datagram Protocol (UDP) uses datagrams as protocol data units for connectionless communication. A layer lower in the Internet protocol suite, at the Internet layer, the PDU is called a packet, irrespective of its payload type.

### OSI Model

- **The layer 4** (Transport layer) PDU is the segment or the datagram, depending on the used protocol.
- **The Layer 3** (Network layer) PDU is the packet
- **The layer 2** (Data Link layer) PDU is frame
- **The Layer 1** (Physical layer) PDU is the bit, or more generally, symbol.

### Internet Protocol Suite:

![Internet Protocol Suite Protocol Data Units](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anfhwyxbzglt3ybfz20b.png)

- **The Transport layer** PDU is the TCP segment for TCP and the datagram for UDP
- **The Internet layer** PDU is the packet
- **The Link layer** PDU is the frame

On TCP/IP over Ethernet, **the data on the physical layer** is carried in Ethernet frames.

## Internet Protocol Suite vs. OSI

![Diagrams comparing IP Suite and OSI models](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5erxljqttu9pykl6tuol.png)


There are a lot of differences between these two conceptualizations from a semantic and implementation point of view. But from a more generic point of view, there are more generic differences between these two conceptualizations:
- **number of layers:** OSI is based on 7 layers, and Internet Protocol Suite is based on 4.
- **Do not confuse TCP/IP and Internet Protocol Suite:**  The Internet Protocol Suite is also called TCP/IP Model. But the conceptualization is separate from the TCP/IP protocol.
- **Enumerating Layers:** The layer enumeration only exists in the OSI Model. In the Internet Protocol Suite, conceptualization layers are not enumerated by numbers as in the OSI Model.

## What's next

In this tutorial, we walked through the two widely used modelizations of computer networks. In the next episode, we'll take a closer look to Layer 3 and will see how IP works in more details

## More about [Makepad](https://Makepad.io)

We're a tech consulting company based in France and share computer science related content on our socials.
If you want to see more this kind of content follow us on our   socials: [LinkedIn](https://linkedin.com/company/Makepad), [Twitter](https://twitter.com/MakepadDev) and [Instagram](https://instagram.com/Makepad.dev).

{% embed https://dev.to/Makepad %}

Follow us on GitHub to stay tuned with our open-source projects: 

{% embed https://github.com/Makepad-fr %}

To join to a community of tech enthusiasts where we talk about tech and other tech-related stuff 👇

{% embed https://discord.gg/NhvYEmyXN2 %}