About the Author .........................................................................................xiii
About the Technical Reviewer .........................................................................xv
Acknowledgments ........................................................................................xvii
Introduction .................................................................................................xix
Part I: Docker Basics and Networking ...............................................................1
Chapter 1: Getting Started with Future Networking Environments ........................3
Understanding Future Networking Environments ................................................4
Cloud Computing Platforms .............................................................................5
5 G ..............................................................................................................19
Docker Role in Future Networking Environments ................................................25
Docker Architecture .......................................................................................26
Docker Way for Services Deployment ...............................................................28
Docker Objects ..............................................................................................29
Docker Image ................................................................................................30
Getting Started with Docker .............................................................................34
Installation .....................................................................................................35
Set Up Docker Registry ..................................................................................35
Know Building Process of Your Image ...........................................................36
Let’s Create and Run Custom Images ............................................................40
Docker Basic Commands for Experimenting .......................................................48
Container Management .................................................................................49
Volumes .........................................................................................................55
Quick View of Docker Networking Commands ................................................59
Summary ......................................................................................................60
Chapter 2: Exploring Docker Networking Features .......................................63
Docker Networking Services .............................................................................64
Getting Started with Docker Networking .......................................................64
Docker Default Supporting Networks ............................................................66
Understanding Docker Host and Container Networking ......................................73
Set Up a Custom Bridge Network ..................................................................73
Set Up a Custom Network with ICC Disabled ................................................77
Set Up a Custom Network with Internet Access Disabled .............................80
Docker IP Addressing and Naming Services .......................................................84
Docker IP Addressing Service ........................................................................85
Docker DNS Services .....................................................................................90
Docker Host Routing and Iptables .......................................................................99
Docker Routing ..............................................................................................99
Docker and Iptables .....................................................................................107
Summary ...................................................................................................135
Chapter 3: Setting Up Realistic Networking Scenarios .....................................137
Docker Services for Setting Up Experimental Networks ...................................138
docker-compose Basics ..............................................................................138
docker-compose for Deployment Tasks ......................................................146
docker-compose for Containers Orchestration ............................................155
Exposing Container Services and Accessing Host Internet ...............................165
Importance of Iptables for Accessing the Internet .......................................172
Experimenting by Setting Up a LAN over Docker Containers ............................174
Experimenting with an Internetworking over Docker Containers .....................179
Summary ...................................................................................................186
Part II: Network Function Virtualization and Virtual Networks Basics ...................189
Chapter 4: Virtualizing Network Functions in Cloud and Telecom Core Networks ...191
Importance of Virtualizing Network Functions ..................................................192
Approaches for Deploying VNFs ..................................................................193
Virtual Machines for Deploying VNFs ...........................................................193
Containers for Deploying VNFs ....................................................................195
Benefits of VNFs ..........................................................................................197
Explore NFV Architecture Details ......................................................................199
Introduction to NFV Architecture .................................................................200
NFV Key Use Cases ......................................................................................204
Role of NFV in 5G Core Networks ......................................................................207
Service-Based Architecture Principles for 5G .............................................208
Basic 5G Core Network Functions ...............................................................211
Look into Sample 5G Core NFs Service Interfaces ......................................214
Role of Docker in Realizing VNFs ......................................................................217
Introduction to OpenAIR 5G Core Network ...................................................217
Experimenting with OPENAIR-CN-5G ...........................................................220
Summary ...........................................................................................................230
Chapter 5: Experiment with VNFs over Docker Containers ..............................233
Setting Up VNFs Using Docker ..........................................................................234
Build VNFs Using Docker Images .................................................................234
Set Up Suitable Volumes and Networks for VNFs Deployment ....................236
Automate VNFs Deployment and Testing Tasks ...........................................238
Experimenting with Virtual DHCP Server ..........................................................240
Set Up and Test DHCP VNFs .........................................................................243
Setting Up Reliable DHCP Service VNFs ......................................................254
Experimenting with Virtual DNS Server ............................................................261
Experiment with Local DNS Server ..............................................................264
Experiment with Authoritative DNS Server ..................................................271
Experimenting with Virtual High-Availability Proxy Server ................................282
Basic Experiments with a Proxy Server VNF ...............................................284
Advanced Experiments with Proxy Server VNF ...........................................291
Summary ..................................................................................................295
Chapter 6: Importance of Virtual Networks in Cloud and Telecom Networks ........297
Role of Virtual Networks in Cloud and 5G Core Networks .................................298
Importance of MAC VLANs ...........................................................................300
Importance of IP VLANs ...............................................................................303
Docker IP VLAN L2 Mode .............................................................................303
IP VLAN L3 Mode .........................................................................................305
Importance of Overlay Networks .................................................................306
Docker Overlay Networks ............................................................................308
Experimenting with Docker Virtual Networks ...................................................310
Experiment with MAC VLANs .......................................................................314
Experiment with IP VLANs ...........................................................................321
Overlay Networks Using Docker Swarm ......................................................331
Set Up and Experiment a Variety of VLANs over Docker Containers .................339
Quickly Set Up MAC VLANs and Test Using docker-compose ......................340
Quickly Set Up IP VLAN L2 Mode and Test Using docker-compose .............346
Quickly Set Up IP VLAN L3 Mode and Test Using docker-compose .............352
Learning Setting Up Overlay Networks over Docker Containers .......................360
Quickly Set Up Overlay Networks and Test over the Docker Swarm ...........360
Practice Setting Up Network Slices over the Docker Swarm Setup ............375
Summary .......................................................................................................384
Part III: Cloud and Networking Security .............................................................385
Chapter 7: Learning Docker Security for Experimenting with Cloud Security ............387
Importance of Cloud Security ............................................................................388
Know Docker Features and Ways for Security .............................................391
Docker Security Features ............................................................................394
Experimenting with Seccomp Profiles ..............................................................404
Understanding Seccomp Profile Syntax ......................................................404
Define a Custom-Secure Computing Environment for Linux Containers .....410
Learn How to Override Secure Environments Using Capabilities ................421
Experimenting with AppArmor Profiles .............................................................429
AppArmor Profile Syntax .............................................................................430
Quickly Set Up and Test an AppArmor Profile ..............................................435
Application-Specific AppArmor Profiles ......................................................441
Summary ...........................................................................................................452
Chapter 8: Explore Scapy for Experimenting with Networking Environments Security ...453
Scapy for Exploring Network Security ..............................................................454
Getting Started with Scapy Usage ...............................................................455
Know Important Features of Scapy for Experimenting with
Network Security .........................................................................................460
Scapy’s Unique Features .............................................................................461
Learning Basics of Scapy Programming ...........................................................464
Construction of Network Protocol Stack Packets ........................................464
Generating Network Protocol Packets Quickly ............................................472
Sniffing and Inspecting of Network Traffic ..................................................478
Sending and Receiving Packets Using Scapy ..............................................490
Implement a Packet Sniffer Using Scapy ..........................................................495
Implement an ARP Sniffer ...........................................................................496
Implement a UDP Sniffer .............................................................................498
Implement an ICMP Sniffer ..........................................................................502
Implement a Packet Spoofer Using Scapy ........................................................505
Implement an ARP Spoofer ..........................................................................506
Implement a UDP Spoofer ...........................................................................510
Implement an ICMP Spoofer ........................................................................513
Summary ..................................................................................................516
Chapter 9: Recreating and Analyzing Realistic Network Security Scenarios .........517
Understanding a Variety of Network Security Attacks ......................................518
Sniffing and Spoofing Network Traffic Attacks ............................................519
Denial-of-Service (DoS) Attacks ..................................................................523
Man-in-the-Middle (MiTM) Attacks .............................................................524
Hands-On 1: Sniffing and Spoofing Network Traffic ..........................................525
Sniffing and Spoofing UDP Traffic ................................................................526
Sniffing and Spoofing ICMP Messages ........................................................530
Hands-On 2: Sniffing and Spoofing Network Traffic ..........................................535
Start with Sniffing TCP Session Segments ..................................................536
Sniffing an Ongoing TCP Session and Spoofing TCP Segments ..................543
Setting Up a Network and Simulating a Variety of Attacks ...............................548
Spoofing DNS Replies ..................................................................................549
DoS Attack on a TCP Server .........................................................................556
Resetting Ongoing TCP Connections ...........................................................560
Summary ...........................................................................................................565
Index .................................................................................................567
Explore virtualized networking environments through the Cloud, Edge, and 5G core networks, and their applications. This book covers the primary approaches related to setting up and experimenting with related cloud and networking environments using virtual networks, and virtual network functions.
You’ll start by experimenting with future networking environments and learn a variety of Docker basics and essential networking skills. Specifically, containers, networking, volumes, iptables (for Docker environment security) and default orchestration features are discussed to help set up custom cloud, edge, and 5G core networking environments. Hands-on activities related to Docker networking and services features for publishing, scaling, and monitoring of services are also provided. By the end of Part 1, you’ll be able to set up a variety of custom networking environments easily using Docker compose features and secure the set-up using iptables.
Part 2 introduces Network Function Virtualization (NFV) architecture, and its roles in Cloud and 5G core networks. You’ll learn to deploy an open source 5G core platform from OpenAirInterface (OAI) using Docker. Then, you’ll set up and evaluate Virtual Network Functions (VNF) over suitable virtual networks. Hands-on activities are featured to guide you through the process of setting up and deploying VNFs such as DHCP, DNS, and proxy servers.
Finally, Part 3 discusses key virtual networks such as IP VLANs, MAC VLANs, and overlay networks using Docker cluster setups. You’ll use interesting hands-on activities to easily experiment and learn cloud and 5G core network set-up related virtual networks, overlay networks, and network slicing. When done, you’ll be able to set up a variety of VNFs, carefully deploying VNFs, and conducting slicing activities over Docker cluster setups.
Explore Cloud, Edge, and 5G core networking using Docker networking features.
Build and evaluate a variety of virtual networks and deploy Virtual Network Functions (VNFs) and Network Slices using Docker swarm setups.
Set up and deploy an open source 5G core network using Docker for experimenting.
Enhance cloud environment and applications security using linux security features such as Capabilities, Seccomp, and AppArmors.
Develop and evaluate network security experiments using Scapy and Docker networks.
Network engineers, cloud engineers, students, faculty, and cloud and networking researchers.