Top Banner
FLICK: Developing and Running Application-Specific Network Services Presenter: Richard G. Clegg, Imperial College Imperial College: Abdul Alim, Luo Mai, Lukas Rupprecht, Eric Seckler, Paolo Costa, Peter Pietzuch, Alexander L. Wolf Cambridge: Nik Sultana, Jon Crowcroft, Anil Madhavapeddy, Andrew W. Moore, Richard Mortier Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg FLICK: Application-specific network services USENIX ATC 0 / 23
87

FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Oct 15, 2020

Download

Documents

dariahiddleston
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: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK: Developing and RunningApplication-Specific Network

Services

Presenter: Richard G. Clegg, Imperial CollegeImperial College: Abdul Alim, Luo Mai, Lukas Rupprecht, Eric Seckler, Paolo Costa,Peter Pietzuch, Alexander L. WolfCambridge: Nik Sultana, Jon Crowcroft, Anil Madhavapeddy, Andrew W. Moore,Richard MortierNottingham: Masoud Koleini, Carlos Oviedo, Derek McAuleyKent: Matteo Migliavacca

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 0 / 23

Page 2: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Packet processing vs application-specific middlebox

Client

Server1

Server2

Server3

Packet processing(ECMP loadbalancer)

process(packet):

dest=hash(packet.srcIP + packet

.srcport)

forward(packet ,dest);

Header data only used.

Packets have fixed format.

Basic data unit is packet.

Application-specific(memcached router)

process(key_val_pair):

dest=hash(key_val_pair.key);

forward(key_val_pair ,dest);

Applications have different dataformats (e.g. key-value pairs,HTTP request/reply).

TCP flow not packets.

One packet != one data item.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 1 / 23

Page 3: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Packet processing vs application-specific middlebox

Client

Server1

Server2

Server3

Packet processing(ECMP loadbalancer)

process(packet):

dest=hash(packet.srcIP + packet

.srcport)

forward(packet ,dest);

Header data only used.

Packets have fixed format.

Basic data unit is packet.

Application-specific(memcached router)

process(key_val_pair):

dest=hash(key_val_pair.key);

forward(key_val_pair ,dest);

Applications have different dataformats (e.g. key-value pairs,HTTP request/reply).

TCP flow not packets.

One packet != one data item.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 1 / 23

Page 4: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Packet processing vs application-specific middlebox

Client

Server1

Server2

Server3

Packet processing(ECMP loadbalancer)

process(packet):

dest=hash(packet.srcIP + packet

.srcport)

forward(packet ,dest);

Header data only used.

Packets have fixed format.

Basic data unit is packet.

Application-specific(memcached router)

process(key_val_pair):

dest=hash(key_val_pair.key);

forward(key_val_pair ,dest);

Applications have different dataformats (e.g. key-value pairs,HTTP request/reply).

TCP flow not packets.

One packet != one data item.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 1 / 23

Page 5: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Packet processing vs application-specific middlebox

Client

Server1

Server2

Server3

Packet processing(ECMP loadbalancer)

process(packet):

dest=hash(packet.srcIP + packet

.srcport)

forward(packet ,dest);

Header data only used.

Packets have fixed format.

Basic data unit is packet.

Application-specific(memcached router)

process(key_val_pair):

dest=hash(key_val_pair.key);

forward(key_val_pair ,dest);

Applications have different dataformats (e.g. key-value pairs,HTTP request/reply).

TCP flow not packets.

One packet != one data item.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 1 / 23

Page 6: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Packet processing vs application-specific middlebox

Client

Server1

Server2

Server3

Packet processing(ECMP loadbalancer)

process(packet):

dest=hash(packet.srcIP + packet

.srcport)

forward(packet ,dest);

Header data only used.

Packets have fixed format.

Basic data unit is packet.

Application-specific(memcached router)

process(key_val_pair):

dest=hash(key_val_pair.key);

forward(key_val_pair ,dest);

