1
play

1 Transport Layer Layer Protocols Protocols Transport Entire - PDF document

Lecture 2 Lecture 2- -bis. bis. Internet Transport Internet Transport Protocols Protocols As seen by the application developer As seen by the application developer point of view point of view G. Bianchi, G. Neglia The primary primary


  1. Lecture 2 Lecture 2- -bis. bis. Internet Transport Internet Transport Protocols Protocols As seen by the application developer As seen by the application developer point of view point of view G. Bianchi, G. Neglia The primary primary (in (in principle principle unique unique) ) The role of Internet of Internet transport transport protocols protocols role � ������ ��������������������� �������� ��� �������������� �� ��������� ������� ������� ��� ������������ ����� � ��!����" ����#������������� � $�����%��� � �����"!�"�& � ���� ������ ������� ���������� ������� ������������� � ���������� ������� ���������������� ������������� httpd My app Transport Port layer 25 80 3211 ... Internet 131.175.15.1 IP address layer G. Bianchi, G. Neglia 1

  2. Transport Layer Layer Protocols Protocols Transport Entire network seen as a pipe ... Internet G. Bianchi, G. Neglia The Internet level level view view The Internet Information units travelling in the network: IP packets Header IP IP Data src & dest IP addr Header transport Transport data src & dest ports App prot Data header G. Bianchi, G. Neglia 2

  3. Where are port numbers? Where are port numbers? App prot Data header Transport Header Port Port TCP or UDP … Transport data src dest IP Header Ipaddr Ipaddr prtc … IP Data src dest G. Bianchi, G. Neglia Transport Control Protocol (TCP) Transport Control Protocol (TCP) � connection oriented � TCP connections � reliable transfer service. � TCP functions � application addressing (ports) � error recovery (acks and retransmission) � reordering (sequence numbers) � flow control � congestion control Appl. Appl. TCP TCP IP IP IP IP IP G. Bianchi, G. Neglia 3

  4. Services Provided Provided by by TCP TCP Services � Connection-oriented service: preliminary handshaking procedure creates a full duplex TCP connection � Reliable transport service: communicating processes can rely on TCP to deliver all the messages sent without error and in the proper order . � TCP does not provide: � a minimum transmission rate guaranteed (sending rate is regulated by TCP congestion control) � any sort of delay guarantees (the World Wide Wait …) G. Bianchi, G. Neglia User Datagram Protocol (UDP) User Datagram Protocol (UDP) � Connectionless � UDP packets � offers unreliable transfer service ( send and pray ). � UDP functions � application addressing (ports) � error checking proc proc UDP UDP IP IP IP IP IP G. Bianchi, G. Neglia 4

  5. Services Provided Provided by by UDP UDP Services � connectionless (no handshaking) � arbitrary sending rate service » no congestion control mechanism present � UDP minimalist lightweight service model does not provide: � any guarantee of reception, any guarantee of order � any guarantee on delay G. Bianchi, G. Neglia UDP TCP UDP TCP � Connectionless � connection oriented � UDP packets � TCP connections � unreliable transfer � reliable transfer service service � send and pray � all bytes sent are recv � UDP functions � TCP functions � application addressing � application addressing (ports) (ports) � error checking � error recovery (acks and retransmission) � reordering (sequence numbers) � flow control � congestion control G. Bianchi, G. Neglia 5

  6. Service Requirements Requirements Service Application Data Loss Bandwidth Time sensitive? file transfer no loss elastic no electronic mail no loss elastic no Web documents no loss elastic no real-time loss- audio: few Kbps to 1Mbps yes: 100's of msec audio/video tolerant video: 10's Kbps to 5 Mbps stored audio/video loss- same as interactive yes: few seconds tolerant audio/video loss- interactive games few Kbps to 10's Kbps yes: 100's msecs tolerant financial no loss elastic yes and no applications G. Bianchi, G. Neglia Common Applications Applications and and Common related transport transport related Application-layer Underlying Application protocol Transport Protocol electronic mail SMTP (RFC 821) TCP remote terminal Telnet (RTC 854) TCP access Web HTTP (RFC 2068) TCP file transfer FTP (RFC 959) TCP remote file NFS UDP or TCP server streaming Proprietary (e.g., Real UDP or TCP multimedia Networks) Internet proprietary (e.g. typically UDP telephony Vocaltec) G. Bianchi, G. Neglia 6

  7. A closer A closer look at look at applications applications: : The Socket Socket Interface Interface The (HTTP example (HTTP example) ) Client Server HTTP request HTTP HTTP Application Application Process Process HTTP response (Browser) (HTTP Daemon) Socket Socket TCP software TCP software TRANSPORT PROTOCOL (for HTTP: TCP) INTERNET G. Bianchi, G. Neglia Sockets in Unix OSs OSs Sockets in Unix � Just file descriptors (everything is a file in Unix!) � “stream sockets” using TCP � “datagram sockets” using UDP � Common I/O file functions: read() , write() � More powerful I/O functions: send() , receive() � Other specific function: socket() , bind() , connect() , listen() , accept() G. Bianchi, G. Neglia 7

  8. The The application application developer developer view view � the only mean for apps to send/receive messages is through sockets � “doors” that hide transportation infrastructure to processes � Very limited control on transport protocol (buffer sizing, variables) Application Process SW (a normal software program!) Send receive Socket: door to transport SW G. Bianchi, G. Neglia Why it it is is trivial trivial (!) (!) to to write write Why networking apps apps? ? networking INTERNET � Application software duties: � open socket (e.g. C, C++, JAVA function call, OS call, external library primitive) � Injects message in its own socket � being confident message is received on the other side � TCP software: in charge of managing segments! � reliable message transport when TCP used � Segmentation performed by TCP transmitter � Receive buffer necessary to ensure proper packet’s order & reassembly G. Bianchi, G. Neglia 8

  9. An open question An open question � Socket: OS interface between the application and the transport level � Ports: numbers in the transport header to identify the specific application � Which is the relation? � We focus on the server G. Bianchi, G. Neglia A first hypothesis A first hypothesis � one-to-one mapping socket port # G. Bianchi, G. Neglia 9

  10. Trivial refinement Trivial refinement � The socket is on a specific host, � i.e. port# has a local meaning socket (IP address,port #) G. Bianchi, G. Neglia How to to reach reach server server socket socket: : How pair of IP of IP Address Address and and Port Port Number Number pair Proprietary Mail srv Web srv app Socket Socket Socket Port number: univocally Transport Incoming 25 80 3211 ... specifies SW process layer request within the node Internet IP address (univocally 131.175.15.1 layer specifies node) � (IP,port): a unique identification of an application layer service to which requests need to be sent � The first contact needs well known port # G. Bianchi, G. Neglia 10

  11. Demultiplexing Demultiplexing at at receiver receiver (1) (1) … app app app Transport SW IP SW Information entering app http Software (managed by app http payload IP packet header Developer) Transport SW: checks segment; Sends to application sw based on Port # Transport data Port number Application demux IP SW: checks IP packet; Sends to transport sw IP addr IP Data Transport demux G. Bianchi, G. Neglia Demultiplexing at at receiver receiver (2) Demultiplexing (2) … app app app UDP SW TCP SW IP SW Information entering app http Software (managed by app http payload IP packet header Developer) Transport SW: checks segment; Sends to application sw based on Port # Transport data Port number Application demux IP SW: checks IP packet; Sends to transport sw IP addr IP Data selects whether UDP or TCP Transport demux G. Bianchi, G. Neglia 11

  12. Does IP software know about Does IP software know about transport protocol? transport protocol? App prot Data header Transport Header Port Port TCP or UDP … Transport data src dest IP Header Ipaddr Ipaddr prtc … IP Data src dest ��� G. Bianchi, G. Neglia Remarks Remarks � When opening socket, needs to specify which transport to use! � UDP port numbers are independent from TCP ones! � This means that TCP looks at TCP ports, while UDP looks at UDP ones � Normally (for pure convenience) port number = same meaning for TCP and UDP � if a well known service is offered by both TCP and UDP, the port number is the same � if a well known (low port number) service is offered for one protocol only, the corresponding port for the other protocol is generally unused � BUT possibly the same port number has different meaning for TCP and UDP…. � Details in RFC1700 or http://www.iana.org/assignments/port-numbers G. Bianchi, G. Neglia 12

Recommend


More recommend