What is TCP/IP?
sobes.tech AI
Answer from AI
The communication protocol suite underlying the Internet. TCP (Transmission Control Protocol) provides reliable data delivery, while IP (Internet Protocol) addresses and routes packets.
The TCP/IP model includes four layers:
-
Application Layer: Defines protocols for application interaction (HTTP, FTP, SMTP, DNS).
-
Transport Layer: Ensures end-to-end communication between processes on different hosts. Main protocols are TCP (reliable, connection-oriented) and UDP (unreliable, connectionless).
-
Internet Layer: Responsible for addressing and routing data packets across networks. The main protocol is IP (IPv4, IPv6).
-
Link Layer, or Network Access Layer: Defines protocols for interaction with the physical transmission medium and local networks (Ethernet, Wi-Fi).
Main differences between TCP and UDP:
| Characteristic | TCP | UDP |
|---|---|---|
| Reliability | High (guaranteed delivery) | Low (unreliable delivery) |
| Connection establishment | Requires a "three-way handshake" | Does not require |
| Flow control | Yes | No |
| Congestion control | Yes | No |
| Speed | Lower | Higher |
| Usage | HTTP, FTP, SSH, Email | DNS, VoIP, streaming video |
TCP segments data, numbers them, and sends them. The receiver acknowledges receipt of segments. If a segment is lost, TCP initiates its retransmission.
UDP sends data in datagrams without acknowledgment and delivery order guarantees.
IPv4 uses 32-bit addresses (e.g., 192.168.1.1), while IPv6 uses 128-bit addresses. An IP packet contains a header with sender and receiver addresses, as well as the data itself. Routers use IP addresses to determine the packet's path to the destination.