OSI Ref Model
OSI Ref Model
MODEL
OSI Model
Communication Architecture
Strategy for connecting host computers and other
communicating equipment.
Defines necessary elements for data communication
between devices.
A communication architecture, therefore, defines a
standard for the communicating hosts.
A programmer formats data in a manner defined by
the communication architecture and passes it on to
the communication software.
Separating communication functions adds flexibility,
for example, we do not need to modify the entire
host software to include more communication
devices.
Need For Protocol Architecture
• E.g. File transfer
—Source must activate comms. Path or inform network
of destination
—Source must check destination is prepared to receive
—File transfer application on source must check
destination file management system will accept and
store file for user
—May need file format translation
• Task broken into subtasks
• Implemented separately in layers in stack
• Functions needed in both systems
• Peer layers communicate
Protocol
2:00
<file>
4
Layered Tasks
An example from the everyday life
Hierarchy?
Services
5
Key Elements of a Protocol
• Syntax
—Data formats
—Signal levels
• Semantics
—Control information
—Error handling
• Timing
—Speed matching
—Sequencing
Simplified File Transfer Architecture
OSI Model
Layer Architecture
Layer architecture simplifies the network design.
It is easy to debug network applications in a layered
architecture network.
The network management is easier due to the
layered architecture.
Network layers follow a set of rules, called protocol.
The protocol defines the format of the data being
exchanged, and the control and timing for the
handshake between layers.
Standardized Protocol Architectures
• Required for devices to communicate
• Vendors have more marketable products
• Customers can insist on standards based
equipment
• Two standards:
—OSI Reference model
• Never lived up to early promises
—TCP/IP protocol suite
• Most widely used
OSI Model
14
Exchange using OSI Model
15
OSI Layers and Encapsulation
Application
Application Data Data Application
Header of
Application
Application Application
Layer
Layer AH Data Layer
Presentation Presentation
Layer
PH AH Data Layer
Session Session
Layer SH PH AH Data Layer
Transport Transport
Layer TH SH PH AH Data Layer
Physical Physical
Layer Bits Layer
17
OSI - The Layer Model
• Each layer performs a subset of the required
communication functions
• Each layer relies on the next lower layer to
perform more primitive functions
• Each layer provides services to the next higher
layer
• Changes in one layer should not require
changes in other layers
18
OSI Layers
OSI Model in a Switched
Communication Network
Node (Router)
Network
Application
Data Link
Presentation
Physical
Network Session
Application
Network Data Link Transport
Presentation
Data Link Physical Network
Session
Physical Data Link
Transport
Physical
Network
Data Link Network
Physical Data Link
Physical
Station (Host)
21
OSI Model
Physical Layer
Provides physical interface for transmission of
information.
23
Data Link Layer – Accessing the Media
• 2 basic services –
• Allows upper layers to access the media
• Controls how data is placed onto the media using media access
control and error detection
Data link layer terms
25
Formatting data for transmission
Network Layer
Implements routing of (packets) through the
network.
Provides services
to exchange data
over the network
between end
devices.
4 Processes:
Addressing
Encapsulation
Routing
Decapsulation
Network Layer protocols
Internet Protocol version 4 (IPv4) –most widely used
Internet Protocol version 6 (IPv6) –
Novell Internetwork Packet Exchange (IPX)
AppleTalk
Connectionless Network Service (CLNS/DECNet)
Network Layer Protocols and Internet Protocol (IP)
Source/Destination IP addresses get added at the
network layer (layer 3).
Network Layer Protocols and Internet Protocol (IP)
IP packet looks like this. Now let’s break down the 6
key fields.
6 key fields of IP header
IP source address – 32 bit ip address of the source host
IP destination address - 32 bit ip address of the destination host –
used to forward the packet by the router!
Time-to-live (TTL) – 8-bit binary that tells the ‘remaining life’ of the
packet. Countdown mechanism at each hop. When is reaches
zero (0), packet is dropped to prevent routing loops.
Type-of-service (ToS) – 8-bit binary used to determine the priority
of each packet. Different types of packets get processed at higher
priorities.
Protocol – indicates the data payload type carried in the packet.
01=ICMP, 06=TCP, 17=UDP, etc.
Fragment Offset – used in case a packet has to be split because
of changing media type to re-construct the packet at the
destination.
Transport Layer Role and Services
Transport layer
Purpose:
Track individual communication between applications on
source/destination hosts
Segment data and manage each piece of data – prepares it to
be sent across the network (network layer). Encapsulation is
required on each piece of data including information that will
allow that data to be tracked. WITHOUT SEGMENTATION, only
ONE application would be able to receive data.
Re-assemble segments back into streams of application data at
the receiving host. Prepares it to be passed back to the
application layer.
Identify the different applications using port numbers. Each
software process that needs to access the network is assigned
a port # that is unique in that host. Indicates which application
that piece of data is associated with.
Controlling conversations
Segmentation and reassembly – Transport layer divides
application data into blocks of data that are the appropriate
size. At the destination, the transport layer reassembles the
data before sending it up to the application or service.
Conversation multiplexing – Many applications or services
might be running on each host. Each is assigned a port # so
that the Transport layer can determine which application or
service is associated with that data.
TCP at the transport layer also provide
Connection-oriented conversations
Reliable/accurate delivery
Ordered data reconstruction
Flow control
Controlling Conversations (cont’d)
Establish a session – connection-oriented (TCP) or
connectionless (UDP)
Reliable delivery – ensures that all pieces reach their
destination by having the source device retransmit any
data that is lost
Same order delivery – numbering and sequencing
segments ensures the transport layer segments are
reassembled in the proper order
Flow control – hosts have limited resources (memory,
bandwidth, etc.) If these get over-taxed, transport layer
can request the flow of data be slowed. Why do this?
Prevent the receiver from being overwhelmed with data!
TCP & UDP protocols
Web browsers
File transfers
DNS
VoIP
Video
streaming
TCP vs. UDP - characteristics
UDP – Connectionless
Advantage – low overhead data delivery
pieces – datagrams
‘Best Effort’ delivery
Used by application that don’t require reliable delivery
Minimal delays
TCP – connection-oriented
More overhead
Same order delivery
Reliability
flow-control
Source vs. Destination Port #’s
Source ports –
Dynamically and randomly assigned by the originating device
from port #’s > 1023
Must not conflict with other ports in use at the time
Destination port
Port # assigned to the service daemon running on the remote
host
Must know which layer 4 protocol (TCP/UDP) and which
application (port #)
Many common applications have default port # assignments
Socket - combination of IP address and port #
192.168.100.48:80 would be HTTP on that IP address
Transport Layer Role and Services
IANA & Port #’s
IANA – Internet Assigned Numbers Authority – assign port
#’s
Port #’s
0-1023 – Well know ports reserved for services & applications
1024-49151 – registered ports assigned to user processes or
applications. May be used as a dynamically selected source port
49152-65535 – Dynamic or private ports (Ephemeral ports).
Port #’s (know these)
TCP TCP/UDP
20&21 – FTP 53 – DNS
23 – Telnet
161 – SNMP
25 – SMTP
80 – HTTP
110 – POP3
443 - HTTPS
UDP
69 – TFTP
520 – RIP
Netstat
Session Layer
Session layer provides mechanism for controlling the
dialogue between the two end systems. It defines how to
start, control and end conversations (called sessions)
between applications.
This layer requests for a logical connection to be
established on an end-user’s request.
Any necessary log-on or password validation is also
handled by this layer.
Session layer is also responsible for terminating the
connection.
This layer provides services like dialogue discipline
which can be full duplex or half duplex.
Session layer can also provide check-pointing
mechanism such that if a failure of some sort occurs
between checkpoints, all data can be retransmitted from
the last checkpoint.
OSI Model
Presentation Layer
Presentation layer defines the format in which the
data is to be exchanged between the two
communicating entities.
Also handles data compression and data encryption
(cryptography).
OSI Model
Application Layer
Application layer interacts with application
programs and is the highest level of OSI model.
Application layer contains management functions to
support distributed applications.
Examples of application layer are applications such
as file transfer, electronic mail, remote login etc.
OSI Model
OSI in Action
A message begins at the top
application layer and moves down
the OSI layers to the bottom
physical layer.
As the message descends, each
successive OSI model layer adds
a header to it.
A header is layer-specific
information that basically explains
what functions the layer carried
out.
Conversely, at the receiving end,
headers are striped from the
message as it travels up the
corresponding layers.