cryptographic hashing in p4 data planes
play

Cryptographic Hashing in P4 Data Planes Dominik Scholz , Andreas - PowerPoint PPT Presentation

Chair of Network Architectures and Services Department of Informatics Technical University of Munich Cryptographic Hashing in P4 Data Planes Dominik Scholz , Andreas Oeldemann, Fabien Geyer, Sebastian Gallenmller, Henning Stubbe, Thomas Wild,


  1. Chair of Network Architectures and Services Department of Informatics Technical University of Munich Cryptographic Hashing in P4 Data Planes Dominik Scholz , Andreas Oeldemann, Fabien Geyer, Sebastian Gallenmüller, Henning Stubbe, Thomas Wild, Andreas Herkersdorf, Georg Carle Chair of Network Architectures and Services Department of Informatics Technical University of Munich

  2. Motivation Manifold P4 Applications and Programs Imagine long list of P4 programs here → Few programs that require cryptographic functionality Image from https://bit.ly/2LHVmDZ P4 is of high interest to industry, e.g. avionics • Rapid prototyping • Program verification • . . . Requires guarantees: e.g. authentication of switches Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 2

  3. Motivation Cryptographic Properties and Functions Cryptographic properties commonly found in network applications and protocols • Confidentiality • Authenticity (data/message integrity) • Authentication (data origin authentication) Cryptographic functions • Encryption • Hash functions → in this work we focus on cryptographic hash functions Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 3

  4. Motivation Use cases for cryptographic hash functions Data structures Authenticity/Authentication • Hash maps • Message Authentication Codes • Bloom-Filter • Client puzzles (TCP SYN cookies) But: cryptographic functions not required Cryptographic functions required e.g. Bloom-Filter: linear-independent hashes suffice Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 4

  5. Outline Problem Statement Choice of Hash Function P4 Targets and Hash Integration Performance Results Conclusion Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 5

  6. Problem Statement Feasibility of cryptographic hashing in programmable data planes • Hash with cryptographic properties • Hash of complete packet content • Ideally achieving 10 GbE line-rate • Software and hardware P4 targets Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 6

  7. Choice of Hash Function Cryptography vs. Performance Benchmarks on software system Cryptographic (hash) functions are • Slow ↔ line-rate Hash Cycles Fixed cycles Cycles • Complex ↔ resource consumption on target algorithm per B per packet for 64 B CRC32 0.32 0.00 10.79 Pseudo-cryptographic SipHash Checksum 0.44 0.00 30.06 SipHash-2-4 1.06 56.40 121.10 • Optimized for small inputs BLAKE2b 3.14 35.85 232.77 • Optimized for performance in software HMAC-SHA256 5.57 959.69 1462.13 Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 7

  8. Available P4 Targets . . . that can be extended with cryptographic hashing • Software: t4p4s (P4ELTE), based on DPDK • Network Processing Unit: Netronome Agilio SmartNIC (NFP-4000) • FPGA: NetFPGA SUME (P4 → NetFPGA) • ASIC: none that we are aware of Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 8

  9. P4 Hash Integration t4p4s • Trivial: link library, add extern • Added SipHash-2-4 and HMAC-SHA512 (openssl) NFP-4000 • Crypto security accelerator (SHA1): not available on our card • Integrated SipHash-2-4 as extern in variation of C NetFPGA SUME • Externs implemented in Verilog/VHDL • Integrated SipHash-2-4 and SHA3-512 • Problem: • Data passed between P4 program and extern is a single data word • SDNet limit: 600 B input width • No timing closure due to resource congestion Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 9

  10. P4 Hash Integration NetFPGA Alternative P4 architecture model Limitations • All packets are always hashed • Hash outcome not usable in P4 • Alternatives: • Hashing before P4 pipeline • Second P4 pipeline after hashing core • Traffic manager • SHA3-512 core uses 125 MHz → clock domain crossing Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 10

  11. Measurement Results Setup ◭ ◭ DuT LoadGen ◮ ◮ • Load Generator Disclaimer • CBR traffic of constant packet size • Precise latency measurements • Open-source implementations • Device-under-Test (DuT) • Non-commercial IP cores • Intel Xeon E5-2620 with Intel X540 NIC • Not optimized integration → proof-of-concept • Netronome NFP-4000 SmartNIC • Take performance figures with grain of salt • NetFPGA SUME → conservative numbers • P4 program • L2 forwarder • Hashes complete packets Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 11

  12. Measurement Results Achievable Throughput t4p4s SipHash t4p4s HMAC SHA512 NetFPGA SipHash NetFPGA SHA3-512 NFP-4000 SipHash 100 80 Throughput [%] 60 40 20 0 64 96 128 512 1024 1500 Packet Size [B] Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 12

  13. Measurement Results Latency NetFPGA NFP-4000 100 6 Latency [ µ s] Percentage 4 50 2 Baseline NFP-4000 5 % 80 % Baseline SHA3-512 SipHash-2-4 SipHash-2-4 NFP-4000 5 % 80 % 0 0 64 300 600 900 1 , 200 1 , 518 10 0 10 1 10 2 10 3 10 4 Packet Size [B] Latency [log µ s] Stable latency: no long-tail 100 Percentage 50 t4p4s Baseline DPDK 5 % 80 % Typical behavior of software system/DPDK: long-tail SipHash DPDK 5 % 80 % 0 10 0 10 1 10 2 10 3 10 4 Latency [log µ s] Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 13

  14. Measurement Results Resource Utilization Does the program fit on the target? • t4p4s: trivial • NFP-4000: no restrictions enountered • NetFPGA: LUTs Registers BRAM Abs. % Abs. % Abs. [kB] % Baseline 64,533 14.90 109,783 12.67 16,362 30.92 SipHash-2-4 66,380 15.32 114,282 13.19 17,460 32.99 SHA3-512 73,449 16.95 118,689 13.70 17,460 32.99 Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 14

  15. Conclusion The current use of hash functions in P4 programs • Data structures might be vulnerable to attacks (hash collisions) • Lack of programs/protocols requiring authentication and integrity → Cryptographic hash functions increase applicability of P4 Cryptographic hashing is target, algorithm and use-case dependent • Line-rate possible on hardware targets • Integration for instance by adjusting P4 architecture model • Algorithms might be better on one target than another → no one-size-fits-all solution → P4 specification should recommend family of hash functions, including cryptographic ones Scholz, Oeldemann, Geyer, Gallenmüller, Stubbe, Wild, Herkersdorf, Carle — Cryptographic Hashing in P4 Data Planes 15

Recommend


More recommend