100% found this document useful (2 votes)
23 views

Instant ebooks textbook Python Network Programming Cookbook Practical solutions to overcome real world networking challenges 2nd Edition Pradeeban Kathiravelu download all chapters

challenges

Uploaded by

mosuovreindl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
23 views

Instant ebooks textbook Python Network Programming Cookbook Practical solutions to overcome real world networking challenges 2nd Edition Pradeeban Kathiravelu download all chapters

challenges

Uploaded by

mosuovreindl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Python Network Programming Cookbook Practical


solutions to overcome real world networking
challenges 2nd Edition Pradeeban Kathiravelu

https://textbookfull.com/product/python-network-programming-
cookbook-practical-solutions-to-overcome-real-world-
networking-challenges-2nd-edition-pradeeban-kathiravelu/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Python Network Programming Cookbook Kathiravelu

https://textbookfull.com/product/python-network-programming-cookbook-
kathiravelu/

textboxfull.com

Practical Packet Analysis Using Wireshark to Solve Real


World Network Proble 3rd Edition Safari

https://textbookfull.com/product/practical-packet-analysis-using-
wireshark-to-solve-real-world-network-proble-3rd-edition-safari/

textboxfull.com

Python GUI Programming Cookbook Meier

https://textbookfull.com/product/python-gui-programming-cookbook-
meier/

textboxfull.com

Programming Excel with VBA A Practical Real World Guide


Flavio Morgado

https://textbookfull.com/product/programming-excel-with-vba-a-
practical-real-world-guide-flavio-morgado/

textboxfull.com
Body Area Network Challenges and Solutions R. Maheswar

https://textbookfull.com/product/body-area-network-challenges-and-
solutions-r-maheswar/

textboxfull.com

Python GUI Programming Cookbook Burkhard A. Meier

https://textbookfull.com/product/python-gui-programming-cookbook-
burkhard-a-meier/

textboxfull.com

Python Real World Machine Learning: Real World Machine


Learning: Take your Python Machine learning skills to the
next level 1st Edition Joshi
https://textbookfull.com/product/python-real-world-machine-learning-
real-world-machine-learning-take-your-python-machine-learning-skills-
to-the-next-level-1st-edition-joshi/
textboxfull.com

Practical Python Design Patterns: Pythonic Solutions to


Common Problems Badenhorst

https://textbookfull.com/product/practical-python-design-patterns-
pythonic-solutions-to-common-problems-badenhorst/

textboxfull.com

Network Analysis Using Wireshark 2 Cookbook: Practical


recipes to analyze and secure your network using Wireshark
2, 2nd Edition Nagendra Kumar Nainar
https://textbookfull.com/product/network-analysis-using-
wireshark-2-cookbook-practical-recipes-to-analyze-and-secure-your-
network-using-wireshark-2-2nd-edition-nagendra-kumar-nainar/
textboxfull.com
Python Network Programming Cookbook
Second Edition

Overcome real-world networking challenges

Pradeeban Kathiravelu
Dr. M. O. Faruque Sarker

BIRMINGHAM - MUMBAI
Python Network Programming Cookbook
Second Edition
Copyright © 2017 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the authors, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be caused
directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: March 2014

Second edition: August 2017

Production reference: 1080817


Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-78646-399-9

www.packtpub.com
Credits

Authors Copy Editors


Pradeeban Kathiravelu Safis Editing
Dr. M. O. Faruque Sarker Juliana Nair

Reviewers Project Coordinator


Dr. S. Gowrishankar Judie Jose
Michael Bright

Commissioning Editor Proofreader


Kartikey Pandey Safis Editing

Acquisition Editor Indexer


Rahul Nair Aishwarya Gangawane

Content Development Editor Graphics


Abhishek Jadhav Kirk D'Penha

Technical Editor Production Coordinator


