SE521907C2 - Method and system for fast IP route search to determine where an IP datagram with a given destination address should be forwarded - Google Patents

Method and system for fast IP route search to determine where an IP datagram with a given destination address should be forwarded

Info

Publication number
SE521907C2
SE521907C2 SE0200153A SE0200153A SE521907C2 SE 521907 C2 SE521907 C2 SE 521907C2 SE 0200153 A SE0200153 A SE 0200153A SE 0200153 A SE0200153 A SE 0200153A SE 521907 C2 SE521907 C2 SE 521907C2
Authority
SE
Sweden
Prior art keywords
search
level
predetermined
forwarding table
representation
Prior art date
Application number
SE0200153A
Other languages
Swedish (sv)
Other versions
SE0200153L (en
SE0200153D0 (en
Inventor
Mikael SUNDSTROEM
Original Assignee
Rockstorm Technologies Ab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rockstorm Technologies Ab filed Critical Rockstorm Technologies Ab
Priority to SE0200153A priority Critical patent/SE521907C2/en
Publication of SE0200153D0 publication Critical patent/SE0200153D0/en
Priority to PCT/SE2003/000064 priority patent/WO2003063427A1/en
Publication of SE0200153L publication Critical patent/SE0200153L/en
Publication of SE521907C2 publication Critical patent/SE521907C2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/742Route cache; Operation thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass

Abstract

A method for IP routhing lookup to determine where to forward an IP -datagram with a given destination address by retrieving from a routing table a next/hop index indicating where to forward said datagram, said next/hop index being associates with the longest matching prefix of said destination address, said address being a number in an address universe U, whereing a set of address prefixes P and a mapping of P onto a set of next/hop indices D are converted into a set of ranges R, constituting a partition of U, and a mapping of R onto D. The method involves the steps of building and storing in a memory a forwarding table representation from R and D by using a predetermined layered data structure where the construction of the layer is selected depending on the range density ¦R´¦ for the sub-universe U´represented by that layer to get a space efficient representation of the set of ranges R, and performing the lookup by a range matching operation in said forwarding table. A corresponding system comprises a first converting means for converting a set of address prefixes P into a set of ranges R constituting a partition of said universe U and a second converting means for converting the mapping from P onto a set of next-hop indices D to an equivalent mapping from R onto D. The system also comprises data structuring means for forming predetermined layered datastructures T representing the routing table, and building and memory means for building and storing a forwarding tablerepresentation from R and D by using a predetermined layered data structure where the construction of the layer is selected depending on the range density ¦R´¦ for the sub-universe U´ represented by that layer to get a space efficient representation of the set of ranges R, and means for performing the lookup by a range matching operation in said forwarding table.

Description

25 30 521 907 2 tionsadressen i den mängd av prefix med godtycklig längd (dvs mellan O och 32 bitar) som utgör vägvalstabellen. The address in the amount of prefix of any length (ie between 0 and 32 bits) which constitutes the path selection table.

För att påskynda vidarebefordringsbeslutet använder många av dagens lP- routerkonstruktioner en cachningsteknik i vilken de senaste eller oftast sökta destina- tionsadresserna och de motsvarande vägvalssökningresultaten sparas i en vägca- che. Denna metod fungerar mycket bra för routrar nära utkanterna av nätverken, dvs så kallade routrar för små kontor och hemmakontor (SOHO), som har små vägvals- tabeller, låg trafikbelastning och höga accesslägen i vägvalstabellen. En annan metod för att snabba på routrarna är att utnyttja det faktum att frekvensen för väg- valstabelluppdateringar, som är resultatet av topologiförändringar i nätverken etc, är extremt låg jämfört med frekvensen för vägvalssökning. Detta gör det möjligt att lagra den relevanta informationen från vägvalstabellen i en effektivare vidarebefordringsta- bell som optimerats för att stödja snabba sökningar. När förändringar sker i vägvals- tabellen byggs vidarebefordringstabellen om delvis eller fullständigt. l P Gupta Algorithms for Routing Lookups and Packet Classification, A Dis- sertation Submltted to the Department of Computer Science and the Committee on Graduate Studies of Stanford University, December 2000, beskrivs en vidarebeford- ringstabellsrepresentation och en motsvarande sökprocedur som endast använder Static Vector Nodes, dvs direkt adressering, i två steg (dvs två minnesaccesser).To speed up the forwarding decision, many of today's LP router designs use a caching technique in which the most recent or most frequently searched destination addresses and the corresponding route selection search results are saved in a road cache. This method works very well for routers near the edges of the networks, ie so-called routers for small offices and home offices (SOHO), which have small routing tables, low traffic load and high access modes in the routing table. Another method of speeding up routers is to take advantage of the fact that the frequency of routing table updates, which are the result of topology changes in the networks, etc., is extremely low compared to the routing frequency. This makes it possible to store the relevant information from the route selection table in a more efficient forwarding table that has been optimized to support fast searches. When changes occur in the route selection table, the forwarding table is rebuilt in part or in full. P Gupta Algorithms for Routing Lookups and Packet Classification, A Dissertation Submltted to the Department of Computer Science and the Committee on Graduate Studies at Stanford University, December 2000, describes a forwarding table representation and a corresponding search procedure using only Static Vector Nodes , ie direct addressing, in two steps (ie two memory accesses).

Med en fortsatt ökning av användningen av lnternet finns det ett konstant behov att förbättra IP-vägvalssökningen. l WO 01/22667 beskrivs en teknik för att göra direkt indexering effektivare genom att komprimera vektornoder som har få använda bestämda minnesadresser. l det beskrivna systemet används en vidarebefordrings- tabell som består av tre nivåer av komprimerade pekarvektorer och kostnaden för en sökning är i värsta fall 6 minnesaccesser. Vid glest besatta intervall är slöseriet av minnesutrymme avsevärt när båda dessa metoder används, även om den andra är mycket bättre. Den så kallade Luleå-algoritmen är en annan vidarebefordringstabell, som beskrivs i WO 99/14906, där minnesutrymmesutnyttjandet i hög grad är förbätt- rat men kostnaden för sökning har ökat till 12 minnesaccesser.With a continued increase in the use of the Internet, there is a constant need to improve the IP path search. WO 01/22667 describes a technique for making direct indexing more efficient by compressing vector nodes that have been allowed to use specific memory addresses. The system described uses a forwarding table consisting of three levels of compressed pointer vectors and the cost of a search is, in the worst case, 6 memory accesses. At sparsely populated intervals, the waste of memory space is considerable when both of these methods are used, although the other is much better. The so-called Luleå algorithm is another forwarding table, which is described in WO 99/14906, where memory space utilization has been greatly improved but the cost of searching has increased to 12 memory accesses.

Syftet med föreliggande uppfinning är att göra lP-vägvalet ännu effektivare genom att introducera en ny vidarebefordringstabellsrepresentation som förbättrar minnesutrymmesutnyttjandet ännu mer medan kostnaden för en sökning reduceras till 4 minnesaccesser. 10 15 20 25 30 5213 907 3. Beskrivning av uppfinningen Detta syfte uppnås genom en metod och ett system av den typ som definie- ras i inledningsdelen av beskrivningen och som har de karakteriserande särdragen enligt kraven 1 respektive 18. l föreliggande uppfinning är följaktligen en serie av datastrukturer utvecklad för att representera vidarebefordringstabellen, vilka data- strukturer är anpassade till intervalldensiteten hos den aktuella delpopulationen.The object of the present invention is to make the IP path selection even more efficient by introducing a new forwarding table representation which improves the memory space utilization even more while the cost of a search is reduced to 4 memory accesses. Description of the invention This object is achieved by a method and a system of the type defined in the preamble of the description and having the characterizing features of claims 1 and 18, respectively. Accordingly, the present invention is a series of data structures developed to represent the forwarding table, which data structures are adapted to the interval density of the current subpopulation.

Sålunda väljs en optimal struktur för en viss intervalldensitet för att minimera min- nesbehoven. För varje minnesaccess introduceras en viss blockstorlek och med utgångspunkt från denna storlek anpassas datastrukturen så att minnesaccessen kommer att bli så effektiv som möjligt. Det är inget problem att reducera antalet min- nesaccesser för sökning om det inte finns någon begränsning för det tillgängliga minnet och, å andra sidan, är det inget problem att utföra en kompression av tabellen om man kan bortse ifrån antalet nödvändiga minnesaccesser för sökning. Med före- liggande uppfinning minimeras båda dessa storheter. Enligt en annan aspekt av före- liggande uppfinning skapas en dataprogramsprodukt som har dataprogramskodme- del för att få en dator att exekvera metoden ovan när programmet körs på en dator. 4. Kort beskrivning av ritningarna För att ytterligare förklara uppfinningen kommer nu utföranden som valts såsom exempel att beskrivas i mer detalj med hänvisning till ritningarna på vilka Figur 1 är ett flödesdiagram som visar hierarkin för de olika underdatastrukturerna och de motsvarande sökprocedurerna enligt uppfinningen. Figur 2 illustrerar nästa hopp-index och kodningsschema för delträdspekare som används i ett första stegs Static Vector Nodes, Figur 3 illustrerar en Dynamic Flat Tree-underdatastruktur med 25 områden som visar uppställningen av informationen med avseende på cache- radsgränser, Figur 4 illustrerar ett Dynamic Layered Tree-löv och kodningen av områdesgränser till nästa hopp-index liksom den motsvarande noden, Figur 5 illu- strerar uppställningen av information i en binär Dynamic Layered Tree-datastruktur ytterligare, Figur 6 visar uppställningen av information i en Static Flat Tree-data- struktur, Figur 7 är ett schematiskt blockdiagram av ett utförande av systemet enligt uppfinningen, och Figur 8 visar ett exempel på en liten vidarebefordringstabell som representeras av en 32-bitarsvariation av Dynamic Layered Tree-datastrukturen. 10 15 20 25 30 521 907 4 5. Beskrivning av föredragna utföranden I det följande beskrivs utvecklingen av en serie av datastrukturer som används för att representera komprimerade vidarebefordringstabeller som stöder snabb vägvalssökning. I synnerhet utvecklar vi en mängd av tekniker som kombine- ras för att komprimera 218 vägar till en vidarebefordringstabellsdatastruktur med användning av mindre än 2,7 Mbyte minne och som ändå inte kräver mer än 4 min- nesaccesser för sökning. 5.1 Förberedelser 5.1.1 Några kommentarer angående beteckningssätt i det följande kommer vi att uttrycka områden eller intervall genom att använda punktnotationen för talen a och b, a < b, att beteckna områden eller sekvenser (beroende på sammanhang) som innefattar a och b enligt följande b-1...b=b-1,b a...b=a,a+1...b Vi kommer även att använda olika enheter som representeras av bitsträngar.Thus, an optimal structure is selected for a certain interval density to minimize memory needs. For each memory access, a certain block size is introduced and based on this size, the data structure is adapted so that the memory access will be as efficient as possible. It is no problem to reduce the number of memory accesses for searching if there is no limit to the available memory and, on the other hand, it is no problem to perform a compression of the table if one can disregard the number of necessary memory accesses for searching. With the present invention, both of these quantities are minimized. According to another aspect of the present invention, a computer program product is created which has computer program code means for causing a computer to execute the above method when the program is run on a computer. 4. Brief Description of the Drawings To further explain the invention, embodiments selected by way of example will now be described in more detail with reference to the drawings, in which: Figure 1 is a flow chart showing the hierarchy of the various subdata structures and the corresponding search procedures of the invention. Figure 2 illustrates the next jump index and coding scheme for subtree pointers used in a first step Static Vector Nodes, Figure 3 illustrates a Dynamic Flat Tree subdata structure with 25 areas showing the arrangement of the information with respect to cached boundaries, Figure 4 illustrates a Dynamic Layered Tree leaves and the encoding of area boundaries to the next jump index as well as the corresponding node, Figure 5 further illustrates the arrangement of information in a Binary Dynamic Layered Tree data structure, Figure 6 shows the arrangement of information in a Static Flat Tree data structure, Figure 7 is a schematic block diagram of an embodiment of the system according to the invention, and Figure 8 shows an example of a small forwarding table represented by a 32-bit variation of the Dynamic Layered Tree data structure. 5 15 20 25 30 521 907 4 5. Description of Preferred Embodiments The following describes the development of a series of data structures used to represent compressed forwarding tables that support fast route search. In particular, we are developing a number of technologies that are combined to compress 218 paths into a forwarding table data structure using less than 2.7 Mbytes of memory and yet require no more than 4 memory accesses for searching. 5.1 Preparations 5.1.1 Some comments regarding designations In the following we will express areas or ranges by using the dot notation for the numbers a and b, a <b, to denote areas or sequences (depending on the context) that include a and b as follows b-1 ... b = b-1, b a ... b = a, a + 1 ... b We will also use different units represented by bit strings.

Om inte annat uttryckligen uppges är bitarna numrerade och startar från 0 och slutar med den högsta biten. Låt x vara en k + 1 bitars bitsträng. Bit ibetecknas med x [i] och hela bitsträngen kan skrivas som x= x[k1x[k-1]...x[11x[o] =x[k...o1.Unless otherwise stated, the bits are numbered and start from 0 and end with the highest bit. Let x be a k + 1 bit string. Bit is denoted by x [i] and the whole bit string can be written as x = x [k1x [k-1] ... x [11x [o] = x [k ... o1.

Anledningen till att börja med den högsta biten är att vi ofta betraktar bit- strängarna såsom icke-negativa heltal där bitsträngen utgör den binära representa- tionen. Storleken på en bitsträng x betecknas med |x|, dvs för x i det tidigare exemp- let har vi att |x| = k + 1. Vi kan tillfoga bitsträngar genom att helt enkelt placera dem efter varandra - z = xy är den bitsträng som erhålls när man adderar x till y. Det vill säga z [|yj - 1...0] = yoch z [|y| + |x| - 1...|y|] = x. Den sträng som erhålls genom att upprepat tillfoga k kopior av x betecknas med xk, dvs 10 15 20 25 30 521 907 5 x“=xx...x se k gånger Slutligen kommer vi att representera mängder såsom X = {x1, x2,..., xn}.The reason for starting with the highest bit is that we often consider the bit strings as non-negative integers where the bit string constitutes the binary representation. The size of a bit string x is denoted by | x |, ie for x in the previous example we have that | x | = k + 1. We can add bit strings by simply placing them one after the other - z = xy is the bit string obtained when adding x to y. That is, z [| yj - 1 ... 0] = yoch z [| y | + | x | - 1 ... | y |] = x. The string obtained by repeatedly adding k copies of x is denoted by xk, ie 10 15 20 25 30 521 907 5 x “= xx ... x see k times Finally we to represent quantities such as X = {x1, x2, ..., xn}.

Storleken på X betecknas med |X| och i detta fall är |X| = n. Dessutom kommer vi att använda de gängse mängdrelationerna, såsom e, c, n, u och g påföljande sätt X1 e X {x1,x2,...,x,,.1} c X X g X {x0,x1, ...,x,,}n{x1,x2,...,x,,+1} = X {x1,x2, ...,x,-}u{X,~+1,x,-+2, ...,x,,} = X. 5.1.2 Vägvalstabeller och vägvalssökning En vägvalstabell är en su/jektiv avbildning från en mängd av /P-adressprefix, eller helt enkelt adressprefix, till en mängd av nästa hopp-index. Vägvalstabeller används för att fastställa vart ett IP-datagram med en given destinationsadress ska vidarebefordras, såsom nämnts ovan. Detta åstadkoms genom att finna det längsta matchande prefixet hos destinationsadressen och hämta det associerade nästa hopp-indexet som representerar vad som ska göras med paketet. Processen att utföra längst prefix-matchningen och att hämta nästa hopp-index refereras till som vägvalssökning.The size of X is denoted by | X | and in this case is | X | = n. In addition, we will use the usual set of relations, such as e, c, n, u and g in the following way X1 e X {x1, x2, ..., x ,,. 1} c XX g X {x0, x1 , ..., x ,,} n {x1, x2, ..., x ,, + 1} = X {x1, x2, ..., x, -} u {X, ~ + 1, x, - + 2, ..., x ,,} = X. 5.1.2 Route selection tables and route selection search A route selection table is a subjective mapping from a set of / P address prefers fi x, or simply address prefre fi x, to a set of the next jump index. Routing tables are used to determine where an IP datagram with a given destination address should be forwarded, as mentioned above. This is accomplished by obtaining the longest matching price at the destination address and retrieving the associated next jump index that represents what to do with the packet. The process of performing the longest prefix match and retrieving the next jump index is referred to as route selection.

En lPv4-adress är ett tal i populationen U = {o, 1, 232 -1}.An lpv4 address is a number in the population U = {o, 1, 232 -1}.

Den representeras av en bitvektor a = a[31]a[30]...a[1]a[0] = a[31...0] som är ekvivalent med den binära representationen av talet. Adressprefix representeras även av bitvektorer. Prefixet med längden 0 betecknas med ersätt- 10 15 20 25 30 521 907 e ningstecknet * och matchar godtycklig adress. Alla andra prefix, med längden k skild från noll, betecknas med p = p[s11p[3o1...p[i] * = p[31...32 _ kr k bitar och matchar alla adresser a som uppfyller a[31...32 - k] = p[31...32 - k].It is represented by a bit vector a = a [31] a [30] ... a [1] a [0] = a [31 ... 0] which is equivalent to the binary representation of the number. Address prefixes are also represented by bit vectors. The prefix with length 0 is denoted by the replacement character * and matches any address. All other prefixes, with length k different from zero, are denoted by p = p [s11p [3o1 ... p [i] * = p [31 ... 32 _ SEK k bits and match all addresses a that satisfy a [31 ... 32 - k] = p [31 ... 32 - k].

Adressprefix representerar även delmängder av U som består av områden.Address pref fi x also represents subsets of U consisting of areas.

Det vill säga prefixet p[31...32 - k] * representerar området p'°...p”i där den binära representationen av p'° och phi ges av p[s1...32 - /<1oo...o ka 32 - k bitar respektive p[31...32-/<111...1 avi! 32 - k bitar För godtyckligt par av prefix P1 och P2 har vi antingen P1 c P2, P1 = P2 eller P1 3 P2. Det är tämligen okomplicerat att konvertera mängden av prefix till en mängd av n områden R = {R1, Rg, ..., R,,} som utgör en partition av U, där det första, izte, och sista området ges av 10 15 20 25 30 521 907 7 Rfiri/o rini=ri_1nf+1___ nnf, respektive.That is, the prefix p [31 ... 32 - k] * represents the range p '° ... p ”i where the binary representation of p' ° and phi is given by p [s1 ... 32 - / <1oo. ..o ka 32 - k bits resp p [31 ... 32 - / <111 ... 1 avi! 32 - k bits For any pair of prefixes P1 and P2 we have either P1 c P2, P1 = P2 or P1 3 P2. It is rather uncomplicated to convert the set of prefixes to a set of n areas R = {R1, Rg, ..., R ,,} which form a partition of U, where the first, izte, and last area are given by 20 25 30 521 907 7 R fi ri / o rini = ri_1nf + 1 ___ nnf, respectively.

Rn = rnlo...rnhi = rn-1hi+1... 232 '1 Dessutom kommer varje område att associeras med ett nästa hopp-index på samma sätt som de ursprungliga prefixen, dvs vi har en surjektiv avbildning från R till mängden av nästa hopp-index. Sålunda kan vi utföra vägvalssökning genom att finna det enda matchande området av en adress a, dvs det R, som uppfyller r,-'° s a s r,-"", i stället för att utföra längst prefix-matchningen. Konverteringen kan utföras enligt följande. Låt R initialt vara tomt och låt den aktuella adressen a vara O. Sätt därefter upprepat in R = /°.../°", där r'° = a och f” är den minsta adressen som är större än eller lika med rsom associeras med samma nästa hopp-index som a, i R och tilldela r'”'+ 1 till a sålänge som a e U.Rn = rnlo ... rnhi = rn-1hi + 1 ... 232 '1 In addition, each area will be associated with a next jump index in the same way as the original prefixes, ie we have a surjective mapping from R to the set of next jump index. Thus, we can perform route selection by finding the only matching area of an address a, i.e. the R, which satisfies r, - '° s a s r, - "", instead of performing the longest prefix match. The conversion can be performed as follows. Initially leave R blank and let the current address a be O. Then insert R = /°.../° "repeatedly, where r '° = a and f" is the smallest address greater than or equal to rsom is associated with the same next jump index as a, in R and assign r '”' + 1 to a as long as ae U.

Vi avslutar detta avsnitt med en sammanfattning av de steg som utförts så långt och en mer formell definition av de problem som återstår att lösa. Låt D = {d1, d2, dm} vara mängden av nästa hopp-index (bokstaven D/d har valts för att repre- sentera sökta data). Låt dessutom nästa hopp-index di representeras av ett llgml bitars icke-negativt heltal arfigml - 11a,{f lgml - 21 ...d,-[11a,{o1. v flgml bitar lnitialt hade vi en mängd av prefix P och en avbildning av P på D. Genom den längst prefix-matchningsoperationen har vi även en avbildning av U på D. Slutli- gen har vi beskrivit en metod för att konvertera P och avbildningen av P på D till en mängd av områden R som utgör en partition av U, och en avbildning av R på D. l själva verket har vi konverterat det ursprungliga längst prefix-matchningsproblem i P till det enklare men ekvivalenta (enda) områdesmatchningsproblemet i R.We conclude this section with a summary of the steps taken so far and a more formal definition of the problems that remain to be solved. Let D = {d1, d2, dm} be the set of the next jump index (the letter D / d has been selected to represent the searched data). Also let the next jump index di be represented by a llgml bit non-negative integer arfigml - 11a, {f lgml - 21 ... d, - [11a, {o1. v flgml bits lnitially we had a set of prefix P and an image of P on D. Through the longest prefix matching operation we also have an image of U on D. Finally, we have described a method for converting P and the image of P on D to a set of areas R that form a partition of U, and an image of R on D. In fact, we have converted the original longest prefix matching problem in P to the simpler but equivalent (single) area matching problem in R.

Den konvertering som beskrivits kan användas för godtycklig vägvalstabells- representation för att hämta denna områdespartition (och motsvarande nästa hopp- 10 15 20 25 30 521 207 index) som tjänar såsom en intermediär representation av vilken vidarebefordrings- tabellen byggs (se Figur 7 bp2 och bp3). Kärnan enligt föreliggande uppfinning: ø den effektiva vidarebefordringstabellsrepresentation som konstrueras av den intermediära områdespartitionsrepresentationen och o den sökprocedur som används för att hämta nästa hopp-indexet som associeras med endast matchande område från nämnda intermediära representation kan därför användas tillsammans med godtycklig vägvalstabellsimplementering för att accelerera vägvalssökningen. 5.1.3 Beräkningsmodell Det sämsta fallet från kostnadssynpunkt för att utföra en beräkning såsom en vägvalssökning i en tämligen stor datastruktur är huvudsakligen beroende på antalet minnesaccesser som utförs. Vid varje minnesaccess hämtas en cacherad eller ett cacheblock av k konsekutiva byte från huvudminnet. Blocket lagras därefter på alla nivåer av cachehierarkin innan aktuella data hämtas iden snabbaste första nivå- cachen. Eftersom den dominerande kostnaden för en minnesaccess är kopieringen av blocket från huvudminnet räknar vi multipla accesser till samma k byte-block under en kort beräkning såsom en sökning såsom en minnesaccess. 5.1.4 Utformningsparametrar l vår målarkitektur, t ex Intel Pentium 111, består varje cacherad av 32 byte och detta är det värde på k som vi kommer att använda för hela utformningen av algoritmen.The conversion described can be used for any route selection table representation to retrieve this area partition (and the corresponding next jump index) which serves as an intermediate representation of which the forwarding table is built (see Figure 7 bp2 and bp3 ). The essence of the present invention: ø the efficient forwarding table representation constructed by the intermediate area partition representation and o the search procedure used to retrieve the next jump index associated with only matching area from said intermediate representation can therefore be used together with arbitrary path selection table implementation to accelerate path selection. 5.1.3 Calculation model The worst case from a cost point of view for performing a calculation such as a route search in a fairly large data structure is mainly dependent on the number of memory accesses performed. For each memory access, a cached or cache block of k consecutive bytes is retrieved from the main memory. The block is then stored at all levels of the cache hierarchy before the current data is retrieved in the fastest first level cache. Since the dominant cost of a memory access is the copying of the block from the main memory, we count multiple accesses to the same k byte block during a short calculation such as a search such as a memory access. 5.1.4 Design parameters In our target architecture, eg Intel Pentium 111, each cached consists of 32 bytes and this is the value of k that we will use for the whole design of the algorithm.

Det uppskattas att storleken på de största vägvalstabellerna kommer att överstiga 200 000 vägar inom några få år. Dagens vägvalstabellsdatastrukturer och -implementeringar med hög kapacitet är därför utformade för att rymma 218 = 262 144 vägar och samma antal nästa hopp-index. Följaktligen behöver vi 18 bitar för att representera ett nästa hopp-index. Den konvertering som beskrivits i de tidi- gare avsnitten konverterar n prefix till som mest 2n + 1 områden. Därför är vår data- struktur utformad för att lagra 2 - 218 + 1 = 524 289 områden. Vårt utformningsmål är att utföra en vägvalssökning vid som mest 4 minnesaccesser. 10 15 20 25 30 521 907 9 5.2 Komprimerad vidarebefordringstabells-representation Den grundläggande principen bakom den komprimerade vidarebefordrings- tabellen är att upprepat reducera storleken på delpopulationerna i upp till fyra steg som motsvarar utformningsparametern på 4 minnesaccesser. I föreliggande uppfin- ning är storleken på varje underproblemsfall (dvs antal områden) med avseende på storleken på delpopulationen noggrant övervakad för att fastställa det bästa tillväga- gångssättet för att representera områdena i denna speciella delpopulation. 5.2.1 Översikt av datastrukturen För att få en bättre förståelse av den grundläggande datastrukturen som används i föreliggande uppfinning och de åtföljande principerna för storleksoptime- ring kommer vi tillsvidare att anta att metoden med upprepad reduktion används exklusivt. lnitialt har vi en mängd av n områden R = {R1, R2,..., Rn} som utgör en parti- tion av den ursprungliga populationen U. Det första steget är att dela U i 216 delpo- pulationer Ug, U1,..., Upon med storleken 216 för var och en. Detta åstadkoms genom att utgå från 216 tomma mängder av 16 bitars-områden Rg, R1,..., R21s-1 och upprepa följande ialla R är iom. Lä: R = r'°...r”' a R oon s = r'° [s1...161. orn H°[31...161= rhfrsinis] ra då bon Rfrän R ooh lägg :lll rf° [1s...o1...r'”' [1s...o1 ull Rs. Lägg annars llll /°[15...o1...(2l6- 1) till Rs och ersätt R med 216 - (s + 1)...r111i R. När proceduren fullbordats är R tom och därefter konverteras de n 32 bitars-områdena till n eller fler 16 bitars-områ- den som fördelas mellan de 216 områdesmängderna. För varje R,- som endast inne- håller ett område, låt Trvara nästa hopp-indexet för detta område. Låt annars T,- vara den datastruktur (som ännu inte beskrivits) som representerar områdena hos R,- och som stöder matchningsoperationen för 16 bitars-område för att söka nästa hopp- indexet. Genom att organisera pekare till To, T1,..., och Tgren i en Static Vector Node, eller pekarvektor, med storleken 216, erhåller vi en datastruktur som stöder fullständig 32 bitars-områdesmatchning. Givet en |Pv4-adress a extraherar vi först de 16 mest 10 15 20 25 521 907 10 signifikanta bitarna a [31...16] och använder dessa för att indexera till vektorn för att hämta Tafgrnßl. Vi söker därefter a [15...0] i Taßruw] med användning av matchnings- operationen för 16 bitars-område som stöds av underdatastrukturen.It is estimated that the size of the largest route selection tables will exceed 200,000 roads within a few years. Today's high capacity route selection table data structures and implementations are therefore designed to accommodate 218 = 262,144 paths and the same number of next jump indexes. Consequently, we need 18 bits to represent a next jump index. The conversion described in the previous sections converts n pre fi x to at most 2n + 1 ranges. Therefore, our data structure is designed to store 2 - 218 + 1 = 524 289 areas. Our design goal is to perform a route search for at most 4 memory accesses. 10 15 20 25 30 521 907 9 5.2 Compressed forwarding table representation The basic principle behind the compressed forwarding table is to repeatedly reduce the size of the subpopulations in up to four steps corresponding to the design parameter of 4 memory accesses. In the present invention, the size of each sub-problem case (ie number of areas) with respect to the size of the subpopulation is closely monitored to determine the best approach to represent the areas in this particular subpopulation. 5.2.1 Overview of the data structure In order to gain a better understanding of the basic data structure used in the present invention and the accompanying principles of size optimization, we will for the time being assume that the method of repeated reduction is used exclusively. Initially we have a set of n areas R = {R1, R2, ..., Rn} which form a partition of the original population U. The first step is to divide U into 216 subpopulations Ug, U1 ,. .., Upon with size 216 for each. This is accomplished by starting from 216 empty sets of 16 bit areas Rg, R1, ..., R21s-1 and repeating the following all Rs are iom. Lä: R = r '° ... r ”' a R oon s = r '° [s1 ... 161. orn H ° [31 ... 161 = rhfrsinis] ra då bon Rfrän R ooh læg: lll rf ° [1s ... o1 ... r '”' [1s ... o1 ull Rs. Otherwise add llll /°[15...o1...(2l6- 1) to Rs and replace R with 216 - (s + 1) ... r111i R. When the procedure is completed, R is empty and then they are converted to n 32 the bit ranges to n or more 16 bit ranges distributed between the 216 range sets. For each R, - which contains only one area, let Trvara the next jump index for that area. Otherwise let T, - be the data structure (not yet described) that represents the areas of R, - and that supports the 16-bit area matching operation to search for the next jump index. By organizing pointers to To, T1, ..., and Tgren in a Static Vector Node, or pointer vector, of size 216, we obtain a data structure that supports full 32-bit area matching. Given a | Pv4 address a we first extract the 16 most 10 15 20 25 521 907 10 significant bits a [31 ... 16] and use these to index to the vector to retrieve Tafgrnßl. We then search for a [15 ... 0] in Taßruw] using the 16-bit area matching operation supported by the subdata structure.

Låt |R,~| > 1 och betrakta representationen av T,-. Genom att applicera samma idé såsom ovan indelar vi U,- i 28 delpopulationer U,~,0, U,-,1,..., U,-,2a.1. Detta följs av bearbetning av mängden av områden R,- till R,~,0, R,~,1,..., R,-,2s-1 och representation av dessa genom underdatastrukturer Tixo, Tin. ---. 7-/128-1- Områdesmatchning i T,- åstadkoms genom att använda a [15...8] för att söka T,-_a[15___8] genom direkt indexering i den statiska vektornoden, följt av att söka a [7...0] i Tr,a[1s...s1- Vi applicerar samma idé på 'Fia-elementen genom att indela varje U,-,,'i 24 del- populationer U/upo, Uli/n. Ui.j,24-1- De resulterande områdesmängderna, R,-,,-,,(elementen, representeras av datastrukturer T,-,,-,0, 7',-,,-,1, T,-,,-,24-1. Sökning åstadkoms genom att använda a [7...4] för att indexera till den statiska vektornoden som innehåller pekare till underdata- strukturerna. Resultatet är antingen ett nästa hopp-index eller en vektor av 24 nästa hopp-index som indexeras, med användning av de 4 minst signifikanta bitarna a [3...O] eller lPv4-adressen, för att fullborda sökningen.Let | R, ~ | > 1 and consider the representation of T, -. By applying the same idea as above, we divide U, - into 28 subpopulations U, ~, 0, U, -, 1, ..., U, -, 2a.1. This is followed by processing the set of ranges R 1 - to R 2,,, 0, R,,, 1, ..., R, -, 2s-1 and representing these by sub-data structures Tixo, Tin. ---. 7- / 128-1- Range matching in T, - is accomplished by using a [15 ... 8] to search for T, -_ a [15 ___ 8] by direct indexing in the static vector node, followed by searching for a [7. ..0] in Tr, a [1s ... s1- We apply the same idea to the 'Fia elements by dividing each U, - ,,' into 24 subpopulations U / upo, Uli / n. Ui.j, 24-1- The resulting range sets, R, - ,, - ,, (the elements, are represented by data structures T, - ,, -, 0, 7 ', - ,, -, 1, T, - ,, Search is accomplished by using a [7 ... 4] to index to the static vector node that contains pointers to the subdata structures, resulting in either a next jump index or a vector of 24 next jumps. index that is indexed, using the 4 least significant bits a [3 ... 0] or the lpv4 address, to complete the search.

Nivå IU I min IR I Storlek Adressbitar Pekarstorlek (bitar) 1 232 oo 216 31...16 32 2 216 2313 28 15...s 20 3 2” 137 24 7...4 20 4 24 12 24 3...o 18 l tabellen ovan ger vi en sammanfattning av de figurer som är relaterade till den upprepade indelningen och användningen av Static Vector Nodes. För en given 10 15 20 521 907 11 nivå är |U| storleken av delpopulationen som representeras vid denna nivå. När utrymmesoptimeringar introduceras kommer vi att använda alternativa och mer utrymmeseffektiva tillvägagångssätt i stället för Static Vector Nodes om antalet områden är mindre än min jRj. Storlekskolumnen visar antalet pekare och adress- bitskolumnen visar vilka bitar av lPv4-adressen som används för att indexera vid varje nivå. Beroende på nivån och justeringsbetingelserna för de olika delstrukturer vi kommer att använda, varierar pekarstorleken, eller antal nödvändiga bitar för att representera en pekare, något mellan nivåerna. Exempelvis behöver vi bara 18 bitar vid den lägsta nivån eftersom vi kan garantera att resultatet av sökningen är ett nästa hopp-index. l vad som följer ger vi en översikt av de olika underdatastrukturerna som vi kommer att använda och i de närmast kommande avsnitten kommer vi att beskriva varje typ av struktur i detalj.Level IU I min IR I Size Address bits Pointer size (bits) 1 232 oo 216 31 ... 16 32 2 216 2313 28 15 ... s 20 3 2 ”137 24 7 ... 4 20 4 24 12 24 3 .. .o 18 l the table above gives a summary of the figures related to the repeated division and use of Static Vector Nodes. For a given 10 15 20 521 907 11 level is | U | the size of the subpopulation represented at this level. When introducing space optimizations, we will use alternative and more space-efficient approaches instead of Static Vector Nodes if the number of areas is less than my jRj. The size column shows the number of pointers and the address bit column shows which bits of the IPv4 address are used to index at each level. Depending on the level and the adjustment conditions for the different substructures we will use, the pointer size, or number of bits necessary to represent a pointer, varies slightly between levels. For example, we only need 18 bits at the lowest level because we can guarantee that the result of the search is a next jump index. In what follows, we give an overview of the different subdata structures that we will use and in the next sections we will describe each type of structure in detail.

Nivå lR Iminma* Struktur Nöjd Bytejustering 2 2...29 Dynamic Flat Tree 1...3 4 2 3o...2o1 Dynamic Layered Tree* 1...3 s 2 2o1...2312 Dynamic Layered Treez 1...3 32 2 2313...216 Static Vector Node Ej tillgängl. 2048/3 3 2...136 Dynamic Layered Trees 1...2 32 3 137...28 Static Vector Node Ej tillgängl. 128/3 4 2...8 Dynamic Layered Tree3 1 32 9...11 Static Flat Tree 1 32 12...24 Static Vector Node Ej tillgängl. 256/7 Den första kolumnen visar nivån för den aktuella datastrukturen. Nivå 1 är den översta nivån, dvs den statiska vektornoden med 216 pekare. Vid varje nivå kommer vi att fastställa vilken datastruktur som ska användas baserat på antalet områden (se Figur 1). För varje nivå och datastruktur visar vi det områdesdensitets- intervall, i jRjmmmax-kolumnen, för vilket denna datastruktur erbjuder den mest utrym- meseffektiva representationen. I den tredje kolumn visar vi namnet på datastrukturen 10 15 20 25 30 52112907 och den fjärde kolumnen innehåller höjden på datastrukturen mätt i det antal min- nesaccesser som är nödvändigt för att utföra sökningen. Observera att vi använder tre något olika typer av Dynamic Layered Tree. Alla datastrukturer som startar vid nivå 2 är som mest 3 nivåer höga utom för den statiska vektornoden där begreppet höjd inte är direkt tillämpligt. Detta innebär att oavsett vilken av dessa vi använder används inte mer än 3 minnesaccesser för att fullborda sökningen efter den första minnesaccessen vid nivå 1. På samma sätt är de datastrukturer som startar vid nivå 3 som mest två nivåer höga och de som startar vid nivå 4 är som mest 1 nivå höga.Level lR Iminma * Structure Satisfied Replacement Adjustment 2 2 ... 29 Dynamic Flat Tree 1 ... 3 4 2 3o ... 2o1 Dynamic Layered Tree * 1 ... 3 s 2 2o1 ... 2312 Dynamic Layered Treez 1 .. .3 32 2 2313 ... 216 Static Vector Node Not Available. 2048/3 3 2 ... 136 Dynamic Layered Trees 1 ... 2 32 3 137 ... 28 Static Vector Node Not Available. 128/3 4 2 ... 8 Dynamic Layered Tree3 1 32 9 ... 11 Static Flat Tree 1 32 12 ... 24 Static Vector Node Not available. 256/7 The first column shows the level of the current data structure. Level 1 is the top level, ie the static vector node with 216 pointers. At each level, we will determine which data structure to use based on the number of areas (see Figure 1). For each level and data structure, we show the area density range, in the jRjmmmax column, for which this data structure offers the most space-efficient representation. In the third column we show the name of the data structure 10 15 20 25 30 52112907 and the fourth column contains the height of the data structure measured in the number of memory accesses necessary to perform the search. Note that we use three slightly different types of Dynamic Layered Tree. All data structures starting at level 2 are at most 3 levels high except for the static vector node where the concept of height is not directly applicable. This means that no matter which of these we use, no more than 3 memory accesses are used to complete the search for the first memory access at level 1. In the same way, the data structures that start at level 3 are at most two levels high and those that start at level 4 are at most 1 level high.

Följaktligen kommer vi aldrig att använda mer än 4 minnesaccesser för en fullständig sökning. I den sista kolumnen visar vi bytejusteringen av de olika strukturerna (för Static Vector Nodes visar vi justering för 3 respektive 7 nodpaket). Justeringen är viktig i den följande diskussionen angående pekarstorlekar och pekarutrymmesut- nyttjande för Static Vector Nodes.Consequently, we will never use more than 4 memory accesses for a complete search. In the last column we show the change adjustment of the different structures (for Static Vector Nodes we show adjustment for 3 and 7 node packets respectively). The adjustment is important in the following discussion regarding pointer sizes and pointer space utilization for Static Vector Nodes.

Figur 1 är ett flödesdiagram som illustrerar hierarkin för de olika datadel- strukturerna och de motsvarande sökprocedurerna enligt detta utförande enligt upp- finningen. Nivå 1 ifiguren är en Static Vector Node (SVN) med storleken 216 = 65 536 pekare. Om antalet områden |R| vid nivå 2 inte överstiger 2312 används en av underdatastrukturerna Dynamic Layered Tree1, Dynamic Layered Treez eller Dyna- mic Flat Tree för att representera mängden av områden och de motsvarande sökpro- cedurerna används för att fullborda sökningen. Om sålunda 201 < |R|< 2312 används underdatastrukturrepresentationen Dynamic Layered Treel. Om 29 < |R| < 201 används underdatastrukturen Dynamic Layered Treez, och om 1 < |R|< 29 används den binära underdatastrukturen Dynamic Flat Tree. Om |R|> 2312 vid nivå 2 utförs annars en Static Vector Node SVN-sökning och sökningen fortsätter vid nivå 3. Om antalet områden |R| vid nivå 3 inte överstiger 136 används underdatastrukturrepre- sentationen Dynamic Layered Tree3. Annars utförs för 136 < |R|< 28 (= 256) en SVN- sökning och sökningen fortsätter vid nivå 4. Om antalet områden |R| inte överstiger 11 används slutligen vid nivå 4 en av underdatastrukturerna Dynamic Layered Tree3 eller Static Flat Tree för att fullborda sökproceduren. Om sålunda 8 < |R|< 11 används den binära underdatastrukturen Dynamic Layered Treea, och om 1 < |R|< 8 används underdatastrukturen Static Flat Tree. Annars används för 11 < |R|< 16 en SVN för att fullborda sökningen och för att erhålla det önskade innehållna nästa hopp-indexet. 10 15 20 25 30 521 907 13 5.2.2 Static Vector Nodes Nivå 1 eller den översta nivåns datastruktur består av en rotnod med 216 möjliga delträd. De 16 mest signifikanta bitarna av lPv4-adressen används för att indexera till den vektor som representerar rotnoden för att extrahera ett 32 bitars icke-negativt heltal som antingen kodar ett index till nästa hopp-tabellen eller en pekare till en underdatastruktur såsom visas i tabellen ovan. Såsom nämnts ovan kommer vi att använda olika typer av delträd beroende på antalet områdesgränser som ligger i delpopulationen, dvs densiteten hos delpopulationen. Kodningen av nästa hopp-index och delträdspekare beskrivs i Figur 2, vilken visar det nästa hopp- index och den delträdstyp och det pekarkodningsschema som används i Static Vector Nodes för nivå 1.Figure 1 is a flow chart illustrating the hierarchy of the various data substructures and the corresponding search procedures according to this embodiment of the invention. Level 1 in the figure is a Static Vector Node (SVN) with the size 216 = 65,536 pointers. About the number of areas | R | at level 2 does not exceed 2312, one of the sub-data structures Dynamic Layered Tree1, Dynamic Layered Treez or DynamicMic Tree is used to represent the amount of areas and the corresponding search procedures are used to complete the search. Thus, if 201 <| R | <2312, the subdata structure representation Dynamic Layered Treel is used. At 29 <| R | <201 uses the Dynamic Layered Treez subdata structure, and if 1 <| R | <29 the Dynamic Flat Tree binary subdata structure is used. If | R |> 2312 at level 2, a Static Vector Node SVN search is performed and the search continues at level 3. If the number of areas | R | at level 3 does not exceed 136, the Dynamic Layered Tree3 subdata structure representation is used. Otherwise, for 136 <| R | <28 (= 256) an SVN search is performed and the search continues at level 4. If the number of areas | R | does not exceed 11, finally at level 4 one of the subdata structures Dynamic Layered Tree3 or Static Flat Tree is used to complete the search procedure. Thus, if 8 <| R | <11, the binary sub-data structure Dynamic Layered Treea is used, and if 1 <| R | <8, the sub-data structure Static Flat Tree is used. Otherwise, an SVN is used for 11 <| R | <16 to complete the search and to obtain the desired content of the next jump index. 10 15 20 25 30 521 907 13 5.2.2 Static Vector Nodes Level 1 or the top level data structure consists of a root node with 216 possible sub-trees. The 16 most significant bits of the IPv4 address are used to index to the vector representing the root node to extract a 32-bit non-negative integer that either encodes an index to the next jump table or a pointer to a subdata structure as shown in the table above . As mentioned above, we will use different types of sub-trees depending on the number of area boundaries that lie in the sub-population, ie the density of the sub-population. The coding of the next jump index and sub-tree pointer is described in Figure 2, which shows the next jump index and the sub-tree type and pointer coding scheme used in Static Vector Nodes for level 1.

Observera att för densiteter i området 2...201 måste vi koda storleken på delträdet exakt för att rymma kvantiseringsreduktionsutrymmesoptimeringar. Sådana optimeringar är inte nödvändiga när densiteten överstiger 201 (kodad såsom 202).Note that for densities in the range 2 ... 201, we must code the size of the sub-tree exactly to accommodate quantization reduction space optimizations. Such optimizations are not necessary when the density exceeds 201 (coded as 202).

Vid nivå 2 och 3 kommer vi att använda 20 bitars-pekare i Static Vector Nodes. Vi reserverar de två mest signifikanta bitarna för att koda pekartypen. De återstående bitarna är tillräckligt för att koda 18 bitars nästa hopp-index såväl som 18 bitars-pekare som refererar till Dynamic Layered Tree, Static Flat Tree eller Static Vector Nodes. Dessa datastrukturer är 32 byte-justerade. Detta innebär att 18 bitar är tillräckligt för att adressera en minnesarea av 218 - 32 = 8 388 608 byte.At levels 2 and 3, we will use 20-bit pointers in Static Vector Nodes. We reserve the two most significant bits to encode the pointer type. The remaining bits are sufficient to encode the 18-bit next jump index as well as 18-bit pointers that refer to Dynamic Layered Tree, Static Flat Tree or Static Vector Nodes. These data structures are 32 byte-adjusted. This means that 18 bits are enough to address a memory area of 218 - 32 = 8,388,608 bytes.

Den 20 bitars-pekare som används vid nivå 2 är inte så lättjusterad. Eftersom det enda kravet på en vektornod är att det är möjligt att indexera bland pekarna och hämta en pekare ien minnesaccess, är vi emellertid i stånd att använda vissa tricks för att uppnå en utrymmeseffektiv representation. I en cacherad kan vi inpassa [256/20] = 12 hela 20 bitars-pekare. Genom att använda 21 + 1/3 cacherader kan vi lagra (21 + 1/3) - 12 = 256 pekare för att representera en Static Vector Node vid nivå 2 (se Figur 1). För att förbättra justeringsbetingelserna packar vi nivå 2-noder till- sammans i grupper om tre. Varje paket kräver (21 + 1/3) - 3 - 32 = 2048 konsekutiva byte för lagring som resulterar i en bytejustering av 2048/3 (2048 byte-block per paket för 3 noder).The 20-bit pointer used at level 2 is not so easy to adjust. However, since the only requirement for a vector node is that it is possible to index among the pointers and retrieve a pointer in memory access, we are able to use certain tricks to achieve a space-efficient representation. In a cached we can fit [256/20] = 12 whole 20 bit pointers. Using 21 + 1/3 cache rows, we can store (21 + 1/3) - 12 = 256 pointers to represent a Static Vector Node at level 2 (see Figure 1). To improve the adjustment conditions, we pack level 2 nodes together in groups of three. Each packet requires (21 + 1/3) - 3 - 32 = 2048 consecutive bytes for storage resulting in a byte adjustment of 2048/3 (2048 byte blocks per packet for 3 nodes).

Vi kan använda samma tillvägagångssätt för att representera nivå 3-noderna.We can use the same approach to represent the level 3 nodes.

Genom att använda 1 + 1/3 cacherader kan vi lagra (1 + 1/3) - 12 = 16 pekare för att representera en Static Vector Node vid nivå 3 såsom framgår av Figur 1. Justeringen förbättras på samma sätt såsom ovan, åter genom att packa noderna tillsammans i 10 15 20 25 30 «521 9o7 M grupper om 3. Vid denna nivå kräver varje paket (1 + 1/3) - 3 - 32 = 128 byte som resulterar i en bytejustering av 128/3.By using 1 + 1/3 cache rows we can store (1 + 1/3) - 12 = 16 pointers to represent a Static Vector Node at level 3 as shown in Figure 1. The adjustment is improved in the same way as above, again by to pack the nodes together in 10 15 20 25 30 «521 9o7 M groups of 3. At this level, each packet (1 + 1/3) requires - 3 - 32 = 128 bytes resulting in a byte adjustment of 128/3.

Vid den lägsta nivån, dvs nivå 4, måste pekarna i Static Vector Nodes repre- sentera nästa hopp-index. Därför behöver vi bara 18 bitars-pekare vid denna nivå. l en cacherad kan vi inpassa [256/18] = 14 hela 18 bitars-pekare. Genom att använda 1 + 1/7 cacherader kan vi representera (1 + 1/7) - 14 = 16 pekare som är nödvändiga för en fullständig nivå 4-nod. Vi packar noderna tillsammans l grupper om 7 för att uppnå bättrejustering. Varje paket upptar en minnesarea av (1 + 1/7) - 7 - 32 = 256 byte, vilket resulterar i en bytejustering av 256/7. 5.2.3 Dynamic Flat Tree Låt R = {R1, R2, R,.} vara mängden av områden och d1, d2, dn vara de associerade nästa hopp-index som utgör det aktuella underproblemet (2 s n < 29).At the lowest level, ie level 4, the pointers in Static Vector Nodes must represent the next jump index. Therefore, we only need 18-bit pointers at this level. In a cached we can fit [256/18] = 14 whole 18 bit pointers. By using 1 + 1/7 cache rows we can represent (1 + 1/7) - 14 = 16 pointers that are necessary for a complete level 4 node. We pack the nodes together in groups of 7 to achieve better adjustment. Each packet occupies a memory area of (1 + 1/7) - 7 - 32 = 256 bytes, resulting in a byte adjustment of 256/7. 5.2.3 Dynamic Flat Tree Let R = {R1, R2, R ,.} be the set of areas and d1, d2, dn be the associated next jump index that constitutes the current sub-problem (2 s n <29).

Låt dessutom r1, rg, r,,_1 vara den sorterade lista av områdesgränser som erhålls genom att ta /°-e|ementet från varje område i R. Genom denna konstruktion har vi att d1 associeras med 0..r1, d; associeras med r1 + 1..r2, och så vidare tills slutligen dn associeras med rm + 1..oo. Beakta åter att varje d,- är ett 18 bitars icke-negativt heltal och låt h,- och l,- vara de 2 mest signifikanta bitarna av d,- respektive de 16 minst signi- fikanta bitarna av d,-. Låt dessutom H = hihzuhnok, där k är det minsta antal nollor som behöver tillfogas för att få IH I E o(mod1s).In addition, let r1, rg, r ,, _ 1 be the sorted list of area boundaries obtained by taking the / ° element from each area in R. Through this construction we have that d1 is associated with 0..r1, d; associated with r1 + 1..r2, and so on until finally dn is associated with rm + 1..oo. Again, consider that each d, - is an 18-bit non-negative integer and let h, - and l, - be the 2 most significant bits of d, - and the 16 least significant bits of d, -, respectively. Also let H = hihzuhnok, where k is the minimum number of zeros that need to be added to get IH I E o (mod1s).

Efter att ha packat de höga 2 bitarna av nästa hopp-indexet och fyllt ut H med nollor består informationen vi behöver representera av n-l+n+ííl=2n-l+íí_\ 8 8 1521 907 ;:f1"f“í*“ä 15 l ~~ i 16 bitars-block. För att förbättra justeringsbetingelserna vill vi använda ett jämnt antal 16 bitars-block. Därför lägger vi till ett tomt block om 2n - 1 + ln/8l är udda. Vi får då totalt 2n-1+|Vg_\ 2. ___:_ 5 141607) = 2 16 bitars-block.After packing the high 2 bits of the next jump index and filling in H with zeros, the information we need to represent consists of n-l + n + ííl = 2n-l + íí_ \ 8 8 1521 907;: f1 "f“ í * “Ä 15 l ~~ in 16 bit blocks. To improve the adjustment conditions we want to use an even number of 16 bit blocks. Therefore we add an empty block if 2n - 1 + ln / 8l are odd. We then get a total 2n-1 + | Vg_ \ 2. ___: _ 5 141607) = 2 16 bit blocks.

Låt B1, Bg, BUN» beteckna informationsblocken och S1, S2,..., Suwm, beteckna de minnesslot som kommer att innehålla informationsblocken. För n = 16 10 har vi 2-16-l+[1~8§_u 2. *àí ul6(16)= 2 =34 15 =16+16+2.Let B1, Bg, BUN »denote the information blocks and S1, S2, ..., Suwm, denote the memory slots that will contain the information blocks. For n = 16 10 we have 2-16-l + [1 ~ 8§_u 2. * àí ul6 (16) = 2 = 34 15 = 16 + 16 + 2.

Eftersom 32 block motsvarar exakt 2 cacherader och 16 bitars-block är packade i par kan dessa 34 block inte fördelas över mer än 3 cacherader. Därav föl- jer att sökkostnaden är begränsad till 3 minnesaccesser oavsett hur vi lagrar infor- 20 mationsblocken i minnesslotten. Därför lagrar vi alltid B1 i S1, B; i S2,..., och BUN) i SU16(n) n S Förn = 17 har vi z-lv-llfífli .ii ui6(17)=2' 2 25 10 15 20 25 30 521 %o7 =36 =2+16+16+2.Since 32 blocks correspond to exactly 2 cache rows and 16 bit blocks are packed in pairs, these 34 blocks cannot be distributed over more than 3 cache rows. It follows that the search cost is limited to 3 memory accesses regardless of how we store the information blocks in the memory slots. Therefore we always store B1 in S1, B; in S2, ..., and BUN) in SU16 (n) n S Förn = 17 we have z-lv-llfí fl i .ii ui6 (17) = 2 '2 25 10 15 20 25 30 521% o7 = 36 = 2 + 16 + 16 + 2.

Om vi inte är uppmärksamma på lagringen av informationsblock i minnes- slotten och positionen för minnesslotten med avseende på cacheradsgränser kan informationen fördelas över 4 cacherader som resulterar i en sökkostnad av 4 min- nesaccesser.If we do not pay attention to the storage of information blocks in the memory slots and the position of the memory slots with respect to cache row boundaries, the information can be distributed over 4 cache rows which results in a search cost of 4 memory accesses.

Låt S, vara det första minnesslottet som är placerat i början av en cacherad.Let S, be the first memory castle placed at the beginning of a cached.

För n z 17 lagrar vi B1 i 8,. 82 i 8,41, Bg i 8,42, Bu16(,,)_(i-1) i Summ), Bu16(,,,-(.-2, i S1, Buæw)- (tg) i S2, och 81,160» i S,-.1.For n z 17 we store B1 in 8 ,. 82 i 8.41, Bg i 8.42, Bu16 (,,) _ (i-1) i Summ), Bu16 (,,, - (.- 2, i S1, Buæw) - (tg) i S2, and 81,160 »in S, -. 1.

Den faktiska informationen lagras slutligen i informationsblocken enligt föl- jande: o H lagras i B1...Br,,/81 o r1...r,,-1 lagras i Brn/81+1...Br,,/81+n-1 o l1...l,, lagras i Brn;81+,,...Br,,,81+2n_1 Genom att hämta den första cacheraden som innehåller B1...B16 kan vi extrahera de 2 mest signifikanta bitarna av det resulterande nästa hopp-indexet och även söka bland vid de första områdesgränserna. Vid den andra minnesaccessen fullbordar vi sökningen bland områdesgränserna i 811.832. Den tredje minnesac- cessen används för att extrahera de 16 minst signifikanta bitarna av det resulterande nästa hopp-indexet.The actual information is finally stored in the information blocks according to the following: o H is stored in B1 ... Br ,, / 81 o r1 ... r ,, - 1 is stored in Brn / 81 + 1 ... Br ,, / 81 + n-1 o l1 ... l ,, stored in Brn; 81 + ,, ... Br ,,, 81 + 2n_1 By retrieving the first cache row containing B1 ... B16 we can extract the 2 most significant the bits of the resulting next jump index and also search among at the first range boundaries. At the second memory access, we complete the search among the area boundaries in 811,832. The third memory access is used to extract the 16 least significant bits of the resulting next jump index.

I Figur 3 visar vi ett exempel på uppställningen av informationen med avse- ende på cacheradsgränser. Figuren illustrerar en Dynamic Flat Tree-underdata- struktur som innehåller 25 områden. Observera att de sista 16 minst signifikanta bitarna av de sista tre nästa hopp-indexen 123, 124 och /25 lagras i slutet av den första cacheraden. Sökningen kommer att starta genom att hämta den andra cacheraden som används. 5.2.4 Dynamic Layered Tree Dynamic Layered Tree består av två byggblock, löv och noder. Löv består av upp till 8 nästa hopp-index och upp till 7 områdesgränser som är packade i en cache- 10 15 20 25 30 521 907 17 rad och noder består av upp till 16 områdesgränser som är packade i en cacherad.In Figure 3, we show an example of the arrangement of the information with regard to cached boundary boundaries. The figure illustrates a Dynamic Flat Tree subdata structure that contains 25 areas. Note that the last 16 least significant bits of the last three next jump indices 123, 124 and / 25 are stored at the end of the first cache row. The search will start by retrieving the second cache row used. 5.2.4 Dynamic Layered Tree The Dynamic Layered Tree consists of two building blocks, leaves and nodes. Leaves consist of up to 8 next jump indices and up to 7 area boundaries packed in a cached row and nodes consist of up to 16 area boundaries packed in a cached one.

Figur 4 illustrerar Dynamic Layered Tree-lövet och kodningen av områdesgränser och nästa hopp-index i den övre delen av figuren, och den motsvarande noden som endast innehåller områdesgränser i den undre delen av figuren.Figure 4 illustrates the Dynamic Layered Tree leaf and the encoding of area boundaries and the next jump index in the upper part of the figure, and the corresponding node that contains only area boundaries in the lower part of the figure.

Låt r1, r2,..., r,,-1 vara en sorterad lista av områdesgränser och d1, d2,..., d" vara den motsvarande listan av nästa hopp-index. Såsom ovan associeras d,- med O..r1, d2 associeras med r1 + 1..r2, och så vidare tills slutligen d,, associeras med r,,-1 + 1..<>0.Let r1, r2, ..., r ,, - 1 be a sorted list of range boundaries and d1, d2, ..., d "be the corresponding list of the next jump index. As above, d, - is associated with O. .r1, d2 is associated with r1 + 1..r2, and so on until finally d ,, is associated with r ,, - 1 + 1 .. <> 0.

För n = 8 konstruerar vi ett träd helt enkelt genom att lagra områdesgrän- serna och nästa hopp-indexen i ett löv såsom visas i Figur 4.For n = 8, we construct a tree simply by storing the area boundaries and the next jump index in a leaf as shown in Figure 4.

För n = 136 = 17 - 8 består trädet av 17 löv, varvid vart och ett representerar 8 områden och 1 nod representerar 16 områdesgränser. Det första lövet innehåller r1,r2, ry och d1, d2,..., da, det andra lövet innehåller r9,r10,...,r15 och dg, d10,..., d16, och så vidare tills det sista lövet som innehåller r129, r130,..., r135 och dm, d130,..., dm.For n = 136 = 17 - 8, the tree consists of 17 leaves, each representing 8 areas and 1 node representing 16 area boundaries. The first leaf contains r1, r2, ry and d1, d2, ..., da, the second leaf contains r9, r10, ..., r15 and dg, d10, ..., d16, and so on until the last the leaf containing r129, r130, ..., r135 and dm, d130, ..., dm.

Det vill säga det izte lövet innehåller fair-nn, fa-(i-1)+2,---.fe»(i-1)+7 och ds-(i- 1)+1, ds-(f-1)+2,---.ds1(i-1)+s.That is, the izte leaf contains fair-nn, fa- (i-1) +2, ---. Fe »(i-1) +7 and ds- (i- 1) +1, ds- (f- 1) +2, ---. Ds1 (i-1) + s.

Noden innehåller rg, r16,..., r8,~,..., rm. Genom att söka noden vid 1 minnes- access kan vi fastställa i vilket löv sökningen ska fullbordas. Vi kan upprepa denna procedur för att hantera godtyckligt stora mängder av områden och nästa hopp- index. För varje nivå som läggs till ökar antalet områden som kan hanteras med en faktor 17. Följaktligen kan vi genom att använda t nivåer hantera 8 ,fört=1 DL T_num(t) = 17-DL T_num(t-1) , annars 10 15 20 25 30 i 521 90718 För t = 1, 2, 3 får vi storlekarna 8, 136 och 2312 för fullständiga träd med höjden 1, 2 respektive 3 träd. När n 2 202 kan vi tillåta oss att använda delvis fyllda cacherader på alla nivåer samtidigt. I vissa fall kommer vi emellertid att lagra ett löv direkt under en nivå 3-nod. Vid ankomsten till det lövet behöver vi ett sätt för att säga om det är en nod eller ett löv. Detta àstadkoms genom att lagra de första två områ- desgränserna i sjunkande ordning i ett löv (men inte i en nod), minnesväxla dem före sökning och minnesväxla dem tillbaka efter att sökningen fullbordats. Den extra kost- naden för denna kodning är försumbar. Storleken på ett fullständigt träd med t nivåer, mätt i antal cacherader, ges av 1 , för t = 1 DLT__size(t) = 1 + 17-DLT_size(t-1) , annars För n s 201 blir kostnaden för ofullständiga träd som resulterar i delvis fyllda cacherader alltför höga med avseende på antalet områden som hanteras. Når exem- pelvis n är i intervallet 137...201 används endast en enda 16 bitars-områdesgräns i nivå 3-noden. För att reducera kvantiseringseffekter kommer vi att försöka att lagra delvis fyllda noder och löv så kompakt som möjligt utan att introducera extra minnes- accesser för sökningen. Låt k = _”_ 2 11361 n2 =nmod 136 k» -lfål n1= ng mod 8 För 30 s n 5 201 är kg antalet fullständiga nivå 2-träd och m2 är antalet åter- stående områden efter att ha lagrat så många som möjligt i fullständiga nivå 2-träd.The node contains rg, r16, ..., r8, ~, ..., rm. By searching for the node at 1 memory access, we can determine in which leaf the search is to be completed. We can repeat this procedure to handle arbitrarily large amounts of areas and the next jump index. For each level that is added, the number of areas that can be handled increases by a factor of 17. Consequently, by using t levels, we can handle 8, för = 1 DL T_num (t) = 17-DL T_num (t-1), otherwise 10 15 20 25 30 i 521 90718 For t = 1, 2, 3 we get the sizes 8, 136 and 2312 for complete trees with a height of 1, 2 and 3 trees respectively. When n 2 202 we can afford to use partially filled cache rows at all levels simultaneously. In some cases, however, we will store a leaf directly below a level 3 node. Upon arrival at that leaf, we need a way to tell if it is a node or a leaf. This is accomplished by storing the first two area boundaries in descending order in a leaf (but not in a node), memorizing them before searching, and memorizing them back after the search is completed. The extra cost of this coding is negligible. The size of a complete tree with t levels, measured in number of cache rows, is given by 1, for t = 1 DLT__size (t) = 1 + 17-DLT_size (t-1), otherwise For ns 201 the cost of incomplete trees resulting in partially filled cache rows too high with respect to the number of areas handled. For example, when n is in the range 137 ... 201, only a single 16-bit area boundary is used in the level 3 node. To reduce quantization effects, we will try to store partially filled nodes and leaves as compact as possible without introducing extra memory accesses for the search. Let k = _ ”_ 2 11361 n2 = nmod 136 k» -lfål n1 = ng mod 8 For 30 sn 5 201 kg is the number of complete level 2 trees and m2 is the number of remaining areas after storing as many as possible in complete level 2 trees.

På liknande sätt är k1 antalet fullständiga nivå 1-träd och m, är antalet områden som återstår efter att ha lagrat så många som möjligt i fullständigs nivå 2- och nivå 1-träd.Similarly, k1 is the number of complete level 1 trees and m, is the number of areas remaining after storing as many as possible in complete level 2 and level 1 trees.

Om n > 136 behöver vi en partiell nivå 3-nod som består av exakt en områdesgräns.If n> 136, we need a partial level 3 node that consists of exactly one area boundary.

Dessutom behöver vi en partiell nivå 2-nod om n :f 136 och slutligen behöver vi ett 521 90719 :gjjftïi i partiellt nivå 1-löv om n1 i O. Det antal områdesgränser som vi behöver lagra i den partiella nivå 2-noden är lika med k1 - 1 om n1 = O och k1 annars. Genom att ta lag- ring av höga 2-bitar av nästa hopp-index, områdesgränser och låga 16-bitar av nästa hopp-index med i beräkningen, blir antalet 16 bitars-block som krävs för att lagra de 5 partiella löven u1(n) =1+n1 + (n1-1) = 2/71 = 2-(n2 mod 8) 10 = 2-((n mod 136)mod 8) Det totala antalet 16 bitars-block som krävs för att lagra de partiella noderna och det partiella lövet ges då av 15 u(n) = u1(n) + u2(n) + u3(n), där u1 (n) definieras såsom ovan, k1-1 , om n1 = 0 2Û U2(I'7) k1 , annars VÉJ-l, om ng mod 8 =0 _ nz , afïnafS 8 25 10 15 20 25 30 (521 907 20 f )@°š1_13i6-J-1,0m(n mod iaenmod s = o, = annars 8 I och k 0 ,om ns136 u3(n) = 1 , annars Vi kallar det partiella lövet och de partiella noderna för trädets huvud och det återstående fullständiga nivå 2-trädet och nivå 1 noder för trädets svans. Svansen består av 32 byte-block och lagras i en minnesarea som är avsedd för 32 byte-juste- rade strukturer. Huvudet å andra sidan består av tillräckligt många 8 byte-block för att lagra de u (n) 16 bitars-blocken och en 32-bitars pekare till svansen. Såsom visas i Figur 6, vilken visar ett huvud med u1 (n) = 12, u; (n) = 4, och u3 (n) = 1, lagras svanspekaren i det första 8 byte-blocket tillsammans med nivå 3-noden (L3). Efter- . som varje 8 byte-block innehålls fullständigt i en cacherad, krävs som mest 1 min- nesaccess för att söka huvudet vid nivå 3, vilket lämnar två minnesaccesser för att efter behov fullborda sökningen vid nivå 2 i svansen. Det största värdet av u2 (n) är 16 (fullständig nivå 2-nod). Detta innebär att nivå 2-noden som lagras i huvudet inte kan fördelas över mer än 2 cacherader. Den första delen av noden kommer att lagras i samma 8 byte-block (och därför även samma cacherad) som svanspekaren, vilket innebär att hänsyn redan har tagits till den första minnesaccessen. l den andra min- nesaccessen är vi garanterade att fullborda nivå 2-sökningen i huvudet, vilket lämnar den tredje och sista minnesaccessen för att fullborda sökningen i ett löv som lagrats i antingen huvudet eller svansen.In addition, we need a partial level 2 node of n: f 136 and finally we need a 521 90719: gjjftïi in partial level 1 leaf of n1 in 0. The number of area boundaries we need to store in the partial level 2 node is equal with k1 - 1 if n1 = 0 and k1 otherwise. By taking into account the storage of high 2-bits of the next jump index, area boundaries and low 16-bits of the next jump index, the number of 16-bit blocks required to store the 5 partial leaves u1 (n ) = 1 + n1 + (n1-1) = 2/71 = 2- (n2 mod 8) 10 = 2 - ((n mod 136) mod 8) The total number of 16-bit blocks required to store the partial the nodes and the partial leaf are then given by 15 u (n) = u1 (n) + u2 (n) + u3 (n), where u1 (n) is defined as above, k1-1, if n1 = 0 2Û U2 (I '7) k1, otherwise VÉJ-l, om ng mod 8 = 0 _ nz, afïnafS 8 25 10 15 20 25 30 (521 907 20 f) @ ° š1_13i6-J-1,0m (n mod iaenmod s = o, = otherwise 8 I and k 0, if ns136 u3 (n) = 1, otherwise We call the partial leaf and the partial nodes the head of the tree and the remaining complete level 2 tree and level 1 nodes for the tail of the tree. byte-blocks and stored in a memory area intended for 32 byte-adjusted structures, on the other hand the main consists of enough 8 byte-blocks to store d e u (n) 16-bit blocks and a 32-bit pointer to the tail. As shown in Figure 6, which shows a head with u1 (n) = 12, u; (n) = 4, and u3 (n) = 1, the tail pointer is stored in the first 8 byte block together with the level 3 node (L3). After-. as each 8 byte block is completely contained in a cached, a maximum of 1 memory access is required to search the head at level 3, leaving two memory accesses to complete the search at level 2 in the tail as needed. The largest value of u2 (n) is 16 (complete level 2 node). This means that the level 2 node stored in the header cannot be distributed over more than 2 cache rows. The first part of the node will be stored in the same 8 byte blocks (and therefore also the same cached) as the tail pointer, which means that the first memory access has already been taken into account. In the second memory access, we are guaranteed to complete the level 2 search in the head, leaving the third and final memory access to complete the search in a leaf stored in either the head or the tail.

Vid nivå 3 och 4 kan områdesdelmängder från samma delpopulation U,~ (för- sta partitioneringssteget) dela Dynamic Layered Tree så länge som antalet minnes- accesser för att fullborda sökningarna inte överstiger 2 respektive 1. Betrakta exem- pelvis de tre områdesmängderna R,-,,-1, R,-,,-2, och R,-,,~3,k där j1 < j; < j3, |R,-,,-1| = 87, |R,-,,-2| = 44, och lR/vfskl = 5. Dessa kan representeras med användning av en fullständig nivå 10 15 20 25 30 521 907 2-DLT efterslom det totala antalet områden är 87 + 44 + 5 = 136 och valet av j1, jg, och ja garanterar att representationen av R,-,,-3_k inte grenslar en cacheradsgräns. De pekare som refererar till delstrukturerna som representerar R,~,,~, och R,-,,-2 kommer att referera till det fullständiga nivå 2-trädet och pekaren som refererar till den delstruktur som representerar Riv-st kommer att referera till lövet hos det fullständiga 2-träd som innehåller R,-,,-3,k. 5.2.5 Static Flat Tree Ett Static Flat Tree används vid nivå 4 för att representera en sorterad lista av 4 bitars-områdesgränser n, r2,..., r,,_1 och den motsvarande listan av nästa hopp- index d1, d2..., d,,. Den används bara när n är lika med 9, 10 eller 11. Såsom ovan associeras d1 med O..r1, d; associeras med r1 + 1..r2, och så vidare tills slutligen dn associeras med r,,-1 + 1.00. Datastrukturen och sökningsmetoden är huvudsakligen desamma som ett Dynamic Layered Tree-löv, men med en skillnad. I stället för att lagra 7 16 bitars-områdesgränser och 8 nästa hopp-index lagrar vi 10 4 bitars-områ- desgränser och 11 nästa hopp-index (vi fyller trädet upp till 11 områden även om vi har 9). Det totala antalet nödvändiga bitarför detta är 10 - 4 + 11 -18 = 238. Figur 6 illustrerar ett Static Flat Tree som innehåller 11 områden med 8 oanvända bitar i R- arean och 10 i H-arean. 5.3 Komprimerad vidarebefordringstabells-sökning Fram till denna punkt har vi beskrivit hur man konverterar prefixmatchnings- problemet till ett områdesmatchningsproblem. Vi har även beskrivit alla de delar som krävs för att åstadkomma en utrymmeseffektiv representation av mängden av områ- den - en representation i vilken vi kan utföra områdesmatchningsoperationen vid fyra minnesaccesser, och därigenom åstadkomma en effektiv vidarebefordringstabellsre- presentation.At levels 3 and 4, area subsets from the same subpopulation U, ~ (first partitioning step) can share the Dynamic Layered Tree as long as the number of memory accesses to complete the searches does not exceed 2 and 1. Consider, for example, the three area sets R, - ,, - 1, R, - ,, - 2, and R, - ,, ~ 3, k where j1 <j; <j3, | R, - ,, - 1 | = 87, | R, - ,, - 2 | = 44, and lR / vfskl = 5. These can be represented using a complete level 10 15 20 25 30 521 907 2-DLT after the total number of areas is 87 + 44 + 5 = 136 and the choice of j1, jg, and yes guarantees that the representation of R, - ,, - 3_k does not cross a cached limit. The pointers referring to the substructures representing R, ~ ,, ~, and R of the complete 2-tree containing R, - ,, - 3, k. 5.2.5 Static Flat Tree A Static Flat Tree is used at level 4 to represent a sorted list of 4-bit range boundaries n, r2, ..., r ,, _ 1 and the corresponding list of the next jump index d1, d2. .., d ,,. It is used only when n is equal to 9, 10 or 11. As above, d1 is associated with O..r1, d; associated with r1 + 1..r2, and so on until finally dn is associated with r ,, - 1 + 1.00. The data structure and search method are essentially the same as a Dynamic Layered Tree leaf, but with a difference. Instead of storing 7 16-bit area boundaries and 8 next jump indexes, we store 10 4-bit area boundaries and 11 next jump indexes (we fill the tree up to 11 areas even if we have 9). The total number of bits required for this is 10 - 4 + 11 -18 = 238. Figure 6 illustrates a Static Flat Tree that contains 11 areas with 8 unused bits in the R-area and 10 in the H-area. 5.3 Compressed Forwarding Table Search Up to this point, we have described how to convert the prefix matching problem to an area matching problem. We have also described all the parts required to achieve a space-efficient representation of the set of areas - a representation in which we can perform the area matching operation with four memory accesses, and thereby achieve an efficient forwarding table representation.

I detta avsnitt beskriver vi sökprocedurerna i närmare detalj. 5.3.1 Huvudsökprocedur Huvudsökningens funktion representeras av Static Vector Node-sökningen SVN_lookup. Den accepterar två parametrar, |Pv4-adressen a och en pekare till datastrukturen T. Initialt refererar Ttill nivås 1 SVN som innehåller T0,..., Tgim (se 10 15 ~ 521 907 22 Figur 1). Vektorelementen är alla 32-bitars icke-negativa heltal så att indexera och hämta undernivåpekaren är okomplicerat. På rad 1...12 utförs den första nivåsök- ningen. Beroende på resultatet av kodningen av pekarvärdet, antingen fullbordas sökningen (rad 3) eller fortsätter genom att anropa en specialanpassad sökprocedur (rad 6, 8 eller 10). Om ingen av dessa är tillämpliga fortsätter sökningen med nästa nivås SVN (rad 13).In this section, we describe the search procedures in more detail. 5.3.1 Main search procedure The function of the main search is represented by the Static Vector Node search SVN_lookup. It accepts two parameters, | Pv4 address a and a pointer to the data structure T. Initially, T refers to level 1 SVN which contains T0, ..., Tgim (see 10 15 ~ 521 907 22 Figure 1). The vector elements are all 32-bit non-negative integers so indexing and retrieving the sublevel pointer is straightforward. In line 1 ... 12, the first level search is performed. Depending on the result of the coding of the pointer value, the search is either completed (line 3) or continues by calling a custom search procedure (line 6, 8 or 10). If none of these are applicable, the search continues with the next level SVN (line 13).

SVNJookup (T, a) T *~ Tujanniß] ifT[3l...24] :Othen return T[23. . .0] elsifT[31 . . .2-1] % 1 then irT[s1...2415 29 men retum DFTJookup (T É_23 . . ,T eisifrjm ...241 5 201 men return DLTJook-upï (T [23. . .Oj ,T[31 . _ . 24] , a [15 . . else mmm nLïzzookupflTjzs. . .oj ,a{1s...o]) end [a1...24j,aj15...oj) end T +- T[23. . .0] T *- Tausms] ifTIIQ. .. 8] :Othen return T[17 . . .U] elsifT [19 . . . 18j 96 1 then nun-n nLTivokupß (T [17 . . . o] .a [15 . _ .ojj end mrov-øp-r-u-r-flrflr-flv-flv-flv-w hHOGIW-QOELWßCnIKQBGEDOONCSCFnKBG-“Nfifl T ._- T [17 . . .oj T '- Taj-kaj afT|19 . _ . 18] = 0 men 22 rveturnT[17. ..0] 23 elsifT [19 _ . _18] yë 1 then 24 ifT[19...18]=2then 25 return DLTJookup3 (T (17. . . 0] ,a [15 . . . Oj) 26 else 27 return SFTJookup(T[17...0],a[15...O]) 28 end 29 end 30 Te-T[17...Û] 31 rffllfn T@js...o| 32 Den andra nivåns SVN-sökning startar på rad 14 genom att indexera till den vektor som representeras av Tsom innehåller pekare T0,..., T2a-1. Nivå 2-noder packas i grupper om tre. De 16 mest signifikanta bitarna av pekaren används för att adressera gruppen och de 2 minst signifikanta bitarna används för att lokalisera noden inom gruppen. Inom gruppen tillhör de första fyra pekarna i varje cacherad den första noden, nästa fyra pekare i varje cacherad tillhör den andra noden, och de sista fyra pekarna inom varje cacherad tillhör den tredje noden. De höga bitarna från adressen a[15...10] används för att lokalisera cacheraden, de 2 minst signifikanta bitarna från nodpekaren används för att lokalisera gruppen av fyra pekare inom 10 15 20 25 30 521 907 23 cacheraden, och de låga bitarna från adressen a[9 ...8] används för att indexera inom gruppen av pekare. Beroende på resultatet av kodningen av den hämtade pekaren, antingen avslutas sökningen (rad 16), fortsätter genom att anropa special- proceduren (rad 18) eller fortsätter med den nästa SVN-nivån (rad 20).SVNJookup (T, a) T * ~ Tujanniß] ifT [3l ... 24]: Othen return T [23. . .0] elsifT [31. . .2-1]% 1 then irT [s1 ... 2415 29 men retum DFTJookup (T É_23.., T eisifrjm ... 241 5 201 men return DLTJook-upï (T [23.. .Oj, T [31 . _. 24], a [15.. Else mmm nLïzzookup fl Tjzs. .Oj, a {1s ... o]) end [a1 ... 24j, aj15 ... oj) end T + - T [23. . .0] T * - Tausms] ifTIIQ. .. 8]: Othen return T [17. . .U] elsifT [19. . . 18j 96 1 then nun-n nLTivokupß (T [17... O] .a [15. _ .Ojj end mrov-øp-rur- fl r fl r- fl v- fl v- fl v-w hHOGIW-QOELWßCnIKQBGEDOONCSCFnKBG- “N fifl. - T [17.. .Oj T '- Taj-kaj afT | 19. _. 18] = 0 men 22 rveturnT [17. ..0] 23 elsifT [19 _. _18] yë 1 then 24 ifT [19. ..18] = 2then 25 return DLTJookup3 (T (17... 0], a [15... Oj) 26 else 27 return SFTJookup (T [17 ... 0], a [15 ... O] ) 28 end 29 end 30 Te-T [17 ... Û] 31 rf fl lfn T @ js ... o | 32 The second level SVN search starts on line 14 by indexing to the vector represented by Tsom containing pointer T0 , ..., T2a-1. Level 2 nodes are packed in groups of 3. The 16 most significant bits of the pointer are used to address the group and the 2 least significant bits are used to locate the node within the group. the four pointers in each cached belong to the first node, the next four pointers in each cached belong to the second node, and the last four pointers within each cached belong to the third node. the a [15 ... 10] is used to locate the cache row, the 2 least significant bits from the node pointer are used to locate the group of four pointers within the cache row, and the low bits from the address a [9 ... 8] is used to index within the group of pointers. Depending on the result of the coding of the retrieved pointer, either the search ends (line 16), continues by calling the special procedure (line 18) or continues with the next SVN level (line 20).

Vid inträdet i den tredje nivån av sökningen refererar Ttill en vektor som innehåller pekare T0,..., T24-1. Även nivå 3-noder packas i grupper om tre och pekarna översätts på samma sätt som vid nivå 2 för att hämta positionen för gruppen och noden inom gruppen. Indexeringen är huvudsakligen densamma. Vi använder de höga bitarna från adressen a[7...6] för att lokalisera cacheraden, och de 2 minst sig- nifikanta bitarna från nodpekaren för att lokalisera gruppen av fyra pekare inom cacheraden, och de låga bitarna från adressen a [5...4] används för att indexera inom gruppen av pekare. Efter att pekaren avkodats vet vi huruvida sökningen avslutats (rad 23) eller huruvida sökningen ska fortsätta i en specialanpassad procedur (rad 26 eller 28). Annars fortsätter sökningen vid den nästa och slutliga nivån - nivå 4.Upon entering the third level of the search, T refers to a vector containing pointers T0, ..., T24-1. Level 3 nodes are also packed in groups of three and the pointers are translated in the same way as at level 2 to retrieve the position of the group and the node within the group. The indexing is essentially the same. We use the high bits from address a [7 ... 6] to locate the cache row, and the 2 least significant bits from the node pointer to locate the group of four pointers within the cache row, and the low bits from address a [5. ..4] is used to index within the group of pointers. After the pointer is decoded, we know whether the search has ended (line 23) or whether the search should continue in a custom procedure (line 26 or 28). Otherwise, the search continues at the next and final level - level 4.

Vid nivå 4 refererar Ttill en vektor som innehåller nästa hoppen T0,..., TZM.At level 4, T refers to a vector that contains the next jump T0, ..., TZM.

Noderna packas tillsammans i grupper om 7. Därför används de 15 mest signifikanta bitarna av nodpekaren för att lokalisera gruppen och de 3 minst signifikanta bitarna används för att lokalisera noden inom gruppen. Vi använder samma typ av organisa- tion inom varje cacherad såsom ovan. Det vill säga de första två (i stället för fyra) pekarna tillhör den första gruppen, nästa två pekare tillhör den andra gruppen och så vidare tills de sista två pekarna som tillhör den sjunde gruppen. Följaktligen måste vi använda de höga adressbitarna a [3...1] för att lokalisera cacheraden, de lägsta tre pekarbitarna för att lokalisera gruppen av två nästa hopp-index inom cacheraden, och den lägsta adressbiten a [0] för att indexera inom gruppen för att hämta nästa hopp-indexet. 5.3.2 Indexsökning Nyckeloperationen i alla specialanpassade sökprocedurer (utom SVN_lookup) är en effektiv binär sökning som används för att beräkna index till vek- torer av nästa hopp-index. Givet en vektor med områdesgränser r0,..., r,,-1, som är sorterad i stigande ordning, och en adress a beräknar vi det minsta index i som upp- fyller a s r,-. Om inget sådant r,- finns är resultatet n. Genom hela proceduren utnyttjar vi i hög grad pekararitmetik, kombinerad med tolkning av booleska värden som numeriska värden, för att uppnå en procedur med ett minimum av villkorliga grenar. 10 15 20 25 i 521 907 24 Det vill säga för en pekare r som representerar adressen till det första elementet av vektorn kan vi skriva r,- som (r + DO. Dessutom kommer de booleska värdena falskt och sant att användas som 0 respektive 1 i beräkningar. inzßcarcfc (r, n, a) b +- r k a- Ugn] m <- r e~ -r + (n - m) - (1',,,_1 < a) while k, > 0 do k +- k - 1 rf-r-l-(rzr. end return (r - b) + (ro < lC®~1G5UIJA§âbJ>^ På raderna 1 till 3 registrerar vi adressen för det första elementet i b, beräk- nar golvet av bas 2-logaritmen av n och tilldelar det till k, och beräknar 2 upphöjt till k och tilldelar värdet till m. ldén är att snabbt fastställa om sökningen ska utföras bland de m första områdesgränserna eller bland de m sista områdesgränserna. När detta görs kan vi upprepat jämföra mittelementet och klippa en vektor med storleken 2* i halvor (minska k i varje steg) tills bara ett element återstår. Själva beslutet och eventuell modifiering av rutförs på rad 3. Om rm z a är det numeriska värdet av (rm-1 < a) 0 och rtilldelas sig själv (ingen modifiering). Annars flyttas startadressen av rn - m steg framåt. I vilket fall som helst utförs den återstående sökningen bland m = 2* element.The nodes are packed together in groups of 7. Therefore, the 15 most significant bits are used by the node pointer to locate the group and the 3 least significant bits are used to locate the node within the group. We use the same type of organization within each cached as above. That is, the first two (instead of four) pointers belong to the first group, the next two pointers belong to the second group, and so on until the last two pointers belong to the seventh group. Consequently, we must use the high address bits a [3 ... 1] to locate the cache row, the lowest three pointer bits to locate the group of the next two jump indexes within the cache row, and the lowest address bit a [0] to index within the group to retrieve the next jump index. 5.3.2 Index Search The key operation in all custom search procedures (except SVN_lookup) is an efficient binary search used to calculate the index to vectors of the next jump index. Given a vector with area boundaries r0, ..., r ,, - 1, which is sorted in ascending order, and an address a, we calculate the smallest index i that satisfies a s r, -. If no such r, - exists, the result is n. Throughout the procedure, we make extensive use of pointer arithmetic, combined with the interpretation of Boolean values as numeric values, to achieve a procedure with a minimum of conditional branches. 10 15 20 25 i 521 907 24 That is, for a pointer r representing the address of the first element of the vector, we can write r, - as (r + DO. In addition, the Boolean values false and true will be used as 0 and 1, respectively. in calculations. inzßcarcfc (r, n, a) b + - rk a- Oven] m <- re ~ -r + (n - m) - (1 ',,, _ 1 <a) while k,> 0 do k + - k - 1 rf-rl- (rzr. end return (r - b) + (ro <lC® ~ 1G5UIJA§âbJ> ^ On lines 1 to 3 we register the address of the first element ib, calculate the floor of base 2 logarithm of n and assigns it to k, and calculates 2 raised to k and assigns the value to m. repeatedly compare the center element and cut a vector with the size 2 * in halves (decrease ki each step) until only one element remains.The actual decision and possible modification of is plotted on row 3. If rm za is the numerical value of (rm-1 <a) 0 and r assigned to itself (no modification). Otherwise, the start address is moved by rn - m steps forward. In any case, the remaining search is performed among m = 2 * elements.

Frågenyckeln a jämförs upprepat med mittelementet och rmodifieras för att reflektera resultatet av jämförelserna tills endast ett element återstår (raderna 5...8).The query key a is repeatedly compared with the middle element and rmodified to reflect the result of the comparisons until only one element remains (lines 5 ... 8).

Slutligen beräknas skillnaden mellan positionen för det första elementet i den ursprungliga vektorn och det element som återstår och efter att ha adderat resultatet av jämförelsen med det sista elementet returneras resultatet (rad 9). 5.3.3 Dynamic Flat Tree-sökning Dynamic Flat Tree-strukturen lagras i en vektor av 16 bitars-minnesslot T1, T2,..., fin/ßpzmr Den faktiska organisationen av trädet beror på storleken och positio- nen Tav det första minnesslottet med avseende på cacheradsgränser. Om n s 16 eller det första minnesslottet är placerat vid början av en cacherad organiseras trädet enligt följande: H = h1,..., h,, lagras i Tynrn/ßj, r1,..., r,,.1 lagras i Trn,81.1___r,,,3j+,,_1, och 10 15 20 25 521 907 ü l1,...,l,, lagras i 7j,,,81+,,_>_r,,,81+2,,-1. Proceduren startar genom att beräkna cacherads- gränsens förskjutning q (rad 1). Beroende på värdet på n och q (q = O innebär att det första minnesslottet är placerat vid början av en cacherad) är sökningen antingen fullbordad på rad 3 och 4 eller fortsätter med de mer komplexa fallen på rad 6. På rad 3 beräknas indexet (0...n - 1) av nästa hopp-indexet med användning av ix_search, och på rad 4 ställs det resulterande nästa hopp-indexet samman (och returneras) genom att foga hm = Tjf/gj [i mod 8...(i mod 8) + 1] till l,»,1 = Fri/sync; DI-“TJookup(T, n, a) q i- (16 - (Tmod 16)) mod 16 1 il'(n5l6)V(q=0)then 2 i i-ianshcarzrrfi KTH-HH., ...IiT[%1+n;> 41) i return Thí (1111od8...(uno 8) + 1] [ghflh- 5 end :Ii- ínsearclllz (<'Tq+[R-i+1. . . . ,Tq+[g-|_j_n_l> m) (Gi ' -¿< n. - qi en returnTuj {i1nod8...(ímod8)+1]Tk-,H+fl+¿ ä end retum T! å' [i mod8 . _ . (imod 8) + 1]T,-_H,_,,,+1 9 l de mer komplexa fallen (n > 16 och q i O) organiseras trädet enligt följande: H = h1,..., h,, lagras in Tq+1...q+lnia1, r1,..., r,,-1 lagras i Tq+rn/a1+1__iq+rn/51+n-1, I1,...,l,,_q lagras l Tq+in/a1+n...2n-1+r,,/ßj, och /,,.q+1,...,l,, lagras i Timq. Beräkning av indexet (rad 6) är huvud- sakligen densamma såsom ovan utom med avseende på cacheradsgränsens för- skjutning. Om de låga 16 bitarna från det resulterande nästa hopp-indexet placeras vid änden av den upptagna minnesarean (i < n -q), är hämtningen och sammanställ- ningen av bitarna okomplicerad (rad 7). Annars placeras de låga 16 bitarna från det resulterande nästa hopp-indexet vid början av minnesarean. Hämtning och samman- ställning utförs slutligen på rad 9. 5.3.4 Dynamic Layered Tree-sökning Vi särskiljer mellan två huvudtyper av Dynamic Layered Tree-sökning. Den okomplicerade versionen DLT_lookup2'3 (två undertyper inom denna huvudtyp) används antingen när trädet är fullständig eller när storleken är tillräckligt stor för att tillåta oss att bortse från kvantiseringseffekter. När träden är små är det nödvändigt att ta hänsyn till kvantiseringseffekter. Såsom beskrivs i Avsnitt 4 kräver detta en mer komplex representation och behov av en motsvarande sökprocedur - DLT_lookup'. 10 15 20 521 907 26 DLT_lookup1-proceduren accepterar tre argument: T, n, och a, där T repre- senterar huvudet av trädstrukturen som lagrats i en vektor av 16 bitars-minnesslot T1, T2,.., och n och a är storleken respektive frågeadressen (minst signifikanta 16 bitar av den ursprungliga adressen). På rad 1 extraherar vi pekaren till trädets svans och tilldelar värdet till tför senare användning. Eftersom startpunkten av svansen är 32 byte-justerad är tfaktiskt ett index till cacherad. Detta följs genom att initiera en för- skjutningsvariabel o till 0 (rad 2). Om [n/136] > 1 såsom testas på rad 3 innehåller huvudet en partiell nivå 3 (L3) -nod. Eftersom n s 201 < 2 - 136 vet vi att den partiella L3-noden innehåller exakt en områdesgräns som lagrats i Tg. Om a s T3 anropas den okomplicerade sökproceduren på rad 5 för att avsluta sökningen i det fullständiga L2- delträd som lagrats i början av svansen och refereras till genom t. Annars överhop- pas det fullständiga L2-trädet genom att addera dess storlek till t(rad 7) och förskjut- ningen o ökas med storleken (dvs 1) av den partiella L3-noden (rad 8). På rad 10 beräknas storleken n; (antal områdesgränser) av den partiella L2-noden, följt av indexsökningen (rad 11).Finally, the difference between the position of the first element in the original vector and the remaining element is calculated, and after adding the result of the comparison with the last element, the result is returned (line 9). 5.3.3 Dynamic Flat Tree Search The Dynamic Flat Tree structure is stored in a vector of 16-bit memory slots T1, T2, ..., fi n / ßpzmr The actual organization of the tree depends on the size and position of the first memory slot with with respect to cached limit. If ns 16 or the first memory castle is located at the beginning of a cached, the tree is organized as follows: H = h1, ..., h ,, stored in Tynrn / ßj, r1, ..., r ,, .1 stored in Trn , 81.1 ___ r ,,, 3j + ,, _ 1, och 10 15 20 25 521 907 ü l1, ..., l ,, lagras i 7j ,,, 81 + ,, _> _ r ,,, 81 + 2 ,, - 1. The procedure starts by calculating the cached boundary offset q (line 1). Depending on the value of n and q (q = 0 means that the first memory slot is located at the beginning of a cached), the search is either completed on lines 3 and 4 or continues with the more complex cases on line 6. On line 3, the index is calculated ( 0 ... n - 1) of the next jump index using ix_search, and in line 4 the resulting next jump index is compiled (and returned) by adding hm = Tjf / gj [in mod 8 ... ( in mode 8) + 1] to l, », 1 = Free / sync; DI- “TJookup (T, n, a) q i- (16 - (Tmod 16)) mod 16 1 il '(n5l6) V (q = 0) then 2 i i-ianshcarzrrfi KTH-HH., ... IiT [% 1 + n;> 41) i return Thí (1111od8 ... (uno 8) + 1] [gh fl h- 5 end: Ii- ínsearclllz (<'Tq + [R-i + 1...., Tq + [g- | _j_n_l> m) (Gi '-¿ <n. - qi en returnTuj {i1nod8 ... (ímod8) +1] Tk-, H + fl + ¿ä end retum T! å' [i mod8. _. (against 8) + 1] T, -_ H, _ ,,, + 1 9 In the more complex cases (n> 16 and qi O) the tree is organized as follows: H = h1, ..., h ,, lagras in Tq + 1 ... q + lnia1, r1, ..., r ,, - 1 lagras i Tq + rn / a1 + 1__iq + rn / 51 + n-1, I1, ..., l ,, _q is stored in Tq + in / a1 + n ... 2n-1 + r ,, / ßj, and /,,.q+1,...,, ,, is stored in Timq. Calculation of the index (line 6) If the low 16 bits from the resulting next jump index are placed at the end of the occupied memory area (i <n -q), the retrieval and compilation of bits uncomplicated (row 7), otherwise the low 16 bits from the resulting next jump index are placed at the beginning an av minnesarean. Retrieval and compilation are finally performed on line 9. 5.3.4 Dynamic Layered Tree Search We distinguish between two main types of Dynamic Layered Tree Search. The uncomplicated version DLT_lookup2'3 (two subtypes within this main type) is used either when the tree is complete or when the size is large enough to allow us to ignore quantization effects. When the trees are small, it is necessary to take into account quantization effects. As described in Section 4, this requires a more complex representation and need for a corresponding search procedure - DLT_lookup '. The DLT_lookup1 procedure accepts three arguments: T, n, and a, where T represents the head of the tree structure stored in a vector of 16-bit memory slots T1, T2, .., and n and a are the size and query address, respectively (at least significant 16 bits of the original address). In row 1, we extract the pointer to the tail of the tree and assign the value for later use. Since the starting point of the tail is 32 byte-adjusted, it is in fact an index to cached. This is followed by initiating an offset variable o to 0 (line 2). If [n / 136]> 1 as tested on line 3, the header contains a partial level 3 (L3) node. Since n s 201 <2 - 136 we know that the partial L3 node contains exactly one area boundary stored in Tg. If as T3, the uncomplicated search procedure is called on row 5 to end the search in the complete L2 subtree stored at the beginning of the tail and referenced by t. Otherwise, the complete L2 tree is skipped by adding its size to t (row 7) and the offset o is increased by the size (ie 1) of the partial L3 node (row 8). In row 10, the size n is calculated; (number of area boundaries) of the partial L2 node, followed by the index search (row 11).

DLTJOokrLpI (T, n, a) return DLTlookupz-s (t + i._1. a) end m 4- (n mod 136) mod 8 i ""” 1ï5-å3aTd1-( return T2+°+,,,_,+2..,¿ [i mod 8. . . (i mod 8) + 1] Tg+o+m+fllj4 C *- T1...2 1 o «- 0 2 ir (fä) >1men 3 ifa 5 T; then 4 return DLT_look-u.p2-3 (t, 2, a) 5 end 5 t +- t + 1 + 17 7 0 o- 0 + 1 8 end 9 112 <- - 1 10 1'- +- íaza-:earch ((T2+,+1. . . . ,T2+,,+,,,) mg, a) 11 ifi < n; then 12 13 d 14 15 16 17 Om i< ng fortsätter sökningen genom att söka i det (i + 1):te fullständiga L1- trädet som lagrats i svansen vid t+ i (rad 13). Annars fullbordas sökningen genom att söka det partiella L1-trädet (lövet) som lagrats i huvudet. Detta åstadkoms enligt föl- jande. Först beräknas storleken m av det partiella L1-trädet (rad 15). Områdesgrän- serna r1,..., fw lagras i T2+0+n2+1,..., T1+0+,,.2.,,,,, de låga bitarna av nästa hopp-indexet l1,..., ln, lagras i T1+0+n2+,,,+1,..., T1+°+n2+2nv och de höga bitarna av nästa hopp-indexet 10 15 20 25 i 521 907 h1,..., hk1 lagras i T2+0+n2+2,,,. Det återstår att utföra indexsökningen (rad 16) och extrahera och sammanställa nästa hopp-indexet (rad 17).DLTJOokrLpI (T, n, a) return DLTlookupz-s (t + i._1. A) end m 4- (n mod 136) mod 8 i "" ”1ï5-å3aTd1- (return T2 + ° + ,,, _, +2 .., ¿[i mod 8... (I mod 8) + 1] Tg + o + m + fl lj4 C * - T1 ... 2 1 o «- 0 2 ir (fä)> 1men 3 ifa 5 T; then 4 return DLT_look-u.p2-3 (t, 2, a) 5 end 5 t + - t + 1 + 17 7 0 o- 0 + 1 8 end 9 112 <- - 1 10 1'- + - íaza-: earch ((T2 +, + 1...., T2 + ,, + ,,,) mg, a) 11 ifi <n; then 12 13 d 14 15 16 17 If i <ng the search continues by search in the (i + 1): th complete L1 tree stored in the tail at t + i (row 13), otherwise the search is completed by searching for the partial L1 tree (leaf) stored in the head. First, the size m of the partial L1 tree is calculated (row 15) The area boundaries r1, ..., fw are stored in T2 + 0 + n2 + 1, ..., T1 + 0 + ,,. 2. ,,,,, the low bits of the next jump index l1, ..., ln, are stored in T1 + 0 + n2 + ,,, + 1, ..., T1 + ° + n2 + 2nv and the high bits of the next the jump index 10 15 20 25 in 521 907 h1, ..., hk1 is stored in T2 + 0 + n2 + 2 ,,,. It remains to perform the index search (line 16) and extract and compile the next jump index (line 17).

Den okomplicerade sökningen DLT_lookup2*3 (nedan) är något enklare. Den accepterar tre argument: Tsom refererar till en vektor av 16 bitars-minnesslot T1,..., T16, nivån t, och frågenyckeln a. Oberoende av värdet på tkan trädet som refereras till av Tantingen vara en nod eller ett löv. Icke desto mindre finns det 7 områdes- gränser r1,..., ry som lagrats i T1,..., Ty. En nod den innehåller 16 områdesgränser r1,..., mf,- som lagrats i T1,..., T16. De första två områdesgränserna hos en nod lagras i sorterad ordning. Detta testas på rad 1 vilket följs av genomförande av en indexsök- ning. Därefter, anropas DLT_lookup2'3 rekursivt för att söka nästa nivås delträd som lagrats vid T+ 1 + i - DLT_size (t) (se rad 2...3 och definitionen av DLT_size i Avsnitt 4).The uncomplicated search DLT_lookup2 * 3 (below) is slightly easier. It accepts three arguments: T which refers to a vector of 16-bit memory slots T1, ..., T16, level t, and the query key a. Regardless of the value of t, the tree referenced by Tantingen may be a node or a leaf. Nevertheless, there are 7 area boundaries r1, ..., ry stored in T1, ..., Ty. A node it contains 16 area boundaries r1, ..., mf, - stored in T1, ..., T16. The first two area boundaries of a node are stored in sorted order. This is tested on line 1, which is followed by the implementation of an index search. Then, DLT_lookup2'3 is called recursively to search for the next level sub-tree stored at T + 1 + i - DLT_size (t) (see lines 2 ... 3 and the definition of DLT_size in Section 4).

DLTJooIc1r;r2'3(T, t, a) if T1 < Tg then i f- i:c_.~:ea'rcfr ((T1, . . . _.T15) ,16_.a) return DLTlookupg-a (T + 1 + “i - DLT_size ,t - 1. a.) end O: -F-Cèwv-l i +- ím-Jcarch (T,,T1.T3.. .,T,),1,«.DLTJooIc1r; r2'3 (T, t, a) if T1 <Tg then i f- i: c_. ~: Ea'rcfr ((T1,... _.T15), 16_.a) return DLTlookupg-a ( T + 1 + “i - DLT_size, t - 1. a.) End O: -F-Cèwv-l i + - ím-Jcarch (T ,, T1.T3 ..., T,), 1,«.

SS; T; and T; an: mappa! return Tm [i mod 8 . . . (i mod 8) + 11Tg+,- Ett löv det organiseras enligt följande: områdesgränserna r1,..., r; lagras i T1,..., Ty, låga bitar från nästa hopp-index l1,..., /8 lagras i T8,..., T15, och de höga bitarna från nästa hopp-index h1,..., hg lagras i T16. Sökning av lövet åstadkoms enkelt genom att först minnesväxla de två första områdesgränserna, utföra en index- sökning för att beräkna i och därefter minnesväxla tillbaka de första två områdes- gränserna (rad 5). Det sista steget är att sammanställa bitarna från nästa hopp- indexet och returnera resultatet. 5.3.5 Static Flat Tree-sökning Ett Static Flat Tree (SFT) är mycket likartad ett Dynamic Layered Tree-löv.SS; T; and T; an: mappa! return Tm [i mod 8. . . (in mod 8) + 11Tg +, - A leaf it is organized as follows: area boundaries r1, ..., r; stored in T1, ..., Ty, low bits from the next jump index l1, ..., / 8 are stored in T8, ..., T15, and the high bits from the next jump index h1, ..., hg is stored in T16. Searching for the leaf is accomplished simply by first memorizing the first two area boundaries, performing an index search to calculate in, and then memorizing back the first two area boundaries (row 5). The last step is to compile the bits from the next jump index and return the result. 5.3.5 Static Flat Tree Search A Static Flat Tree (SFT) is very similar to a Dynamic Layered Tree leaf.

Den första skillnaden är att storleken på områdesgränserna är 4 bitar i SFT jämfört med 16 i DLT. Detta fordrar en speciell version ix_search4 för att söka 4 bitars-områ- desgränserna. Den andra skillnaden är antalet områdesgränser som är 10 i SFT 10 15 20 25 30 521 907 28 jämfört med 7 i DLT. Trädet består av en vektor av 16 bitars-minnesslot T1,..., T16 som organiseras enligt följande: 4 bitars-områdesgränser r1,..., rm lagras i T1...3, de låga 16 bitarna av nästa hopp-indexet l1,..., /11 lagras i T4,..., TM, och de höga 2 bitarna av nästa hopp-indexet lagras i T15...T16.The first difference is that the size of the area boundaries is 4 bits in SFT compared to 16 in DLT. This requires a special version ix_search4 to search the 4-bit range boundaries. The second difference is the number of area boundaries which is 10 in SFT 10 15 20 25 30 521 907 28 compared to 7 in DLT. The tree consists of a vector of 16-bit memory slots T1, ..., T16 which are organized as follows: 4-bit area boundaries r1, ..., rm are stored in T1 ... 3, the low 16 bits of the next jump index l1, ..., / 11 are stored in T4, ..., TM, and the high 2 bits of the next jump index are stored in T15 ... T16.

SFTlookup(T, n, a) i«-iz_search4((T1[3...0],...,¶É;[7...4]),1O,a) 1 return TI å I [i1norí8. . . (i mod 8) + 1] TW 2 Liksom i DLT-löv åstadkoms sökning genom att utföra en indexsökning (rad 1). Den fullständiga vektorn av 4 bitars-områdesgränser ges av r2[7...41,T2[11...sinne..12],T3[s...o1, r3[7...41.SFTlookup (T, n, a) i «-iz_search4 ((T1 [3 ... 0], ..., ¶É; [7 ... 4]), 1O, a) 1 return TI å I [i1norí8 . . . (in mode 8) + 1] TW 2 As in DLT leaves, search is accomplished by performing an index search (line 1). The complete vector of 4-bit range boundaries is given by r2 [7 ... 41, T2 [11 ... mind..12], T3 [s ... o1, r3 [7 ... 41.

Detta följs av att hämta och sammanställa nästa hopp-indexet och returnera resultatet (rad 2). 5.4 Routersystemarkitektur Figur 7 är ett schematiskt blockdiagram av en routersystemarkitektur som valts såsom ett exempel. Det finns tre autonoma processer: Vägvalsprocessen, Kon- struktörsprocessen och Vidarebefordringprocessen, och tre datastrukturer: Vägvals- tabellen, Vidarebefordringstabellen och Nästa hopp-tabellen.This is followed by retrieving and compiling the next jump index and returning the result (line 2). 5.4 Router system architecture Figure 7 is a schematic block diagram of a router system architecture selected as an example. There are three autonomous processes: the Road Selection Process, the Constructor Process and the Forwarding Process, and three data structures: the Road Selection Table, the Forwarding Table and the Next Jump Table.

Alla datagram som kommer in i och lämnar systemet hanteras av Vidarebe- fordrlngprocessen. Den grundläggande funktionen är att motta ett paket (fp 1), söka nästa hopp-indexet i vidarebefordringstabellen med användning av SVN__lookup (T, a) där T är vidarebefordringstabellen och a är destinationsadressen (fp2), hämta nästa hopp-informationen från nästa hopp-tabellen (fp3), och vidarebefordra paketet enligt nästa hopp-informationen (fp4).All datagrams that enter and leave the system are handled by the Forwarding process. The basic function is to receive a packet (fp 1), search for the next jump index in the forwarding table using SVN__lookup (T, a) where T is the forwarding table and a is the destination address (fp2), retrieve the next jump information from the next jump table (fp3), and forward the packet according to the next jump information (fp4).

Vägvalsprocessen, eller Routing Protocol Daemon, är en process som kom- municerar med andra system i routerns omgivning med användning av ett vägvals- protokoll för att få reda på förändringar i nätverkstopologi och för att uppdatera väg- valstabellen för att rymma sådana förändringar. Ett exempel på en vägvalsprocess, eller mer exakt en dataprogramsprodukt som definierar vägvalsprocessen, är Gate 10 15 20 25 30 521 907 29 Daemon (gateD) som kan skaffas från www . gated. org. Olika vägvalsprotokoll arbetar på olika sätt och använder olika optšmeringskriterier för att bestämma vilken som är den mest effektiva vägen genom nätverket och därigenom bestämma vilka uppdateringar som ska utföras i vägvaltabellen. Den grundläggande funktionen hos alla routerprocesser är emellertid att detektera eller få reda på nätverkstopologiför- ändringar genom att kommunicera enligt vägvalsprotokollet (rpl), uppdatera väg- valstabellen för att rymma dessa förändringar (rp2), och informera grannarna (väg- valsprocesserna) om topologiförändringar (rp3).The Routing Protocol Daemon is a process that communicates with other systems in the router's environment using a routing protocol to find out changes in network topology and to update the routing table to accommodate such changes. An example of a routing process, or more precisely a computer software product that defines the routing process, is Gate 10 15 20 25 30 521 907 29 Daemon (gateD) which can be obtained from www. gated. org. Different routing protocols work in different ways and use different optimization criteria to determine which is the most efficient path through the network and thereby determine which updates to perform in the routing table. However, the basic function of all router processes is to detect or find out network topology changes by communicating according to the routing protocol (rpl), updating the routing table to accommodate these changes (rp2), and informing the neighbors (routing processes) of topology changes ( rp3).

I motsatts till den dynamiska vägvalstabellen är den halvstatiska vidarebe- fordringstabellen inte utformad att bli direkt manipulerad genom vägvalsprocessen.In contrast to the dynamic route selection table, the semi-static forwarding table is not designed to be directly manipulated through the route selection process.

Dynamisk och statisk refererar här till beräkningskomplexiteten för att utföra tabelluppdateringar - dynamisk betyder lätt och statisk betyder att den fullständiga tabellen måste byggas om. Modifieringar av vägvalstabellen sprider sig till modifie- ringar av vidarebefordringstabellen på ett kontrollerat sätt genom funktionerna hos en Konstruktörsprocess. Det finns flera sätt att planera omkonstruktioner eller partiella omkonstruktioner av vidarebefordringstabellen och en allmänt använd metod är att skjuta upp nästa omkonstruktion något efter att en vägvalstabelluppdatering har detekterats. Exempelvis kan konstruktörsprocessen ackumulera alla förändringar i vägvalstabellen under en förutbestämd tidsperiod innan omkonstruktionen exekve- ras. På detta vis kan en skur av vägvalstabellsmodifieringar (vilket inte är ovanligt) hanteras genom en enda vidarebefordringstabellsomkonstruktion (eller uppdatering).Dynamic and static here refer to the computational complexity of performing table updates - dynamic means easy and static means that the complete table needs to be rebuilt. Modifications to the routing table spread to modifications of the forwarding table in a controlled manner through the functions of a Constructor process. There are several ways to plan redesigns or partial redesigns of the forwarding table and a commonly used method is to postpone the next redesign slightly after a route selection table update has been detected. For example, the design process can accumulate all changes in the path selection table for a predetermined period of time before the redesign is executed. In this way, a burst of routing table modifications (which is not uncommon) can be handled by a single forwarding table redesign (or update).

Den grundläggande funktionen hos Konstruktörsprocessen är att vänta tills en väg- valstabellsuppdatering sker (bpl), hämta områdesgränserna och nästa hopp- indexen med användning av den generella metod som beskrivits i Avsnitt 2 (bp2), eller en effektivare metod som optimerats för den vägvalstabellsrepresentation som används, och bygga om vidarebefordrlngstabellen enligt representationen som beskrivits i Avsnitt 5.2 (bp 3). 5.5 Små vägvals- och vidarebefordringstabeller Ett enkel och okomplicerat sätt att representera vägvalstabellen är att lagra adressprefix tillsammans med nästa hopp-index i poster som är länkade till varandra i en skiktad trädliknande struktur såsom visas i Figur 7. Varje post har en pekare till nästa post till höger (om sådan finns) och till den första barnposten (om sådan finns). 5 10 521 907 30 Poster på samma nivå lagras i sorterad ordning med avseende på den minsta adress som matchar postens prefix (dvs startpunkten av området som utgörs av prefixet).The basic function of the Constructor process is to wait until a route selection table update occurs (bpl), retrieve the area boundaries and the next jump index using the general method described in Section 2 (bp2), or a more efficient method optimized for the route selection table representation used, and rebuild the forwarding table according to the representation described in Section 5.2 (bp 3). 5.5 Small routing and forwarding tables A simple and uncomplicated way to represent the routing table is to store the address prefix together with the next jump index in records that are linked to each other in a layered tree-like structure as shown in Figure 7. Each record has a pointer to the next record to the right (if any) and to the first child record (if any). 5 10 521 907 30 Records at the same level are stored in sorted order with respect to the smallest address that matches the record's prefix (ie the starting point of the area that consists of the prefix).

Poster med prefix som är delmängder av prefixet av en given post lagras i nivåer under den givna posten. Den detaljerade informationen som lagrats i de vägvalsta- bellsposter som visas i Figur 7 visas i tabellen nedan. i p; (winar _ representation) pro pm Nästa hopp-index 1 * 0 4294967295 1 2 oooo* 0 268435455 9 3 oooooooooooooooooooooololoonolo 666 666 16 4 0000001100* 50331648 54525951 7 5 0o1ooo1oo1o11o1oo0011100001* 576330784 576330815 15 6 011111011010100111* 2108276736 2108293119 12 7 1* 2147483648 4294967295 4 8 100* 2147483648 2684354559 10 9 1o1oo11o1o111o11oo* 2797273088 2797289471 3 10 101101111101000001* 3083878400 3083894783 5 11 11ooo1ooo11oo1101* 3295051776 3295084543 14 12 1100100001110106110111010* 3363101952 3363102079 6 13 1111ooo1o11o0100* 4049862656 4049928191 2 14 11116010111000010* 4074831872 4074864639 13 15 1111010111111001011010111111* 4126764016 4126764031 8 16 111111o11o11oo11o11o1* 4256393216 4256395263 11 l detta exempel resulterar resultatet av att genomlöpa vägvalstabellen och beräkna den intermediära områdespartitionsrepresentation i följande. 1.10 rår-s 0 665 666 666 667 50331647 50331648 54525951 54525952 268435455 268435456 576330783 576330784 576330815 576330816 2108276735 2108276736 2108293119 2108293120 2147483647 2147483648 2684354559 2684354560 2797273087 2797273088 2797289471 2797289472 3083878399 3083878400 3083894783 3083894784 3295051775 3295051776 3295084543 3295084544 3363101951 3363101952 3363102079 3363102080 4049862655 4049862656 4049928191 4049928192 4074831871 4074831872 4074864639 4074864640 4126764015 4126764016 4126764031 4126764032 4256393215 4256393216 4256395263 4256395264 4294967295 Náflahoppdndex Ntxäwlsäwßähäwtsâb-flv-»ø-flr-øv-v-»a-øv-flr-ßv-fl M~JOJUI|ÄCANWC©OONOICXIÄCÅN>F-*@!$0C~1S§Cfi~$-C~ätOI-^ s. i»- >- i-I r-ß »- r-n u-n ßÄHàUJ-ÄOO-ÄN-S-Ot-ß-ßßšflràšåß-Ov-'MI-'fflfi 10 15 20 521 907 För att representera detta i en vidarebefordringstabell använder vi en speciell typ av Dynamic Layered Tree som är lämplig för mindre vägvalstabeller. Principen är exakt densamma som för reguljära DLT men i stället för att använda 16 bitars-områ- desgränser använder vi 32-bitars-områdesgränser. Dessutom är antalet bitar som används för att representera nästa hopp-index reducerat till 16. I denna datastruktur som vi kallar 32-bitars Dynamic Layered Tree består en nod av 8 områdesgränser i stället för 16 och ett löv innehåller 5 områdesgränser och 6 nästa hopp-index i stället för 7 respektive 8. Detta innebär att vi kan representera upp till 6 * 9 * 9 * 9 = 4374 områden eller 2187 vägar med användning av denna teknik utan att överstiga utformningsbegränsningen på 4 minnesaccesser. I denna konfiguration är den största mängd minne som krävs för att representera 2187 vägar 32+9-(32+9-(32+9-32))=26240byte.Items with prefixes that are subsets of the price of a given record are stored in levels below the given record. The detailed information stored in the route table entries shown in Figure 7 is shown in the table below. i p; (winar _ representation) pro pm Next jump-index 1 * 0 4294967295 1 2 oooo * 0 268435455 9 3 oooooooooooooooooooooolooloonolo 666 666 16 4 0000001100 * 50331648 54525951 7 5 0o1ooo1oo1o11o1oo0011100001 * 5763108101 216118101 4 8 100 * 2147483648 2684354559 10 9 1o1oo11o1o111o11oo * 2797273088 2797289471 3 10 101101111101000001 * 3083878400 3083894783 5 11 11ooo1ooo11oo1101 * 3295051776 3295084543 14 12 1100100001110106110111010 * 3363101952 3363102079 6 13 1111ooo1o11o0100 * 4049862656 4049928191 2 14 11116010111000010 * 4074831872 4074864639 13 15 1111010111111001011010111111 * 4126764016 4126764031 8 16 111111o11o11oo11o11o1 * 4256393216 4256395263 11 In this example, the result results by going through the path selection table and calculating the intermediate area partition representation in the following. 10.1 RAR's 0 665 666 666 667 50331647 50331648 54525951 54525952 268435455 268435456 576330783 576330784 576330815 576330816 2108276735 2108276736 2108293119 2108293120 2147483647 2147483648 2684354559 2684354560 2797273087 2797273088 2797289471 2797289472 3083878399 3083878400 3083894783 3083894784 3295051775 3295051776 3295084543 3295084544 3363101951 3363101952 3363102079 3363102080 4049862655 4049862656 4049928191 4049928192 4074831871 4074831872 4074864639 4074864640 4126764015 4126764016 4126764031 4126764032 4256393215 4256393216 4256395263 4256395264 4294967295 Na al ahoppdndex Ntxäwlsäwßähäwtsâb- al w- »The Ø fl r-OV-V-" Rest of A-Fl R-SSV M fl ~ JOJUI | © ÄCANWC OONOICXIÄCÅN> F - * @! $ 0C ~ 1S§C fi ~ $ - C ~ ätOI- ^ s. I »-> - iI r-ß» - rn un ßÄHàUJ-ÄOO-ÄN-S-Ot-ß-ßßš fl ràšåß-Ov-'MI-'f flfi 10 15 20 521 907 To represent this in a forwarding table, we use a special type of Dynamic Layered Tree that is suitable for smaller routing tables. The principle is exactly the same as for regular DLT, but instead of using 16-bit area boundaries, we use 32-bit area boundaries. In addition, the number of bits used to represent the next jump index is reduced to 16. In this data structure we call the 32-bit Dynamic Layered Tree, a node consists of 8 area boundaries instead of 16 and a leaf contains 5 area boundaries and 6 next jump boundaries. index instead of 7 and 8 respectively. This means that we can represent up to 6 * 9 * 9 * 9 = 4374 areas or 2187 paths using this technology without exceeding the design limit of 4 memory accesses. In this configuration, the largest amount of memory required to represent 2187 paths is 32 + 9- (32 + 9- (32 + 9-32)) = 26240 bytes.

Den 32-bitars DLT-struktur som representerar områdespartitionen ovan visas i Figur 8. Varje rad representerar en cacherad som lagrar antingen en nod (de första tre raderna) eller ett löv (de sista fem raderna). Observera att kvantiseringseffekter inte har beaktats vilket innebär att denna speciella representation är något mindre minnesutrymmeseffektiv än den fulla flytkomprimerade vidarebefordringstabellen för stora vägvalstabeller. De specialanpassade söknings- och indexsökningsprocedu- rerna för 32-bitars DLT visas i C-kod nedan. 521 907 32 :iyjïïàiífïgï fl” static __in1ine int DLT32_ix_search5(u_int32_t *tkey, u_ínt32_t qkey) i u_int32_t *base = tkey; tkey += *tkey <= qxey; tkey += (*(tkey + 2) <= qkey) << 1; tkey += (*(tkey + 1) <= qkey) << 0; return (int)((tkey - base) + (*tkey <= qkey)); l static __in1ine int DLT32_ix_search8(u_int32_t *tkey, u_int32_t qkey) { u_int32_t *base = tkey; tkey += (*(tkey + 4) <= qkey) << 2; tkey += (*(tkey + 2) <= qkey) << 1; tkey += (*(tkey + 1) <= qyey) << 0; return (int)((tkey - base) + (*tkey <= qkey)): l ädefine _FT;SIZE_1 (8 ) #define _FT_SIZE_2 (8 + 9 * _FT_SIZE_1) #define _FT_s1zE_3 (8 + 9 * _FT_sIzE_2) static __in1ine int DLT32_1ookup(u_int32_t *ft, u_int32_t key) { ft += 8 + _FT_SIZE_3 * _ft_qsearch8(ft, key); fc += s + _FT_s1zE_2 * _ft_qsearchß(ft, keyl; ft += 8 + _FT_SIZE_1 * _ft_qsearch8(ft, key); return ((u__inc1e_c *) (f: + 5)) Lfgqsearchßlít, keyll: DLT32_ix_serach5 och DLT32_ix_search8 är specialanpassade indexsökningsprocedurer for sökning mellan 5 respektive 8 områdesgränser. Efter- som både antalet nivåer (fyra) och antalet områdesgränser som ska sökas är kända i varje steg, kan sökningen utföras som en deterministisk sekvens av aritmetiska operationer, utan villkorlig förgrening, för att helt och fullt utnyttja överlappningen av instruktioner som utförs av CPU:n.The 32-bit DLT structure representing the area partition above is shown in Figure 8. Each row represents a cache that stores either a node (the first three rows) or a leaf (the last five rows). Note that quantization effects have not been taken into account, which means that this special representation is slightly less memory space efficient than the full flow-compressed forwarding table for large route selection tables. The custom search and index search procedures for 32-bit DLT are shown in C-code below. 521 907 32: iyjïïàiífïgï fl ”static __in1ine int DLT32_ix_search5 (u_int32_t * tkey, u_ínt32_t qkey) i u_int32_t * base = tkey; tkey + = * tkey <= qxey; tkey + = (* (tkey + 2) <= qkey) << 1; tkey + = (* (tkey + 1) <= qkey) << 0; return (int) ((tkey - base) + (* tkey <= qkey)); l static __in1ine int DLT32_ix_search8 (u_int32_t * tkey, u_int32_t qkey) {u_int32_t * base = tkey; tkey + = (* (tkey + 4) <= qkey) << 2; tkey + = (* (tkey + 2) <= qkey) << 1; tkey + = (* (tkey + 1) <= qyey) << 0; return (int) ((tkey - base) + (* tkey <= qkey)): l ädefine _FT; SIZE_1 (8) #define _FT_SIZE_2 (8 + 9 * _FT_SIZE_1) #define _FT_s1zE_3 (8 + 9 * _FT_sIzE_1) static int DLT32_1ookup (u_int32_t * ft, u_int32_t key) {ft + = 8 + _FT_SIZE_3 * _ft_qsearch8 (ft, key); fc + = s + _FT_s1zE_2 * _ft_qsearchß (ft, keyl; ft + = 8 + _FT_SIZE_1 * _ft_qsearch8 (ft, key); return ((u__inc1e_c *) (f: + 5)) Lfgqsearchßlít, keyll: DLT32_ix8s_sex_serach5 for searching between 5 and 8 area boundaries, respectively. Since both the number of levels (four) and the number of area boundaries to be searched are known in each step, the search can be performed as a deterministic sequence of arithmetic operations, without conditional branching, to fully utilize the overlap of instructions executed by the CPU.

Claims (29)

10 15 20 25 30 521 907 33 6. Patentkrav10 15 20 25 30 521 907 33 6. Patent claim 1. Metod för IP-vägvalssökning för att fastställa vart ett IP-datagram med en given destinationsadress ska vidarebefordras genom att från en vägvalstabell hämta ett nästa hopp-index som indikerar vart nämnda datagram ska vidarebefordras, var- vid nämnda nästa hopp-index associeras med det längsta matchande prefixet hos nämnda destinationsadress, varvid nämnda adress är ett tal i en adresspopulation U, i vilken en mängd av adressprefix P och en avbildning av P på en mängd av nästa hopp-index D konverteras till en mängd av områden R som utgör en partition av U, och en avbildning av R på D, vilken kännetecknas av stegen att konstruera och i ett minne lagra en vidarebefordringstabellsrepresentation från R och D genom att använda en förutbestämd skiktad datastruktur där konstruktionen av skiktet väljs beroende på områdesdensiteten |R'| för delpopulationen U' som representeras av detta skikt för att få en utrymmeseffektiv representation av mängden av områden R, och att utföra sökningen genom en områdesmatchningsoperation i nämnda vidare- befordringstabell.Method of IP routing search to determine where an IP datagram with a given destination address should be forwarded by retrieving from a routing table a next hop index indicating where said datagram is to be forwarded, wherein said next hop index is associated with the longest matching prefix of said destination address, said address being a number in an address population U, in which an amount of address prefix P and a mapping of P on an amount of the next hop index D are converted to an amount of areas R constituting a partition of U, and an image of R on D, which is characterized by the steps of constructing and storing in a memory a forwarding table representation from R and D using a predetermined layered data structure where the construction of the layer is selected depending on the area density | R '| for the subpopulation U 'represented by this layer to obtain a space-efficient representation of the set of areas R, and to perform the search by an area matching operation in said forwarding table. 2. Metod enligt krav 1, kännetecknad därav att antalet vägar som ska repre- senteras i vidarebefordringstabellen och ett största tillåtna antal minnesaccesser för sökningen är föreskrivna, varpå nämnda datastrukturer väljs som konstruktionsblock för konstruktionen av vidarebefordringstabellen på sådant sätt att minnesbehoven minimeras.Method according to claim 1, characterized in that the number of paths to be represented in the forwarding table and a maximum permissible number of memory accesses for the search are prescribed, whereupon said data structures are selected as construction blocks for the construction of the forwarding table in such a way as to minimize memory requirements. 3. Metod enligt krav 1, kännetecknad därav att antalet vägar som ska repre- senteras i vidarebefordringstabellen och en största tillgänglig minneskapacitet är föreskrivna, varpå nämnda datastrukturer väljs som konstruktionsblock för konstruk- tionen av vidarebefordringstabellen på sådant sätt att antalet minnesaccesser för sökningen minimeras.Method according to claim 1, characterized in that the number of paths to be represented in the forwarding table and a maximum available memory capacity are prescribed, whereupon said data structures are selected as construction blocks for the construction of the forwarding table in such a way that the number of memory accesses for the search is minimized. 4. Metod enligt något av föregående krav, kännetecknad därav att nämnda datastrukturer för konstruktionen av vidarebefordringstabellen är väljbara bland strukturerna Dynamic Flat Tree, Dynamic Layered Tree och Static Flat Tree och vari- ationer därav. 10 15 20 25 30 521 907 34Method according to any one of the preceding claims, characterized in that said data structures for the construction of the forwarding table are selectable from the structures Dynamic Flat Tree, Dynamic Layered Tree and Static Flat Tree and variations thereof. 10 15 20 25 30 521 907 34 5. Metod enligt något av föregående krav, kännetecknad därav att för att upp- repat reducera storleken på adressdelpopulationerna vid successiva nivåer används en Static Vector Node (SVN) -representation vid en första nivå för vidarebeford- ringstabellsrepresentationen, en av en första mängd av nämnda förutbestämda skiktade datastrukturer, väljbara beroende på det faktiska värdet av områdesdensi- teten |R,-| för att ge den mest effektiva tabellrepresentationen, väljs för att konstruera vidarebefordringstabellen vid en andra nivå, om |R,-| är mindre än ett förutbestämt första gränsvärde, annars används en SVN-representation, vid en tredje nivå väljs en av en andra mängd av nämnda förutbestämda datastrukturer, väljbara beroende på det faktiska värdet av områdesdensiteten |R,-,,-| för att ge den mest effektiva tabellre- presentationen, för att konstruera vidarebefordringstabellen vid denna tredje nivå, om |R,«,,-| är mindre än ett förutbestämt andra gränsvärde, annars används en SVN-repre- sentation etc tills alla nivåer har representerats.Method according to any one of the preceding claims, characterized in that in order to repeatedly reduce the size of the address subpopulations at successive levels, a Static Vector Node (SVN) representation is used at a first level for the forwarding table representation, one of a first set of said predetermined layered data structures, selectable depending on the actual value of the area density | R, - | to provide the most efficient table representation, is selected to construct the forwarding table at a second level, if | R, - | is less than a predetermined first limit value, otherwise an SVN representation is used, at a third level one of a second set of said predetermined data structures is selected, selectable depending on the actual value of the area density | R, - ,, - | to provide the most efficient table presentation, to construct the forwarding table at this third level, if | R, «,, - | is less than a predetermined second limit value, otherwise an SVN representation is used, etc. until all levels have been represented. 6. Metod enligt krav 5, kännetecknad därav att en initial SVN-sökning genom direkt indexering utförs vid nämnda första nivå för att hämta en pekare som antingen representerar ett nästa hopp-index, vilket betyder att sökningen har fullbordats, eller refererar till en underdatastruktur där sökningen fortsätter på nämnda andra nivå och, beroende på värdet på |R,-|, kodad i pekarvärdet och erhållen genom att avkoda pekarvärdet, fullbordas en sökning i en vidarebefordringstabell som representeras av en av nämnda första mängd av nämnda förutbestämda skiktade datastrukturer om |R,-| är mindre än nämnda förutbestämda första gränsvärde, annars utförs en SVN- sökning genom direkt indexering vid nämnda andra nivå för att hämta en pekare som antingen representerar ett nästa hopp-index, vilket betyder att sökningen har fullbor- dats, eller refererar till en underdatastruktur där sökningen fortsätter på nämnda tredje nivå och, beroende på värdet på IRM-I, kodad i pekarvärdet och erhållen genom att avkoda pekarvärdet, fullbordas en sökning i en vidarebefordringstabell som repre- senteras av en av nämnda andra mängd av nämnda förutbestämda skiktade data- strukturer om |R,-,,-| är mindre än nämnda förutbestämda andra gränsvärde, annars utförs en SVN-sökning genom direkt indexering etc tills sökningen har fullbordats.Method according to claim 5, characterized in that an initial SVN search by direct indexing is performed at said first level to retrieve a pointer which either represents a next jump index, which means that the search has been completed, or refers to a subdata structure where the search continues at said second level and, depending on the value of | R, - |, encoded in the pointer value and obtained by decoding the pointer value, a search is completed in a forwarding table represented by one of said first set of said predetermined layered data structures if | R , - | is less than said predetermined first limit value, otherwise an SVN search is performed by direct indexing at said second level to retrieve a pointer which either represents a next jump index, which means that the search has been completed, or refers to a subdata structure where the search continues at said third level and, depending on the value of IRM-I, encoded in the pointer value and obtained by decoding the pointer value, a search is completed in a forwarding table represented by one of said second set of said predetermined layered data structures if | R, - ,, - | is less than said predetermined second limit value, otherwise an SVN search is performed by direct indexing etc until the search has been completed. 7. Metod enligt något av kraven 1-2 eller 4-6 kännetecknad därav att det största antalet vägar är fixerat till 218 vägar och det största tillåtna antalet minnesac- cesser till 4, varpå nämnda datastrukturer väljs som konstruktionsblock för konstruk- 10 15 20 25 30 521 907 tionen av vidarebefordringstabellen på sådant sätt att minnesbehoven är mindre än 2,7 Mbyte.Method according to any one of claims 1-2 or 4-6, characterized in that the largest number of paths is fixed to 218 paths and the largest permissible number of memory accesses to 4, whereupon said data structures are selected as construction blocks for construction. 521 907 of the forwarding table in such a way that the memory requirements are less than 2.7 Mbytes. 8. Metod enligt något av kraven 1 eller 3-6, kännetecknad därav att det största antalet vägar är fixerat till 218 vägar och den största tillgängliga minneskapaciteten till 2,7 Mbyte, varpå nämnda datastrukturer väljs som konstruktionsblock för konstruk- tionen av vidarebefordringstabellen på sådant sätt att antalet minnesaccesser för sökningen är mindre än eller lika med 4.Method according to any one of claims 1 or 3-6, characterized in that the largest number of paths is increased to 218 paths and the largest available memory capacity to 2.7 Mbytes, whereupon said data structures are selected as construction blocks for the construction of the forwarding table on such means that the number of memory accesses for the search is less than or equal to 4. 9. Metod enligt något av föregående krav, kännetecknad därav att för att upp- repat reducera storleken på adressdelpopulationerna vid successiva nivåer används en Static Vector Node (SVN) -representation med storleken 216 pekare vid en första nivå för vidarebefordringstabellsrepresentationen, en av en första mängd av nämnda förutbestämda skiktade datastrukturer, väljbara beroende på det faktiska värdet av områdesdensiteten |R,-| för att ge den mest effektiva tabellrepresentationen, väljs för att konstruera vidarebefordringstabellen vid en andra nivå, om |R,-| är mindre än ett förutbestämt första gränsvärde 2313, annars används en SVN-representation med storleken 28 pekare, vid en tredje nivå väljs en av en andra mängd av nämnda förut- bestämda datastrukturer, väljbara beroende på det faktiska värdet av områdesden- siteten |R,-,,-| för att ge den mest effektiva tabellrepresentationen, för att konstruera vidarebefordringstabellen vid denna tredje nivå, om |R,-,,-| är mindre än ett förutbe- stämt andra gränsvärde 137, annars används en SVN-representation med storleken 24 pekare, och vid en fjärde nivå väljs en av en tredje mängd av nämnda förutbe- stämda datastrukturer, väljbara beroende på det faktiska värdet av områdesdensite- ten |R,-,,-,k| för att ge den mest effektiva tabellrepresentationen, för att konstruera vida- rebefordringstabellen vid denna fjärde nivå, om |R,-,,-,kj är mindre än ett förutbestämt tredje gränsvärde 12, annars används en SVN-representation med storleken 24 pekare.Method according to one of the preceding claims, characterized in that in order to repeatedly reduce the size of the address subpopulations at successive levels, a Static Vector Node (SVN) representation with the size 216 pointers is used at a first level for the forwarding table representation, one of a first set of said predetermined layered data structures, selectable depending on the actual value of the area density | R, - | to provide the most efficient table representation, is selected to construct the forwarding table at a second level, if | R, - | is less than a predetermined first limit value 2313, otherwise an SVN representation of size 28 pointers is used, at a third level one of a second set of said predetermined data structures is selected, selectable depending on the actual value of the area density | R, - ,, - | to provide the most efficient table representation, to construct the forwarding table at this third level, if | R, - ,, - | is less than a predetermined second limit value 137, otherwise an SVN representation of size 24 pointers is used, and at a fourth level one of a third set of said predetermined data structures is selected, selectable depending on the actual value of the area density. | R, - ,, -, k | to provide the most efficient table representation, to construct the forwarding table at this fourth level, if | R, - ,, -, kj is less than a predetermined third limit value 12, otherwise an SVN representation of size 24 pointers is used. 10. Metod enligt krav 9, kännetecknad därav att en initial SVN-sökning genom direkt indexering utförs vid nämnda första nivå för att hämta en pekare som antingen representerar ett nästa hopp-index, vilket betyder att sökningen har fullbordats, eller refererar till en underdatastruktur där sökningen fortsätter på nämnda andra nivå och, beroende på värdet på |R,-|, kodad i pekarvärdet och erhållen genom att avkoda 10 15 20 25 30 *521 907 36 pekarvärdet, fullbordas en sökning i en vidarebefordringstabell som representeras av en av nämnda första mängd av nämnda förutbestämda skiktade datastrukturer om |R,-| är mindre än nämnda förutbestämda första gränsvärde 2313, annars utförs en SVN-sökning genom direkt indexering vid nämnda andra nivå för att hämta en pekare som antingen representerar ett nästa hopp-index, vilket betyder att sökningen har fullbordats, eller refererar till en underdatastruktur där sökningen fortsätter på nämnda tredje nivå och, beroende på värdet på jR,-,,'|, kodad i pekarvärdet och erhål- len genom att avkoda pekarvärdet, fullbordas en sökning i en vidarebefordringstabell som representeras av en av nämnda andra mängd av nämnda förutbestämda skik- tade datastrukturer om |R,-,,-| är mindre än nämnda förutbestämda andra gränsvärde 137, annars utförs en SVN-sökning genom direkt indexering vid nämnda tredje nivå för att hämta en pekare som antingen representerar ett nästa hopp-index, vilket betyder att sökningen har fullbordats, eller refererar till en underdatastruktur där sök- ningen fortsätter på nämnda fjärde nivå och. beroende på värdet på |R,-,,-,k|, kodad i pekarvärdet och erhållen genom att avkoda pekarvärdet, fullbordas en sökning i en vidarebefordringstabell som representeras av en av nämnda tredje mängd av nämnda förutbestämda skiktade datastrukturer om |R,-,,-,k| är mindre än nämnda förut- bestämda tredje gränsvärde 12, annars fullbordas sökningen genom en slutlig SVN- sökning med användning av direkt indexering vid nämnda fjärde nivå.Method according to claim 9, characterized in that an initial SVN search by direct indexing is performed at said first level to retrieve a pointer which either represents a next jump index, which means that the search has been completed, or refers to a subdata structure where the search continues at said second level and, depending on the value of | R, - |, encoded in the pointer value and obtained by decoding the pointer value, a search is completed in a forwarding table represented by one of said first amount of said predetermined layered data structures of | R, - | is less than said predetermined first limit value 2313, otherwise an SVN search is performed by direct indexing at said second level to retrieve a pointer which either represents a next jump index, meaning that the search has been completed, or refers to a subdata structure where the search proceeds to said third level and, depending on the value of jR, - ,, '|, encoded in the pointer value and obtained by decoding the pointer value, a search is completed in a forwarding table represented by one of said second set of said predetermined arrays. data structures about | R, - ,, - | is less than said predetermined second threshold 137, otherwise an SVN search is performed by direct indexing at said third level to retrieve a pointer which either represents a next jump index, which means that the search has been completed, or refers to a subdata structure where search continues at said fourth level and. depending on the value of | R, - ,, -, k |, encoded in the pointer value and obtained by decoding the pointer value, a search is completed in a forwarding table represented by one of said third set of said predetermined layered data structures of | R, -, , -, k | is less than said predetermined third limit value 12, otherwise the search is completed by a final SVN search using direct indexing at said fourth level. 11. Metod enligt krav 9 eller 10, kännetecknad därav att vid nämnda andra nivå är populationen U uppdelad i 216 delpopulationer UO, U1,..., U21s_1, var och en med storleken 216, och därav att mängden av områden R bearbetas till Ro, R1,..., R21e_1 och representeras av underdatastrukturerna To, T1,..., TzwjMethod according to claim 9 or 10, characterized in that at said second level the population U is divided into 216 subpopulations UO, U1, ..., U21s_1, each of size 216, and in that the amount of areas R is processed into Ro , R1, ..., R21e_1 and are represented by the sub-data structures To, T1, ..., Tzwj 12. Metod enligt krav 11, kännetecknad därav att vid nämnda tredje nivå är varje delpopulation U,- uppdelad i 28 delpopulationer U,-,0, U,-,1,..., U,~,2e_1, var och en med storleken 28, och därav att mängden av områden R,- bearbetas till R,-,0, R,-,1,..., R,-,2a_, och representeras av underdatastrukturerna 'F,-,0, Ehn., 71,284.Method according to claim 11, characterized in that at said third level each subpopulation is U, - divided into 28 subpopulations U, -, 0, U, -, 1, ..., U, ~, 2e_1, each with size 28, and from the fact that the set of areas R 1, - is processed into R 1, -, 0, R, -, 1, ..., R, -, 2a_, and is represented by the subdata structures' F 71,284. 13. varje delpopulation UU uppdelad i 24 delpopulationer U,-,,-,0, U,,,-,1,. U,-,,-,24_1, var och en Metod enligt krav 12, kännetecknad därav att vid nämnda fjärde nivå är med storleken 24, och därav att mängden av områden R,',,- bearbetas till R,-J-,0, R,-¿,1,..., R,~,,-,24-1 och representeras av underdatastrukturerna 711,0, T,-,,-,1,..., T,-,,-,24.1. 10 15 20 25 30 521 9og713. each subpopulation UU divided into 24 subpopulations U, - ,, -, 0, U ,,, -, 1 ,. Each method according to claim 12, characterized in that at said fourth level it is of size 24, and in that the amount of areas R , R, -¿, 1, ..., R, ~ ,, -, 24-1 and is represented by the sub-data structures 711.0, T, - ,, -, 1, ..., T, - ,, -, 24.1. 10 15 20 25 30 521 9og7 14. Metod enligt något av kraven 9-13, kännetecknad därav att nämnda första mängd av datastrukturer består av Dynamic Flat Tree- och Dynamic Layered Tree- strukturer.Method according to any one of claims 9-13, characterized in that said first set of data structures consists of Dynamic Flat Tree and Dynamic Layered Tree structures. 15. mängd av datastrukturer består av Dynamic Layered Tree-strukturer. Metod enligt något av kraven 9 -14, kännetecknad därav att nämnda andra15. set of data structures consists of Dynamic Layered Tree structures. Method according to any one of claims 9 -14, characterized in that said second 16. Metod enligt något av kraven 9-15, kännetecknad därav att nämnda tredje mängd av datastrukturer som ska användas vid nämnda fjärde nivå av sökprocedu- ren består av Dynamic Layered Tree- och Static Flat Tree-strukturer.Method according to any one of claims 9-15, characterized in that said third set of data structures to be used at said fourth level of the search procedure consists of Dynamic Layered Tree and Static Flat Tree structures. 17. Metod enligt något av kraven 1-2 eller 4-6, kännetecknad därav att det största antalet vägar är fixerat till 2187 och det största tillåtna antalet minnesaccesser till 4, varpå en 32-bitarsvariation av datastrukturen Dynamic Layered Tree används som konstruktionsblock för konstruktionen av vidarebefordringstabellen så att min- nesbehoven är lika med 26 240 byte.Method according to one of Claims 1 to 2 or 4 to 6, characterized in that the maximum number of paths is fixed to 2187 and the maximum permissible number of memory accesses to 4, whereupon a 32-bit variation of the data structure Dynamic Layered Tree is used as the construction block for the construction. of the forwarding table so that the memory requirements are equal to 26,240 bytes. 18. System för IP-vägvalssökning för att fastställa vart ett IP-datagram med en given destinationsadress ska vidarebefordras genom att från en vägvalstabell hämta ett nästa hopp-index som indikerar vart nämnda datagram ska vidarebefordras, var- vid nämnda nästa hopp-index associeras med det längsta matchande prefixet av nämnda destinationsadress, varvid nämnda adress är ett tal i en adresspopulation U, nämnda system består av ett första konverteringsmedel för att konvertera en mängd adressprefix P till en mängd områden R som utgör en partition av nämnda population U och ett andra konverteringsmedel för att konvertera avbildningen från P på en mängd av nästa hopp-index D till en ekvivalent avbildning från R på D, vilket känne- tecknas av datastruktureringsmedel för att bilda förutbestämda skiktade datastruktu- rer Tsom representerar vägvalstabellen, och konstruktions- och minnesmedel för att konstruera och att lagra en vidarebefordringstabellsrepresentation från R och D genom att använda en förutbestämd skiktad datastruktur där konstruktionen av skik- tet väljs beroende på områdesdensiteten lR'| för delpopulationen U' som represente- ras av detta skikt för att få en utrymmeseffektiv representation av mängden av områ- 10 15 20 25 30 521 907 den R, och medel för att utföra sökningen genom en områdesmatchningsoperation i nämnda vidarebefordringstabell.18. IP routing search system for determining where an IP datagram with a given destination address is to be forwarded by retrieving from a routing table a next hop index indicating where said datagram is to be forwarded, said next hop index being associated with the longest matching prefix of said destination address, said address being a number in an address population U, said system consisting of a first conversion means for converting a plurality of address prefix P to a plurality of areas R constituting a partition of said population U and a second conversion means to convert the image from P on a set of the next jump index D to an equivalent image from R on D, which is characterized by data structuring means to form predetermined layered data structures representing the path selection table, and construction and memory means for constructing and storing a forwarding table representation from R and D using a a predetermined layered data structure where the construction of the layer is selected depending on the area density 1R '| for the subpopulation U 'represented by this layer to obtain a space-efficient representation of the amount of areas R, and means for performing the search by an area matching operation in said forwarding table. 19. System enligt krav 18, kännetecknat därav att nämnda konstruktions- och lagringsmedel för vidarebefordringstabell är anordnade för att upprepat reducera storleken på adressdelpopulationerna vid successiva nivåer används en Static Vector Node (SVN) -representation vid en första nivå för vidarebefordringstabellsre- presentationen, en av en första mängd av nämnda förutbestämda skiktade data- strukturer, väljbara beroende på det faktiska värdet av områdesdensiteten |R,«| för att ge den mest effektiva tabellrepresentationen, väljs för att konstruera vidarebeford- ringstabellen vid en andra nivå, om |R,-| är mindre än ett förutbestämt första gräns- värde, annars används en SVN-representauon, vid en tredje nivå väljs en av en andra mängd av nämnda förutbestämda datastrukturer, väljbara beroende på det faktiska värdet av områdesdensiteten |R,-,,-| för att ge den mest effektiva tabellrepre- sentationen, för att konstruera vidarebefordringstabellen vid denna tredje nivå, om jR,~,,»| är mindre än ett förutbestämt andra gränsvärde, annars används en SVN-repre- sentation etc tills konstruktionen och lagringen har fullbordats.A system according to claim 18, characterized in that said design and storage means for forwarding table are arranged to repeatedly reduce the size of the address subpopulations at successive levels, a Static Vector Node (SVN) representation is used at a first level for forwarding table representation, one of a first set of said predetermined layered data structures, selectable depending on the actual value of the area density | R, «| to provide the most efficient table representation, is selected to construct the forwarding table at a second level, if | R, - | is less than a predetermined first limit value, otherwise an SVN representative is used, at a third level one of a second set of said predetermined data structures is selected, selectable depending on the actual value of the area density | R, - ,, - | to provide the most efficient table representation, to construct the forwarding table at this third level, if jR, ~ ,, »| is less than a predetermined second limit value, otherwise an SVN representation is used, etc. until the design and storage has been completed. 20. System enligt något av kraven 18 eller 19, kännetecknat därav att nämnda sökningsutförandemedel är anordnade för att utföra en initial SVN-sökning genom direkt indexering vid nämnda första nivå för att hämta en pekare som antingen repre- senterar ett nästa hopp-index, vilket betyder att sökningen har fullbordats, eller refe- rerar till en underdatastruktur där sökningen fortsätter på nämnda andra nivå och, beroende på värdet på |R,-|, kodad i pekarvärdet och erhållen genom att avkoda pekarvärdet, fullbordas en sökning i en vidarebefordringstabell representerad genom en av nämnda första mängd av nämnda förutbestämda skiktade datastrukturer om |R,«| är mindre än nämnda förutbestämda första gränsvärde, annars utförs en SVN- sökning genom direkt indexering vid nämnda andra nivå för att hämta en pekare som antingen representerar ett nästa hopp-index, vilket betyder att sökningen har fullbor- dats, eller refererar till en underdatastruktur där sökningen fortsätter på nämnda tredje nivå och, beroende på värdet på |R,-,,~|, kodad i pekarvärdet och erhållen genom att avkoda pekarvärdet, fullbordas en sökning i en vidarebefordringstabell represen- terad genom en av nämnda andra mängd av nämnda förutbestämda skiktade data- 10 15 20 25 30 521 907 strukturer om |R,-,,-| är mindre än nämnda förutbestämda andra gränsvärde, annars utförs en SVN-sökning genom direkt indexering etc tills sökningen har fullbordats.A system according to any one of claims 18 or 19, characterized in that said search execution means are arranged to perform an initial SVN search by direct indexing at said first level to retrieve a pointer which either represents a next jump index, which means that the search has been completed, or refers to a subdata structure where the search continues at said second level and, depending on the value of | R, - |, encoded in the pointer value and obtained by decoding the pointer value, a search is completed in a forwarding table represented by one of said first set of said predetermined layered data structures of | R, «| | is less than said predetermined first limit value, otherwise an SVN search is performed by direct indexing at said second level to retrieve a pointer which either represents a next jump index, which means that the search has been completed, or refers to a subdata structure where the search continues at said third level and, depending on the value of | R, - ,, ~ |, encoded in the pointer value and obtained by decoding the pointer value, a search is completed in a forwarding table represented by one of said second set of said predetermined layers data- 10 15 20 25 30 521 907 structures about | R, - ,, - | is less than said predetermined second limit value, otherwise an SVN search is performed by direct indexing etc until the search has been completed. 21. System enligt något av kraven 18-20, kännetecknat därav att det största antalet vägar är fixerat till 218 vägar, det största antalet minnesaccesser för att söka nästa hopp-indexet är 4, och varpå nämnda datastrukturer väljs som konstruktions- block för konstruktionen av vidarebefordringstabellen på sådant sätt att minnesbeho- ven är mindre än 2,7 Mbyte.System according to any one of claims 18-20, characterized in that the largest number of paths is fixed to 218 paths, the largest number of memory accesses to search for the next jump index is 4, and then said data structures are selected as construction blocks for the construction of the forwarding table in such a way that the memory requirements are less than 2.7 Mbytes. 22. System enligt något av kraven 18-21, kännetecknat därav att nämnda kon- struktions- och lagringsmedel för vidarebefordringstabell är anordnade för att uppre- pat reducera storleken på adressdelpopulationerna vid successiva nivåer används en Static Vector Node (SVN) -representation med storleken 216 pekare vid en första nivå för vidarebefordringstabellsrepresentationen, en av en första mängd av nämnda för- utbestämda skiktade datastrukturer, väljbara beroende på det faktiska värdet av områdesdensiteten |R,-| för att ge den mest effektiva tabellrepresentationen, väljs för att konstruera vidarebefordringstabellen vid en andra nivå, om |R,~| är mindre än ett förutbestämt första gränsvärde 2313, annars används en SVN-representation med storleken 28 pekare, vid en tredje nivå väljs en av en andra mängd av nämnda förut- bestämda datastrukturer, väljbara beroende på det faktiska värdet av områdesden- siteten |R,-,,~| för att ge den mest effektiva tabellrepresentationen, för att konstruera vidarebefordringstabellen vid denna tredje nivå, om |R,-,,-| är mindre än ett förutbe- stämt andra gränsvärde 137, annars används en SVN-representation med storleken 24 pekare, och vid en fjärde nivå väljs en av en tredje mängd av nämnda förutbe- stämda datastrukturer, väljbara beroende på det faktiska värdet av områdesdensite- ten |R,-,,-,k| för att ge den mest effektiva tabellrepresentationen, för att konstruera vida- rebefordringstabellen vid denna fjärde nivå, om |R,-,,-,k| är mindre än ett förutbestämt tredje gränsvärde 12, annars används en SVN-representation med storleken 24 pekare.System according to any one of claims 18-21, characterized in that said design and storage means for forwarding table are arranged to repeatedly reduce the size of the address subpopulations at successive levels, a Static Vector Node (SVN) representation of size 216 is used. pointers at a first level for the forwarding table representation, one of a first set of said predetermined layered data structures, selectable depending on the actual value of the area density | R, - | to provide the most efficient table representation, is selected to construct the forwarding table at a second level, if | R, ~ | is less than a predetermined first limit value 2313, otherwise an SVN representation of size 28 pointers is used, at a third level one of a second set of said predetermined data structures is selected, selectable depending on the actual value of the area density | R, - ,, ~ | to provide the most efficient table representation, to construct the forwarding table at this third level, if | R, - ,, - | is less than a predetermined second limit value 137, otherwise an SVN representation of size 24 pointers is used, and at a fourth level one of a third set of said predetermined data structures is selected, selectable depending on the actual value of the area density. | R, - ,, -, k | to provide the most efficient table representation, to construct the forwarding table at this fourth level, if | R, - ,, -, k | is less than a predetermined third limit value 12, otherwise an SVN representation of size 24 pointers is used. 23. System enligt något av kraven 18-22, kännetecknat därav att nämnda sök- ningsutförandemedel är anordnade för att utföra en initial SVN-sökning genom direkt indexering vid nämnda första nivå för att hämta en pekare som antingen represente- rar ett nästa hopp-index, vilket betyder att sökningen har fullbordats, eller refererar till 10 15 20 25 30 i 521 907 40 en underdatastruktur där sökningen fortsätter på nämnda andra nivå och, beroende på värdet på |R,-|, kodad i pekarvärdet och erhållen genom att avkoda pekarvärdet, fullbordas en sökning i en vidarebefordringstabell representerad genom en av nämnda första mängd av nämnda förutbestämda skiktade datastrukturer om |R,-| är mindre än nämnda förutbestämda första gränsvärde 2313, annars utförs en SVN- sökning genom direkt indexering vid nämnda andra nivå för att hämta en pekare som antingen representerar ett nästa hopp-index, vilket betyder att sökningen har fullbor- dats, eller refererar till en underdatastruktur där sökningen fortsätter på nämnda tredje nivå och, beroende på värdet på |R,~,;|, kodad i pekarvärdet och erhållen genom att avkoda pekarvärdet, fullbordas en sökning i en vidarebefordringstabell represen- terad genom en av nämnda andra mängd av nämnda förutbestämda skiktade data- strukturer om |Rf,;| är mindre än nämnda förutbestämda andra gränsvärde 137, annars utförs en SVN-sökning genom direkt indexering vid nämnda tredje nivå för att hämta en pekare som antingen representerar ett nästa hopp-index, vilket betyder att sökningen har fullbordats, eller refererar till en underdatastruktur där sökningen fort- sätter på nämnda fjärde nivå och, beroende på värdet på |R,-,,-,k|, kodad i pekarvärdet och erhållen genom att avkoda pekarvärdet, fullbordas en sökning i en vidarebeford- ringstabell representerad genom en av nämnda tredje mängd av nämnda förutbe- stämda skiktade datastrukturer om |R,-,,-,k| är mindre än nämnda förutbestämda tredje gränsvärde 12, annars fullbordas sökningen genom en slutlig SVN-sökning med användning av direkt indexering vid nämnda fjärde nivå.System according to any one of claims 18-22, characterized in that said search execution means are arranged to perform an initial SVN search by direct indexing at said first level to retrieve a pointer which either represents a next jump index. , which means that the search has been completed, or refers to a sub-data structure where the search continues at said second level and, depending on the value of | R, - |, encoded in the pointer value and obtained by decoding the pointer value , a search is completed in a forwarding table represented by one of said first set of said predetermined layered data structures of | R, - | is less than said predetermined first limit value 2313, otherwise an SVN search is performed by direct indexing at said second level to retrieve a pointer which either represents a next jump index, which means that the search has been completed, or refers to a subdata structure where the search continues at said third level and, depending on the value of | R, ~,; |, encoded in the pointer value and obtained by decoding the pointer value, a search is completed in a forwarding table represented by one of said second set of said predetermined layers data structures on | Rf,; | is less than said predetermined second threshold 137, otherwise an SVN search is performed by direct indexing at said third level to retrieve a pointer which either represents a next jump index, meaning that the search has been completed, or refers to a subdata structure where the search continues at said fourth level and, depending on the value of | R, - ,, -, k |, encoded in the pointer value and obtained by decoding the pointer value, a search is completed in a forwarding table represented by one of said third set of said predetermined layered data structures of | R, - ,, -, k | is less than said predetermined third limit value 12, otherwise the search is completed by a final SVN search using direct indexing at said fourth level. 24. System enligt något av kraven 21-23, kännetecknat därav att vid en första nivå anpassas nämnda datastruktureringsmedel att indela populationen U i 216 del- populationer UO, U1,..., U216_1, var och en med storleken 216, och att bearbeta mängden av områden R till Ro, R1,..., R2ia_1, vilka representeras av underdatastrukturerna To, T1,..., Tziaj.System according to any one of claims 21-23, characterized in that at a first level said data structuring means is adapted to divide the population U into 216 sub-populations UO, U1, ..., U216_1, each of size 216, and to process the set of areas R to Ro, R1, ..., R2ia_1, which are represented by the sub-data structures To, T1, ..., Tziaj. 25. System enligt krav 24, kännetecknat därav att vid en andra nivå anpassas nämnda datastruktureringsmedel att indela varje delpopulation U,« i 28 delpopulationer 10 15 20 25 521 9o7M Uno. Ui,1,---. Ui,28-1, var och en med storleken 28, och att bearbeta mängden av områden R, till R,-,0, R,-,1,..., R,-,2a_1, vilka representeras av underdatastrukturerna 71,0, T,-,1,..., 'F,-,2a_1_25. A system according to claim 24, characterized in that at a second level said data structuring means is adapted to divide each subpopulation U, «into 28 subpopulations Ui, 1, ---. Ui, 28-1, each of size 28, and to process the set of ranges R 1, to R 1, -, 0, R, -, 1, ..., R 0, T, -, 1, ..., 'F, -, 2a_1_ 26. System enligt krav 25, kännetecknat därav att vid en tredje nivå anpassas nämnda datastruktureringsmedel att indela varje delpopulation U,-,,- i 24 delpopulatio- nef Ui.j,o. Ui.j,1,---. Ui.j.24-1. var och en med storleken 24, och att bearbeta mängden av områden R,-,,~ till R,-,,-,0, R,-,,~,1,..., R,~,,-,24_1, vilka representeras av underdatastrukturerna T,~,,-,0, T,-,,-,1,..., 711124-1-26. A system according to claim 25, characterized in that at a third level, said data structuring means is adapted to divide each subpopulation U, - ,, - into 24 subpopulations Ui.j, o. Ui.j, 1, ---. Ui.j.24-1. each of size 24, and to process the set of ranges R, - ,, ~ to R, - ,, -, 0, R, - ,, ~, 1, ..., R, ~ ,, -, 24_1 , which are represented by the subdata structures T, ~ ,, -, 0, T, - ,, -, 1, ..., 711124-1- 27. System enligt något av kraven 18-26, kännetecknat därav att nämnda data- struktureringsmedel anpassas för att bilda datastrukturer som består av Dynamic Flat Tree-, Dynamic Layered Tree- och Static Flat Tree-datastrukturer.System according to any one of claims 18-26, characterized in that said data structuring means is adapted to form data structures consisting of Dynamic Flat Tree, Dynamic Layered Tree and Static Flat Tree data structures. 28. System enligt något av kraven 18-20, kännetecknat därav att nämnda data- struktureringsmedel anpassas för att bilda en 32-bitarsvariation av en Dynamic Layered Tree-datastruktur som konstruktionsblock för konstruktion av en vidarebe- fordringstabell så att minnesbehoven är lika med 26 240 byte för ett största antal vägar av 2187 och ett största antal minnesaccesser av 4.A system according to any one of claims 18-20, characterized in that said data structuring means is adapted to form a 32-bit variation of a Dynamic Layered Tree data structure as a construction block for constructing a forwarding table so that the memory requirements are equal to 26 240 replacement for a maximum number of paths of 2187 and a maximum number of memory accesses of 4. 29. Dataprogramsprodukt, vilken kännetecknas av dataprogramskodmedel för att förmå en dator att exekvera metoden enligt något av kraven 1-17 när programmet körs på en dator.A computer program product, which is characterized by computer program code means for causing a computer to execute the method according to any one of claims 1-17 when the program is run on a computer.
SE0200153A 2002-01-21 2002-01-21 Method and system for fast IP route search to determine where an IP datagram with a given destination address should be forwarded SE521907C2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
SE0200153A SE521907C2 (en) 2002-01-21 2002-01-21 Method and system for fast IP route search to determine where an IP datagram with a given destination address should be forwarded
PCT/SE2003/000064 WO2003063427A1 (en) 2002-01-21 2003-01-16 Method and system for fast ip routing lookup using forwarding tables with guaranteed compression rate and lookup performance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
SE0200153A SE521907C2 (en) 2002-01-21 2002-01-21 Method and system for fast IP route search to determine where an IP datagram with a given destination address should be forwarded

Publications (3)

Publication Number Publication Date
SE0200153D0 SE0200153D0 (en) 2002-01-21
SE0200153L SE0200153L (en) 2003-07-22
SE521907C2 true SE521907C2 (en) 2003-12-16

Family

ID=20286711

Family Applications (1)

Application Number Title Priority Date Filing Date
SE0200153A SE521907C2 (en) 2002-01-21 2002-01-21 Method and system for fast IP route search to determine where an IP datagram with a given destination address should be forwarded

Country Status (2)

Country Link
SE (1) SE521907C2 (en)
WO (1) WO2003063427A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7840696B2 (en) * 2003-07-25 2010-11-23 Broadcom Corporation Apparatus and method for classifier identification
US7990979B2 (en) 2006-08-25 2011-08-02 University Of Florida Research Foundation, Inc. Recursively partitioned static IP router tables
US9300583B2 (en) 2014-01-23 2016-03-29 Gainspan Corporation Maintaining routing information in memory constrained routers
CN108718277B (en) * 2018-04-11 2021-11-09 新华三技术有限公司 Message forwarding method based on routing table, routing table maintenance method and related device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE511972C2 (en) * 1997-09-09 2000-01-10 Sics Swedish Inst Of Computers Lookup device and method for classifying and forwarding data packets
US6266706B1 (en) * 1997-09-15 2001-07-24 Effnet Group Ab Fast routing lookup system using complete prefix tree, bit vector, and pointers in a routing table for determining where to route IP datagrams
SE9903460L (en) * 1999-09-22 2001-03-23 Effnet Group Ab Method and system for fast routing lookups
EP1232612B1 (en) * 1999-11-18 2006-11-02 Broadcom Corporation Table lookup mechanism for address resolution in a packet network switch

Also Published As

Publication number Publication date
WO2003063427A1 (en) 2003-07-31
SE0200153L (en) 2003-07-22
SE0200153D0 (en) 2002-01-21

Similar Documents

Publication Publication Date Title
US6490592B1 (en) Method of and apparatus for generating a tree data structure supporting longest match lookup
EP2159708B1 (en) Method for selecting hash function, method for storing and searching routing table and devices thereof
US6560610B1 (en) Data structure using a tree bitmap and method for rapid classification of data in a database
US6697363B1 (en) Method and apparatus for longest matching prefix determination in a communication network
US7356033B2 (en) Method and apparatus for performing network routing with use of power efficient TCAM-based forwarding engine architectures
EP2040184B1 (en) Database and database processing methods
JP4565793B2 (en) Method and apparatus for longest match address lookup
US8356021B2 (en) Method and apparatus for indexing in a reduced-redundancy storage system
KR100586461B1 (en) Method, Hardware Architecture and Recording Medium for Searching IP Address by Using Pipeline Binary Tree
US20070294502A1 (en) Lookup table array compression and indexing
WO2003069509A2 (en) Efficient ipv4/ipv6 best matching prefix method and apparatus
US7249149B1 (en) Tree bitmap data structures and their use in performing lookup operations
US20130024649A1 (en) Method and device for storing routing table entry
US7478109B1 (en) Identification of a longest matching prefix based on a search of intervals corresponding to the prefixes
Hsieh et al. Multiprefix trie: A new data structure for designing dynamic router-tables
Hsieh et al. A classified multisuffix trie for IP lookup and update
CN110995876B (en) Method and device for storing and searching IP
SE521907C2 (en) Method and system for fast IP route search to determine where an IP datagram with a given destination address should be forwarded
CN111131015B (en) Method for dynamically updating route based on PC-Trie
KR100814077B1 (en) An ip address lookup method using priority-trie and apparatus for relaying packets therefor
KR100560420B1 (en) Internet protocol address lookup method using a trie
Yu et al. A space-and time-efficient hash table hierarchically indexed by Bloom filters
JPH11102363A (en) Data management system and recording medium
McLaughlin et al. High-speed ip address lookups using hardware based tree structures

Legal Events

Date Code Title Description
NUG Patent has lapsed