KauNetEm Deterministic Network Emulation in Linux . Per Hurtig, - - PowerPoint PPT Presentation

kaunetem
SMART_READER_LITE
LIVE PREVIEW

KauNetEm Deterministic Network Emulation in Linux . Per Hurtig, - - PowerPoint PPT Presentation

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain) KauNetEm Deterministic Network Emulation in Linux . Per Hurtig, Johan Garcia February 12, 2016 netdevconf 1.1, February 10-12,


slide-1
SLIDE 1

KauNetEm

Deterministic Network Emulation in Linux

.

Per Hurtig, Johan Garcia February 12, 2016

netdevconf 1.1, February 10-12, Seville, Spain 1

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-2
SLIDE 2

Talk outline

  • 1. Deterministic Network Emulation
  • 2. Use Case Examples
  • 3. KauNetEm System Design
  • 4. Demo
  • 5. Open Issues
  • 6. The Way Forward / Closing Remarks

2

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-3
SLIDE 3

Deterministic Network Emulation .

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-4
SLIDE 4

What?

Deterministic network emulation allows the experimenter not

  • nly to generate various emulation effects such as packet loss,

rate restrictions or delay, but to apply these emulation effects at precisely controlled places.

4

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-5
SLIDE 5

Emulation Setups

5

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-6
SLIDE 6

NetEm Workflow

6

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-7
SLIDE 7

NetEm Workflow

7

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-8
SLIDE 8

NetEm Workflow

8

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-9
SLIDE 9

NetEm Workflow

9

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-10
SLIDE 10

NetEm Workflow

10

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-11
SLIDE 11

KauNetEm Workflow

11

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-12
SLIDE 12

Data vs. Time driven

12

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-13
SLIDE 13

Emulation Effects

Emulation effect Data-driven Time-driven Packet loss X X Delay X X Rate X X Bit error X

  • Duplication

X X Reordering X

  • Trigger
  • X-
  • ?-

13

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-14
SLIDE 14

Use Case Examples .

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-15
SLIDE 15

Why?

  • Transport protocol implementation debugging / validation
  • Functional evaluation of new Transport layer mechanisms
  • Transport or Application layer performance evaluations
  • ''Control what you can, and randomize the rest''

15

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-16
SLIDE 16

Random losses

16

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-17
SLIDE 17

Randomly generated loss pattern

17

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-18
SLIDE 18

Increased statistical strength

18

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-19
SLIDE 19

Functional evaluation of Transport layer mechanisms

5 10 15 20 position of loss (pkt no.) 200 400 600 800 1000 1200 1400 1600 1800 transmission time of flow [ms]

tail loss behavior of TCP early_retrans=3 early_retrans=0

19

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-20
SLIDE 20

KauNetEm System Design .

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-21
SLIDE 21

How?

Traffic

Pattern/Table Management Pattern Decoding and Forwarding Loss Duplication Corruption … KauNetEm NetEm/KauNetEm

Pattern Creation Pattern/Table Loading

Kernel Space User Space

21

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-22
SLIDE 22

Data representation - Float data

15 14 13 12 11 10 9 8 7 6 5 4 3 3 2 1

F

11 bit mantissa 4 bit exponent

F

15 bit run length value

F: Flag to indicate if run-length value or float value is encoded

  • Used for Bandwidth and Delay patterns
  • 0 - 2.047 · 100−15 [bps, µs] (i.e max at ∼ 2Pbps, 2 · 109s)

22

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-23
SLIDE 23

Data representation - Float data

2 4 6 8 10 0.00 0.05 0.10 0.15 0.20 0.25 Percent

11+4 Float representation error 23

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-24
SLIDE 24

Data representation - Packet data

15 14 13 12 11 10 9 8 7 6 5 4 3 3 2 1

F

15 bit run length value F: Indicates if packet at current position should be dropped / duplicated

  • Used for Paket loss and Packet duplication patterns
  • 0.1% packet loss rate at 100Mbps ⇒ 24 minutes / 16KByte

pattern

24

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-25
SLIDE 25

Data representation - Integer data

