CS 268: Route Lookup and Packet Classification

Similar documents
Generic Architecture. EECS 122: Introduction to Computer Networks Switch and Router Architectures. Shared Memory (1 st Generation) Today s Lecture

EECS 122: Introduction to Computer Networks Switch and Router Architectures. Today s Lecture

Problem Statement. Algorithm MinDPQ (contd.) Algorithm MinDPQ. Summary of Algorithm MinDPQ. Algorithm MinDPQ: Experimental Results.

Growth of the Internet Network capacity: A scarce resource Good Service

Performance Evaluation and Improvement of Algorithmic Approaches for Packet Classification

ECE697AA Lecture 20. Forwarding Tables

Forwarding and Routers : Computer Networking. Original IP Route Lookup. Outline

Hardware Assisted Recursive Packet Classification Module for IPv6 etworks ABSTRACT

CS118 Discussion, Week 6. Taqi

Data Structures for Packet Classification

Switch and Router Design. Packet Processing Examples. Packet Processing Examples. Packet Processing Rate 12/14/2011

CS419: Computer Networks. Lecture 6: March 7, 2005 Fast Address Lookup:

Towards Effective Packet Classification. J. Li, Y. Qi, and B. Xu Network Security Lab RIIT, Tsinghua University Dec, 2005

The IP Data Plane: Packets and Routers

Fast IP Routing Lookup with Configurable Processor and Compressed Routing Table

QoS Services with Dynamic Packet State

Scalable Packet Classification for IPv6 by Using Limited TCAMs

Network Layer/IP Protocols

ECE697AA Lecture 21. Packet Classification

Where we are in the Course

Network Layer: Control/data plane, addressing, routers

Master Course Computer Networks IN2097

EE 122: Differentiated Services

Master Course Computer Networks IN2097

Lecture 12: Addressing. CSE 123: Computer Networks Alex C. Snoeren

Tutorial 9. SOLUTION Since the number of supported interfaces is different for each subnet, this is a Variable- Length Subnet Masking (VLSM) problem.

Network Layer PREPARED BY AHMED ABDEL-RAOUF

Lecture 12: Aggregation. CSE 123: Computer Networks Alex C. Snoeren

Computer Networks CS 552

Internet Protocol version 6

KUPF: 2-Phase Selection Model of Classification Records

Inside Internet Routers

Fast Packet Classification Algorithms

AN EFFICIENT HYBRID ALGORITHM FOR MULTIDIMENSIONAL PACKET CLASSIFICATION

Lecture 3: Packet Forwarding

Grid of Segment Trees for Packet Classification

Decision Forest: A Scalable Architecture for Flexible Flow Matching on FPGA

Lecture 11: IPv6. CSE 123: Computer Networks Alex C. Snoeren. HW 2 due NOW

IP Addresses. IP Addresses

Tree-Based Minimization of TCAM Entries for Packet Classification

Internet. Organization Addresses TCP/IP Protocol stack Forwarding. 1. Use of a globally unique address space based on Internet Addresses

AN ASSOCIATIVE TERNARY CACHE FOR IP ROUTING. 1. Introduction. 2. Associative Cache Scheme

Review for Chapter 4 R1,R2,R3,R7,R10,R11,R16,R17,R19,R22,R24, R26,R30 P1,P2,P4,P7,P10,P11,P12,P14,P15,P16,P17,P22,P24,P29,P30

CS 268: Integrated Services

IPv4 ACLs, identified by ACL numbers, fall into four categories, as shown in Table 1. Table 1 IPv4 ACL categories

ITTC High-Performance Networking The University of Kansas EECS 881 Packet Switch I/O Processing

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061. Lecture 2. Internetworking IPv4, IPv6

A Scalable Approach for Packet Classification Using Rule-Base Partition

Configuring ACLs. ACL overview. ACL categories. ACL numbering and naming

Last Lecture: Network Layer

University of Toronto Faculty of Applied Science and Engineering. Final Exam, December ECE 461: Internetworking Examiner: J.

Basics of communication. Grundlagen der Rechnernetze Introduction 31

Network layer: Overview. Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing

Packet Classification Using Dynamically Generated Decision Trees

The Interconnection Structure of. The Internet. EECC694 - Shaaban

Network layer: Overview. Network Layer Functions

HP A-F1000-A-EI_A-F1000-S-EI VPN Firewalls

b. Suppose the two packets are to be forwarded to two different output ports. Is it

COMP/ELEC 429/556 Introduction to Computer Networks

ROUTING INTRODUCTION TO IP, IP ROUTING PROTOCOLS AND PROXY ARP

Homework 1 Solutions:

Introduction to Internetworking

IP Addressing. Introductory material. An entire module devoted to IP addresses. Pedro Brandão (PhD) University of Évora

15-744: Computer Networking. Routers

Differentiated Services

Router Design: Table Lookups and Packet Scheduling EECS 122: Lecture 13

Chapter 12: Indexing and Hashing. Basic Concepts

CS 3516: Advanced Computer Networks

