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

12
Using C# for high performance network programming Jonny Shipton CL, University of Cambridge 1 Low latency High throughput (10-100Gbps) NAT

Upload: others

Post on 17-Mar-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

Using C# for high performance network programming

Jonny Shipton

CL, University of Cambridge 1

Low latencyHigh throughput

(10-100Gbps)

NAT

Page 2: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

What is a NAT?

www.google.co.uk

www.bbc.co.uk

Alice

NAT

Cathy

Bob

Reality

2

212.58.244.26:80

Page 3: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

What is a NAT?

www.google.co.uk

www.bbc.co.uk

Alice

Cathy

Bob

Client’s POV

3

Page 4: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

What is a NAT?

www.google.co.uk

www.bbc.co.uk

Nathan

Server’s POV

4

Page 5: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

Why C#?

Verilog C#

Performance ✓✓✓ ✓

Scalable to 100Gbps+

✓✓✓ ✓

Skill base Small Large

Comfy language features

✓✓✓

5

Page 6: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

Why C#?

Methods

Loops

Exceptions

LINQ

Generics

Concurrency

OOPMemory Management

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

Lambdas

6

Page 7: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

Why C#?

7

0 5 10 15 20 25 30 35 40

C#

Verilog simulation

Hardware

Time (mins) to compile and run

Page 8: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

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

C# CIL Verilog Hardware

F#

SynthesisCompile

Compile

Kiwi

8

Page 9: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

Look at the code

9

Page 10: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

Look at the code

10

Object wrapping raw data array

Property

Intuitive enum…

Page 11: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

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

Page 12: Using C# for high performance network programmingsrepls4.doc.ic.ac.uk/slides/shipton.pdf · Using C# for high performance network programming Jonny Shipton CL, University of Cambridge

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/