𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Network Programming and Automation Essentials: Get started in the realm of network automation using Python and Go

✍ Scribed by Claus Topke


Publisher
Packt Publishing
Tongue
English
Leaves
296
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Unleash the power of automation by mastering network programming fundamentals using Python and Go best practices

Purchase of the print or Kindle book includes a free PDF eBook

Key Features

  • Understand the fundamentals of network programming and automation
  • Learn tips and tricks to transition from traditional networking to automated networks
  • Solve everyday problems with automation frameworks in Python and Go

Book Description

Network programming and automation, unlike traditional networking, is a modern-day skill that helps in configuring, managing, and operating networks and network devices. This book will guide you with important information, helping you set up and start working with network programming and automation.

With Network Programming and Automation Essentials, you'll learn the basics of networking in brief. You'll explore the network programming and automation ecosystem, learn about the leading programmable interfaces, and go through the protocols, tools, techniques, and technologies associated with network programming. You'll also master network automation using Python and Go with hands-on labs and real network emulation in this comprehensive guide.

By the end of this book, you'll be well equipped to program and automate networks efficiently.

What you will learn

  • Understand the foundation of network programming
  • Explore software-defined networks and related families
  • Recognize the differences between Go and Python through comparison
  • Leverage the best practices of Go and Python
  • Create your own network automation testing framework using network emulation
  • Acquire skills in using automation frameworks and strategies for automation

Who this book is for

This book is for network architects, network engineers, and software professionals looking to integrate programming into networks. Network engineers following traditional techniques can use this book to transition into modern-day network automation and programming. Familiarity with networking concepts is a prerequisite.

Table of Contents

  1. Network Basics for Development
  2. Programmable Networks
  3. Accessing the Network
  4. Working with Network Configurations and Definitions
  5. Dos and Don'ts for Network Programming
  6. Using Go and Python for Network Programming
  7. Error Handling and Logging
  8. Scaling Your Code
  9. Network Code Testing Framework
  10. Hands-On and Going Forward

