37
1 Lecture #19: Transport Lecture #19: Transport Protocols. Elements and Protocols. Elements and Examples 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

Lecture #19: Transport Protocols. Elements and Examples

  • Upload
    clea

  • View
    57

  • Download
    0

Embed Size (px)

DESCRIPTION

Lecture #19: Transport Protocols. Elements and Examples. C o n t e n t s. OSI Transport Layer Transport Service Primitives Addressing Connection Control Transport Layer in Internet TCP Addressing TCP protocol UDP. 2. 4. 6. 9. 11. 12. 13. 18. OSI Transport Layer. - PowerPoint PPT Presentation

Citation preview

Page 1: Lecture #19: Transport Protocols. Elements and Examples

1

Lecture #19: Transport Lecture #19: Transport Protocols. Elements and Protocols. Elements and

ExamplesExamplesC o n t e n t s C o n t e n t s

OSI Transport LayerOSI Transport Layer

Transport Service PrimitivesTransport Service Primitives

AddressingAddressing

Connection ControlConnection Control

Transport Layer in InternetTransport Layer in Internet

TCP AddressingTCP Addressing

TCP protocolTCP protocol

UDPUDP

6

4

9

18

13

12

2

11

Page 2: Lecture #19: Transport Protocols. Elements and Examples

2

OSI Transport LayerOSI Transport LayerUser application 1 ...

Encryption/decryption

compression/expansion

Choice of syntax

Sessioncontrol

Session to transportmapping

Session management

Sessionsynch.

Layer and flowcontrol

Error recovery

Multiplexing

Connection control

Routing Addressing

Errorcontrol

Flowcontrol

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 layer6/1Functions 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-multiplexing (end-to-end) transport-connections onto network-

connections;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 end-to-end error detection and any necessary monitoring of the

quality of service; etc.quality of service; etc.

Page 3: Lecture #19: Transport Protocols. Elements and Examples

3

Services of the Transport Services of the Transport LayerLayer

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 address. The transport-service provides the means to establish, maintain and release transport-connections establish, maintain and release transport-connections (case the service is connection-oriented)(case the service is connection-oriented)

– duplex transmissionduplex transmission between a pair of transport addresses between a pair of transport addresses (one or more transport connection can be established (one or more transport connection can be established between the same pair of transport addresses)between the same pair of transport addresses)

– provides provides endpoint identifiersendpoint identifiers that distinguish the that distinguish the transport connection endpointstransport connection endpoints

– the the quality of servicequality of service provided on a transport connection provided on a transport connection depends on the service class requested by the session depends on the service class requested by the session entities (the selected quality of service is maintained entities (the selected quality of service is maintained throughout the lifetime of the transport connection)throughout the lifetime of the 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.

Page 4: Lecture #19: Transport Protocols. Elements and Examples

4

6/6

Transport services are provided by the Transport services are provided by the access access primitivesprimitives

Access primitives provide interface to user applications Access primitives provide interface to user applications and sessionsand 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 ) - standard data entity exchanged between transport peers.entity exchanged between transport peers. TPDU payload TPDU payload is packed with header in Network Layer packet. NL packet is cut is packed with header in Network Layer packet. NL packet is cut into Data Link Layer frames with frame’s headersinto Data Link Layer frames with frame’s headers

UNIX implementation of transport service primitivesUNIX implementation of transport service primitives: : as as any other interface in UNIX the network transport layer data has any other interface in UNIX the network transport layer data has filefile presentation established by presentation established by SOCKETSOCKET and assigned by BIND. and assigned by BIND. Unblocking Unblocking LISTENLISTEN allocates buffer for remote requests. allocates buffer for remote requests.

State-transition diagram of the transport layer State-transition diagram of the transport layer connection process:connection process:– event driven control; events: local execution of a event driven control; events: local execution of a

transport primitive or incoming packettransport primitive or incoming packet

Transport Service Transport Service PrimitivesPrimitives

6/3

