1 a fast ip lookup scheme for longest-matching prefix authors: lih-chyau wuu, shou-yu pin reporter:...

37
1 A Fast IP Lookup Scheme for Longest- Matching Prefix Authors: Lih-Chyau Wuu, Shou- Yu Pin Reporter: Chen-Nien Tsai

Post on 21-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

1

A Fast IP Lookup Scheme for Longest-Matching Prefix

Authors: Lih-Chyau Wuu, Shou-Yu Pin

Reporter: Chen-Nien Tsai

2

Outline

IntroductionPrevious IP Lookup SchemeNew IP Lookup SchemePerformance AnalysisConclusion

3

What is IP Lookup

IP lookup is an important action in router that is to find the next hop of each incoming packet with a longest-prefix-match address in the routing table.

The major bottleneck in Internet is slow packet forwarding rate, which cannot fit the fast link speed in the router.

4

The IP lookup steps

1. The router finds the set of routing entries that match the beginning IP destination address of the incoming packet.

2. Among this set of matched routes, the router selects the one with the longest prefix to forward the packet.

Note: The longest prefix matching is complex.

5

How to Implement

Software For the complex longest prefix matching, IP

lookup is often designed in software a first. Not suitable for high speed network.

Hardware Recently, several hardware lookup mechanisms

have been presented. These mechanisms almost based on indirect

lookup.

6

Outline

IntroductionPrevious IP Lookup SchemeNew IP Lookup SchemePerformance AnalysisConclusion

7

1. Binary Trie

What is the trie? A tree for storing strings in which there is one n

ode for every common prefix. The strings are stored in extra leaf nodes.

For the IPv4, an IP lookup is up to 32 memory accesses in the worst case.

Therefore, this trie structure is not efficient when used in IP lookup.

8

1. Binary Trie (cont.)

9

2. Complete Binary Trie

To decrease the memory access.Only one memory access is needed if use

array to implement the complete trie.But, for an IPv4 routing table, we need 232

(4 GB) entries.It is infeasible to have such a large memor

y in a router.

10

2. Complete Binary Trie (cont.)

11

3. Indirect Lookup

To reduce the size of the above complete trie structure.

The routing table are transformed into a forwarding table which consisting of: One segment array Several next hop array (NHA).

12

Complete binary trie

26 entries

IP Next Hop

00000000 A。。。

A

00111111 A

Next Hop Offset

0000 A Null

0001 A Null

0010 A Null

0011 A Null

Indirect lookup

4 entries

An Indirect Lookup Example

Prefix Next Hop

00* A

Routing Table (a entry)

13

3. Indirect Lookup (cont.)

Number of entries: 256 → 48

14

Outline

IntroductionPrevious IP Routing Lookup SchemeNew IP Lookup SchemeHardware ImplementationPerformance AnalysisConclusion

15

Data Structure of the Forwarding Table

The Forwarding Table consists of four small tables: Level one forwarding table Level two forwarding table Level three forwarding table Level four forwarding table

Next hop array

Segment array

16

The Forwarding Table

17

How to Construct the Forwarding Table

1. Using Haung’s algorithm to constructs the segment array and NHA.

2. Transform the segment array to L1FT and L2FT.

3. Transform the NHA to L3FT and L4FT.

18

Segment Array Construction

For a 32-bit IP address in IPv4, the size of the segment array is 216.

Algorithm steps:1. If the length of a route prefix larger than 16,

then construct the corresponding NHA.

2. Otherwise, determine the range of the segment array to store the next hop information.

19

An Example (for one entry and 8-bit IP)

Next Hop Offset

0000 A Null

0001 A Null

0010 A Null

0011 A Null

Prefix Next Hop

0/2 AThe length of prefix: 2

The size of segment array: 24.

Let S and E denote the range that the next hop is A.

Goal: S = 0000 and E = 0011

S = 0000 AND 1100

E = 0000 OR 0011

20

21

Next Hop Array Construction

Algorithm steps:1. For each prefixes which have the same

segment, calculate maximum offset.

2. Similar to segment array, determine the range of the NHA to store the next hop information.

22

23

L1FT/L2FT construction

To reduce the segment array size, we scan the segment array in a group of 24 entries.

Thus, the L1FT has 212 entries.If all entries in a group have the same next

hop, then it become one entry in the L1FT.Otherwise, we need construct L2FT and

calculate compression bit map (CBM) for IP lookup operation.

24

L1FT/L2FT construction (cont.)

Number of entries: 32 → 6

25

26

L3FT/L4FT construction

For each segment with its longest length larger than four, its associated NHA is replaced by L3FT/L4FT, otherwise the NHA becomes L3FT directly.

The algorithm is similar with previous one.Because the length of a NHA offset is

varied, we need adjust the algorithm.

27

L3FT/L4FT construction (cont.)

Number of entries: 32 → 5

28

29

IP Lookup Operation (An Example)

BTW, Number of entries: 48 → 26

30

IP Lookup Operation (Flow Chart)

31

32

Hardware Implementation

33

Outline

IntroductionPrevious IP Lookup SchemeNew IP Lookup SchemePerformance AnalysisConclusion

34

Performance Analysis

The Internet routing table at web site for the IPMA project is used to evaluate the forwarding table size.

The proposed scheme was compared with these four lookup schemes: DIR-24-8 DIR-21-3-8 SFT scheme Huang’s scheme

35

Performance Analysis (cont.)

36

Conclusion

The forwarding table of this proposed scheme is small enough to fit into SRAM.

The scheme offers lookup speed of 100 million packets per second. (using current 10ns SRAM)

When the routing table changes, the forwarding table will reconstruct from scratch.

37

THE END