How TCP/IP Works - Understanding the Foundation of Internet Communication

15 min read | 2025.12.18

What is TCP/IP

TCP/IP (Transmission Control Protocol/Internet Protocol) is a collection of communication protocols used on the Internet. Developed in the 1970s for ARPANET (the predecessor to the Internet), it now forms the foundation of modern Internet communication.

The name “TCP/IP” combines the two most important protocols, TCP and IP, but it actually refers to a family of protocols including HTTP, FTP, SMTP, DNS, and more.

Key Point: TCP/IP is also called a “protocol stack” and has a layered structure where each layer handles specific responsibilities. This design allows each layer to be improved or replaced independently.

The 4-Layer TCP/IP Model

TCP/IP consists of four layers. Compared to the OSI reference model’s seven layers, it’s organized more practically.

LayerNameRoleMain Protocols
4Application LayerApplication-specific communication processingHTTP, HTTPS, FTP, SMTP, DNS, SSH
3Transport LayerEnd-to-end communication controlTCP, UDP
2Internet LayerRouting by IP addressIP, ICMP, ARP
1Network Interface LayerPhysical network connectionEthernet, Wi-Fi

Data Flow (Encapsulation)

When sending data, “headers” are added at each layer. This is called encapsulation.

  1. Application Layer: Generates application data
  2. Transport Layer: Adds TCP header (port number, sequence number, etc.) → Segment
  3. Internet Layer: Adds IP header (source/destination IP address, etc.) → Packet
  4. Network Interface Layer: Adds Ethernet header (MAC address, etc.) → Frame

The Role of IP - Delivery by Address

IP (Internet Protocol) is responsible for delivering packets to their destination. Using a postal system analogy, it’s the part that “looks at the address and delivers the letter.”

IP Address

A number that identifies each device on the Internet. IPv4 uses 32 bits (e.g., 192.168.1.1), while IPv6 uses 128 bits (e.g., 2001:0db8:85a3::8a2e:0370:7334).

# IPv4 address examples
192.168.1.1     # Private address
8.8.8.8         # Google's DNS server

# IPv6 address examples
::1             # Loopback address
fe80::1         # Link-local address

IP Characteristics

  • Connectionless: Sends packets without establishing a connection beforehand
  • Best Effort: Does not guarantee packet delivery (reliability is handled by TCP)
  • Routing: Forwards packets through multiple networks

Why IP alone is insufficient: IP only “tries to deliver” packets, with no confirmation of delivery or guarantee of order. TCP provides this reliability.

The Role of TCP - Reliable Communication

TCP (Transmission Control Protocol) enables reliable data transfer.

Main TCP Functions

  • Connection-oriented: Establishes connection before communication (3-way handshake)
  • Reliability: Delivery confirmation and retransmission control
  • Order control: Guarantees data order using sequence numbers
  • Flow control: Adjusts sending speed according to receiver’s processing capacity
  • Congestion control: Adjusts transmission volume based on network congestion

3-Way Handshake

TCP connection establishment is done through an exchange of three messages.

Client                         Server
    |                              |
    |-------- SYN (seq=x) -------->|  1. Connection request
    |                              |
    |<--- SYN-ACK (seq=y,ack=x+1) -|  2. Connection request response + own connection request
    |                              |
    |-------- ACK (ack=y+1) ------>|  3. Confirmation of connection request response
    |                              |
    |      Connection established  |

Differences Between TCP and UDP

FeatureTCPUDP
ConnectionConnection-orientedConnectionless
ReliabilityYes (retransmission control)No
Order guaranteeYesNo
SpeedRelatively slowFast
Use casesWeb, email, file transferVideo streaming, games, DNS

Selection criteria: Choose TCP when data accuracy is important; choose UDP when real-time capability is important and some data loss is acceptable.

The Role of Port Numbers

Port numbers are numbers that identify multiple services on the same IP address. The range is 0-65535.

Well-Known Ports (0-1023)

Port Number  Protocol    Purpose
20, 21       FTP         File transfer
22           SSH         Secure shell
25           SMTP        Email sending
53           DNS         Name resolution
80           HTTP        Web
443          HTTPS       Secure Web

Useful Commands for Troubleshooting

# Connection check
ping google.com

# Route check
traceroute google.com    # macOS/Linux
tracert google.com       # Windows

# Check TCP connection status
netstat -an | grep ESTABLISHED

# Packet capture (requires admin privileges)
tcpdump -i eth0 port 80

Summary

TCP/IP is the foundational technology supporting Internet communication. IP delivers packets to their destination, and TCP provides reliable communication. Through the 4-layer protocol stack, each layer functions independently, providing a flexible and extensible communication infrastructure.

← Back to list