Get started Bring yourself up to speed with our introductory content.

Learn how to master network traffic analysis with Python

In this book excerpt, explore key components of network security and network traffic analysis with Python scripting from Packt Publishing author José Manuel Ortega.

Traffic may not be everyone's favorite conversation topic, but IT teams must discuss and analyze traffic that passes through their organization's network to protect those networks against breaches and other cybersecurity threats.

The programming language Python can make network traffic analysis easier to implement, thanks to Python's clear, high-level syntax, security researcher and author José Manuel Ortega said. Ortega has authored various books about Python networking and how network traffic analysis with Python can benefit an organization's network security strategy.

Ortega's book, Mastering Python for Networking and Security -- available now -- tackles these issues head-on.

Below is a chapter excerpt: "Chapter 5: Analyzing Network Traffic." This chapter focuses on network traffic analysis with Python modules Scapy and Pcapy. These modules can create small scripts to examine a network's traffic, though they handle packets in different ways. For example, Pcapy focuses more on packet captures, while Scapy involves packet creation and modification. The chapter dives into these specifics, along with further critical information for network traffic analysis with Python.

Python book coverClick to learn more about
this book.

Before readers explore the chapter, however, Ortega recommended readers have a basic understanding of how to capture network packages with network traffic analysis tools and commands, such as Wireshark or TCPdump. Ortega also recommended readers familiarize themselves with Linux systems before they start the chapter.

The book takes readers through a network's lifecycle with Python, from how to build a network to how to protect the network from breaches and other security attacks. Network traffic analysis with Python is a key factor in network security assessments, which this chapter emphasizes.

Explore Mastering Python for Networking and Security

Click here to read "Chapter 5: Analyzing Network Traffic"

In Mastering Python for Networking and Security, Ortega covers what he dubbed the "broad, multidisciplinary field" of network packet analysis. Knowledge of these network protocols is important for everyone involved in networking, especially systems administrators and security experts, Ortega said, and it's crucial for organizations to support these tasks and endeavors as well.

This was last published in November 2019

Dig Deeper on Network management software and network analytics