Caches. Han Wang CS 3410, Spring 2012 Computer Science Cornell University. See P&H 5.1, 5.2 (except writes)

CS 5114 Network Programming Languages Data Plane. Nate Foster Cornell University Spring 2013

Chapter 12: Indexing and Hashing

Table of Contents. Cisco How NAT Works

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

IP Address Lookup and Packet Classification Algorithms

Efficient Multi-Match Packet Classification with TCAM

ECE 461 Internetworking Fall Quiz 1

CS 268: Graduate Computer Networks Spring Overview

Design Considerations : Computer Networking. Outline. Challenge 1: Address Formats. Challenge. How to determine split of functionality

Core-Stateless Fair Queueing: Achieving Approximately Fair Bandwidth Allocations in High Speed Networks. Congestion Control in Today s Internet

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

Review on Tries for IPv6 Lookups

LOGICAL ADDRESSING. Faisal Karim Shaikh.

An Efficient Parallel IP Lookup Technique for IPv6 Routers Using Multiple Hashing with Ternary marker storage

Multiway Range Trees: Scalable IP Lookup with Fast Updates

Network Performance: Queuing

Multi Protocol Label Switching (an introduction) Karst Koymans. Thursday, March 12, 2015

Business Data Communications and Networking

Packet Classification. George Varghese

Page 1. Quality of Service. CS 268: Lecture 13. QoS: DiffServ and IntServ. Three Relevant Factors. Providing Better Service.

Layering and Addressing CS551. Bill Cheng. Layer Encapsulation. OSI Model: 7 Protocol Layers.

1 Connectionless Routing

MPLS MULTI PROTOCOL LABEL SWITCHING OVERVIEW OF MPLS, A TECHNOLOGY THAT COMBINES LAYER 3 ROUTING WITH LAYER 2 SWITCHING FOR OPTIMIZED NETWORK USAGE

2/22/2008. Outline Computer Networking Lecture 9 IP Protocol. Hop-by-Hop Packet Forwarding in the Internet. Internetworking.

Prof. Shervin Shirmohammadi SITE, University of Ottawa. Internet Protocol (IP) Lecture 2: Prof. Shervin Shirmohammadi CEG

Chapter 12: Indexing and Hashing

CS610 Computer Network Final Term Papers Solved MCQs with reference by Virtualians Social Network

CS 525: Advanced Database Organization 04: Indexing

Differentiated Services

Message Switch. Processor(s) 0* 1 100* 6 1* 2 Forwarding Table

CS 520: Network Architecture I Winter Lecture 11: IP Address Conservation

Transcription:

Overview CS 268: Route Lookup and Packet Classification Packet Lookup Packet Classification Ion Stoica March 3, 24 istoica@cs.berkeley.edu 2 Lookup Problem Identify the output interface to forward an incoming packet based on packet s destination address Forwarding tables summarize information by maintaining a mapping between IP address prefixes and output interfaces Route lookup find the longest prefix in the table that matches the packet destination address Packet with destination address 2.82.. is sent to interface 2, as 2.82..xxx is the longest prefix matching packet s destination address 28.6.2.xxx 2.82.xxx.xxx 3 2.82..xxx 2 2.82.. 28.6.2. 2 istoica@cs.berkeley.edu 3 istoica@cs.berkeley.edu 4 Patricia Tries Use binary tree paths to encode prefixes xx 2 x 3 xxx 5 2 3 5 Lulea s Routing Lookup Algorithm (Sigcomm 97) Minimize number of memory accesses Minimize size of data structure (why?) Solution: use a three-level data structure Advantage: simple to implement Disadvantage: one lookup may take O(m), where m is number of bits (32 in the case of IPv4) istoica@cs.berkeley.edu 5 istoica@cs.berkeley.edu 6