Applications have different dataformats (e.g. key-value pairs,HTTP request/reply).

TCP flow not packets.

One packet != one data item.Richard G. Clegg FLICK: Application-specific network services USENIX ATC 1 / 23

Page 7: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Problem: The application-specific middlebox

Figures from: Making Middleboxes Someone Elses Problem, Sherry et al. SIGCOMM 2012

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 2 / 23

Page 8: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Problem: The application-specific middlebox

Application specific middleboxes

Figures from: Making Middleboxes Someone Elses Problem, Sherry et al. SIGCOMM 2012

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 2 / 23

Page 9: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Problem: The application-specific middlebox

Application specific middleboxes

NetAgg: Using Middleboxesfor On-path AggregationCoNEXT 2014

Figures from: Making Middleboxes Someone Elses Problem, Sherry et al. SIGCOMM 2012

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 2 / 23

Page 10: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Problem: The application-specific middlebox

Application specific middleboxes

NetAgg: Using Middleboxesfor On-path AggregationCoNEXT 2014

BlindBox: Deep Packet Inspec-tion over Encrypted TrafficSIGCOMM 2015

Figures from: Making Middleboxes Someone Elses Problem, Sherry et al. SIGCOMM 2012

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 2 / 23

Page 11: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Problem: The application-specific middlebox

Application specific middleboxes

NetAgg: Using Middleboxesfor On-path AggregationCoNEXT 2014

BlindBox: Deep Packet Inspec-tion over Encrypted TrafficSIGCOMM 2015

Yoda: A Highly AvailableLayer-7 Load BalancerEuroSys 2016

Figures from: Making Middleboxes Someone Elses Problem, Sherry et al. SIGCOMM 2012

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 2 / 23

Page 12: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Problem: The application-specific middlebox

Application specific middleboxes

NetAgg: Using Middleboxesfor On-path AggregationCoNEXT 2014

BlindBox: Deep Packet Inspec-tion over Encrypted TrafficSIGCOMM 2015

Yoda: A Highly AvailableLayer-7 Load BalancerEuroSys 2016

Introducing mcrouter:A memcached protocol routerFacebook blog

Figures from: Making Middleboxes Someone Elses Problem, Sherry et al. SIGCOMM 2012

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 2 / 23

Page 13: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Creating new application-specific middlebox

Ease of implementation

Exp

ress

iven

ess

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 3 / 23

Page 14: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Creating new application-specific middlebox

Ease of implementation

Exp

ress

iven

ess

C/C++ codefrom scratch

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 3 / 23

Page 15: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Creating new application-specific middlebox

Ease of implementation

Exp

ress

iven

ess

C/C++ codefrom scratch

ClickOSexisting modules

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 3 / 23

Page 16: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Creating new application-specific middlebox

Ease of implementation

Exp

ress

iven

ess

C/C++ codefrom scratch

ClickOSexisting modules

ClickOSnew modules

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 3 / 23

Page 17: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Creating new application-specific middlebox

Ease of implementation

Exp

ress

iven

ess

C/C++ codefrom scratch

ClickOSexisting modules

ClickOSnew modules Software

Defined Networking

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 3 / 23

Page 18: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK for the datacentre

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 4 / 23

Page 19: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK for the datacentre

mcrouter mcrouterspam filter

IP firewallWAN opt

HTTPloadbalancer

HTTPloadbalancer

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 4 / 23

Page 20: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK for the datacentre

IP firewall

FLICK

FLICK

FLICK FLICK

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 4 / 23

Page 21: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

General system for application-specific middleboxes?

Challenge 1: Ease-of-use

Rapidly express many middlebox functions.System created in hours not weeks/months.

Challenge 2: Performance

Generality must not have large performance penalty.Performance similar to specially written system.

Challenge 3: Safety/Isolation

Middleboxes should be “safe” in resource usage.Applications on same machine share resources well.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 5 / 23

Page 22: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

