liveBook · Manning

TCP/IP protocol suite

As explained in Rust Servers, Services, and Apps

The Internet Protocol suite is the four-layered family of networking protocols comprising the network access, Internet, transport, and application layers.

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

Figure 2.1 TCP/IP network model

Use the layer diagram to trace communication from network access through Internet and transport services to application protocols. section 2.1

How Rust Servers, Services, and Apps covers it

How deep it goes
Develops the four-layer model and implements TCP and HTTP examples, but stops short of production-ready server behavior.
Examples
Uses a Rust TCP client-server exchange, an HTTP parser, static pages, JSON responses, browsers, and curl.
What it assumes
Teaches basic TCP/IP networking in Rust while assuming enough Rust familiarity to work with data types, traits, and lifetimes.
What you can do after
Build it from scratch as a basic Rust TCP server, client, HTTP library, and web server using the standard library.
How it connects
Connects network access, IP, TCP, UDP, HTTP, SMTP, DNS, FTP, QUIC, REST, gRPC, and GraphQL.

Also explained in

Compare how 2 books explain TCP/IP protocol suite →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.