Network Programming with Rust
上QQ阅读APP看书,第一时间看更新

Introduction to Client/Server Networking

This book is an introduction to writing networking applications in Rust. This title begs two questions: why should anyone care about networking? And why would anyone want to write networking applications in Rust? We attempt to answer the first question in this chapter. We will introduce Rust and network programming using Rust in subsequent chapters. Firstly, in this chapter, we will start with a bit of history and try to understand how network architecture evolved over the last hundred years. In subsequent sections, we will see how modern networks are layered and addressed. Afterwards, we will describe common service models used in networking. We will end with a summary of networking-related programming interfaces that Linux exposes. Note that this book deliberately ignores network programming in other operating systems and focuses only on Linux for the sake of simplicity. While the Rust compiler is platform-agnostic, there can be cases where some things are different in other platforms compared to Linux. We will point out those differences as we progress.

In this chapter, we will cover the following topics:

  • History of networking: why and how networks came into use and how the internet evolved
  • Layering in networks: how layering and encapsulation works
  • Addressing: how networks and individual hosts are uniquely identified on the internet
  • How IP routing works
  • How DNS works
  • Service models for data delivery
  • The network programming interface in Linux