Chapter 2
Applications and
Layered Architectures
Network Layers & OSI
Reference Model
What is a Protocol?
l A protocol is a set of rules that govern
how two or more communicating entities
“in a layer” are to interact
l Messages that need to be exchanged
(handshake)
l Actions that are to be taken when a certain
event occurs, e.g. sending or receiving
messages, expiry of timers, …
The purpose of a protocol is to provide a service
to the layer above
What is a Protocol?
a human protocol and a computer network protocol
Hi TCP connection
request
Hi
TCP connection
Got the response
Get [Link]
time?
2:00 <file>
time
Layers
l A set of related communication functions
(protocols) that can be managed and grouped
together
l Application Layer: communications functions that
are used by application programs
l HTTP, DNS, SMTP (email)
l Transport Layer: end-to-end communications
between two processes in two end hosts
l TCP, User Datagram Protocol (UDP)
l Network Layer: node-to-node communications
between two end hosts
l Internet Protocol (IP)
Open Systems Interconnection
l By the 1970s every major computer vendor had
developed its own proprietary layered network
architecture
l Problem: computers from different vendors could
not be networked together
l Open Systems Interconnection (OSI) was an
international effort by the International Organization
for Standardization (ISO) to enable multivendor
computer interconnection
l proposed a layered network architecture
l Network architecture (software):
l Definition of all the layers
l Design of protocols for each layer
OSI Reference Model
l Describes a seven-layer (later became five) abstract
reference model for a network architecture
l Purpose of the reference model was to provide a
framework for the development of protocols
l Constitutes the basis for all Internet protocols we
have today
l In which layer (of abstraction) a protocol resides?
l Define APIs between neighboring layers: get service from
the layer below and offer service to the layer above
7-Layer OSI Reference Model
Application Application
End-to-End Protocols
Application Application
Layer Layer
Application Application
Levels of Abstraction
Presentation Presentation sec Msg
Layer
Layer Layer
Layer
Session Session
Layer Layer
Transport Transport 100s ms Segment
Layer Layer
Network Network Network Network 10s Packet
Layer Layer Layer Layer msec
Data Link Data Link Data Link Data Link
msec Frame
Layer Layer Layer Layer
Physical Physical Physical Physical µs Bit
Layer Layer Layer Layer
Communicating End Systems
Time Data
One or More Network Nodes Scale Unit
Why Layering?
l Layering simplifies the design, implementation, and
testing by partitioning overall communications
process into parts (layers)
l Modularity
l Layering provides flexibility for modifying and evolving
protocols and services without having to change other layers
l Separation of Concerns
l Protocol in each layer can be designed separately from
those in other layers
l Multiple Levels of Abstraction
l Different time scale, data unit and scope at each layer
l Monolithic non-layered architectures are complex,
inflexible and soon became obsolete
L1: Physical Layer
l Transfers bits across links (transmission
medium): wired or wireless
l Definition & specification of the physical
aspects of a communication link
l Mechanical: cable, plugs, pins...
l Electrical/optical: modulation, signal strength, voltage levels, bit
durations, …
l functional/procedural: how to activate, maintain, and deactivate
physical links…
l Twisted-pair cable, coaxial cable, optical fiber, radio,
infrared, free-space optics (FSO), millimeter wave, …
l e.g., Ethernet (wired LANs), DSL, IEEE 802.11 (Wi-Fi),
cable modem, telephone modems, Bluetooth (BT),…
L2: Data Link Layer
l Transfers frames over a direct connection (link)
l Groups bits into DL data unit (frames)
l Detection of bit errors; Retransmission of frames
l Activation, maintenance, & deactivation of data link
connections
l Medium access control (MAC) for broadcast
networks, e.g. LANs, wireless (Wi-Fi, Cellular, …)
l Flow control
frames
l e.g., Ethernet, Data Link Data Link
Layer Layer
IEEE 802.11, BT, … Physical bits Physical
Layer Layer
L3: Network Layer
l Transfers packets over multi-hop paths
and/or across multiple networks
l Addressing must scale to large networks
l IPv4 and then IPv6
l Nodes jointly execute a routing algorithm to
determine paths across the network
l Forwarding transfers packet across nodes
l Congestion control to deal with traffic surges
l e.g., Internet Protocol (IPv4 and IPv6)
Internetworking
Ethernet LAN
l Internetworking is part of network layer and provides
l l l l l l
transfer of packets across multiple possibly dissimilar
ATM
networks Network ATM
Switch
l Gateways (routers) direct packets across networks
ATM ATM
HSwitch Switch
ATM
H Switch
Net
Net 33
G
Net
Net 11 G
G
G
Net55
Net
H Net 2 G Net 4 G
H
G = gateway
H = host
L4: Transport Layer
l Transfers data end-to-end from a process in an end
host to a process in another end host
l Reliable stream transfer or quick-and-simple
single-block transfer
l Flow and congestion control
l Message segmentation and reassembly
l Connection setup, maintenance, and release, if CO
l e.g., TCP, UDP
Transport Transport
Layer Layer
Network Network Network Network
Layer Layer Layer Layer
Communication Network
L5: Application & Upper Layers
l Application Layer: provides
services that are frequently
required by applications: DNS, Application
Application
web access, file transfer, email… Application
Layer
l Presentation Layer: machine- Application
Layer
Presentation
independent representation of Transport
Layer
data… Layer
Session
l Session Layer: dialog Layer
management, recovery from Transport
Layer
errors, …
Incorporated into
Application Layer
Headers & Trailers
l Each protocol uses a header that carries addresses,
sequence numbers, flag bits, length indicators, etc…
l CRC check bits may be appended for error detection
Virtual Communications (peer process)
Application APP DATA Application
Application AH APP DATA Application
Layer Layer
Physical Communications
Physical Communications
Transport Transport
Layer TH AH APP DATA Layer
Network Network
Layer NH TH AH APP DATA Layer
Data Link Data Link
Layer DH NH TH AH APP DATA CRC Layer
Physical Physical
Layer
bits Layer
Encapsulation
TCP Header contains
source & destination HTTP Request
port numbers
IP Header contains
source and destination TCP
header HTTP Request
IP addresses;
transport protocol type
Ethernet Header contains
source & destination MAC IP TCP
header header HTTP Request
addresses;
network protocol type
Ethernet IP TCP
HTTP Request FCS
header header header
OSI Unified View: Protocols
l Layer n in one machine interacts with layer n in
another machine to provide a service to layer n +1
l The entities comprising the corresponding layers on
different machines are called peer processes
l The machines at layer n use a set of rules and
conventions called the layer-n protocol
l Layer-n peer processes communicate by
exchanging Protocol Data Units (PDUs)
n-PDUs
Layer Layer
n n
Layer n peer process (protocol)
TCP/IP Protocol Suite
HTTP SMTP DNS RTP
Distributed
applications User
Reliable
TCP UDP
stream datagram
service service
Best-effort (ICMP, ARP)
IP
connectionless
packet transfer
Network Network Network
interface 1 interface 2 interface 3
Diverse network technologies
Summary
l Layers: related communications functions
l Application Layer: HTTP, DNS
l Transport Layer: TCP, UDP
l Network Layer: IP
l Services: a protocol provides a
communications service to the layer above
l TCP provides connection-oriented reliable byte
transfer service
l UDP provides best-effort datagram service
l Each layer builds on services of lower layers
l HTTP builds on top of TCP
l DNS builds on top of UDP
l TCP and UDP build on top of IP