Book description
Power up your network applications with Python programming
Key Features
- Master Python skills to develop powerful network applications
- Grasp the fundamentals and functionalities of SDN
- Design multi-threaded, event-driven architectures for echo and chat servers
Book Description
This Learning Path highlights major aspects of Python network programming such as writing simple networking clients, creating and deploying SDN and NFV systems, and extending your network with Mininet. You'll also learn how to automate legacy and the latest network devices. As you progress through the chapters, you'll use Python for DevOps and open source tools to test, secure, and analyze your network. Toward the end, you'll develop client-side applications, such as web API clients, email clients, SSH, and FTP, using socket programming.
By the end of this Learning Path, you will have learned how to analyze a network's security vulnerabilities using advanced network packet capture and analysis techniques.
This Learning Path includes content from the following Packt products:
- Practical Network Automation by Abhishek Ratan
- Mastering Python Networking by Eric Chou
- Python Network Programming Cookbook, Second Edition by Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker
What you will learn
- Create socket-based networks with asynchronous models
- Develop client apps for web APIs, including S3 Amazon and Twitter
- Talk to email and remote network servers with different protocols
- Integrate Python with Cisco, Juniper, and Arista eAPI for automation
- Use Telnet and SSH connections for remote system monitoring
- Interact with websites via XML-RPC, SOAP, and REST APIs
- Build networks with Ryu, OpenDaylight, Floodlight, ONOS, and POX
- Configure virtual networks in different deployment environments
Who this book is for
If you are a Python developer or a system administrator who wants to start network programming, this Learning Path gets you a step closer to your goal. IT professionals and DevOps engineers who are new to managing network devices or those with minimal experience looking to expand their knowledge and skills in Python will also find this Learning Path useful. Although prior knowledge of networking is not required, some experience in Python programming will be helpful for a better understanding of the concepts in the Learning Path.
Table of contents
- Title Page
- Copyright
- About Packt
- Contributors
- Preface
- Fundamental Concepts
- Python for Network Engineers
- Continuous Integration for Network Engineers
- SDN Concepts in Network Automation
- Low-Level Network Device Interactions
- APIs and Intent-Driven Networking
- The Python Automation Framework – Ansible Basics
- The Python Automation Framework – Beyond Basics
- AWS Cloud Networking
- Working with Git
-
Sockets, IPv4, and Simple Client/Server Programming
- Introduction
- Printing your machine's name and IPv4 address
- Retrieving a remote machine's IP address
- Converting an IPv4 address to different formats
- Finding a service name, given the port and protocol
- Converting integers to and from host to network byte order
- Setting and getting the default socket timeout
- Handling socket errors gracefully
- Modifying a socket's send/receive buffer sizes
- Changing a socket to the blocking/non-blocking mode
- Reusing socket addresses
- Printing the current time from the internet time server
- Writing an SNTP client
- Writing a simple TCP echo client/server application
- Writing a simple UDP echo client/server application
- Multiplexing Socket I/O for Better Performance
-
IPv6, Unix Domain Sockets, and Network Interfaces
- Introduction
- Forwarding a local port to a remote host
- Pinging hosts on the network with ICMP
- Waiting for a remote network service
- Enumerating interfaces on your machine
- Finding the IP address for a specific interface on your machine
- Finding whether an interface is up on your machine
- Detecting inactive machines on your network
- Performing a basic IPC using connected sockets (socketpair)
- Performing IPC using Unix domain sockets
- Finding out if your Python supports IPv6 sockets
- Extracting an IPv6 prefix from an IPv6 address
- Writing an IPv6 echo client/server
-
Programming with HTTP for the Internet
- Introduction
- Downloading data from an HTTP server
- Serving HTTP requests from your machine
- Extracting cookie information after visiting a website
- Submitting web forms
- Sending web requests through a proxy server
- Checking whether a web page exists with the HEAD request
- Spoofing Mozilla Firefox in your client code
- Saving bandwidth in web requests with the HTTP compression
- Writing an HTTP fail-over client with resume and partial downloading
- Writing a simple HTTPS server code with Python and OpenSSL
- Building asynchronous network applications with Twisted
- Building asynchronous network applications with Tornado
- Building concurrent applications with Tornado Future
-
Email Protocols, FTP, and CGI Programming
- Introduction
- Listing the files in a remote FTP server
- Uploading a local file to a remote FTP server
- Emailing your current working directory as a compressed ZIP file
- Downloading your Google email with POP3
- Checking your remote email with IMAP
- Sending an email with an attachment via Gmail SMTP server
- Writing a guestbook for your (Python-based) web server with CGI
- Finding the mail server from an email address
- Writing a simple SMTP server
- Writing a secure SMTP client using TLS
- Writing an email client with POP3
-
Programming Across Machine Boundaries
- Introduction
- Executing a remote shell command using telnet
- Copying a file to a remote machine by SFTP
- Printing a remote machine's CPU information
- Installing a Python package remotely
- Running a MySQL command remotely
- Transferring files to a remote machine over SSH
- Configuring Apache remotely to host a website
-
Working with Web Services – SOAP, and REST
- Introduction
- Querying a local XML-RPC server
- Writing a multithreaded, multicall XML-RPC server
- Running an XML-RPC server with a basic HTTP authentication
- Collecting some photo information from Flickr using REST
- Searching for SOAP methods from an Amazon S3 web service
- Searching Amazon for books through the product search API
- Creating RESTful web applications with Flask
-
Network Monitoring and Security
- Introduction
- Sniffing packets on your network
- Saving packets in the pcap format using the pcap dumper
- Adding an extra header in HTTP packets
- Scanning the ports of a remote host
- Customizing the IP address of a packet
- Replaying traffic by reading from a saved pcap file
- Scanning the broadcast of packets
- Network Modeling
- Authentication, Authorization, and Accounting (AAA)
- Open and Proprietary Networking Solutions
- NFV and Orchestration – A Larger Ecosystem
- Programming the Internet
- Other Books You May Enjoy
Product information
- Title: Python Network Programming
- Author(s):
- Release date: January 2019
- Publisher(s): Packt Publishing
- ISBN: 9781788835466
You might also like
video
Python Network Programming for Network Engineers (Python 3)
The days of configuring Cisco networks only with the command-line interface (CLI) are ending. Do you …
book
Python Network Programming Techniques
Become well-versed with network programmability by solving the most commonly encountered problems using Python 3 and …
book
Python Network Programming Cookbook - Second Edition
Discover practical solutions for a wide range of real-world network programming tasksAbout This Book Solve real-world …
book
Mastering Python Networking - Third Edition
New edition of the bestselling guide to mastering Python Networking, updated to Python 3 and including …