program tip

실제 TCP 및 UDP의 예는 무엇입니까?

radiobox 2021. 1. 9. 09:43
반응형

실제 TCP 및 UDP의 예는 무엇입니까?


나는 기술적 수준에서 둘의 차이점을 알고 있습니다.

그러나 실생활에서 누구든지 TCP와 UDP의 응용 프로그램 (사용)에 대한 예 (더 많을수록 좋음)를 제공하여 차이점을 보여줄 수 있습니까?


UDP : 항상 모든 데이터를 얻는다면별로 신경 쓰지 않는 모든 것

  • 터널링 / VPN (손실 된 패킷은 괜찮습니다-터널링 된 프로토콜이 처리합니다)
  • 미디어 스트리밍 (분실 된 프레임은 괜찮음)
  • 모든 업데이트를 받아도 상관없는 게임
  • 로컬 브로드 캐스트 메커니즘 (서로 "검색"하는 다른 시스템에서 실행되는 동일한 응용 프로그램)

TCP : 전송 된 모든 데이터를 가져와야하는 거의 모든 것

  • 편물
  • SSH, FTP, 텔넷
  • SMTP, 메일 보내기
  • IMAP / POP, 메일 수신

편집 : 나는 당신이 이미 알고 있고 다른 모든 대답이 어쨌든 그것을 설명한다고 말했기 때문에 차이점을 설명하지 않을 것입니다. :)


UDP는 우체국에서 편지를 보내고 있습니다.

TCP는 우체국에서 반품 영수증과 함께 편지를 우송하고 있습니다. 단, 우체국은 우편물 순서대로 편지를 정리하고 순서대로 배달합니다.

음, 어쨌든 시도였습니다.


TCP :

  • World Wide Web (HTTP)
  • 이메일 (SMTP TCP)
  • FTP (파일 전송 프로토콜)
  • SSH (보안 셸)

UDP :

  • DNS (도메인 이름 시스템)
  • 영화와 같은 스트리밍 미디어 애플리케이션
  • 온라인 멀티 플레이어 게임
  • VoIP (Voice over IP)
  • TFTP (Trivial File Transfer Protocol)

고전적인 관점은 TCP를 안전한 것으로 간주하고 UDP를 신뢰할 수없는 것으로 간주하는 것입니다.

그러나 TCP-IP 프로토콜이 안전이 중요한 응용 프로그램에서 사용되는 경우 TCP는 여러 가지 이유로 오류시 중지 될 수 있으므로 권장되지 않습니다. UDP를 사용하면 애플리케이션 소프트웨어가 오류, 재전송 타이머 등을 처리 할 수 ​​있습니다.

또한 TCP는 UDP보다 처리 오버 헤드가 더 많습니다.

현재 UDP는 항공기 제어 및 비행 장비에 사용되며 ARINC 664 표준에서는 AFDX (Avionics Full-Duplex Switched Ethernet)라고도합니다. ARINC 664에서 TCP는 선택 사항이지만 UDP는 ARINC 653 표준 (민간 항공기의 높은 신뢰성 제어 소프트웨어) 용으로 설계된 RTOS (실시간 운영 체제)와 함께 사용됩니다.

AFDX에서 IP 및 UDP를 사용한 실시간 제어에 대한 자세한 내용은 http://www.afdx.com/pdf/AFDX_Training_October_2010_Full.pdf 에서 27 ~ 50 페이지를 읽을 수 있습니다 .


TCP

확인을받을 때까지 더 이상 데이터를 보내지 않겠습니다.

이 과정은 느리다

보안 목적으로 사용됩니다.

예 : 웹, 메일 보내기, 메일 받기 등

UDP

여기 나는 인정으로 두통이 없습니다.

이 프로세스는 더 빠르지 만 여기서 데이터가 손실 될 수 있습니다.

예 : 비디오 스트리밍, 온라인 게임 등

TCP + UDP = SMTP (예 : 모바일, 전화)


TCP는 (순서대로) 패킷 전달을 보장합니다. UDP는 그렇지 않습니다.

TCP-모든 데이터가 필요한 트래픽에 사용됩니다. 즉, HTML, 사진 등 UDP-패킷이 손실 되어도 큰 문제가되지 않는 트래픽 (예 : 비디오 및 음성 스트리밍, 온라인 게임의 일부 데이터 채널 등)에 사용됩니다.


TCP 용 실시간 애플리케이션 :

이메일:

이유 : 일부 패킷 (단어 / 문)이 누락 된 경우 내용을 이해할 수 없으며 신뢰할 수 있어야합니다.

UDP 용 실시간 애플리케이션 :

비디오 스트리밍:

* **Reason: ***suppose if some packet(frame/sequence) is missing we can understand the content.Because video is collection of frames.For 1 second video there should be 25 frames(image).Even though we can understand some frames are missing due to our imagination skills. Thats why UDP is used for video streaming.


TCP is a connection oriented protocol, It establishes a path, or a virtual connection all the way through switches routers proxies etc and then starts any communication. Various mechanisms like routing djikstras shortest path algorithm exist to establish the virtual end to end connection. So it finds itself used while browsing HTML and other pages, making payments and web applications in general.

