Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ofir Luzon 037237468 Supervisor: Prof. Michael Segal Longest Prefix Match For IP Lookup.

Similar presentations


Presentation on theme: "Ofir Luzon 037237468 Supervisor: Prof. Michael Segal Longest Prefix Match For IP Lookup."— Presentation transcript:

1 Ofir Luzon 037237468 Supervisor: Prof. Michael Segal Longest Prefix Match For IP Lookup

2 LPM – L ONGEST P REFIX M ATCH Definition

3 LPM For IP Lookup A router holds a routing table which contains prefix entries of variable length, and destination port. When a router receives a packet, it searches for the longest prefix of the destination IP address in its routing table. A long delay could eventually cause packet lose as the incoming queues can get overflow.

4 LPM Motivation For the class based addressing there is no need for longest prefix as only one entry can match a given IP address: Class LeadingNumberAddresses Start address End address Bitsof Networksper Network Class A0128 (2 7 )16,777,216 (2 24 )0.0.0.0127.255.255.255 Class B1016,384 (2 14 )65,536 (2 16 )128.0.0.0191.255.255.255 Class C1102,097,152 (2 21 )256 (2 8 )192.0.0.0223.255.255.255 Class D (multicast)1110not defined 224.0.0.0239.255.255.255 Class E (reserved)1111not defined 240.0.0.0255.255.255.255

5 LPM Motivation CIDR addressing (Classless Inter Domain Routing) o Any prefix length o Reduces size of tables o Aggregation of several prefixes o More then one entry can match a given IP address o The correct entry is always the longest match

6 S IZE AND O PERATIONS Data Structure Requirements

7 Active BGP entries (FIB) Summary of total route table size, a listing of possibly bogus routes seen and summary information on ASes. Roughly 325K entries. Routing table can not be stored in fast memory components alone like Flash and DRAM, and slower components like HDD must also be used. Therefore, amount of I/O operations has to be kept as low as possible.

8 Table Updates Per Week Histogram showing number of deletion and insertion updates for a week, divided by prefix length. Two important observations can be made: amount of updates is significantly lower then amount of lookups. updates do occur at regular bases. About 5000 updates a week or 750 a day.

9 B INARY T RIE P ATRICIA T RIE K S TRIDE M ULTI -B IT T RIE Solutions Being Used Today

10 Trie A trie is an ordered tree data structure that is used to store an associative array where the keys are usually strings. Unlike a tree, no node in the trie stores the key associated with that node; instead, its position in the tree shows what key it is associated with. All the descendants of a node have a common prefix of the string associated with that node. The term trie comes from “retrieval”.

11 Binary Trie Each node marked with a letter is a prefix node. Leaves are always prefix nodes. Search Algorithm Traverse the tree according to destination address bit by bit. The last recent marked node is the longest prefix.

12 Compressed Binary Trie – Patricia trie Patricia - Practical Algorithm To Retrieve Information Coded In Alphanumeric Compress all one child branches. Requires to store additional information with nodes, the bit number field is added to each node. A comparison of full prefix is made at every node. Prefix string must be stored at every node.

13 K stride multi- bit Trie Kbit are inspected at each step. Each Node has potentially child nodes. The result is a faster lookup, as each step more then one bit is inspected. Some prefix nodes will be multiplied. Example of 2 stride trie.

14 Complexity of the Lookup N – Number of prefixes L – Query length (32 for IP address) Data StructureLookupUpdate Memory consumption Binary TrieO(L) O(NL) Patricia TrieO(L) O(NL) K Stride multi-bit TrieO(L/K)O(L/K+2 K )O(2 K NL/K)

15 G OAL A ND C ONCEPTS My Research

16 Research Goal Develop an efficient data structure, which support search insertion and deletion operations. Primary concern will be the search operation, since the amount of searches is considerably larger then update operations. The data structure will be planned and optimized for IP addresses and not for a general type of strings.

17 Main Concepts The research is based on two main ideas: Unite similar partial data from different prefixes, and by doing so, significantly reduce memory consumption of a routing table. Build a data structure that will give different weight of importance to different length of prefixes, as the lengths are not uniformly distributed.

18 Compress table size by unite similar partial data Divide entry into small segments. For each segment hold an array of forwarding ports (size of array is the number of ports in the router). The array for each segment tells which ports are associated with that segment. A search algorithm will compare some combinations of segments arrays. False positive. Prefix Table 127.230.18 113.230.145 19.230.55 19.127.39 19.65.13 Partial prefixes Table 12718 113230145 55 1912739 6513

19 False Positive A false positive is when the algorithm finds an entry that was not inserted False positive can create multiple options if there is an entry with one port, and false positive with another port.

20 F UTURE R ESEARCH My Research

21 My Future Research Additional data must be stored to overcome the false positive matches. Generalize the algorithm to find any prefix length.  Shorter lengths are “easy”, all options can be easily mapped. There is one more interesting data structure that I came across, which I will research and try to convert it to fit LPM; BDD – Binary Decision Diagram.

22 BDD BDD is a data structure that can be considered as a compressed representation of sets or relations. Unlike other compressed representations, operations are performed directly on the compressed representation. BDD is a rooted DAG (Directed Acyclic Graph) used to represent a binary function. Each node represent a literal of the function, and has two directed edges (0,1). Different orders of the nodes in the graph will result in different running time. Finding the optimal order in NP-Hard.

23 Bad Order Good Order BDD Order

24 Questions?


Download ppt "Ofir Luzon 037237468 Supervisor: Prof. Michael Segal Longest Prefix Match For IP Lookup."

Similar presentations


Ads by Google