OSI Reference Model
OSI Reference Model
OSI Model
2
OSI Model Layers
Layer - 7 Application
Application
Upper Layer
Layer - 6 Presentation
Presentation or
Software Layer
Layer - 5 Session
Session
Layer - 4 Transport
Transport Heart of OSI
Layer - 3 Network
Network
Lower Layer
Layer - 2 Data
Data Link
Link or
Hardware Layer
Layer - 1 Physical
Physical
3
Application Layer
Application Layer is
Application
Application
Application
Application responsible for providing
Networking Services to the
Presentation
Presentation user. It is also known as
Desktop Layer. Identification of
Session
Session Services is done using Port
Numbers.
Transport
Transport
Ports are Entry and Exit Points
Network
Network to the Layer
Data
Data Link
Link Total No. Ports 0 –
65535
Physical
Physical
Reserved Ports 0 – 1023
Open Client Ports 1024 – 65535
4
Example of HTTP request
http://www.zoomgroup.com
HTTP Request
HTTP Request
Received HTTP Reply Listen on
http:// www.zoomgroup.com
http://www.zoomgroup.com Port 80
Webpage Sending HTTP Reply
Webpage
FTP Request
FTP Request
Received FTP Reply Listen on
ftp://ftp.microsoft.com
ftp://ftp.microsoft.com Port 21
Sending FTP Reply
HTTP 80
FTP 21
SMTP 25
TELNET 23
TFTP 69
9
Data flow from Application Layer
Application
Application Data
80 21 25 53 67 69
Presentation
Presentation
Session
Session
Transport
Transport
Network
Network
Data
Data Link
Link
Physical
Physical
10
Presentation Layer
Presentation Layer is
Application
Application responsible for converting data
into standard format.
Presentation
Presentation
Examples : ASCII, EBCDIC,
Session
Session JPEG, MPEG, BMP, MIDI, WAV,
MP3
Transport
Transport
Application
Application Data
Presentation
Presentation Data
Session
Session
Transport
Transport
Network
Network
Data
Data Link
Link
Physical
Physical
12
Session Layer
Transport
Transport
Examples :
Network
Network
RPC Remote Procedure Call
Data
Data Link
Link SQL Structured Query Language
NFS Network File System
Physical
Physical
13
Data flow from Session Layer
Application
Application Data
Presentation
Presentation Data
Session
Session Data
Transport
Transport
Network
Network
Data
Data Link
Link
Physical
Physical
14
Transport Layer
Transport Layer is
Application
Application responsible for end-to-end
connectivity. It is also known as
Presentation
Presentation the heart of OSI Layers.
Following tasks are performed at
Session
Session the Transport Layer : -
Transport
Transport
Transport
Transport • Identifying Service
Network
Network • Multiplexing & De-multiplexing
• Segmentation
Data
Data Link
Link
• Sequencing & Reassembling
Physical
Physical • Error Correction
• Flow Control
15
Identifying Service
TCP UDP
• Acknowledgement • No Acknowledgement
• Reliable • Unreliable
• Slower • Faster
16
Multiplexing & De-multiplexing
Application
Application
Presentation
Presentation
Session
Session
80 21 25 53 67 69
Transport
Transport
TCP - 6 UDP - 17
Network
Network
Data
Data Link
Link
Physical
Physical
17
Segmentation
A B
18
Sequencing & Reassembling
you
Hello! HowHow
You Hello! are ?
you
Are? Hello!
Hello!
How are How ?
you ? Hello!
You Hello!
How AreHow You? Are? are
A B
19
Sequencing & Reassembling
A B
20
Error Correction
Segment Missing
Hello! How are you ? Hello!
Hello!
How are
How are
you ? Hello! How Are You ? you ?
1/5 2/5 3/5 4/5 5/5
A B
21
Flow Control - Windowing
Ack-Rec- PC-A
PC-A
Ack.
Sending
3 Received
Received- can
can send
send 44 Segments
Segments
3-window
Sending 3-window
4-window
4 at
5-window at aa time
time to
to
PC-B
PC-B
A B
22
Data flow from Transport Layer
Application
Application Data
Presentation
Presentation Data
Session
Session Data
Transport TH
Segment
Data
Transport
Network
Network
Data
Data Link
Link
Physical
Physical
23
Network Layer
Network Layer is
Application
Application responsible for providing best
path for data to reach the
Presentation
Presentation destination. Logical Addressing
works on this layer. Router is a
Session
Session Network Layer device.
Transport
Transport It is divided into two parts
Network
Network • Routed Protocols
Network
Network
e.g. IP, IPX, Apple Talk.
Data
Data Link
Link • Routing Protocols
Physical
Physical e.g. RIP, IGRP, OSPF, EIGRP
24
Routed Protocols
Segment
Hello!
Hello!
How are
How are
you ?
Source IP
192.168.1.1
you ?
Destination
Segment IP
192.168.1.2
A B
192.168.1.1 192.168.1.2
25
Routing Protocols
www.zoomgroup.com
26
Data flow from Network Layer
Application
Application Data
Presentation
Presentation Data
Session
Session Data
Network
Network NHPacket
Segment
Data
Data Link
Link
Physical
Physical
27
Datalink Layer
Datalink Layer is
Application
Application divided into two Sub Layers :
Presentation
Presentation
• LLC – Logical Link Control
Session It talks about Wan protocols e.g.
Session
PPP, HDLC, Frame-relay
Transport
Transport
• MAC – Media Access Control
Network
Network It talks about Physical Address.
It is a 48 bit address i.e. 12 digit
Data
Data Link
Link Hexadecimal Number.
It is also responsible for Error
Physical
Physical Detection
Devices working on Data Link
Layer are Switch, Bridge, NIC.
28
Error Detection – CRC Check
Packet
PC-A
PC-A
CRC
CRC No. No. 33333
33333
Hello!
How are
PC-B
PC-B
Source MAC
you ? CRC
CRC No.
No. 11114
11114
00-20-18-C0-07-71
Error 33333
11114
46323
99434
43434
99323
55434
89696
22222
32434
00000
Detected
Error
Error Detected
Detected
Destination
Packet MAC
00-20-18-C0-07-72
For
For Error
Error Correction
Correction
Contact
Contact Source
Source Transport
Transport layer
layer
A B
192.168.1.1 192.168.1.2
00-20-18-C0-07-71 00-20-18-C0-07-72 29
Error Detection – CRC Check
Packet
Hello!
How are
Source MAC
00-20-18-C0-07-71
you ?
20202
11114
46323
99434
43434
99323
55434
89696
22222
32434
00000
Destination
Packet MAC
00-20-18-C0-07-72
A B
192.168.1.1 192.168.1.2
00-20-18-C0-07-71 00-20-18-C0-07-72 30
Data flow from Data Link Layer
Application
Application Data
Presentation
Presentation Data
Session
Session Data
Transport
Transport Segment
Data
Data Link
Link DH Frame
Packet DT
Physical
Physical
31
Physical Layer
Physical Layer is
Application
Application responsible for electrical,
mechanical and procedural checks.
Presentation
Presentation Data will be converted into Binary
(i.e) 0’s & 1’s. Data will be in the
Session
Session form of electrical pulses if it is
Coaxial or Twisted Pair cable and in
Transport
Transport the form of Light if it is Fiber Optic
Cable.
Network
Network
Devices working at Physical Layer
Data
Data Link
Link are Hubs, Repeaters, Cables,
Modems etc.
Physical
Physical
32
Physical Layer Example
Frame
Hello!
How are
you ?
1010101010101010
Frame
A 0101011010101010101010101
1010101101010101010101010
0101011010101010101010101 B
33
Data flow from Physical Layer
Application
Application Data
Presentation
Presentation Data
Session
Session Data
Transport
Transport Segment
Network
Network Packet
Physical
Physical Bits
34
Data Encapsulation & De-capsulation
A B
Presentation
Presentation Data Data Presentation
Presentation
Session
Session Data Data Session
Session
Transport
Transport
TH Data
Segment TH
Segment
Data TransportTH
Transport
Network
Network NHPacket
Segment NHPacket
Segment Network NH
Network
Data DHFrameDT
Packet DTFrameDH
Packet
Packet DH
DT
DataLink
Link DataLink
Data Link
Physical
Physical Bits Bits Physical
Physical
35
Comparing OSI with TCP/IP Layers
Application
Application
Presentation
Presentation Application
Application
Session
Session
Transport
Transport Transport
Transport
Network
Network Internet
Internet
Data
Data Link
Link Network
Network
Access
Access
Physical
Physical
36
37
Example of HTTP request
http://www.zoomgroup.com
38
ftp://ftp.microsoft.com
39
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.
C:\> telnet 192.168.1.150
Connecting .....
================================
Welcome to Hyderabad Router
================================
User Access Verification
password :
40
http://www.microsoft.com
41
http://mail.yahoo.com
xyz@yahoo.com
xyz
******
42