IP Address Lookup Masoud Sabaei Assistant professor

Slides:



Advertisements
Similar presentations
February 12, 2007 WALCOM '2007 1/22 DiskTrie: An Efficient Data Structure Using Flash Memory for Mobile Devices N. M. Mosharaf Kabir Chowdhury Md. Mostofa.
Advertisements

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.
Network Algorithms, Lecture 4: Longest Matching Prefix Lookups George Varghese.
An On-Chip IP Address Lookup Algorithm Author: Xuehong Sun and Yiqiang Q. Zhao Publisher: IEEE TRANSACTIONS ON COMPUTERS, 2005 Presenter: Yu Hao, Tseng.
Quick Review of Apr 10 material B+-Tree File Organization –similar to B+-tree index –leaf nodes store records, not pointers to records stored in an original.
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.
Survey of Packet Classification Algorithms. Outline Background and problem definition Classification schemes – One dimensional classification – Two dimensional.
B+-Trees (PART 1) What is a B+ tree? Why B+ trees? Searching a B+ tree
Tries Standard Tries Compressed Tries Suffix Tries.
Digital Search Trees & Binary Tries Analog of radix sort to searching. Keys are binary bit strings.  Fixed length – 0110, 0010, 1010,  Variable.
An Efficient IP Address Lookup Algorithm Using a Priority Trie Authors: Hyesook Lim and Ju Hyoung Mun Presenter: Yi-Sheng, Lin ( 林意勝 ) Date: Mar. 11, 2008.
BTrees & Bitmap Indexes
Higher Order Tries Key = Social Security Number.   9 decimal digits. 10-way trie (order 10 trie) Height
1 A Tree Based Router Search Engine Architecture With Single Port Memories Author: Baboescu, F.Baboescu, F. Tullsen, D.M. Rosu, G. Singh, S. Tullsen, D.M.Rosu,
Power Efficient IP Lookup with Supernode Caching Lu Peng, Wencheng Lu*, and Lide Duan Dept. of Electrical & Computer Engineering Louisiana State University.
Deterministic Memory- Efficient String Matching Algorithms for Intrusion Detection Nathan Tuck, Timothy Sherwood, Brad Calder, George Varghese Department.
1 Multi-Prefix Trie: a New Data Structure for Designing Dynamic Router-Tables Author: Sun-Yuan Hsieh Member, IEEE, Yi-Ling Huang, and Ying- Chi Yang Publisher:
1 A Novel Scalable IPv6 Lookup Scheme Using Compressed Pipelined Tries Author: Michel Hanna, Sangyeun Cho, and Rami Melhem Publisher: NETWORKING 2011 Presenter:
CS 268: Lectures 13/14 (Route Lookup and Packet Classification) Ion Stoica April 1/3, 2002.
Parallel-Search Trie-based Scheme for Fast IP Lookup
Study of IP address lookup Schemes
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Part B Part A:  Index Definition in SQL  Ordered Indices  Index Sequential.
1 A Fast IP Lookup Scheme for Longest-Matching Prefix Authors: Lih-Chyau Wuu, Shou-Yu Pin Reporter: Chen-Nien Tsai.
Basic Data Structures for IP lookups and Packet Classification
1 HEXA: Compact Data Structures or Faster Packet Processing Author: Sailesh Kumar, Jonathan Turner, Patrick Crowley, Michael Mitzenmacher. Publisher: ICNP.
B + -Trees (Part 1) Lecture 20 COMP171 Fall 2006.
B + -Trees (Part 1) COMP171. Slide 2 Main and secondary memories  Secondary storage device is much, much slower than the main RAM  Pages and blocks.
Univ. of TehranAdv. topics in Computer Network1 Advanced topics in Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr.
Homework #3 Due Thursday, April 17 Problems: –Chapter 11: 11.6, –Chapter 12: 12.1, 12.2, 12.3, 12.4, 12.5, 12.7.
Fast binary and multiway prefix searches for pachet forwarding Author: Yeim-Kuan Chang Publisher: COMPUTER NETWORKS, Volume 51, Issue 3, pp , February.
B + -Trees COMP171 Fall AVL Trees / Slide 2 Dictionary for Secondary storage * The AVL tree is an excellent dictionary structure when the entire.
Address Lookup in IP Routers. 2 Routing Table Lookup Routing Decision Forwarding Decision Forwarding Decision Routing Table Routing Table Routing Table.
Data Structures for Computer Graphics Point Based Representations and Data Structures Lectured by Vlastimil Havran.
Database Management 8. course. Query types Equality query – Each field has to be equal to a constant Range query – Not all the fields have to be equal.
Chapter 19: Binary Trees. Objectives In this chapter, you will: – Learn about binary trees – Explore various binary tree traversal algorithms – Organize.
Data : The Small Forwarding Table(SFT), In general, The small forwarding table is the compressed version of a trie. Since SFT organizes.
12.1 Chapter 12: Indexing and Hashing Spring 2009 Sections , , Problems , 12.7, 12.8, 12.13, 12.15,
B + -Trees. Motivation An AVL tree with N nodes is an excellent data structure for searching, indexing, etc. The Big-Oh analysis shows that most operations.
1 Dynamic Pipelining: Making IP- Lookup Truly Scalable Jahangir Hasan T. N. Vijaykumar School of Electrical and Computer Engineering, Purdue University.
Higher Order Tries Key = Social Security Number.   9 decimal digits. 10-way trie (order 10 trie) Height
IP Address Lookup Masoud Sabaei Assistant professor
1 Power-Efficient TCAM Partitioning for IP Lookups with Incremental Updates Author: Yeim-Kuan Chang Publisher: ICOIN 2005 Presenter: Po Ting Huang Date:
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.
PARALLEL-SEARCH TRIE- BASED SCHEME FOR FAST IP LOOKUP Author: Roberto Rojas-Cessa, Lakshmi Ramesh, Ziqian Dong, Lin Cai Nirwan Ansari Publisher: IEEE GLOBECOM.
Sets of Digital Data CSCI 2720 Fall 2005 Kraemer.
Marwan Al-Namari Hassan Al-Mathami. Indexing What is Indexing? Indexing is a mechanisms. Why we need to use Indexing? We used indexing to speed up access.
Memory-Efficient IPv4/v6 Lookup on FPGAs Using Distance-Bounded Path Compression Author: Hoang Le, Weirong Jiang and Viktor K. Prasanna Publisher: IEEE.
Spring 2003 ECE569 Lecture 05.1 ECE 569 Database System Engineering Spring 2003 Yanyong Zhang
Author: Haoyu Song, Murali Kodialam, Fang Hao and T.V. Lakshman Publisher/Conf. : IEEE International Conference on Network Protocols (ICNP), 2009 Speaker:
Updating Designed for Fast IP Lookup Author : Natasa Maksic, Zoran Chicha and Aleksandra Smiljani´c Conference: IEEE High Performance Switching and Routing.
Dynamic Pipelining: Making IP-Lookup Truly Scalable Jahangir Hasan T. N. Vijaykumar Presented by Sailesh Kumar.
Hierarchical packet classification using a Bloom filter and rule-priority tries Source : Computer Communications Authors : A. G. Alagu Priya 、 Hyesook.
Author : Masanori Bando and H. Jonathan Chao Publisher : INFOCOM, 2010 Presenter : Jo-Ning Yu Date : 2011/02/16.
Ofir Luzon Supervisor: Prof. Michael Segal Longest Prefix Match For IP Lookup.
IP Address Lookup Masoud Sabaei Assistant professor Computer Engineering and Information Technology Department, Amirkabir University of Technology.
Multiway Search Trees Data may not fit into main memory
IP Routers – internal view
AN ON-CHIP IP ADDRESS LOOKUP ALGORITHM
Mark Redekopp David Kempe
Multiway range trees: scalable IP lookup with fast updates
Higher Order Tries Key = Social Security Number.
Database Design and Programming
A Small and Fast IP Forwarding Table Using Hashing
Indexing 4/11/2019.
Presentation transcript:

