Evaluating Viability of Network Functions on Lambda Architecture - - PowerPoint PPT Presentation

evaluating viability of network functions on lambda
SMART_READER_LITE
LIVE PREVIEW

Evaluating Viability of Network Functions on Lambda Architecture - - PowerPoint PPT Presentation

Evaluating Viability of Network Functions on Lambda Architecture By Arjun Singhvi, Anshul Purohit and Shruthi Racha Network Functions (NFs) Examine and modify packets and flows in sophisticated ways Ensure security, improve


slide-1
SLIDE 1

Evaluating Viability of Network Functions

  • n Lambda

Architecture

By Arjun Singhvi, Anshul Purohit and Shruthi Racha

slide-2
SLIDE 2

❖ Examine and modify packets and flows in sophisticated ways ❖ Ensure security, improve performance, and providing other novel network functionality ❖ Examples of Network Functions : Firewall, Network Address Translators, Intrusion Detection Systems

Network Functions (NFs)

slide-3
SLIDE 3

❖ Lie in the Critical Path between source and destination ❖ Should be capable of ➢ Handling packet bursts ➢ Failures

Network Functions (NFs)

slide-4
SLIDE 4

Lambda Architecture - Working

Upload your code to Lambda Setup your code to trigger from other cloud services, HTTP endpoints or in-app activity Lambda runs your code only when triggered, using only the compute resources needed Pay just for the compute time used

slide-5
SLIDE 5

Lambda Frameworks

❖ Lambda Frameworks are popular ❖ Public cloud lambda offerings ➢ AWS Lambda ➢ Azure Functions ➢ Google Cloud Functions

slide-6
SLIDE 6

Lambda Frameworks - Advantages

❖ Elimination of server management ❖ Continuous Scaling on demand ❖ High-availability ❖ Pay-as-you-go model ❖ Developer just writes event-handling logic

slide-7
SLIDE 7

Problem Statement

Does it make sense to implement network functions on lambda architectures?

slide-8
SLIDE 8

Our Focus

❖ Investigate the performance of standalone NFs on Lambda architectures ❖ Implement and evaluate a locality-aware, event-based NF chaining system - LENS

slide-9
SLIDE 9

Key Takeaways

❖ Naively implementing NFs on Lambda architecture leads to scalability at the cost of ➢ High end-to-end latency ➢ High overhead ❖ Porting standalone NFs onto Lambda architecture is not a viable option ❖ Lambda architectures are too restrictive - users cannot control the placement of lambda functions

slide-10
SLIDE 10

Outline

❖ Standalone NFs Implementation ❖ Standalone NFs Evaluation Results ❖ LENS Design ❖ LENS Implementation Choices ❖ LENS Evaluation Results ❖ Summary ❖ Conclusion

slide-11
SLIDE 11

Standalone Network Functions

❖ Firewall ❖ NAT (Network address translation) ❖ PRADS (Passive Real-time Asset Detection System)

slide-12
SLIDE 12

Standalone Network Functions - Firewall

❖ Monitors and controls the incoming

and outgoing network traffic based on predetermined security rules ❖ Control Flow -

  • i. Switch triggers Firewall
  • ii. Fetch security rules
  • iii. Block malicious packets

Firewall

SWITCH 1 Redis 2 2 3

slide-13
SLIDE 13

Standalone Network Functions - NAT

❖ Remaps IP addresses across private and public IP address space ❖ Control Flow -

  • i. Switch triggers NAT
  • ii. Extract IP address from packet
  • iii. Lookup for IP from external store
  • iv. Modify the IP address in packet

NAT

SWITCH 1 Redis 2 2 3

slide-14
SLIDE 14

Standalone Network Functions - PRADS

❖ Gathers information on hosts/services ❖ Control Flow -

  • i. Switch triggers PRADS
  • ii. Extract relevant packet fields
  • iii. Store to external store

PRADS

SWITCH 1 Redis 2 2 3

slide-15
SLIDE 15

Experimental Setup

❖ Experiments run on Cloudlab ❖ Synthetic Benchmarks - ➢ Sequential Packet Benchmark ■ Analyse latency breakdown ➢ Concurrent Packet Benchmark ■ Analyze latency with scale ❖ Lambda Region ➢ AWS: us-east-1 region

slide-16
SLIDE 16

Sequential Packet Benchmark Results - NAT

Sequential Packet Benchmark: End to End Latency Packets Time (s)

slide-17
SLIDE 17

Sequential Packet Benchmark Results - NAT

Total Latency = Lambda Execution Time + Network Latency + AWS Overhead

Sequential Packet Benchmark Time (s) Packet Number

