The Transport Layer
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
This critical layer provides communications services directly to distributed processes running on different hosts.
The Most Frequently Used Internet Transport Protocols
Transmission Control Protocol (TCP)
User Datagram Protocol (UDP)
TCP/IP Protocol Data Units (PDUs)
TCP/IP Concepts
TCP/IP Concepts – Data Flow
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
networklink
physical
data
data
TCP Applications
FTPclient
FTPserver
TCP control connection
port 21
TCP data connectionport 20
mailserver
useragent
useragent
useragent
mailserver
useragent
useragent
mailserver
useragent
SMTPSMTP
SMTPSMTP
SMTPSMTPPC runningPC running
ExplorerExplorer
Server Server runningrunning
Apache WebApache WebServerServer
Mac runningMac runningNavigatorNavigator
http request
http re
quest
http response
http re
sponse
Web browsing
File transfer
The transport level addressing
Network Service Access Point (NSAP): it is between the network and transport levels
Transport Service Access Point (Transport address, TSAP): it is between the transport and the application layers
Port Number = Application Selection Address (ASA)
Port
An abstraction, which is used by the transport protocols to take the difference among each addressee in a given host
The TCP/IP protocol identify the port with a small integer
The port equivalent to the Transport Selector (TSEL) in the transport layer of the OSI model
Assigned Port or Socket Number
Decimal Octal Description0-63 0-77 Network Wide Standard Function64-127 100-177 Hosts Specific Functions128-223 200-337 Reserved for Future Use224-255 340-377 Any Experimental Function
Some well-known port numbers
Port number Application
20 FTP control
21 FTP data
23 Telnet
25 SMTP (mail)
37 Timeserver
53 DNS (Domain Name Service)
80 HTTP
119 NNTP (Network News Transfer Protocol)
520 RIP/UDP routing information
Transport services and protocols
provide logical communication between application processes running on different hosts
transport protocols run in end systems
transport vs. network layer services: network layer: data transfer
between end systems (hosts) transport layer: data transfer
between processes Transport layer relies on
and enhances network layer services
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
logical end-end transport
The source and destination port in the client-server communication
Clienthost
Transport levelprotocol messages Server
hostSource port=xDest. port=80
Source port=80Dest. port=x
Transportlevel
protocol entity
Transportlayer
protocol entity
Socket, the realization of the port in the programming
socketdoor
TC Psend buffer
TC Preceive buffer
socketdoor
se g m e n t
applicationwrites data
applicationreads data
TCP is a transport level protocol, see later
applicationtransportnetwork
MP2
applicationtransportnetwork
Multiplexing/demultiplexing
Recall: segment - unit of data exchanged between transport layer entities aka TPDU: transport
protocol data unitreceiver
HtHn
Demultiplexing: delivering received segments to correct app layer processes
segment
segment Mapplicationtransportnetwork
P1M
M MP3 P4
segmentheader
application-layerdata
Transport level multiplexing
Internet
Host A
PA1, PA2, PA3 application processes Port1 Port2 Port3
Transport prot. entity
IP protocol entity
Network access protocol entity
Host C
PC1 application processes
Port1
Transport prot. entity
IP protocol entity
Network access protocol entity
Host B
PB1, PB2 application processes Port1 Port2
Transport prot. entity
IP protocol entity
Network access protocol entity
Multiplexing/demultiplexing: examples
host A server Bsource port: xdest. port: 23
source port:23dest. port: x
port use: simple telnet app
Web clienthost A
Webserver B
Web clienthost C
Source IP: CDest IP: B
source port: x
dest. port: 80
Source IP: CDest IP: B
source port: y
dest. port: 80
port use: Web server
Source IP: ADest IP: B
source port: x
dest. port: 80
Transmission Control Protocol (TCP)
Connection-oriented End-to-end reliability
Reliability: positive acknowledging It is intended for use as a highly reliable host-
to-host protocol between hosts in packet-switched computer communication networks,
and in interconnected systems of such networks
Flow control with sliding window protocol-adaptation to:
• round-trip time (RTT) or• available transmission velocity
higher-levelTCP
internet protocolcommunication network
Protocol Layering:Protocol Layering:
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581
Point-to-point: one sender, one receiver
Reliable transport using sliding window protocol
Flow controlled and congestion controlled
User Datagram Protocol (UDP)
The UDP gives the transport mechanism with the possible smallest overhead
Connection-less It carry out multiplexing/demultiplexing and
error check, only The delivery is not reliable The delivery is not ordered
Relation With Other Protocols
Application Layer(SMTP, FTP, HTTP, etc)
Transport Layer(TCP, UDP)
Internet Layer(IP, ICMP, ARP)
Network Interface Layer(Ethernet, X25, SLIP, PPP)
PHYSICAL NETWORKPHYSICAL NETWORK
TCP/IPSTACK
UDP: User Datagram Protocol [RFC 768]
“best effort” service, UDP segments may be: lost delivered out of order
to app connectionless:
no handshaking between UDP sender, receiver
each UDP segment handled independently of others
Why is there a UDP? no connection
establishment (which can add delay)
simple: no connection state at sender, receiver
small segment header no congestion control:
UDP can blast away and send data as fast as desired
UDP: more
often used for streaming multimedia apps loss tolerant rate sensitive
other UDP uses: DNS SNMP
reliable transfer over UDP: add reliability at application layer application-specific
error recover!
source port # dest port #
32 bits
Applicationdata
(message)
UDP segment format
length checksumLength, in
bytes of UDPsegment,including
header
UDP-based Error Check If sum of the whole 16-bit words of the received
UDP datagram equals to FFFFh, the datagram is probably error free
Calculation of the control sum: E.g. let the next 16-bit words: 0110111001110110
00101010101010100001111000101011
Their sum: 1011011101001011 (1st complement: all 0 are exchanged to 1 and vice versa) So we get the control sum: 0100100010110100 At the receiver side the sum of the whole 16-bit word plus
the control sum (possible carry bit is eliminated):1111111111111111=FFFFh
This error check is not very safe
Features of the Application of UDP
Small header overhead Non-controlled sending speed No connection establishing No connection state Lack of error control Lack of congestion protection Message carried by UDP restricted to
512 bytes, not counting the IP or UDP headers Longer message are truncated
Services provided by Internet transport protocols
TCP service: connection-oriented: setup
required between client, server
reliable transport between sending and receiving process
flow control: sender won’t overwhelm receiver
congestion control: throttle sender when network overloaded
does not provide: timing, minimum bandwidth guarantees
UDP service: unreliable data transfer
between sending and receiving process
does not provide: connection setup, reliability, flow control, congestion control, timing, or bandwidth guarantee
Q: Why is there a UDP?Why is there a UDP?
Application of the Transport Protocols
Application Application level protocol Transport protocol
routing protocol e.g. RIP UDP
domain name service DNS UDP
network management SNMP UDP
remote file service NFS UDP
file transfer FTP TCP
remote terminal access Telnet TCP
electronic-mail SMTP UDP, TCP
Internet based telephoning application dependent UDP
World Wide Web (WWW) HTTP TCP
streaming media handling application dependent UDP