Mohd Riyan Khan Aparna Bhagat
About the Author
Pradeeban Kathiravelu is an open source evangelist. He is a Ph.D. researcher at INESC-ID
Lisboa/Instituto Superior Tecnico, Universidade de Lisboa, Portugal, and Universite
Catholique de Louvain, Belgium. He is a Fellow of Erasmus Mundus Joint Degree in
Distributed Computing (EMJD-DC), researching a software-defined approach to quality of
service and data quality in multi-tenant clouds.

Pradeeban holds a master of science degree, Erasmus Mundus European Master in


Distributed Computing (EMDC), from Instituto Superior Tecnico, Portugal and KTH Royal
Institute of Technology, Sweden. He also holds a first class bachelor of science in
engineering (Hons) degree, majoring in computer science and engineering, from the
University of Moratuwa, Sri Lanka. His research interests include Software-Defined
Networking (SDN), distributed systems, cloud computing, web services, big data in
biomedical informatics, Network Functions Virtualizations (NFV), and data mining. He is
very interested in free and open source software development and has been an active
participant in the Google Summer of Code (GSoC) program since 2009, as a student and as a
mentor.

Pradeeban has published several conference papers and co-authored a few book chapters.
He has also worked on OpenDaylight Cookbook and Learning OpenDaylight as a technical
reviewer. Python Network Programming Cookbook, Second Edition (2017) is his first book as an
author, and he is quite excited about it.

I would like to thank my readers for the interest in the book. Please feel free to contact me if
you need any assistance in the topics or the recipes, beyond what we have discussed in the
book. I would like to thank the entire editorial team at Packt, including Abhishek Jadhav,
Rahul Nair, and Mohd Riyan Khan. I would like to extend my thanks to the Linux
Foundation for their open source projects on softwarization of networks and systems. I
would like to thank my friends and colleagues who helped me in various ways. I would like
to thank Prof. Luís Veiga (INESC-ID Lisboa), my MSc and Ph.D. advisor, for sharing his
wisdom and encouragement throughout my stay in Instituto Superior Técnico. I would
like to thank him for being my mentor since 2012. I would also like to thank Prof. Ashish
Sharma (Emory University, Atlanta) for his guidance and motivation.

My special thanks go to my loving wife, Juejing Gu. This book would not be a reality
without her continuous support and creative suggestions. Her tireless efforts helped me
always be on time without missing the deadlines.
I would like to thank my mom, Selvathie Kathiravelu, for her support.
Dr. M. O. Faruque Sarker is a software architect based in London, UK, where he has been
shaping various Linux and open source software solutions, mainly on cloud computing
platforms, for commercial companies, educational institutions, and multinational
consultancies. Over the past 10 years, he has been leading a number of Python software
development and cloud infrastructure automation projects. In 2009, he started using
Python, where he was responsible for shepherding a fleet of miniature E-puck robots at the
University of South Wales, Newport, UK. Later, he honed his Python skills, and he was
invited to work on the Google Summer of Code (2009/2010) programs for contributing to
the BlueZ and Tahoe-LAFS open source projects. He is the author of Python Network
Programming Cookbook and Learning Python Network Programming both by Packt Publishing.

He received his Ph.D. in multi-robot systems from the University of South Wales. He is
currently working at University College London. He takes an active interest in cloud
computing, software security, intelligent systems, and child-centric education. He lives in
East London with his wife, Shahinur, and daughter, Ayesha.

All praises and thanks to Allah, the God who is the Merciful and the Beneficent. I would
not be able to finish this book without the help of God.I would like to thank everyone who
has contributed to the publication of this book, including the publisher, technical reviewers,
editors, my family and friends for their sacrifice of time, encouraging words, and smiles,
especially my wife Shahinur Rijuani for her love and support in my work. I also thank the
readers who have patiently been waiting for this book and who have given me lots of
valuable feedback.
About the Reviewers
Dr. S. Gowrishankar is currently working as an associate professor in the Department of
Computer Science and Engineering at Dr. Ambedkar Institute of Technology, Bengaluru,
Karnataka, India.

