150 likes | 262 Views
IXP Lab 2012: Part 2. Example Functions. Outline. Demo-1 : Packet Counter – 1ME Version Demo-2 : Packet Counter – n MEs Version Demo-3 : Packet Size Counter DIY-1 : Multiple Port Packet Counter Demo-4 : IP Lookup – Linear Search Version
E N D
IXP Lab 2012: Part 2 Example Functions
Outline • Demo-1: Packet Counter – 1ME Version • Demo-2: Packet Counter – nMEs Version • Demo-3: Packet Size Counter • DIY-1: Multiple Port Packet Counter • Demo-4: IP Lookup – Linear Search Version • Demo-5: Packet Classification – Linear Search Version • DIY-2: Flow Statistics Counter
Demo 1Packet Counter – 1ME Version • Demo how to simulate packet traffic • Explain the base project • Using “Shared GPR” to implement the counter. • Explain the reason of using “shared” GPR • Subset of the real counter value • Show that the design is valid • The execution of thread is non-preemptive • Demo how to allocate multiple ME to packet processing • The result is not correct when multiple ME are used
Demo 2Packet Counter – nMEs Version • Code for allocating a scratchpad variable • Use Atomic Increment Instruction to implement the counter • The result is still correct while multiple ME are used
Demo 3Packet Size Counter (1/2) • The usage of packet counter and packet size counter • The meta-data of the packet
Demo 3Packet Size Counter (2/2) • Use Atomic Add Instruction to implement the counter • Multiple size of traffic are evaluated (64B, 128B, 256B) • Show one of the performance limit of network processor (interface) • Demo how to generate own packet traffic • The format of STRM traffic is plain-text format
DIY 1Multiple Port Packet Counter Modify the above projects to: • Generate three kinds of Ethernet-IP-TCP Packet Traffic (Size: 68B, 72B, 76B) (Each traffic has 10 packets) • Assign Port 0 to 2 a packet stream (Port 0: 68B, Port 1: 72B, Port 2: 76B) • Set Outgoing Port to Incoming Port Plus one • Count total size of packet pass through the three ports separately • Use the function of the workbench to verify the result
Demo 4IP Lookup - Linear Search Version (1/4) • Given a routing table with 4 entries • Suppose we have four packet with specific destination address field
Demo 4IP Lookup - Linear Search Version (2/4) • Discuss the Longest Prefix Matching result • Example data structure of a routing table entry • Script Format (Assume the base address is 0x40065080)
Demo 4IP Lookup - Linear Search Version (3/4) • The code to obtain the needed header fields • The Code of get an routing table entry
Demo 4IP Lookup - Linear Search Version (4/4) • The Code of Longest Prefix Matching (LPM) • Used pre-generated traffic to demo the functional
Demo 5Packet Classification- Linear Search Version (1/3) • Given a rule table with 5 rules (R1~R5) • SA => Source Address; DA=> Destination Address (Prefix Matching) • SP => Source Port; DP => Destination Port; (Range Matching) • PO => Protocol (Exact Matching)
Demo 5Packet Classification- Linear Search Version (2/3) • Suppose we have seven packets with follows header fields • A simple data structure to store a rule
Demo 5Packet Classification- Linear Search Version (3/3) • Result rule table:
DIY 2Flow Statistics Counter • Flow: Defined as the distinct combination of Source Address, Destination Address, Protocol, Source Port, Destination Port. • Flow Statistics Counter: Calculate the number of packets and bytes count for each flows. • Goal: 1. Distinguish incoming packets to the different flows. • 2. Calculate the number of received packets and received bytes count for each flow.