[ํ’€์Šคํƒ] UDP - User Datagram Protocol

2023. 4. 11. 21:29ใ†ComputerScience/FullStackProgramming

 

 

 

UDP User Datagram Protocol

  • The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol.
  • It does not add anything to the services of IP except to provide process-to-process communication instead of host-to- host communication.
  • If UDP is so powerless, why would a process want to use it? Very simple protocol using a minimum of overhead
  • if a process wants to send a small message and does not care much about reliability, it can use UDP
  • if it sends a small message, taking much less interaction between the sender and receiver than it does using TCP

 

 

 

https://ko.wikipedia.org/wiki/TCP/UDP์˜_ํฌํŠธ_๋ชฉ๋ก - ์ž˜ ์•Œ๋ ค์ง„ ํฌํŠธ ๋„˜๋ฒ„๋“ค์ด ์žˆ๋‹ค.

 

 

 

ํ—ค๋”๊ฐ€ ๊ตฌํ˜„๋œ ๋ฐฉ์‹ -> ๋ณด๋‚ด๋Š” ํฌํŠธ์˜ ๋ฒˆํ˜ธ + ๋ฐ›๋Š” ํฌํŠธ์˜ ๋ฒˆํ˜ธ https://static.javatpoint.com/tutorial/computer-network/images/udp-protocol.png

 

 

 

 

IP ์ฃผ์†Œ(3)์™€ ํฌํŠธ ๋„˜๋ฒ„(4)๋ฅผ ํ•ฉํ•˜๋ฉด, ํŠน์ • ์ปดํ“จํ„ฐ(์„œ๋ฒ„)์˜ ํ”„๋กœ์„ธ์Šค๋ฅผ ์‹๋ณ„ ๊ฐ€๋Šฅํ•˜๋‹ค ! https://www.myreadingroom.co.in/images/stories/docs/dcn/user%20datagram_Header.JPG

 

 

 

UDP Operation

  • Connectionless Services : 
    UDP provides a connectionless services that each datagram sent by UDP is an independent datagram.
  • Flow and Error Control : 
    There is no flow control and hence no window mechanism.
    There is no error control mechanism in UDP except for the checksum.
  • Encapsulation and Decapsulation :
    The UDP protocol encapsulates and decapsulates messages in an IP datagram.

 

 

 

Queuing at client site

  • When a process starts, it requests a port No. from the operating system.
    The client process sends messages to the outgoing queue by using the source port No. specified in the request.
  • UDP removes the messages one by one and, after adding the UDP header, delivers them to IP.
  • An outgoing queue can overflow.
    If this happens, the OS can ask the client process to wait before sending any more messages.
  • When a message arrives for a client, UDP checks to see if an incoming queue has been created for the port No. specified in the destination port No. field of the user datagram.
    If there is a queue, UDP sends the received user datagram to the end of the queue.

 

  • ํด๋ผ์ด์–ธํŠธ - ์ •๋ณด๋ฅผ ๋ณด๋‚ด๋ฉด ๋จ
    ์šด์˜์ฒด์ œ๋กœ๋ถ€ํ„ฐ ํฌํŠธ ๋ฒˆํ˜ธ๋ฅผ ๋ถ€์—ฌ๋ฐ›๋Š”๋‹ค.
  • ํ†ต์‹ ์„ ์œ„ํ•œ ํฌํŠธ๋ฒˆํ˜ธ๋ฅผ ์šด์˜์ฒด์ œ์—๊ฒŒ ์š”๊ตฌ
    ์šด์˜์ฒด์ œ๋Š” ํ”„๋กœ์„ธ์Šค์—๊ฒŒ ํ†ต์‹  ํฌํŠธ ๋ฒˆํ˜ธ๋ฅผ ์ค€๋‹ค
  • UDP๋Š” ์ •๋ณด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์–ด์•ผํ•จ - ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„ ํ•„์š”
    layer3 ์—๊ฒŒ ๋ฐ›์€ ์ •๋ณด - UDP ๊ฐ–๊ณ  ์žˆ๋‹ค๊ฐ€, 4์—๊ฒŒ ์คŒ
    * ์ƒ์œ„ ๊ณ„์ธต์ด ํ•˜์œ„ ๊ณ„์ธต์—๊ฒŒ ์ฃผ๋ฉด, ํ•˜์œ„ ๊ณ„์ธต์€ ์ฝ์–ด๊ฐ„๋‹ค. 
  • ๋ณธ์ธ์ด ๋ฐ‘์œผ๋กœ ๋‚ด๋ฆด ๋•Œ ์•„๋ž˜ ๊ณ„์ธต์˜ ํ์—๋‹ค ์“ฐ๊ณ , ์•„๋ž˜ ๊ณ„์ธต์€ ๊ทธ๊ฑธ ๋‹ค์‹œ ์ฝ์–ด ๊ฐ„๋‹ค. 

 

 

 

