Académique Documents
Professionnel Documents
Culture Documents
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:
6.References