The TCP/IP protocol suite is a simplified four-layer model for Internet communication. Its layers cooperate to move a message from a sending process to a receiving process while allowing different protocols at each layer. section 2.1
The layers divide communication responsibilities:
- Network access layer—handles the lowest-level network communication, typically through hardware or operating-system infrastructure. section 1.1
- Internet layer—provides the Internet-level part of communication through IP. section 2.1
- Transport layer—carries application data using protocols such as TCP or UDP. section 2.4 section 11.1.1
- Application layer—understands message semantics through protocols such as HTTP, SMTP, DNS, and FTP. section 2.1
TCP is stream-oriented: communicating endpoints exchange a continuous stream of bytes, without TCP understanding application message semantics. HTTP commonly runs above TCP and interprets those bytes as requests and responses. section 2.4
A small Rust web server
A basic implementation can use only the Rust standard library: construct a TCP server and client, exchange raw bytes, then add an HTTP library that parses requests and builds responses. Modeling HTTP requests and responses with Rust structs and enums supports serving static pages and JSON to browsers or curl. section 2.2 section 2.4 section 2.0
Use the layer diagram to trace communication from network access through Internet and transport services to application protocols. section 2.1

