CS 268: Lectures 13/14 (Route Lookup and Packet Classification) Ion Stoica April 1/3, 2002.

Slides:



Advertisements
Similar presentations
IP Router Architectures. Outline Basic IP Router Functionalities IP Router Architectures.
Advertisements

A Search Memory Substrate for High Throughput and Low Power Packet Processing Sangyeun Cho, Michel Hanna and Rami Melhem Dept. of Computer Science University.
Router/Classifier/Firewall Tables Set of rules—(F,A)  F is a filter Source and destination addresses. Port number and protocol. Time of day.  A is an.
Spring 2006CS 685 Network Algorithmics1 Longest Prefix Matching Trie-based Techniques CS 685 Network Algorithmics Spring 2006.
1 IP-Lookup and Packet Classification Advanced Algorithms & Data Structures Lecture Theme 08 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
A Scalable and Reconfigurable Search Memory Substrate for High Throughput Packet Processing Sangyeun Cho and Rami Melhem Dept. of Computer Science University.
Spring 2006CS 685 Network Algorithmics1 Principles in Practice CS 685 Network Algorithmics Spring 2006.
Network Algorithms, Lecture 4: Longest Matching Prefix Lookups George Varghese.
Fast Firewall Implementation for Software and Hardware-based Routers Lili Qiu, Microsoft Research George Varghese, UCSD Subhash Suri, UCSB 9 th International.
Bio Michel Hanna M.S. in E.E., Cairo University, Egypt B.S. in E.E., Cairo University at Fayoum, Egypt Currently is a Ph.D. Student in Computer Engineering.
© 2009 Cisco Systems, Inc. All rights reserved. SWITCH v1.0—4-1 Implementing Inter-VLAN Routing Deploying Multilayer Switching with Cisco Express Forwarding.
M. Waldvogel, G. Varghese, J. Turner, B. Plattner Presenter: Shulin You UNIVERSITY OF MASSACHUSETTS, AMHERST – Department of Electrical and Computer Engineering.
IP Routing Lookups Scalable High Speed IP Routing Lookups.
Outline Introduction Related work on packet classification Grouper Performance Empirical Evaluation Conclusions.
CS 268: Lecture 10 Router Design and Packet Lookup Ion Stoica Computer Science Division Department of Electrical Engineering and Computer Sciences University.
Efficient Multi-match Packet Classification with TCAM Fang Yu Randy H. Katz EECS Department, UC Berkeley {fyu,
Packet Classification on Multiple Fields Pankaj Gupta and Nick McKeown Stanford University {pankaj, September 2, 1999.
15-744: Computer Networking L-4 Routers. L -4; © Srinivasan Seshan, Routing How do routers process IP packets Forwarding lookup algorithms.
CS 268: Route Lookup and Packet Classification Ion Stoica March 11, 2003.
1 A Fast IP Lookup Scheme for Longest-Matching Prefix Authors: Lih-Chyau Wuu, Shou-Yu Pin Reporter: Chen-Nien Tsai.
Packet Classification George Varghese. Original Motivation: Firewalls Firewalls use packet filtering to block say ssh and force access to web and mail.
CS 268: Route Lookup and Packet Classification
Algorithms for Advanced Packet Classification with TCAMs Karthik Lakshminarayanan UC Berkeley Joint work with Anand Rangarajan and Srinivasan Venkatachary.
1 Performing packet content inspection by longest prefix matching technology Authors: Nen-Fu Huang, Yen-Ming Chu, Yen-Min Wu and Chia- Wen Ho Publisher:
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Switch and Router Architectures Computer Science Division Department of Electrical Engineering.
Fast binary and multiway prefix searches for pachet forwarding Author: Yeim-Kuan Chang Publisher: COMPUTER NETWORKS, Volume 51, Issue 3, pp , February.
Chapter 9 Classification And Forwarding. Outline.
Computer Networks Layering and Routing Dina Katabi
Computer Networks Switching Professor Hui Zhang
Cs6390 summer 2000 Tradeoffs for Packet Classification 1 Tradeoffs for Packet Classification Members: Jinxiao Song & Yan Tong.
ECE 526 – Network Processing Systems Design Network Processor Architecture and Scalability Chapter 13,14: D. E. Comer.
1 Routing with a clue Anat Bremler-Barr Joint work with Yehuda Afek & Sariel Har-Peled Tel-Aviv University.
Network Layer (3). Node lookup in p2p networks Section in the textbook. In a p2p network, each node may provide some kind of service for other.
IP Address Lookup Masoud Sabaei Assistant professor
Applied Research Laboratory Edward W. Spitznagel 7 October Packet Classification for Core Routers: Is there an alternative to CAMs? Paper by: Florin.
Data : The Small Forwarding Table(SFT), In general, The small forwarding table is the compressed version of a trie. Since SFT organizes.
Timothy Whelan Supervisor: Mr Barry Irwin Security and Networks Research Group Department of Computer Science Rhodes University Hardware based packet filtering.
Author: Haoyu Song, Fang Hao, Murali Kodialam, T.V. Lakshman Publisher: IEEE INFOCOM 2009 Presenter: Chin-Chung Pan Date: 2009/12/09.
ECE 526 – Network Processing Systems Design Networking: protocols and packet format Chapter 3: D. E. Comer Fall 2008.
Advance Computer Networking L-8 Routers Acknowledgments: Lecture slides are from the graduate level Computer Networks course thought by Srinivasan Seshan.
Wire Speed Packet Classification Without TCAMs ACM SIGMETRICS 2007 Qunfeng Dong (University of Wisconsin-Madison) Suman Banerjee (University of Wisconsin-Madison)
Packet Classification on Multiple Fields 참고 논문 : Pankaj Gupta and Nick McKeown SigComm 1999.
Review the key networking concepts –TCP/IP reference model –Ethernet –Switched Ethernet –IP, ARP –TCP –DNS.
Towards a Billion Routing Lookups per Second in Software  Author: Marko Zec, Luigi, Rizzo Miljenko Mikuc  Publisher: SIGCOMM Computer Communication Review,
Multi-Field Range Encoding for Packet Classification in TCAM Author: Yeim-Kuan Chang, Chun-I Lee and Cheng-Chien Su Publisher: INFOCOM 2011 Presenter:
Applied Research Laboratory Edward W. Spitznagel 24 October Packet Classification using Extended TCAMs Edward W. Spitznagel, Jonathan S. Turner,
1. Outline Introduction Related work on packet classification Grouper Performance Analysis Empirical Evaluation Conclusions 2/42.
1 Fast packet classification for two-dimensional conflict-free filters Department of Computer Science and Information Engineering National Cheng Kung University,
Scalable High Speed IP Routing Lookups Scalable High Speed IP Routing Lookups Authors: M. Waldvogel, G. Varghese, J. Turner, B. Plattner Presenter: Zhqi.
A Small IP Forwarding Table Using Hashing Yeim-Kuan Chang and Wen-Hsin Cheng Dept. of Computer Science and Information Engineering National Cheng Kung.
Efficient Cache Structures of IP Routers to Provide Policy-Based Services Graduate School of Engineering Osaka City University
A Smart Pre-Classifier to Reduce Power Consumption of TCAMs for Multi-dimensional Packet Classification Yadi Ma, Suman Banerjee University of Wisconsin-Madison.
Sets of Digital Data CSCI 2720 Fall 2005 Kraemer.
High-Speed Policy-Based Packet Forwarding Using Efficient Multi-dimensional Range Matching Lakshman and Stiliadis ACM SIGCOMM 98.
Cross-Product Packet Classification in GNIFS based on Non-overlapping Areas and Equivalence Class Author: Mohua Zhang, Ge Li Publisher: AISS 2012 Presenter:
CS 740: Advanced Computer Networks IP Lookup and classification Supplemental material 02/05/2007.
Packet classification on Multiple Fields Authors: Pankaj Gupta and Nick McKcown Publisher: ACM 1999 Presenter: 楊皓中 Date: 2013/12/11.
Packet Classification Using Multidimensional Cutting Sumeet Singh (UCSD) Florin Baboescu (UCSD) George Varghese (UCSD) Jia Wang (AT&T Labs-Research) Reviewed.
Author : Lynn Choi, Hyogon Kim, Sunil Kim, Moon Hae Kim Publisher/Conf : IEEE/ACM TRANSACTIONS ON NETWORKING Speaker : De yu Chen Data :
Packet Classification Using Multi- Iteration RFC Author: Chun-Hui Tsai, Hung-Mao Chu, Pi-Chung Wang Publisher: 2013 IEEE 37th Annual Computer Software.
Author : Tzi-Cker Chiueh, Prashant Pradhan Publisher : High-Performance Computer Architecture, Presenter : Jo-Ning Yu Date : 2010/11/03.
By: Yaron Levy Supervisors: Dr. Shlomo Greenberg Mr. Hagai David.
IP Routers – internal view
CS 268: Lecture 10 Router Design and Packet Lookup
CS 457 – Lecture 10 Internetworking and IP
Transport Layer Systems Packet Classification
Indexing and Hashing Basic Concepts Ordered Indices
Jason Klaus Supervisor: Duncan Elliott August 2, 2007 (Confidential)
EE 122: Lecture 7 Ion Stoica September 18, 2001.
Network Layer: Control/data plane, addressing, routers
Presentation transcript:

CS 268: Lectures 13/14 (Route Lookup and Packet Classification) Ion Stoica April 1/3, 2002

Lookup Problem  Identify the output interface to forward an incoming packet based on its destination address  Routing (forwarding) tables summarize information by maintaining prefixes  Route lookup  find the longest prefix in the table that matches the packet destination address

Example  Packet with destination address is sent to interface 2, as xxx is the longest prefix matching packet’s destination address …… xxx.xxx xxx xxx 2

Patricia Tries  Use binary tree paths to encode prefixes  Advantage: simple to implement  Disadvantage: one lookup may take O(m), where m is number of bits (32 in the case of IPv4) 001xx x 3 10xxx

Lulea’s Routing Lookup Algorithm  Minimize number of memory accesses  Minimize size of data structure -Small size allow to fit entire data structure in the cache (why do you care about size?)  Solution: use a three level data structure

First Level: Bit-Vector  Cover all prefixes down to depth 16  Use one bit to encode each prefix -Memory requirements: 2 16 = 64 Kb = 8 KB genuine heads root heads

First Level: Pointers  Maintain 16-bit pointers to (1) next-hop (routing) table or (2) to two level chuncks -2 bits encode pointer type -14 bits represent an index into routing table or into an array containing level two chuncks  Pointers are stored at consecutive memory addresses  Problem: find the pointer

Example … pointer array Routing table Level two chunks 0006abcd bit vector … 000acdef Problem: find pointer

Code Word and Base Indexes Array  Split the bit-vector in bit-masks (16 bits each)  Find corresponding bin-mask  How? -Maintain a16-bit code word for each bit-mask (10-bit value; 6-bit offset) -Maintain a base index array (one 16-bit entry for each 4 code words) number of previous ones in the bit-vector Code word array Base index array Bit-vector

First Level: Finding Pointer Group  Use first 12 bits to index into code word array  Use first 10 bits to index into base index array address: 004C first 12 bits 4 1 first 10 bits + = 13 Code word array Base index array

First Level: Encoding Bit-masks  Observation: not all 16-bit values are possible -Example: bit-mask 1001… is not possible (why?)  Let a(n) be number of bit-masks of length 2 n  Compute a(n) using recurrence: -a(0) = 1 -a(n) = 1 + a(n-1) 2  For length 16, we get only 677 possible values for bit- masks  This can be encoded in 10 bits -Values r i in code words  Store all possible bit-masks in a table, called maptable

First Level: Finding Pointer Index  Each entry in Maptable is an offset of 4 bits: -Offset of pointer in the group  Number of memory accesses: 3 (7 bytes accessed)

First Level: Memory Requirements  Code word array: one code word per bit-mask -64 Kb  Based index array: one base index per four bit- mask -16 Kb  Maptable: 677x16 entries, 4 bits each -~ 43.3 Kb  Total: Kb = 15.4 KB

First Level: Optimizations  Reduce number of entries in Maptable by two: -Don’t store bit-masks 0 and 1; instead encode pointers directly into code word -If r value in code word larger than 676  direct encoding -For direct encoding use r value + 6-bit offset

Levels 2 and 3  Levels 2 and 3 consists of chunks  A chunck covers a sub-tree of height 8  at most 256 heads  Three types of chunks -Sparse: 1-8 heads 8-bit indices, eight pointers (24 B) -Dense: 9-64 heads Like level 1, but only one base index (< 162 B) -Very dense: heads Like level 1 (< 552 B)  Only 7 bytes are accessed to search each of levels 2 and 3

Limitations  Only 2 14 chuncks of each kind -Can accommodate a growth factor of 16  Only 16-bit base indices -Can accommodate a growth factor of 3-5  Number of next hops <= 2 14

Notes  This data structure trades the table construction time for lookup time (build time < 100 ms) -Good trade-off because routes are not supposed to change often  Lookup performance: -Worst-case: 101 cycles A 200 MHz Pentium Pro can do at least 2 millions lookups per second -On average: ~ 50 cycles  Open question: how effective is this data structure in the case of IPv6 ?

Classification Problem  Classify an IP packet based on a number of fields in the packet header, e.g., -source/destination IP address (32 bits) -source/destination port number (16 bits) -TOS byte (8 bits) -Type of protocol (8 bits)  In general fields are specified by range

Example of Classification Rules  Access-control in firewalls -Deny all traffic from ISP-X to Y  Policy-based routing -Route IP telephony traffic from X to Y via ATM  Differentiate quality of service -Ensure that no more than 50 Mbps are injected from ISP-X

Characteristics of Real Classifiers  Results are collected over 793 packet classifiers from 101 ISPs, with a total of 41,505 rules -Classifiers do not contain many rules: mean = 50 rules, max = 1734 rules, only 0.7% contain over 1000 rules -Many fields are specified by range, e.g., greater than 1023, or % of classifiers had a rule with a non-contiguous mask ! -Rules in the same classifier tend to share the same fields -8% of the rules are redundant, i.e., they can be eliminated without changing classifier’s behavior

Example  Two-dimension space (i.e., classification based on two fields)  Complexity depends of the layout (i.e., how many distinct regions are created)

Hard Problem  Even if regions don’t overlap, with n rules and F fields we have the following lower-bounds O(log n) time and O(n F ) space O(log F-1 n) time and O(n) space

Simplifying Assumptions  In practice, you get the average not the worst- case, e.g., number of overlapping regions for the largest classifier 4316 vs. theoretical worst case  The number of rules is reasonable small, i.e., at most several thousands  The rules do not change often

Recursive Flow Classification (RFC) Algorithm  Problem formulation: -Map S bits (i.e., the bits of all the F fields) to T bits (i.e., the class identifier)  Main idea: -Create a 2 S table with pre-computed values; each entry would contain the class identifier Only one memory access needed -…but this is impractical  require huge memory

RFC Algorithm  Use recursion: trade speed (number of memory accesses) for memory footprint

The RFC Algorithm  Split the F fields in chuncks  Use the value of each chunck to index into a table -Indexing is done in parallel  Combine results from previous phase, and repeat  In the final phase we obtain only one value

Example of Packet Flow in RFC

Complete Example  Four fields  six chunks -Source and destination IP addresses  two chuncks each -Protocol number  one chunck -Destination port number  one chunck

Complete Example indx=c02*6+c03*3+c05 indx=c10*5+c11

indx=c10*5+c11

RFC Lookup Performance  Dataset: classifiers used in practice  Hardware: millions pps using three stage pipeline, and 4-bank 64 Mb SRAMs at 125 MHz  Software: > 1million pps on a 333 MHz Pentium

RFC Scalling  RFC does not handle well large (general) classifiers -As the number of rules increases, the memory requirements increase dramatically, e.g., for 1500 rules you may need over 4.5 MB with a three stage classifier  Proposed solution: adjacency groups -Idea: group rules that generate the same actions and use same fields -Problems: can’t tell which rule was matched

Summary  Routing lookup and packet classification  two of the most important challenges in designing high speed routers  Very efficient algorithms for routing lookup  possible to do lookup at the line speed  Packet classification still an area of active research  Key difficulties in designing packet classification: -Requires multi-field classification which is an inherently hard problem -If we want per flow QoS insertion/deletion need also to be fast Harder to make update-lookup tradeoffs like Lulea’s algorithm

RFC Algorithm: Example  Phase 0: -Possible values for destination port number: 80, 20-21, >1023, * Use two bits to encode Reduction: 16  2 -Possible values for protocol: udp, tcp, * Use two bits to encode Reduction: 8  2  Phase 1: -Concatenate from phase 1, five possible values: {80,udp}, {20-21,udp}, {80,tcp}, {>1023,tcp}, everything else Use three bits to encode Reduction 4  3