HTTP, the application-layer protocol understood by web frameworks, transports HTML, CSS, JavaScript, WebAssembly modules, images, video, and other content between networked systems. Understanding it helps tune framework performance and diagnose problems. section 8.1
HTTP operates within layered networking. Lower layers pass byte streams upward without knowing their meaning, while higher layers remain largely agnostic about how messages travel. TCP carries HTTP, and TLS sits between them to provide encrypted messaging for HTTPS. section 8.1
Figure 8.2 Several layers of networking protocols involved with delivering content over the internet. The figure compares some common models, including the seven-layer OSI model and the four-layer TCP/IP model.
Use the networking-layer figure to compare the OSI and TCP/IP models and locate HTTP among the protocols delivering internet content. section 8.1
A raw HTTP client can be assembled by coordinating several network operations:
- Resolve a domain name to an IP address with DNS. section 8.10
- Create and manage a TCP connection through smoltcp primitives. section 8.10
- Progress through connection, request, and response states. section 8.10
- Coordinate command-line parsing, URL handling, Ethernet setup, DNS, and HTTP code in the mget project. section 8.10
mget: a manually built web client
The mget command accepts a URL and tap device, optionally accepts a DNS server, resolves the domain, configures Ethernet support, and performs an HTTP request without relying on a high-level web framework. section 8.10
ch8-mget
├── Cargo.toml #1
└── src
├── main.rs #2
├── ethernet.rs #3
├── http.rs #4
└── dns.rs #5
Browse the mget file tree to see how command-line coordination, Ethernet handling, HTTP interaction, and DNS resolution are separated into modules. section 8.10







