Book Image

Network Automation with Go

By : Nicolas Leiva, Michael Kashin
Book Image

Network Automation with Go

By: Nicolas Leiva, Michael Kashin

Overview of this book

Go’s built-in first-class concurrency mechanisms make it an ideal choice for long-lived low-bandwidth I/O operations, which are typical requirements of network automation and network operations applications. This book provides a quick overview of Go and hands-on examples within it to help you become proficient with Go for network automation. It’s a practical guide that will teach you how to automate common network operations and build systems using Go. The first part takes you through a general overview, use cases, strengths, and inherent weaknesses of Go to prepare you for a deeper dive into network automation, which is heavily reliant on understanding this programming language. You’ll explore the common network automation areas and challenges, what language features you can use in each of those areas, and the common software tools and packages. To help deepen your understanding, you’ll also work through real-world network automation problems and apply hands-on solutions to them. By the end of this book, you’ll be well-versed with Go and have a solid grasp on network automation.
Table of Contents (18 chapters)
1
Part 1: The Go Programming Language
6
Part 2: Common Tools and Frameworks
10
Part 3: Interacting with APIs

What this book covers

Chapter 1, Introduction, explores networking and Go, the benefits of Go, and how it contrasts with Python.

Chapter 2, Go Basics, defines Go and talks about its guiding principles. It presents the Go source code file structure and shows how to compile Go programs.

Chapter 3, Getting Started with Go, covers different characteristics of Go that are relevant for network automation such as control flow, input and output operations, decoding and encoding, and concurrency.

Chapter 4, Networking (TCP/IP) with Go, focuses on practical use cases with Go for each layer of the TCP/IP model.

Chapter 5, Network Automation, discusses what network automation is, its impact on network operations, and its benefits for the business. It also talks about scaling individual use cases into a network automation system.

Chapter 6, Configuration Management, walks us through practical examples using Go to interact with network devices from different networking vendors via SSH and HTTP to configure and collect their operational state to verify any changes.

Chapter 7, Automation Frameworks, describes how some automation frameworks can integrate with Go with an emphasis on Ansible and Terraform.

Chapter 8, Network APIs, takes a look at machine-to-machine interfaces to manage network devices that enable network automation. From RESTCONF and OpenAPI to gRPC.

Chapter 9, OpenConfig, examines how to perform common operational tasks with OpenConfig gRPC services, such as provisioning a device, subscribing to a telemetry stream, and executing an action such as traceroute.

Chapter 10, Network Monitoring, dives into the world of network monitoring from different angles with Go; capturing network packets, processing data plane telemetry, running active probes to measure network performance, and visualizing metrics.

Chapter 11, Expert Insights, consists of people who have real-world hands-on experience with network automation and/or are using Go for network-related tasks and activities sharing their perspectives with us.

Chapter 12, Appendix: Building a Testing Environment, documents the process of building a testing environment that includes the compatible version of Containerlab and other related dependencies, to make sure you get a seamless experience running examples from any chapter of this book.