slide-18
SLIDE 18

Sequential Packet Benchmark Results - NAT

Lambda Execution Time = External Store Access Time + Pure Lambda Execution Time

Sequential Lambda Time Breakdown Time (ms) Packet Number

slide-19
SLIDE 19

Concurrent Packet Benchmark Results - NAT

Network Functions Scale on Lambda Frameworks

Number of concurrent packets Effect of Scale on Packet Processing Latency on a single machine Average Time per packet (ms) Concurrent Benchmark Average Latency Time (s) Concurrent Clients

slide-20
SLIDE 20

Concurrent Packet Benchmark Results - NAT

Time of Lambda (ms) Concurrent Clients Average Time on Local vs Lambda Time of Local (ms)

slide-21
SLIDE 21

DynamoDB vs Redis

Use of in-memory redis state operations provides much lower latencies

NAT Dynamo Lambda Breakdown Store Type Time (ms) NAT Redis Lambda Breakdown Store Type Time (ms)

slide-22
SLIDE 22

NAT

Firewall

PRADS

2 1 3 5 4 6 SWITCH

Middlebox Chaining Solution (Naive Approach)

slide-23
SLIDE 23

LENS Locality-aware, Event-based NF Chaining System

slide-24
SLIDE 24

LENS Implementation Choice 1 - All In One

SWITCH

Firewall NAT

1

PRADS

2

❖ Functionality of 3 middleboxes in single function ❖ Pros ➢ Locality Aware ❖ Cons ➢ One hot middlebox leads to unnecessary relaunch of all 3 middleboxes. ➢ One middlebox corruption renders

  • ther middleboxes on same lambda

instance unusable

slide-25
SLIDE 25

LENS Implementation Choice 2 - Step Functions

SWITC H

Default

NAT

Blocked

Firewall

Choice State

PRADS

End Start

1 2

❖ Interpose each middlebox lambda

  • nto a node in step function

❖ Pros ➢ Easy to model complex workflows ❖ Cons ➢ Overhead in Lambda States and Transitions ➢ Can not enforce locality

slide-26
SLIDE 26

Implementation Choice 3 - Simple Notification Service

❖ Simple Notification Service (SNS) ➢ Fast ➢ Flexible ➢ Push Notification Service ➢ Send individual messages ➢ Fan - out messages ➢ Publisher - Subscriber Model ❖ Pros ➢ Simplifies Event based handling ❖ Cons ➢ Locality unaware

slide-27
SLIDE 27

LENS Implementation Choice 3 - Simple Notification Service (SNS)

Firewall NAT

PRADS

SWITCH

SNS Topic 1 SNS Topic 2

publish

subscribe

publish

subscribe 1 2 3 4 5 6

slide-28
SLIDE 28

LENS Evaluation Results

Middlebox Chaining : End to End Latency Results Chaining Method Time (s)

slide-29
SLIDE 29

LENS Evaluation Results - Analysing Step Functions

Total Latency = Network Latency + Lambda Execution Time + AWS Step Function Overhead ❖ ~100ms to execute ❖ ~3ms for Lambda Execution ❖ High setup cost ❖ AWS Step Function Overhead represents ➢ State Transitions ➢ Non-Task State time

Step Functions - Latency Breakdown Step Functions Latency Time (s)

slide-30
SLIDE 30

LENS Evaluation Results - Analysing SNS Execution

❖ SNS ➢ 92% overhead ❖ Overhead includes ➢ Pub-Sub delay ➢ Lambda Setup costs

Time (s) SNS Latency Breakdown SNS Latency

slide-31
SLIDE 31

Summary

❖ Implementing standalone NFs/middleboxes on Lambda is not a viable option ➢ High latency and overhead ❖ Chaining middleboxes hides the high latency ❖ After exploring various chaining methods ➢ Services provided by AWS lambda are ■ Very restrictive ■ Have high overhead ➢ Chaining is most beneficial in the All-In-One case ■ Provides locality ■ High memory footprint ■ Only suitable when all NFs scale equally

slide-32
SLIDE 32

Questions?

slide-33
SLIDE 33

Graph Slides

slide-34
SLIDE 34

Graph 1

Effect of Scale on Packet Processing Latency on a single machine Average Time per packet (ms)

❖ Plot illustrating average NAT response time with concurrent clients ❖ Highlights the problem of scaling on a single machine ❖ Motivation for investigating a an implementation in a distributed setting

Number of concurrent packets

slide-35
SLIDE 35

Graph 2

❖ NAT implementation on AWS lambda scales well ❖ AWS lambda: maximum parallel executions set to 100 ❖ Latency is mostly unaffected ❖ High end to end latencies