General system for application-specific middleboxes?

Challenge 1: Ease-of-use

Rapidly express many middlebox functions.System created in hours not weeks/months.

Challenge 2: Performance

Generality must not have large performance penalty.Performance similar to specially written system.

Challenge 3: Safety/Isolation

Middleboxes should be “safe” in resource usage.Applications on same machine share resources well.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 5 / 23

Page 23: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

General system for application-specific middleboxes?

Challenge 1: Ease-of-use

Rapidly express many middlebox functions.System created in hours not weeks/months.

Challenge 2: Performance

Generality must not have large performance penalty.Performance similar to specially written system.

Challenge 3: Safety/Isolation

Middleboxes should be “safe” in resource usage.Applications on same machine share resources well.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 5 / 23

Page 24: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK overview

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 6 / 23

Flick programs

Domain specific language (DSL) for application-specific middleboxes.Tens of lines of code not tens of thousands

Page 25: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK overview

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 6 / 23

Flick task graphs

Break work into independently schedulable units (tasks).Join tasks by channels into task graphs.

Page 26: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK overview

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 6 / 23

Flick platform

The running implementation. Integrates the compiled C++ from DSL.Handles network connections, worker threads and scheduling tasks.

Page 27: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the language

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 7 / 23

Page 28: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – features

type cmd: record

key : string

proc Memcached: (cmd/cmd client , [cmd/cmd] backends)

| backends => client

| client => target_backend(backends)

fun target_backend: ([-/cmd] backends , req:cmd) -> ()

let target = hash(req.key) mod len(backends)

req => backends[target]

Process as basic unit of code expresses flow of typed data.

Control structures restricted. Bounded loops and hence executiontime.

Strongly typed for safety.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 8 / 23

Page 29: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – features

type cmd: record

key : string

proc Memcached: (cmd/cmd client , [cmd/cmd] backends)

| backends => client

| client => target_backend(backends)

fun target_backend: ([-/cmd] backends , req:cmd) -> ()

let target = hash(req.key) mod len(backends)

req => backends[target]

Process as basic unit of code expresses flow of typed data.

Control structures restricted. Bounded loops and hence executiontime.

Strongly typed for safety.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 8 / 23

Page 30: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – processing data (memcached)

Client

Server 1

Server 2

type cmd: record

key : string

proc Memcached: (cmd/cmd client , [cmd/cmd] backends)

| backends => client

| client => target_backend(backends)

fun target_backend: ([-/cmd] backends , req:cmd) -> ()

let target = hash(req.key) mod len(backends)

req => backends[target]

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 9 / 23

Page 31: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – processing data (memcached)

Client

Server 1

Server 2

type cmd: record

key : string

proc Memcached: (cmd/cmd client , [cmd/cmd] backends)

| backends => client

| client => target_backend(backends)

fun target_backend: ([-/cmd] backends , req:cmd) -> ()

let target = hash(req.key) mod len(backends)

req => backends[target]

Structure allows work tobreak into smaller task units

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 9 / 23

Page 32: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – processing data (memcached)

Client

Server 1

Server 2

type cmd: record

key : string

proc Memcached: (cmd/cmd client , [cmd/cmd] backends)

| backends => client

| client => target_backend(backends)

fun target_backend: ([-/cmd] backends , req:cmd) -> ()

let target = hash(req.key) mod len(backends)

req => backends[target]

Structure allows work tobreak into smaller task units

Convenient abstractions for middlebox

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 9 / 23

Page 33: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – processing data (memcached)

Client

Server 1

Server 2

type cmd: record

key : string

proc Memcached: (cmd/cmd client , [cmd/cmd] backends)

| backends => client

| client => target_backend(backends)

fun target_backend: ([-/cmd] backends , req:cmd) -> ()

let target = hash(req.key) mod len(backends)

req => backends[target]

Type definitiononly necessaryfields included

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 9 / 23

