Long title, but accurate. I will attempt to make sense of the OSI seven layer model to networking. Ill explain it in non networking terms then go back and expand a little on it. I wont get in to too much detail, but you should have a working understanding by the time were done here.
But why should you know? Specific problems in networking can be attributed to specific layers of the OSI model. When someone says to you that there is a level 1 problem with the network card it would be good to know what they're talking about. Also, different protocols work at different layers of the networking model. If you cant retrieve emails from your server you might have a POP3 problem, which is a layer 7 issue.
Alright, so there are 7 layers to the OSI model. Those Layers (from top to bottom) are:
Were going to talk about these layers in terms of talking, so stay with me here...
The application layer is like thinking of what your going to say. It is the uesr interface, its what you see on your computer screen.
The presentation layer is the language you talk in. If your speaking english and the person your talking to speaks japanese, you wontbe able to understand eachother.
The session layer is picking a topic to talk about. this layer establishes connections between programs using sockets.
The transport layer converts the electrical impulses in your brain into sound waves, and sound waves into electrical impulses. This layer interprets data units from the bottom three layers into something coherent for the top three layers, and vice versa.
The network layer handles delievery. If your message has to go through 3 people to get to the person you want to talk to (think the old telephone game we used to play as kids in school) then the network will pick the best 3 people to route the message through. If the message changes or is lost the network layer deals with this.
The Data link layer is broken into two sub layers
The MAC sub layer determines when you can talk. Are you interrupting someone? Will you just talk over them and hope your message gets through?
The LLC sub layer makes sure the electrical signals from your brain are encoded into the right vibration patterns from yuor vocal cords. Will the vibrate to fast, to slow, will there be intermittent pauses?
The physical layer is the air and the waves coming out of your mouth. It's what physically carries the information. will you breather slower and softer, making the "signal" weaker. Is the air itself humid, dampening sound. Are you trying to talk under watter, and what things must change in order for that to happen?
Now for the technical aspect. -- warning -- I am about to geek out, please turn away from your monitor if you are not prepared...
These 7 layers can be broken up into 2 main catagories. The top 3 are end user layers, the bottom three are network layers. Transport, the layer in the middle, is (to no ones surprise) a transport between the top and bottom layers.
LAYER 7: The Application layer, as i said above, is the interface you put information into. This is the layer at which the protocols that run your email client are found. FTP is at this layer, as is HTTP, POP3, IMAP4, SMTP, telnet (and in fact most terminal emulation protocols are at this layer)
This layer is NOT your email application (groupwise, thunderbird, etc.). It is not any application. When your email client wants to send an email, it uses a protocol to transfer your email to your server and transfer it to a remote server (SMTP). When you want to retrieve emails you hit a button on your application and the application uses a protocol (POP3) to download the email to your client. See the difference? This layer is not the application itself, but the protocols that your programs call directly to process your request.
LAYER 6: The Presentation layer, otherwise known as the syntax layer. This layer handles common encryption and compression. This layer ensure that your either talking in the same language, or that you can translate well enough for things to make sense. When you send an email, is it encrypted? If it is, the system your sending it to has to know how you encrpyted it, and how to decrypt it, or else your email will be just so much gibberish to the recieving system. When you use your web browser to view a web page, the web server send you back a whole bunch of css, java and XML crap. Does your browser know how to interpret this? If not you wont be reading that web page any time soon.
LAYER 5: The Session layer. The layer handels connections between two different SERVICES. Not between two different computers. When you request data from a web server, it will do you no good if your system receives the information and tries to send it to your email client via POP3. This is done with port numbers.
A port number is a number used to designate a protocol/service. Port numbers range from between 0 and 65535.
0 - 1023 are "well known" port numbers. Though i challenge anyone to name all 1024 of them. These include FTP (port 20 and 21) SSH (port 22) SMTP (port 25) and HTTP (port 80) etc.
1024 - 49151 are registered port numbers.
49152 - 65535 are for dynamic or private use.
LAYER 4: The Transport layer. This layer breaks up the stream of information from the top three layers into segments more easily digestable by the lower layers (or recombines segments into a data stream for the upper layers). This layer is also responsible for multiplexing (combining multiple signals from a host into one data stream, think email, web and AIM all pushed down one pipe at the same time) and flow control (making sure data is not sent to fast or to slow for the application to process). TCP is the most well know layer 4 protocol.
LAYER 3: The Network layer. This layer is responsible for routing functions. RIP and OSPF are examples of routing protocols that operate at this layer. Most design of network layouts is done at this level. And of course IP is the most well known layer 3 protocol. Routing is done using an IP address and a MAC address. The mechanics of routing are outside the scope of this post but it has given me an idea for my next post... :-)
LAYER 2: The Data Link protocol. This layer is broken up into 2 different sub layers:
MAC: Media Access Control sublayer. This sublayer is responsible for how devices connect and send data out onto the network. CSMA/CA, CSMA/CD, Token bassed access, etc.
LLC: Logical Linc Control sub layer. Actually, much of this sub layer is no longer in use. It used to handle flow control between single connections (not the multiplexed connection made at the Transport layer), frame control (including sliding frame size and re-ordering of frames as needed) and error checking. Of all of these only error checking and frame synchronization are usually used. Frame Synchronization is needed because of the erratic nature of routing on the internet. After you send frames out onto the internet you have no idea if they will arrive in the correct order so the recieving system has to have a way to re-order them. Error checking is done in multiple ways (and is handeled at different times in the OSI model). Parity bits, checksum and hashing to name a few.
Also, this layer routes packets using the MAC address (a unique hex digit asigned to all network connectivity devices).
LAYER 1: The physical layer. This layer definces the physical characteristics of the network. What voltage must a LAN card send across a cat 5e cable, how fast must the voltage switch, etc. These questions are answered here. Repeaters are the perfect hardware to explain this. All a basic repeater does is take in the electrical signal on a wire, amplify it, and send it onto the other wire connected to it. The repeater doesnt care what it is amplifying, and in fact cant know. All it deals with is voltages.
- Making Sense of the Open Standards Institute 7 layer model of networking communication...