1
Lecture #19: Transport Protocols.
Lecture #19: Transport Protocols.
Elements and Examples Elements and Examples
C o n t e n t s C o n t e n t s
OSI Transport Layer OSI Transport Layer
Transport Service Primitives Transport Service Primitives
Addressing Addressing
Connection Control Connection Control
Transport Layer in Internet Transport Layer in Internet
TCP Addressing TCP Addressing
TCP protocol TCP protocol
UDP UDP
6
4
9
18
13
12
2
11
2
OSI Transport Layer OSI Transport Layer
User application 1 ...
Encryption/
decryption
compression/
expansion
Choice of syntax Session
control
Session to transport mapping
Session management Session
synch.
Layer and flow control
Error recovery
Multiplexing
Connection control
Routing Addressing
Error control
Flow control Data link
establishment
Synch Framing
Access to transm. media
Physical and electrical interface
Activation/
deactivation of con.
Application layer Presentation layer
Session layer Transport layer
Network layer
Link layer
Physical layer
6/1
Functions within the transport layer may include:
Functions within the transport layer may include:
• mapping transport-address onto network-address;mapping transport-address onto network-address;
• multiplexing (end-to-end) transport-connections onto network-connections;multiplexing (end-to-end) transport-connections onto network-connections;
• establishment and release of transport-connections;establishment and release of transport-connections;
• end-to-end sequence control on individual connections;end-to-end sequence control on individual connections;
• end-to-end error detection and any necessary monitoring of the quality of end-to-end error detection and any necessary monitoring of the quality of service; etc.
service; etc.
3
Services of the Transport Layer Services of the Transport Layer
Services to the session (or application) layer:Services to the session (or application) layer:
– unique identificationunique identification of each session entity by its transport of each session entity by its transport
address. The transport-service provides the means to establish, address. The transport-service provides the means to establish, maintain and release transport-connections (case the service is maintain and release transport-connections (case the service is
connection-oriented) connection-oriented)
– duplex transmissionduplex transmission between a pair of transport addresses (one or between a pair of transport addresses (one or more transport connection can be established between the same more transport connection can be established between the same
pair of transport addresses) pair of transport addresses)
– provides provides endpoint identifiers that distinguish the transport endpoint identifiers that distinguish the transport connection endpoints
connection endpoints
– the the quality of servicequality of service provided on a transport connection depends provided on a transport connection depends on the service class requested by the session entities (the selected on the service class requested by the session entities (the selected
quality of service is maintained throughout the lifetime of the quality of service is maintained throughout the lifetime of the
transport connection) transport connection)
– the following services are provided by the transport layer:the following services are provided by the transport layer:
• transport-connection establishmenttransport-connection establishment
• data transferdata transfer
• transport-connection releasetransport-connection release
Transport service provider and transport service user.Transport service provider and transport service user.
4
6/6
Transport services are provided by the Transport services are provided by the access primitivesaccess primitives
Access primitives provide interface to user applications and Access primitives provide interface to user applications and sessions
sessions
Example set of transport service’s access primitivesExample set of transport service’s access primitives
Transport Protocol Data Unit (Transport Protocol Data Unit (TPDUTPDU) - standard data entity ) - standard data entity exchanged between transport peers.
exchanged between transport peers. TPDU payload is packed with TPDU payload is packed with header in Network Layer packet. NL packet is cut into Data Link Layer frames header in Network Layer packet. NL packet is cut into Data Link Layer frames with frame’s headers
with frame’s headers
UNIX implementation of transport service primitivesUNIX implementation of transport service primitives: : as any other as any other interface in UNIX the network transport layer data has
interface in UNIX the network transport layer data has filefile presentation presentation established by
established by SOCKETSOCKET and assigned by BIND. Unblocking and assigned by BIND. Unblocking LISTENLISTEN allocates allocates buffer for remote requests.
buffer for remote requests.
State-transition diagram of the transport layer connection State-transition diagram of the transport layer connection process:
process:
– event driven control; events: local execution of a event driven control; events: local execution of a transport primitive or incoming packet
transport primitive or incoming packet
Transport Service Primitives Transport Service Primitives
6/3 6/4
6/5
5
Transport protocols implement transport layer Transport protocols implement transport layer functionality
functionality
Example protocol hierarchy (TCP/IP model)Example protocol hierarchy (TCP/IP model)
Transport protocol environment:Transport protocol environment:
– host-to-host communicationhost-to-host communication over the subnet (instead the Network layer over the subnet (instead the Network layer communication between subnet components - routers, over data link) communication between subnet components - routers, over data link) – source/destination addressing (instead addressing by selection of router’s source/destination addressing (instead addressing by selection of router’s
outgoing line by the Network Layer outgoing line by the Network Layer
– possibility to store (and delay) packetspossibility to store (and delay) packets in the subnet by datagram model --> in the subnet by datagram model -->
special transport protocols for real-time and interactive communications special transport protocols for real-time and interactive communications
– dynamic allocation of connection’s buffersdynamic allocation of connection’s buffers as the number of connections is not as the number of connections is not predefined (in contrast to the Network Layer where the number of input/output predefined (in contrast to the Network Layer where the number of input/output lines is fixed and static allocation of the buffer space is applicable).
lines is fixed and static allocation of the buffer space is applicable).
Transport Protocol Transport Protocol
Elements Elements
19/1
6/7
Addressing Addressing
Addressing is based on TSAPAddressing is based on TSAP (Transport Service Access Point) that (Transport Service Access Point) that corresponds to some port of a local process. TSAP is defined by pairs corresponds to some port of a local process. TSAP is defined by pairs
((IP address, local portIP address, local port ii) )
where where NSAPNSAP (Network Layer SAP) is presented by IP address (or another (Network Layer SAP) is presented by IP address (or another adequate addressing - AAL…)
adequate addressing - AAL…)
TSAP are multiple for any transport entity while NSAP are either one or few in TSAP are multiple for any transport entity while NSAP are either one or few in a machine/router
a machine/router
Connection phases:Connection phases:
– server OS assigns a TSAP to an active server process upon its requestserver OS assigns a TSAP to an active server process upon its request
– application process on a remote machine requests connection to server’s TSAP via its application process on a remote machine requests connection to server’s TSAP via its local TSAP
local TSAP
– transport entities use the network link to process the communication request either transport entities use the network link to process the communication request either as connection oriented service (session) or as connectionless data delivery
as connection oriented service (session) or as connectionless data delivery
6/ 8
7
Addressing Addressing
Constant TSAP address services Constant TSAP address services
Dynamic TSAP assignment to the service Dynamic TSAP assignment to the service processes
processes
– Initial connection protocol by Initial connection protocol by process serverprocess server – process server acts as a process server acts as a proxyproxy between a set of between a set of
server processes and remote client processes server processes and remote client processes
– the requested server is split out from the process the requested server is split out from the process server set and communicates autonomously to the server set and communicates autonomously to the
client during the session client during the session
6/ 9
Classes of the transport protocol Classes of the transport protocol
0 A Minimal functions
1 B Network error recovery
2 A Connection bonding
3 B Network error recovery,
connection bonding
4 C Error detection and recovery, connection bonding
Protocol class
Network
type Functions
9
Connection Establishment Connection Establishment
6/11a
Three-way handshakingThree-way handshaking
– Normal operationNormal operation::
• control parameters:control parameters:
– sequential number of initiator - sequential number of initiator - xx – sequential number of the party - ysequential number of the party - y
• CR - connection request from initiating hostCR - connection request from initiating host
• ACK - connection accepted from ACK - connection accepted from
• Data transferData transfer
– delayed duplicate request TPDUdelayed duplicate request TPDU - the delayed request is - the delayed request is rejected by the initiator
rejected by the initiator
– delayed duplicate request and delayed duplicate acknowledgedelayed duplicate request and delayed duplicate acknowledge: : the initiator rejects the delayed request acknowledge as in
the initiator rejects the delayed request acknowledge as in previous case; the party rejects the delayed duplicate data- previous case; the party rejects the delayed duplicate data-
acknowledge because of imparity of its sequential number acknowledge because of imparity of its sequential number ( (z instead z instead yy))
6/11c
6/11b
Connection Release Connection Release
• Asymmetric releaseAsymmetric release: connection release initiative of any of the : connection release initiative of any of the parties:
parties:
• simple and quicksimple and quick
• possible lost of datapossible lost of data
• Symmetric releaseSymmetric release
• treats the connection as two independent unidirectional connections treats the connection as two independent unidirectional connections and release each of them separately
and release each of them separately
• no data lossesno data losses
• synchronization problem (synchronization problem (two-army problemtwo-army problem))
6/12
6/13
11
Transport Layer in Internet Transport Layer in Internet
• Connection-orientedConnection-oriented and and connectionless orientedconnectionless oriented protocols protocols in Internet
in Internet
• TCP (Transport Control Protocol) features:TCP (Transport Control Protocol) features:
• connection oriented protocolconnection oriented protocol supporting end-to-end full- supporting end-to-end full- duplex byte stream over network links with losses and duplex byte stream over network links with losses and
errors errors
• upper interface to user processesupper interface to user processes or OS kernel requests or OS kernel requests
• lower interface to IPlower interface to IP
• brakes user/OS data into IP datagrams of 1500-64kB or brakes user/OS data into IP datagrams of 1500-64kB or restore the IP datagrams into upper level byte stream restore the IP datagrams into upper level byte stream
• controls the timeout periods, retransmission events, controls the timeout periods, retransmission events, sequencing, etc, over the unreliable IP transfer
sequencing, etc, over the unreliable IP transfer
19/1
TCP addressing TCP addressing
• Addressing based on Addressing based on sockets:sockets:
• a socket unifies NSAP end TSAP a socket unifies NSAP end TSAP
• the socket number consists of:the socket number consists of:
• IP address (NSAP) - 4 bytesIP address (NSAP) - 4 bytes
• local portlocal port (TSAP) - 16b (up to 64k ports addressing space) (TSAP) - 16b (up to 64k ports addressing space)
• a socket pair uniquely identifies a transport connection: (socket1, a socket pair uniquely identifies a transport connection: (socket1, socket2)
socket2)
• several connections may ended in a common socketseveral connections may ended in a common socket
• socket calls from the OS:socket calls from the OS:
• port address space:port address space:
• 0 - 255 - 0 - 255 - well-known portswell-known ports::
7 - Echo; 13 - Daytime; 21 - FTP File Transfer; 23 - Telnet;
7 - Echo; 13 - Daytime; 21 - FTP File Transfer; 23 - Telnet;
49 - Login Host Protocol; 79 - Finger; 80 - World Wide Web 49 - Login Host Protocol; 79 - Finger; 80 - World Wide Web HTTP; 110 - Post Office Protocol - Version 3 (POP3)
HTTP; 110 - Post Office Protocol - Version 3 (POP3)
6/6
13
TCP protocol TCP protocol
• 32-bit numbering (0 - 4G) of the byte sequence32-bit numbering (0 - 4G) of the byte sequence
• TPDUs: segments TPDUs: segments
• Segmentation according the network properties (user data Segmentation according the network properties (user data stream can be split into smaller segments or collected in stream can be split into smaller segments or collected in
larger ones).
larger ones).
• Segment structureSegment structure::
• header (20B)header (20B)
• header optionsheader options
• data (optional, up to 64k)data (optional, up to 64k)
• Segment header:Segment header:
• 5 * 32-bit words5 * 32-bit words
• Source/DestinationSource/Destination port - 16b - local end points of the port - 16b - local end points of the connection
connection
• Sequence Number/Acknowledgement NumberSequence Number/Acknowledgement Number - 32b (4G ) - - 32b (4G ) - the byte numbers in the stream (last received and next expected) the byte numbers in the stream (last received and next expected)
6/24
14
TCP protocol TCP protocol
• Segment Header Segment Header (cont.)(cont.)
• TCP header lengthTCP header length - (4b) - the header length in 32b words - up - (4b) - the header length in 32b words - up to 16 words of which 5 are standard header and up to 11 are
to 16 words of which 5 are standard header and up to 11 are optional header words
optional header words
• reserved fieldreserved field of 6b (not used in TCP versions up to now) of 6b (not used in TCP versions up to now)
• 6 flags field6 flags field; the value 1 of the flags means respectively:; the value 1 of the flags means respectively:
• URGURG: Urgent pointer in use. Urgent pointer is a facility that points the : Urgent pointer in use. Urgent pointer is a facility that points the urgent data field. Urgent data contains interrupt messages that are urgent data field. Urgent data contains interrupt messages that are interpret by the upper levels but not by TCP itself
interpret by the upper levels but not by TCP itself
• ACK: Valid Acknowledgement number. If ACK=0 the contents of the ACK: Valid Acknowledgement number. If ACK=0 the contents of the Acknowledgement number field is ignored
Acknowledgement number field is ignored
• PSHPSH: Pushed data indicator. “Pushed data” is data that has to be : Pushed data indicator. “Pushed data” is data that has to be delivered to the application layer without buffering (i.e. without delay) delivered to the application layer without buffering (i.e. without delay)
• RST: Reset connection. Used in cases of host failure or refusal of RST: Reset connection. Used in cases of host failure or refusal of connection opening attempt
connection opening attempt
6/24
15
TCP protocol TCP protocol
• Segment HeaderSegment Header - Flags’ field - Flags’ field (cont.) (cont.)
• SYNSYN: Establish connection. Connection request/replay indicator. SYN=1 and : Establish connection. Connection request/replay indicator. SYN=1 and ACK=0 means connection request (no piggybacked acknowledgement) and ACK=0 means connection request (no piggybacked acknowledgement) and SYN=1 and ACK=1 means connection replay (acceptance) with a
SYN=1 and ACK=1 means connection replay (acceptance) with a
acknowledgement piggybacked in the same segment. SYN segments are acknowledgement piggybacked in the same segment. SYN segments are ordered by the sequence numbers in order to prevent delayed duplications.
ordered by the sequence numbers in order to prevent delayed duplications.
• FINFIN: Release connection request. The sender has finished the data : Release connection request. The sender has finished the data
transmission. FIN segments also are ordered by the sequence numbers in transmission. FIN segments also are ordered by the sequence numbers in order to prevent delayed duplications.
order to prevent delayed duplications.
• Window size. Window size. 16b - 16b - Indicates the free buffer space of the receiver Indicates the free buffer space of the receiver after the last received byte (which is Acknowledgement number - 1).
after the last received byte (which is Acknowledgement number - 1).
The maximum buffer buffer indicated is 64kB. 0 buffer space means The maximum buffer buffer indicated is 64kB. 0 buffer space means
temporarily to stop data transmission to the receiver.
temporarily to stop data transmission to the receiver.
• ChecksumChecksum. 16b - checksum over header, data and the pseudoheader: . 16b - checksum over header, data and the pseudoheader:
(set of segment parameters) (set of segment parameters)
• pseudoheader: pseudoheader: set of transmission parametersset of transmission parameters that includes that includes source/destination IP addresses and the segment length
source/destination IP addresses and the segment length (Note that the control (Note that the control over IP addresses is not a functionality of TCP but of IP)
over IP addresses is not a functionality of TCP but of IP)
6/25
6/24
TCP protocol TCP protocol
• Segment HeaderSegment Header (cont.) (cont.)
• Urgent pointer. Urgent pointer. 16b 16b - - Used in compination with URG flag.Used in compination with URG flag.
• Header OptionsHeader Options. Variable length - optional extension of the . Variable length - optional extension of the header facilities e.g. maximum segment length. The segment header facilities e.g. maximum segment length. The segment
length has to be compromised between the transmission length has to be compromised between the transmission
effectiveness and the host/application requirements.
effectiveness and the host/application requirements.
6/24
17
• TCP uses TCP uses 3-way handshaking3-way handshaking for connection establishment: for connection establishment:
• the server host (host2) waits for incoming having issued the server host (host2) waits for incoming having issued LISTEN LISTEN or or ACCEPT
ACCEPT primitive primitive
• the client host (host1) issued the client host (host1) issued CONNECTCONNECT primitive specifying TSAP by (IP primitive specifying TSAP by (IP addr., port) couple; the flags SYN=1, ACK=0
addr., port) couple; the flags SYN=1, ACK=0
• the server host acknowledges the connection if there is active server the server host acknowledges the connection if there is active server process listening the specified port
process listening the specified port
• simultaneous attempts simultaneous attempts to open connection lead to failure because of to open connection lead to failure because of different sequence numbering (6/26b)
different sequence numbering (6/26b)
• simultaneous attempts simultaneous attempts to closeto close connection are not in a collision; FIN connection are not in a collision; FIN segments are acknowledged (or timed-out) and the connection is closed segments are acknowledged (or timed-out) and the connection is closed
• Finite state-machine of a TCP connection:Finite state-machine of a TCP connection:
• set of statesset of states
• set of transitions (the transitions are invoced by event/action pair)set of transitions (the transitions are invoced by event/action pair)
6/27
TCP connection management TCP connection management
6/26
6/28
UDP UDP
• UDP (User Datagram Protocol)UDP (User Datagram Protocol) implements implements connectionless unreliable services
connectionless unreliable services of the Transport of the Transport Layer
Layer
• The establishment/release of the connection is skippedThe establishment/release of the connection is skipped
• UDP segmentUDP segment::
• 8B (2x32b words) header8B (2x32b words) header
• extends IP datagram with extends IP datagram with
• source/destination ports fieldssource/destination ports fields
• UDP segment length field (data + 8B header)UDP segment length field (data + 8B header)
• UDP checksum field over header, pseudoheader and dataUDP checksum field over header, pseudoheader and data
• UDPUDP is generally the protocol used in transmitting voice and video is generally the protocol used in transmitting voice and video across a network. In some
across a network. In some instant messengers/chat programs too.instant messengers/chat programs too.
6/34
19
Miscellaneous Transport protocols Miscellaneous Transport protocols
Stream Control Transmission Protocol Stream Control Transmission Protocol ( ( SCTP SCTP ) )
– RFC 4960RFC 4960 defines the protocol, with defines the protocol, with RFC 3286RFC 3286 providing an providing an introductory text.
introductory text.
– Provides reliable, in-sequence transport of Provides reliable, in-sequence transport of message message streams
streams with congestion control. with congestion control.
Feature Name
Feature Name TCPTCP UDPUDP SCTPSCTP Connection oriented
Connection oriented YesYes NoNo YesYes Reliable transport
Reliable transport YesYes NoNo YesYes Preserve message
Preserve message boundary
boundary NoNo YesYes YesYes Ordered delivery
Ordered delivery YesYes NoNo YesYes Unordered delivery
Unordered delivery NoNo YesYes YesYes Data checksum
Data checksum YesYes YesYes YesYes Checksum size (bits)
Checksum size (bits) 1616 1616 3232 Path MTU
Path MTU YesYes NoNo YesYes Congestion control
Congestion control YesYes NoNo YesYes Multiple streams
Multiple streams NoNo NoNo YesYes Multi-homing support
Multi-homing support NoNo NoNo YesYes Bundling
Bundling NoNo NoNo YesYes
20
Real-time Transport ProtocolReal-time Transport Protocol ( (RTPRTP) defines a ) defines a
standardized packet format for delivering audio and video standardized packet format for delivering audio and video
over the Internet. It was developed by the Audio-Video over the Internet. It was developed by the Audio-Video
Transport Working Group of the IETF and first published Transport Working Group of the IETF and first published
in 1996 as
in 1996 as RFC 1889RFC 1889 which was made obsolete in 2003 by which was made obsolete in 2003 by RFC 3550
RFC 3550. Real time transport protocol can also be used in . Real time transport protocol can also be used in conjunction with
conjunction with RSVPRSVP protocol which enhances the field protocol which enhances the field of multimedia applications.
of multimedia applications.
Resource ReSerVation ProtocolResource ReSerVation Protocol ( (RSVPRSVP), described in ), described in RFC 2205
RFC 2205. Designed to reserve resources across a network . Designed to reserve resources across a network for an
for an integrated services Internet (QoS)integrated services Internet (QoS)..
"RSVP does not transport application data but is rather an
"RSVP does not transport application data but is rather an Internet control protocol, like ICMP, IGMP, or routing
Internet control protocol, like ICMP, IGMP, or routing protocols.“
protocols.“
RSVP provides receiver-initiated setup of resource RSVP provides receiver-initiated setup of resource
reservations for
reservations for multicast or unicast data flowsmulticast or unicast data flows with with scaling and robustness.
scaling and robustness.
Miscellaneous Transport protocols (2)
Miscellaneous Transport protocols (2)
21
19/119/1
6/16/1
23
6/36/3
6/46/4
6/56/5
25
6/66/6
6/76/7
27
6/86/8
6/96/9
29
6/116/11
6/126/12
31
6/136/13
6/246/24
33
6/256/25
6/266/26
35
6/276/27
6/286/28
37
6/346/34