Page 34: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – processing data (memcached)

Client

Server 1

Server 2

type cmd: record

key : string

proc Memcached: (cmd/cmd client , [cmd/cmd] backends)

| backends => client

| client => target_backend(backends)

fun target_backend: ([-/cmd] backends , req:cmd) -> ()

let target = hash(req.key) mod len(backends)

req => backends[target]

Process: entry pointdefines how

channels connect

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 9 / 23

Page 35: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – processing data (memcached)

Client

Server 1

Server 2

type cmd: record

key : string

proc Memcached: (cmd/cmd client , [cmd/cmd] backends)

| backends => client

| client => target_backend(backends)

fun target_backend: ([-/cmd] backends , req:cmd) -> ()

let target = hash(req.key) mod len(backends)

req => backends[target]

Functionselects backend

using key

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 9 / 23

Page 36: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – parsing data (memcached)

type cmd = unit {

%byteorder = big;

magic_code : uint8;

opcode : uint8;

key_len : uint16;

extras_len : uint8;

: uint8; # anon field - future use

status_or_v_bucket : uint16;

total_len : uint32;

opaque : uint32;

cas : uint64;

extras : bytes &length = self.extras_len;

key : string &length = self.key_len;

value : bytes &length = self.value_len;

};

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 10 / 23

Page 37: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – parsing data (memcached)

type cmd = unit {

%byteorder = big;

magic_code : uint8;

opcode : uint8;

key_len : uint16;

extras_len : uint8;

: uint8; # anon field - future use

status_or_v_bucket : uint16;

total_len : uint32;

opaque : uint32;

cas : uint64;

extras : bytes &length = self.extras_len;

key : string &length = self.key_len;

value : bytes &length = self.value_len;

};

Based on Spicy/binpac++ [IMC2006]

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 10 / 23

Page 38: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – parsing data (memcached)

type cmd = unit {

%byteorder = big;

magic_code : uint8;

opcode : uint8;

key_len : uint16;

extras_len : uint8;

: uint8; # anon field - future use

status_or_v_bucket : uint16;

total_len : uint32;

opaque : uint32;

cas : uint64;

extras : bytes &length = self.extras_len;

key : string &length = self.key_len;

value : bytes &length = self.value_len;

};

Based on Spicy/binpac++ [IMC2006]

Developer can quickly parse evencomplex formats like HTTP

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 10 / 23

Page 39: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – parsing data (memcached)

type cmd = unit {

%byteorder = big;

magic_code : uint8;

opcode : uint8;

key_len : uint16;

extras_len : uint8;

: uint8; # anon field - future use

status_or_v_bucket : uint16;

total_len : uint32;

opaque : uint32;

cas : uint64;

extras : bytes &length = self.extras_len;

key : string &length = self.key_len;

value : bytes &length = self.value_len;

};

Based on Spicy/binpac++ [IMC2006]

Developer can quickly parse evencomplex formats like HTTP

Compiles to efficient C++. Onlyextracts fields used in processing

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 10 / 23

Page 40: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – parsing data (memcached)

type cmd = unit {

%byteorder = big;

magic_code : uint8;

opcode : uint8;

key_len : uint16;

extras_len : uint8;

: uint8; # anon field - future use

status_or_v_bucket : uint16;

total_len : uint32;

opaque : uint32;

cas : uint64;

extras : bytes &length = self.extras_len;

key : string &length = self.key_len;

value : bytes &length = self.value_len;

};

Fixed width fieldeasy to define

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 10 / 23

Page 41: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK (language) – parsing data (memcached)

type cmd = unit {

%byteorder = big;

magic_code : uint8;

opcode : uint8;

key_len : uint16;

extras_len : uint8;

: uint8; # anon field - future use

status_or_v_bucket : uint16;

total_len : uint32;

opaque : uint32;

cas : uint64;

extras : bytes &length = self.extras_len;

key : string &length = self.key_len;

value : bytes &length = self.value_len;

};

