in

ixy-languages ​​/ ixy-languages, Hacker News

ixy-languages ​​/ ixy-languages, Hacker News


          A high-speed network driver written in C, Rust, Go, C #, Java, OCaml, Haskell, Swift, Javascript, and Python           

                    

        

Ixy is an educational user space network driver for the Intel ixgbe family of (Gbit / s NICs) 82599 ES aka X 520, X 540, X 550 , X 552, …). Its goal is to show that writing a super-fast network driver can be surprisingly simple, check out thefull description in the main repository of the C implementationto learn about the basics of user space drivers. Ixy was originally written in C as lowest common denominator of system programming languages, but it is possible to write user space drivers in any programming language.

Check out our research paper“The Case for Writing Network Drivers in High-Level Languages”[BibTeX] or watch the recording of ourtalk at (C3) to learn more.

Yes, these drivers are really a full implementation of an actual PCIe driver in these languages; they handle everything from setting up DMA memory to receiving and transmitting packets in a high-level language. You don’t need to write any kernel code to build drivers! Some languages ​​require a few lines of C stubs for features not offered by the language; usually related to getting the memory address of buffers or calling mmap in the right way. But all the core logic is in high-level languages; the implementations are about 1000 lines of code each.

also features a VirtIO driver for easy testing in VMs with Vagrant

This repository here is only a short summary of the project, check out the repositories and full evaluations linked above for all the gory details.

Ourbenchmarking scriptfor theMoonGen packet generatorloads the forwarder example application with full bidirectional load at 20 Gbit / s with 64 byte packets (29. (Mpps). The forwarder then increments one byte in the packet to ensure that the packet is loaded all the way into the L1 cache. Correct functionality of the forwarder is also tested by the script by validating sequence numbers.

A main driver of performance for network drivers is sending / receiving packets in batches from / to the NIC. Ixy can already achieve a high performance with relatively low batch sizes of 32 – 64 because it is a full user space driver. Other user space packet processing frameworks like netmap that rely on a kernel driver need larger batch sizes of 512 and above to amortize the larger overhead of communicating with the driver in the kernel. Running this on a single core of a Xeon E3 – 1230 v2 CPU yields these throughput results in million packets per second (Mpps) when varying the batch size.

Performance with different batch sizes, CPU at 3.3 GHz

Performance with different batch sizes, CPU at 1.6 GHz

Notes on multi-core:Some languages ​​implement multi-threading for ixy, but some can’t or are limited by the language’s design (eg, the GIL in Python and OCaml). However, this isn’t a real problem because multi-threading within one process isn’t really necessary. Network cards can split the traffic at the hardware level (via a feature called RSS), the traffic can then be distributed to independent different processes. For example,Snabbworks like this and many DPDK applications use multiple threads that do not communicate (shared-nothing architecture).

Average and median latency is the same regardless of the programming language as latency is dominated by buffering times, theevaluation scriptcan sample the latency of up to 1000 packets per second with hardware timestamping (precision: 8 nanoseconds). This yields somewhat interesting results depending on queue sizes and NUMA configuration, see theixy paperfor an evaluation.

Latency spikes induced by languages ​​featuring a garbage collector might not be caught by the test setup above. We have a second test setup to catch this: we also captureallpackets before and after the device under test with fiber optic taps and useMoonSniffto acquire hardware timestamps (25 6 nanosecond precision (for all packets.

Running the forwarder on an Intel Xeon E5 – 2620 v3 at 2.4 GHz yields the following results for the forwarding latency.

Latency

Latency******

Latency

How to read this graph: the x axis refers to the percentage of packets that can be forwarded in this time. For example, if a language takes longer than 100 µs for only one packet in 1000 packets, it shows a value of 100 ats at x position 99. This graph focuses on the tail latency, note the logarithmic scaling on the x axis.

Graphs only include languages ​​that can cope with the offered load. Measuring an overloaded driver doesn’t make sense as latency is dominated by the buffer size in this scenario.

  

Brave Browser
Read More
Payeer

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Summer heat 'killed nearly 1,500' in France, Hacker News

Summer heat 'killed nearly 1,500' in France, Hacker News

Companies are calling themselves “tech” less often, Recode

Companies are calling themselves “tech” less often, Recode