In today's highly interconnected world, whether browsing the web, sending emails, streaming videos, remotely monitoring industrial equipment, or collecting IoT data, all network communication relies on a core set of protocols—TCP/IP. As the foundation of the Internet, the TCP/IP protocol suite supports the interconnection of billions of devices worldwide. Understanding this protocol suite is essential for professionals working in network technology, industrial communication, and IoT development.
TCP/IP is not a single protocol but a collection of protocols, named after its two most important components: the Transmission Control Protocol (TCP) and the Internet Protocol (IP). This protocol suite adopts a layered architecture, typically divided into four layers:
| Layer | Function | Main Protocols |
|---|---|---|
| Application Layer | Provides network services for user applications | HTTP, FTP, SMTP, MQTT, Modbus TCP |
| Transport Layer | Provides end-to-end communication services | TCP, UDP |
| Network Layer | Handles packet routing and forwarding | IP, ICMP, ARP |
| Network Interface Layer | Manages physical network hardware | Ethernet, Wi-Fi, 4G/5G |
This layered design ensures clear separation of responsibilities, facilitating protocol design, implementation, and maintenance.
The IP protocol is responsible for sending data packets from source devices to destination devices, defining addressing methods and routing mechanisms on the network.
Every device connected to a network is assigned a unique IP address, similar to a postal address. There are currently two main versions of the IP protocol:
IPv4: 32-bit addresses, typically expressed as four decimal numbers (e.g., 192.168.1.1), providing approximately 4.3 billion addresses. With the explosive growth of connected devices, IPv4 addresses have been largely exhausted.
IPv6: 128-bit addresses, expressed in hexadecimal notation, providing virtually unlimited address space to meet the addressing needs of the massive number of devices in the IoT era.
The IP protocol encapsulates data into packets for transmission. An IP packet consists of a header and a data section:
Header: Contains key information such as source IP address, destination IP address, time-to-live (TTL), and protocol type
Data: Carries actual data from upper layers (such as TCP or UDP)
The IP protocol does not guarantee reliable packet delivery—it is only responsible for sending packets to the destination address. Packets may be lost, arrive out of order, or be duplicated during transmission. These reliability issues are handled by upper-layer protocols (such as TCP).
TCP is the core protocol that provides reliable transmission on top of IP. It addresses the unreliability of the IP protocol, offering connection-oriented, reliable, and ordered byte-stream services to the application layer.
The TCP segment header is the core structure of the TCP protocol, containing key information for controlling data transmission. The standard TCP header length is 20 bytes (without options) and can be extended to up to 60 bytes. Main fields include:
| Field | Length | Purpose |
|---|---|---|
| Source Port | 16 bits | Identifies the sending application |
| Destination Port | 16 bits | Identifies the receiving application |
| Sequence Number | 32 bits | Identifies the position of each byte in the data stream for ordering |
| Acknowledgment Number | 32 bits | Indicates the next expected byte, used to confirm received data |
| Data Offset | 4 bits | Indicates the length of the TCP header |
| Control Flags | 6 bits | Contains SYN, ACK, FIN, RST, etc., used for connection management |
The six control flags in the TCP header are critical for connection management and data transmission:
SYN: Synchronization flag, used to synchronize sequence numbers when establishing a connection
ACK: Acknowledgment flag, indicates that the Acknowledgment Number field is valid
FIN: Finish flag, used to gracefully close a connection
RST: Reset flag, used to abruptly terminate a connection
PSH: Push flag, instructs the receiver to immediately deliver data to the application layer
URG: Urgent flag, indicates that the Urgent Pointer field is valid
TCP establishes a reliable connection through a "three-way handshake":
First Handshake: The client sends a SYN packet to the server, indicating its initial sequence number
Second Handshake: The server replies with a SYN-ACK packet, acknowledging receipt of the client's SYN and sending its own SYN
Third Handshake: The client replies with an ACK packet, acknowledging receipt of the server's SYN
After the three-way handshake is completed, the connection is established and data transmission begins.
TCP connection termination follows a "four-way handshake" process:
The active party sends a FIN packet, indicating it has finished sending data
The passive party replies with an ACK, acknowledging receipt of the FIN
The passive party sends a FIN packet, indicating it has also finished sending data
The active party replies with an ACK, acknowledging receipt of the FIN
Key mechanisms that enable TCP's reliable transmission include:
Sequence Numbers and Acknowledgments: Every byte sent has a sequence number; receivers use acknowledgment numbers to indicate which data has been received
Timeout Retransmission: If the sender does not receive an acknowledgment within a specified time, it retransmits the data
Flow Control: Uses the window field to inform the sender of its receiving capacity, preventing data loss due to excessive transmission speed
Congestion Control: Dynamically adjusts the sending rate based on network conditions to prevent network congestion
In addition to TCP, the transport layer includes another important protocol—UDP (User Datagram Protocol). Each has distinct characteristics suited for different scenarios:
| Feature | TCP | UDP |
|---|---|---|
| Connection Type | Connection-oriented | Connectionless |
| Reliability | Reliable, guarantees delivery | Best-effort, may lose packets |
| Data Ordering | Guarantees order | No guarantee of order |
| Flow Control | Supported | Not supported |
| Congestion Control | Supported | Not supported |
| Header Overhead | 20 bytes | 8 bytes |
| Typical Applications | Web browsing, file transfer, industrial control | Real-time audio/video, DNS queries, SNMP |
In industrial automation and IoT, the TCP/IP protocol suite also plays a central role:
Modbus TCP encapsulates the classic Modbus RTU protocol over TCP/IP, enabling industrial equipment to communicate over Ethernet. Compared to traditional serial Modbus, Modbus TCP supports higher communication speeds and more flexible networking.
MQTT is a lightweight IoT communication protocol based on TCP, widely used for data transmission between devices and cloud platforms. TCP's reliable transmission ensures accurate delivery of control commands and critical data.
Industrial gateways often use TCP/IP to achieve conversion between different protocols:
Converting Modbus RTU from serial devices to Modbus TCP
Encapsulating PLC data for upload to cloud platforms via TCP
Receiving cloud commands over TCP and delivering them to field devices
Possible causes:
Target server not running or network unreachable
Firewall blocking the port
Route unreachable
Troubleshooting methods: Use ping to test network connectivity, use telnet or netcat to test port reachability
Possible causes:
Target port not open
Application layer abnormally closed the connection
Firewall actively interrupted
Troubleshooting: Check server program status, confirm port is listening properly
Possible causes:
Network congestion or insufficient bandwidth
TCP window size set too small
Packet loss causing retransmissions
Troubleshooting: Use network monitoring tools to analyze traffic, check packet loss rate and latency
With the explosive growth of IoT devices, IPv6 deployment is accelerating. IPv6 not only solves the address exhaustion problem but also offers better security and auto-configuration capabilities.
QUIC (Quick UDP Internet Connections) is emerging as a new protocol. Based on UDP but providing reliability similar to TCP, it solves TCP's head-of-line blocking problem and is used in HTTP/3.
In industrial internet applications, the demand for low latency and high reliability is driving the development of technologies such as TSN (Time-Sensitive Networking), enabling TCP/IP to better support industrial real-time control scenarios.
The TCP/IP protocol suite is the foundation of the Internet era. Through its layered design, reliable transmission, and flexible addressing, it supports global data communication. From the early ARPANET to today's industrial internet, TCP/IP has evolved over decades, and its core design principles remain highly resilient. For network technology professionals, a deep understanding of TCP/IP is essential for network planning, troubleshooting, and system optimization. Whether building industrial IoT platforms or developing network applications, TCP/IP is fundamental knowledge that must be mastered.