UDP : User Datagram Protocol

11
1 UDP : User Datagram Protocol Computer Network System Sirak Kaewjamnong

description

UDP : User Datagram Protocol. Computer Network System Sirak Kaewjamnong. UDP : User Datagram Protocol. RFC 768 connectionless protocol (no connection establishment) provide unreliable service use socket as TCP. UDP Encapsulation. With Ethernet frame protocol type in IP header = 17. - PowerPoint PPT Presentation

Transcript of UDP : User Datagram Protocol

Page 1: UDP : User Datagram Protocol

1

UDP : User Datagram Protocol

Computer Network SystemSirak Kaewjamnong

Page 2: UDP : User Datagram Protocol

2

UDP : User Datagram Protocol

• RFC 768• connectionless protocol (no

connection establishment)• provide unreliable service• use socket as TCP

Page 3: UDP : User Datagram Protocol

3

UDP Encapsulation

• With Ethernet frame

protocol type in IP header = 17

Ethernet headerIP headerUDP header data

UDP datagram

Page 4: UDP : User Datagram Protocol

4

Ports

• Port : A 16 bits address allocated for the most common application level service

• UDP and TCP use port addressing to deliver information to applications

• Service are known by port number–FTP 20, TELNET 23, SMTP 25, HTTP 80

Page 5: UDP : User Datagram Protocol

5

Ports

• Port numbers are generally allocated by

•0 not used•1- 255 Reserves port to well known service

•256 - 1023 Other reserve port•1024 - 65535 user defined server ports

• UNIX store general used ports in /etc/service

Page 6: UDP : User Datagram Protocol

6

Sockets

• Socket : a pair of the IP address and the port number

172.28.80.96, 5160• IP address is a unique to a node, the

port is unique on a nodethe socket gives a unique identification of an application layer service

IP address Port number

Page 7: UDP : User Datagram Protocol

7

Socket Address

• A connections identified by the socket address at its to ends– client socket :

172.28.80.96,3000; 192.168.100.3 ,21

– server socket : 192.168.100.3,21 ; 172.28.80.96,3000

IP 172.28.80.96

Client port: 3000

IP 192.168.100.3

Server port: 21connection

Page 8: UDP : User Datagram Protocol

8

UDP Format

• 16Source and destination port : iiiiii, 1 6ii iiiiiiiiiiii ii iiii ii iii iiiiiiiiii

• 16length: - length of datagram including heiiii iii iiii

• 16checksum : - iii iiii iii ii iiiiii ’iii iiii iiiiiiiii iiiiii iiii

Source port :16Destination port: 16

UDP length :16Checksum : 16data

0 15 16 31

Page 9: UDP : User Datagram Protocol

9

UDP Pseudo Header

0 7 8 15 16 31

Source IP address : 32Destination IP address : 32

Zero:8Protocol : 8UDP length :16Source port : 16Destination port : 16UDP length : 16Checksum : 16

Data….

Pseudo header

UDP header

Page 10: UDP : User Datagram Protocol

10

UDP Pseudo Header

• Include destination for double checking that destination is correct

• if datagrams be an odd number of bytes, UDP append a pad byte of 0, just for computation

• 0 indicates no checksum (checksum disable)

• if compute checksum is 0, it stores as all one bits (65,535)

Page 11: UDP : User Datagram Protocol

11

UDP for Application

• TFTP• DNS• RPC, NFS• SNMP