Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-26-2009, 05:29 PM   #1
Rico Federico
LQ Newbie
Registered: Jan 2009
Distribution: Mandriva 2008 Spring
Posts: 2

Rep: Reputation: 0
Question Networking: Mapping languages to OSI Model

Hi all,

This is my first post on Linuxquestions. I love this site! It's such a great reference. I was turned on to this site by a good friend and Linux pro, and I reference it often.

This question is less Linux-oriented, but after hopping around to different sites, it seems Linux users have a better grasp of the subjects addressed in the question....

My question is: What programming languages can be mapped to what OSI layers?

I understand that the OSI model is just that - a model. I also understand that depending on the functions used or the general use for a particular language, it/its uses may or may not map to one or more layer(s) of the model. I did run across a general map of the languages online once, and it really helped me understand internet technologies in a much more comprehensive manner. For instance, that SQL presents to PHP and so on and so forth.

It's been a while since I referred back to that, and now that I am looking to get into programming, I want to experiment with how different languages communicate "through the layers" on a network...and I seem to have forgotten some of that information in that map model. But I tried looking up that reference model again's gone! I can't seem to find it anywhere!

I hope some of you Linux friends can help because no one I've talked to seems to able to answer my question in a clear manner.

It's okay if you need to refer me to some other links for each language or whatnot, you know, for the details, I'm just more concerned with an overall account of how they can fit in with each other from hyperlink click to page delivery, or from ftp request to file delivery, and what languages on a typical site would be used to facilitate requests on whatever layer, and how they communicate with langauges that may perform services in other layers...for instance...would you say that SQL is a session layer-oriented or presentation-oriented language, and how does that fit in with PHP, Perl, etc?
It would be ossim if someone out there could give me an overall view of that for each layer, and for each popular or heavily-used langauge out there.

Thanks for reading everyone, I hope you guys can help!


Old 03-27-2009, 04:31 PM   #2
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
I don't think that you can come up with a mapping between languages and OSI model layers as it would not be languages that exist at particular layers of the OSI model, but programs / applications created using these languages. To be a little more clear:
  1. Layer 1 (physical layer) would not tend to be associated with programs, but with wires, transistors, lasers, radio waves, etc.
  2. Layer 2 (data link layer) consists of pretty low-level functions involved with getting the data onto the wire, error detection, etc. - the firmware in network devices, and the device drivers within the kernel.
  3. Layer 3 (network layer) and layer 4 (transport layer) tend to be implemented as part of the operating system kernel and as system utilities such as route. In Linux, these services would be implemented in C.
  4. Unless you are involved in systems programming, the majority of programs would exist at Level 5 and above (i.e. in the "application layer" as defined in the TCP/IP model)
  5. Many languages - C, Java, Perl, etc. allow you to create sockets to hook into layer 4.
  6. Functions at layer 5 (authentication, permissions), layer 6 (encoding, compression, encryption) and layer 7 (protocols such as HTTP and FTP) can be implemented in many languages. Often libraries/modules will be available for these purposes.

Everything else is outside the OSI model. Programs may sit above layer 7 and hook into it to make use of network connections. These programs may or may not be implemented in the same languages that are used to implement the network stack itself.

Hope this helps, and welcome to the forum.

Edited to add: Just re-read your last paragraph. To clarify: SQL exists above the OSI model (though can make use of network connections to remote databases). Here is a Linux network programming tutorial from Linux Journal (not gone through it myself yet, so don't know what it's like) and there are many good websites just a Google away.
  • OSI layers (2,) 3 and 4 are the realm of Systems Programming: C, assembly language
  • OSI layers 5-7 are the realm of Client and Server Programming: C, C++, Java, Perl, Python
  • Above layer 7 is the realm of Application Programming: C++, Java, Perl, Python, PHP, Ruby, C, .NET, SQL...

Last edited by Robhogg; 03-27-2009 at 05:22 PM.
Old 03-27-2009, 05:53 PM   #3
Rico Federico
LQ Newbie
Registered: Jan 2009
Distribution: Mandriva 2008 Spring
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up ROBHOGG: Right on!

That explanation at the bottom definitely helped.

I get lots of conflicting, vague, incomplete, or misleading information when it comes to this question, but your explanation with the SQL example and the languages worked well to give me a much cleaner idea than the answers I was receiving. Thank you, I knew I came to the right place!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
architecture of a multi user network with reference to the OSI model monty69 Linux - Networking 1 04-23-2006 05:07 PM
languages of linux: which languages can be choosen in suse and red-hat distributions? Klaus Schnorr Linux - Software 3 09-10-2005 02:19 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration