Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using...

Post on 17-Mar-2020

9 views 0 download

transcript

Using C# for high performance network programming

Jonny Shipton

CL, University of Cambridge 1

Low latencyHigh throughput

(10-100Gbps)

NAT

What is a NAT?

www.google.co.uk

www.bbc.co.uk

Alice

NAT

Cathy

Bob

Reality

2

212.58.244.26:80

What is a NAT?

www.google.co.uk

www.bbc.co.uk

Alice

Cathy

Bob

Client’s POV

3

What is a NAT?

www.google.co.uk

www.bbc.co.uk

Nathan

Server’s POV

4

Why C#?

Verilog C#

Performance ✓✓✓ ✓

Scalable to 100Gbps+

✓✓✓ ✓

Skill base Small Large

Comfy language features

✓✓✓

5

Why C#?

Methods

Loops

Exceptions

LINQ

Generics

Concurrency

OOPMemory Management

Also iterators, properties, inheritance, libraries, dynamic variables, safe expressive type system, …

Lambdas

6

Why C#?

7

0 5 10 15 20 25 30 35 40

C#

Verilog simulation

Hardware

Time (mins) to compile and run

Compile C# to Verilog?!Sequential/Synchronous Semantics Concurrent Semantics

C# CIL Verilog Hardware

F#

SynthesisCompile

Compile

Kiwi

8

Look at the code

9

Look at the code

10

Object wrapping raw data array

Property

Intuitive enum…

Limitations

• No truly dynamic allocation (yet)• Array sizes must be determined statically

• Objects can be allocated and used within loops

• Library support less mature

• Complexity -> longer compile times

• No reflection, dynamic invoke, etc.

• Clock cycles are more precious, so we want to do more in each one• Asynchronous – Kiwi flattens code

11

Thanks to:

• Nik Sultana

• Salvator Galea

• David Greaves

• Networks-as-a-Service(Naas-project.org)

• EPSRC

• Kynesim

12

Kiwi

Google “Kiwi compiler”http://www.cl.cam.ac.uk/~djg11/kiwi/http://www.cl.cam.ac.uk/research/srg/han/hprls/orangepath/kiwic.html

NetFPGA-SUMEhttp://netfpga.org/site/#/systems/1netfpga-sume/details/