Queuing at server site

  • When it starts running, a server asks for incoming and outgoing queues, using its well-known port.
  • When a message arrives for a server, UDP checks to see if an incoming queue has been created for the port number specified in the destination port number field of the user datagram.
  • If there is a queue, UDP sends the received user datagram to the end of the queue.
    ์—ฐ๊ฒฐ ์„ค์ • ๊ณผ์ •์ด ์—†๋‹ค
  • When a server wants to respond to a client, it sends messages to the outgoing queue, using the source port No. specified in the request.
  • UDP removes the messages one by one and, after adding the UDP header, delivers them to IP.

 

 

 

Applications of UDP

  • UDP is suitable for a process that requires simple request-response communication with little concern for flow and error control.
  • ํŒŒ์ผ ์‚ฌ์ด์ฆˆ๊ฐ€ ์ž‘์„ ๋•Œ, ์„œ๋ฒ„์™€ ๊ฐ€๊นŒ์ด ์žˆ์–ด ์•ˆ์ •์ ์ผ ๋•Œ -> UDP๋กœ ํŒŒ์ผ์„ ์ฃผ๊ณ  ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค. 
  • Not used for sending bulk data, such as FTP
  • TFTP including internal flow and error control
  • Suitable transport protocol for multicasting
  • Used for some route updating protocols such as Routing Information Protocol (RIP)
    ๋ผ์šฐํ„ฐ๋ผ๋ฆฌ ๊ฐ„๋‹จํ•œ ์ •๋ณด ์ฃผ๊ณ ๋ฐ›์„ ๋•Œ 
  • Used for management processes such as SNMP.
    SNMP(Simple Network Management Protocol)๋ž€?
    UDP/IP(์‚ฌ์šฉ์ž ๋ฐ์ดํ„ฐ๊ทธ๋žจ ํ”„๋กœํ† ์ฝœ/์ธํ„ฐ๋„ท ํ”„๋กœํ† ์ฝœ)๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋”๋„ท ์—ฐ๊ฒฐ์„ ํ†ตํ•ด ๋„คํŠธ์›Œํฌ ๊ด€๋ฆฌ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๋Š” ์‘์šฉ ๊ณ„์ธต ํ”„๋กœํ† ์ฝœ

 

  • ๊ตฌ๊ธ€ ์™„์ „ํžˆ UDP ๊ธฐ๋ฐ˜
    ์œ ํŠœ๋ธŒ - UDP ๊ธฐ๋ฐ˜
    TCP๋ฅผ ๊ฑท์–ด๋‚ธ ์ƒˆ๋กœ์šด ํ†ต์‹  ํ”„๋กœํ† ์ฝœ - ํ€ต์œผ๋กœ ๊ตฌํ˜„
    ๋„ค์ด๋ฒ„ - ํ€ต ๋ฒ ์ด์Šค, 4๊ณ„์ธต ํ†ต์‹  ํ”„๋กœํ† ์ฝœ๋กœ ๋„˜์–ด๊ฐ
  • ์ƒˆ๋กœ์šด ํ†ต์‹  ํ”„๋กœํ† ์ฝœ์ด UDP ์œ„์— ์„ค๊ณ„๋˜๊ณ  ์žˆ๋‹ค. 
    ๊ฑฐ์˜ ๋ชจ๋“  ์šด์˜์ฒด์ œ์— UDP๋Š” ์žˆ๋‹ค.