Network Programming with Rust

Learn to write servers and network clients using Rust’s low-level socket classes with this guide
Preview in Mapt

Network Programming with Rust

Abhishek Chanda
New Release!

1 customer reviews
Learn to write servers and network clients using Rust’s low-level socket classes with this guide
Mapt Subscription
FREE
€29.73/m after trial
eBook
€9.73
RRP €35.68
Save 72%
Print + eBook
€37.99
RRP €37.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
€0.00
€9.73
€37.99
€29.74 p/m after trial
RRP €35.68
RRP €37.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Network Programming with Rust Book Cover
Network Programming with Rust
€ 35.68
€ 9.73
RUST Design Patterns and Best Practices Book Cover
RUST Design Patterns and Best Practices
€ 0.00
Buy 2 for €52.72
Save €21.81
Add to Cart

Book Details

ISBN 139781788624893
Paperback278 pages

Book Description

Rust is low-level enough to provide fine-grained control over memory while providing safety through compile-time validation. This makes it uniquely suitable for writing low-level networking applications.

This book is divided into three main parts that will take you on an exciting journey of building a fully functional web server. The book starts with a solid introduction to Rust and essential networking concepts. This will lay a foundation for, and set the tone of, the entire book. In the second part, we will take an in-depth look at using Rust for networking software. From client-server networking using sockets to IPv4/v6, DNS, TCP, UDP, you will also learn about serializing and deserializing data using serde. The book shows how to communicate with REST servers over HTTP. The final part of the book discusses asynchronous network programming using the Tokio stack. Given the importance of security for modern systems, you will see how Rust supports common primitives such as TLS and public-key cryptography.

After reading this book, you will be more than confident enough to use Rust to build effective networking software.

Table of Contents

Chapter 1: Introduction to Client/Server Networking
A brief history of networks
Layering in networks
Addressing in networks
How IP routing works
How DNS works
Common service models
The network programming interface in Linux
Summary
Chapter 2: Introduction to Rust and its Ecosystem
The Rust ecosystem
Getting started with Rust
Introduction to the borrow checker
Generics and the trait system
Error handling
The macro system
Functional features in Rust
Concurrency primitives
Testing
Summary
Chapter 3: TCP and UDP Using Rust
A Simple TCP server and client
A Simple UDP server and client
Miscellaneous utilities in std::net
Some related crates
Summary
Chapter 4: Data Serialization, Deserialization, and Parsing
Serialization and deserialization using Serde
Parsing textual data
Parsing binary data
Summary
Chapter 5: Application Layer Protocols
Introduction to RPC
Introduction to SMTP
Introduction to FTP and TFTP
Summary
Chapter 6: Talking HTTP in the Internet
Introducing Hyper
Introducing Rocket
Introducing reqwest
Summary
Chapter 7: Asynchronous Network Programming Using Tokio
Looking into the Future
Heading to tokio
Conclusion
Chapter 8: Security
Securing the web
Cryptography using ring
Summary
Chapter 9: Appendix
Introduction to coroutines and generators
Awaiting the future
Data parallelism
Parsing using Pest
Miscellaneous utilities
Summary

What You Will Learn

  • Appreciate why networking is important in implementing distributed systems
  • Write a non-asynchronous echo server over TCP that talks to a client over a network
  • Parse JSON and binary data using parser combinators such as nom
  • Write an HTTP client that talks to the server using reqwest
  • Modify an existing Rust HTTTP server and add SSL to it
  • Master asynchronous programming support in Rust
  • Use external packages in a Rust project

Authors

Table of Contents

Chapter 1: Introduction to Client/Server Networking
A brief history of networks
Layering in networks
Addressing in networks
How IP routing works
How DNS works
Common service models
The network programming interface in Linux
Summary
Chapter 2: Introduction to Rust and its Ecosystem
The Rust ecosystem
Getting started with Rust
Introduction to the borrow checker
Generics and the trait system
Error handling
The macro system
Functional features in Rust
Concurrency primitives
Testing
Summary
Chapter 3: TCP and UDP Using Rust
A Simple TCP server and client
A Simple UDP server and client
Miscellaneous utilities in std::net
Some related crates
Summary
Chapter 4: Data Serialization, Deserialization, and Parsing
Serialization and deserialization using Serde
Parsing textual data
Parsing binary data
Summary
Chapter 5: Application Layer Protocols
Introduction to RPC
Introduction to SMTP
Introduction to FTP and TFTP
Summary
Chapter 6: Talking HTTP in the Internet
Introducing Hyper
Introducing Rocket
Introducing reqwest
Summary
Chapter 7: Asynchronous Network Programming Using Tokio
Looking into the Future
Heading to tokio
Conclusion
Chapter 8: Security
Securing the web
Cryptography using ring
Summary
Chapter 9: Appendix
Introduction to coroutines and generators
Awaiting the future
Data parallelism
Parsing using Pest
Miscellaneous utilities
Summary

Book Details

ISBN 139781788624893
Paperback278 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

RUST Design Patterns and Best Practices Book Cover
RUST Design Patterns and Best Practices
€ 0.00
Understanding Software Book Cover
Understanding Software
€ 27.35
€ 9.73
Mastering Go Book Cover
Mastering Go
€ 45.20
€ 9.73
SSL VPN : Understanding, evaluating and planning secure, web-based remote access Book Cover
SSL VPN : Understanding, evaluating and planning secure, web-based remote access
€ 28.54
€ 9.73
Practical Deep Reinforcement Learning Book Cover
Practical Deep Reinforcement Learning
€ 45.20
€ 9.73
Learning Scrapy - Second Edition Book Cover
Learning Scrapy - Second Edition
€ 36.87
€ 9.73