LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   The seven layers (https://www.linuxquestions.org/questions/linux-networking-3/the-seven-layers-4175731726/)

ychaouche 12-12-2023 03:52 AM

The seven layers
 
Dear LQ,

I wasn't satisfied with the search results about real protocols for each layer.
For example,
some sources claim that JPEG and GIF are network protocols?

Anyway, here's what I gathered so far:

1. Physical (wifi, ethernet, bluetooth)
2. Link (PPP, ATM, wifi, ethernet)
3. Network (IP, ICMP, ARP)
4. Transport (TCP, UDP, STCP)
5. Session (RPC, NetBios)
6. Presentation (TLS)
7. Application (HTTP/DNS)

Could anyone confirm these protocols are on the right layers?
(some of them are duplicated,
for example ethernet and wifi span two layers)

Turbocapitalist 12-12-2023 04:56 AM

Funny that this has come up some many times in the last few days in various places.

I'd look at TechTarget's summary: https://www.techtarget.com/searchnet...definition/OSI

Thus is might look like Wi-Fi and Ethernet are in there twice, but those are separate: There is the cabling of Ethernet (the wires) and the electrical signal of Ethernet (IEEE 802.3) over the wires. Same for the Wi-Fi. There are the electromagnetic waves and then the signal (IEEE 802.11) over those waves, if I understand correctly.

However, there are often three additional unofficial but very important layers described as the financial, political, and religious layers.


TLS could be in the Session or Presentation layers. There is even some commentary on the shortcomings of the OSI model since a lot of other protocols don't quite fit in one layer or another either:

But to get to the primary source, the PDF is available at ISO:

https://standards.iso.org/ittf/Publi...-1_1994(E).zip

Bizarrely the PDF is wrapped in a Zip archive.

Ser Olmy 12-12-2023 06:43 AM

Quote:

Originally Posted by ychaouche (Post 6469920)
1. Physical (wifi, ethernet, bluetooth)

"Physical" means precisely that: The method by which the actual signals representing bits are sent and received. Terms like "WiFi" or "Bluetooth" encompass a awful lot more than just that.

Some examples: The various 802-standards specifying data transmission over twisted-pair wire, coaxial cable, radio waves, and optical fibre.

These standards are implemented as physical components inside various types of tranceivers.
Quote:

Originally Posted by ychaouche (Post 6469920)
2. Link (PPP, ATM, wifi, ethernet)

Layer 2 specifies how sequences of bits (=signals) are grouped to form frames, which typically include a header, a payload (the actual data), and possibly a trailer.

Layer 2 will typically also specify some form of node addressing, making it possible to send frames to and from specific nodes in a multi-node setup. For 802.3/802.11 that would be the MAC addresses.

Examples: 802.3 ("Ethernet"), 802.11, and yes, PPP.

Note that some of these standards encompass one or more Layer 1 specifications as well. Since Layer 1 can transmit bits, it's entirely possible to use the same Layer 2 frame format with different Layer 1 technologies; Ethernet over twisted-pair, coaxial, and fibreoptic cable all use the exact same Layer 2 frame format. Same with PPP, you can run that over a number of different media/transports.

Layer 2 may also encompass certain "control plane" protocols that network equipment use to communicate with one another and possibly auto-configure links, but that do not contain any upper-layer information.

Examples: The Spanning-Tree protocol (STP/RSTP), Link-Layer Discovery Protocol (LLDP), Link Aggregation Control Protocol (LACP).

Layer 2 standards are implemented inside various types of chips (typically ASICs) inside switches and network interface adapters. The connection to Layer 3 (if relevant) is provided by drivers.
Quote:

Originally Posted by ychaouche (Post 6469920)
3. Network (IP, ICMP, ARP)

Layer 3 deals with network addressing and unlike Layer 2, the addresses may belong to different networks, making it possible to send data from A to B via C. It specifies a header structure for packets that fit inside one or more Layer 2 frames.

Examples: IPv4, IPv6 (and older standards like IPX, DECnet, etc.)

While Layer 3 should in theory be completely Layer 2-agnostic, a Layer 3 protocol must also specify how a network address is associated with a local Layer 2 address, and how such associations are discovered and published.

Examples: ARP (for IPv4), NDP (for IPv6)

Some non-data-carrying protocols designed for network operations and troubleshooting also fit into this category, simply by virtue of not (normally) carrying user data.

Examples: ICMP (ping), various routing protocols (RIP/OSPF/BGP/etc.)
Quote:

Originally Posted by ychaouche (Post 6469920)
4. Transport (TCP, UDP, STCP)

Correct. These protocols exist within Layer 3 packets and carry the actual application protocol data as a payload. They may or may not include mechanisms for error checking, retransmissions, and throttling.
Quote:

Originally Posted by ychaouche (Post 6469920)
5. Session (RPC, NetBios)

Things get a bit more vague here, as the concept of a "session" simply means a transaction that is started and finished in a particular way, and should be considered ongoing even if no data is currently being transmitted.

NFS and SMB are fairly good examples of protocols that include a session layer (and a lot more). Protocols like Telnet and SSH also work like this, but they rely on a single TCP connection for session management and thus have no real session layer of their own.
Quote:

Originally Posted by ychaouche (Post 6469920)
6. Presentation (TLS)

This is where the theoretical OSI model somewhat breaks down when confronted with reality, as encryption (arguably the most common implementation of presentation-layer functionality) isn't necessarily implemented over a pure Layer 5 session layer.

TLS (and its predecessor SSL) sits directly on top of a transport protocol (TCP or UDP), while IPsec runs directly over Layer 3 (IP) and does session management over a separate UDP connection. In the latter case the encrypted connection is itself treated as a Layer 3 protocol, meaning the result looks something like this:
Code:

Layer 1 - Layer 2 - Layer 3 - IPsec - Encrypted Layer 3 - Layer 4 etc.
But sure, encryption belongs at Layer 6 in the OSI model.
Quote:

Originally Posted by ychaouche (Post 6469920)
7. Application (HTTP/DNS)

Indeed. These are the protocols spoken by various servers and clients.

ychaouche 12-12-2023 06:51 AM

That OSI model refuses to die article is a gem.
Thanks a lot for the pointer.
I feel releived!

ychaouche 12-12-2023 07:10 AM

Thanks for the extremely detailed explanation Ser Olmy,
one the most intelligible things I have read on the matter today.


All times are GMT -5. The time now is 07:18 PM.