User Datagram Protocol UDP

31
User Datagram Protocol UDP Capitulo 11, TCP/IP Forouzan. McGraw Hill

description

User Datagram Protocol UDP. 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: - PowerPoint PPT Presentation

Transcript of User Datagram Protocol UDP

Page 1: User Datagram Protocol UDP

User Datagram ProtocolUDP

Capitulo 11, TCP/IP Forouzan. McGraw Hill

Page 2: User Datagram Protocol UDP

Protocolos para capa transporte

TCP/IP especifica 2 protocolos para la capa de transporte: TCP y UDP.

Forouzan, cap. 11

Page 3: User Datagram Protocol UDP

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.

Page 4: User Datagram Protocol UDP

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.

Page 5: User Datagram Protocol UDP

Comunicacion proceso-a-proceso Comunicacion host-to-host --> IP. Comunicacion process-to-process --> UDP.

Forouzan, cap. 11

Page 6: User Datagram Protocol UDP

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”

Page 7: User Datagram Protocol UDP

Figure 11-3 Forouzan

Port numbers

Page 8: User Datagram Protocol UDP

Figure 11-4 Forouzan.

IP addresses versus port numbers

Page 9: User Datagram Protocol UDP

Figure 11-5 Forouzan

IANA ranges

Page 10: User Datagram Protocol UDP

Well-Known UDP Ports.

http://www.networksorcery.com/enp/protocol/ip/ports00000.htm

Page 11: User Datagram Protocol UDP

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”.

Page 12: User Datagram Protocol UDP

Figure 11-6 Forouzan

Socket addresses

Page 13: User Datagram Protocol UDP

Figure 11-7 Forouzan

User datagram format

Page 14: User Datagram Protocol UDP

Checksum

El calculo del checksum de UDP incluye:

– Pseudoheader (parte del header de IP que encapsula al datagrama).

– UDP header.

– Datos.

Page 15: User Datagram Protocol UDP

Figure 11-8

Pseudoheader added to the UDP datagram

Page 16: User Datagram Protocol UDP

Figure 11-9

Checksum calculation of a simple UDP user datagram

Page 17: User Datagram Protocol UDP

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.

Page 18: User Datagram Protocol UDP

Figure 11-10

Encapsulation and decapsulation

Page 19: User Datagram Protocol UDP

Figure 11-11

Queues in UDP

Page 20: User Datagram Protocol UDP

Figure 11-12

Multiplexing and demultiplexing

Page 21: User Datagram Protocol UDP

Figure 11-13

UDP package

Page 22: User Datagram Protocol UDP

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

Page 23: User Datagram Protocol UDP

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.

Page 24: User Datagram Protocol UDP

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.

Page 25: User Datagram Protocol UDP

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

Page 26: User Datagram Protocol UDP

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).

Page 27: User Datagram Protocol UDP

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

Page 28: User Datagram Protocol UDP

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.

Page 29: User Datagram Protocol UDP

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.

Page 30: User Datagram Protocol UDP

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).

Page 31: User Datagram Protocol UDP

TAREA

Leer capitulo 11, TCP/IP - Forouzan.