15 14 13 12 11 10 9 8 7 6 5 4 3 3 2 1

F

15 bit integer value

F

15 bit run length value

F: Flag to indicate if run-length value or float value is encoded

  • Used for Reordering, Bit errors, and future Trigger patterns
  • 14 bits to encode bit to flip / reordering distance / trigger

value

25

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-26
SLIDE 26

User Space Code Extensions

  • tc/q_netem.c:

75 lines of code added

  • Command line parsing
  • Pattern loading/transfer
  • patt_gen:

∼ 1400 lines of c code

  • Value encoding/decoding routines
  • Pattern creation handling
  • I/O

26

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-27
SLIDE 27

Pattern generation

patt_gen -pkt|-ber|-del|-bw|-reo|-dup|-trig

  • s <size> [-o <outfilename>]

<position-values>|-f infilename <position-values>: A comma separated list of positions and values, or loss/duplication positions. <size>: Specifies the length of the generated pattern. The unit is packets or milliseconds. For packet loss patterns: patt_gen -pkt -rand -s size [-r random_seed] <PVAL> patt_gen -pkt -ge -s size [-r random_seed] <good_rate> <bad_rate> <good_tran_prob> <bad_tran_prob> patt_gen -pkt -int -s size <interval-list>|-f <infilename> 27

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-28
SLIDE 28

Packet loss probability vs Actual loss rate

There is a difference between a 0.2% packet loss probability and an actual 0.2% achieved loss rate. Example: 0.2% loss for a 1000 packet flow:

2 4 6 8 10 0.0 0.1 0.2 0.3 0.4 0.5 Probability mass

PVAL = 0.002

2 4 6 8 10 0.0 0.2 0.4 0.6 0.8 1.0 Probability mass

PVAL = 2 28

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-29
SLIDE 29

Kernel Space Code Extensions

  • pkt_sched.h:

12 lines (2 variables, 10 defines)

  • sch_netem.c:

~400 lines

  • Management and traversal of patterns
  • pattern forwarding
  • value decoding,
  • hrtimer management
  • Pattern effect invocation

29

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-30
SLIDE 30

Demo .

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-31
SLIDE 31

Packet Loss

31

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-32
SLIDE 32

Duplication

32

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-33
SLIDE 33

Open Issues .

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-34
SLIDE 34

Open design considerations

  • What should happen at the end of a pattern?
  • Just end pattern?
  • Wraparound?
  • Append new pattern?
  • Behavior for packet being sent at low throughput when

time-driven increase of throughput happens?

  • Send remaining bits at original low rate?
  • Send remaining bits at new higher rate?
  • Need for additional patterns?
  • Trigger patterns will be added
  • Any more?
  • Fold patt_gen code into tc?
  • Split delay patterns to delay_reorder and delay_fifo?

34

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-35
SLIDE 35

Why extend Netem?

Is using NetEm the best way to achive deteministic emulation? + Not a lot of added kernel code + Much of emulation effect infrastructure is present

  • NetEm qdisc cannot be nested
  • Not possible to easily have multiple concurrent patterns

Is an approach based on filter actions a possible alternative or possible complement? Should we create a separate qdisc instead?

35

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-36
SLIDE 36

The Way Forward / Closing Remarks .

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-37
SLIDE 37

The way forward

We will continue to:

  • add code functionality
  • provide documentation / examples.

Possible integrations:

  • CORE: Common Open Research Emulator
  • LNST: Linux Network Stack Testing tool

Room for contributions:

  • Bug reports
  • Code patches
  • Feature requests

37

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-38
SLIDE 38

Closing remarks

We believe deterministic emulation has an important role to fill for networking researchers and protocol implementers. KauNetEm is an ongoing work aiming to provide deterministic emulation in Linux in an easy to use and well-documented way.

38

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)

slide-39
SLIDE 39

Questions?

 git.cs.kau.se/pub/kaunetem  per.hurtig@kau.se  johan.garcia@kau.se

39

.

Proceedings of NetDev 1.1: The Technical Conference on Linux Networking (February 10th-12th 2016. Seville, Spain)