Concurrent Benchmark Average Latency Time (s) Concurrent Clients

slide-36
SLIDE 36

Graph 3

❖ Comparison between lambda and local NAT ❖ Very higher rate of change

  • f local latency

❖ Lambda is unaffected ❖ Lambda addresses the scaling problem ➢ At the cost of very high end-to-end latency ➢ Further analysis

Time of Lambda (ms) Concurrent Clients Average Time on Local vs Lambda Time of Local (ms)

slide-37
SLIDE 37

Graph 4

❖ Distribution of NAT latencies for 100 sequential packets. ❖ Need to breakdown the latency into known components ➢ Network Latency ➢ Lambda Execution ➢ AWS overhead

Sequential Packet Benchmark: End to End Latency Packets Time (s)

slide-38
SLIDE 38

Graph 5

❖ Distribution with the Lambda, Network and AWS overhead components ❖ High cost for launching lambda instances

Sequential Packet Benchmark Time (s) Packet Number

slide-39
SLIDE 39

Graph 6

❖ Breakdown of Lambda Execution Time ❖ State operations take higher fraction of time ❖ DynamoDB Update

  • perations are costly

➢ Provides High Consistency

Sequential Lambda Time Breakdown Time (ms) Packet Number

slide-40
SLIDE 40

Graph 7

❖ Illustrating the scaling property provided by the lambda architecture ❖ Similar trend observed for Firewall and PRADS middleboxes ❖ Average latency remains mostly unaffected

Concurrent Benchmark Average Latency Time (s) Concurrent Clients

slide-41
SLIDE 41

Graph 8

❖ Use of in-memory redis state operations provides much lower latencies ❖ The state mapping will not be persistent ➢ Backup state in the DynamoDB ➢ Replication in Redis

NAT Dynamo Lambda Breakdown Store Type Time (ms) NAT Redis Lambda Breakdown Store Type Time (ms)

slide-42
SLIDE 42

Graph 9

❖ Running the benchmarks from an EC2 instance ❖ Avoids the Wide Area Network Latency by calling an internal API and Lambda trigger ➢ Lower Network Latency ➢ Lower AWS Overhead ❖ Latency characteristics are comparable among the middleboxes

Latency Trends Time (s)

slide-43
SLIDE 43

Graph 10

❖ AWS chaining constructs have very high latency ❖ All-In-One illustrates low

  • verhead

➢ 1 Lambda instance ❖ Naive launches 3 lambdas

Middlebox Chaining : End to End Latency Results Chaining Method Time (s)

slide-44
SLIDE 44

Graph 11

❖ States executing lambdas ➢ ~100ms to execute ➢ ~3ms for Lambda execution ➢ High setup cost ❖ Overhead represents ➢ State Transitions ➢ Non-Task State time

Step Functions - Latency Breakdown Step Functions Latency Time (s)

slide-45
SLIDE 45

Graph 12

❖ SNS ➢ 92% overhead ❖ Overhead includes ➢ Pub-Sub delay ➢ Lambda Setup costs

Time (s) SNS Latency Breakdown SNS Latency

slide-46
SLIDE 46

Backup Slides

slide-47
SLIDE 47
  • The term middlebox was coined in “1999” also

now known as network functions.

  • Systems that examine and modify packets and

flows

  • Ensure

security & improve performance in enterprise and service provider networks.

  • Recent

Trend: Network Functions Virtualization (NFV) ○ Replace dedicated hardware appliances with software-based network functions running on generic compute resources.

Middleboxes

Figure 1: Various Middleboxes

slide-48
SLIDE 48

Lambda Architecture?

  • Architecture for real-time & serverless computing

○ Execution of stateless functions

  • Public cloud lambda offerings

○ AWS Lambda ○ Azure Functions ○ Google Cloud Functions

  • Generic Advantages

○ Elimination of server management ○ Continuous Scaling on demand ○ High-availability ○ Event-based triggering mechanism ○ Developer just writes event-handling logic

slide-49
SLIDE 49

Lambda Architecture

  • How it works ?

Upload your code to Lambda Setup your code to trigger from other cloud services, HTTP endpoints or in-app activity Lambda runs your code only when triggered, using only the compute resources needed Pay just for the compute time used

slide-50
SLIDE 50

Problem Statement and Motivation

  • Evaluate the viability of implementing Network Middleboxes on the Lambda architecture based on

○ Scale ○ Performance ○ Consistency ○ State Maintenance

  • Implementing Middleboxes on a single machine does not scale well.
  • Use the benefits of scaling and high availability provided by Lambda Architecture
  • Obtain better performance characteristics for Middleboxes at scale
