Mastering Python Networking

Become an expert in implementing advanced, network-related tasks with Python.

Mastering Python Networking

Eric Chou

5 customer reviews
Become an expert in implementing advanced, network-related tasks with Python.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.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
$28.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781784397005
Paperback446 pages

Book Description

This book begins with a review of the TCP/ IP protocol suite and a refresher of the core elements of the Python language. Next, you will start using Python and supported libraries to automate network tasks from the current major network vendors. We will look at automating traditional network devices based on the command-line interface, as well as newer devices with API support, with hands-on labs. We will then learn the concepts and practical use cases of the Ansible framework in order to achieve your network goals.

We will then move on to using Python for DevOps, starting with using open source tools to test, secure, and analyze your network. Then, we will focus on network monitoring and visualization. We will learn how to retrieve network information using a polling mechanism, flow-based monitoring, and visualizing the data programmatically. Next, we will learn how to use the Python framework to build your own customized network web services.

In the last module, you will use Python for SDN, where you will use a Python-based controller with OpenFlow in a hands-on lab to learn its concepts and applications. We will compare and contrast OpenFlow, OpenStack, OpenDaylight, and NFV. Finally, you will use everything you’ve learned in the book to construct a migration plan to go from a legacy to a scalable SDN-based network.

 

Table of Contents

Chapter 1: Review of TCP/IP Protocol Suite and Python Language
The internet overview
The OSI model
Client server models
Network protocol suites
Python language overview
Chapter 2: Low-Level Network Device Interactions
The challenges of CLI
Constructing a virtual lab 
Python Pexpect Library
The Python Paramiko library
Looking ahead
Summary
Chapter 3: API and Intent-Driven Networking
Infrastructure as the Python code
The Cisco API and ACI
The Python API for Juniper networks
The Arista Python API
Vendor neutral libraries
Summary
Chapter 4: The Python Automation Framework - Ansible Basics
A quick Ansible example
The advantages of Ansible
The Ansible architecture
Ansible networking modules
The Ansible Cisco example
The Ansible Juniper example
The Ansible Arista example
Summary
Chapter 5: The Python Automation Framework - Ansible Advance Topics
Ansible conditionals
Ansible loops
Templates
Group and host variables
The Ansible vault
The Ansible include and roles
Writing your own custom module
Summary
Chapter 6: Network Security with Python
The lab setup
Python Scapy 
Access lists
The syslog search
Other tools 
Summary
Chapter 7: Network Monitoring with Python - Part 1
Lab setup
SNMP
Python visualization
Python for Cacti
Summary
Chapter 8: Network Monitoring with Python - Part 2
Graphviz
Flow-based monitoring
Elasticsearch (ELK stack)
Summary
Chapter 9: Building Network Web Services with Python
Comparing Python web frameworks 
Flask and lab setup
Introduction to Flask
Network static content API
Network dynamic operations
Security
Additional resources
Summary
Chapter 10: OpenFlow Basics
Lab setup
Introducing OpenFlow
Mininet
The Ryu controller with Python
Layer 2 OpenFlow switch
The POX controller
Summary
Chapter 11: Advanced OpenFlow Topics
Setup
OpenFlow operations with Ryu
Packet inspection
Static router
Router with API
BGP router with OpenFlow
Firewall with OpenFlow
Summary
Chapter 12: OpenStack, OpenDaylight, and NFV
OpenStack 
OpenDaylight
Summary
Chapter 13: Hybrid SDN
Preparing the network 
Greenfield deployment
Controller redundancy
BGP migration example
More BGP example
Monitoring integration
Secure TLS connection
Physical switch selection
Summary

What You Will Learn

  • Review all the fundamentals of Python and the TCP/IP suite
  • Use Python to execute commands when the device does not support the API or programmatic interaction with the device
  • Implement automation techniques by integrating Python with Cisco, Juniper, and Arista eAPI
  • Integrate Ansible using Python to control Cisco, Juniper, and Arista networks
  • Achieve network security with Python
  • Build Flask-based web-service APIs with Python
  • Construct a Python-based migration plan from a legacy to scalable SDN-based network.

Authors

Table of Contents

Chapter 1: Review of TCP/IP Protocol Suite and Python Language
The internet overview
The OSI model
Client server models
Network protocol suites
Python language overview
Chapter 2: Low-Level Network Device Interactions
The challenges of CLI
Constructing a virtual lab 
Python Pexpect Library
The Python Paramiko library
Looking ahead
Summary
Chapter 3: API and Intent-Driven Networking
Infrastructure as the Python code
The Cisco API and ACI
The Python API for Juniper networks
The Arista Python API
Vendor neutral libraries
Summary
Chapter 4: The Python Automation Framework - Ansible Basics
A quick Ansible example
The advantages of Ansible
The Ansible architecture
Ansible networking modules
The Ansible Cisco example
The Ansible Juniper example
The Ansible Arista example
Summary
Chapter 5: The Python Automation Framework - Ansible Advance Topics
Ansible conditionals
Ansible loops
Templates
Group and host variables
The Ansible vault
The Ansible include and roles
Writing your own custom module
Summary
Chapter 6: Network Security with Python
The lab setup
Python Scapy 
Access lists
The syslog search
Other tools 
Summary
Chapter 7: Network Monitoring with Python - Part 1
Lab setup
SNMP
Python visualization
Python for Cacti
Summary
Chapter 8: Network Monitoring with Python - Part 2
Graphviz
Flow-based monitoring
Elasticsearch (ELK stack)
Summary
Chapter 9: Building Network Web Services with Python
Comparing Python web frameworks 
Flask and lab setup
Introduction to Flask
Network static content API
Network dynamic operations
Security
Additional resources
Summary
Chapter 10: OpenFlow Basics
Lab setup
Introducing OpenFlow
Mininet
The Ryu controller with Python
Layer 2 OpenFlow switch
The POX controller
Summary
Chapter 11: Advanced OpenFlow Topics
Setup
OpenFlow operations with Ryu
Packet inspection
Static router
Router with API
BGP router with OpenFlow
Firewall with OpenFlow
Summary
Chapter 12: OpenStack, OpenDaylight, and NFV
OpenStack 
OpenDaylight
Summary
Chapter 13: Hybrid SDN
Preparing the network 
Greenfield deployment
Controller redundancy
BGP migration example
More BGP example
Monitoring integration
Secure TLS connection
Physical switch selection
Summary

Book Details

ISBN 139781784397005
Paperback446 pages
Read More
From 5 reviews

Read More Reviews

Recommended for You

Python: Master the Art of Design Patterns Book Cover
Python: Master the Art of Design Patterns
$ 67.99
$ 47.60
Neural Network Programming with Python Book Cover
Neural Network Programming with Python
$ 35.99
$ 25.20
Basic and Low-level Python Network Attacks [Video] Book Cover
Basic and Low-level Python Network Attacks [Video]
$ 124.99
$ 106.25
Python Network Programming Cookbook - Second Edition Book Cover
Python Network Programming Cookbook - Second Edition
$ 39.99
$ 28.00
Learning Python Network Programming Book Cover
Learning Python Network Programming
$ 39.99
$ 28.00
Python Network Programming Cookbook Book Cover
Python Network Programming Cookbook
$ 26.99
$ 18.90