IP Address Lookup Masoud Sabaei Assistant professor Computer Engineering and Information Technology Department, Amirkabir University of Technology

Outlines Overview, Trie-based Algorithms, Hardware-based Schemes, IPV6 Lookup

Trie-based Algorithms Binary Trie, Path Compressed Trie, Multi-Bit Trie Level Compression, Lulea Algorithm, Tree Bitmap Algorithm Tree-Based Pipelined Search, Binary Search on Prefix Lengths, Binary Search on Prefix Range.

Binary Trie Represents prefixes of different lengths 1-bit trie Left link: 0 Right link: 1 Search Start from root, move to left or right if the current bit of the address is 0 or 1 respectively If a node containing a prefix mark (*) is seen, store it somewhere as the longest match up to now Addition Follow the path and create new nodes if needed and finally mark the last node as a prefix Deletion Follow the path and delete the last node and its parents until a marked node or a node with another child is seen يکی از ساختارهای داده‌ی شناخته شده برای جستجو بر اساس طولانی‌ترين تطبيق، Trie می‌باشد. در ساده‌ترين حالت، يک Trie يک درخت دودويی است که اطلاعات پيشوند‌ها در يال‌های آن ذخيره شده‌اند و نام پيشوندها در نودها قرار دارند. با شروع از نود ريشه‌ی Trie، و با شروع از پر ارزش‌ترين بيت پيشوند، بسته به صفر يا يک بودن اين بيت، يک انشعاب به فرزند چپ يا فرزند راست داريم. پس از رسيدن به آخرين بيت، نام پيشوند در نود فعلی قرار دارد. شکل، يک مثال در اين مورد نشان می‌دهد. در اين شکل تعدادی پيشوند و Trie متناظر با آن‌ها مشاهده می‌شود. همان طور که در شکل مشاهده می‌شود، نام پيشوندها می‌تواند درنودهای غير برگ هم وجود داشته باشد و اين به خاطر اين است که يک پيشوند می‌تواند خود، پيشوندی از ديگری باشد. مثلا پيشوند b در اين شکل، پيشوندی از e است. به همين خاطر است که امکان تطبيق يک آدرس مورد جستجو با چند پيشوند وجود دارد و در اين موارد طولانی‌ترين پيشوند به عنوان نتيجه‌ی جستجو بازگردانده می‌شود. جستجودر Trie خيلی ساده است. با شروع از نود ريشه و با توجه به صفر يا يک بودن بيت‌های آدرس مورد جستجو، پس از چک کردن هر بيت‌، به فرزند سمت چپ يا راست آن نود منتقل می‌شويم. در حين اين انتقال، هر جا که نودی حاوی نام پيشوند مشاهده کنيم، آن را به عنوان طولانی‌ترين تطبيق يافته شده تا به حال به خاطر می‌سپاريم. وقتی که به يک نود برگ برسيم، و يا اين که ادامه‌ی حرکت امکان‌پذير نباشد، جستجو پايان يافته‌است. به عنوان مثال فرض کنيد بخواهيم در Trie شکل بالا برای آدرس 11000 جستجو انجام شود. برای سادگی کار، آدرس را 5 بيتی در نظر گرفته‌ايم. با شروع از نود ريشه، با توجه به اولين بيت آدرس که يک است به فرزند سمت راست منتقل می‌رويم. در آن‌جا با مشاهده‌ی پيشوند a آن را به عنوان طولانی‌ترين تطبيق مشاهده شده تا به حال به خاطر می‌سپاريم. سپس با توجه به بيت بعدی آدرس که يک است، به فرزند سمت راست نود a حرکت می‌کنيم. در آن جا نام پيشوندی مشاهده نمی‌شود. بنابراين a هنوز طولانی‌ترين تطبيق يافته شده تا به حال است. سپس با توجه به صفر بودن بيت بعدی آدرس، به فرزند سمت چپ نود فعلی می‌رويم. در آن جا d را مشاهده می‌کنيم و اين بار d به عنوان طولانی‌ترين تطبيق يافته شده تا به حال، جای a را می‌گيرد. سپس با توجه به صفر بودن بيت بعدی آدرس مورد جستجو، بايد به فرزند سمت چپ نود d حرکت کنيم. اما با توجه به عدم وجود چنين فرزندی اين کار امکان ندارد و به همين خاطر جستجو پايان يافته است و d بهترين تطبيق يافته شده برای آدرس 11000 است. وقتی که يک مدخل جديد به جدول مسيريابی افزوده می‌شود، بايد پيشوند جديد در Trie وارد شود. برای انجام اين کار ابتدا مثل اين که بخواهيم يک جستجو برای آن پيشوند انجام دهيم، مسير موجود بر روی Trie را تا جايی که وجود دارد ادامه می‌دهيم. اگر اين مسير به طور کامل وجود داشت، فقط کافی است نام پيشوند را در نود پايانی ثبت کنيم. در غير اين صورت بايد ادامه‌ی مسير مربوط به آن نود را در Trie ايجاد کنيم و سپس نام پيشوند را در نود پايانی ذخيره کنيم. در مورد حذف يک پيشوند از Trie، ابتدا مسير مربوط به آن پيشوند را تا انتها بر روی Trie مرور می‌کنيم. سپس اگر آخرين نود مربوط به اين مسير دارای فرزندی باشد، مثل پيشوند c در شکل بالا، بايد فقط نام پيشوند را از نود حذف کنيم و نمی‌توانيم خود نود را حذف کنيم. مثلا برای حذف پيشوند c از Trie شکل بالا، بايد نام آن را از نود مربوط به آن حذف کنيم. اما در صورتی که فرزندی نداشته‌باشد، بايد خود نود را حذف کنيم و نيز والد‌های نود هم تا جايی که حاوی پيشوند نباشند و فقط يک فرزند داشته باشند، بايد حذف شوند. مثلا برای حذف پيشوند h از Trie شکل بالا، بايد نود h و نود والد آن حذف شوند.

