1CSIE,NTUT,TAIWAN
The OSI Model
and
TCP/IP Protocol Suite
Computer Science and Information Engineering
Spring 2004
Chuan-Ming Liu
CSIE,NTUT,TAIWAN 2
CONTENTS
THE OSI MODEL
LAYERS IN THE OSI MODEL
TCP/IP PROTOCOL SUITE
ADDRESSING
TCP/IP VERSIONS
CSIE,NTUT,TAIWAN 3
THE
OSI
MODEL
2.1
CSIE,NTUT,TAIWAN 4
Layering
Divide a task into pieces and then solve
each piece independently (or nearly so).
Establishing a well-defined interface
between layers makes porting easier,
Major Advantages:
Code Reuse
Extensibility
CSIE,NTUT,TAIWAN 5
Layering Example,Federal Express
Letter in envelope,address on outside
FedX guy adds addressing information,
barcode.
Local office drives to airport and delivers to
hub.
Sent via airplane to nearest city.
Delivered to right office
Delivered to right person
CSIE,NTUT,TAIWAN 6
Letter
FedX Layers
Letter Addressed
Envelope
Addressed
Envelope
CSIE,NTUT,TAIWAN 7
Layered Software Systems
Network software
Operating systems
Windowing systems
CSIE,NTUT,TAIWAN 8
Unix/Linux is a Layered System
Applications
Libraries
System Calls
Kernel
CSIE,NTUT,TAIWAN 9
OSI Model
Although the OSI model is a just a model (not a
specification),it is generally regarded as the
most complete model (as well it should be -
nearly all of the popular network protocol suites
in use today were developed before the OSI
model was defined).
CSIE,NTUT,TAIWAN 10
ISO is the organization,
OSI is the model.
CSIE,NTUT,TAIWAN 11
OSI <-> Network Software
Although this course is about network
programming (and not about networking in
general),an understanding of a complete
network model is essential.
CSIE,NTUT,TAIWAN 12
OSI 7 Layer Model
7 Application
6 Presentation
5 Session
4 Transport
3 Network
2 Data-Link
1 Physical
High level protocols
Low level protocols
CSIE,NTUT,TAIWAN 13
Simplified Network Model
Process
Transport
Network
Data Link
Process
Transport
Network
Data Link
Interface Protocols
Peer-to-peer
Protocols
CSIE,NTUT,TAIWAN 14
Interface and
Peer-to-peer
Protocols
Interface protocols describe the
communication between layers on the same
endpoint.
Peer-to-peer protocols describe
communication between peers at the same
layer.
Process
Transport
Network
Data Link
Process
Transport
Network
Data Link
Interface Protocols
Peer-to-peer
Protocols
CSIE,NTUT,TAIWAN 15Figure 2-2
OSI layers
CSIE,NTUT,TAIWAN 16
Headers are added
to the data at layers
6,5,4,3,and 2,
Trailers are usually
added only at layer 2.
CSIE,NTUT,TAIWAN 17Figure 2-3
An exchange using the OSI model
CSIE,NTUT,TAIWAN 18
LAYERS
IN
THE
OSI
MODEL
2.2
CSIE,NTUT,TAIWAN 19
Physical Layer
Coordinates the functions required to transmit
a bit stream over a physical medium
Concerns
– Physical characteristics of interfaces and medium
– Representation of bits
– Data rate (Transmission rate),bits/sec
– Synchronization of bits
CSIE,NTUT,TAIWAN 20
Physical Layer
– Line configuration
Point-to-point
Multipoint
– Physical topology
mesh,star,ring,or bus.
– Transmission mode
simplex,half-duplex,or full-duplex
CSIE,NTUT,TAIWAN 21Figure 2-4
Physical Layer
CSIE,NTUT,TAIWAN 22
Data Link Layer
Transforms the physical layer to a reliable link
Makes the physical layer appear error free to
upper layer
Responsible for
– Framing
frames
– Physical addressing (physical address)
Header defines the sender and/or receiver
Receiver is the device connected to the next
CSIE,NTUT,TAIWAN 23
Data Link Layer
– Flow control
– Error control
– Access control
Multi-home,computer having two or more NICs
CSIE,NTUT,TAIWAN 24Figure 2-5
Data Link Layer
CSIE,NTUT,TAIWAN 25Figure 2-6
Node-to-node delivery
CSIE,NTUT,TAIWAN 26
Network Layer
Responsible for the source-to-destination
delivery of a packet
Responsibilities:
– Logical addressing (IP address)
– Routing
CSIE,NTUT,TAIWAN 27Figure 2-7
Network Layer
CSIE,NTUT,TAIWAN 28Figure 2-8
End-to-end delivery
CSIE,NTUT,TAIWAN 29
Transport Layer
Source-to-destination (end-to-end) delivery of
the entire message
Functions include:
– Service-point addressing (port)
– Segmentation and reassembly
– Connection control
connectionless v.s,connection-oriented
– Flow control
– Error control
CSIE,NTUT,TAIWAN 30Figure 2-9
Transport Layer
CSIE,NTUT,TAIWAN 31Figure 2-10
Reliable end-to-end delivery of a message
CSIE,NTUT,TAIWAN 32
Session Layer
Network dialog controller
establishes,maintains,and synchronizes the
interaction between communicating systems
Functions include:
– Dialog control
– Synchronization (checkpoint)
CSIE,NTUT,TAIWAN 33Figure 2-11
Session Layer
CSIE,NTUT,TAIWAN 34
Presentation Layer
Concerned with the syntax an semantics of the
information exchanged between two systems
Responsibilities include
– Translation
– Encryption
– Compression
CSIE,NTUT,TAIWAN 35Figure 2-12
Presentation Layer
CSIE,NTUT,TAIWAN 36
Application Layer
Interface for users to access the network
Services include
– Network virtual terminal
– File transfer,access,and management (FTAM)
– Mail services
– Directory services
CSIE,NTUT,TAIWAN 37Figure 2-13
Application Layer
CSIE,NTUT,TAIWAN 38Figure 2-14
Summary of layers
CSIE,NTUT,TAIWAN 39
TCP/IP
PROTOCOL
SUITE
2.3
CSIE,NTUT,TAIWAN 40
TCP/IP Protocol Suite
Physical Layer
Data link Layer
Network Layer
Transport Layer
Application Layer
No specific protocol defined in physical and
data link layers
Correspond to OSI model
Last three layers in OSI
CSIE,NTUT,TAIWAN 41Figure 2-15
TCP/IP and OSI model
CSIE,NTUT,TAIWAN 42
Network Layer
Internetwork layer
Support
– IP,Internetworking Protocol
– ARP,Address Resolution Protocol
– RARP,Reverse Address Resolution Protocol
– ICMP,Internet Control Message Protocol
– IGMP,Internet Group Message protocol
CSIE,NTUT,TAIWAN 43
Internetworking Protocol (IP)
Transmission mechanism
Datagram,data unit to be sent in IP
Unreliable and connectionless
Best-effort delivery service
Host-to-host protocol
CSIE,NTUT,TAIWAN 44
Transport Layer
TCP and UDP,delivery of a message from a
process to another process
User Datagram Protocol (UDP)
Transmission Control Protocol (TCP)
CSIE,NTUT,TAIWAN 45
ADDRESSING
2.4
CSIE,NTUT,TAIWAN 46Figure 2-16
Addresses in TCP/IP
CSIE,NTUT,TAIWAN 47Figure 2-17
Relation-
ship
of
layers
and
addresses
in TCP/IP
CSIE,NTUT,TAIWAN 48Figure 2-18
Figure 2.18 shows an example of physical
addresses,
Example 1
CSIE,NTUT,TAIWAN 49
Example 2
Most local area networks use a 48-bit (6
bytes) physical address written as 12
hexadecimal digits,with every 2 bytes
separated by a hyphen as shown below:
07-01-02-01-2C-4B
A 6-byte (12 hexadecimal digits) physical address
CSIE,NTUT,TAIWAN 50Figure 2-19
IP addresses
CSIE,NTUT,TAIWAN 51
Example 4
As we will see in Chapter 4,an Internet
address (in IPv4) is 32 bits in length,
normally written as four decimal numbers,
with each number representing 1 byte,The
numbers are separated by a dot,Below is an
example of such an address.
132.24.75.9
CSIE,NTUT,TAIWAN 52Figure 2-20
Port addresses
CSIE,NTUT,TAIWAN 53
Example 6
As we will see in Chapters 11 and 12,a port
address is a 16-bit address represented by
one decimal number as shown below.
753 A 16-bit port address
CSIE,NTUT,TAIWAN 54
TCP/IP
VERSIONS
2.5
CSIE,NTUT,TAIWAN 55
Versions:
Version 4 (current)
Version 5
Version 6 (future)