The OSI-Model

Browser, ports, cables and whatnot!

From seven to one and vice versa

The OSI (Open Systems Interconnection) Model is a framework for standardising the functions of networking equipment.
The goal for this is to make said equipment compatible with each other no matter the internalĀ  build-up.

The OSI model was developed in the late 70’s. Basically to ‘stabilise’ the overgrowing amount of networking standards at the time.

The OSI model is going to beĀ your tool for troubleshooting and understanding networks. The OSI model always has to go up or down in order.

Example: If you would go to ‘YouTube.com‘ your browser will handle layer 7 to 5 (taking into account that Cisco handles this as one layers themselves). The browser, operating system and it’s firewall will take care of the ports used and allowed, thus layer 4.
It’ll than pass the router which routes based on destination IP, which is layer 3. If a switch is in between, this device will take care of layer 2.
All the equipment, cables and the electrical signal belong to layer 1, the physical layer.

In the end. Layer 5 to 7 can be seen as a single one for networking specifically.

The seven layers of the OSI model.

Layer 1: Physical

Layer 1, The physical layer. This one is pretty easy to remember. Layer one is responsible for the transmission of the raw (photo)electrical signal through the means of a transmission medium. Which could be copper ethernet cable or an optical fibre cable for instance.

This layer also specifies the physical maximum data rates, physical connectors and whether something is full-duplex or half-duplex.

More information

Layer 2: Data Link

Layer 2, The Data Link layer. This layer is responsible for node-to-node transfer of data. It is capable of detecting and correcting errors that may occur on the physical layer.

Layer two defines the protocol that both establishes and terminates the connection between two physically connected devices. Meaning, if the LED’s on your network interface of your computer would turn on right after you plugged in your ethernet cable. This means layer two is successfully established.

Layer two contains the MAC (Medium/Media Access Control) addresses. These addresses are hardcoded into a NIC (Network Interface Card). Switches use these MAC addresses to determine what the source and destination host should be for forwarding data within a single LAN. Read more on my ‘Hubs, Routers and Switches’ page.

More information

Layer 3: Network

Layer 3, The Network layer. This layer is, for me, the most interesting of all.

Layer 3 basically provides the functions and procedures for transferring packets from A to B through different networks, from node to node in where each node has an IP address.

If passing multiple networks, a router is necessary to forward it to its destination based on routes. Read more on my ‘Hubs, Routers and Switches’ page.

More information

Layer 4: Transport

Layer 4, The Transport layer. This layer works a bit as a layer that ‘co-ordinates’ layer 5 to 7 with layer 1 to 3.
This layer is where the logical end-to-end connections are handled as in what ports are used and whether UDP or TCP is used.

UDP (User Datagram Protocol) is mainly used for real-time applications where reliability isn’t necessary (e.g. re-sending lost data amidst the connection) but where speed is necessary. Online games, VoIP, DHCP, DNS (If the data is below 512 bytes which usually never happens…)

TCP (Transmission Control Protocol) is used where reliability is more important over speed/overhead.
Connecting to websites, Mail, SSH/Telnet and DNS (with data over 512 bytes) uses TCP for example.

More information

Layer 5: Session

Layer 5, The Application layer. This layer controls the connection in end-to-end connections. It manages and shut it down when the need arises in a graceful manner.

SSL/TLS encryption is handled in this layer, strictly for HTTPS traffic for instance. But encryption can be done on layer 3 to 7!

More information

Layer 6: Presentation

Layer 6, The Presentation layer. This layer is responsible for formatting the information to the application layer.

You can look at this layer as a sort of translator for the application. A bit like a driver/API.
In many applications, layer 6 and 7 are mostly handled as one. You won’t see really much networking specific in here.

More information

Layer 7: Application

Layer 7, The Application layer. This layer is directly in contact with the user. Like your browser, email client or videogame.

An example would be that you inside your browser fill in a web address, once you press enter it’ll ‘encapsulate’ it’s HTTP request to the webserver from which client it came and what protocol to use. In this case HTTP(S).

Example protocols: Telnet, TFTP, SMTP, DNS.

More information