UDP is a connectionless protocol - it simply has a destination and nodes simply pass it along if it comes as best as they can. So packets arriving out of order, along various routes etc are common. So Instant messengers and similar software developers think UDP an ideal solution.

In real life if you want to throw data in the net, without worrying about time taken to reach, order of reaching use UDP. If you want a solid path before you start throwing packets, and want same order and latency for your data packets use TCP - I will use UDP for Torrents and TCP for PayPal!


TCP is appropriate when you have to move a decent amount of data (> ~1 kB), and you require all of it to be delivered. Almost all data that moves across the internet does so via TCP - HTTP, SMTP, BitTorrent, SSH, etc, all use TCP.

UDP is appropriate when you have small messages which you can afford to lose, and would like to send them as efficiently as possible. One reason you might be able to afford to lose them is because you can re-send them if they get lost. The main example on the internet is DNS - DNS consists of small queries saying things like "what is the IP number for stackoverflow.com?", and the responses are correspondingly small. Computers make a lot of these queries, so they should be made efficiently, but if they get lost en route, it's easy to time out and re-send them.


TCP guarantees packet delivery AND order. Order is almost as important as the delivery in the first place when reconstructing data for files such as executables, etc.

UDP does not guarantee delivery NOR order. Packets can arrive (or not!) in any order.

Common uses for TCP include file transfer where the integrity of the packets is paramount. Voice/video applications can afford to lose some data while still maintaining acceptable quality, and so usually use UDP.


  • TCP: will get there in meaningful order
  • UDP: god knows (maybe)

One additional thought on some of the comments above that talks about ordered delivery.... It must be clarified that the destination computer may receive packets out of order on the wire, but the TCP at the destination is responsible for "rearranging out-of-order data" before passing it on to the upper layers of the stack. When you say TCP guarantees ordered packet delivery, what that means is it will deliver packets in correct order to the upper layers of the stack.


SCTP vs TCP vs UDPServices/Features       SCTP        TCP       UDP
Connection-oriented                       yes         yes       no
Full duplex                               yes         yes       yes
Reliable data transfer                    yes         yes       no
Partial-reliable data transfer            optional    no        no
Ordered data delivery                     yes         yes       no
Unordered data delivery                   yes         no        yes
Flow control                              yes         yes       no
Congestion control                        yes         yes       no
ECN capable                               yes         yes       no
Selective ACKs                            yes         optional  no
Preservation of message boundaries        yes         no        yes
Path MTU discovery                        yes         yes       no
Application PDU fragmentation             yes         yes       no
Application PDU bundling                  yes         yes       no
Multistreaming                            yes         no        no
Multihoming                               yes         no        no
Protection against SYN flooding attacks   yes         no        n/a
Allows half-closed connections            no          yes       n/a
Reachability check                        yes         yes       no
Psuedo-header for checksum                no (vtags)  yes       yes
Time wait state                           vtags       4-tuple   n/a

Since tcp usages are pretty straightforward from other answers, I'll mention some interesting UDP use-cases:

1)DHCP - Dynamic Host Configuration Protocol, which is being used in order to dynamically assign IP address and some other network configuration to the connecting devices. In simple words, this protocol allows you just connect to the network cable(or wifi) and start using the internet, without any additional configurations. DHCP uses UDP protocol. Since the settings request message is being broadcasted from the host and there is no way to establish a TCP connection with DHCP server(you don't know it's address) it's impossible to use TCP instead.

2)Traceroute - well-known network diagnostic tool which allows you to explore which path in the network your datagram passes to reach it's destination(and how much time it takes). By default, it works by sending UDP datagram with unlikely destination port number(ranging from 33434 to 33534) to the destination with the ttl(time-to-live) field set to 1. When the router somewhere in the network gets such datagram - it finds out that the datagram is expired. Then, the router drops the datagram and sends to the origin of the datagram an ICMP(Internet Control Message Protocol) error message indicating that the datagram's ttl was expired and containing router's name and IP address. Each time the host sends datagrams with higher and higher TTL, thus increasing the network part which it succeeds to overcome and getting new ICMP messages from new routers. When it eventually reaches it's destination(datagrams TTL is big enough to allow it),- the destination host sends 'Destination port unreachable' ICMP message to the origin host. This way, Traceroute knows that the destination was reached. Since the TCP guarantees segments delivery it would be at least inefficient to use it instead of UDP which, in turn, allows datagram to be just dropped without any resend attempts(resend is implemented on the higher level, with continuously increasing TTL as described above).


UDP is applied a lot in games or other Peer-to-peer setups because it's faster and most of the time you don't need the protocol itself to make sure everything gets to the destination in the original order (UDP does not garantee packet delivery or delivery order).

Web traffic on the other hand is over TCP. (I'm not sure here but I think it has to do with the way the HTTP protocol is built)

Edited because I failed at UDP.


Real life examples of both TCP and UDP tcp -> a phone call, sms or anything specific to destination UDP -> a FM radio channel (AM), Wi-Fi.

ReferenceURL : https://stackoverflow.com/questions/5330277/what-are-examples-of-tcp-and-udp-in-real-life

반응형