The OSI-model

after reading a paper about the OSI-model I'm not exactly sure how to look at this model.

Does data (a file) travel from the application level "down" each layer at the client

Application
V
Presentation
V
Session
V
Transport
V
Network
V
Data link
V
|
|
| (Physical)
|
|
and "up" each layer (in reverse order: physical, data link, network etc..) at the server ?

After taking a look at a picture (http://www.cs.columbia.edu/~hgs/internet/it_stack.gif\)
I noticed that there seems to be no data link activity between the
network (IPv4, IPv6) and physical layer (Ethernet)..

I couldn't be more confused. Any help at all is highly appreciated :slight_smile:

You are partially correct! The data does traverse down the OSI model on the source node.......across the network medium.......to the destination node....and back up the OSI model.

BUT, transmissions do not have to actually start at the application level. Have you ever heard of two or three tier routers? They only use part of the OSI model.....hence two or three layers are transmitted....not all 7.

It goes like this:

Data to be sent in this datagram = XXXXXXXXXX

Layer 7 puts on application specific headers:

AAXXXXXXXXXXA

Then Layer 6 for presentation:

PPAAXXXXXXXXXXAP

Then Layer 5 does the same on a session basis:

SSPPAAXXXXXXXXXXAPS

Layer 4 for transport portion:

TTSSPPAAXXXXXXXXXXAPST

Layer 3 goes next:

NNTTSSPPAAXXXXXXXXXXAPSTN

Layer 2 puts on the Data Link layer stuff:

DDNNTTSSPPAAXXXXXXXXXXAPSTND

The finally the Physical layer:

PPDDNNTTSSPPAAXXXXXXXXXXAPSTNDP

This is then transmitted. At the destination...each layer strips the corresponding layer and sends it up to the next layer....etc.

This is very basic...it's more complex than this tutorial...each layer does not have the same size of headers...and such...but this gets the idea across.

I think that I might be able to offer a little better explanation of the layers. First though, you must realize that TCP/IP can only roughly be molded into the OSI network layers.

Application Layer I am a user and I want to use the network to send a file from my pc to a unix host. I must start by selecting an application. For this example, I will use the application known as ftp. Ftp is a commonly available application. My expertise on pc's is limited, but I can open an MS-DOS window and type the command "ftp". At that point, I suddenly know what to do. This is because the ftp program on windows is very similiar to the ftp program on unix. To a great extent, for a user, this is the only layer that I care about.

Presentation Layer But that ftp program was written by a programmer. She needed to invoke various functions or subroutines to get the job done. Those routines will require that data be converted from whatever form the current cpu may be using to a network format. A TCP/IP programmer working in C will have macros designed for this. These macros are named stuff like htonl (for host to network long). These macros are important, ignore them and you may write a program that works of a big-endian cpu but fails on a little-endian cpu. A few screwball systems have 6 bit bytes. On a system like that, this layer would have a lot more work to do. But unless you are working on an old CDC Cyber or something, this is a rather thin layer. It is also perhaps, not the first issue that the programmer would encounter in writing ftp. This is why I say that the OSI model is not a perfect match for TCP/IP. But let's move on.

Session Layer My ftp program will need to establish a session to the unix host. Since I am running nt, I could open a second ms-dos window and run a second ftp job to the same host. That's ok, the session layer will keep the jobs from getting mixed up. To the programmer, this layer means establishing a socket to the remote system.

Transport Layer When she established a socket, she had to specify a transport layer. Ftp uses TCP as it's transport layer. TCP will send packets from my pc to the unix host. It will get them there reliably and in order.

Network Layer IP is the only network layer available. The network layer will accept a packet from TCP and it will do it's best to deliver that packet to the destination. If it fails, TCP will need to resend. But IP will look at the the destination IP address and it will figure out how to move the packet closer to the destination. If needed, if will fragment a packet that is too big for the next layer down. As a special case, if the packet is addressed to the local host, it will just hand it back up to TCP (or UDP), thus bypassing the lower layers.

Data Link The IP layer on my PC talks to an ethernet driver. That driver is the Data Link layer. It converts the IP datagram into an ethernet frame.

Physical And finally, my ethernet driver talks to a card that actually puts the data on the cable that goes to a hub.

And the unix host, data arrives on its ethernet cable (physical) and is read by its ethernet driver (data link). The driver passes the data to the IP layer (network). The IP layer hands the data to the TCP layer (transport). The TCP layer makes the data available to a particular socket(session). The data to transformed to local format (presentation). And the ftpd daemon stores it in a file (application).

thanks for your replies

Great explanation you wrote there Perderabo
taught me a lot
:slight_smile: