Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jennifer Rexford Fall 2014 (TTh 3:00-4:20 in CS 105) COS 561: Advanced Computer Networks TCP.

Similar presentations


Presentation on theme: "Jennifer Rexford Fall 2014 (TTh 3:00-4:20 in CS 105) COS 561: Advanced Computer Networks TCP."— Presentation transcript:

1 Jennifer Rexford Fall 2014 (TTh 3:00-4:20 in CS 105) COS 561: Advanced Computer Networks http://www.cs.princeton.edu/courses/archive/fall14/cos561/ TCP Performance Monitoring (and Pyretic background )

2 Assignments Buffer bloat –Extension till 3pm Tuesday October 14 Next assignment: two options –BGP measurement  Study BGP (in)stability “in the wild”  If you haven’t taken COS 461  TA: Linpeng Tang –SDN firewall  Build an SDN controller application on Pyretic  If you haven’t taken the fall 2013 SDN grad seminar  TA: Xin Jin xinjin@CS.Princeton.EDU –If you didn’t take either course, you can pick one! 2

3 Applications Inside Data Centers 3 Front end Server Aggregator Workers ….

4 Challenges of Datacenter Diagnosis Large complex applications –Hundreds of application components –Tens of thousands of servers New performance problems –Update code to add features or fix bugs –Change components while app is in operation Old performance problems (Human factors) –Developers may not understand network well –Small packets, delayed ACK, etc. 4

5 Diagnosis in Data Centers 5 Host App OS Packet sniffer App logs: #Reqs/sec Response time 1% req.>200ms delay Switch logs: #bytes/pkts per minute Packet trace: Filter out trace for long delay req. SNAP: Diagnose net-app interactions SNAP: Diagnose net-app interactions Application- specific Too expensive Too coarse-grained Generic, fine-grained, and lightweight

6 Collect Data in TCP Stack TCP understands net-app interactions –Flow control: How much data apps want to read/write –Congestion control: Network delay and congestion Collect TCP-level statistics –Defined by RFC 4898 –Already exists in today’s Linux and Windows OSes 6

7 TCP-level Statistics Cumulative counters –Packet loss: #FastRetrans, #Timeout –RTT estimation: #SampleRTT, #SumRTT –Receiver: RwinLimitTime –Calculate the difference between two polls Instantaneous snapshots –#Bytes in the send buffer –Congestion window size, receiver window size –Representative snapshots based on Poisson sampling 7

8 Life of Data Transfer 8 Application generates the data –No network problem Copy data to send buffer –Send buffer not large enough TCP sends data to the network –Fast retransmission –Timeout Receiver receives the data and ACK –Not reading fast enough (CPU, disk, etc.) –Not ACKing fast enough (Delayed ACK) Sender App Send Buffer Receiver Network

9 Characterizing Performance Limitations 9 Send Buffer Receiver Network #Apps that are limited for > 50% of the time 1 App 6 Apps 8 Apps 144 Apps –Send buffer not large enough –Fast retransmission –Timeout –Not reading fast enough (CPU, disk) – Not ACKing fast enough (Delayed ACK )

10 Discussion What to do if the monitoring is too expensive? What to do in a public cloud, where each tenant runs its own virtual machine? What to do in the wide area, between a server and a (remote) client? 10

11 Programming Abstractions for SDN Controller Applications http://www.cs.princeton.edu/~jrex/pape rs/pyretic-login13.pdf 11

12 Simple, Open Data-Plane API Prioritized list of rules –Pattern: match packet header bits –Actions: drop, forward, modify, send to controller –Priority: disambiguate overlapping patterns –Counters: #bytes and #packets 12 1.src=1.2.*.*, dest=3.4.5.*  drop 2.src = *.*.*.*, dest=3.4.*.*  forward(2) 3. src=10.1.2.3, dest=*.*.*.*  send to controller 1.src=1.2.*.*, dest=3.4.5.*  drop 2.src = *.*.*.*, dest=3.4.*.*  forward(2) 3. src=10.1.2.3, dest=*.*.*.*  send to controller

13 (Logically) Centralized Controller 13 Controller Platform

14 Protocols  Applications 14 Controller Platform Controller Application

15 Programming SDNs 15 Images by Billy Perkins The Good –Network-wide visibility –Direct control over the switches –Simple data-plane abstraction The Bad –Low-level programming interface –Functionality tied to hardware –Explicit resource control The Ugly –Non-modular, non-compositional –Programmer faced with challenging distributed programming problem

16 Combining Many Networking Tasks 16 Controller Platform Monitor + Route + FW + LB Monolithic application Hard to program, test, debug, reuse, port, …

17 Modular Controller Applications 17 Controller Platform LB Route Monitor FW Easier to program, test, and debug Greater reusability and portability A module for each task

18 Modules Affect the Same Traffic 18 Controller Platform LB Route Monitor FW How to combine modules into a complete application? Each module partially specifies the handling of the traffic

