My Account Log in

3 options

Mastering Python networking : your one-stop solution to using Python for network automation, DevOps, and test--driven development / Eric Chou.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central College Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Chou, Eric, author.
Language:
English
Subjects (All):
Application software--Development.
Application software.
Computer networks--Management.
Computer networks.
Physical Description:
1 online resource (453 pages)
Edition:
Second edition.
Place of Publication:
Birmingham, UK : Packt Publishing, [2018]
System Details:
text file
Summary:
Master the art of using Python for a diverse range of network engineering tasks Key Features Explore the power of Python libraries to tackle difficult network problems efficiently and effectively Use Python for network device automation, DevOps, and software-defined networking Become an expert in implementing advanced network-related tasks with Python Book Description Networks in your infrastructure set the foundation for how your application can be deployed, maintained, and serviced. Python is the ideal language for network engineers to explore tools that were previously available to systems engineers and application developers. In this second edition of Mastering Python Networking, you'll embark on a Python-based journey to transition from traditional network engineers to network developers ready for the next-generation of networks. This book begins by reviewing the basics of Python and teaches you how Python can interact with both legacy and API-enabled network devices. As you make your way through the chapters, you will then learn to leverage high-level Python packages and frameworks to perform network engineering tasks for automation, monitoring, management, and enhanced security. In the concluding chapters, you will use Jenkins for continuous network integration as well as testing tools to verify your network. By the end of this book, you will be able to perform all networking tasks with ease using Python. What you will learn Use Python libraries to interact with your network Integrate Ansible 2.5 using Python to control Cisco, Juniper, and Arista eAPI network devices Leverage existing frameworks to construct high-level APIs Learn how to build virtual networks in the AWS Cloud Understand how Jenkins can be used to automatically deploy changes in your network Use PyTest and Unittest for Test-Driven Network Development Who this book is for Mastering Python Networking is for network engineers and programmers who want to use Python for networking. Basic familiarity with Python programming and networking-related concepts such as Transmission Control Protocol/Internet Protocol (TCP/IP) will be useful. Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Contents:
Cover
Title Page
Copyright and Credits
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: Review of TCP/IP Protocol Suite and Python
An overview of the internet
Servers, hosts, and network components
The rise of data centers
Enterprise data centers
Cloud data centers
Edge data centers
The OSI model
Client-server model
Network protocol suites
The transmission control protocol
Functions and characteristics of TCP
TCP messages and data transfer
User datagram protocol
The internet protocol
The IP NAT and security
IP routing concepts
Python language overview
Python versions
Operating system
Running a Python program
Python built-in types
The None type
Numerics
Sequences
Mapping
Sets
Python operators
Python control flow tools
Python functions
Python classes
Python modules and packages
Summary
Chapter 2: Low-Level Network Device Interactions
The challenges of the CLI
Constructing a virtual lab
Cisco VIRL
VIRL tips
Cisco DevNet and dCloud
GNS3
Python Pexpect library
Pexpect installation
Pexpect overview
Our first Pexpect program
More Pexpect features
Pexpect and SSH
Putting things together for Pexpect
The Python Paramiko library
Installation of Paramiko
Paramiko overview
Our first Paramiko program
More Paramiko features
Paramiko for servers
Putting things together for Paramiko
Looking ahead
Downsides of Pexpect and Paramiko compared to other tools
Idempotent network device interaction
Bad automation speeds bad things up
Chapter 3: APIs and Intent-Driven Networking
Infrastructure as code
Intent-Driven Networking
Screen scraping versus API structured output
Data modeling for infrastructure as code
The Cisco API and ACI.
Cisco NX-API
Lab software installation and device preparation
NX-API examples
The Cisco and YANG models
The Cisco ACI
The Python API for Juniper networks
Juniper and NETCONF
Device preparation
Juniper NETCONF examples
Juniper PyEZ for developers
Installation and preparation
PyEZ examples
The Arista Python API
Arista eAPI management
The eAPI preparation
eAPI examples
The Arista Pyeapi library
Pyeapi installation
Pyeapi examples
Vendor-neutral libraries
Chapter 4: The Python Automation Framework - Ansible Basics
A more declarative framework
A quick Ansible example
The control node installation
Running different versions of Ansible from source
Lab setup
Your first Ansible playbook
The public key authorization
The inventory file
Our first playbook
The advantages of Ansible
Agentless
Idempotent
Simple and extensible
Network vendor support
The Ansible architecture
YAML
Inventories
Variables
Templates with Jinja2
Ansible networking modules
Local connections and facts
Provider arguments
The Ansible Cisco example
Ansible 2.5 connection example
The Ansible Juniper example
The Ansible Arista example
Chapter 5: The Python Automation Framework - Beyond Basics
Ansible conditionals
The when clause
Ansible network facts
Network module conditional
Ansible loops
Standard loops
Looping over dictionaries
Templates
The Jinja2 template
Jinja2 loops
The Jinja2 conditional
Group and host variables
Group variables
Host variables
The Ansible Vault
The Ansible include and roles
The Ansible include statement
Ansible roles
Writing your own custom module
The first custom module
The second custom module
Chapter 6: Network Security with Python.
The lab setup
Python Scapy
Installing Scapy
Interactive examples
Sniffing
The TCP port scan
The ping collection
Common attacks
Scapy resources
Access lists
Implementing access lists with Ansible
MAC access lists
The Syslog search
Searching with the RE module
Other tools
Private VLANs
UFW with Python
Further reading
Chapter 7: Network Monitoring with Python - Part 1
SNMP
Setup
PySNMP
Python for data visualization
Matplotlib
Installation
Matplotlib - the first example
Matplotlib for SNMP results
Additional Matplotlib resources
Pygal
Pygal - the first example
Pygal for SNMP results
Additional Pygal resources
Python for Cacti
Python script as an input source
Chapter 8: Network Monitoring with Python - Part 2
Graphviz
Graphviz examples
Python with Graphviz examples
LLDP neighbor graphing
Information retrieval
Python parser script
Final playbook
Flow-based monitoring
NetFlow parsing with Python
Python socket and struct
ntop traffic monitoring
Python extension for ntop
sFlow
SFlowtool and sFlow-RT with Python
Elasticsearch (ELK stack)
Setting up a hosted ELK service
The Logstash format
Python helper script for Logstash formatting
Chapter 9: Building Network Web Services with Python
Comparing Python web frameworks
Flask and lab setup
Introduction to Flask
The HTTPie client
URL routing
URL variables
URL generation
The jsonify return
Network resource API
Flask-SQLAlchemy
Network content API
Devices API
The device ID API
Network dynamic operations
Asynchronous operations
Security
Additional resources
Chapter 10: AWS Cloud Networking.
AWS setup
AWS CLI and Python SDK
AWS network overview
Virtual private cloud
Route tables and route targets
Automation with CloudFormation
Security groups and the network ACL
Elastic IP
NAT Gateway
Direct Connect and VPN
VPN Gateway
Direct Connect
Network scaling services
Elastic Load Balancing
Route53 DNS service
CloudFront CDN services
Other AWS network services
Chapter 11: Working with Git
Introduction to Git
Benefits of Git
Git terminology
Git and GitHub
Setting up Git
Gitignore
Git usage examples
GitHub example
Collaborating with pull requests
Git with Python
GitPython
PyGitHub
Automating configuration backup
Collaborating with Git
Chapter 12: Continuous Integration with Jenkins
Traditional change-management process
Introduction to continuous integration
Installing Jenkins
Jenkins example
First job for the Python script
Jenkins plugins
Network continuous integration example
Jenkins with Python
Continuous integration for Networking
Chapter 13: Test-Driven Development for Networks
Test-driven development overview
Test definitions
Topology as code
Python's unittest module
More on Python testing
pytest examples
Writing tests for networking
Testing for reachability
Testing for network latency
Testing for security
Testing for transactions
Testing for network configuration
Testing for Ansible
Pytest in Jenkins
Jenkins integration
Other Books You May Enjoy
Index.
Notes:
Previous edition published: 2017.
Description based on print version record.
ISBN:
9781789130263
1789130263
OCLC:
1053901417

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Library Catalog Using Articles+ Library Account