Wednesday, August 4, 2010

The osi model

"What is The OSI model? Is this related to any of the atom models done in old school ? Huh!" No, my friend the OSI model [OPEN SYSTEM INTERCONNECTION ] is a way of subdividing a system into smaller or simpler parts [ with respect to the communications ] called layers.

Things to remember
  1. A layer is a collection of services/functions .
  2. Each layer provides services to the layer above it and receive services from the layer below it.
  3. It have 7 layers coming to that in a minute.
Layers of the OSI model:-
  1. Application
  2. Presentation
  3. Session
  4. Transport
  5. Network
  6. Data-Link
  7. Physical layer
How to remember all these layers....

Yeah! I know that you guyz would be thinking how do I remember these stuff..

As usual I'll make it easy:-

Here comes the acronym to remember these layers with their orders . I came to know about this from a youtube video...
All        : application
People : presentation
Seem : session
to : transport
need : network
Data : data-link
processing : physical
What are these layers man What do they do..

Lets start explaining them 1 by 1 :-
  1. Application layer

    This layer is basically there so that you can interact with any application on the WWW or the world wide web or on your own network. Protocols in there are : HTTP , FTP , SMTP etc etc.........
  2. Presentation Layer

    This layer is the easiest one it deals with the ANCII code means it deals with the relationship between binary and letters.. We'll be doing the byte-ordering and conversion topics few pages down. Then you'll be able to properly understand this..
  3. Session Layer

    This one's easy too.. The dictionary meaning of session is : A period of time spend on a particular activity. What a session in OSI model means that it finds the destination PC on the network .

    Ask about can they initiate a connection between our comp's and theirs.

    In easy language it just there to establish a connection between the source computer to the destination.

    I'll make it easy :-

    Imagine you make a chat server program and decide to establish a connection between you and your friend so in that ,the role of this layer will be to carry the request from your computer to your friend's computer "knock knock" and ask him "Sir can we initiate a connection between each other and do some chat,if you dont mind"

    So that was the session layer.
  4. Transport

    In our case this is the most Important stuff . It contains the two most important protocols for us :- TCP and UDP .. I'll explain these two in a healthy 2 pages topic .. Which is coming next in the next tutorial.

    After this.
  5. Network layer

    This layer is also a very important layer. This is where IP : INETERNET PROTOCOL is found …

    We all know that net is like a matrix it is the most complex network so it has lots and lots of webs of wires so what the IP and other protocols here does that they find or actually they know the shortest and the most reliable way to connect host and the destination . I'll explain you this topic more clearly through the following "kind of picture"
    ******                  Route 2nd                         ****** 
    * C1 *-------->------>------------>---------------------->* C2 *
    ****** ******
    | |
    | 1st route |
    | |
    ****** |
    * C3 *---------<---------------<--------------<----------<------
    In the above diagram there is a network of 3 computers C1,C2 and C3.

    We want to initiate a connection between C1 and C3. There are 2 routes :-

    The straight and the shorter route is "route 1st"

    The coiled , complex and the longer route is "route 2nd".

    You'll have a better understanding of this topic while in the next section. "When I'll talk about TCP/IP in more detail".
  6. Data-Link layer

    According to me it is the most confusing layer . It contains two sub-layers MAC and LLC:-

    MAC :- The id given to every network card manufactured.

    Is known as MAC address.

    Don't be confused between logical address and physical address .

    They both are different logical addresses are what we call IP addresses and physical addresses are one associated with this layer.
  7. Physical layer

    This is the most easy layer according to me It only deals with zeroes and ones yeah! Binary.. The ethernet cable , hub , switch , modem , etc etc all come in this layer....

Where he is getting us with all this stuff!!!" Sorry guyz but it is important if you want to be a good and a successful socket programmer you have to know about all this stuff so Fix in your seat and bear it with me....

Ip versions:-

Till date there are two IP VERSIONS :-

1.IPv4 [The old one but still the dominant one]
2.IPv6 [The new and the complex one]

The reason why we needed to get this new ip versions is that we were getting short of it "what" yes we were getting short of it..
Day by day the net was spreading more and more faster which lead to creation of new Ip version that is Ipv6...

What are thes Ipv4 and Ipv6 :-

See before getting what are these different versions and differentiate them i'd like you to introduce about.

What is an IP?

IP is known as Internet protocol it is the primary protocol in the Internet layer. It have many uses like incapsulation [ explained above ] , addressing , etc , etc....

But I'll only cover the basics:-

TCP/IP in terms of Addressing

Before talking in terms of the biggy big net I'll talk this topic with respect to a smaller network let call it "The tutorial network" .

What I did is that I connected 3 of my computers with each other . Ok . You are sitting at comp no.1 I'm at comp no.2 and my uncle "Mr Sachin Sharma " is sitting on the third . I requested to download a file name "blah blah blah.jpg " on the Sachin's computer [3rd computer] . Now suppose that you are the [3rd computer ] how will you find who wanted to download that file.

Here when the ip's comes in work .. You can actually suppose IP's as the names of computer.

Now when I'll make a request to read a file on comp 3rd The computer will respond back to my ip address .

The exact definition of IP address :-

It is a numeric address given to every device including/participating in a computer network.

That was IP in terms on Addressing.

More about ip :-

IPV4 and IPV6:-

As I explained above that IP is a numeric address given to every device participating in a computer network .whether its a mobile phone , a PSP etc etc..

IPV4 : It is a 32 bit ip version and the old one.


Yeah I'll explain you what is 32 bit.

Actually its a 4 byte address.

As there are 8 bits in each byte . And 8*4=32 . Got it …

Wait a sec I'll make it easy.


234 = 11101010 ? 8 bits
44 = 00101100 ? 8 bits
55 = 00110111 ? 8 bits
22 = 00010110 ? 8 bits

IPV6 :

See as, I said above we needed IPV6 as we were getting short of IPV4 addresses .

IPV6 are a 128 bit IP version . And they were invented in 1995 …

"Whats so cool about that" I was born in the same year... Yupiii!!!



You can also see a IP like this :-

in the form of this:-


This is because the zeros in the IPV6 can be omitted.

No comments:

Post a Comment