36
ModNet: A modular approach to network stack extension Sharvanath Pathak Vivek S. Pai Princeton University

ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

ModNet: A modular approach to network

stack extension

Sharvanath Pathak Vivek S. Pai

Princeton University

Page 2: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Changing  Trends  in  Networking

•  Use of TCP for multimedia streaming o Netflix + YouTube > 50% internet traffic at

peak [Global Internet phenomena report]

•  Tremendous growth of mobile devices o Wireless/mobile > wired traffic by 2018

[Cisco Visual Networking Index]

2

Page 3: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

TCP  Stack  Limitations

•  Little explicit feedback to applications

•  Applications rely on implicit feedback o BW estimate via connection/request latency

•  Hinders rapid content adaptation

3

Page 4: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

TCP  Stack  Limitations

•  Large buffers for performance (128kB-1MB) o Hides BWD-product, scheduler delays

•  Slow to react to network hiccups o Large buffers drain slowly o Especially when BW drops

4

Page 5: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

TCP  Stack  Limitations

•  TCP stack modification o Want: better management of socket

contents, timing and parameters

•  Changing OS/stack/protocol difficult o Adoption: chicken & egg problem o Deployment: middlebox problems

5

Page 6: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

ModNet  Overview

•  Loosen the boundary between the OS and network applications

•  Stick with TCP for practicality

•  Provide opportunity for low-latency reaction

6

Page 7: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

ModNet  Techniques

•  Delegation o Network modules for customizing TCP stack

•  Inspection o  Interfaces for exposing socket state

•  Revocation o Modifying unsent socket buffer content

7

Page 8: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Delegation

•  Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer

swapping

o Reusable across applications, e.g. adaptive HTTP compression

o Composable modules

8

Page 9: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Socket  Stealing

Application Module

NIC

ModNet (OS Kernel)

Socki_app Sockm_left

9

Sockm_right (Real)

Page 10: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Inspection

•  Memory-mapped socket state o mmap (socket_fd, …) o Low cost: atomic counts & shared memory o Safe access: shadowed values

socket_state_struct last_ack_ts

second_ack_ts   last_ack_seq

second_ack_seq tcp_sndwnd tcp_cwnd      

……          

S TCP  Socket

mmap

10

Page 11: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Revocation

o  Allow applications to inspect or yank existing socket buffer data. modnet_yank (int socket_fd, char * buffer, int length,

…)

o  Affects only unsent (but OS-buffered) content

o  Normal mode: large buffers for performance Problems: yank & replace for fast reaction

11

Page 12: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Experiments

•  Quantify the module overheads

•  Evaluate the end-to-end performance of some interesting modules

•  Evaluate the utility of revocation for more reactive video streaming

12

Page 13: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Experimental  Setup

13

Server  Application (Nginx,  Apache,  MistServer)

+

ModNet  Module   (Image  compression,  

SSD  swap,  etc.)

Client  Application (hLp  client,

VLC)

Modified  Linux  Machine   (ModNet  )

10  Gig   Switch

Standard  Linux   Machines

Page 14: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Overheads  of  Delegation

•  Web server benchmark

•  Nginx with and without dummy module

•  400 concurrent connections from 2 client machines

14

Page 15: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Overheads  of  Delegation

15

Page 16: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Overheads  of  Delegation

16

Page 17: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Overheads  of  Delegation

17

Page 18: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Adaptive  Image  Compression

•  Application-oblivious HTTP Jpeg compression (delegation)

•  Passive bandwidth estimation (inspection)

•  New dynamic Jpeg compression scheme

o Adjust DCT coefficients mid-transmission o No client-side changes

•  Similar experimental setup as last one

18

Page 19: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Jpeg  module  (3G  network  traces)

19

Page 20: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Jpeg  module  (3G  network  traces)

20

Page 21: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Jpeg  module  (3G  network  traces)

21

Page 22: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Swappable  Socket  Buffers  

•  Dynamic content generation

22

Page 23: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Dynamic  Content  Server

23

THREAD  1

THREAD  2

THREAD  3

Fast  Client  Request

Slow  Client  Request BLOCKED  on  SEND!

Connection  Accept  Queue

BLOCKED  on  SEND!

BLOCKED  on  SEND!

Page 24: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Swappable  Socket  Buffers  

•  Dynamic content generation o  Flash crowd ties up all threads/processes o  Server crawls, despite available bandwidth

•  Socket buffer swap module o  Swapping slow buffers to SSDs

•  Dynamic file download with mixed workload

24

Page 25: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Swappable  Socket  Buffers  

•  OS-like functionalities in user space •  Delegation for appropriate privileges,

resource limits and scheduling

•  Inspection - decide when to offload

•  Revocation – yank slow content

25

Page 26: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Socket  buffer  swap  module

26

Page 27: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Socket  buffer  swap  module

27

Page 28: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Deduplicating  Socket  Buffers

•  Templated dynamic web pages o Lots of near-duplicate content

•  Reduce memory pressure via dedup

•  Utilize the spare CPU cycles as opposed to spare SSD bandwidth in SSD swap module

28

Page 29: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Deduplication  Module

29

Page 30: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Modified  HTTP  live  streaming

HLS (HTTP live streaming) protocol •  When BW drops, buffered data causes

slowdown

With ModNet, server observes slowdown & reacts as well •  Truncation mechanism •  Faster reaction using yank

30

Page 31: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Modified  HTTP  live  streaming

•  Inspection for estimating network conditions

•  Revocation for yanking buffer content

31

Page 32: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Video  streaming  with  revocation

32

Page 33: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Video  streaming  with  revocation

33

Page 34: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Video  streaming  with  revocation

34

Page 35: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Conclusions •  ModNet enhances OS network API

•  Delegation o Eases implementation and deployment of network stack extensions

•  Inspection and Revocation o Better control and insight for applications and modules

•  New interesting modules o Prove the utility of ModNet

35

Page 36: ModNet: A modular approach to network stack extension · • Allow sockets to be intercepted by one or more user-level modules o OS-like functionalities, e.g. socket buffer swapping

Thanks sharvanath.info/modnet [email protected]

36