Network Emulation using Linux Network Namespaces Daniel Schubert - - PowerPoint PPT Presentation

network emulation using linux network namespaces
SMART_READER_LITE
LIVE PREVIEW

Network Emulation using Linux Network Namespaces Daniel Schubert - - PowerPoint PPT Presentation

Chair of Network Architectures and Services Department of Informatics Technical University of Munich Network Emulation using Linux Network Namespaces Daniel Schubert Friday 5 th July, 2019 IITM SS19 Garching b. Mnchen, Germany Chair of


slide-1
SLIDE 1

Chair of Network Architectures and Services Department of Informatics Technical University of Munich

Network Emulation using Linux Network Namespaces

Daniel Schubert

Friday 5th July, 2019 IITM SS19 Garching b. München, Germany Chair of Network Architectures and Services Department of Informatics Technical University of Munich

slide-2
SLIDE 2

Agenda

  • Options for Network Testing
  • Linux lightweight emulation features
  • Mininet
  • Conclusion
  • D. Schubert — Network Emulation using Linux Network Namespaces

2

slide-3
SLIDE 3

Introduction

Options for Network Testing

Hardware Testbed accurate expensive hard to reconfigure Simulator inexpensive might be unrealisc flexible Emulator inexpensive real code flexible

  • D. Schubert — Network Emulation using Linux Network Namespaces

3

slide-4
SLIDE 4

Introduction

Hardware Testbed

Switch Host Hardware Host

eth0 tap0 tap1

Host Hardware Host

eth0

Hardware Switch

  • D. Schubert — Network Emulation using Linux Network Namespaces

4

slide-5
SLIDE 5

Introduction

Network Emulation

v Switch Hardware Host Host Virtual machine

eth0

Host Virtual machine

eth0 tap0 tap1

  • D. Schubert — Network Emulation using Linux Network Namespaces

5

slide-6
SLIDE 6

Introduction

Network Emulation

Switch Hardware Host Host Network Namespace

eth0

Host Network Namespace

eth0 veth0 veth1 Virtual Ethernet pairs

  • D. Schubert — Network Emulation using Linux Network Namespaces

6

slide-7
SLIDE 7

Linux Emulation Features

Namespaces

  • Isolate one or serveral processes
  • Own view of system resource
  • Examples:
  • Mount Namespace
  • PID Namespace
  • Network Namespace
  • D. Schubert — Network Emulation using Linux Network Namespaces

7

slide-8
SLIDE 8

Linux Emulation Features

Network Namespaces

  • Individual copy of network stack per namespace
  • Network devices
  • Routing tables
  • Ports
  • ...
  • Creation
  • ip netns add <name>
  • ip netns exec <name> <command>
  • D. Schubert — Network Emulation using Linux Network Namespaces

8

slide-9
SLIDE 9

Linux Emulation Features

Network Namespaces

  • Individual copy of network stack per namespace
  • Network devices
  • Routing tables
  • Ports
  • ...
  • Creation
  • ip netns add <name>
  • ip netns exec <name> <command>

Virtual Ethernet Devices

  • Always created as interconnected pairs
  • Acts as tunnel connecting two namespaces
  • Creation:
  • ip link add <d1> type veth peer name <d2>
  • ip link set <d2> netns <d2-namespace>
  • D. Schubert — Network Emulation using Linux Network Namespaces

8

slide-10
SLIDE 10

Linux Emulation Features

Control Groups

  • Limit resources for group of processes
  • Used to emulate CPU limited Hosts
  • D. Schubert — Network Emulation using Linux Network Namespaces

9

slide-11
SLIDE 11

Linux Emulation Features

Control Groups

  • Limit resources for group of processes
  • Used to emulate CPU limited Hosts

Linux Traffic Control (tc)

  • Configure Traffic Control of Linux kernel
  • Influence how packets are handled at specific interfaces
  • Used to emulate links with lower bandwidth or delay
  • D. Schubert — Network Emulation using Linux Network Namespaces

