OS support for (flexible) high-speed networking Herbert Bos Vrije Universiteit Amsterdam uspace kspace nspace u k n monitoring intrusion detection packet.

Slides:



Advertisements
Similar presentations
NETWORK TRANSFORMATION THROUGH VIRTUALIZATION
Advertisements

IP Router Architectures. Outline Basic IP Router Functionalities IP Router Architectures.
Computer Organization and Architecture
01/05/2015Leiden Institute of Advanced Computer Science 1 The Open Kernel Environment - spinning Linux - Herbert Bos Bart Samwel
An Overview of Software-Defined Network Presenter: Xitao Wen.
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
Computer Organization and Architecture
CacheCast: Eliminating Redundant Link Traffic for Single Source Multiple Destination Transfers Piotr Srebrny, Thomas Plagemann, Vera Goebel Department.
Web Caching Schemes1 A Survey of Web Caching Schemes for the Internet Jia Wang.
Processes CSCI 444/544 Operating Systems Fall 2008.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Reasons to study concepts of PL
FFPF: Fairly Fast Packet Filters uspace kspace nspace Vrije Universiteit Amsterdam Herbert Bos Willem de Bruijn Trung Nguyen Mihai Cristea Georgios Portokalidis.
Computer System Overview
More on FunctionsCS-2301 B-term More on Functions CS-2301, System Programming for Non-majors (Slides include materials from The C Programming Language,
FFPF: Fairly Fast Packet Filters uspace kspace nspace Vrije Universiteit Amsterdam Herbert Bos Willem de Bruijn Trung Nguyen Mihai Cristea Georgios Portokalidis.
An IST Projecthttp:// 1 Herbert Bos, VU, FFPF: Fairly Fast Packet Filters Herbert Bos Vrije Universiteit.
Processes in Unix, Linux, and Windows CS-502 Fall Processes in Unix, Linux, and Windows CS502 Operating Systems (Slides include materials from Operating.
September RTC-Mon Enabling High-Speed and Extensible Real-Time Communications Monitoring Diego Costantini, Felipe Huici
CH12 CPU Structure and Function
FIREWALL TECHNOLOGIES Tahani al jehani. Firewall benefits  A firewall functions as a choke point – all traffic in and out must pass through this single.
Sven Ubik, Petr Žejdl CESNET TNC2008, Brugges, 19 May 2008 Passive monitoring of 10 Gb/s lines with PC hardware.
I/O Systems ◦ Operating Systems ◦ CS550. Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read.
Christopher Bednarz Justin Jones Prof. Xiang ECE 4986 Fall Department of Electrical and Computer Engineering University.
CS252: Systems Programming Ninghui Li Final Exam Review.
RAID2005 CardGuard: Towards software-based signature detection for intrusion prevention on the network card Herbert Bos and Kaiming Huang presented by.
Jennifer Rexford Princeton University MW 11:00am-12:20pm Programmable Data Planes COS 597E: Software Defined Networking.
Department of Computer Science and Engineering Applied Research Laboratory 1 A Hardware Based TCP/IP Processing Engine David V. Schuehler
Paper Review Building a Robust Software-based Router Using Network Processors.
Computer Concepts & Careers Exam 1 Study Guide. Hardware What is RAM? – Random Access Memory – A temporary holding area for data, application instructions,
Workpackage 3 New security algorithm design ICS-FORTH Paris, 30 th June 2008.
ECE 526 – Network Processing Systems Design Network Processor Architecture and Scalability Chapter 13,14: D. E. Comer.
Software-Defined Networks Jennifer Rexford Princeton University.
1 GAIA VoIP traffic generator and analyzer Presentation by Amrut Bang Ashish Deshpande Vijay Gabale Santosh Patil Sponsored by GS Lab Pvt. Ltd Pune Institute.
LiNK: An Operating System Architecture for Network Processors Steve Muir, Jonathan Smith Princeton University, University of Pennsylvania
SIGCOMM 2002 New Directions in Traffic Measurement and Accounting Focusing on the Elephants, Ignoring the Mice Cristian Estan and George Varghese University.
N E T G R O U P P O L I T E C N I C O D I T O R I N O Towards Effective Portability of Packet Handling Applications Across Heterogeneous Hardware Platforms.
1 Liquid Software Larry Peterson Princeton University John Hartman University of Arizona
MIDeA :A Multi-Parallel Instrusion Detection Architecture Author: Giorgos Vasiliadis, Michalis Polychronakis,Sotiris Ioannidis Publisher: CCS’11, October.
Programmable Networks: Active Networks + SDN. How to Introduce new services Overlays: user can introduce what-ever – Ignores physical network  perf overhead.
To be smart or not to be? Siva Subramanian Polaris R&D Lab, RTP Tal Lavian OPENET Lab, Santa Clara.
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
Vladimír Smotlacha CESNET Full Packet Monitoring Sensors: Hardware and Software Challenges.
Distributed Denial of Service Attacks Shankar Saxena Veer Vivek Kaushik.
EECB 473 DATA NETWORK ARCHITECTURE AND ELECTRONICS PREPARED BY JEHANA ERMY JAMALUDDIN Basic Packet Processing: Algorithms and Data Structures.
Parallelization and Characterization of Pattern Matching using GPUs Author: Giorgos Vasiliadis 、 Michalis Polychronakis 、 Sotiris Ioannidis Publisher:
Jennifer Rexford Princeton University MW 11:00am-12:20pm Measurement COS 597E: Software Defined Networking.
Department of Computer Science and Engineering Applied Research Laboratory Architecture for a Hardware Based, TCP/IP Content Scanning System David V. Schuehler.
Workpackage 3 New security algorithm design ICS-FORTH Ipswich 19 th December 2007.
July 12th 1999Kits Workshop 1 Active Networking at Washington University Dan Decasper.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
ICS-FORTH WISDOM Workpackage 3: New security algorithm design FORTH-ICS Update and plans for the next six months Heraklion, 4 th June 2007.
Hardened IDS using IXP Didier Contis, Dr. Wenke Lee, Dr. David Schimmel Chris Clark, Jun Li, Chengai Lu, Weidong Shi, Ashley Thomas, Yi Zhang  Current.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
1 ECE 526 – Network Processing Systems Design System Implementation Principles I Varghese Chapter 3.
Addressing Data Compatibility on Programmable Network Platforms Ada Gavrilovska, Karsten Schwan College of Computing Georgia Tech.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Sven Ubik, Aleš Friedl CESNET TNC 2009, Malaga, Spain, 11 June 2009 Experience with passive monitoring deployment in GEANT2 network.
Firewalls. Overview of Firewalls As the name implies, a firewall acts to provide secured access between two networks A firewall may be implemented as.
1 The user’s view  A user is a person employing the computer to do useful work  Examples of useful work include spreadsheets word processing developing.
FlowRadar: A Better NetFlow For Data Centers
Microprocessor Systems Design I
Software Defined Networking (SDN)
POOJA Programmer, CSE Department
CPU Structure CPU must:
Last Class: Communication in Distributed Systems
Presentation transcript:

OS support for (flexible) high-speed networking Herbert Bos Vrije Universiteit Amsterdam uspace kspace nspace u k n monitoring intrusion detection packet processing (NATs, firewalls, etc.) network processors multiple concurrent apps optical infrastructure

we’re hurting because of ● hardware problems ● software problems ● language problems ● lack of flexibility ● network speed may grow too fast anyway ● multiple apps problem CPUMEM NIC

What are we building? flows different barriers

What are we building? uspace kernel if (pkt.proto == TCP) then if (http) then scan webattacks; else if (smtp) scan spam; scan viruses fi else if (pkt.proto == UDP) then if (NFS traffic) mem = statistics (pkt); else scan SLAMMER; fi reconfigure when load changes dynamic optical infrastructure: - configure at startup time - construct datapaths

Application B reduce copying ● FFPF avoids both ‘horizontal’ and ‘vertical’ copies Application A U K ‘filter’ - no ‘vertical’ copies - no ‘horizontal’ copies within flow group - more than ‘just filtering’ in kernel (e.g.,statistics)

minimise copying, context switching flowgraph = DAG combine multiple requests control  dataplane different copying regimes different buffer regimes endianness new languages

applications userspace kernelspace ixp2xxx FFPF host- NIC boundary userspace-kernel boundary MAPI libpcap FFPF toolkit FFPF Software structure

current status ● working for Linux PC with – NICs – IXP1200s and IXP2400s (plugged in) – remote IXP2850 (with poetic license) ● rudimentary support for distributed packet processor ● speed comparable to tailored solutions

Thank you!

bridging barriers

Three flavours 11 Three flavours of packet processing on IXP & host Regular -copy only when needed -may be slow depending on access pattern Zero copy -never copy -may be slow depending on access pattern Copy once -copy always

combining filters (dev,expr=/dev/ixp0) > [ [ (BPF,expr=“…”) > (PKTCOUNT) ] | (FPL2,expr=“…”) ] > (PKTCOUNT)

Example 1: writing applications 1. int main(int argc, char** argv) { 2. void *opaque_handle; 3. int count, returnval; 4. /** pass the string to the subsystem. It initializes and returns an opaque pointer */ 5. opaque_handle = ffpf_open(argv[1], strlen(argv[1])); 6. if (start_listener(asynchronous_listener, NULL)) 7. { 8. printf (WARNING,“spawn failed\n"); 9. ffpf_close (opaque_handle); return -1; 10. } 11. count = ffpf_process(FFPF_PROCESS_FOREVER); 12. stop_listener(1); 13. returnval = ffpf_close(opaque_handle); 14. printf(,"processed %d packets\n",count); 15. return returnval; 16. }

Example 1: writing applications 1. void* asynchronous_listener(void* arg) { 2. int i; 3. while (!should_stop()) { 4. sleep(5); 5. for (i=0;i<export_len;i++) { 6. printf("flowgrabber %d: read %d, written%d\n", i, get_stats_read(exported[i]), get_stats_processed(exported[i])); 7. while ((pkt = get_packet_next(exported[i]))) { 8. dump_pkt (pkt); 9. } 10. } 11. } 12. return NULL; 13. }

Example 2: FPL-2 new pkt processing language: FPL-2 for IXP, kernel and userspace simple, efficient and flexible simple example: filter all webtraffic IF ( (PKT.IP_PROTO == PROTO_TCP) && (PKT.TCP_PORT == 80)) THEN RETURN 1; more complex example: count pkts in all TCP flows IF (PKT.IP_PROTO == PROTO_TCP) THEN R[0] = Hash[ 14, 12, 1024]; M[ R[0] ]++; FI

FPL-2 ● all common arithmetic and bitwise operations ● all common logical ops ● all common integer types – for packet – for buffer (  useful for keeping state!) ● statements – Hash – External functions ● to call hardware implementations ● to call fast C implementations – If … then … else – For … break; … Rof – Return

Example application: dynamic ports 1. // R[0] stores no. of dynports found (initially 0) 2. IF (PKT.IP_PROTO==PROTO_TCP) THEN 3. IF (PKT.TCP_DPORT==554) THEN 4. M[R[0]]=EXTERN("GetDynTCPDPortFromRTSP",0,0); 5. R[0]++; 6. ELSE // compare pkt’s dst port to all ports in array – if match, return pkt 7. FOR (R[1]=0; R[1] < R[0]; R[1]++) 8. IF (PKT.TCP_DPORT == M[ R[1] ] ) THEN 9. RETURN TRUE; 10. FI 11. ROF 11. FI 12. FI 12. RETURN FALSE;

? x ? ? ? kernel userspace network card efficient ● reduced copying and context switches ● sharing data ● flowgraphs: sharing computations “push filtering tasks as far down the processing hierarchy as possible”

Network Monitoring ● Increasingly important – traffic characterisation, security traffic engineering, SLAs, billing, etc. ● Existing solutions: – designed for slow networks or traffic engineering/QoS – not very flexible ● We’re hurting because of – hardware (bus, memory) – software (copies, context switches) -process at lowest possible level -minimise copying -minimise context switching -freedom at the bottom  demand for solution: - scales to high link rates - scales in no. of apps - flexible spread of SAPPHIRE in 30 minutes

HTTP RTSP RTP bytecount generalised notion of flow Flow: “a stream of packets that match arbitrary user criteria” TCP SYN UID 0 eth0 U TCP UDP IP “contains worm”  Flowgraph UDP with CodeRed

Application B reduce copying ● FFPF avoids both ‘horizontal’ and ‘vertical’ copies Application A U K ‘filter’

(device,eth0) | (device,eth1) -> (sampler,2) -> (FPL-2,”..”) | (BPF,”..”) -> (bytecount) (device,eth0) -> (sampler,2) -> (BPF,”..”) -> (packetcount) Extensible ✔ modular framework ✔ language agnostic ✔ plug-in filters

Buffers O O O O O OO W R ● PacketBuf – circular buffer with N fixed-size slots – large enough to hold packet ● IndexBuf – circular buffer with N slots – contains classification result + pointer

Buffers O O O O O OO W R ● PacketBuf – circular buffer with N fixed-size slots – large enough to hold packet ● IndexBuf – circular buffer with N slots – contains classification result + pointer

X X X X X OO W R Buffers ● PacketBuf – circular buffer with N fixed-size slots – large enough to hold packet ● IndexBuf – circular buffer with N slots – contains classification result + pointer

Buffer management  what to do if writer catches up with slowest reader? ● slow reader preference – drop new packets (traditional way of dealing with this) – overall speed determined by slowest reader ● fast reader preference – overwrite existing packets – application responsible for keeping up ● can check that packets have been overwritten ● different drop rates for different apps O O O O O OO R1 O O O O O O O O O W

Languages ● FFPF is language neutral ● Currently we support: – BPF – C – OKE Cyclone – FPL simple to use compiles to optimised native code resource limited (e.g., restricted FOR loop) access to persistent storage (scratch memory) calls to external functions (e.g., fast C functions or hardware assists) compiler for uspace, kspace, and nspace (ixp1200) IF (PKT.IP_PROTO == PROTO_TCP) THEN // reg.0 = hash over flow fields R[0] = Hash (14,12,1024) // increment pkt counter at this // location in MBuf MEM[ R[0] ]++ FI IF (PKT.IP_PROTO == PROTO_TCP) THEN // reg.0 = hash over flow fields R[0] = Hash (14,12,1024) // increment pkt counter at this // location in MBuf MEM[ R[0] ]++ FI

packet sources uspace kspace nspace ● currently three kinds implemented - netfilter -net_if_rx() -IXP1200 ● implementation on IXPs : NIC-FIX -bottom of the processing hierarchy -eliminates mem & bus bottlenecks

Network Processors “programmable NIC” zero copy copy once on-demand copy

Performance results pkt loss: FFPF: < 0.5% LSF: 2-3%

Performance results pkt loss: LSF:64-75% FFPF: 10-15%

Performance

Summary concept of ‘flow’  generalised copying and context switching  minimised processing in kernel/NIC  complex programs + ‘pipes’ FPL: FFPF Packet Languages  fast + flexible persistent storage  flow-specific state authorisation + third-party code  any user flow groups  applications sharing packet buffers

Thank you!

microbenchmarks

we’re hurting because of ● hardware problems ● software problems ● language problems ● lack of flexibility ● network speed may grow too fast anyway ● multiple apps problem kernel: too little, too often vertical + horizontal copies context switching CPUMEM NIC popular ones: not expressive expressive ones: not popular same for speed no way to mix and match heterogeneous hardware programmable cards, routers, etc. no easy way to combine build on abstractions that are too hi-level hard to use as ‘generic’ packet processor 10  40Gbps: what will you do in 10 ns? beyond capacity of single processor