19 From Rules to a Policy Function Located packet –A packet and its location (switch and port) Policy function –From located packet to set of located packets Examples –Original packet: identity –Drop the packet: none –Modified header: modify(f=v) –New location: fwd(a) 19

20 From Bit Patterns to Predicates OpenFlow –No direct way to specify dstip!=10.0.0.1 – Requires two prioritized bitmatches  Higher priority: dstip=10.0.0.1  Lower priority: * Using boolean predicates – Providing &, |, and ~ – E.g., ~match(dstip=10.0.0.1) 20

21 Virtual Header Fields Unified abstraction –Real headers: dstip, srcport, … –Packet location: switch and port –User-defined: e.g., traffic_class Simple operations –Match: match(f=v) –Modify: modify(f=v) Example – match(switch=A) & match(dstip=‘1.0.0.3’ ) 21

22 Power of Policy as a Function Dynamic policy –A stream of policy functions Composition –Parallel: Monitor + Route –Sequential: Firewall >> Route A >> (B + C) >> D (A >> P) + (B >> P) (A + B)>>P 22

23 Equational Theory Commutative (+) –P + Q == Q + P Associative (+) –(P + Q) + R == P + (Q + R) Drop unit –P + drop == P Associative (>>) –(P >> Q) >> R == P >> (Q >> R) 23 A sign of a well-conceived language == a simple equational theory

24 Equational Theory Id unit (>>) –id >> P == P –P >> id == P Drop zero (>>) –drop >> P == drop –P >> drop == drop If commutes (>>) –(if q then P else Q) >> R == if q then (P >> R) else (Q >> R) 24

25 A Simple Use Case (Modular Reasoning) 25 firewall = if srcip = 1.1.1.1 then drop else id firewall = if srcip = 1.1.1.1 then drop else id router =... app = firewall >> router app == firewall >> router == (if srcip = 1.1.1.1 then drop else id) >> router == if srcip = 1.1.1.1 then (drop >> router) else (id >> router) == if srcip = 1.1.1.1 then drop else (id >> router) == if srcip = 1.1.1.1 then drop else router

26 Compiling Parallel Composition 26 Controller Platform Route on destination Monitor on source + dstip = 1.2.3.4  fwd(1) dstip = 3.4.5.6  fwd(2) srcip = 5.6.7.8  count

27 Compiling Parallel Composition 27 Controller Platform Route on destination Monitor on source + dstip = 1.2.3.4  fwd(1) dstip = 3.4.5.6  fwd(2) srcip = 5.6.7.8  count srcip = 5.6.7.8, dstip = 1.2.3.4  fwd(1), count srcip = 5.6.7.8, dstip = 3.4.5.6  fwd(2), count srcip = 5.6.7.8  count dstip = 1.2.3.4  fwd(1) dstip = 3.4.5.6  fwd(2)

28 Compiling Sequential Composition 28 Controller Platform Routing Load Balancer >> dstip = 10.0.0.1  fwd(1) dstip = 10.0.0.2  fwd(2) srcip = 0*, dstip=1.2.3.4  dstip=10.0.0.1 srcip = 1*, dstip=1.2.3.4  dstip=10.0.0.2

29 Compiling Sequential Composition 29 Controller Platform Routing Load Balancer >> dstip = 10.0.0.1  fwd(1) dstip = 10.0.0.2  fwd(2) srcip = 0*, dstip=1.2.3.4  dstip=10.0.0.1 srcip = 1*, dstip=1.2.3.4  dstip=10.0.0.2 srcip = 0*, dstip = 1.2.3.4  dstip = 10.0.0.1, fwd(1) srcip = 1*, dstip = 1.2.3.4  dstip = 10.0.0.2, fwd(2)

30 Queries as Buckets Forwarding to a “bucket” –Q = packets(limit=1,group_by=['srcip']) Callback functions –Q.register_callback(printer) Multiple kinds of buckets –Packets: with limit on number –Packet counts: with time interval –Byte counts: with time interval 30

31 SQL-Like Query Language Get what you ask for –Nothing more, nothing less SQL-like query language –Familiar abstraction –Returns a stream –Intuitive cost model Minimize controller overhead –Filter using high-level patterns –Limit the # of values returned –Aggregate by #/size of packets 31 Select(bytes) * Where(in:2 & srcport:80) * GroupBy([dstmac]) * Every(60) Select(packets) * GroupBy([srcmac]) * SplitWhen([inport]) * Limit(1) Learning Host Location Traffic Monitoring

32 Next Steps Assignments –Buffer bloat due 3pm Tuesday October 14 –BGP/Pyretic assignment due 5pm Friday November 14 Project proposals –Up to two pages, due 5pm Friday October 17 Next two weeks –Interdomain routing 32


Download ppt "Jennifer Rexford Fall 2014 (TTh 3:00-4:20 in CS 105) COS 561: Advanced Computer Networks TCP."

Similar presentations


Ads by Google