Network stack personality in Android phone. Cristina Opriceana, Hajime Tazaki (IIJ Research Lab.) Linux netdev 2.2, Seoul, Korea 08 Nov.

Similar documents
Playing BBR with a userspace network stack

Over-The-Top (OTT) Aggregation Solutions

Status Update About COLO FT

MANAGING THE CAR CLOUD CONNECTION.

MidoNet Scalability Report

IsoStack Highly Efficient Network Processing on Dedicated Cores

An Overview of MAMS (Multiple Access Management Services)

SFO17-403: Optimizing the Design and Implementation of KVM/ARM

Mobility Management Concept for Always-Best-Connected Network

Network optimizations for PV guests

Stacked Vlan: Performance Improvement and Challenges

Multipath Transport for Virtual Private Networks

TLDK Overview. Transport Layer Development Kit Ray Kinsella February ray.kinsella [at] intel.com IRC: mortderire

Netchannel 2: Optimizing Network Performance

Accelerating Load Balancing programs using HW- Based Hints in XDP

IPoC: IP over CCN for seamless 5G mobility

Tolerating Malicious Drivers in Linux. Silas Boyd-Wickizer and Nickolai Zeldovich

Ed Warnicke, Cisco. Tomasz Zawadzki, Intel

A Userspace Packet Switch for Virtual Machines

LINUX CONTAINERS. Where Enterprise Meets Embedded Operating Environments WHEN IT MATTERS, IT RUNS ON WIND RIVER

Speeding up Linux TCP/IP with a Fast Packet I/O Framework

Network stack virtualization for FreeBSD 7.0. Marko Zec

To EL2, and Beyond! connect.linaro.org. Optimizing the Design and Implementation of KVM/ARM

On the cost of tunnel endpoint processing in overlay virtual networks

QuickSpecs. HP Z 10GbE Dual Port Module. Models

Operating System Services. User Services. System Operation Services. User Operating System Interface - CLI. A View of Operating System Services

Open Mobile Platforms. EE 392I, Lecture-6 May 4 th, 2010

Computer Networks Security: intro. CS Computer Systems Security

LibOS as a regression test framework for Linux networking

SmartNIC Data Plane Acceleration & Reconfiguration. Nic Viljoen, Senior Software Engineer, Netronome

Support for Smart NICs. Ian Pratt

SLIPSTREAM: AUTOMATIC INTERPROCESS COMMUNICATION OPTIMIZATION. Will Dietz, Joshua Cranmer, Nathan Dautenhahn, Vikram Adve

SoftRDMA: Rekindling High Performance Software RDMA over Commodity Ethernet

Virtualization. ...or how adding another layer of abstraction is changing the world. CIS 399: Unix Skills University of Pennsylvania.

Square Pegs in a Round Pipe: Wire-Compatible Unordered Delivery In TCP and TLS

Schahin Rajab TCP or QUIC Which protocol is most promising for the future of the internet?

Spring 2017 :: CSE 506. Introduction to. Virtual Machines. Nima Honarmand

VALE: a switched ethernet for virtual machines

PDP : A Flexible and Programmable Data Plane. Massimo Gallo et al.

Ethernet Services over IPoIB

MirageOS. Towards a smaller and safer OS. Thomas Gazagnaire. École Normale Supérieure Année Systèmes et Réseaux.

Study Abroad Programme

COURSE OUTLINE: A+ COMPREHENSIVE

Very Tight Coupling between LTE and WiFi: a Practical Analysis

Accelerate Network Protocol Stack Performance and Adoption in the Cloud Networking via DMM

Minion: An All-Terrain Packet Packhorse to Jump-Start Stalled Internet Transports

Exploring Alternative Routes Using Multipath TCP

An Overview of MAMS (Multiple Access Management Services)

viommu/arm: full emulation and virtio-iommu approaches Eric Auger KVM Forum 2017

Zhang Chen Zhang Chen Copyright 2017 FUJITSU LIMITED

New Approach to OVS Datapath Performance. Founder of CloudNetEngine Jun Xiao

COMS3200/7201 Computer Networks 1 (Version 1.0)

Upgrading Transport Protocols using Untrusted Mobile Code

What s New in Energy Debugging

KVM CPU MODEL IN SYSCALL EMULATION MODE ALEXANDRU DUTU, JOHN SLICE JUNE 14, 2015

Applicability of IETF Mobility Solutions to the 3GPP All IP Network

Light & NOS. Dan Li Tsinghua University

