1
play

1 User Datagram Protocol (UDP) User Datagram Protocol (UDP) - PDF document

The primary primary (in (in principle principle unique unique) ) The role of Internet of Internet transport transport protocols protocols role


  1. The primary primary (in (in principle principle unique unique) ) The role of Internet of Internet transport transport protocols protocols role � ������ ��������������������� �������� ��� �������������� Lecture 2 Lecture 2- -bis. bis. �� ��������� ������� ������� ��� ������������ ����� � ��!����" ����#������������� � $�����%��� � �����"!�"�& � ���� ������ ������� ���������� ������� ������������� Internet Transport Internet Transport � ���������� ������� ���������������� ������������� Protocols Protocols httpd My app Transport As seen by the application developer Port As seen by the application developer layer 25 80 3211 ... point of view point of view Internet 131.175.15.1 IP address layer G. Bianchi, G. Neglia G. Bianchi, G. Neglia Transport Transport Layer Layer Protocols Protocols The Internet level level view view The Internet Entire network seen as a pipe Information units travelling in the network: IP packets Header IP IP Data src & dest IP addr Header transport Transport data src & dest ports ... Internet App prot Data header G. Bianchi, G. Neglia G. Bianchi, G. Neglia Transport Control Protocol (TCP) Transport Control Protocol (TCP) Where are port numbers? Where are port numbers? � connection oriented � TCP connections � reliable transfer service. � TCP functions App prot Data header � application addressing (ports) � error recovery (acks and retransmission) Transport Header � reordering (sequence numbers) � flow control Port Port TCP or UDP … Transport data src dest � congestion control Appl. Appl. TCP TCP IP Header IP IP IP Ipaddr Ipaddr prtc … IP Data src dest IP IP G. Bianchi, G. Neglia G. Bianchi, G. Neglia 1

  2. User Datagram Protocol (UDP) User Datagram Protocol (UDP) Services Provided Services Provided by by TCP TCP � Connectionless � Connection-oriented service: preliminary � UDP packets handshaking procedure creates a full duplex TCP � offers unreliable transfer service ( send connection and pray ). � UDP functions � Reliable transport service: communicating � application addressing (ports) processes can rely on TCP to deliver all the messages � error checking sent without error and in the proper order . proc proc � TCP does not provide: UDP UDP � a minimum transmission rate guaranteed (sending IP IP IP rate is regulated by TCP congestion control) IP IP � any sort of delay guarantees (the World Wide Wait …) G. Bianchi, G. Neglia G. Bianchi, G. Neglia UDP TCP UDP TCP Services Provided Provided by by UDP UDP Services � Connectionless � connection oriented � connectionless (no handshaking) � UDP packets � TCP connections � unreliable transfer � reliable transfer � arbitrary sending rate service service service � send and pray � all bytes sent are recv » no congestion control mechanism present � UDP functions � TCP functions � application addressing � application addressing � UDP minimalist lightweight service (ports) (ports) � error checking � error recovery (acks and model does not provide: retransmission) � any guarantee of reception, any guarantee of order � reordering (sequence � any guarantee on delay numbers) � flow control � congestion control G. Bianchi, G. Neglia G. Bianchi, G. Neglia Common Applications Applications and and Common related transport related transport Service Service Requirements Requirements Application-layer Underlying Application Data Loss Bandwidth Time sensitive? Application protocol Transport Protocol file transfer no loss elastic no electronic mail SMTP (RFC 821) TCP electronic mail no loss elastic no remote terminal Telnet (RTC 854) TCP access Web documents no loss elastic no Web HTTP (RFC 2068) TCP real-time loss- audio: few Kbps to 1Mbps yes: 100's of msec audio/video tolerant video: 10's Kbps to 5 Mbps file transfer FTP (RFC 959) TCP stored audio/video loss- same as interactive remote file yes: few seconds NFS UDP or TCP tolerant audio/video server loss- streaming Proprietary (e.g., Real interactive games few Kbps to 10's Kbps yes: 100's msecs UDP or TCP tolerant multimedia Networks) financial Internet proprietary (e.g. no loss elastic yes and no typically UDP applications telephony Vocaltec) G. Bianchi, G. Neglia G. Bianchi, G. Neglia 2

  3. A closer A closer look at look at applications applications: : The The Socket Socket Interface Interface Sockets in Unix OSs OSs Sockets in Unix (HTTP example (HTTP example) ) Client Server HTTP request � Just file descriptors (everything is a HTTP HTTP file in Unix!) Application Application Process Process � “stream sockets” using TCP HTTP response (Browser) (HTTP Daemon) � “datagram sockets” using UDP Socket Socket � Common I/O file functions: read() , write() TCP software TCP software TRANSPORT PROTOCOL � More powerful I/O functions: send() , (for HTTP: TCP) receive() � Other specific function: socket() , bind() , INTERNET connect() , listen() , accept() G. Bianchi, G. Neglia G. Bianchi, G. Neglia Why it it is is trivial trivial (!) (!) to to write write Why The application The application developer developer view view networking apps networking apps? ? � 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 INTERNET Process SW (a normal software program!) Send receive � 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! Socket: door to transport SW � reliable message transport when TCP used You’ll see JAVA example in the practice lectures � Segmentation performed by TCP transmitter � Receive buffer necessary to ensure proper packet’s order & reassembly G. Bianchi, G. Neglia G. Bianchi, G. Neglia An open question An open question A first hypothesis A first hypothesis � Socket: OS interface between the � one-to-one mapping application and the transport level � Ports: numbers in the transport header to identify the specific socket port # application � Which is the relation? � We focus on the server G. Bianchi, G. Neglia G. Bianchi, G. Neglia 3

  4. How How to to reach reach server server socket socket: : Trivial refinement Trivial refinement pair pair of IP of IP Address Address and and Port Port Number Number Proprietary � The socket is on a specific host, Mail srv Web srv app Socket Socket Socket � i.e. port# has a local meaning Port number: univocally Incoming Transport 25 80 3211 ... specifies SW process layer request within the node Internet IP address (univocally 131.175.15.1 layer specifies node) socket (IP address,port #) � (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 G. Bianchi, G. Neglia Demultiplexing Demultiplexing at at receiver receiver (1) Demultiplexing at Demultiplexing at receiver receiver (2) (1) (2) … … app app app app app app Transport SW UDP SW TCP SW IP SW IP SW Information entering app Information entering app http http http payload Software (managed by app http payload Software (managed by app IP packet IP packet header header Developer) Developer) Transport SW: checks segment; Transport SW: checks segment; Sends to application sw based on Sends to application sw based on Port # Transport data Port # Transport data Port number Port number Application demux Application demux IP SW: checks IP packet; IP SW: checks IP packet; Sends to transport sw Sends to transport sw IP addr IP Data IP addr IP Data selects whether UDP or TCP Transport demux Transport demux G. Bianchi, G. Neglia G. Bianchi, G. Neglia Remarks Remarks Does IP software know about Does IP software know about transport protocol? transport protocol? � When opening socket, needs to specify which transport to use! App prot � UDP port numbers are independent from Data header TCP ones! � This means that TCP looks at TCP ports, while UDP looks at UDP ones Transport Header � Normally (for pure convenience) port number = same meaning for TCP and UDP Port Port TCP or UDP … Transport data � if a well known service is offered by both TCP and UDP, the port number src dest is the same � if a well known (low port number) service is offered for one protocol only, IP Header the corresponding port for the other protocol is generally unused � BUT possibly the same port number has Ipaddr Ipaddr prtc … IP Data src dest different meaning for TCP and UDP…. � Details in RFC1700 or http://www.iana.org/assignments/port-numbers ��� G. Bianchi, G. Neglia G. Bianchi, G. Neglia 4

Recommend


More recommend