He received his Ph.D. in Engineering from Jadavpur University, Kolkata, West Bengal,
India in 2010, MTech in software engineering and BE in computer science and engineering
from Visvesvaraya Technological University (VTU), Belagavi, Karnataka, India in the year
2005 and 2003 respectively.

From 2011 to 2014 he worked as a senior research scientist and tech lead at Honeywell
Technology Solutions, Bengaluru, Karnataka, India.

He has published several papers in various reputed international journals and conferences.
He is serving as an editor and reviewer for various prestigious international journals. He is
also a member of IEEE, ACM, CSI, and ISTE.

He has delivered many keynote addresses and invited talks throughout India on a variety
of subjects related to computer science and engineering. He was instrumental in organizing
several conferences, workshops, and seminars. He has also served on the panel of a number
of academic bodies of universities and autonomous colleges as a BOS and BOE member.

His current research interests are mainly focused on data science, including its technical
aspects as well as its applications and implications. Specifically, he is interested in the
applications of Machine Learning, Data Mining, and Big Data Analytics in Healthcare.

I would like to acknowledge my earnest gratitude to my wife, Roopa K M, for her constant
source of support and encouragement throughout this assignment. I’m truly thankful to
almighty God for having her in my life and give her my deepest expression of love and
appreciation.
Michael Bright, RHCE/RHCSA, is a solution architect working in the HPE EMEA Customer
Innovation Center.

He has strong experience across Cloud and Container technologies (Docker, Kubernetes,
AWS, GCP, Azure) as well as NFV/SDN.

Based in Grenoble, France, he runs a Python user group and is a co-organizer of the Docker
and FOSS Meetup groups. He has a keen interest in Container, Orchestration, and
Unikernel technologies on which he has presented and run training tutorials in several
conferences.
He has presented many times on subjects diverse as NFV, Docker, Container Orchestration,
Unikernels, Jupyter Notebooks, MongoDB, and Tmux.