✦ Table of Contents


Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1: Foundations for Network Automation
Chapter 1: Network Basics for Development
Reviewing protocol layers, network device types, and network topologies
Protocol layers
LAN, WAN, internet, and intranet
Describing network architecture and its components
Diagrams
Network node names
The last-mile network
The physical architecture
The routing architecture
Types of failure
Failure detection techniques
Control plane and forwarding plane
Graceful restart
Illustrating network management components, network bastions, and more
ACL
Management system and managed elements
In-band and out-of-band management
Network telemetry
Management information base
Network bastions
FCAPS
Network planning
Network security
Summary
Chapter 2: Programmable Networks
Exploring the history of programmable networks and looking at those used in the present day
Active networking
NodeOS
Data and control plane separation
Virtual network technologies
Virtual private networks
The Virtual Router Redundancy Protocol
The Virtual Extensible Local Area Network
Open vSwitch
Linux Containers
Virtual machines
SDNs and OpenFlow
History of OpenFlow
SDN architecture
OpenFlow and its future
Understanding cloud computing
Commercial cloud computing
The OpenStack Foundation
Cloud Native Computing Foundation
Using OpenStack for networking
OpenStack Neutron
The Neutron API
Summary
Chapter 3: Accessing the Network
Working with the CLI
The command prompt
Serial access
Remote insecure access
Remote secure access
Using SNMP
SNMP agents and managers
An SNMP MIB
SNMP versions
SNMP primitive methods
SNMP security issues
Employing NETCONF
Motivation
OpenConfig
YANG
NETCONF
RESTCONF
Adopting gRPC
The letter g
Motivation
Overview
Protobuf
gRPC and network telemetry
Code examples using gRPC
Operating with gNMI
Protocol layers
The data model
The communication model
Service definition
gNMI-gateway
Summary
Chapter 4: Working with Network Configurations and Definitions
Technical requirements
Describing the configuration problem
Source of truth
The startup configuration and the running configuration
Configuration states and history
Deployment pipeline
Network diagrams and automation
Using network definitions to aid automation
The router configuration render
Using configuration templates
Using Python engine templates
Using Go engine templates
Creating network definitions
Nested and hierarchical definitions
IP allocation considerations
Using files for definitions
File format
Names
Exploring different file types
XML files
JSON files
YAML files
Summary
Part 2: Network Programming for Automation
Chapter 5: Dos and Don’ts for Network Programming
Coding topics
Peer review
Life cycle
Refactoring
Copying code and licensing
Code quality and perception
Architecture and modeling
Applying best practices in coding
Follow the standards
Mindful code writing
Making it extremely readable
Commenting your code
Use IP libraries
Follow naming conventions
Don’t shorten variable names
Avoid complex loops
Don’t repeat code
Coding formatters
Python Black
Python isort
Python YAPF
Go gofmt
Go golines
Go golangci-lint
Versioning and concurrent development
clone
checkout
commit
Mainline
Branching
Merging
Testing your code
Unit testing
Integration testing
E2E testing
Other testing
Summary
Chapter 6: Using Go and Python for Network Programming
Technical requirements
Looking into the language runtime
What are compiled and interpreted languages?
Python interpreter
Go compiler
Pros and cons of programming runtimes
Using third-party libraries
Adding Python libraries
Adding Go libraries
Accessing network devices using libraries
Libraries to access the network via a CLI
Libraries to access networks using SNMP
Libraries to access networks using NETCONF or RESTCONF
Libraries to access networks using gRPC and gNMI
Summary
Chapter 7: Error Handling and Logging
Technical requirements
Writing code for error handling
Adding error handling in Go
Adding error handling in Python
Logging events
Severity levels
Adding logging to your code
Adding event logging in Go
Add event logging in Python
Summary
Chapter 8: Scaling Your Code
Technical requirements
Dealing with multitasking, threads, and coroutines
Multiprocessing
Multithreading
Coroutines
Adding schedulers and job dispatchers
Using classical schedulers and dispatchers
Working with big data
Using microservices and containers
Building a scalable solution by example
Summary
Part 3: Testing, Hands-On, and Going Forward
Chapter 9: Network Code Testing Framework
Technical requirements
Using software for testing
Differences between emulation and simulation
Using device emulation
Scaling up emulation with containers
Connecting devices for testing
Using physical wires to connect
Using software to connect
Building a hybrid lab
Using advanced testing techniques
Using time dilation
Using monkey testing
Using artificial intelligence
Using network simulation
Using traffic control
Summary
Chapter 10: Hands-On and Going Forward
Technical requirements
Using a network lab
Building our network lab
Launching the lab host
Checking the lab host
Connecting the devices
The OOB management network
Looking at the topology
Creating the connections between devices
Automating the connections
Looking into the automation program
Checking the connections manually
Adding automation
Link connection check automation
IP configuration automation
Additional network lab automation
Going forward and further study
Checking popular platforms and tools
Joining the network automation community
Summary
Index
Other Books You May Enjoy


πŸ“œ SIMILAR VOLUMES


Network Programming and Automation Essen
✍ Claus TΓΆpke πŸ“‚ Library πŸ“… 2023 πŸ› Packt Publishing Ltd. 🌐 English

Unleash the power of automation by mastering network programming fundamentals using Python and Go best practices Key Features Understand the fundamentals of network programming and automation Learn tips and tricks to transition from traditional networking to automated networks Solve everyday p

Network Automation with Go: Learn how to
✍ Nicolas Leiva, Michael Kashin πŸ“‚ Library πŸ“… 2023 πŸ› Packt Publishing 🌐 English

<p><span>Understand the world of modern network automation with Go and deepen your knowledge with insights from 10+ experts who have real-world hands-on experience with network automation and/or are using Go for network-related tasks</span></p><h4><span>Key Features</span></h4><ul><li><span><span>A

Network Automation with Go: Learn how to
✍ Nicolas Leiva, Michael Kashin πŸ“‚ Library πŸ› Packt Publishing 🌐 English

<p><span>Understand the world of modern network automation with Go and deepen your knowledge with insights from 10+ experts who have real-world hands-on experience with network automation and/or are using Go for network-related tasks</span></p><h4><span>Key Features</span></h4><ul><li><span><span>A

Python Networking 101: Navigating essent
✍ Odette Windsor πŸ“‚ Library πŸ“… 2023 πŸ› GitforGits 🌐 English

Python Networking 101 is the ultimate guide for aspiring network administrators looking to build their network management and automation skills using Python. With a comprehensive and hands-on approach, this book covers the most important aspects of networking, including network fundamentals, network