Data Structure of a 1-bit Binary Trie

Performance of Binary Trie The Number of Memory Accesses in The Worst Case is 32 for IPv4. To Add a Prefix to The Trie, In The Worst Case It Needs to Add 32 Nodes. In This Case, The Storing Complexity is 32N · S, The Lookup Complexity is O(W), The Storagecomplexity is O(NW)

Variants of Binary Tries Disjoint-prefix binary trie

Path-Compressed Trie

Example of Path-Compressed Trie with N Leaves

Performance of Path-compressed Tire Path compression reduces the height of a sparse binary trie. When the tree is full and there is no compression possible, a path-compressed trie looks the same as a regular binary trie. Thus, its lookup and update complexity (the worst case) is the same as a binary trie, O(W). Considering a path-compressed trie as a full binary trie with N leaves, there can be N − 1 internal nodes between the root and each leaf node (including the root node), Since the path can be significantly compressed to reduce the internal nodes, the space complexity becomes O(N), independent of W.

Multi-Bit Trie

Multi-Bit Trie Example With Each Entry a Prefix or a Pointer to Save Memory Space

Performance of Multi-Bit Trie The advantage of the k-bit trie structure is that it improves the lookup by k times. The disadvantage is that a large memory space is required. One way to reduce the memory space is to use a scheme called ‘leaf pushing’. The lookup is performed in strides of k bits. The lookup complexity is the number of bits in the prefix divided by k bits, O(W/k). For example, if W is 32 and k is 4, then 8 lookups in the worst case are required to access that node. An update requires a search through W/k lookup iterations plus access to each child node (2k ). The update complexity is O(W/k + 2k). In the worst case, each prefix would need an entire path of length (W/k) and each node would have 2k entries. The space complexity would then be O((2k ∗ N ∗ W)/k).

