Top Banner
Performance Challenges In Software Networking Stephen Hemminger @networkplumber
48

Performance challenges in software networking

Apr 12, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Performance challenges in software networking

Performance ChallengesIn

Software Networking

Stephen Hemminger

@networkplumber

Page 2: Performance challenges in software networking

Who am I?

● Principal ArchitectBrocade vRouter(Vyatta)

● FellowLinux Foundation

● SequentUnix SMP networking

● DPDK– #3 contributor

● Linux– 10+ year contributor

– Maintainer● Bridge● iproute

Page 3: Performance challenges in software networking

Agenda

● Myths● Requirements● Benchmarks● Reality

Page 4: Performance challenges in software networking

Myths

● Software networking can never do:– 1Gbit

● 2008 – Linux, FreeBSD, ...– 10Gbit

● 2013 – DPDK, Netmap, ...– 40Gbit

● 2015 – DPDK, ...– 100Gbit

● 2016?

Page 5: Performance challenges in software networking

Hardware vs Software

● Clock rate● TCAM size● TCAM miss● Bus transactions

● Clock rate● Cache size● Cache misses per packet● PCI bus operations

Page 6: Performance challenges in software networking

Optimization cycle

AnalyzeOptimize

Measure

Page 7: Performance challenges in software networking

SDN Measurement

ForwardingRFC2544

ScalingImix, BGP, Firewall, ...

ApplicationBGP convergenceAvailablity

SDN WorkloadPerformance

Test Environment

Page 8: Performance challenges in software networking

Benchmark vs Reality

● Benchmark– random flows– 10 or less rules– 128GB memory– 32 or more CPU

● Reality– Burstyflows– 1000's of rules– 2GB VM– 2-4 CPU

Page 9: Performance challenges in software networking

System effects

● Data/Control resource sharing– CPU cache– Background noise

● Power consumption● Memory footprint● Virtualization overhead● Platform differences

Page 10: Performance challenges in software networking

Basics

memory is ~70+ ns away (i.e. 2.0 GHz = 140+ cycles)

Source: Intel® 64 and IA-32 Architectures: Optimization Reference Manual

Sandy BridgeIvy Bridge

Haswell Skylake

(bytes/cycle) 4 4 4

L1 Peak Bandwidth 2x16 2x32 load1x32 store

2x32 load1x32 store

L2 data access (cycles) 12 11 12

L2 peak Bandwidth 1x32 64 64

Shared L3 access (cycles) 26-31 34 44

L3 peak bandwidth 32 - 32

Data hit in L2 cache 43 – clean hit60 – modified

Page 11: Performance challenges in software networking

Time Budget

● 10Gbit 64 byte packet– 67.2ns = 201 cycles @ 3Ghz

● Cache– L3 = 8 ns– L2 = 4.3

● Atomic operations– Lock = 8.25 ns– Lock/Unlock = 16.1

Network stack challenges at increasing speeds – LCA 2015 Jesper Dangaard Brouer

Page 12: Performance challenges in software networking

Magic Exlir?

Page 13: Performance challenges in software networking

Fast vs Slow

● New software– Lockless– Single function– Tight layering– Cache aware

● Legacy software– Interrupts– Shared resources– System calls– VM exit

Page 14: Performance challenges in software networking

Performance Tradeoffs

● Bulk operations● Lock-less Algorithms

● Tight integration● Polling

● Caching

➔ Latency➔ Update speed

Consistency➔ Inflexible➔ CPU utilization

Power management➔ Memory utilization

Update overhead

Page 15: Performance challenges in software networking

CPU pipeline

Page 16: Performance challenges in software networking

Cache flow

RxDevice

NetworkFunction

TxDevice

RxPoll

TxKick

TxDescriptor

RxDescriptor

Function TableAccesses

Worst case 7+ cache miss per packet!

PacketData

Page 17: Performance challenges in software networking

Cache Ping/Pong

● Cache line shared between cores– Statistics– Session state

Page 18: Performance challenges in software networking

NFV bucket brigade

Page 19: Performance challenges in software networking

Packet batching

Page 20: Performance challenges in software networking

New developments

● DPDK– Multi-architecture– NIC support– Packet pipeline– ACL– LPM– ...

● Linux– Batched Tx– Lockless queue

disciplines– Memory allocator

performance

Page 21: Performance challenges in software networking

Conclusions

● Software networking is function of:– Algorithims– Low level CPU utilization– Cache behavior

Page 22: Performance challenges in software networking

Questions?

Page 24: Performance challenges in software networking

Next Generation Software Networking

● Openvswitch + DPDK● Brocade – vRouter● 6Wind● FD.io – VPP● Juniper - Opencontrail● Huawei - Fusionsphere

