Wednesday, July 4, 2007

OSI model, DOD model, data encapsulation

The first step in becoming an expert in networking is understanding of the OSI model.

OSI layers -

  1. Physical
  2. Datalink
  3. Network
  4. Transport
  5. Session
  6. Presentation
  7. Application

Physical

Functions
Data is sent across physical media like wires and hubs. Responsible for encoding scheme (like Manchester encoding) .

Devices
Hubs, Repeaters, Amplifiers, Transceivers

Protocols
None

Datalink

Functions
Packets placed into frames at this layer. CRC is added at this layer. If CRC fails at the receiving computer, this layer will request retransmission. Mac addresses are resolved at this layer.

Devices
Bridges, Switches.


Protocols
CSMA/CD

Network

Functions
Logical addressing, routing of message, determining the best route.

Devices
Routers.

Protocols
IP, IPX, RIP, OSPF, ICMP, ARP, RARP, IGRP, BGP, EGRP

Transport

Functions
Sequencing, Error free delivery. Sliding window is at this layer.

Devices
Gateways

Protocols
TCP, UDP

Session

Functions
Responsible for opening, using and closing the session. Also places checkpoints in the data flow, so that if the transmission fails, only the the data after the last checkpoint needs to be retransmitted.

Devices
Gateways

Protocols
Network file system, SQL, RPC.

Presentation

Functions
Translating data into understandable format for transmission. Data compression and encryption takes place at this layer. Redirector works at this layer.

Devices
Gateways

Protocols
JPEG, MIDI, MPEG, (All kind of music, pictures and movie formats)

Application

Functions
Interface between the user and the computer. API incorporated in this layer.

Devices
Gateways

Protocols
SNMP, FTP, TELNET, WWW, HTTP, MIME

To help remember the layers of the OSI model, I use this phrase: "People Develop Networks To Send Packets Accurately"
You may see questions about OSI model that are very confusing. It's easier to find the correct answer if you associate each layer with the specific "keywords"
To see what I mean, look at this table. Once you are familiar with all 7 layers of the OSI model, go over it a few times. Then when you see a question on your exam, look for "keywords"; they will give away the correct answer.

OSI layer
Physical

Keywords
Bits, Bit synchronization, Transmissions, Cable, Repeater, HUB, Physical topology

OSI layer
Datalink

Keywords
Data into frames, Frames, Framing, MAC address, Hardware address, LLC, Logical Link Control, Sublayer, Bridge, Polling, Token Passing, Contention, Switches, CRC (Ciclic redundancy check), Frame types

OSI layer
Network

Keywords
Routing, Routers, IP, IP address, IPX, RIP, OSPF, Packet switching, Layer 3 addresses, Layer 3 protocol, Network address, best route.

OSI layer
Transport

Keywords
Error-free delivery, Segment data, reassemble data, sequencing, Sliding window, windowing, determining availability of communication, flow control, acknowledgement. TCP, UDP.

OSI layer
Session

Keywords
Placing checkpoints, NFS, RPC, ASP(AppleTalk), X-Window, SQL, coordinating of communications.

OSI layer
Presentation

Keywords
ASCII, JPEG, MPEG, Graphics, images, multimedia, (you make a presentation of your graphics) compression, encryption, data transfer syntax

OSI layer
Application

Keywords
Telnet, WWW, FTP, email gateway, gateway, applications, sending and receiving applications.

Comments: The easiest to remember is physical layer. Everything that does not involve any processing - wires, cables, hubs.
At the two highest layers of the OSI- Presentation and Application you have all the things that you can see on your screen - browser, email, ftp prompt, graphics, multimedia.Just remember that all the graphics and multimedia are at the presentation layer. Imagine that you are an artist and you making a presentation of your art - pictures, movies, multimedia, graphics.

Advantages of using OSI model is

  1. compatibility. Different operating systems using OSI model can communicate with each other.
  2. It clarifies a general function, rather than a specific on how to do something
  3. Developers can change features of one layer without changing the code Simplifying the troubleshooting

OSI model is just a model. It's up to the software manufacturer to decide what layers they will use in writing the software. Most Network Operating Systems don't use all 7 layers of the OSI model. Depending on the software only 4-6 layer approach is used.
The DOD model is a simplified version of the OSI model. It only has four layers. It's easier to remember four layers than seven layers. Department of Defense wanted to simplify the OSI model and make it easier. Unfortunately it makes it harder for you because now you have to learn the OSI model and the DOD model.


DOD model
Process/Application

Protocols
Telnet, FTP, TFTP, NFS, SMTP, SNMP, X Window

Corresponding OSI layers
Application
Presentation
Session

DOD model
Host-to-Host

Protocols
TCP, UDP

Corresponding OSI layers
Transport

DOD model
Internet

Protocols
IP, ARP, RARP, BootP, ICMP

Corresponding OSI layers
Network

DOD model
Network Access

Protocols
CSMA/CD

Corresponding OSI layers
Data Link
Physical

Data encapsulation:

Encapsulation is the process of inserting the information of upper layer into the data field of a lower layer. Let's say you want to send email from your PC to another PC on the Internet. First you type a message that you want to send. This message is converted into 1s and 0s by the application layer. Then, the presentation layer takes this message, and adds it's own header and footer bytes to it. Your message itself has not been changed, it is contained in the data field of the presentation layer.
Then the session layer takes the resulting message and adds it's own header and footer to it. The process repeats until it gets to the physical layer. When the resulting packet gets to the physical layer, it is allot longer then your original message, because it contains headers and footers from another layers. The physical layer does not care what this data means. Physical layer just converts this data into bits and sends it onto the network media like UTP cable. The physical layer does not even care about the network address or the physical address of the packer because the network address has been added at the network layer and the physical address has been added at the Datalink layer.
When the packet arrives to it's destination, the receiving computer performs the same process in reverse order (de-encapsulation). First, the physical layer of the receiving computer converts the signal into bits, then Datalink layer examines the physical address field of the packet. If the destination physical address of the packed matches the physical address of the machine, the Datalink information is stripped off the packed, and the resulting packed is passed on to the network layer. The network layer will then strip off the header that was placed by the network layer of the sending machine and the rest of the packed is passed on to the transport layer. The process repeats until the packed finally arrives to the application layer. By that time, all other headers and footers have been striped off the packed and it looks like the email message that you typed. The Application layer is then converts this message into the readable format (remember that when data arrives to the application layer it's still a bunch of 1s and 0s) and the email is displayed on the screen of the receiving computer.

For the exam you need to remember the order of data encapsulation.
1. User information converted to data
2. Data converted into segments
3. Segments converted into packets
4. Packets converted into frames
5. Frames converted into bits

Flow control:
Flow control is a process of adjusting the flow of data packets to ensure the reliability of data delivery and data integrity. Flow control is performed at the Transport layer of the OSI model.
When packets are received by the destination computer, they are put into buffer while being processed. If buffer becomes full, any additional data packets will be discarded.
To prevent this from happening, the Transport layer of the destination computer will send "not ready" indicator to the sending computer, requesting it to temporarily stop transmission.
Windowing is the mechanism used for the flow control. Window is the number of data segments a source machine can send before it must receive an acknowledgement from the destination machine. Network administrator can increase or decrease the size of the window. On reliable LAN the size of the window should be increased. This will decrease the number of acknowledgements, freeing up some bandwidth and increasing the speed of the transmission.If the sending machine does not receive the acknowledgement, the packets are retransmitted. This method is called "Positive acknowledgement with retransmission"