PISCES: A Programmable, Protocol-Independent Software Switch Muhammad Shahbaz, Sean Choi , Ben Pfaff, Changhoon Kim, Nick Feamster, Nick McKeown, and Jennifer Rexford
Fixed Set of Protocols Fixed-Function Switch Chip Ethernet TCP HTTP UDP IPv4 BGP TLS IPv6 2
• Ease of Adding new protocols • Ease of Removing unused protocols • Gain greater Visibility into the network • Perform network functions at the switch 3
Programmable Switching Chip Custom Protocols Ethernet TCP HTTP CUSTOM_P IPv4 BGP TLS IPv6 4
VM VM Software Switch Virtual Port Physical Port 5
Approx. Number of Physical Ports vs. Virtual Ports in Global Data Centers [1] 60 40 20 Millions 0 2010 2011 2012 2013 2014 2015 Phyical Ports Virtual Ports [1] Martin Casado, VMWorld 2013 6
It should be EASY to program software switches! Not really… 7
Software Switch Kernel Fast Packet Forwarding DPDK 8
Requires domain expertise in: Software Switch - Network protocol design - Kernel development Slow to release changes Parser Packet Processing Logic Match-Action Pipeline Specialized APIs Kernel DPDK 9
To add TCP Flag in Open vSwitch… Software Switch changed 20 files and 370 lines of code [1] Weeks of development and Test Parser Match-Action Pipeline Kernel DPDK [1] https://github.com/openvswitch/ovs/commit/dc235f7fbcff 10
We can do this in 4 lines and within minutes with PISCES! header_type tcp_t { header_type flow_t { fields { fields { srcPort : 16; ... dstPort : 16; tcp_flags_pad : 4; seqNo : 32; tcp_flags : 12; ackNo : 32; ... dataOffset : 4; } res : 4; } tcp_flags : 12; window : 16; parser tcp { checksum : 16; extract(tcp); urgentPtr : 16; set_metadata(flow.tcp_flags, } tcp.tcp_flags); } return ingress; } 11
Software Switch Parser Match-Action Pipeline Kernel DPDK 12
TCP Header Domain-Specific Language (DSL) header_type tcp_t { fields { Parser Match-Action Pipeline srcPort : 16; dstPort : 16; seqNo : 32; ackNo : 32; dataOffset : 4; Compile res : 4; window : 16; checksum : 16; Software Switch urgentPtr : 16; } Parser Match-Action Pipeline } parser tcp { extract(tcp); Kernel DPDK return ingress; } ... 13
Domain-Specific Language Domain-Specific Language 2 PISCES is a software switch that takes Parser Match-Action Pipeline Parser Match-Action Pipeline a Domain-Specific Language input • Compile and outputs a customized Software Switch Switch 2 a Software Switch Target • Parser Match-Action Pipeline Parser Match-Action Pipeline Kernel DPDK Kernel DPDK 14
P4 [1] P4 is an open-source language . [1] Parser Match-Action Pipeline Easily defines - Packet headers and fields Compile - Parser - Actions OVS - Match-Action Tables Parser Match-Action Pipeline Kernel DPDK [1] http://p4.org 15
P4 Parser Match-Action Pipeline 341 lines of P4 code Compile Native OVS Packet Processing Logic OVS Parser Match-Action Pipeline 14,535 lines of C code Kernel DPDK 16
header_type tcp_t { header_type tcpv2_t { fields { fields { srcPort : 16; P4 Program srcPort : 16; dstPort : 16; dstPort : 16; seqNo : 32; seqNo : 32; ackNo : 32; PISCES ackNo : 32; dataOffset : 4; dataOffset : 4; res : 4; res : 4; Compiler window : 16; tcp_flags : 8; checksum : 16; window : 16; urgentPtr : 16; checksum : 16; } urgentPtr : 16; } parse match action } parser tcp { P.I. OVS } extract(tcp); parser tcpv2 { return ingress; extract(tcpv2); } set_metadata(flow.tcp_flags, ... tcpv2.tcp_flags); return ingress; OVS Executable } ... 17
P4 Parser Match-Action Pipeline Performance Overhead? Compile OVS Parser Match-Action Pipeline Kernel DPDK 18
Throughput on Eth + IPv4 + ACL benchmark application 50 43.00 45 Throughput (Gbps) 40 33.17 35 25.71 30 23.35 25 19.00 PISCES v0.1 20 13.43 13.62 15 OVS 8.29 10 5 0 64 128 192 256 Packet Size (Bytes) Performance overhead of ~ 40% 19
Cause for the Overhead Egress Ingress Packet Checksum Checksum Packet Match-Action Parser Verify Update Deparser Tables CPU Cycles per Packet 20
Extra CPU cycles are consumed by • Checksum computation • Packet header editing mode and more… 21
Checksum Inefficiencies Checksum Update ( Checksum Verify ( version, ihl, diffserv, totalLen, version, ihl, diffserv, totalLen, identification, flags, fragOffset, identification, flags, fragOffset, ttl, protocol, hdrChecksum, ttl, protocol, hdrChecksum, srcAddr, dstAddr) srcAddr, dstAddr) Egress Ingress Match-Action Packet Checksum Checksum Pipeline Parser Verify Update 22
Checksum Inefficiencies Checksum Verify ( version, ihl, diffserv, totalLen, Incremental Checksum Update ( ttl ) identification, flags, fragOffset, ttl, protocol, hdrChecksum, srcAddr, dstAddr) Egress Ingress Checksum Packet Checksum Decrement(ttl) Verify Parser Update 23
Post-Pipeline Editing Egress Ingress Packet Checksum Checksum Packet Parser Verify Match-Action Update Deparser Tables Ingress Packet Egress Packet Header Fields 24
Inline Editing Ingress Packet Egress Packet Ingress Packet Egress Match-Action Parser Tables 25
Editing Mode Editing Mode Advantage Advantage Disadvantage Disadvantage Post-Pipeline Post-Pipeline Packet header size is Extra copy of headers Extra copy of headers adjusted only once Inline Inline No extra copy of headers No extra copy of headers Packet header size is adjusted multiple times 26
PISCES automatically chooses between • Inline Editing • Post-pipeline Editing Egress Ingress Packet Checksum Checksum Packet Match-Action Parser Verify Update Deparser Tables 27
Throughput on Eth + IPv4 + ACL benchmark application 16 13.43 PISCES v0.1 13.32 12.56 12.28 Throughput (Gbps) 14 Incremental Checksum 12 Editing Mode Selection 10 7.59 PISCES v1.0 8 Native OVS 6 4 2 0 64 Performance overhead of Packet Size (Bytes) < 2% 28
Number of Files Changed Lines of Code Changed 28 411 30 450 370 400 25 350 20 18 20 300 250 15 170 200 10 150 100 5 1 1 1 50 5 6 4 0 0 Connection Label Tunnel OAM Flag TCP Flag Connection Label Tunnel OAM Flag TCP Flag Native OVS PISCES Native OVS PISCES 29
A method to quickly develop and deploy packet • processing logic on a software switch With hardly any performance cost! • Learn more and Try PISCES here: http://pisces.cs.princeton.edu 30
Recommend
More recommend