9

slide-12
SLIDE 12

Linux Emulation Features

Creating Emulation Manually

1 1From [1]

  • D. Schubert — Network Emulation using Linux Network Namespaces

10

slide-13
SLIDE 13

Mininet

Overview

  • CLI and API to create and interact with network
  • Open source project written in Python
  • Emulation is performed by C-code
  • Developped as a tool for rapid prototyping of SDNs
  • D. Schubert — Network Emulation using Linux Network Namespaces

11

slide-14
SLIDE 14

Mininet

Create Emulation with Mininet API

2 2From [1]

  • D. Schubert — Network Emulation using Linux Network Namespaces

12

slide-15
SLIDE 15

Mininet

Create Emulation with Mininet API

3 3From [1]

  • D. Schubert — Network Emulation using Linux Network Namespaces

13

slide-16
SLIDE 16

Mininet

Create Emulation with Mininet API

4 4From [1]

  • D. Schubert — Network Emulation using Linux Network Namespaces

14

slide-17
SLIDE 17

Mininet

Performance

v Switch Host1 Host2 HostN

Hosts (N) 1 100 500 1000 Setup (s) 0.103 ± 0.005 0.652 ± 0.033 3.32 ± 0.166 7.06 ± 0.353 RAM (MB) 396 ± 9.17 438 ± 30.52 941 ± 19.49 1570 ± 155.77 NRFR (%) 0.0 0.0 0.0 30.91

v Switch Host1 Host2 v Switch v Switch

Switches (N) 1 100 500 1000 Setup (s) 0.104 ± 0.005 5.47 ± 0.273 185.5 ± 9.276 230.95 ± 15.70 RAM (MB) 308 ± 12.17 433 ± 54.41 961 ± 51.43 1737 ± 158.41 NRFR (%) 0.0 0.0 65.08 85.48

[2]

  • D. Schubert — Network Emulation using Linux Network Namespaces

15

slide-18
SLIDE 18

Mininet

Pros

  • Fast Setup of Networks
  • Use real programs on Network Nodes
  • Runs on a single laptop
  • Easy to install (included with Ubuntu 12.10)
  • Easy to use with CLI and Python scripts
  • Open source
  • Under active development
  • D. Schubert — Network Emulation using Linux Network Namespaces

16

slide-19
SLIDE 19

Mininet

Pros

  • Fast Setup of Networks
  • Use real programs on Network Nodes
  • Runs on a single laptop
  • Easy to install (included with Ubuntu 12.10)
  • Easy to use with CLI and Python scripts
  • Open source
  • Under active development

Cons

  • Resource limits
  • Only with Linux kernel
  • By default all hosts share file system and PID space
  • No timing guarantees
  • No virtual time
  • D. Schubert — Network Emulation using Linux Network Namespaces

16

slide-20
SLIDE 20

Mininet

Related Work

  • ns-3: open source discret-event simulator
  • Mahimahi: record-and-replay network emulator
  • Mininet clustering: Split network topology between multiple machines
  • D. Schubert — Network Emulation using Linux Network Namespaces

17

slide-21
SLIDE 21

Conclusion

  • Linux Network Namespaces + Virtual Ethernet Pairs + Open Flow Switches = Lightweight

Network Emulation

  • Mininet offers API to build network conveniently
  • Networks with several hundred nodes possible
  • For larger networks distributed Mininet exists/is being developed
  • D. Schubert — Network Emulation using Linux Network Namespaces

18

slide-22
SLIDE 22

Bibliography

[1] T.-Y. Huang, V. Jeyakumar, B. Lantz, N. Feamster, K. Winstein, and A. Sivaraman. Teaching computer networking with mininet. In ACM SIGCOMM, 2014. [2] P . Isaia and L. Guan. Performance benchmarking of sdn experimental platforms. In 2016 IEEE NetSoft Conference and Workshops (NetSoft), pages 116–120, June 2016.

  • D. Schubert — Network Emulation using Linux Network Namespaces

19