MIGSOCK A Migratable TCP Socket in Linux

The Convergence of Storage and Server Virtualization Solarflare Communications, Inc.

Configure Windows VM to CGM-SRV Module on CGR1xxx

Upgrading Transport Protocols using Untrusted Mobile Code

A practical introduction to XDP

24-vm.txt Mon Nov 21 22:13: Notes on Virtual Machines , Fall 2011 Carnegie Mellon University Randal E. Bryant.

DPDK Tunneling Offload RONY EFRAIM & YONGSEOK KOH MELLANOX

Disclaimer This presentation may contain product features that are currently under development. This overview of new technology represents no commitme

CSE 461 Midterm Winter 2018

Multipath QUIC: Design and Evaluation

BIG-IQ Centralized Management: ADC. Version 5.0

Multipath QUIC: Design and Evaluation

TCP/misc works. Eric Google

Host Identifier and Local Locator for Mobile Oriented Future Internet: Implementation Perspective

RESTRUCTURING ENDPOINT CONGESTION CONTROL

MPTCP: Design and Deployment. Day 11

viommu/arm: full emulation and virtio-iommu approaches Eric Auger KVM Forum 2017

HACK: HIERARCHICAL ACKS FOR EFFICIENT WIRELESS MEDIUM UTILIZATION

TOWARDS FAST IP FORWARDING

Design and Implementation of Virtual TAP for Software-Defined Networks

EMBEDDED LINUX ON ARM9 Weekend Workshop

Containers Do Not Need Network Stacks

IO virtualization. Michael Kagan Mellanox Technologies

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Operating Systems. 17. Sockets. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski

Advanced Computer Networking. CYBR 230 Jeff Shafer University of the Pacific QUIC

The Challenges of XDP Hardware Offload

Comprehensive BPF offload

Embedded Android? Not so fast!

QUIC. Internet-Scale Deployment on Linux. Ian Swett Google. TSVArea, IETF 102, Montreal

Openvpn Client Do Not Change Default Gateway

Using the UEFI Shell. October 2010 UEFI Taipei Plugfest Insyde Software

Backporting is so 1993

Network Adapters. FS Network adapter are designed for data center, and provides flexible and scalable I/O solutions. 10G/25G/40G Ethernet Adapters

打造 Linux 下的高性能网络 北京酷锐达信息技术有限公司技术总监史应生.

Light: A Scalable, High-performance and Fully-compatible User-level TCP Stack. Dan Li ( 李丹 ) Tsinghua University

What is an L3 Master Device?

Accelerating VM networking through XDP. Jason Wang Red Hat

Hostless Xen Deployment

UDP Encapsulation in Linux netdev0.1 Conference February 16, Tom Herbert

Virtual switching technologies and Linux bridge

NLUUG, Bunnik CloudABI: safe, testable and maintainable software for UNIX Speaker: Ed Schouten,

The State of the Art in Bufferbloat Testing and Reduction on Linux

Transcription:

Network stack personality in Android phone Cristina Opriceana, Hajime Tazaki (IIJ Research Lab.) Linux netdev 2.2, Seoul, Korea 08 Nov. 2017 1

Librarified Linux talks (LLL) Userspace network stack (NUSE) in general (netdev0.1) kernel CI with libos and ns-3 (netdev1.1) Network performance improvement of LKL (netdev1.2, by Jerry Chu) How bad/good with LKL and hrtimer (BBR) (netdev2.1) Updating Android network stack (netdev2.2) 2

Android a platform of billions devices billions installed Linux kernel Questions When our upstreamed code available? What if I come up with a great protocol? https://developer.android.com/about/dashboards/index.html 3