Field lengthdepends on

previous field

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 10 / 23

Page 42: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 11 / 23

Page 43: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

Client

Server 1

Server 2

Separate input, processing andoutput tasks enable parallelism

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 12 / 23

Page 44: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

Client

Server 1

Server 2

Input TCPflow

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 12 / 23

Page 45: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

Client

Server 1

Server 2

Input taskdeserialises data

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 12 / 23

Page 46: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

Client

Server 1

Server 2

Processing taskforwards by key

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 12 / 23

Page 47: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

Client

Server 1

Server 2

Output taskserialises data

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 12 / 23

Page 48: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

Client

Server 1

Server 2

Serversends reply

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 12 / 23

Page 49: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

Client

Server 1

Server 2

Input taskdeserialises data

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 12 / 23

Page 50: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

For memcached router each client has its own task graph.

Different types of task graph – some have data parallelism.Data and task parallelism.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 13 / 23

Page 51: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the task graph

For memcached router each client has its own task graph.Different types of task graph – some have data parallelism.Data and task parallelism.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 13 / 23

Page 52: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 14 / 23

Page 53: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

SchedulerTask Queue

Work Threads

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 15 / 23

Page 54: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

SchedulerTask Queue

Work Threads

Efficiently handle the TCPconnection set up and tear down

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 15 / 23

Page 55: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

SchedulerTask Queue

Work Threads

Efficiently handle the TCPconnection set up and tear down

Manage memory allocation smartly(reduce dynamic allocation)

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 15 / 23

Page 56: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

SchedulerTask Queue

Work Threads

Efficiently handle the TCPconnection set up and tear down

Manage memory allocation smartly(reduce dynamic allocation)

Schedule tasks fairly betweenapplications (safety/isolation)

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 15 / 23

Page 57: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 58: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

New TCPconnection

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 59: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

DPDK/mTCP (userland TCP)reduce kernel calls

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 60: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Choose applicationto connect to

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 61: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 62: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Connect toexisting graph

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 63: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

New graphfrom pool

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 64: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

SchedulerTask Queue

Work Threads

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 65: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

SchedulerTask Queue

Work Threads

Tasks with dataadded to queue

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 66: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

SchedulerTask Queue

Work Threads

Workers picktasks from queue

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 67: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

SchedulerTask Queue

Work Threads

Tasks have limitedtime on a thread

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 68: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

FLICK – the platform

Application Dispatcher

Graph DispatcherGraph pool

Existinggraph

Newgraph

SchedulerTask Queue

Work Threads

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 16 / 23

Page 69: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – latency/throughput (loadbalancer)

Client

Server 1

Server 2

Clients send HTTP requests up to ten backends.

Persistent TCP connections to/from loadbalancer.

Vary number of clients measure latency and throughput.

DPDK/mTCP used to reduce kernel calls in connections.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 17 / 23

Page 70: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – latency/throughput (loadbalancer)

Client

Server 1

Server 2

Clients send HTTP requests up to ten backends.

Persistent TCP connections to/from loadbalancer.

Vary number of clients measure latency and throughput.

DPDK/mTCP used to reduce kernel calls in connections.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 17 / 23

Page 71: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – latency (loadbalancer)

0

10

20

100 200 400 800 1600Concurrent clients

Mea

n la

tenc

y (m

s)

Lower is better

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 18 / 23

Page 72: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – latency (loadbalancer)

0

10

20

100 200 400 800 1600Concurrent clients

Mea

n la

tenc

y (m

s)

FLICKApacheNginx

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 18 / 23

Page 73: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – latency (loadbalancer)

0

10

20

100 200 400 800 1600Concurrent clients

Mea

n la

tenc

y (m

s) FLICK mTCPFLICKApacheNginx

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 18 / 23

Page 74: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – throughput (loadbalancer)

100

200

300

100 200 400 800 1600Concurrent clients

Thou

sand

reqs

