Answer:
There are 7 layers in linux.
Explanation:
As networking is difficult and complex.
Imagine if every application had to know how to communicate on every step that would be more than just complex. So, rather than reinvent something which will help it to communicate let’s just make something that will automatically controls the communication and for that protocols came in to live.
As for the linux operating system, it is not exceptional from other operating systems.
There are 7 layers on network protocol stack use to communicate with other network protocol stack.
1. Application layer
2. System call interface
3. Protocol agnostic interface
4. Network protocol
5. Device agnostic interface
6. Device drivers
7. Physical hardware
All the layers vary in their functionality.
One more important thing to remember is that the network protocol stack layers is not one way its 2 way communication. First, when a client request to a network and second, when the request is full filled.
The top most layer is a part of user space, the next five layers comes in the kernel space and the final layer is the physical layer.
<u>Application layer:
</u>
When a client or user request to a network the request initially comes to this layer.
On this layer we use tcp/ip protocol.
<u>System call interface(SCI):
</u>
When application layer make a call to the kernel this layer handles that call. And take the request to the next layer.
<u>Protocol agnostic interface:
</u>
This layer has two functions “talking” or “listening”. There is a thing called sockets which perform these functions and each socket has an id which is used specifically for an application.
<u>Network protocol:
</u>
This layer is used for how the data is sent or received.
<u>Device agnostic interface:
</u>
It is used to connect data from/to kernel user space and the network device drivers which allows the data to prepare itself for transmission over the medium from the network device.
<u>Physical hardware :
</u>
This layer is responsible for the data packets transmission and received from the network medium being used whether cable or wireless.