Page 25: Performance challenges in software networking

Performance ChallengesIn

Software Networking

Stephen Hemminger

@networkplumber

Page 26: Performance challenges in software networking

Who am I?

● Principal ArchitectBrocade vRouter(Vyatta)

● FellowLinux Foundation

● SequentUnix SMP networking

● DPDK– #3 contributor

● Linux– 10+ year contributor

– Maintainer● Bridge● iproute

Page 27: Performance challenges in software networking

Agenda

● Myths● Requirements● Benchmarks● Reality

Page 28: Performance challenges in software networking

Myths

● Software networking can never do:– 1Gbit

● 2008 – Linux, FreeBSD, ...– 10Gbit

● 2013 – DPDK, Netmap, ...– 40Gbit

● 2015 – DPDK, ...– 100Gbit

● 2016?

Page 29: Performance challenges in software networking

Hardware vs Software

● Clock rate● TCAM size● TCAM miss● Bus transactions

● Clock rate● Cache size● Cache misses per packet● PCI bus operations

Page 30: Performance challenges in software networking

Optimization cycle

AnalyzeOptimize

Measure

Page 31: Performance challenges in software networking

SDN Measurement

ForwardingRFC2544

ScalingImix, BGP, Firewall, ...

ApplicationBGP convergenceAvailablity

SDN WorkloadPerformance

Test Environment

Page 32: Performance challenges in software networking

Benchmark vs Reality

● Benchmark– random flows– 10 or less rules– 128GB memory– 32 or more CPU

● Reality– Burstyflows– 1000's of rules– 2GB VM– 2-4 CPU

Page 33: Performance challenges in software networking

System effects

● Data/Control resource sharing– CPU cache– Background noise

● Power consumption● Memory footprint● Virtualization overhead● Platform differences

Page 34: Performance challenges in software networking

Basics

memory is ~70+ ns away (i.e. 2.0 GHz = 140+ cycles)

Source: Intel® 64 and IA-32 Architectures: Optimization Reference Manual

Sandy BridgeIvy Bridge

Haswell Skylake

(bytes/cycle) 4 4 4

L1 Peak Bandwidth 2x16 2x32 load1x32 store

2x32 load1x32 store

L2 data access (cycles) 12 11 12

L2 peak Bandwidth 1x32 64 64

Shared L3 access (cycles) 26-31 34 44

L3 peak bandwidth 32 - 32

Data hit in L2 cache 43 – clean hit60 – modified

Page 35: Performance challenges in software networking

Time Budget

● 10Gbit 64 byte packet– 67.2ns = 201 cycles @ 3Ghz

● Cache– L3 = 8 ns– L2 = 4.3

● Atomic operations– Lock = 8.25 ns– Lock/Unlock = 16.1

Network stack challenges at increasing speeds – LCA 2015 Jesper Dangaard Brouer

Page 36: Performance challenges in software networking

Magic Exlir?

Page 37: Performance challenges in software networking

Fast vs Slow

● New software– Lockless– Single function– Tight layering– Cache aware

● Legacy software– Interrupts– Shared resources– System calls– VM exit

Page 38: Performance challenges in software networking

Performance Tradeoffs

● Bulk operations● Lock-less Algorithms

● Tight integration● Polling

● Caching

➔ Latency➔ Update speed

Consistency➔ Inflexible➔ CPU utilization

Power management➔ Memory utilization

Update overhead

Page 39: Performance challenges in software networking

CPU pipeline

Page 40: Performance challenges in software networking

Cache flow

RxDevice

NetworkFunction

TxDevice

RxPoll

TxKick

TxDescriptor

RxDescriptor

Function TableAccesses

Worst case 7+ cache miss per packet!

PacketData

Page 41: Performance challenges in software networking

Cache Ping/Pong

● Cache line shared between cores– Statistics– Session state

Page 42: Performance challenges in software networking

NFV bucket brigade

Page 43: Performance challenges in software networking

Packet batching

Page 44: Performance challenges in software networking

New developments

● DPDK– Multi-architecture– NIC support– Packet pipeline– ACL– LPM– ...

● Linux– Batched Tx– Lockless queue

disciplines– Memory allocator

performance

Page 45: Performance challenges in software networking

Conclusions

● Software networking is function of:– Algorithims– Low level CPU utilization– Cache behavior

Page 46: Performance challenges in software networking

Questions?

Page 47: Performance challenges in software networking

Thank you

Stephen [email protected]

@networkplumber

Page 48: Performance challenges in software networking

Next Generation Software Networking

● Openvswitch + DPDK● Brocade – vRouter● 6Wind● FD.io – VPP● Juniper - Opencontrail● Huawei - Fusionsphere