Android (cont'd) When our upstreamed code available? wait until base kernel is upgraded backport specific function What if I come up with a great protocol? craft your own kernel and put into your image Long delivery to all billions devices 4

Approaches to alleviate the issue Virtualization (KVM on Android) Overhead isn't negligible to embedded devices Project Treble (since Android O) More modular platform implementation Fushia Rewrite OS from scratch QUIC (transport over UDP) Rewrite transport protocols on UDP

https://source.android.com/devices/architecture/treble An alternate approach network stack personality use own network stack implemented in userspace no need to replace host kernels but (try to) preserve the application compatibility NUSE (network stack in userspace) No delay of network stack update Application can choose a network stack if needed 56

Userspace implementations Toys, Misguided People Selfish Motivation Trying to present that a Toy is practically useful 7

Linux Kernel Library intro (again) Out-of-tree architecture (h/w-independent) Run Linux code on various ways with a reusable library h/w dependent layer on Linux/Windows /FreeBSD uspace, unikernel, on UEFI, network simulator (ns-3) Android 8

LKL: current status Sent RFC (Nov. 2015) no update on LKML since then have evolved a lot fast syscall path offload (csum, TSO/LRO) CONFIG_SMP (WIP) json config qemu baremetal (unikernel) on UEFI https://github.com/lkl/linux 9

Extensions to LKL Android (arm/arm64) support (lkl/linux#372) raw socket extension (only handle ETH_P_IP) (not upstreamed yet) hijack library enhance (not upstreamed yet) 10

HOWTO % LD_PRELOAD=liblkl-hijack.so netperf XXX # console app % setprop wrap.app LD_PRELOAD=liblkl-hijack.so # Java app { "gateway": "10.206.211.1", "interfaces": [ { "ifgateway": "202.214.86.129", "ip": "202.214.86.168", "mac": "02:87:f8:27:22:02", "masklen": "26", "param": "/dev/tap23", "type": "macvtap" } ], "debug": "0", "singlecpu": "1", "delay_main": "500000", "sysctl": "net.ipv4.tcp_wmem=4096 87380 2147483647;net.mptcp.mptcp_debu } 11

hijack library For smooth replacement (i.e., hijack) for Android UI app syscalls (java-based) bionic is more familiar than glibc only socket-related calls are redirected handling a mixture of host and lkl descriptors 12

New feature introduction Example Multipath TCP ( http://multipath-tcp.org/ ) out-of-tree for long time 13

Multipath TCP An extension to TCP subsystem application compatibility (unlike SCTP) Use multiple paths better throughput (aggregation) smooth recovery from failure (handover) http://blog.multipath-tcp.org/blog/html/2015/12/25/commercial_usage_of_multipath_tcp.html 14

Demo verify site (cat /proc/net/mptcp base detection) http://amiusingmptcp.de/ 15

No penalty with userspace network stack? Condition To use Linux mptcp w/o replacing kernel Questions Is NUSE working fine (Will users wanna use it)? How different from native Linux kernel? With tolerable amount of overhead? 16

netperf measurement Client Nexus5 anrdoid 6.01 (rooted) LTE, wifi LKL arm/android patched or native kernel Server Ubuntu 16.04 (amd64) on KVM virtio/etherlink (uplink: 100 Mbps) mptcp-4.4.70 (v0.92) Software netperf 2.7.x 10 seconds TCP_STREAM, TCP_MAERTS 5 trials, over 64-64K byte packet 17

Single path (Wi-Fi only) Tx (TCP_STREAM) Condition phone: LKL v.s. (stock) kernel Rx (TCP_MAERTS) Comparable goodput CPU utilization: LKL < native 18

Multipath TCP Tx (TCP_STREAM) Condition phone: LKL v.s. mptcp kernel Rx (TCP_MAERTS) Goodput (Tx) LKL > native even it's using multipath CPU: unstable (LKL) LKL > native 19

Multipath TCP (Korea/KT) Tx (TCP_STREAM) Condition phone: LKL v.s. (stock) kernel native uses single-path/ LKL uses multi-path at Ibis hotel Rx (TCP_MAERTS) Goodput: No much gain with LKL even it's using multipath CPU: unstable (LKL) LKL > native 20

IP conflicts may heavier processed twice (host/lkl) per packet Results are often unstable difficult measurement under wireless media Observations 21

Limitations Implementations DHCP only boot time (handover will fail) IPv4 only on cellular interface (rmnet0) Fundamental limitations of hijack library asynchronous signal unsafe MT unsafe Required tweaks grant NET_RAW permission (packet socket) need filter out RST packet from host iptables -A OUTPUT -p tcp --tcp-flags RST RST -j DROP 22

Further investigations other platform ios11 now shipped userspace implementation profiling 23

Summary Use out-of-tree kernel as a library on Android make your code easier to distribute with privileged installation/operation Comparable goodput over WiFi/LTE Unstable CPU utilization with LKL You can prepare your library file for your own purpose 24

Backups 25

Alternate network stacks lwip (2002~) mtcp [NSDI '14] SandStorm [SIGCOMM '14] rumpkernel [ATC '09] SolarFlare (2007~?) libuinet (2013~) SeaStar (2014~) None of them are feature-rich, or one-shot porting 26