Post on 16-Mar-2016
description
User Datagram ProtocolUDP
Capitulo 11, TCP/IP Forouzan. McGraw Hill
Protocolos para capa transporte
TCP/IP especifica 2 protocolos para la capa de transporte: TCP y UDP.
Forouzan, cap. 11
Transport Layer
Funciones de la capa Transporte:
– Proveer mecanismos para lograr la comunicación “process-to-process”.
– Proveer mecanismos de control de flujo y errores.
UDP utiliza puertos para establecer comunicación process-to-process, pero no tiene mecanismo de control de flujo ni se lleva a cabo el acuse de recibo de los paquetes. Si provee un mecanismo de control de errores.
Por que UDP.
UDP es un protocolo no orientado a conexión, no ofrece muchos servicios de IP solo establece la comunicación process-to-process. Su mecanismo de control de errores es muy limitado.
Sin embargo, UDP es un protocolo muy simple, produce poco overhead, sirve para enviar pequeños mensajes y es muy útil para aplicaciones de tiempo real.
Comunicacion proceso-a-proceso Comunicacion host-to-host --> IP. Comunicacion process-to-process --> UDP.
Forouzan, cap. 11
PUERTOS Paradigma cliente-servidor. Ambientes multiusuarios y multiprogramas. Partes involucradas:
– Local host.– Local process.– Remote host.– Remote process.
Para identificar los procesos se utilizan puertos (en TCP/IP van de 0 a 65,535).
Tipos de puertos: “ephemeral” y “well-know”
Figure 11-3 Forouzan
Port numbers
Figure 11-4 Forouzan.
IP addresses versus port numbers
Figure 11-5 Forouzan
IANA ranges
Well-Known UDP Ports.
http://www.networksorcery.com/enp/protocol/ip/ports00000.htm
SOCKETS
UDP necesita 2 identicadores para establecer la conexion: la direccion IP y un numero de puerto. La combinacion de estos dos se llama: “Socket address”.
Por lo tanto se necesita un “client-socket” y un “server-socket”.
Figure 11-6 Forouzan
Socket addresses
Figure 11-7 Forouzan
User datagram format
Checksum
El calculo del checksum de UDP incluye:
– Pseudoheader (parte del header de IP que encapsula al datagrama).
– UDP header.
– Datos.
Figure 11-8
Pseudoheader added to the UDP datagram
Figure 11-9
Checksum calculation of a simple UDP user datagram
OPERACION
Conceptos involucrados en la operacion de UDP:
– Servicios no-orientados a conexion.– Control de flujo y error (nulo o muy simple).– Encapsulacion / Desencapsulacion.– Filas de espera.– Multiplexion / Demultiplexion.
Figure 11-10
Encapsulation and decapsulation
Figure 11-11
Queues in UDP
Figure 11-12
Multiplexing and demultiplexing
Figure 11-13
UDP package
StateState Process IDProcess ID Port NumberPort Number Queue Queue NumberNumber
---------------- ------------------------ ---------------------------- ------------------------IN-USE 2,345 52,010 34
IN-USE 3,422 52,011
FREE
IN-USE 4,652 52,012 38
FREE
Control-block table at the beginning
Example 1Example 1
The first activity is the arrival of a user datagram with destination port number 52,012. The input module searches for this port number and finds it. Queue number 38 has been assigned to this port, which means that the port has been previously used. The input module sends the data to queue 38. The control-block table does not change.
Example 2Example 2
After a few seconds, a process starts. It asks the operating system for a port number and is granted port number 52,014. Now the process sends its ID (4,978) and the port number to the control-block module to create an entry in the table. The module does not allocate a queue at this moment because no user datagrams have arrived for this destination.
StateState Process IDProcess ID Port NumberPort Number Queue Queue NumberNumber
---------------- ------------------------ ---------------------------- --------------------IN-USE 2,345 52,010 34
IN-USE 3,422 52,011
IN-USE 4,978 52,014
IN-USE 4,652 52,012 38
FREE
Modified table after Example 2
Example 3Example 3
A user datagram now arrives for port 52,011. The input module checks the table and finds that no queue has been allocated for this destination since this is the first time a user datagram has arrived for this destination. The module creates a queue and gives it a number (43).
StateState Process IDProcess ID Port NumberPort Number Queue Queue NumberNumber
---------------- ------------------------ ----------------------------------------------------------
IN-USE 2,345 52,010 34
IN-USE 3,422 52,011 43
IN-USE 4,978 52,014
IN-USE 4,652 52,012 38
FREE
Modified table after Example 3
Example 4Example 4
After a few seconds, a user datagram arrives for port 52,222. The input module checks the table and cannot find the entry for this destination. The user datagram is dropped and a request is made to ICMP to send an “unreachable port” message to the source.
Example 5Example 5
After a few seconds, a process needs to send a user datagram. It delivers the data to the output module which adds the UDP header and sends it.
Uso de UDP
En procesos que requieren comunicacion simple sin importar control de flujo y error.
En procesos que cuentan ya con mecanismos de control de flujo y error internos (TFTP).
Para multicast y broadcast.
Para procesos de administracion como SNMP.
Actualizaciones de rotocolos de ruteo (RIP).
TAREA
Leer capitulo 11, TCP/IP - Forouzan.