Book Image

Python Network Programming Cookbook - Second Edition

By : Pradeeban Kathiravelu, Gary Berger, Dr. M. O. Faruque Sarker
Book Image

Python Network Programming Cookbook - Second Edition

By: Pradeeban Kathiravelu, Gary Berger, Dr. M. O. Faruque Sarker

Overview of this book

Python Network Programming Cookbook - Second Edition highlights the major aspects of network programming in Python, starting from writing simple networking clients to developing and deploying complex Software-Defined Networking (SDN) and Network Functions Virtualization (NFV) systems. It creates the building blocks for many practical web and networking applications that rely on various networking protocols. It presents the power and beauty of Python to solve numerous real-world tasks in the area of network programming, network and system administration, network monitoring, and web-application development. In this edition, you will also be introduced to network modelling to build your own cloud network. You will learn about the concepts and fundamentals of SDN and then extend your network with Mininet. Next, you’ll find recipes on Authentication, Authorization, and Accounting (AAA) and open and proprietary SDN approaches and frameworks. You will also learn to configure the Linux Foundation networking ecosystem and deploy and automate your networks with Python in the cloud and the Internet scale. By the end of this book, you will be able to analyze your network security vulnerabilities using advanced network packet capture and analysis techniques.
Table of Contents (15 chapters)

What this book covers

Chapter 1, Sockets, IPv4, and Simple Client/Server Programming, introduces you to Python's core networking library with various small tasks and enables you to create your first client-server application.

Chapter 2, Multiplexing Socket I/O for Better Performance, discusses various useful techniques for scaling your client/server applications with default and third-party libraries.

Chapter 3, IPv6, Unix Domain Sockets, and Network Interfaces, focuses more on administering your local machine and looking after your local area network.

Chapter 4, Programming with HTTP for the Internet, enables you to create a mini command-line browser with various features such as submitting web forms, handling cookies, managing partial downloads, compressing data, and serving secure content over HTTPS.

Chapter 5, Email Protocols, FTP, and CGI Programming, brings you the joy of automating your FTP and e-mail tasks such as manipulating your Gmail account, and reading or sending emails from a script or creating a guest book for your web application. We learn to write email clients with SMTP and POP3.

Chapter 6, Programming Across Machine Boundaries, gives you a taste of automating your system administration and deployment tasks over SSH. You can run commands, install packages, or set up new websites remotely from your laptop.

Chapter 7, Working with Web Services - XML-RPC, SOAP, and REST, introduces you to various API protocols such as XML-RPC, SOAP, and REST. You can programmatically ask any website or web service for information and interact with them. For example, you can search for products on Amazon or Google.

Chapter 8, Network Monitoring and Security, introduces you to various techniques for capturing, storing, analyzing, and manipulating network packets. This encourages you to go further to investigate your network security issues using concise Python scripts.

Chapter 9, Network Modeling, introduces you to the world of network simulations and emulations. You learn to simulate networks with NS-3, and emulate networking systems with Mininet and its extensions.

Chapter 10, Getting Started with SDN, discusses the enterprise SDN controllers, configuring them to use in Software-Defined Networks. We learn to develop SDN visually with MiniEdit, and configure the networks with OpenDaylight, ONOS, Floodlight, Ryu, and POX controllers.

Chapter 11, Authentication, Authorization, and Accounting (AAA), introduces how the networks are secured, and discusses configuring LDAP clients with Python, accounting aspects of the network, and authentication and access of network services.

Chapter 12, Open and Proprietary Networking Solutions, discusses in detail, configuring large-scale enterprise networking projects, including a few projects from Cisco, Juniper, VMware, and the Linux Foundation.

Chapter 13, NFV and Orchestration - A Larger Ecosystem, discusses configuring complex NFV and orchestration systems of the Linux Foundation, such as OPNFV, DPDK, SNAS.io, Dronekit, and PNDA. We elaborate the use of Python in these complex systems.

Chapter 14, Programming the Internet, presents you various Python libraries for BGP protocol and implementations developed for the internet scale. We learn to use and benchmark libraries such as exabgp and yabgp, and also discuss the looking glass implementations with Python.