1

Knowing the theory of how the seven layers interact and manipulate the data in theory is one thing, but how one implements this in the real-world with actual code is another.

I want to know how these layers are implemented in practice (PC as a example, because it uses all of the layers unlike a Router, etc.) - is every layer a separate process that has a standardized API (so there are many peices of software that work together) or is something like a network Driver for a specific HW/SW setup responsible for all of this using shared libraries and such? Or is it some other completely different approach?

The reason I'm asking this, is because I want to create my own network on the 868MHz band, and I want to use some existing code (for ex. a DataLink error correction and such code - because that is just way beyond my skill) but also write my own Network layer code to customize the way devices interact.

niraami
  • 646
  • 8
  • 18
  • I know that I'm referencing a PC and that implies that I'm talking about TCP/IP, and that it doesn't work exactly like the OSI REFERENCE Model specifies, but the fact that TCP/IP was made based the OSI standard still stands. – niraami Nov 26 '16 at 15:13
  • 1
    Actually, TCP/IP came before the OSI model, and the OSI model is still just a model, not a standard. The OSI model was created to try to explain how something in an ideal world would work. The only thing I know that actually tried to implement OSI was IS-IS. – Ron Maupin Nov 26 '16 at 16:12
  • IS-IS: https://en.m.wikipedia.org/wiki/IS-IS – Jonathon Reinhart Nov 26 '16 at 17:02
  • @RonMaupin Oh, didn't know that. Sorry and thanks! – niraami Nov 26 '16 at 18:20
  • Just read some more info about it, and first of all, both Standards were documented around 1970.. so I don't think that TCP came first. Second of all, the OSI Model is a standard.. why else would it have been released as 7498-1 from a Standardization Organization (ISO and IEC, not really sure which maintains it now)? – niraami Nov 26 '16 at 18:27
  • 1
    @areuz The OSI project was not even in existence in 1970. The OSI model was released in 1984 as a standard *for the ISO protocol suite* that was released as a standard by the same organization. Generations of college teachers have mistakenly taught it as though it applies to the universe. It doesn't. You don't need seven layers to implement your protocol. – user207421 Nov 26 '16 at 23:52

1 Answers1

3

is something like a network Driver for a specific HW/SW setup responsible for all of this

Yes. In most all modern operating systems, the networking stack is implemented in the kernel, for performance and security reasons.

Performance: A lot of work goes into processing a packet, so it's more efficient to do that work in the kernel before dispatching the application-layer data to the application bound to the given socket.

Security: The kernel prevents unpriveleged users from doing "bad" things, like spoofing their IP address or flooding another host with ICMP messages.

A good resource to look at would be the Linux kernel source code.

  • net - Here you'll find all of the core device and protocol implementations (IP, TCP, UDP, etc.)
    • dev.c - Device management
    • ipv4 - IPv4 and UDP, TCP v4
    • ipv6 - IPv6 and UDP, TCP v6
  • drivers/net - Network device drivers
Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328