Network Programmability and Automation, 2nd Edition

Book description

Network engineers are finding it harder than ever to rely solely on manual processes to get their jobs done. New protocols, technologies, delivery models, and the need for businesses to become more agile and flexible have made network automation essential. The updated second edition of this practical guide shows network engineers how to use a range of technologies and tools, including Linux, Python, APIs, and Git, to automate systems through code. This edition also includes brand new topics such as network development environments, cloud, programming with Go, and a reference network automation architecture.

Network Programmability and Automation will help you automate tasks involved in configuring, managing, and operating network equipment, topologies, services, and connectivity. Through the course of the book, you'll learn the basic skills and tools you need to make this critical transition.

You'll learn:

  • Programming skills with Python and Go: data types, conditionals, loops, functions, and more
  • How to work with Linux-based systems, the foundation for modern networking and cloud platforms
  • Data formats and models: JSON, XML, YAML, and YANG
  • Jinja templating for creating network device configurations
  • The role of application programming interfaces (APIs) in network automation
  • Source control with Git to manage code changes during the automation process
  • Cloud-native technologies like Docker and Kubernetes
  • How to automate network devices and services using Ansible, Salt, and Terraform
  • Tools and technologies for developing and continuously integrating network automation

Publisher resources

View/Submit Errata

Table of contents

  1. 1. Network Industry Trends
    1. The Rise of Software Defined Networking
      1. OpenFlow
      2. What Is Software Defined Networking?
    2. Summary
  2. 2. Network Automation
    1. Why Network Automation?
      1. Simplified Architectures
      2. Deterministic Outcomes
      3. Business Agility
      4. Continuous Improving
    2. Types of Network Automation
      1. Device Provisioning
      2. Data Collection and Enrichment
      3. Migrations
      4. Configuration Management
      5. Configuration Compliance
      6. State Validation
      7. Reporting
      8. Troubleshooting
    3. Evolving the Management Plane from SNMP to Device APIs
      1. Application Programming Interfaces (APIs)
      2. Impact of Open Networking
    4. Network Automation in the SDN Era
    5. Summary
  3. 3. Python
    1. Should Network Engineers Learn to Code?
    2. Using the Python Interactive Interpreter
    3. Understanding Python Data Types
      1. Learning to Use Strings
      2. Learning to Use Numbers
      3. Learning to Use Booleans
      4. Learning to Use Python Lists
      5. Learning to Use Python Dictionaries
      6. Learning About Python Sets and Tuples
    4. Adding Conditional Logic to Your Code
    5. Understanding Containment
    6. Using Loops in Python
      1. Understanding the while Loop
      2. Understanding the for Loop
    7. Using Python Functions
    8. Working with Files
      1. Reading from a File
      2. Writing to a File
    9. Creating Python Programs
      1. Creating a Basic Python Script
      2. Comments in Python
      3. Migrating Code from the Python Interpreter to a Python Script
    10. Working with Python Modules
      1. Documenting Functions
    11. Passing Arguments into a Python Script
    12. Using pip and Installing Python Packages
      1. Isolate your Dependencies with Virtualenv
    13. Understanding Python Classes
      1. Using Classes
      2. Building your own classes
    14. Embrace Failure with try/except
    15. Parallelize your Python Programs
    16. Summary
  4. 4. Data Formats and Models
    1. Benefits and Fundamentals of Structured Data Formats
      1. When Structured Data Isn’t Available: Screen Scraping
      2. Types of Data
      3. Documents vs Data
      4. Categories of Data Formats
    2. Text-Based Data Formats
      1. YAML
      2. XML
      3. JSON
    3. Binary Data Formats
      1. Google Protocol Buffers (protobuf)
      2. Other Binary Data Formats
    4. Data Modeling
      1. YANG
      2. JSON Schema
      3. XML Schema Definition (XSD)
      4. Modeling and Validating Protocol Buffers
    5. Conclusion
  5. 5. Automation Tools
    1. Reviewing Automation Tools
    2. Using Ansible
      1. Discovering the Ansible Framework
      2. Understanding How Ansible Works
      3. Constructing an Inventory File
      4. Executing an Ansible Playbook
      5. Using Secrets
      6. Using Variable Files
      7. Writing Ansible Playbooks for Network Automation
      8. Using Third-Party Collections and Modules
      9. Ansible Summary
    3. Automating with Salt
      1. Understanding the Salt Architecture
      2. Getting Familiar with Salt
      3. Using Salt to Collect Network Status
      4. Managing Network Configurations with Salt
      5. Executing Salt Functions Remotely
      6. Diving into Salt’s Event-Driven Infrastructure
      7. Salt Summary
    4. Terraform
      1. Understanding Terraform Architecture
      2. Provisioning Your First Resource With Terraform
      3. Extending Terraform Execution
      4. Managing Terraform at Scale
      5. Terraform Out of its Comfort Zone
      6. Terraform Summary
    5. Summary
  6. About the Authors

Product information

  • Title: Network Programmability and Automation, 2nd Edition
  • Author(s): Matt Oswalt, Christian Adell, Scott S. Lowe, Jason Edelman
  • Release date: August 2023
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098110765