/s Higheris better

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 19 / 23

Page 75: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – throughput (loadbalancer)

100

200

300

100 200 400 800 1600Concurrent clients

Thou

sand

reqs

/s

FLICK Apache Nginx

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 19 / 23

Page 76: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – throughput (loadbalancer)

100

200

300

100 200 400 800 1600Concurrent clients

Thou

sand

reqs

/s

FLICK mTCP FLICK Apache Nginx

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 19 / 23

Page 77: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – scalability with cores

This middlebox merges data in big data systems.

Binary merge tree takes advantage of data parallelism.

See “NetAgg: Using Middleboxes for Application-specific On-pathAggregation in Data Centres” [CoNext 2014].

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 20 / 23

Page 78: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – scalability with cores

This middlebox merges data in big data systems.

Binary merge tree takes advantage of data parallelism.

See “NetAgg: Using Middleboxes for Application-specific On-pathAggregation in Data Centres” [CoNext 2014].

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 20 / 23

Page 79: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – scalability with cores

Test scaling. Measure throughput as number of cores increases.

Three data sets each one billion words. 8, 12 and 16 character words.

Merge eight streams – measure throughput of output stream.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 21 / 23

Page 80: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – scalability with cores

Test scaling. Measure throughput as number of cores increases.

Three data sets each one billion words. 8, 12 and 16 character words.

Merge eight streams – measure throughput of output stream.

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 21 / 23

Page 81: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – scalability with cores

Maximum throughput

0

2000

4000

6000

8000

1 2 4 8 16CPU cores

Thro

ughp

ut M

b/s

Higheris better

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 22 / 23

Page 82: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – scalability with cores

Maximum throughput

0

2000

4000

6000

8000

1 2 4 8 16CPU cores

Thro

ughp

ut M

b/s

16 char words

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 22 / 23

Page 83: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Evaluation – scalability with cores

Maximum throughput

0

2000

4000

6000

8000

1 2 4 8 16CPU cores

Thro

ughp

ut M

b/s

8 char words12 char words16 char words

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 22 / 23

Page 84: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Conclusions

Application-specific services

Application-specific middleboxes are here to stay.

Packet processing systems not suitable for these.

The FLICK system

FLICK domain-specific language – “safe by design”.

Task graph abstraction gives task and data parallelism.

Performance of FLICK comparable to specialist system.

Thank you – questions?Richard G. Clegg

[email protected]

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 23 / 23

Page 85: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Conclusions

Application-specific services

Application-specific middleboxes are here to stay.

Packet processing systems not suitable for these.

The FLICK system

FLICK domain-specific language – “safe by design”.

Task graph abstraction gives task and data parallelism.

Performance of FLICK comparable to specialist system.

Thank you – questions?Richard G. Clegg

[email protected]

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 23 / 23

Page 86: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Conclusions

Application-specific services

Application-specific middleboxes are here to stay.

Packet processing systems not suitable for these.

The FLICK system

FLICK domain-specific language – “safe by design”.

Task graph abstraction gives task and data parallelism.

Performance of FLICK comparable to specialist system.

Thank you – questions?Richard G. Clegg

[email protected]

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 23 / 23

Page 87: FLICK: Developing and Running Application-Speci c Network … · 2020. 6. 23. · Nottingham: Masoud Koleini, Carlos Oviedo, Derek McAuley Kent: Matteo Migliavacca Richard G. Clegg

Performance – memcached example

●●

0

1

2

3

4

1 2 4 8 16CPU cores

Mea

n la

tenc

y (m

s)

● FLICKFLICK mTCPMoxi

Comparison with Moxi (also supports multi-core + binary protocol).

Set up 128 clients making multiple requests.

Latency reduction shown.

FLICK throughput with mTCP 198,000 reqs/sec.

Moxi throughput 82,000 reqs/sec

Richard G. Clegg FLICK: Application-specific network services USENIX ATC 1 / 1