Principles of Networking
The TCP/IP Model
1
Why Another Model?
Although the OSI reference model is universally
recognized, the historical and technical open
standard of the Internet is Transmission Control
Protocol / Internet Protocol (TCP/IP).
The TCP/IP reference model and the TCP/IP
protocol stack make data communication possible
between any two computers, anywhere in the world,
at nearly the speed of light.
The U.S. Department of Defense (DoD) created the
TCP/IP reference model because it wanted a
network that could survive any conditions, even a
nuclear war.
2
Don’t Confuse the Models
7 Application
6 Presentation Application
5 Session
4 Transport Transport
3 Network Internet
2 Data Link Network
1 Physical Access
3
2 Models Side-By-Side
7 Application
6 Presentation Application
5 Session
4 Transport Transport
3 Network Internet
2 Data Link Network
1 Physical Access
4
The Application Layer
The application layer of the TCP/IP model handles:
High-level protocols
Issues of representation
Encoding
Dialog control
5
The Transport Layer
The transport layer provides transport services from the
source host to the destination host
It constitutes a logical connection between these endpoints of
the network
Transport protocols segment and reassemble upper-layer
applications into the same data stream between endpoints
The transport layer data stream provides end-to-end transport
services making sure the data arrives safely, in the right order, and without errors.
The Internet Layer
Addresses every device so
data knows where to go
The purpose of the Internet layer is to select the best path through
the network for packets to travel. The main protocol that functions at
this layer is the Internet Protocol (IP). Best path determination and
packet switching occur at this layer.
Splits data into chunks and sends them
Determines the best path for data to travel across networks.
7
The Network Access Layer
Manages the physical transmission of data over the network hardware.
The network access layer is also called the host-to-network layer
It the layer that is concerned with all of the issues that an IP packet
requires to actually make a physical link to the network media
It includes LAN and WAN details, and all the details contained in the
OSI physical and data-link layers
ARP & RARP work at both the Internet and Network Access Layers
8
Comparing TCP/IP & OSI Models
NOTE: TCP/IP transport layer using UDP does not always guarantee
reliable delivery of packets as the transport layer in the OSI model
does.
9
More on The Transport Layer
The transport layer provides transport services from the
source host to the destination host
It establishes a logical connection between the endpoints
of the network
Transport services include the following basic services:
Segmentation of upper-layer application data
Establishment of end-to-end operations
Transport of segments from one end host to another
end host
Flow control provided by sliding windows
Reliability provided by sequence numbers and
acknowledgments
10
Transport Layer Protocols
Transmission Control Protocol (TCP)
User Datagram Protocol (UDP)
TCP
Transmission Control Protocol (TCP) is a connection-
oriented Layer 4 protocol that provides reliable full-
duplex data transmission
TCP is part of the TCP/IP protocol stack. In a connection-oriented
environment, a connection is established between both ends before
the transfer of information can begin.
TCP is responsible for breaking messages into segments,
reassembling them at the destination station, resending anything that
is not received, and reassembling messages from the segments.
TCP supplies a virtual circuit between end-user applications.
The protocols that use TCP include:
• FTP (File Transfer Protocol)
• HTTP (Hypertext Transfer Protocol)
• SMTP (Simple Mail Transfer Protocol)
• Telnet
12
TCP Segment Format
13
TCP
UDP
User Datagram Protocol (UDP) is the connectionless
transport protocol in the TCP/IP protocol stack
UDP is a simple protocol that exchanges datagrams, without
acknowledgments or guaranteed delivery. Error processing and
retransmission must be handled by higher layer protocols.
UDP uses no windowing or acknowledgments so reliability, if
needed, is provided by application layer protocols. UDP is designed
for applications that do not need to put sequences of segments
together.
The protocols that use UDP include:
• TFTP (Trivial File Transfer Protocol)
• SNMP (Simple Network Management Protocol)
• DHCP (Dynamic Host Control Protocol)
• DNS (Domain Name System)
UDP Segment Format
16
UDP
Applications that use UDP
There are three types of applications that are best suited for UDP:
Live video and multimedia applications - These applications can
tolerate some data loss, but require little or no delay.
Simple request and reply applications - Applications with simple
transactions where a host sends a request and may or may not receive a
reply. Examples include DNS and DHCP.
Applications that handle reliability themselves - Unidirectional
communications where flow control, error detection, acknowledgments,
and error recovery is not required, or can be handled by the application.
Examples include SNMP and TFTP.
What transport service does an app need?
Data loss Throughput
some apps (e.g., audio) can some apps (e.g.,
tolerate some loss multimedia) require
other apps (e.g., file transfer, minimum amount of
telnet) require 100% reliable throughput to be
data transfer “effective”
other apps (“elastic apps”)
Timing make use of whatever
some apps (e.g., Internet throughput they get
telephony, interactive Security
games) require low delay encryption, data integrity,
to be “effective” …
Application 2-19
Transport service requirements of common
apps
Application Data loss Throughput Time Sensitive
file transfer no loss elastic no
e-mail no loss elastic no
Web documents no loss elastic no
real-time audio/video loss-tolerant audio: 5kbps-1Mbps yes, 100’s mse
video:10kbps-5Mbps
stored audio/video loss-tolerant same as above yes, few secs
interactive games loss-tolerant few kbps up yes, 100’s mse
instant messaging no loss elastic yes and no
Application 2-20
TCP vs UDP
Internet transport protocols services
TCP service: UDP service:
connection-oriented: setup required unreliable data transfer
between client and server between sending and receiving
processes process
reliable transport between sending does not provide: connection
and receiving process setup, reliability, flow control,
flow control: sender won’t congestion control, timing,
overwhelm receiver throughput guarantee, or
security
congestion control: throttle sender
when network overloaded
does not provide: timing, minimum Q: why bother? Why is there a
throughput guarantees, security UDP?
Application 2-22
Internet apps: application, transport protocols
Application Underlying
Application layer protocol transport protocol
e-mail SMTP [RFC 2821] TCP
remote terminal access Telnet [RFC 854] TCP
Web HTTP [RFC 2616] TCP
file transfer FTP [RFC 959] TCP
streaming multimedia HTTP (e.g., YouTube), TCP or UDP
RTP [RFC 1889]
Internet telephony SIP, RTP, proprietary
(e.g., Skype) typically UDP
Application 2-23
TCP Connection Establishment
Step 1. SYN : The initiating client requests a client-to-server
communication session with the server.
TCP Connection Establishment
Step 2. ACK and SYN :The server acknowledges the client-
to-server communication session and requests a server-to-
client communication session.
TCP Connection Establishment
Step 3. ACK :The initiating client acknowledges the server-
to-client communication session.
3-Way Handshake
TCP requires connection establishment before data transfer
begins
For a connection to be established or initialized, the two
hosts must synchronize their Initial Sequence Numbers
(ISNs)
27
Principles of Reliable data transfer
important in app., transport, link layers
top-10 list of important networking topics!
characteristics of unreliable channel will determine complexity of
reliable data transfer protocol (rdt)
3-
Transport Layer 28
Reliable data transfer in action
3-
Transport Layer 29
Reliable data transfer in action
Ignore ACK1
3-
Transport Layer 30
Basic Windowing
Data packets must be
delivered to the recipient in the
same order in which they were
transmitted to have a reliable,
connection-oriented data
transfer.
The protocol fails if any data
packets are lost, damaged,
duplicated, or received in a
different order.
An easy solution is to have a
recipient acknowledge the
receipt of each packet before
the next packet is sent.
31
Sliding Window
32
Sliding Window with Different Window Sizes
33