slide-51
SLIDE 51

Motivation

Effect of Scale on Packet Processing Latency on a single machine Average Time per packet (ms)

  • Performance degrades with the

number of concurrent packets

  • Natural way to handle scale is to

launch more concurrent instances

  • Network middleboxes are on the

critical path ○ Handle low latency ○ Handle concurrent connections

  • Each stage of processing in a

middlebox chain must ○ Handle load ○ Handle hard/soft failures

Number of concurrent packets

slide-52
SLIDE 52

Solution Approach

  • Model middleboxes as event-based lambda functions

○ Stateful middleboxes ■

  • Eg. NAT, Firewall

■ Fetching and updating state on every packet ■ Use external stores for maintaining state

  • Trade-off between latency and consistency of the state

■ Stateless operations performed in the lambda handler ○ Stateless middleboxes ■ Fits the lambda framework naturally ■ All the middlebox box handled in a function

  • Investigate the idea of middlebox chaining

○ Reduce communication time between middleboxes ○ Current implementations lead to multiple hops on the network

slide-53
SLIDE 53

Concise Result

  • We would be presenting some results based on our Lambda Middlebox applications

○ Preliminary investigation among public clouds ○ Choice of storing the stateful information ○ Baseline performance characteristics for the middleboxes ■ NAT ■ Firewall ■ PRADS ○ Breakdown and analysis of the total client observed end-to-end latency ○ Overheads and effect of network latency ○ Effect of chaining the middleboxes using various techniques ■ Naive ■ All in one lambda ■ Use of a graph-based step functions topology ■ Notification based triggering mechanism

slide-54
SLIDE 54

Design (Middleboxes)

  • Network Address Translation (NAT)

○ Remaps IP addresses across private and public IP address space ○ Design a 2 way mapping to perform lookups ○ Lambda functions would ■ Extract IP address from packet ■ Lookup for IP to external store ■ Modify the IP address in packet ○ Mapping is stored externally ■ Database ■ In-Memory Cache

slide-55
SLIDE 55

Design (Middleboxes)

  • Firewall

○ Inspects the IP address/port ○ Mapping contains rules for filtering ○ Lambda functions would ■ Extract IP/port fields ■ Lookup for filtering rules ■ Block malicious packets

  • PRADS

○ Gathers information on hosts/services ○ Mapping stores relevant fields ○ Lambda function would ■ Extract IP/port fields ■ Store host fields Generic workflow

  • Parse incoming packets
  • Update/Retrieve state information
  • Middlebox specific action
slide-56
SLIDE 56

Baseline Latency Results

We pick AWS Lambda to implement the middleboxes discussed Trends for NAT implementation on AWS-Dynamo and Azure-SQL

NAT End To End Latency Comparison Time (s) Public Cloud

slide-57
SLIDE 57

Breakdown of the Latency and Lambda Execution

  • Execution of lambda functions is a small fraction of the latency
slide-58
SLIDE 58

Concurrent Benchmark Behaviour

  • The workload launched

concurrent clients

  • AWS lambda has a limit of

maximum 100 parallel executions

  • Small variation in the average

time taken for 10 and 100 clients

  • Illustrates the scaling achieved by

lambda. ○ Contrasts with the single machine trend

slide-59
SLIDE 59

Effect of External Store and Network Latency

  • Dynamo DB persists the

state to leading to higher

  • verhead
  • Storing state in memory

leads to faster lookups and updates

  • This is not persistent and

is lost on redis-server crash

  • Majority of the lambda

execution time is spent in state lookups

slide-60
SLIDE 60

Effect of Network Latency

  • Sending requests from the

EC2 datacenter avoids the link over Wide Area Network.

  • Network latency is a major

component of the remote request latency

slide-61
SLIDE 61

Design I (Lambda - Naive impln)

NAT

Firewall

PRADS

2 1 3 5 4 6 SWITCH

slide-62
SLIDE 62

Design (Lambda - All In One)

SWITCH

Firewall NAT

1

PRADS

2

slide-63
SLIDE 63

Design (Step Fns)

SWITC H

Default

NAT

Blocked

Firewall

Choice State

PRADS

End Start

1 2

slide-64
SLIDE 64

Design (SNS - Pub/Sub model)

Firewall NAT

PRADS

SWITCH

SNS Topic 1 SNS Topic 2

publish

subscribe

publish

subscribe 1 2 3 4 5 6

slide-65
SLIDE 65

Design (Lambda calling Lambda) - Future Work

slide-66
SLIDE 66

Comparison between middlebox chaining

slide-67
SLIDE 67

Summary

slide-68
SLIDE 68

Conclusion