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

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

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 A Fast IP Lookup Scheme for Longest-Matching Prefix Authors: Lih-Chyau Wuu, Shou-Yu Pin Reporter: Chen-Nien Tsai.

1

A Fast IP Lookup Scheme for Longest-Matching Prefix

Authors: Lih-Chyau Wuu, Shou-Yu Pin

Reporter: Chen-Nien Tsai

Page 2: 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

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

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.

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

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.

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

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.

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

6

Outline

IntroductionPrevious IP Lookup SchemeNew IP Lookup SchemePerformance AnalysisConclusion

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

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.

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

8

1. Binary Trie (cont.)

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

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.

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

10

2. Complete Binary Trie (cont.)

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

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).

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

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)

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

13

3. Indirect Lookup (cont.)

Number of entries: 256 → 48

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

14

Outline

IntroductionPrevious IP Routing Lookup SchemeNew IP Lookup SchemeHardware ImplementationPerformance AnalysisConclusion

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

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

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

16

The Forwarding Table

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

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.

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

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.

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

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

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

20

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

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.

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

22

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

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.

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

24

L1FT/L2FT construction (cont.)

Number of entries: 32 → 6

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

25

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

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.

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

27

L3FT/L4FT construction (cont.)

Number of entries: 32 → 5

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

28

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

29

IP Lookup Operation (An Example)

BTW, Number of entries: 48 → 26

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

30

IP Lookup Operation (Flow Chart)

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

31

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

32

Hardware Implementation

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

33

Outline

IntroductionPrevious IP Lookup SchemeNew IP Lookup SchemePerformance AnalysisConclusion

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

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

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

35

Performance Analysis (cont.)

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

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.

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

37

THE END