First Level: Bit-Vector Cover all prefixes down to depth 6 Use one bit to encode each prefix - Memory requirements: 2 6 = 64 Kb = 8 KB First Level: Pointers Maintain 6-bit pointers to () next-hop (routing) table or (2) to two level chuncks - 2 bits encode pointer type - 4 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 root heads genuine heads istoica@cs.berkeley.edu 7 istoica@cs.berkeley.edu 8 Code Word and Base Indexes Array 6abcd acdef bit vector pointer array Problem: find pointer Split the bit-vector in bit-masks (6 bits each) Find corresponding bit-mask How? - Maintain a6-bit code word for each bit-mask (-bit value; 6-bit offset) - Maintain a base index array (one 6-bit entry for each 4 code words) number of previous ones in the bit-vector Bit-vector Code word array Routing table Level two chunks istoica@cs.berkeley.edu 9 Base index array istoica@cs.berkeley.edu Code word array Base index array First Level: Finding Pointer Group Use first 2 bits to index into code word array Use first bits to index into base index array address: 4C first 2 bits 4 first bits 3 + = 3 First Level: Encoding Bit-masks Observation: not all 6-bit values are possible - : bit-mask is not possible (why not?) Let a(n) be number of non-zero bit-masks of length 2 n Compute a(n) using recurrence: - a() = - a(n) = + a(n-) 2 For length 6, 678 possible values for bit-masks This can be encoded in bits - Values r i in code words Store all possible bit-masks in a table, called maptable istoica@cs.berkeley.edu istoica@cs.berkeley.edu 2 2

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 bitmask - 6 Kb Maptable: 677x6 entries, 4 bits each - ~ 43.3 Kb Total: 23.3 Kb = 5.4 KB istoica@cs.berkeley.edu 3 istoica@cs.berkeley.edu 4 First Level: Optimizations Reduce number of entries in Maptable by two: - Don t store bit-masks and ; 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: -8 heads 8-bit indices, eight pointers (24 B) - Dense: 9-64 heads Like level, but only one base index (< 62 B) - Very dense: 65-256 heads Like level (< 552 B) Only 7 bytes are accessed to search each of levels 2 and 3 istoica@cs.berkeley.edu 5 istoica@cs.berkeley.edu 6 Limitations Notes Only 2 4 chuncks of each kind - Can accommodate a growth factor of 6 Only 6-bit base indices - Can accommodate a growth factor of 3-5 Number of next hops <= 2 4 This data structure trades the table construction time for lookup time (build time < ms) - Good trade-off because routes are not supposed to change often Lookup performance: - Worst-case: cycles A 2 MHz Pentium Pro can do at least 2 millions lookups per second - On average: ~ 5 cycles Open question: how effective is this data structure in the case of IPv6? istoica@cs.berkeley.edu 7 istoica@cs.berkeley.edu 8 3

Overview Classification Problem Packet Lookup Packet Classification 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 (6 bits) - TOS byte (8 bits) - Type of protocol (8 bits) In general fields are specified by range istoica@cs.berkeley.edu 9 istoica@cs.berkeley.edu 2 of Classification Rules Characteristics of Real Classifiers (Gupta & McKeown, Sigcomm 99) Access-control in firewalls - Deny all e-mail 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 5 Mbps are injected from ISP-X Results are collected over 793 packet classifiers from ISPs, with a total of 4,55 rules - Classifiers do not contain many rules: mean = 5 rules, max = 734 rules, only.7% contain over rules - Many fields are specified by range, e.g., greater than 23, or 2-24 - 4% 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 istoica@cs.berkeley.edu 2 istoica@cs.berkeley.edu 22 Two-dimension space, i.e., classification based on two fields Complexity depends on 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- n) time and O(n) space istoica@cs.berkeley.edu 23 istoica@cs.berkeley.edu 24 4

Simplifying Assumptions Recursive Flow Classification (RFC) Algorithm In practice, you get the average not the worstcase, e.g., number of overlapping regions for the largest classifier 436 vs. theoretical worst case 3 The number of rules is reasonable small, i.e., at most several thousands The rules do not change often 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 size table with pre-computed values; each entry contains the class identifier Only one memory access needed - but this is impractical require huge memory istoica@cs.berkeley.edu 25 istoica@cs.berkeley.edu 26 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 istoica@cs.berkeley.edu 27 istoica@cs.berkeley.edu 28 of Packet Flow in RFC Four fields six chunks - Source and destination IP addresses two chuncks each - Protocol number one chunck - Destination port number one chunck istoica@cs.berkeley.edu 29 istoica@cs.berkeley.edu 3 5

Complete indx=c*5+c indx=c*5+c indx=c2*6+c3*3+c5 istoica@cs.berkeley.edu 3 istoica@cs.berkeley.edu 32 RFC Lookup Performance RFC Scalling Dataset: classifiers used in practice Hardware: 3.25 millions pps using three stage pipeline, and 4-bank 64 Mb SRAMs at 25 MHz Software: > million pps on a 333 MHz Pentium RFC does not handle well large (general) classifiers - As the number of rules increases, the memory requirements increase dramatically, e.g., for 5 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 istoica@cs.berkeley.edu 33 istoica@cs.berkeley.edu 34 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 in Lulea s algorithm istoica@cs.berkeley.edu 35 Check-Point Presentation (cont d) Next Tuesday (March 5) project presentations: Each group has minutes - 7 minutes for presentations - 3 minutes for questions Time will be very strictly enforced Don t use more than five slides (including the title slide) istoica@cs.berkeley.edu 36 6

Check-Point Presentation (cont d) st slide: Title 2 nd slide: motivations and problem formulation - Why is the problem important? - What is challenging/hard about your problem 3 rd slide: main idea of your solution 4 th slide: status 5 th slide: future plans and schedule istoica@cs.berkeley.edu 37 Phase : - Possible values for destination port number: 8, 2-2, >23, * Use two bits to encode Reduction: 6 2 - Possible values for protocol: udp, tcp, * Use two bits to encode Reduction: 8 2 Phase : - Concatenate from phase, five possible values: {8,udp}, {2-2,udp}, {8,tcp}, {>23,tcp}, everything else Use three bits to encode Reduction 4 3 RFC Algorithm: istoica@cs.berkeley.edu 38 7