Vous êtes sur la page 1sur 5

IP Lookup using Two-level indexing and B-Trees

Monther Aldwairi Areej Odaat


munzer@just.edu.jo amodaat06@just.edu.jo

Computer and Programming Engineering Department


Jordan University of Science and Technology
Irbid 0000, Jordan

Abstract - According to network expansion


and thus the increasing in the size of the routing
table , the problem of time to find the out To find the corresponding entry of the IP in a router table,
coming port of the IP in the routing table is Monzer approach use both of thumb indexing and Binary
increased also the times of memory access ,the based approaches, where in thumb indexing a prefix is
old search technique suffered in increasing the checked bit by bit with the routing table entry, while in
time exponentially with increasing the size of binary based approach use the LPM to find the entry in
the routing tables ,Dr.Monzer in JUST, used a the IP routing table.
combination of two approaches with two level Briefly, Monzer approach , use the prefix to divide the
indexing ,in our approach we use 2 level routing table to sub tables as a first level of indexing then
indexing like what he did use, and then use the number of bits in the entry to provide more sub tables
direct reference to the longest prefix match ,this , those resulting tables then the base of balanced binary
approaches shows linear growth with routing tree ,that provide fast and consuming safe of memory
table size growth instead of exponentially space. We use the indexing in the same way like what he
growth in other approaches. Also nearly fixed did but we use direct reference to the longest prefix match
time to reach any IP port number. instead of the binary search tree.

1.Introduction In the rest of this paper describes related work in this


problem and the disadvantage in that approaches, also we
The expansion of the network make more Illustrate the new approach, and the simulation result of
demands on the routers duties to be faster in this new method and finally the references part.
order to overcome the network traffic problem ,
most of the IP look up table approaches if used
alone suffer from slowness when the IP routing
table size increase ,Monzer approaches combine 2 Related Work
the best advantages of the IP look up
approaches . Sequential search: where we search the routing table for
specific entry that match exactly the coming IP address
The IP address consist of 32 bit and network with specific length[1] , this very travail and simple , and
mask , and define the out coming port the packet need the worst case of 32 combinations, so it is very clear
should access to reach the destination network , for us the waste of space and time.
and finally the receiver, each network has a
range, for example 11.11.11.00 - 11.11.11.FF. Two-level indexing and B-Trees: Dr.Monzer use tow
11.11.11.** is called a prefix and have a level indexing, he combine the best of features of thumb
corresponding entry in router table. indexing and balanced binary search tree .
According to Two-level indexing and B-Trees -pointer which point to the IP list.
we apply 2 level indexing and decimal storage The first level indexing is performed according to the first k bit
IPs, in the IP’s as in Two-level indexing and B-Tree. But the
B-tree and binary search to find the port number second level is according to the ones counter in the first 8 bit
of the IP, figure 1 show this approach structure. which is the least subnet mask for all IP’s in the routing table.

Now after performing the indexing we have all second level


tables, each one start with prefix and one’s counter differ from
any other table, and store just the IP significant mask in binary
format.
Each table from those tables has a corresponding table that
contains the Port numbers, so one pointer for 3 tables; the 3rd
table is the table that contains all names for all tables. e.g.
tab_Prfx_0.One_count_4,
All tables are in array list so we have a structure similar to the
following one that shown in figure 2.

Figure 1. Architecture of Two-level indexing and B-Tree.

This approach depend on K value for faster


search, first level indexing is perfumed
according to the first k bit in IP’s in routing
table, and create 2^k sub tables, so if k equal 2
then on the first level we have 4 tables the first
one includes all IP’s that start with 00 the 2nd
contains all that start with 01..etc.
Now for each table of the first level is reduced
to smaller sub tables and this reduce the space
search table, this is performed according to the
number of ones in the IP address which is stored
in decimal to provide memory usage
minimization.
Our approach uses the simplest of the sequential
search and the way of 2 levels indexing to
minimize the search space, and reach any IP Figure 2. Architecture of the proposed algorithm.
port number in fixed time.[2]

3Tow level indexing with direct reference. To find the corresponding entry of the IP in a router table, we
convert the coming IP address to binary base format and find
the first k bit prefix value , then count the number of one’s in
This approach perform 2 level indexing and IPs the first 8 bit, now we have the list’s name for example
are stored in binary format in list and the Port tab_prfx0_count1s_0 as shown in figure 2 above, we get index
numbers in another list that has the same of the name which is in fig.2 = 0, now get all_2nd_tabls_IP.list[index]
120
And all_2nd_tabls_Port.list[index] Find in this sub list
index of the given IP initially the full match (31 bit ) if it is 100
not fount find the next less match (…until 8 bit)
80
Now after we have the index of the longest prefix match
we get the corresponding port number using 60
ArrayList_n.indexOf () method. That is direct reference to
40
the port number.
20

4.Preliminary Results 0
-200000 0 200000 400000 600000
-20
We implement the approach in C# using Microsoft Visual
C# 2008 Express Edition and tested it using random IPv4
Figure 3. diagram for #IP vs. processing time
(source:mae-west routing table with 71,100 IPs)
Addresses. The test was performed on an Intel Core 2 Duo
processer with 3.0 GHz speed and 2 GB of memory. And next Figure 4 show memory access times vs.
For simulation we generate 71000 random IPv4 IPs and #IP’s growth:
change k value form 0-7 we found that the best k was 6 bit 4500000
it is provide faster access time to memory and less 4000000
memory access. 3500000
Also the time needed to get the port number increased 3000000
linearly with the number of IP’s increasing. figure 3 shows 2500000
the processing time growth vs.#IP’s growth 2000000
1500000
Processing Memory 1000000
# IP time access 500000
10 0.001 160 0
100 0.009 800 -200000 0 200000 400000 600000
1000 0.096 8000 Figure 3. diagram for #IP vs. Memory access
5000 1.227 40000
10000 0.879 160000 Task manager shows that the maximum memory
15000 6.3693 120000 space needed was 29,000 Kbyte.
30000 11.2326 240000 And for I random IP average access time = 0.001
50000 11.5896 200000 sec and accesses time = 8 accesses.
100000 30.3887 800000
500000 96.1685 4000000 5. Conclusions:

In this paper we introduce the 2 level indexing


with direct reference algorithm which follow on
Two-level indexing and B-Tree approaches’
indexing , we test the time to access the memory
and found it is nearly fixed in avg = 0.001sec.and
show how the memory access times and
processing time increased linearly with the.
growth of the number of IP’s.we use the mae.west routing
table with more than 71100 entry in our test.

6.References

[1] M. Waldvogel, G. Varghese J. Turner and B. Plattnery,


“Scalable High
Speed IP Routing Lookups”. In Proceedings of IEEE
ACM SIGCOMM 97
Cannes, France, pp.25–36, 1997.

[2] Monzer al_dwari , Monther Aldwairi*, _oor Al-Tarazi”


IP Lookup using Two-level indexing and B-Trees,
ICOMP 2010: Computer Engineering and Applied
Computing

Vous aimerez peut-être aussi