TCP/UDP (Socket Communication)

TCP (Transmission Control Protocol)

  • Provides a connection-oriented service.
  • Guarantees high reliability.
  • Establishes connections with 3-way handshaking.
  • Terminates connections with 4-way handshaking.
  • Provides data flow control and congestion control.
    • Flow control: prevents receiver buffer overflow.
    • Congestion control: prevents an excessive increase in the number of packets in the network.
  • Provides full-duplex, point-to-point service (bidirectional transmission and reception).
  • Used for cases where reliability is important, such as file exchange.

UDP (User Datagram Protocol)

  • Provides a connectionless service.
  • Has low reliability.
  • The order of data transmission can change.
  • Does not confirm whether data was received; there is no process like 3-way handshaking.
  • Has a faster transmission speed than TCP.
  • Mainly used for streaming, where real-time delivery is important.
  • Supports 1:1, 1:N, and N:M communication.