Michael has a wealth of experience across pure research, R&D and pre-sales consulting
roles.
www.PacktPub.com
For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.comand as a
print book customer, you are entitled to a discount on the eBook copy. Get in touch with us
at [email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters and receive exclusive discounts and offers on Packt books and
eBooks.

https://www.packtpub.com/mapt

Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt
books and video courses, as well as industry-leading tools to help you plan your personal
development and advance your career.

Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Customer Feedback
Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial
process. To help us improve, please leave us an honest review on this book's Amazon page
at https://www.amazon.com/dp/1786463997.

If you'd like to join our team of regular reviewers, you can e-mail us at
[email protected]. We award our regular reviewers with free eBooks and
videos in exchange for their valuable feedback. Help us be relentless in improving our
products!
I dedicate this book to the world, in memory of my dad, Kanapathipillai Kathiravelu.
Table of Contents
Preface 1
Chapter 1: Sockets, IPv4, and Simple Client/Server Programming 11
Introduction 12
Printing your machine's name and IPv4 address 12
Getting ready 12
How to do it... 13
How it works... 15
Retrieving a remote machine's IP address 16
How to do it... 16
How it works... 17
Converting an IPv4 address to different formats 18
How to do it... 18
How it works... 19
Finding a service name, given the port and protocol 19
Getting ready 19
How to do it... 19
How it works... 20
Converting integers to and from host to network byte order 20
How to do it... 20
How it works... 21
Setting and getting the default socket timeout 22
How to do it... 22
How it works... 23
Handling socket errors gracefully 23
How to do it... 23
How it works... 25
Modifying a socket's send/receive buffer sizes 26
How to do it... 26
How it works... 28
Changing a socket to the blocking/non-blocking mode 28
How to do it... 28
How it works... 29
Reusing socket addresses 29
How to do it... 30
How it works... 32
Printing the current time from the internet time server 32
Getting ready 32
How to do it... 33
How it works... 34
Writing an SNTP client 34
How to do it... 34
How it works... 35
Writing a simple TCP echo client/server application 36
How to do it... 36
How it works... 39
Writing a simple UDP echo client/server application 39
How to do it... 39
How it works... 42
Chapter 2: Multiplexing Socket I/O for Better Performance 43
Introduction 43
Using ForkingMixIn in your socket server applications 44
How to do it... 44
How it works... 47
Using ThreadingMixIn in your socket server applications 48
Getting ready 48
How to do it... 48
How it works... 50
Writing a chat server using select.select 50
How to do it... 51
How it works... 58
Multiplexing a web server using select.epoll 58
How to do it... 58
How it works... 61
Multiplexing an echo server using Diesel concurrent library 62
Getting ready 62
How to do it... 64
How it works... 66
Chapter 3: IPv6, Unix Domain Sockets, and Network Interfaces 67
Introduction 67
Forwarding a local port to a remote host 68
How to do it... 68
How it works... 71

[ ii ]
Pinging hosts on the network with ICMP 72
Getting ready 72
How to do it... 72
How it works... 76
Waiting for a remote network service 77
How to do it... 77
How it works... 80
Enumerating interfaces on your machine 80
Getting ready 81
How to do it... 81
How it works... 82
Finding the IP address for a specific interface on your machine 83
Getting ready 83
How to do it... 83
How it works... 84
Finding whether an interface is up on your machine 85
Getting ready 85
How to do it... 85
How it works... 86
Detecting inactive machines on your network 87
Getting ready 87
How to do it... 87
How it works... 89
Performing a basic IPC using connected sockets (socketpair) 89
Getting ready 89
How to do it... 90
How it works... 91
Performing IPC using Unix domain sockets 91
How to do it... 91
How it works... 94
Finding out if your Python supports IPv6 sockets 94
Getting ready 94
How to do it... 95
How it works... 96
Extracting an IPv6 prefix from an IPv6 address 97
How to do it... 97
How it works... 99
Writing an IPv6 echo client/server 99
How to do it... 99

[ iii ]
How it works... 102
Chapter 4: Programming with HTTP for the Internet 103
Introduction 104
Downloading data from an HTTP server 104
How to do it... 104
How it works... 107
Serving HTTP requests from your machine 107
How to do it... 108
How it works... 110
Extracting cookie information after visiting a website 110
How to do it... 110
How it works... 113
Submitting web forms 114
Getting ready 114
How to do it... 114
How it works... 116
Sending web requests through a proxy server 116
Getting ready 116
How to do it... 116
How it works... 118
Checking whether a web page exists with the HEAD request 118
How to do it... 119
How it works... 121
Spoofing Mozilla Firefox in your client code 121
How to do it... 121
How it works... 122
Saving bandwidth in web requests with the HTTP compression 122
How to do it... 123
How it works... 125
Writing an HTTP fail-over client with resume and partial downloading 125
How to do it... 126
How it works... 127
Writing a simple HTTPS server code with Python and OpenSSL 128
Getting ready 128
How to do it... 128
How it works... 129
Building asynchronous network applications with Twisted 130
Getting ready 130
How to do it... 131

[ iv ]
How it works... 134
Building asynchronous network applications with Tornado 134
Getting ready 134
How to do it... 134
How it works... 136
Building concurrent applications with Tornado Future 137
Getting ready 137
How to do it... 137
How it works... 140
Chapter 5: Email Protocols, FTP, and CGI Programming 141
Introduction 141
Listing the files in a remote FTP server 142
Getting ready 142
How to do it... 142
How it works... 144
Common error 144
Uploading a local file to a remote FTP server 146
Getting ready 146
How to do it... 146
How it works... 147
Emailing your current working directory as a compressed ZIP file 148
Getting ready 148
How to do it... 148
How it works... 151
See also 152
Downloading your Google email with POP3 152
Getting ready 152
How to do it... 152
How it works... 153
Checking your remote email with IMAP 153
Getting ready 154
How to do it... 154
How it works... 155
Sending an email with an attachment via Gmail SMTP server 156
Getting ready 156
How to do it... 156
How it works... 158
Writing a guestbook for your (Python-based) web server with CGI 158
Getting ready 158

[v]
How to do it... 158
How it works... 162
Finding the mail server from an email address 163
Getting ready 163
How to do it... 164
How it works... 166
Writing a simple SMTP server 166
Getting ready 166
How to do it... 166
How it works... 169
Writing a secure SMTP client using TLS 170
Getting ready 170
How to do it... 170
How it works... 172
Writing an email client with POP3 173
Getting ready 173
How to do it... 174
How it works... 175
Chapter 6: Programming Across Machine Boundaries 176
Introduction 176
Executing a remote shell command using telnet 177
Getting ready 177
How to do it... 177
How it works... 179
Copying a file to a remote machine by SFTP 179
Getting ready 179
How to do it... 180
How it works... 181
Printing a remote machine's CPU information 182
Getting ready 182
How to do it... 182
How it works... 186
Installing a Python package remotely 186
Getting ready 187
How to do it... 187
How it works... 189
Running a MySQL command remotely 189
Getting ready 189
How to do it... 190

[ vi ]
How it works... 193
Transferring files to a remote machine over SSH 193
Getting ready 193
How to do it... 194
How it works... 196
Configuring Apache remotely to host a website 196
Getting ready 197
How to do it... 197
How it works... 199
Chapter 7: Working with Web Services – XML-RPC, SOAP, and REST 201
Introduction 201
Querying a local XML-RPC server 202
Getting ready 202
How to do it... 202
How it works... 204
Writing a multithreaded, multicall XML-RPC server 205
How to do it... 205
How it works... 207
Running an XML-RPC server with a basic HTTP authentication 208
How to do it... 208
How it works... 212
Collecting some photo information from Flickr using REST 213
How to do it... 213
How it works... 217
Searching for SOAP methods from an Amazon S3 web service 217
Getting ready 217
How to do it... 218
How it works... 219
Searching Amazon for books through the product search API 219
Getting ready 220
How to do it... 220
How it works... 222
Creating RESTful web applications with Flask 222
Getting ready 223
How to do it... 223
How it works... 226
Chapter 8: Network Monitoring and Security 227
Introduction 227

[ vii ]
Sniffing packets on your network 228
Getting ready 228
How to do it... 228
How it works... 230
Saving packets in the pcap format using the pcap dumper 230
How to do it... 231
How it works... 234
Adding an extra header in HTTP packets 235
How to do it... 235
How it works... 236
Scanning the ports of a remote host 237
How to do it... 237
How it works... 239
Customizing the IP address of a packet 239
How to do it... 239
How it works... 241
Replaying traffic by reading from a saved pcap file 241
How to do it... 241
How it works... 243
Scanning the broadcast of packets 244
How to do it... 244
How it works... 246
Chapter 9: Network Modeling 247
Introduction 247
Simulating networks with ns-3 248
Getting ready 248
How to do it... 250
How it works... 252
Emulating networks with Mininet 252
Getting ready 253
How to do it... 253
How it works... 255
Distributed network emulation with MaxiNet 255
Getting ready 256
How to do it... 257
How it works... 258
Emulating wireless networks with Mininet-WiFi 259
Getting ready 259
How to do it... 259

[ viii ]
How it works... 263
Extending Mininet to emulate containers 264
Getting ready 265
How to do it... 266
How it works... 270
Chapter 10: Getting Started with SDN 271
Introduction 271
SDN emulation with Mininet 272
Getting ready 272
How to do it... 272
How it works... 275
Developing Software-Defined Networks with OpenDaylight controller 276
Getting ready 276
How to do it... 278
How it works... 281
Developing Software-Defined Networks with ONOS controller 281
Getting ready 282
How to do it... 284
How it works... 286
Developing Software-Defined Networks with Floodlight controller 286
Getting ready 287
How to do it... 290
How it works... 293
Developing Software-Defined Networks with Ryu controller 293
Getting ready 293
How to do it... 294
How it works... 298
Developing Software-Defined Networks with POX controller 299
Getting ready 299
How to do it... 301
How it works... 302
Developing Software-Defined Networks visually with MiniEdit 303
Getting ready 303
How to do it... 303
How it works... 307
Chapter 11: Authentication, Authorization, and Accounting (AAA) 308
Introduction 309
Finding DNS names of a network 309

[ ix ]
Getting ready 309
How to do it... 309
How it works... 311
Finding DNS host information 311
Getting ready 311
How to do it... 311
How it works... 313
Finding DNS resource records 313
Getting ready 315
How to do it... 315
How it works... 318
Making DNS zone transfer 319
Getting ready 319
How to do it... 319
How it works... 323
Querying NTP servers 323
Getting ready 323
How to do it... 323
How it works... 325
Connecting to an LDAP server 325
Getting ready 326
How to do it... 327
How it works... 330
Making LDAP bind 331
Getting ready 331
How to do it... 331
How it works... 333
Reading and writing LDAP 333
Getting ready 333
How to do it... 334
How it works... 335
Authenticating REST APIs with Eve 336
Getting ready 336
How to do it... 336
How it works... 338
Throttling requests with RequestsThrottler 338
Getting ready 339
How to do it... 339
How it works... 342

[x]
Chapter 12: Open and Proprietary Networking Solutions 343
Introduction 343
Configuring Red PNDA 344
Getting ready 344
How to do it... 344
How it works... 347
Configuring VMware NSX for vSphere 6.3.2 348
Getting ready 348
How to do it... 349
How it works... 350
Configuring Juniper Contrail Server Manager 351
Getting ready 351
How to do it... 354
How it works... 355
Configuring OpenContrail controller 355
Getting ready 356
How to do it... 356
How it works... 357
Configuring OpenContrail cluster 357
How to do it... 358
How it works... 363
Interacting with devices running Cisco IOS XR 363
Getting ready 364
How to do it... 364
How it works... 364
Collaborating with Cisco Spark API 365
Getting ready 365
How to do it... 367
How it works... 368
Chapter 13: NFV and Orchestration – A Larger Ecosystem 369
Introduction 369
Building VNFs with OPNFV 370
Getting ready 370
How to do it... 371
How it works... 373
Packet processing with DPDK 376
Getting ready 377
How to do it... 379

[ xi ]
How it works... 379
Parsing BMP messages with SNAS.io 380
Getting ready 381
How to do it... 382
How it works... 386
Controlling drones with a wireless network 387
Getting ready 387
How to do it... 387
How it works... 390
Creating PNDA clusters 390
Getting ready 391
How to do it... 394
How it works... 395
Chapter 14: Programming the Internet 396
Introduction 396
Checking a website status 396
Getting ready 397
How to do it... 397
How it works... 398
Benchmarking BGP implementations with bgperf 398
Getting ready 398
How to do it... 400
How it works... 400
BGP with ExaBGP 401
Getting ready 401
How to do it... 401
Looking glass implementations with Python 402
Getting ready 404
How to do it... 405
How it works... 407
Understanding the internet ecosystem with Python 407
Getting ready 408
How to do it... 409
How it works... 410
Establishing BGP connections with yabgp 410
Getting ready 411
How to do it... 411
How it works... 413

[ xii ]
Index 414

[ xiii ]
Preface
It has been more than 3 years since Python Network Programming Cookbook was first
published. In this second edition, we extend our book to discuss the recent advancements in
the networking industry and network softwarization. The widespread use of Software-
Defined Networking (SDN), Network Functions Virtualization (NFV), and orchestration
have been addressed in detail in the latter chapters while the first eight chapters were taken
from the first edition, improved with a few new recipes based on the feedback from the
readers.

This book is an exploratory guide to network programming in Python. It has touched a


wide range of networking protocols such as TCP/UDP, HTTP/HTTPS, FTP, SMTP, POP3,
IMAP, and CGI. With the power and interactivity of Python, it brings joy and fun to
develop various scripts for performing real-world tasks on network and system
administration, web application development, interacting with your local and remote
network, low-level network packet capture and analysis, and so on. The primary focus of
this book is to give you a hands-on experience on the topics covered. So, this book covers
less theory, but it is packed with practical materials.

This book is written with a DevOps mindset, where a developer is also more or less in
charge of operation, that is, deploying the application and managing various aspects of it,
such as remote server administration, monitoring, scaling-up, and optimizing for better
performance. This book introduces you to a bunch of open-source, third-party Python
libraries, which are ideal to be used in various use cases. We elaborate in detail the
configurations of complex networking systems with helpful hints to ensure that the reader
can follow them without getting stuck.

We hope you will enjoy the recipes presented in this book and extend them to make them
even more powerful and enjoyable.

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.
Preface

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.

[2]
Preface

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.

What you need for this book


You need a working PC or laptop, preferably with a modern Linux operating system. The
installation instructions are written and tested on Ubuntu 16.04 LTS and would work on
any recent Debian-based Linux operating system without modification. We developed for
Python 3. However, we have maintained backward-compatibility with Python 2 in our
recipes as much as we can. On the other hand, some open source projects used in this book
do not yet support Python 3. So, ideally, you will need both Python 2 and Python 3 to test
all the recipes in this book.

Most of the recipes in this book will run on other platforms such as Windows and Mac OS
with some changes in the configuration steps. Some of the recipes require two or more
computers in a cluster to test the distributed systems. You may use Amazon Web Services
(AWS) to initiate a cluster inside a single placement group to test these recipes.

You also need a working internet connection to install the third-party software libraries
mentioned with respective recipes. If you do not have a stable or continuous internet
connection, you can download the third-party libraries and install them in one go.
However, it is highly recommended to test some of these recipes with the internet
connection, as it would make the configuration task minimal and more interesting, than
having to download a bulk of software in bunch. Moreover, testing the application in an
AWS cluster would certainly require the internet connectivity.

The following is a list of the Python third-party libraries with their download URLs:

ntplib: https://pypi.python.org/pypi/ntplib/
diesel: https://pypi.python.org/pypi/diesel/
nmap: https://pypi.python.org/pypi/python-nmap
scapy: https://pypi.python.org/pypi/scapy
netifaces: https://pypi.python.org/pypi/netifaces/

[3]
Preface

netaddr: https://pypi.python.org/pypi/netaddr
pyopenssl: https://pypi.python.org/pypi/pyOpenSSL
pygeocoder: https://pypi.python.org/pypi/pygocoder
pyyaml: https://pypi.python.org/pypi/PyYAML
requests: https://pypi.python.org/pypi/requests
feedparser: https://pypi.python.org/pypi/feedparser
paramiko: https://pypi.python.org/pypi/paramiko/
fabric: https://pypi.python.org/pypi/Fabric
supervisor: https://pypi.python.org/pypi/supervisor
xmlrpclib: https://pypi.python.org/pypi/xmlrpclib
SOAPpy: https://pypi.python.org/pypi/SOAPpy
bottlenose: https://pypi.python.org/pypi/bottlenose
construct: https://pypi.python.org/pypi/construct/
libpcap: https://pypi.python.org/pypi/pcap
setup tools: https://pypi.python.org/pypi/setuptools
exabgp: https://pypi.python.org/pypi/exabgp
traixroute: https://pypi.python.org/pypi/traixroute
dronekit: https://pypi.python.org/pypi/dronekit
dronekit-sitl: https://pypi.python.org/simple/dronekit-sitl/
ryu: https://pypi.python.org/pypi/ryu
Flask: https://pypi.python.org/pypi/Flask
smtpd: https://pypi.python.org/pypi/secure-smtpd
twisted: https://pypi.python.org/pypi/Twisted
tornado: https://pypi.python.org/pypi/tornado
dnspython: https://pypi.python.org/pypi/dnspython
ldap3: https://pypi.python.org/pypi/ldap3
Eve: https://pypi.python.org/pypi/Eve
RequestsThrottler: https://pypi.python.org/pypi/RequestsThrottler
PyNSXv: https://pypi.python.org/pypi/pynsxv
vmware-nsx: https://pypi.python.org/pypi/vmware-nsx

[4]
Preface

Other software needed to run some recipes are as follows:

postfix: http://www.postfix.org/
openssh server: http://www.openssh.com/
mysql server: http://downloads.mysql.com/
apache2: http://httpd.apache.org/download.cgi/
virtualenv: https://virtualenv.pypa.io/
filezilla: https://filezilla-project.org/
vsftpd: https://security.appspot.com/vsftpd.html
telnetd: telnetd.sourceforge.net/
curl: https://curl.haxx.se/
NS-3: https://www.nsnam.org/ns-3-26/download/
Mininet: mininet.org/
Ansible: https://www.ansible.com/
Git: https://git-scm.com/
aptitude: https://www.openhub.net/p/aptitude
Node-ws / wscat: https://www.npmjs.com/package/wscat
MaxiNet: https://github.com/MaxiNet/MaxiNet/
Mininet-WiFi: https://github.com/intrig-unicamp/mininet-wifi
ContainerNet: https://github.com/containernet/containernet.git
Ant: ant.apache.org/
Maven: https://maven.apache.org/
OpenDaylight: https://www.opendaylight.org/downloads
ONOS: https://wiki.onosproject.org/display/ONOS/Downloads
Floodlight: http://www.projectfloodlight.org/download/
POX: http://github.com/noxrepo/pox
libnl-3-dev: https://packages.debian.org/sid/libnl-3-dev
libnl-genl-3-dev: https://packages.debian.org/sid/libnl-genl-3-dev
libnl-route-3-dev: https://packages.debian.org/sid/libnl-route-3-dev
pkg-config: https://www.freedesktop.org/wiki/Software/pkg-config/
python-tz: pytz.sourceforge.net/
libpcap-dev: https://packages.debian.org/libpcap-dev
libcap2-dev: https://packages.debian.org/jessie/libcap2-dev

[5]
Exploring the Variety of Random
Documents with Different Content
*** END OF THE PROJECT GUTENBERG EBOOK MACHINE GUN
MANUAL ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright
in these works, so the Foundation (and you!) can copy and
distribute it in the United States without permission and without
paying copyright royalties. Special rules, set forth in the General
Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree to
abide by all the terms of this agreement, you must cease using
and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project
Gutenberg™ works in compliance with the terms of this
agreement for keeping the Project Gutenberg™ name
associated with the work. You can easily comply with the terms
of this agreement by keeping this work in the same format with
its attached full Project Gutenberg™ License when you share it
without charge with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it
away or re-use it under the terms of the Project Gutenberg
License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country where
you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of the
copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute
this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must, at
no additional cost, fee or expense to the user, provide a copy, a
means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original “Plain Vanilla ASCII” or other
form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt that
s/he does not agree to the terms of the full Project Gutenberg™
License. You must require such a user to return or destroy all
copies of the works possessed in a physical medium and
discontinue all use of and all access to other copies of Project
Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite
these efforts, Project Gutenberg™ electronic works, and the
medium on which they may be stored, may contain “Defects,”
such as, but not limited to, incomplete, inaccurate or corrupt
data, transcription errors, a copyright or other intellectual
property infringement, a defective or damaged disk or other
medium, a computer virus, or computer codes that damage or
cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES -


Except for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU
AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE,
STRICT LIABILITY, BREACH OF WARRANTY OR BREACH
OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE
TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER
THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR
ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE
OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF
THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If


you discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person or
entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR
ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you do
or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission of


Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status by
the Internal Revenue Service. The Foundation’s EIN or federal
tax identification number is 64-6221541. Contributions to the
Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or
determine the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About Project


Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like