Level Compression Trie One-bit trie; Path-compressed trie; LC-trie.

Performance of Level Compression Trie An LC-trie searches in strides of k bits, and thus the lookup complexity of a k-stride LC-trie is O(W/k). To update a particular node, we would have to go through W/k lookups and then access each child of the node (2k ). Thus, the update complexity is O(W/k + 2k). The memory consumption increases exponentially as the stride size (k) increases. In the worst case, each prefix would need an entire path of length (W/k) and each node has 2k entries. The space complexity would then be O((2k ∗ N ∗ W)/k).

Lulea Algorithm Example of a Lulea Trie

Lulea Algorithm Three Levels of the Data Structure

Lulea Algorithm Part of cut with corresponding bit-vector

Lulea Algorithm Bit-masks versus code words and base indices

Lulea Algorithm Finding the pointer index

Lulea Algorithm Performance. The Lulea algrorithm provides a very compact data structure and fast lookups. The data structure has 150–160 kbytes for the largest forwarding tables with 40,000 routing entries, which is small enough to fit in the cache of a conventional general-purpose processor. A 200MHz Pentium Pro or a 333MHz Alpha 21164 with the table in the cache can perform a few million IP lookups per second without special hardware and no traffic locality is assumed. Lulea does not support incremental updates because of the algorithm’s tight coupling property. In many cases, the whole table should be reconstructed. Thus, routing protocols that require frequent updates make this algorithm unsuitable. The Lulea trie uses the k-bit stride multi-bit method. The lookup complexity is the same as a multi-bit trie, O(W/k). The bitmap compression technique applied to the multi-bit trie makes it almost impossible to perform incremental updates. The data structure may need to be completely rebuilt. The memory consumption is the same as the k-bit stride multi-bit trie. Thus, the space complexity is O((2k ∗ N ∗ W)/k).

Tree Bitmap Algorithm

Tree Bitmap Algorithm Example of route lookup

Tree-Based Pipelined Search

Tree-Based Pipelined Search Random ring pipeline architecture with two data paths

Binary Search on Prefix Lengths

Binary Search on Prefix Lengths

Binary Search on Prefix Lengths Performance. The algorithm requiresO(log2 W) hashed memory accesses for one lookup operation, taking no account of the hash collision. So does the update complexity. This data structure has storage complexity of O(NW) since there could be up to W markers for a prefix-each internal node in the trie on the path from the root node to the prefix. However, not all the markers need to be kept. Only the log2 W markers that would be probed by the binary search algorithm need be stored in the corresponding hash tables. For instance, an IPv4 prefix of length 22 needs markers only for prefix lengths 16 and 20. This decreases the storage complexity to O(N log2 W).

Binary Search on Prefix Range

Binary Search on Prefix Lengths Performance. There should be 2N segment points for a prefix database size of N when each prefix generates two endpoints. If a k-way search is used, the search time in the worst case will be logk 2N. Once a prefix is added or deleted, the range sequence is changed and the content of N memory locations storing the original N ranges need to be updated. The update complexity and memory space are both O(N). It has been reported that by using a 200-MHz Pentium Pro-based machine and a practical forwarding table with over 32,000 route entries, the worst-case time of 490 ns and an average time of 100 ns for IP route lookups were obtained. Only a 0.7-Mbyte memory was used. A drawback of this algorithm is that it does not support incremental updates.