Packet Scope Monitoring the Packet Lifecycle Within a
















![Packet. Scope Prototype • We built a prototype[1] in Python and P 4 with: Packet. Scope Prototype • We built a prototype[1] in Python and P 4 with:](https://slidetodoc.com/presentation_image_h/298135e938e02886f9f706f72f82b183/image-17.jpg)

- Slides: 18
Packet. Scope: Monitoring the Packet Lifecycle Within a Switch Ross Teixeira (Princeton) Rob Harrison (United States Military Academy) Arpit Gupta (UC Santa Barbara) Jennifer Rexford (Princeton)
Outline 1. Peeking Inside the Switch 2. Packet Lifecycle Query Language 3. Efficient Query Compilation 4. Packet. Scope Prototype 2
Outline 1. Peeking Inside the Switch 2. Packet Lifecycle Query Language 3. Efficient Query Compilation 4. Packet. Scope Prototype 3
What Happens Inside a (Programmable) Switch? • Packets are modified in the switch • Multiple pipelines • Access Control List (ACL) drops • Queues cause delays and loss Queues Ingress Egress 4
Prior Systems Don’t Peek Inside • Switch monitoring is important • Want to adapt dataflow monitoring systems • map, filter, reduce operators on incoming tuples • Prior systems only capture arriving packets[1, 3] • Or only provide queuing delay info[2] Queues Ingress Egress Switch Pipeline 5 [1] Sonata (SIGCOMM ‘ 18), [2] Marple (SIGCOMM ‘ 17), [3] Gigascope (SIGMOD ‘ 03)
Introducing Packet. Scope • Monitoring the packet lifecycle • Packet modifications • ACL drops • Queuing delays/loss Queues 6
Outline 1. Peeking Inside the Switch 2. Packet Lifecycle Query Language 3. Efficient Query Compilation 4. Packet. Scope Prototype 7
The Life of a Packet Queues port_in, headers_in, time_in port_intent, headers_mid (Could be modified/ dropped!) queuing _in/_out (length, time) port_out, headers_out (Could be modified/ dropped!) (Could be delayed!) Ingress() tuples Egress() tuples 8
Example Query • Count un-dropped SSH packets that traverse a NAT 1 undropped_SSH_NAT = egress() 2. filter(tcp. src. Port_in == 22) 3. filter(ipv 4. src. IP_in != ipv 4. src. IP_out) 4. filter(port_out != -1) Not Lost SSH Packets Crossing a NAT Not Dropped 9
How To Track Queuing Loss? Queues Ingress X • Loss happens outside ingress/egress processing • We can’t process individual packets • But over time, we can track aggregate counts by keeping state • . lost(groupby_fields, epoch_ms) operator • count packets grouped by groupby_fields every epoch_ms 10
Outline 1. Peeking Inside the Switch 2. Packet Lifecycle Query Language 3. Efficient Query Compilation 4. Packet. Scope Prototype 11
Compilation: “Tag Little, Compute Early” Execute Queues Metadata: ipv 4. src. IP_in = X Packet: ipv 4. src. IP==Y ipv 4. src. IP ? ? E. g. Queries across ports? . filter(ipv 4. src. IP_in != ipv 4. src. IP_out) A: Tag packet with metadata 12
Compilation: “Tag Little, Compute Early” Queues Metadata: ipv 4. src. IP_in ? Packet ipv 4. src. IP = X Where to place computation? . filter(ipv 4. src. IP_in != ipv 4. src. IP_mid)… A: As early as possible! 13
Compilation: “Tag Little, Compute Early” Execute Queues Metadata: ipv 4. src. IP_in Packet: ipv 4. src. IP = Y Where to place computation? . filter(ipv 4. src. IP_in != ipv 4. src. IP_mid)… A: As early as possible! • Metadata can be reused for future processing. 14
How To Compile Lost Operator? State Ingress Queues X State Egress • . lost([ipv 4. src. IP], 10 ms) • Compile as a join of two queries: • Count by ipv 4. src. IP on ingress • Count by ipv 4. src. IP on egress • Report difference every 10 ms of packet arrival times • Gory details in paper 15
Outline 1. Peeking Inside the Switch 2. Packet Lifecycle Query Language 3. Efficient Query Compilation 4. Packet. Scope Prototype 16
Packet. Scope Prototype • We built a prototype[1] in Python and P 4 with: • Support for packet modifications, queuing delays • Tag little, compute early compilation • We also built a queuing loss query prototype • Uses the BMv 2 software model • More details and future work in paper [1] As an extension to Sonata (SIGCOMM ‘ 18) 17
Conclusion • Packet. Scope is a network telemetry system • Using a dataflow programming model (map, filter, reduce) • That supports queries on the full packet lifecycle: • Packet modifications • ACL drops • Queuing delays/loss • And compiles efficiently to programmable switches Queues