6/4

6/5

Page 5: Lecture #19: Transport Protocols. Elements and Examples

5

Transport protocols implement transport layer Transport protocols implement transport layer

functionalityfunctionality

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 addressingsource/destination addressing (instead addressing by selection of (instead addressing by selection of

router’s outgoing line by the Network Layerrouter’s 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 --> special transport protocols for real-time and interactive

communicationscommunications

– dynamic allocation of connection’s buffersdynamic allocation of connection’s buffers as the number of connections as the number of connections

is not predefined (in contrast to the Network Layer where the number of is not predefined (in contrast to the Network Layer where the number of

input/output lines is fixed and static allocation of the buffer space is input/output lines is fixed and static allocation of the buffer space is

applicable).applicable).

Transport Protocol Transport Protocol ElementsElements

19/1

6/7

Page 6: Lecture #19: Transport Protocols. Elements and Examples

6

AddressingAddressing Addressing is based on Addressing is based on TSAPTSAP (Transport Service Access Point) that (Transport Service Access Point) that

corresponds to some port of a local process. TSAP is defined by pairscorresponds 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 (Network Layer SAP) is presented by IP address (or

another adequate addressing - AAL…)another adequate addressing - AAL…)

TSAP are multiple for any transport entity while NSAP are either one TSAP are multiple for any transport entity while NSAP are either one

or few in a machine/router or few in 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 application process on a remote machine requests connection to server’s

TSAP via its local TSAPTSAP via its local TSAP

– transport entities use the network link to process the communication transport entities use the network link to process the communication

request either as connection oriented service (session) or as request either as connection oriented service (session) or as

connectionless data deliveryconnectionless data delivery

6/8

Page 7: Lecture #19: Transport Protocols. Elements and Examples

7

AddressingAddressing Constant TSAP address servicesConstant TSAP address services Dynamic TSAP assignment to the service Dynamic TSAP assignment to the service

processesprocesses– 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 between a set

of server processes and remote client of server processes and remote client

processesprocesses

– the requested server is split out from the the requested server is split out from the

process server set and communicates process server set and communicates

autonomously to the client during the sessionautonomously to the client during the session

6/9

Page 8: Lecture #19: Transport Protocols. Elements and Examples

8

Classes of the transport Classes of the transport protocolprotocol

0 A Minimal functions

1 B Network error recovery

2 A Connection bonding

3 BNetwork error recovery,

connection bonding

4 CError detection and recovery,

connection bonding

Protocolclass

Networktype

Functions

Page 9: Lecture #19: Transport Protocols. Elements and Examples

9

Connection Connection EstablishmentEstablishment

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 - sequential number of the party - yy

• 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 initiatorrejected by the initiator

– delayed duplicate request and delayed duplicate delayed duplicate request and delayed duplicate

acknowledgeacknowledge: the initiator rejects the delayed request : the initiator rejects the delayed request

acknowledge as in previous case; the party rejects the acknowledge as in previous case; the party rejects the

delayed duplicate data-acknowledge because of imparity of delayed duplicate data-acknowledge because of imparity of

its sequential numberits sequential number

( (zz instead instead yy))

6/11c

6/11b

Page 10: Lecture #19: Transport Protocols. Elements and Examples

10

Connection ReleaseConnection Release•Asymmetric releaseAsymmetric release: connection release initiative of : connection release initiative of

any of the parties:any of the parties:

• simple and quicksimple and quick

• possible lost of datapossible lost of data

•Symmetric releaseSymmetric release

• treats the connection as two independent unidirectional treats the connection as two independent unidirectional

connections and release each of them separatelyconnections and release each of them separately

• no data lossesno data losses

• synchronization problem (synchronization problem (two-army problemtwo-army problem))

6/12

6/13

Page 11: Lecture #19: Transport Protocols. Elements and Examples

11

Transport Layer in Transport Layer in InternetInternet

• Connection-orientedConnection-oriented and and connectionless orientedconnectionless oriented

protocols in Internetprotocols in Internet

• TCP (Transport Control Protocol) features:TCP (Transport Control Protocol) features:

• connection oriented protocolconnection oriented protocol supporting end-to- supporting end-to-

end full-duplex byte stream over network links end full-duplex byte stream over network links

with losses and errorswith losses and errors

• upper interface to user processesupper interface to user processes or OS kernel or OS kernel

requestsrequests

• lower interface to IPlower interface to IP

• brakes user/OS data into IP datagrams of 1500-brakes user/OS data into IP datagrams of 1500-

64kB or restore the IP datagrams into upper level 64kB or restore the IP datagrams into upper level

byte stream byte stream

• controls the timeout periods, retransmission controls the timeout periods, retransmission

events, sequencing, etc, over the unreliable IP events, sequencing, etc, over the unreliable IP

transfertransfer

19/1

Page 12: Lecture #19: Transport Protocols. Elements and Examples

12

TCP addressingTCP addressing• Addressing based on Addressing based on socketssockets::

• 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 local portport (TSAP) - 16b (up to 64k ports addressing space) (TSAP) - 16b (up to 64k ports addressing space)

• a socket pair uniquely identifies a transport connection: a socket pair uniquely identifies a transport connection:

(socket1, socket2)(socket1, 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

Page 13: Lecture #19: Transport Protocols. Elements and Examples

13

TCP protocolTCP 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 Segmentation according the network properties

(user data stream can be split into smaller (user data stream can be split into smaller

segments or collected in larger ones).segments or collected in 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

connectionconnection• Sequence Number/Acknowledgement NumberSequence Number/Acknowledgement Number - 32b - 32b

(4G ) - the byte numbers in the stream (last received and (4G ) - the byte numbers in the stream (last received and

next expected) next expected)

6/24

Page 14: Lecture #19: Transport Protocols. Elements and Examples

14

TCP protocolTCP protocol• Segment Header Segment Header (cont.)(cont.)

• TCP header lengthTCP header length - (4b) - the header length in 32b - (4b) - the header length in 32b

words - up to 16 words of which 5 are standard header and words - up to 16 words of which 5 are standard header and

up to 11 are optional header wordsup to 11 are 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 : Urgent pointer in use. Urgent pointer is a facility that

points the urgent data field. Urgent data contains interrupt points the urgent data field. Urgent data contains interrupt

messages that are interpret by the upper levels but not by messages that are interpret by the upper levels but not by

TCP itselfTCP itself

• ACKACK: Valid Acknowledgement number. If ACK=0 the contents : Valid Acknowledgement number. If ACK=0 the contents

of the Acknowledgement number field is ignoredof the Acknowledgement number field is ignored

• PSHPSH: Pushed data indicator. “Pushed data” is data that has to : Pushed data indicator. “Pushed data” is data that has to

be delivered to the application layer without buffering (i.e. be delivered to the application layer without buffering (i.e.

without delay)without delay)

• RSTRST: Reset connection. Used in cases of host failure or refusal : Reset connection. Used in cases of host failure or refusal

of connection opening attempt of connection opening attempt

6/24

Page 15: Lecture #19: Transport Protocols. Elements and Examples

15

TCP protocolTCP protocol• Segment HeaderSegment Header - - Flags’ fieldFlags’ field (cont.) (cont.)

• SYNSYN: Establish connection. Connection request/replay indicator. : Establish connection. Connection request/replay indicator.

SYN=1 and ACK=0 means connection request (no piggybacked SYN=1 and ACK=0 means connection request (no piggybacked

acknowledgement) and SYN=1 and ACK=1 means connection acknowledgement) and SYN=1 and ACK=1 means connection

replay (acceptance) with a acknowledgement piggybacked in the replay (acceptance) with a acknowledgement piggybacked in the

same segment. SYN segments are ordered by the sequence same segment. SYN segments are ordered by the sequence

numbers in order to prevent delayed duplications. 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 transmission. FIN segments also are ordered by the sequence

numbers in order to prevent delayed duplications. numbers in order to prevent delayed duplications.

• Window size. Window size. 16b 16b - - Indicates the free buffer space of the Indicates the free buffer space of the

receiver after the last received byte (which is receiver after the last received byte (which is

Acknowledgement number - 1). The maximum buffer buffer Acknowledgement number - 1). The maximum buffer buffer

indicated is 64kB. 0 buffer space means temporarily to stop indicated is 64kB. 0 buffer space means temporarily to stop

data transmission to the receiver.data transmission to the receiver.• ChecksumChecksum. 16b - checksum over header, data and the . 16b - checksum over header, data and the

pseudoheader: (set of segment parameters)pseudoheader: (set of segment parameters)• pseudoheaderpseudoheader: : 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 (Note that

the control over IP addresses is not a functionality of TCP but of IP)the control over IP addresses is not a functionality of TCP but of IP)

6/25

6/24

Page 16: Lecture #19: Transport Protocols. Elements and Examples

16

TCP protocolTCP protocol

• Segment HeaderSegment Header (cont.) (cont.)

• Urgent pointer. Urgent pointer. 16b 16b - - Used in compination with URG Used in compination with URG

flag.flag.

• Header OptionsHeader Options. Variable length - optional extension of . Variable length - optional extension of

the header facilities e.g. maximum segment length. The the header facilities e.g. maximum segment length. The

segment length has to be compromised between the segment length has to be compromised between the

transmission effectiveness and the host/application transmission effectiveness and the host/application

requirements.requirements.

6/24

Page 17: Lecture #19: Transport Protocols. Elements and Examples

17

• TCP uses TCP uses 3-way handshaking3-way handshaking for connection for connection

establishment:establishment:• the server host (host2) waits for incoming having issued the server host (host2) waits for incoming having issued LISTEN LISTEN

or or ACCEPTACCEPT primitive primitive

• the client host (host1) issued the client host (host1) issued CONNECTCONNECT primitive specifying TSAP primitive specifying TSAP

by (IP addr., port) couple; the flags SYN=1, ACK=0by (IP addr., port) couple; the flags SYN=1, ACK=0

• the server host acknowledges the connection if there is active the server host acknowledges the connection if there is active

server process listening the specified portserver process listening the specified port

• simultaneous attempts simultaneous attempts to opento open connection lead to failure connection lead to failure

because of different sequence numbering (6/26b)because of different sequence numbering (6/26b)

• simultaneous attempts simultaneous attempts to closeto close connection are not in a collision; connection are not in a collision;

FIN segments are acknowledged (or timed-out) and the FIN segments are acknowledged (or timed-out) and the

connection is closedconnection 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 set of transitions (the transitions are invoced by

event/action pair)event/action pair)

6/27

TCP connection TCP connection managementmanagement

6/26

6/28

Page 18: Lecture #19: Transport Protocols. Elements and Examples

18

UDPUDP• UDP (User Datagram Protocol)UDP (User Datagram Protocol) implements implements

connectionless unreliable servicesconnectionless unreliable services of the of the

Transport LayerTransport Layer

• The establishment/release of the connection is The establishment/release of the connection is

skippedskipped

• 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 UDP checksum field over header, pseudoheader and

datadata

• UDPUDP is generally the protocol used in transmitting voice and is generally the protocol used in transmitting voice and

video across a network. In some video across a network. In some instant messengers/chatinstant messengers/chat

programs too.programs too.

6/34

Page 19: Lecture #19: Transport Protocols. Elements and Examples

19

Miscellaneous Transport Miscellaneous Transport protocolsprotocols

Stream Control Transmission ProtocolStream Control Transmission Protocol ( (SCTPSCTP))– RFC 4960RFC 4960 defines the protocol, with defines the protocol, with RFC 3286RFC 3286 providing providing

an introductory text.an introductory text.– Provides reliable, in-sequence transport of Provides reliable, in-sequence transport of message message

streamsstreams with congestion control. with congestion control.

Feature NameFeature Name TCPTCP UDPUDP SCTSCTPP

Connection orientedConnection oriented YesYes NoNo YesYes

Reliable transportReliable transport YesYes NoNo YesYes

Preserve message Preserve message boundaryboundary NoNo YesYes YesYes

Ordered deliveryOrdered delivery YesYes NoNo YesYes

Unordered deliveryUnordered delivery NoNo YesYes YesYes

Data checksumData checksum YesYes YesYes YesYes

Checksum size (bits)Checksum size (bits) 1616 1616 3232

Path MTUPath MTU YesYes NoNo YesYes

Congestion controlCongestion control YesYes NoNo YesYes

Multiple streamsMultiple streams NoNo NoNo YesYes

Multi-homing Multi-homing supportsupport NoNo NoNo YesYes

BundlingBundling NoNo NoNo YesYes

Page 20: Lecture #19: Transport Protocols. Elements and Examples

20

Real-time Transport ProtocolReal-time Transport Protocol ( (RTPRTP) defines a ) defines a standardized packet format for delivering audio and standardized packet format for delivering audio and video over the Internet. It was developed by the video over the Internet. It was developed by the Audio-Video Transport Working Group of the IETF Audio-Video Transport Working Group of the IETF and first published in 1996 as and first published in 1996 as RFC 1889RFC 1889 which was which was made obsolete in 2003 by made obsolete in 2003 by RFC 3550RFC 3550. Real time . Real time transport protocol can also be used in conjunction transport protocol can also be used in conjunction with with RSVPRSVP protocol which enhances the field of protocol which enhances the field of multimedia applications.multimedia applications.

Resource ReSerVation ProtocolResource ReSerVation Protocol ( (RSVPRSVP), ), described in described in RFC 2205RFC 2205. Designed to reserve . Designed to reserve resources across a network for an resources across a network for an integrated integrated services Internet (QoS)services Internet (QoS).."RSVP does not transport application data but is "RSVP does not transport application data but is rather an Internet control protocol, like ICMP, IGMP, rather an Internet control protocol, like ICMP, IGMP, or routing protocols.“or routing 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 scaling and robustness.with scaling and robustness.

Miscellaneous Transport protocols Miscellaneous Transport protocols (2)(2)

Page 21: Lecture #19: Transport Protocols. Elements and Examples

21

19/119/1

Page 22: Lecture #19: Transport Protocols. Elements and Examples

22

6/16/1

Page 23: Lecture #19: Transport Protocols. Elements and Examples

23

6/36/3

6/46/4

Page 24: Lecture #19: Transport Protocols. Elements and Examples

24

6/56/5

Page 25: Lecture #19: Transport Protocols. Elements and Examples

25

6/66/6

Page 26: Lecture #19: Transport Protocols. Elements and Examples

26

6/76/7

Page 27: Lecture #19: Transport Protocols. Elements and Examples

27

6/86/8

Page 28: Lecture #19: Transport Protocols. Elements and Examples

28

6/96/9

Page 29: Lecture #19: Transport Protocols. Elements and Examples

29

6/116/11

Page 30: Lecture #19: Transport Protocols. Elements and Examples

30

6/126/12

Page 31: Lecture #19: Transport Protocols. Elements and Examples

31

6/136/13

Page 32: Lecture #19: Transport Protocols. Elements and Examples

32

6/246/24

Page 33: Lecture #19: Transport Protocols. Elements and Examples

33

6/256/25

Page 34: Lecture #19: Transport Protocols. Elements and Examples

34

6/266/26

Page 35: Lecture #19: Transport Protocols. Elements and Examples

35

6/276/27

Page 36: Lecture #19: Transport Protocols. Elements and Examples

36

6/286/28

Page 37: Lecture #19: Transport Protocols. Elements and Examples

37

6/346/34