SK3692000A3 - Method and system for fast routing lookups - Google Patents

Method and system for fast routing lookups Download PDF

Info

Publication number
SK3692000A3
SK3692000A3 SK369-2000A SK3692000A SK3692000A3 SK 3692000 A3 SK3692000 A3 SK 3692000A3 SK 3692000 A SK3692000 A SK 3692000A SK 3692000 A3 SK3692000 A3 SK 3692000A3
Authority
SK
Slovakia
Prior art keywords
bit
bundle
level
index
pointer
Prior art date
Application number
SK369-2000A
Other languages
Slovak (sk)
Inventor
Andrej Brodnik
Mikael Degermark
Svante Carlsson
Stephen Pink
Original Assignee
Effnet Group 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
Priority claimed from SE9703332A external-priority patent/SE9703332D0/en
Application filed by Effnet Group Ab filed Critical Effnet Group Ab
Priority claimed from PCT/SE1998/000854 external-priority patent/WO1999014906A1/en
Publication of SK3692000A3 publication Critical patent/SK3692000A3/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]

Abstract

In a method of IP routing lookup in a routing table, comprising entries of arbitrary length prefixes with associated next-hop information in a next-hop table, to determine where IP datagrams are to be forwarded, a representation of the routing table is stored, in the form of a complete prefix tree (7), defined by the prefixes of all routing table entries. Further, a representation of a bit vector (8) comprising data of a cut through the prefix tree (7) at a current depth (D), and an array of pointers, comprising indices to the next-hop table and to a next-level chunk, are stored. Said bit-vector (8) is divided into bit-masks and a representation of the bit-masks is stored in a maptable. Then, an array of code words, each encoding a row index into the maptable and a pointer offset, and an array of base addresses are stored. Finally, the lookup is performed.

Description

Spôsob IP vyhľadávania smerov v smerovej tabuľke a systém na IP vyhľadávanie smerov v smerovej tabuľkeThe method of IP directions search in the direction table and the system for IP directions search in the direction table

Oblasť technikyTechnical field

Vynález sa týka vo všeobecnosti spôsobu a systému IP vyhľadávaní smerov v smerovej tabuľke, ktorá obsahuje ako položky prefixy ľubovoľnej dĺžky s priradenou informáciou o nasledujúcom skoku v tabuľke nasledujúcich skokov, aby sa určilo, kam sa majú IP datagramy ďalej odoslať.In general, the invention relates to a method and a system of IP directional lookups in a direction table which includes as prefixes of arbitrary length with associated next hop information in the next hop table to determine where the IP datagrams are to be forwarded.

Doterajší stav technikyBACKGROUND OF THE INVENTION

Internet je prepojený súbor sietí, v ktorom si každá zo sietí, ktoré sú jeho súčasťou, zachováva svoju identitu a sú potrebné špeciálne mechanizmy na komunikáciu medzi viacerými sieťami. Na siete, ktoré sú súčasťou Internetu, sa odkazuje ako na podsiete.The Internet is an interconnected set of networks in which each of the networks that are part of it retains its identity and requires special mechanisms for communication between multiple networks. Networks that are part of the Internet are referred to as subnets.

Každá podsieť v Internete podporuje komunikáciu medzi zariadeniami, pripojenými k tejto podsieti. Ďalej, podsiete sú spojené zariadeniami, na ktoré sa odkazuje ako na komunikačné jednotky prepojených systémov (interworking units IWU).Each subnet on the Internet supports communication between devices connected to that subnet. Further, subnets are connected by devices referred to as interworking units (IWUs).

Konkrétnou IWU je smerovač, ktorý sa používa na spojenie dvoch sietí, ktoré môžu alebo nemusia byť podobné. Tento smerovač používa internetový protokol (IP), prítomný v každom smerovači a v každom hostiteľskom počítači siete.A particular IWU is a router that is used to connect two networks that may or may not be similar. This router uses the Internet Protocol (IP) present on each router and on each network host computer.

IP poskytuje službu bez pripojenia alebo datagramovú službu medzi stanicami.IP provides a connectionless or datagram service between stations.

Smerovanie sa vo všeobecnosti uskutočňuje udržiavaním smerovej tabuľky v každej stanici a smerovači, ktorá indikuje pre každú možnú sieť určenia nasledujúci smerovač, ku ktorému sa má IP datagram odoslať.Routing is generally accomplished by maintaining a routing table at each station and router that indicates, for each possible destination network, the next router to which the IP datagram is to be sent.

IP smerovače vykonávajú vyhľadávanie smeru v smerovej tabuľke, aby určili, kam sa majú IP datagramy ďalej odoslať. Výsledkom tejto operácie je nasledujúciIP routers perform directional lookup in the routing table to determine where IP datagrams are to be forwarded. The result of this operation is as follows

-2skok na dráhe k cieľu. Položkou v smerovej tabuľke je v princípe prefix (smerový kód) ľubovoľnej dĺžky s priradenou informáciou o nasledujúcom skoku. Smerové vyhľadávania musia nájsť smerovú položku s najdlhším zhodným prefixom.-2 jump to the finish line. The item in the direction table is in principle a prefix of any length with associated information about the next jump. Directional searches must find the routing item with the longest matching prefix.

Pretože IP smerové vyhľadávania boli vo svojej podstate pomalé a zložité, operácie podľa riešení doterajšieho stavu techniky viedli k rozširovaniu techník, pomocou ktorých sa dá vyhnúť ich použitiu. Rôzne technológie prepínania spojových vrstiev pod IP, metódy obídenia IP vrstvy (opísané v Proceedings of the Conference on Computer Communications (IEEE Infocom) (Zborník konferencie o počítačových komunikáciách), San Francisco, California, marec 1996; Proceedings of Gigabit NetWork Workshop (Zborník seminára o gigabitových sieťach), Boston, apríl 1995; a Proceedings of ACM SIGCOMM ’95, str. 49-58, Cambridge, Massachusetts, august 1995) a vývoj alternatívnych sieťových vrstiev, zakladajúcich sa na technológiách virtuálnych obvodov, ako je ATM, sú do istej miery výsledkami priania vyhnúť sa IP vyhľadávaniam smerov.Because IP routing searches were inherently slow and complex, operations according to prior art solutions have led to the proliferation of techniques that can be avoided. Various link layer switching technologies under IP, methods of bypassing the IP layer (described in Proceedings of the Conference on Computer Communications (IEEE Infocom), San Francisco, California, March 1996; Proceedings of Gigabit NetWork Workshop) on Gigabit networks), Boston, April 1995, and Proceedings of ACM SIGCOMM '95, pp. 49-58, Cambridge, Massachusetts, August 1995) and the development of alternative network layers based on virtual circuit technologies such as ATM To some extent, the results of the desire to avoid IP directional searches.

Použitie prepínania spojových vrstiev a architektúry prepínania toku alebo príznakov pod IP úrovňou zvyšuje zložitosť a redundanciu siete.Using link layer switching and flow or flag switching architecture below the IP level increases network complexity and redundancy.

Najnovšie návrhy IP smerovačov používajú techniky s rýchlymi vyrovnávacími pamäťami, pričom smerové položky aktuálne používaných cieľových adries sú držané v rýchlej vyrovnávacej pamäti. Táto technika vychádza z toho, že v prevádzke existuje dosť miesta, takže úspešnosť hľadania v rýchlej vyrovnávacej pamäti je dostatočne vysoká a náklady na vyhľadávanie smeru sa amortizujú po niekoľkých paketoch. Tieto metódy s rýchlymi vyrovnávacími pamäťami v minulosti dobre pracovali. Avšak v dôsledku toho, že súčasný prudký rast Internetu zväčšuje potrebnú veľkosť adresových rýchlych vyrovnávacích pamätí, hardvérové rýchle vyrovnávacie pamäte sa môžu stať nehospodárnymi.The latest designs of IP routers use cache techniques, while the routing entries of the currently used destination addresses are kept in the cache. This technique is based on the fact that there is enough space in operation, so that the cache search success rate is high enough and the directional search costs are amortized after a few packets. These cached methods have worked well in the past. However, as the current rapid growth of the Internet increases the required size of address buffers, hardware buffers may become wasteful.

Tradičné implementácie smerových tabuliek používajú verziu Patrícia stromov (opísané v Journal of the ACM 15(4), 514-534, október 1968), údajovú štruktúru, vymyslenú pred takmer tridsiatimi rokmi, s modifikáciami pre najdlhšiu zhodu prefixov.Traditional implementations of turntables use the version of Tree Patients (described in Journal of the ACM 15 (4), 514-534, October 1968), a data structure devised almost thirty years ago, with modifications for the longest prefix match.

-3Priama implementácia Patrícia stromov na účely vyhľadávania smerov, napríklad v NetBSD 1.2 implementácii, používa 24 bytov pre výstupy (listy) a vnútorné uzly. So 40 000 položkami má samotná stromová štruktúra takmer 2 megabyty a v perfektne vyváženom strome sa musí prechádzať 15 alebo 16 uzlami, aby sa našla smerová položka.-3Direct Implementation The tree belonging for directional search purposes, for example in the NetBSD 1.2 implementation, uses 24 bytes for outputs (blades) and internal nodes. With 40,000 entries, the tree structure itself has almost 2 megabytes, and in a perfectly balanced tree, 15 or 16 nodes must be traversed to find the directional entry.

V niektorých prípadoch sa v dôsledku pravidla najdlhších zhodných prefixov musí prechádzať ďalšími uzlami, aby sa našla správna smerová informácia, pretože nie je zaručené, že pôvodné hľadanie nájde správny výstup. Existujú optimalizácie, ktoré môžu zmenšiť veľkosť Patrícia stromu a zlepšiť rýchlosti vyhľadávania. Aj tak je údajová štruktúra veľká a na jej prehľadanie je potrebných príliš veľa drahých pamäťových odkazov. Súčasné Internetové smerové tabuľky sú príliš veľké na to, aby sa zmestili do rýchlych vyrovnávacích pamätí na čipe a pamäťové odkazy mimo čipov na DRAM sú príliš pomalé na to, aby podporovali požadované rýchlosti smerovania.In some cases, due to the rule of the longest matching prefixes, it is necessary to pass through other nodes in order to find the correct routing information, as it is not guaranteed that the original search will find the correct output. There are optimizations that can reduce the size of the Tree Patient and improve search speeds. Even so, the data structure is large and too many expensive memory links are required to crawl it. The current Internet routing tables are too large to fit in the chip buffers on the chip, and out-of-chip memory references on the DRAMs are too slow to support the required routing speeds.

Jedna z prvých prác o zlepšení výkonnosti IP smerovania tým, že sa nepoužijú úplné smerové vyhľadávania (opísané v Proceedings of the Conference on Computer Communications (IEEE Infocom), New Orleans, Louisiana, marec 1988) zistila, že malá rýchla vyrovnávacia pamäť pre cieľové adresy môže zlepšiť výkonnosť vyhľadávania smerov o najmenej 65 percent. Bolo potrebných menej než 10 slotov, aby sa dosiahla úspešnosť vyhľadávania nad 90 percent. Takéto malé rýchle vyrovnávacie pamäte pre cieľové adresy nie sú dostatočné pri veľkej intenzite prevádzky a počte hostiteľských počítačov v dnešnom Internete.One of the first works to improve IP routing performance by not using full directional lookups (described in IEEE Infocom, New Orleans, Louisiana, March 1988) found that a small cache of destination addresses can improve directional search performance by at least 65 percent. Less than 10 slots were required to achieve search success rates above 90 percent. Such small caches for destination addresses are not sufficient for the high traffic and number of host computers on the Internet today.

ATM (asynchronous transfer móde (asynchrónny režim prenosu)) obchádza vykonávanie vyhľadávaní smerov tým, že má signalizačný protokol, ktorý prenáša adresy do siete počas vytvárania spojenia. Stav odosielania, zistený identifikátorom virtuálneho okruhu (VCI), sa inštaluje do prepínačov pozdĺž dráhy spojenia počas vytvárania spojenia. ATM bunky obsahujú VCI, ktoré sa potom dajú použiť ako priamy index do tabuľky so stavom odosielania alebo ako kľúč k transformačnej funkcii. Smerové rozhodovanie je jednoduchšie pre ATM. Avšak, ak sú veľkosti paketov väčšie než 48 bytov, je potrebné urobiť viac ATM smerových rozhodnutí.ATM (asynchronous transfer mode) bypasses performing directional searches by having a signaling protocol that transmits addresses to the network while establishing a connection. The send state, as determined by the virtual circuit identifier (VCI), is installed in the switches along the link path during the connection establishment. ATM cells contain VCIs, which can then be used as a direct index to the send status table or as a key to the transformation function. Directional decision making is easier for ATM. However, if the packet sizes are larger than 48 bytes, more ATM directional decisions need to be made.

-4Prepínanie príznakov a prepínanie toku (opísané v Proceedings of the Conference on Computer Communications (IEEE Infocom), San Francisco, California, marec 1996) sú dve IP obchádzajúce metódy, ktoré sú určené na prevádzkovanie cez ATM. Základnou ideou je nechať IP kontrolovať ATM hardvér na spojovacej úrovni, ktorý vykonáva skutočné odosielanie údajov ďalej. Medzi smerovačmi sú potrebné protokoly špeciálneho určenia (opísané v Request for Comments RFC 1953, Internet Engineering Task Force, máj 1996), aby sa dohodli na tom, ktoré ATM identifikátory virtuálneho okruhu sa majú použiť a ktorý paket by mal použiť ktorý VCI.Symptom Switching and Flow Switching (described in IEEE Infocom, San Francisco, California, March 1996) are two IP bypass methods that are designed to operate over ATM. The basic idea is to let IP control ATM-level hardware at the connection level, which performs real data forwarding. Among the routers, special purpose protocols (described in Request for Comments RFC 1953, Internet Engineering Task Force, May 1996) are required to agree which ATM virtual circuit identifiers to use and which packet should be used by which VCI.

Iný prístup s tým istým cieľom vyhnúť sa IP spracovaniu sa používa v IP/ΑΤΜ architektúre (opísanej v Proceedings of Gigabit NetWork Workshop, Boston, apríl 1995; a v Proceedings of ACM SIGCOMM '95, str. 49-58, Cambridge, Massachusetts, august 1995), kde ATM spätná matica spojí viaceré riadkové karty a smerové karty. IP spracovateľské prvky, umiestnené v smerových kartách, spracujú IP hlavičky. Keď príde prúd paketov, kontroluje sa len prvá IP hlavička a ďalšie pakety sa nasmerujú po rovnakej ceste ako prvý paket. Hlavným účelom týchto skratiek sa zdá byť amortizácia nákladov na IP spracovanie veľkého množstva paketov.Another approach with the same goal of avoiding IP processing is used in the IP / ΑΤΜ architecture (described in Proceedings of Gigabit NetWork Workshop, Boston, April 1995; and in Proceedings of ACM SIGCOMM '95, pp. 49-58, Cambridge, Massachusetts, August 1995), where an ATM back matrix connects multiple row cards and direction cards. IP processing elements placed in directional cards process IP headers. When a packet stream arrives, only the first IP header is checked and other packets are routed along the same path as the first packet. The main purpose of these abbreviations seems to be the amortization of the cost of IP processing of large numbers of packets.

Konštrukcie IP smerovačov môžu používať hardvér špeciálneho zamerania, aby uskutočnili IP spracovanie, ako je to pri IBM smerovači (opísaný v Journal of High Speed Networks 1(4), 281-288, 1993). To môže byť nepružné riešenie. Akékoľvek zmeny v IP formáte alebo protokole by takéto konštrukcie znefunkčnili. Pružnosť softvéru a prudký vzrast výkonu procesorov všeobecného zamerania robia takéto riešenia výhodnými.IP router designs can use specialty hardware to perform IP processing, as is the case with the IBM router (described in Journal of High Speed Networks 1 (4), 281-288, 1993). This may be an inflexible solution. Any changes to the IP format or protocol would render such constructs inoperable. The flexibility of the software and the rapid increase in performance of general-purpose processors make such solutions advantageous.

Iným hardvérovým prístupom je použitie CAM, aby vykonávali vyhľadávania smerov (opísané v Proceedings of the Conference on Computer Communications (IEEE Infocom), zv. 3, str. 1382-1391, San Francisco 1993). Toto je rýchle, ale drahé riešenie.Another hardware approach is to use CAM to perform directional searches (described in Proceedings of the Conference on Computer Communications (IEEE Infocom), Vol. 3, pp. 1382-1391, San Francisco 1993). This is a quick but expensive solution.

BBN v súčasnosti stavia pár multi-gigabitových smerovačov, ktoré používajú procesory všeobecného zamerania ako odosielacie prostriedky. Doteraz o tom boloBBN is currently building a pair of multi-gigabit routers that use general-purpose processors as sending means. So far it was about it

-5publikovaných málo informácií. Zdá sa však, že ideou je použiť Alpha procesory ako odosielacie prostriedky a vykonať celé IP spracovanie v softvéri. Publikácia Gigabit networking (Výstavba gigabitových sietí), Addison-Wesley, Reading, Massachusetts 1993 ukazuje, že je možné vykonať IP spracovanie v nie viac než 200 inštrukciách, predpokladajúc zásah v smerovej rýchlej vyrovnávacej pamäti. Sekundárna rýchla vyrovnávacia pamäť počítača Alpha sa využíva ako veľká LRU (least recently used (najmenej práve teraz využívaná)) rýchla vyrovnávacia pamäť pre cieľové adresy. Táto schéma predpokladá dostatok miesta v prevádzkových obrazcoch. S málom miesta by úspešné vyhľadávanie v rýchlej vyrovnávacej pamäti príliš pokleslo a výkon by sa znížil.-5published little information. However, the idea seems to be to use Alpha processors as the sending means and perform all IP processing in the software. Gigabit networking, Addison-Wesley, Reading, Massachusetts 1993 shows that it is possible to perform IP processing in no more than 200 instructions, assuming directional caching intervention. Alpha's secondary cache is used as a large LRU (least recently used) cache for destination addresses. This diagram assumes sufficient space in the operating patterns. With little space, successful caching searches would decrease too much and performance would decrease.

Preto je cieľom tohto vynálezu poskytnúť zlepšený spôsob a systém IP vyhľadávania smerov na vykonávanie úplných vyhľadávaní smerov pre každý IP paket až do gigabitových rýchlostí, pričom tento spôsob a systém prekonajú vyššie uvedené nevýhody.Therefore, it is an object of the present invention to provide an improved method and system of IP routing for performing full routing for each IP packet up to gigabit speeds, the method and system overcoming the above-mentioned disadvantages.

Ďalším cieľom je zvýšiť rýchlosti vyhľadávania smerov s bežným mikroprocesorom.Another goal is to increase the speed of direction finding with a conventional microprocessor.

Ďalším cieľom je minimalizovať dobu vyhľadávania v odosielacej tabuľke.Another goal is to minimize search time in the send table.

Iným ďalším cieľom tohto vynálezu je poskytnúť údajovú štruktúru, ktorá sa celá zmestí do rýchlej vyrovnávacej pamäte bežného mikroprocesora.Another further object of the present invention is to provide a data structure that fits entirely into the cache memory of a conventional microprocessor.

V dôsledku toho budú prístupy do pamäte rádovo rýchlejšie v porovnaní s tým, keď údajová štruktúra musí spočívať v pamäti, ktorá napríklad pozostáva z relatívne pomalej DRAM.As a result, memory accesses will be of an order of magnitude faster compared to when the data structure must consist of a memory that, for example, consists of a relatively slow DRAM.

Podstata vynálezuSUMMARY OF THE INVENTION

Tieto ciele sa dosiahnu spôsobom IP vyhľadávania smerov v smerovej tabuľke, obsahujúcej ako položky prefixy ľubovoľnej dĺžky s priradenou informáciou o nasledujúcom skoku, aby sa určilo, kam sa majú IP datagramy odoslať, ktorý zahrnuje kroky:These goals are achieved by the IP directional lookup method in the direction table, containing prefixes of any length with associated jump information to determine where to send IP datagrams, which includes the steps:

-6zapamätania do pamäťových prostriedkov reprezentácie smerovej tabuľky vo forme úplného prefixového stromu, definovaného prefixami všetkých položiek smerovej tabuľky, doplneného tak, že každý uzol má buď žiadneho alebo dvoch následníkov, pričom všetkými pridanými následníkmi sú výstupy s tou istou informáciou o nasledujúcom skoku, ako má najbližší predchodca s informáciou o nasledujúcom skoku, alebo s nedefinovaným skokom, ak taký predchodca neexistuje, zapamätania do uvedených pamäťových prostriedkov reprezentácie bitového vektora, obsahujúceho údaje o reze cez prefixový strom v aktuálnej hĺbke s jedným bitom na možný uzol v aktuálnej hĺbke, pričom tento bit je nastavený na 1, ak tam existuje uzol v prefixovom strome, zapamätania do uvedených pamäťových prostriedkov poľa smerníkov prvej úrovne pre pravé hlavy, vrátane indexov k tabuľke nasledujúcich skokov, a pre koreňové hlavy, vrátane indexov k zväzku v nasledujúcej úrovni, rozdelenia uvedeného bitového vektora na bitové masky určitej dĺžky, zapamätania do uvedených pamäťových prostriedkov poľa kódových slov, z ktorých každé kóduje riadkový index k mapovej tabuľke a relatívny ukazovateľ smerníka, zapamätania do uvedených pamäťových prostriedkov poľa bázových adries, prístupu ku kódovému slovu na mieste, ktoré zodpovedá prvej indexovej časti IP adresy v poli kódových slov, prístupu k položkovej časti mapovej tabuľky na mieste, ktoré zodpovedá stĺpcovej indexovej časti IP adresy a riadkovej indexovej časti kódového slova v mapovej tabuľke, prístupu k bázovej adrese na mieste, ktoré zodpovedá druhej indexovej časti IP adresy v poli bázových adries, a prístupu k smerníku na mieste, ktoré zodpovedá bázovej adrese plus relatívnemu ukazovateľu smerníka kódového slova plus položkovej časti mapovej tabuľky v poli smerníkov,-6 memorizing the direction table representation memory means in the form of a complete prefix tree defined by the prefixes of all direction table entries, supplemented so that each node has either no or two successors, all successors added being outputs with the same jump information as it has the next predecessor with information about the next jump, or an undefined jump, if no such predecessor exists, storing in said memory means a representation of the bit vector containing the section data through the prefix tree at the current depth with one bit per possible node at the current depth is set to 1, if there is a node in the prefix tree, memorizing to the above-mentioned memory means the array of first-level pointers for the right heads, including indexes to the following jumps table, and for the root heads, including indexes to the volume in dividing said bit vector into bit masks of a certain length, storing into said memory means a field of code words, each of which encodes a row index to the map table and a relative pointer pointer, storing into said memory means a base address field a location corresponding to the first index portion of an IP address in the codeword field, accessing a map portion of the map table at a location that corresponds to a column index portion of an IP address, and a codeword row index portion of the map table the index portion of the IP address in the base address field, and the access to the pointer at a location that corresponds to the base address plus the relative pointer of the codeword pointer plus the map portion of the map table in the pointer field,

-Ί podstatou ktorého je, že krok zapamätania do uvedených pamäťových prostriedkov reprezentácie možných bitových masiek v mapovej tabuľke zahrnuje krok zapamätania reprezentácie možných bitových masiek, ktoré majú tú vlastnosť, že ľubovoľný interval bitov, ktorého dĺžka je párnou mocninou dvoch a začína pri bitovom indexe, ktorý je násobkom tej istej mocniny dvoch, buď obsahuje samé nuly, alebo má najnižší bit nastavený na 1.- the principle being that the step of storing into said memory means of representing possible bit masks in the map table comprises the step of storing representations of possible bit masks having the property that any bit interval whose length is equal to two and starts at the bit index, which is a multiple of the same power of two, either contains all zeros or has the lowest bit set to 1.

Ak je smerníkom index k zväzku nasledujúcej úrovne, zahrnuje spôsob podľa vynálezu ďalší krok prístupu k zväzku druhej úrovne, aby sa našiel smerník v poli smerníkov zväzkov druhej úrovne pre pravé hlavy, vrátane indexu k tabuľke nasledujúcich skokov, a pre koreňové hlavy, vrátane indexu k zväzku tretej úrovne.If the pointer is an index to the next-level bundle, the method of the invention includes the next step of accessing the second-level bundle to find the pointer in the second-level bundle pointers for the right heads, including the index to the next jump table, and for the root heads, including the index k third-level volume.

Ak je smerníkom v poli smerníkov zväzkov druhej úrovne index k zväzku tretej úrovne, zahrnuje spôsob podľa vynálezu ďalší krok prístupu k zväzku tretej úrovne, aby sa našiel smerník v poli smerníkov zväzkov tretej úrovne, vrátane indexov k tabuľke nasledujúcich skokov.If the pointer in the second-level bundle directional array is an index to the third-level bundle, the method of the invention includes a further step of accessing the third-level bundle to find the pointer in the third-level bundle directional array, including indexes to the next jump table.

Ak zväzok obsahuje 1 až 8 hláv, zväzok je riedky zväzok a je reprezentovaný poľom 8-bitových indexov hláv a ôsmimi 16-bitovými smerníkmi, ak zväzok obsahuje 9 až 64 hláv, zväzok je hustý zväzok a je reprezentovaný analogicky s prvou úrovňou, ak zväzok obsahuje 65 až 256 hláv, zväzok je veľmi hustý zväzok a je reprezentovaný analogicky s prvou úrovňou.If a bundle contains 1 to 8 heads, the bundle is a thin bundle and is represented by an 8-bit head index field and eight 16-bit pointers, if the bundle contains 9 to 64 heads, the bundle is a dense bundle and is represented analogously to the first level if the bundle it contains 65 to 256 heads, the bundle is a very dense bundle and is represented analogously to the first level.

Ďalej vynález poskytuje systém na IP vyhľadávanie smerov v smerovej tabuľke, zahrnujúcej ako položky prefixy ľubovoľnej dĺžky s priradenou informáciou o nasledujúcom skoku v tabuľke nasledujúcich skokov, aby sa určilo, kam sa majú IP datagramy odoslať, smerovú tabuľku vo forme úplného prefixového stromu, definovaného prefixami všetkých položiek smerovej tabuľky, pričom každý uzol má buď žiadneho alebo dvoch následníkov, pričom všetkými pridanými následníkmi sú výstupy s tou istou informáciou o nasledujúcom skoku, ako má najbližší predchodca s informáciou o nasledujúcom skoku, alebo s nedefinovaným skokom, ak taký predchodca neexistuje,Further, the invention provides a system for retrieving IP directions in a routing table, including as prefixes of any length with associated next hop information in the next hop table to determine where IP datagrams are to be sent, a routing table in the form of a complete prefix tree defined by prefixes all items in the direction table, with each node having either no or two successors, with all successors added being outputs with the same next jump information as the next predecessor with the next jump information, or an undefined jump if there is no such predecessor,

-8reprezentáciu bitového vektora, zahrnujúceho údaje o reze cez prefixový strom v aktuálnej hĺbke s jedným bitom na možný uzol v aktuálnej hĺbke, pričom tento bit je nastavený na 1, ak tam existuje uzol v prefixovom strome, pole smerníkov pre pravé hlavy, vrátane indexov k tabuľke nasledujúcich skokov, a pre koreňové hlavy, vrátane indexov k zväzku nasledujúcej úrovne, uvedený bitový vektor rozdelený na bitové masky určitej dĺžky, mapovú tabuľku, obsahujúcu reprezentáciu možných bitových masiek, pole kódových slov, z ktorých každé kóduje riadkový index k mapovej tabuľke a relatívny ukazovateľ smerníka, a pole bázových adries, v ktorom možné bitové masky majú tú vlastnosť, že ľubovoľný interval bitov, ktorého dĺžka je párnou mocninou dvoch a začína pri bitovom indexe, ktorý je násobkom tej istej mocniny dvoch, buď obsahuje samé nuly, alebo má najnižší bit nastavený na 1.-8 a representation of the bit vector including the section data through the prefix tree at the current depth with one bit per possible node at the current depth, which bit is set to 1 if there is a node in the prefix tree a table of subsequent jumps, and for root heads, including indexes to the next-level bundle, said bit vector divided into bit masks of a certain length, a map table containing a representation of possible bit masks, codeword fields each coding a row index to the map table; a pointer pointer, and a base address field in which possible bit masks have the property that any bit interval whose length is an even power of two and starts at a bit index that is a multiple of the same power of two, either contains all zeros or has the lowest bit set to 1.

Zväzkom nasledujúcej úrovne je zväzok druhej úrovne, reprezentovaný poľom smerníkov zväzku druhej úrovne pre pravé hlavy, vrátane indexov k tabuľke nasledujúcich skokov, a pre koreňové hlavy, vrátane indexov k zväzku tretej úrovne.The next-level bundle is the second-level bundle, represented by the second-level bundle pointer field for the right heads, including indexes to the next jump table, and for the root heads, including the indexes to the third-level bundle.

Zväzok tretej úrovne je reprezentovaný poľom smerníkov zväzku tretej úrovne, vrátane indexov k tabuľke nasledujúcich skokov.The third-level bundle is represented by the array of third-level bundle pointers, including indexes to the next jump table.

Systémom je údajová štruktúra, ktorá môže reprezentovať veľké smerové tabuľky vo veľmi kompaktnej forme a ktorá sa dá prehľadať rýchlo s použitím malého počtu pamäťových odkazov.The system is a data structure that can represent large directional tables in a very compact form and that can be searched quickly using a small number of memory links.

Vynález je podrobnejšie vysvetlený na výkresoch a výhody a znaky výhodných uskutočnení tohto vynálezu budú podrobne opísané ďalej.The invention is explained in more detail in the drawings and the advantages and features of the preferred embodiments of the invention will be described in detail below.

Prehľad obrázkov na výkresochBRIEF DESCRIPTION OF THE DRAWINGS

Obr. 1 je schematický pohľad na návrh smerovača, kde 3 sú odosielacie prostriedky, 1 a 2 je rozhranie a 4 je sieťový procesor.Fig. 1 is a schematic view of a router design, wherein 3 is the sending means, 1 and 2 is the interface, and 4 is the network processor.

Obr. 2 je ilustratívny pohľad na binárny strom, preklenujúci celý IP adresový priestor,Fig. 2 is an illustrative view of a binary tree spanning the entire IP address space,

-9Obr. 3 je ilustratívny pohľad na smerové položky, definujúci rozsahy IP adries,-9Obr. 3 is an illustrative view of directional items defining ranges of IP addresses,

Obr. 4 je ilustratívny pohľad na krok rozšírenia prefixového stromu na úplný, Obr. 5 je ilustratívny pohľad na tri úrovne údajovej štruktúry podľa tohto vynálezu,Fig. 4 is an illustrative view of the step of extending the prefix tree to complete; FIG. 5 is an illustrative view of three levels of data structure according to the present invention;

Obr. 6 je ilustratívny pohľad na časť rezu prefixovým stromom v hĺbke 16,Fig. 6 is an illustrative view of a section of a prefix tree at depth 16;

Obr. 7 je ilustratívny pohľad na prehľadávanie údajovej štruktúry na prvej úrovni,Fig. 7 is an illustrative view of first level data structure search,

Obr. 8 je tabuľka, ilustrujúca údaje o odosielacích tabuľkách, zostrojených z rozličných smerových tabuliek,Fig. 8 is a table illustrating send table data constructed from different directional tables;

Obr. 9 je tabuľka, ilustrujúca údaje o procesore a rýchlej vyrovnávacej pamäti,Fig. 9 is a table illustrating processor and cache data,

Obr. 10 je graf, znázorňujúci rozdelenie vyhľadávacích časov pre Alpha 21164, aFig. 10 is a graph showing the distribution of search times for Alpha 21164, and

Obr. 11 je graf, znázorňujúci rozdelenie vyhľadávacích časov pre PentiumFig. 11 is a graph showing the distribution of search times for a Pentium

Pro.Pro.

Príklady uskutočnenia vynálezuDETAILED DESCRIPTION OF THE INVENTION

S odkazom na obr. 1 konštrukcia smerovača zahrnuje viaceré vnútri siete viazané rozhrania 1, zo siete von smerujúce rozhrania 2, odosielacie prostriedky 3 a sieťový procesor 4, ktoré sú všetky prepojené prepojovacou štruktúrou 5. Vnútri viazané rozhrania 1 pošlú hlavičky paketov odosielacím prostriedkom 3 cez prepojovaciu štruktúru 5. Odosielacie prostriedky 3 zasa určia, ku ktorému von smerujúcemu rozhraniu 2 sa má paket poslať. Táto informácia sa pošle späť k vnútri viazanému rozhraniu 1, ktoré odošle paket von smerujúcemu rozhraniu 2. Jedinou úlohou odosielacích prostriedkov 3 je spracovať hlavičky paketov. Všetky ostatné úlohy, ako je podieľanie sa na smerových protokoloch, rezervácia zálohy (zdrojov), manipulácia s paketmi, ktoré vyžadujú zvláštnu pozornosť, a iné administratívne úlohy spracuje sieťový procesor 4.Referring to FIG. 1, the router structure comprises a plurality of network-bound interfaces 1, network-outbound interfaces 2, sender means 3, and a network processor 4, all interconnected by the interconnect structure 5. the means 3 in turn determine to which outwardly directed interface 2 the packet is to be sent. This information is sent back to the internal bound interface 1, which sends a packet to the outgoing interface 2. The only task of the sending means 3 is to process the packet headers. All other tasks such as sharing routing protocols, reserving backups (resources), handling packets that require special attention, and other administrative tasks are handled by the network processor 4.

-10Každé odosielacie prostriedky 3 používajú lokálnu verziu smerovej tabuľky, odosielacej tabuľky, stiahnuté zo sieťového procesora 4 a zapamätané v pamäťových prostriedkoch odosielacích prostriedkov 3, aby robili svoje smerové rozhodnutia. Nie je nevyhnutné sťahovať novú odosielaciu tabuľku pre každú smerovú aktualizáciu. Smerové aktualizácie môžu byť časté, ale keďže smerové protokoly potrebujú určitú dobu na konvergenciu, odosielacie tabuľky sa môžu stať mierne zastaralými a nepotrebujú zmenu častejšie než maximálne raz za sekundu (opísané v Stanford University Workshop on Fast Routing and Switching (Stanford University seminár o rýchlom smerovaní a prepínaní), december 1996; http“//tinytera.stanford.edu/Workshop_Dec96/).Each transmission means 3 uses a local version of the direction table, the send table, downloaded from the network processor 4 and stored in the memory means of the transmission means 3 to make their directional decisions. It is not necessary to download a new send table for each directional update. Directional updates may be frequent, but as directional protocols require some time to converge, the send tables may become slightly outdated and need no change more than once per second (described in the Stanford University Fast Routing Workshop) and switching), December 1996; http: // tinytera.stanford.edu/Workshop_Dec96/).

Sieťový procesor 4 potrebuje dynamickú smerovú tabuľku, navrhnutú na rýchle aktualizácie a rýchle generovanie odosielacích tabuliek. Odosielacie tabuľky sa na druhej strane dajú optimalizovať na rýchlosť vyhľadávania a nemusia byť dynamické.The network processor 4 needs a dynamic routing table designed to quickly update and generate the send tables. On the other hand, the send tables can be optimized for search speed and may not be dynamic.

Aby sa minimalizovala doba vyhľadávania, musia sa v údajovej štruktúre v odosielacej tabuľke súčasne minimalizovať dva parametre, počet prístupov do pamäte, potrebný počas vyhľadávania, a veľkosť údajovej štruktúry.To minimize search time, two parameters, the number of memory accesses required during the search, and the size of the data structure, must be minimized simultaneously in the data structure in the send table.

Zníženie počtu prístupov do pamäte, potrebných počas vyhľadávania, je dôležité, pretože prístupy do pamäte sú pomerne pomalé a tvoria obyčajne úzky profil procedúr vyhľadávania. Ak sa dá údajová štruktúra dostatočne zmenšiť, môže sa celá zmestiť do rýchlej vyrovnávacej pamäte bežného mikroprocesora. To znamená, že prístupy do pamäte budú rádovo rýchlejšie než v prípade, keď údajová štruktúra musí spočívať v pamäti, pozostávajúcej z relatívne pomalej DRAM, ako je tomu v prípade Patrícia stromov.Reducing the number of memory accesses needed during a search is important because memory accesses are relatively slow and usually form a narrow profile of search procedures. If the data structure can be sufficiently reduced, it can fit entirely into the cache of a conventional microprocessor. This means that memory accesses will be of an order of magnitude faster than if the data structure must consist of a memory consisting of a relatively slow DRAM, as is the case with Tree Patients.

Ak sa odosielacia tabuľka nevojde celá do rýchlej vyrovnávacej pamäte, stále je výhodné, ak veľká časť tabuľky môže zostať v rýchlej vyrovnávacej pamäti. Rozmiestnenie v prevádzkových obrazcoch bude udržiavať najčastejšie používané časti údajovej štruktúry v rýchlej vyrovnávacej pamäti, takže väčšina vyhľadávaní bude rýchla. Naviac sa už dnes dá použiť rýchla SRAM pre malú potrebnú externúIf the send table does not fit all into the cache, it is still advantageous if a large portion of the table can remain in the cache. The layout in the traffic patterns will keep the most frequently used parts of the data structure cached, so most searches will be fast. In addition, a fast SRAM can now be used for a small external device

-11 pamäť. SRAM je drahá a tým drahšia, čím je rýchlejšia. Pri danej cene SRAM môže byť rýchlejšia, ak je jej treba menej.-11 memory. SRAM is expensive and the more expensive the faster it is. At a given price, SRAM may be faster if less is needed.

Ako sekundárne konštrukčné ciele by údajová štruktúra mala potrebovať len málo inštrukcií počas vyhľadávania a udržiavať entity podľa možnosti čo najprirodzenejšie usporiadané, aby sa nemuseli použiť drahé inštrukcie a ťažkopádne operácie výberu bitov.As secondary design objectives, the data structure should need little instruction during the search and keep entities as naturally organized as possible, avoiding the use of expensive instructions and cumbersome bit selection operations.

Aby sa určili kvantitatívne parametre návrhu údajovej štruktúry, preskúmali sa viaceré veľké smerové tabuľky, ako opíšeme ďalej. V týchto tabuľkách je okolo 40 000 rozličných smerových položiek. Ak sú nasledujúce skoky rovnaké, zvyšok smerovej informácie je tiež ten istý, a teda všetky smerové položky, ktoré špecifikujú ten istý nasledujúci skok, môžu zdieľať smerovú informáciu. Počet rozličných nasledujúcich skokov v smerovej tabuľke smerovača je obmedzený počtom iných smerovačov alebo hostiteľských počítačov, ktoré sa dajú dosiahnuť jedným skokom, takže neprekvapuje, že tieto počty môžu byť malé aj pre veľké heterogénne smerovače. Avšak, ak je smerovač pripojený napríklad k veľkej ATM sieti, počet nasledujúcich skokov môže byť oveľa vyšší.In order to determine the quantitative parameters of the data structure design, several large directional tables have been examined, as will be described below. In these tables, there are around 40,000 different directional items. If the following jumps are the same, the rest of the directional information is also the same, and thus all directional items that specify the same next jump can share the directional information. The number of different successive hops in the router routing table is limited by the number of other routers or host computers that can be reached by one hop, so it is not surprising that these numbers may be small even for large heterogeneous routers. However, if the router is connected to, for example, a large ATM network, the number of subsequent jumps may be much higher.

V tomto uskutočnení je údajová štruktúra odosielacej tabuľky navrhnutá tak, aby pojala 214 alebo 16K rôznych nasledujúcich skokov, čo by pre väčšinu prípadov malo postačovať. Ak existuje menej než 256 rôznych nasledujúcich skokov, takže index k tabuľke nasledujúcich skokov sa dá zapamätať do jediného bytu, odosielacie tabuľky, ktoré sú tu opísané, sa dajú v inom uskutočnení modifikovať tak, aby zaberali podstatne menej miesta.In this embodiment, the send table data structure is designed to accommodate 2 14 or 16K different subsequent jumps, which would be sufficient for most cases. If there are less than 256 different subsequent jumps, so that the index to the following jumps table can be memorized in a single byte, the send tables described herein may be modified in another embodiment to occupy substantially less space.

Odosielacia tabuľka je v podstate strom s tromi úrovňami. Prehľadanie jednej úrovne vyžaduje jeden až štyri prístupy do pamäte. V dôsledku toho maximálny počet prístupov do pamäte je dvanásť. Avšak s bežnými smerovými tabuľkami veľká väčšina vyhľadávaní vyžaduje prehľadanie len jednej alebo dvoch úrovní, takže počet prístupov do pamäte je najpravdepodobnejšie osem alebo menej.The send table is basically a tree with three levels. One level scan requires one to four memory accesses. As a result, the maximum number of memory accesses is twelve. However, with conventional routing tables, the vast majority of searches require only one or two levels to be crawled, so the number of memory accesses is likely to be eight or less.

Za účelom pochopenia údajovej štruktúry si predstavme binárny strom 6, ktorý preklenuje celý IP adresový priestor, znázornený na obr. 2. Jeho hĺbka je 32 a počet výstupov je 232, jeden pre každú možnú IP adresu. Prefix položky smerovejIn order to understand the data structure, consider a binary tree 6 that spans the entire IP address space shown in FIG. 2. Its depth is 32 and the number of outputs is 32 , one for each possible IP address. Directional item prefix

-12tabuľky definuje dráhu v strome, ktorá končí v niektorom uzle. Všetky IP adresy (výstupy) v podstrome, ktorý začína v tomto uzle, by mali byť smerované podľa tejto smerovej položky. Týmto spôsobom každá položka smerovej tabuľky definuje rozsah IP adries s rovnakou smerovou informáciou.The -12 table defines a path in the tree that ends at a node. All IP addresses (outputs) in a subtree that begins at this node should be routed according to this routing entry. In this way, each routing table entry defines a range of IP addresses with the same routing information.

Ak niekoľko smerových položiek pokrýva tie isté IP adresy, aplikuje sa pravidlo najdlhšej zhody; to hovorí, že pre danú IP adresu by sa mala použiť smerová položka s najdlhším zhodným prefixom. Táto situácia je ilustrovaná na obr. 3; smerová položka el je krytá e2 pre adresy v rozsahu r.If several routing entries cover the same IP addresses, the longest match rule applies; this indicates that the routing entry with the longest matching prefix should be used for the given IP address. This situation is illustrated in FIG. 3; the directional entry el is covered by e2 for addresses in the range r.

Odosielacia tabuľka je reprezentáciou binárneho stromu 6, preklenutého všetkými smerovými položkami, prefixového stromu 7. Vyžaduje sa, aby prefixový strom bol úplný, t. j. aby každý uzol v strome mal buď dvoch alebo žiadneho následníka. Uzly s jediným následníkom sa musia rozšíriť, aby mali dvoch následníkov; následníci, pridaní týmto spôsobom, sú vždy výstupmi a ich informácia o nasledujúcom skoku bude tá istá ako informácia o nasledujúcom skoku najbližšieho predchodcu s informáciou o nasledujúcom skoku alebo „nedefinovaný“ nasledujúci skok, ak takýto predchodca neexistuje.The send table is a representation of the binary tree 6, spanned by all directional items, of the prefix tree 7. The prefix tree is required to be complete, i. j. so that each node in the tree has either two or no successors. Nodes with a single successor must extend to have two successors; the successors added in this way are always outputs and their information about the next jump will be the same as the next jump information of the next predecessor with the next jump information or the "undefined" next jump if there is no such predecessor.

Táto procedúra, ilustrovaná na obr. 4, zvyšuje počet uzlov v prefixovom strome 7, ale umožňuje zostrojiť malú odosielaciu tabuľku. Avšak na zostrojenie odosielacej tabuľky nie je nevyhnutné skutočne zostrojiť prefixový strom. Prefixový strom sa používa na zjednodušenie opisu. Odosielacia tabuľka sa dá zostrojiť počas jediného behu cez všetky smerové položky.This procedure, illustrated in FIG. 4, increases the number of nodes in the prefix tree 7, but allows a small send table to be constructed. However, it is not necessary to actually construct a prefix tree to construct a send table. The prefix tree is used to simplify the description. The send table can be constructed in a single run across all directional items.

Súbor smerových položiek rozdeľuje IP adresový priestor na súbory IP adries. Problém nájdenia správnej smerovej informácie je podobný problému susedstva súboru intervalov (interval set membership problém) (opísaný v SIAM Journal on Computing 17(1), 1093-1102, december 1988). V tomto prípade je každý interval definovaný uzlom v prefixovom strome, a preto má vlastnosti, ktoré sa dajú použiť na skomprimovanie odosielacej tabuľky. Napríklad každý rozsah IP adries má dĺžku, ktorá je mocninou dvoch.The routing file divides the IP address space into IP address files. The problem of finding the right directional information is similar to the problem of the interval set membership problem (described in SIAM Journal on Computing 17 (1), 1093-1102, December 1988). In this case, each interval is defined by a node in the prefix tree, and therefore has properties that can be used to compress the send table. For example, each range of IP addresses has a length that is a power of two.

Ako je znázornené na obr. 5, úroveň jedna údajovej štruktúry kryje prefixový strom do hĺbky 16, úroveň dva kryje hĺbky 17 až 24 a úroveň tri hĺbky 25 až 32.As shown in FIG. 5, level one of the data structure covers the prefix tree to a depth of 16, level two covers the depths of 17 to 24, and level three of the depths of 25 to 32.

-13Kdekoľvek sa časť prefixového stromu rozprestiera pod úrovňou 16, zväzok na úrovni dva opisuje túto časť stromu. Podobne zväzky na úrovni tri opisujú časti prefixového stromu, ktoré sú hlbšie než 24. Výsledkom prehľadávania niektorej úrovne údajovej štruktúry je buď index k tabuľke nasledujúcich skokov alebo index k poľu zväzkov pre nasledujúcu úroveň.-13Wherever a part of the prefix tree extends below level 16, the volume at level two describes that part of the tree. Similarly, tier three volumes describe portions of the prefix tree that are deeper than 24. A search of any level of the data structure results in either an index to a table of subsequent jumps or an index to a volume field for the next level.

Napríklad na úrovni 1 údajovej štruktúry na obr. 5 je rez prefixovým stromom 7 v hĺbke 16. Rez je zapamätaný v bitovom vektore s jedným bitom na možný uzol v hĺbke 16. Vyžaduje sa teda 216 bitov = 64 kilobitov = 8 kilobytov. Aby sa našiel bit, zodpovedajúci začiatočnej časti IP adresy, ako index k bitovému vektoru sa použije horných 16 bitov tejto adresy.For example, at level 1 of the data structure of FIG. 5 is a sectional view of a prefix tree 7 in the depth of cut 16 is stored in the bit vector with one bit per possible node at the depth of 16 is required, therefore 2 16 bits = 64 kilobits = 8 kilobytes. To find the bit corresponding to the initial portion of the IP address, the upper 16 bits of that address are used as an index to the bit vector.

Ak existuje uzol v prefixovom strome v hĺbke 16, zodpovedajúci bit vo vektore sa nastaví na 1. Tiež, keď má strom výstup v hĺbke menšej než 16, najnižší bit v intervale, ktorý je krytý týmto výstupom, je nastavený na 1. Všetky ostatné bity sú nulové. Bit v bitovom vektore teda môže byť taký, ktorý reprezentuje skutočnosť, že prefixový strom pokračuje pod rez; koreňová hlava (bity 6, 12 a 13 na obr. 6), alebo taký, ktorý reprezentuje výstup v hĺbke 16 alebo menej; pravá hlava (bity 0, 4, 7, 8, 14 a 15 na obr. 6), alebo nula, čo znamená, že táto hodnota je členom rozsahu, krytého výstupom v hĺbke menšej než 16 (bity 1, 2, 3, 5, 9, 10 a 11 na obr. 6). Tieto členy majú ten istý nasledujúci skok ako najvyššia hlava, nižšia než člen.If there is a node in the prefix tree at depth 16, the corresponding bit in the vector is set to 1. Also, if the tree has an output at a depth less than 16, the lowest bit in the interval covered by that output is set to 1. All other bits are zero. Thus, the bit in the bit vector may be one that represents the fact that the prefix tree continues below the slice; a root head (bits 6, 12 and 13 in Fig. 6), or one that represents an output at a depth of 16 or less; right head (bits 0, 4, 7, 8, 14 and 15 in Fig. 6), or zero, which means that this value is a member of the range covered by the output at a depth of less than 16 (bits 1, 2, 3, 5 9, 10 and 11 in FIG. 6). These members have the same following jump as the highest head, lower than the member.

Pre pravé hlavy sa index k tabuľke nasledujúcich skokov musí zapamätať. Členy budú používať ten istý index ako najvyššia hlava, nižšia než člen. Pre koreňové hlavy sa musí zapamätať index k zväzku na úrovni dva, ktorý reprezentuje zodpovedajúci podstrom. Informácia o hlavách je zapamätaná v 16bitových smerníkoch, zapamätaných v poli. Dva bity smerníka kódujú, o aký druh smerníka ide, a zvyšných 14 bitov sú buď indexy k tabuľke nasledujúcich skokov alebo k poľu, obsahujúcemu zväzky na úrovni dva.For the right heads, the index to the following jumps table must be remembered. Members will use the same index as the highest head, lower than the member. For root heads, the level-two index to the corresponding subtree must be remembered. The head information is stored in 16-bit pointers stored in the array. The two bits of the pointer encode what kind of pointer is, and the remaining 14 bits are either indexes to the next hop table or to a field containing two-level bundles.

Aby sa našiel správny smerník, bitový vektor je rozdelený na bitové masky s dĺžkou 16 a tých je 212 = 4096. Ďalej, poloha smerníka v poli sa získa sčítaním trochIn order to find the correct pointer, the bit vector is divided into bit masks with a length of 16 and these are 2 12 = 4096. Further, the position of the pointer in the array is obtained by adding three

- 14entít: bázového indexu, 6-bitového relatívneho ukazovateľa a 4-bitového relatívneho ukazovateľa. Bázový index plus 6-bitový relatívny ukazovateľ určuje, kde sú smerníky, zodpovedajúce konkrétnej bitovej maske, zapamätané. 4-bitový relatívny ukazovateľ špecifikuje, ktorý smerník spomedzi nich sa má vybrať. Obr. 7 znázorňuje, ako sa tieto entity nájdu. Nasledujúce odseky sa zaoberajú touto procedúrou.- 14entits: base index, 6-bit relative indicator and 4-bit relative indicator. The base index plus the 6-bit relative pointer determines where the pointers corresponding to a particular bit mask are remembered. The 4-bit relative pointer specifies which pointer to select from. Fig. 7 illustrates how these entities are found. The following paragraphs deal with this procedure.

Pretože bitové masky sa generujú z úplného prefixového stromu, nie sú možné všetky kombinácie 16 bitov. Nenulovou bitovou maskou dĺžky 2n môže byť ľubovoľná kombinácia dvoch bitových masiek dĺžky n alebo bitová maska s hodnotou 1. Nech a(n) je počet možných nenulových bitových masiek dĺžky 2n. a(n) je definované rekurentne a(0) = 1, a(n) = 1+a(n-1)2 Because bit masks are generated from a complete prefix tree, not all 16-bit combinations are possible. The non-zero bit mask of length 2n may be any combination of two bit masks of length n or a bit mask of value 1. Let a (n) be the number of possible non-zero bit masks of length 2 n . and (n) is defined recurrently and (0) = 1, and (n) = 1 + and (n-1) 2

Počet možných bitových masiek s dĺžkou 16 je teda a(4) + 1 = 678, kde jednotka je pridaná preto, lebo bitová maska môže byť nulová. Index k tabuľke s položkou pre každú bitovú masku teda potrebuje len 10 bitov.Thus, the number of possible bit masks with a length of 16 is a (4) + 1 = 678, where the unit is added because the bit mask may be zero. Thus, an index to an entry table for each bit mask only needs 10 bits.

Takáto tabuľka, mapová tabuľka, sa drží na mapovanie bitových čísel v bitovej maske na 4-bitové relatívne ukazovatele. Tento relatívny ukazovateľ špecifikuje, koľko smerníkov sa má preskočiť, aby sa našiel ten, ktorý chceme, takže sa rovná počtu bitov, nastavených na 1, menšiemu než bitový index. Tieto relatívne ukazovatele sú rovnaké pre všetky odosielacie tabuľky bez ohľadu na to, aké hodnoty by smerníky mohli mať. Mapová tabuľka je konštantná, vygeneruje sa raz a navždy.Such a table, the map table, is held to map the bit numbers in the bit mask to 4-bit relative pointers. This relative indicator specifies how many pointers to skip to find the one we want, so it equals the number of bits set to 1 less than the bit index. These relative indicators are the same for all dispatch tables, no matter what values the pointers might have. The map table is constant, it is generated once and for all.

Možné bitové masky majú vlastnosť, že akýkoľvek interval bitov, ktorého dĺžka je párnou mocninou dvoch a začína pri bitovom indexe, ktorý je násobkom tej istej mocniny dvoch, buď 1) obsahuje samé nuly, alebo 2) má najnižší bit nastavený na 1.Possible bit masks have the property that any bit interval whose length is an even power of two and starts at a bit index that is a multiple of the same power of two, either 1) contains all zeros, or 2) has the lowest bit set to 1.

Mapovanie z bitovej masky a bitu na relatívny ukazovateľ, poskytované mapovou tabuľkou, spolu s rozšírením prefixu, ktoré robí prefixový strom úplným aMapping from bit mask and bit to relative pointer provided by the map table, along with prefix extensions that make the prefix tree complete and

-15umožňuje použiť mapovanie, je kľúčom na dosiahnutie malej veľkosti odosielacej tabuľky.-15Letting mapping is the key to achieving a small send table size.

Skutočné bitové masky nie sú potrebné a namiesto bitového vektora držíme pole 16-bitových kódových slov, pozostávajúcich z 10-bitového indexu k mapovej tabuľke plus 6-bitového relatívneho ukazovateľa. 6-bitový relatívny ukazovateľ kryje až do 64 smerníkov, takže je potrebný jeden bázový index na štyri kódové slová. Môže existovať najviac 64K smerníkov, takže bázové indexy potrebujú byť najviac 16 bitové (216 = 64K).True bit masks are not needed and instead of a bit vector we hold an array of 16-bit code words consisting of a 10-bit index to the map table plus a 6-bit relative pointer. The 6-bit relative pointer covers up to 64 pointers, so one base index per four code words is required. There can be a maximum of 64K pointers, so base indexes need to be a maximum of 16 bits (2 16 = 64K).

Nasledujúce kroky v pseudokóde v procedúre, znázornenej na obr. 7, sú potrebné na prehľadanie prvej úrovne údajovej štruktúry, kde pole kódových slov sa nazýva „code“, pole bázových adries sa nazýva „base“, ix je prvá indexová časť IP adresy v poli kódových slov, „bit“ je stĺpcová indexová časť IP adresy do mapovej tabuľky („maptable“), „ten je riadková indexová časť kódového slova do mapovej tabuľky, „bix“ je druhá indexová časť IP adresy do poľa bázových adries a „pix“ je smerník do poľa smerníkov, zahrnujúceho indexy k tabuľke nasledujúcich skokov, ako aj indexy k zväzku na úrovni dva.The following steps in the pseudocode of the procedure shown in FIG. 7, are needed to search the first level of the data structure where the codeword field is called "code", the base address field is called "base", ix is the first index part of the IP address in the codeword field, "bit" is the column index part of IP "maptable", "this is the row index part of the codeword into the map table," bix "is the second index part of the IP address into the base address field, and" pix "is the pointer to the field of pointers including indexes to the table following jumps, as well as indexes to the volume at level two.

ix := horných 12 bitov IP adresy bit := spodné 4 z horných 16 bitov IP adresového kódového slova := code[ix] ten := desať bitov z kódového slova six := šesť bitov z kódového slova bix := horných desať bitov IP adresy pix := base[bix] + six + maptable[ten][bit] pointer := levell_pointers[pix]ix: = top 12 bits of IP address bit: = bottom 4 of the top 16 bits of the IP address codeword: = code [ix] ten: = ten bits of code word six: = six bits of code word bix: = top ten bits of IP pix: = base [bix] + six + maptable [ten] pointer: = levell_pointers [pix]

Je teda potrebných len niekoľko výberov bitov, odkazov na polia a sčítaní. Nie sú potrebné žiadne inštrukcie násobenia alebo delenia s výnimkou vnútorných násobení, keď sa indexujú polia.Thus, only a few bit selections, field references, and additions are needed. No multiplication or division instructions are required except for internal multiplication when fields are indexed.

Na prehľadanie prvej úrovne je potrebný prístup k celkove 7 bytom: dvojbytovému kódovému slovu, dvojbytovej bázovej adrese, jednému bytu (v skutočnosti 4 bity) v mapovej tabuľke a nakoniec k dvojbytovému smerníku. VeľkosťA total of 7 bytes are needed to search the first level: a two-byte codeword, a two-byte base address, one byte (actually 4 bits) in the map table, and finally a two-byte pointer. size

-16prvej úrovne je 8 kilobytov pre pole kódových slov, 2 kilobyty pre pole bázových indexov plus počet smerníkov. 5,3 kilobytu, potrebných pre mapovú tabuľku, sú zdieľané medzi všetkými tromi úrovňami.-16 the first level is 8 kilobytes for the codeword field, 2 kilobytes for the base index field, plus the number of pointers. The 5.3 kilobytes needed for the map table are shared among all three levels.

Keď je bitová maska nulová, alebo má jediný bit nastavený na 1, smerník musí byť indexom k tabuľke nasledujúcich skokov. Takéto smerníky sa dajú zakódovať priamo do kódového slova a teda mapová tabuľka nemusí obsahovať položky pre bitové masky jedna a nula. Počet položiek mapovej tabuľky je teda znížený na 676 (indexy 0 až 675). Keď je desať bitov v kódovom slove (vyššie uvedené „ten“) väčších než 675, kódové slovo reprezentuje priamy index do tabuľky nasledujúcich skokov. Šesť bitov z kódového slova sa používa ako najspodnejších 6 bitov v indexe a (ten - 676) sú horné bity indexu. Toto kódovanie umožňuje najviac (1024 - 676) x 2® = 22272 indexov nasledujúcich skokov, čo je viac než 16K, pre ktoré robíme návrh. Táto optimalizácia eliminuje tri pamäťové odkazy, keď je smerová položka umiestnená v hĺbke 12 alebo vyššie, a podstatne znižuje počet smerníkov v poli smerníkov. Cenou za to je jedno porovnávanie a jedno podmienené vetvenie.When the bit mask is zero or has a single bit set to 1, the pointer must be an index to the following jumps table. Such pointers can be encoded directly into the codeword and thus the map table does not need to include entries for bit masks one and zero. The number of map table items is therefore reduced to 676 (indexes 0 to 675). When ten bits in the code word (the "one" above) is greater than 675, the code word represents a direct index to the table of subsequent jumps. Six bits of the codeword are used as the lowest 6 bits in the index and (ten - 676) are the upper bits of the index. This encoding allows a maximum of (1024 - 676) x 2® = 22272 indexes of the following jumps, which is more than 16K for which we are designing. This optimization eliminates three memory references when the directional item is located at a depth of 12 or higher, and substantially reduces the number of pointers in the pointer array. The price is one comparison and one conditional branch.

Mapovanie je zahrnuté v nasledujúcich údajoch a funkciách v programovacom jazyku C.Mapping is included in the following data and features in C programming language.

Dôležitým znakom tohto kódu je mapovanie, ktoré poskytuje z jednotlivej bitovej masky na pole relatívnych ukazovateľov.An important feature of this code is the mapping that it provides from a single bit mask to a field of relative pointers.

Variácie, ako je permutovanie položiek „mtable“ (a „mt“), poskytne to isté mapovanie. Taktiež iné spôsoby reprezentácie poľa relatívnych ukazovateľov, napríklad ako dve 32-bitové slová namiesto štyroch 16-bitových slov.Variations such as permutation of "mtable" (and "mt") will provide the same mapping. Also, other ways of representing an array of relative pointers, such as two 32-bit words instead of four 16-bit words.

/* mapová tabuľka */ #define MAPVECLEN 4 typedef uint16 MAPVEC[MAPVECLEN];/ * map table * / #define MAPVECLEN 4 typedef uint16 MAPVEC [MAPVECLEN];

-17typedef MAPVEC MCOMPACT;-17typedef MAPVEC MCOMPACT;

MCOMPACT mt[TMAX];MCOMPACT mt [TMAX];

/* mt je mapová tabuľka, ktorá sa používa počas vyhľadávania, inicializovaná z mtable, ktorá sa používa počas zostrojovania */ typedef struct mentry { uintl 6 mask; /* 16-bitový obrazec (LSB je vždy nastavený na 1! 7 uintl6 len; /* 8-bitová len (hodnota 1-16) 7/ * mt is a map table that is used during searches, initialized from mtable, which is used during construction * / typedef struct mentry {uintl 6 mask; / * 16-bit pattern (LSB is always set to 1! 7 uint16 only; / * 8-bit only (value 1-16) 7

MAPVEC map; /*16 4-bitových relatívnych ukazovateľov v skupinách po štyroch 7 } MENTRY, *MP;MAPVEC map; / * 16 4-bit relative pointers in groups of four 7} MENTRY, * MP;

void mentryžmcompact (MENTRY *from, MCOMPACT *to) /* vezme časť mapy z „from“ a vloží do „to 7 {void mentomcompact (MENTRY * from, MCOMPACT * to) / * takes part of the map from "from" and inserts it into "to 7 {

int i;int i;

for (i=0; i<MAPVECLEN; i++) { (*to) [ i ] = from -> map [ i ];for (i = 0; i <MAPVECLEN; i ++) {(* to) [i] = from-> map [i];

} }}}

extern void mtable_compact () /* inicializuje mt z mtable 7 {extern void mtable_compact () / * initializes mt from mtable 7 {

register int i;register int i;

for (i = 0; i < TMAX; i++) { mentry2mcompact (&mtable[ i ], &mt[ i ]);for (i = 0; i <TMAX; i ++) {ment2mcompact (& mtable [i], & mt [i]);

} }}}

-18Úrovne dve a tri údajovej štruktúry pozostávajú zo zväzkov. Zväzok kryje podstrom s výškou 8 a môže obsahovať najviac 28 = 256 hláv. Koreňová hlava na úrovni n-1 ukazuje na zväzok na úrovni n.-18Levels two and three data structures consist of bundles. The bundle covers a subtree with a height of 8 and can contain a maximum of 28 = 256 heads. The root head at level n-1 points to a bundle at level n.

Existujú tri druhy zväzkov v závislosti od toho, koľko hláv fiktívny bitový vektor obsahuje. Ak existuje až 8 hláv, zväzok je riedky a je reprezentovaný poľom 8-bitových indexov hláv plus osem 16-bitových smerníkov; celkove 24 bytov.There are three types of bundles depending on how many heads the imaginary bit vector contains. If there are up to 8 heads, the volume is sparse and is represented by an array of 8-bit head indexes plus eight 16-bit pointers; 24 flats in total.

až 64 hláv, zväzok je hustý. Je reprezentovaný analogicky s úrovňou 1 s výnimkou počtu bázových indexov. Rozdiel je v tom, že pre všetkých 16 kódových slov je potrebný len jeden bázový index, pretože 6-bitové relatívne ukazovatele môžu pokryť všetkých 64 smerníkov. Celkove je potrebných 34 bytov plus 18 až 128 bytov pre smerníky.up to 64 heads, the bundle is dense. It is represented analogously to level 1 except for the number of base indexes. The difference is that only one base index is needed for all 16 code words, because 6-bit relative pointers can cover all 64 pointers. A total of 34 bytes are needed, plus 18 to 128 bytes for signposts.

až 256 hláv, zväzok je veľmi hustý. Je reprezentovaný analogicky s úrovňou 1. 16 kódových slov a 4 bázové indexy dávajú celkove 40 bytov. Okrem toho 65 až 256 smerníkov vyžaduje 130 až 512 bytov.up to 256 heads, the bundle is very dense. It is represented analogously to level 1. 16 code words and 4 base indexes give a total of 40 bytes. In addition, 65 to 256 pointers require 130 to 512 bytes.

Husté a veľmi husté zväzky sa prehľadávajú analogicky s prvou úrovňou.Dense and very dense bundles are searched analogously to the first level.

Riedke zväzky sa prehľadávajú špeciálne zameraným binárnym prehľadávacím postupom pre 8 prvkov. Tento je podstatne rýchlejší než lineárne vyhľadávanie a binárne prehľadávanie všeobecného zamerania. Naviac, toto prehľadávanie sa dá implementovať bez použitia podmienených skokov na procesorových architektúrach, ktoré majú inštrukciu podmieneného posunu.The thin volumes are searched by a specially designed binary search procedure for 8 elements. This is significantly faster than linear search and binary general search. In addition, this search can be implemented without using conditional jumps on processor architectures that have conditional shift instruction.

/* vyhľadávacia funkcia pre riedke zväzky */ státie inline uint16 findsparse (SPARSECHUNK *chu, uint32 val) /* chu -> vals je triedené pole 0 ... 7 8-bitových hodnôt chu -> rinfo je zodpovedajúce pole 0 ... 7 smerníkov val je vyhľadávací kľúč/ * lookup lookup function * / stand inline uint16 findsparse (SPARSECHUNK * chu, uint32 val) / * chu -> vals is a sorted array of 0 ... 7 8-bit chu values -> rinfo is a matching array of 0 ... The 7 pointers val is the search key

-19{ uint8 *p, *q;-19 {uint8 * p, * q;

p = q = &(chu -> vals [0]);p = q = & (chu → vals [0]);

P += (*(P + 3) > val) « 2;P + = (* (P + 3)> val) 2;

P += (*(P + 1) > val) « 1;P + = (* (P + 1)> val) 11;

p += (*p > val);p + = (* p> val);

return (chu -> rinfo[p - q]);return (chu-> rinfo [p-q]);

}}

Husté a veľmi husté zväzky sú optimalizované analogicky s úrovňou 1, ako sme opísali vyššie. V riedkych zväzkoch sa dve následné hlavy môžu spojiť a reprezentovať nižšou z nich, ak sú nasledujúce skoky rovnaké. Keď sa rozhoduje, či je zväzok riedky alebo hustý, toto spájanie sa berie do úvahy, takže zväzok sa považuje za riedky, keď počet spojených hláv je 8 alebo menej. Mnohé z výstupov, ktoré sa pridali, aby sa strom urobil úplným, budú zoradené a budú mať rovnaké nasledujúce skoky. Hlavy, zodpovedajúce takýmto výstupom, sa v riedkych zväzkoch spoja.The dense and very dense bundles are optimized analogously to level 1 as described above. In sparse bundles, two successive heads can join and represent the lower one if the subsequent jumps are the same. When deciding whether a bundle is sparse or dense, this joining is considered, so that the bundle is considered sparse when the number of connected heads is 8 or less. Many of the outputs that have been added to make the tree complete will be sorted and will have the same following jumps. The heads corresponding to such outputs are joined together in thin volumes.

Táto optimalizácia posunie distribúciu zväzkov z väčších, hustých zväzkov smerom k menším, riedkym zväzkom. Pre veľké tabuľky sa veľkosť odosielacej tabuľky zmenší typicky o 5 až 15 percent.This optimization shifts the volume distribution from larger, dense bundles towards smaller, thin bundles. For large tables, the size of the send table is typically reduced by 5 to 15 percent.

Údajová štruktúra sa môže prispôsobiť značnému vzrastu počtu smerových položiek. Existujú dve obmedzenia v tomto návrhu.The data structure can adapt to a significant increase in the number of directional items. There are two limitations in this proposal.

1. Počet zväzkov každého druhu je obmedzený na 214 = 16384 na jednu úroveň.1. The number of volumes of each species is limited to 2 14 = 16384 per level.

Tabuľka 1 ukazuje, že to je asi 16-krát viac, než sa v súčasnosti používa. Ak sa táto hranica vôbec niekedy prekročí, údajová štruktúra sa dá modifikovať tak, že smerníky sa zakódujú odlišne, aby sa poskytlo viac priestoru pre indexy, alebo tak, že sa zväčší veľkosť smerníkov.Table 1 shows that it is about 16 times more than currently used. If this threshold is ever exceeded at all, the data structure can be modified so that the pointers are encoded differently to provide more space for the indexes, or by increasing the pointer size.

2. Počet smerníkov na úrovniach dva a tri je obmedzený veľkosťou bázových indexov.2. The number of pointers at levels two and three is limited by the size of the base indexes.

-20Súčasná implementácia používa 16-bitové bázové indexy a môže zniesť rastový faktor 3 až 5. Ak sa táto hranica prekročí, je jednoduché zväčšiť veľkosť bázových smerníkov na tri byty. Veľkosť zväzkov sa potom zväčší o 3 percentá pre husté zväzky a o 10 percent pre veľmi husté zväzky. Riedke zväzky nie sú ovplyvnené.The current implementation uses 16-bit base indexes and can bear a growth factor of 3 to 5. If this threshold is exceeded, it is easy to increase the size of the base pointers to three bytes. The bundle size is then increased by 3 percent for dense bundles and 10 percent for very dense bundles. Thin volumes are not affected.

Je jasné, že údajová štruktúra sa môže prispôsobiť veľkému nárastu počtu smerových položiek. Jej veľkosť porastie takmer lineárne s počtom smerových položiek.It is clear that the data structure can adapt to the large increase in the number of directional items. Its size will grow almost linearly with the number of directional items.

Na preskúmanie efektívnosti odosielacích tabuliek sa pozberali viaceré IP smerové tabuľky. Internetové smerové tabuľky sú v súčasnosti dostupné na web mieste pre Internet Performance Measurement and Analysis (IPMA) projekt (Meranie výkonu a analýza internetu) (http://www.ra.net/statistics/) a predtým boli sprístupnené teraz skončeným Routing Arbiter (Smerový arbiter) projektom (http://www.ra.net/statistics/). Pozberanými smerovými tabuľkami sú denné momentky smerových tabuliek, použitých na rôznych veľkých internetových prepojovacích bodoch. Niektoré zo smerových položiek v týchto tabuľkách obsahujú viaceré nasledujúce skoky. V tom prípade sa jeden z nich náhodne vybral ako nasledujúci skok, ktorý sa použil v odosielacej tabuľke.Several IP routing tables were collected to examine the effectiveness of the send tables. Internet routing tables are currently available on the website for the Internet Performance Measurement and Analysis (IPMA) project (http://www.ra.net/statistics/) and were previously made available to the now expired Routing Arbiter ( Directional arbiter) project (http://www.ra.net/statistics/). The collected routing tables are daily snapshots of the routing tables used at various large Internet interconnection points. Some of the directional items in these tables contain several subsequent jumps. In this case, one of them was randomly selected as the next jump that was used in the send table.

Tabuľka 1 na obr. 8 ukazuje údaje o odosielacích tabuľkách, zostrojených z rôznych smerových tabuliek. Pre každé miesto ukazuje údaje a výsledky pre smerovú tabuľku, ktorá generovala najväčšiu odosielaciu tabuľku. Stĺpec „smerové položky“ znamená počet smerových položiek v smerovej tabuľke a „nasledujúce skoky“ je počet rozličných nasledujúcich skokov, nájdených v tabuľke. „Výstupy“ znamenajú počet výstupov v prefixovom strome po pridaní výstupov, aby sa stal úplným.Table 1 in FIG. 8 shows data on dispatch tables constructed from different direction tables. For each location, it shows data and results for the routing table that generated the largest send table. The "Directional Items" column means the number of directional items in the Directional Table, and "Subsequent Jumps" is the number of different successive jumps found in the Table. “Outputs” means the number of outputs in the prefix tree after adding outputs to become complete.

„Doba zostrojenia“ v tabuľke 1 je čas, potrebný na generovanie odosielacej tabuľky z reprezentácie smerovej tabuľky binárnym stromom v pamäti. Tieto časy sa merali na 333 MHz Alpha 21164 pod operačným systémom DEC OSF1. Nasledujúce stĺpce ukazujú celkový počet riedkych, hustých a veľmi hustýchThe "construction time" in Table 1 is the time required to generate a send table from a direction table representation by a binary tree in memory. These times were measured on 333 MHz Alpha 21164 under the DEC OSF1 operating system. The following columns show the total number of thin, dense and very dense

-21 zväzkov v generovanej tabuľke, po ktorom nasleduje počet zväzkov v najnižšej úrovni údajovej štruktúry.-21 volumes in the generated table, followed by the number of volumes at the lowest level of the data structure.

Z tabuľky 1 je jasné, že nové odosielacie tabuľky sa dajú generovať rýchlo. Pri frekvencii regenerovania jeden Herz sa spotrebuje menej než jedna desatina kapacity Alpha. Ako sme opísali vyššie, vyššie frekvencie regenerovania než 1 Hz nie sú potrebné.From Table 1 it is clear that new send tables can be generated quickly. At a regeneration frequency of one Herz, less than one tenth of Alpha capacity is consumed. As described above, regeneration frequencies higher than 1 Hz are not necessary.

Väčšie tabuľky v tabuľke 1 sa celkom nezmestia do 96 kilobytovej sekundárnej rýchlej vyrovnávacej pamäte Alpha. Je však možné mať malú, veľmi rýchlu SRAM v rýchlej vyrovnávacej pamäti na tretej úrovni pre tie časti, ktoré sa nezmestia do sekundárnej rýchlej vyrovnávacej pamäte, a tak znížiť náklady na nezásah v sekundárnej rýchlej vyrovnávacej pamäti. S dostatočným miestom v prevádzkových obrazcoch by väčšina pamäťových odkazov šla do sekundárnej rýchlej vyrovnávacej pamäte.The larger tables in Table 1 do not fit completely into the 96 kilobytes of secondary Alpha cache. However, it is possible to have a small, very fast SRAM in the third-level cache for those portions that do not fit in the secondary cache, thereby reducing the cost of non-intervention in the secondary cache. With enough space in the traffic patterns, most memory references would go to the secondary cache.

Zaujímavým zistením je to, že veľkosť týchto tabuliek je porovnateľná s veľkosťou, ktorú by vyžadovalo len zapamätanie všetkých prefixov v poli. Pre väčšie tabuľky nie je ptrebné viac než 5,6 bytov na jeden prefix. Viac než polovica týchto bytov sa spotrebuje na smerníky. V Sprint tabuľke je 33469 smerníkov, ktoré vyžadujú viac než 65 kilobytov pamäte. Je jasné, že ďalšie zmenšenia veľkosti odosielacej tabuľky by sa dali uskutočniť zmenšením počtu smerníkov.An interesting finding is that the size of these tables is comparable to the size that only the prefixes in the array would need to be remembered. For larger tables, no more than 5.6 bytes per prefix are required. More than half of these apartments are consumed by signposts. In the Sprint table there are 33469 pointers that require more than 65 kilobytes of memory. It is clear that further reductions in the size of the send table could be made by reducing the number of pointers.

Merania s vyhľadávacím podprogramom sa uskutočnili s C funkciou, skompilovanou pomocou kompilátora GNU C-compiler gcc (opísaný v Using and porting gnu cc. Manual (Používanie a presúvanie gnu cc (kompilátor jazyka C), Free Software Foundation, november 1995, ISBN 1-882114-66-3). Uvádzané časy nezahrnujú volanie funkcie alebo prístup do pamäte k tabuľke nasledujúcich skokov, gcc generuje kód, ktorý používa približne 50 Alpha inštrukcií na prehľadanie jednej úrovne údajovej štruktúry v najhoršom prípade. Na Pentium Pro gcc generuje kód, ktorý používa 35 až 45 inštrukcií na jednu úroveň v najhoršom prípade.Measurements with the search subroutine were performed with the C function compiled with the GNU C-compiler gcc compiler (described in Using and porting gnu cc. Manual, Free Software Foundation, November 1995, ISBN 1- The reported times do not include function calls or memory access to the following jumps table, gcc generates code that uses approximately 50 Alpha instructions to search one level of data structure at worst. On Pentium Pro gcc generates code that uses 35 to 45 instructions per level in the worst case.

Nasledujúca funkcia v C-kóde ukazuje kód vyhľadávacej funkcie, ktorá sa použila pri meraniach.The following function in the C-code shows the code of the search function used in the measurements.

-22Pole kódových slov na úrovni 1 sa nazýva „int1“ a pole bázových indexov „basel. Smerníky na úrovni 1 sú zapamätané v poli „htabl“.-22The level 1 codeword field is called "int1" and the base index field is "basel." Level 1 pointers are remembered in the "htabl" field.

Zväzky sú zapamätané v poliach „cis“, „cid“, „cidd“, kde i je úroveň.The volumes are remembered in the fields "cis", "cid", "cidd", where i is the level.

Bázové adresy a smerníky pre husté a veľmi husté zväzky sú zapamätané v poliach „baseid“, „baseidd“ a „htabid“, „htabidd“.Base addresses and pointers for dense and very dense volumes are remembered in the "baseid", "baseidd" and "htabid", "htabidd" fields.

/* vyhľadávacia funkcia pre odosielaciu tabuľku */ # include “conf.h” # include “forward.h” # include “mtentry.h” # include “mtable.h # include “bit2index.h” #define TABLE_LOOKUP # include “sparse.h # include “timing.h # include “lookup.h /* tieto makrá pracujú len vtedy, ak ip je 32-bitový unsigned int (uint32) */ #define EXTRACT (štart,bits.ip) (((ip)«(start))»(32-(bits)) #define GETTEN (m) (((m)«22)»22) #define GETSIX (m) ((m)»10) #define bit2o (ix, bit) ((mt [(ix)j [(bit)»2]»(((bit) &0x3)«2)) &Oxf) /‘lookup (ipaddr) - index položky smerovej tabuľky pre ipaddr 7/ * search function for sending table * / # include “conf.h” # include “forward.h” # include “mtentry.h” # include “mtable.h # include“ bit2index.h ”#define TABLE_LOOKUP # include“ sparse .h # include “timing.h # include” lookup.h / * these macros only work if ip is a 32-bit unsigned int (uint32) * / #define EXTRACT (start, bits.ip) (((ip) «(Start))» (32 - (bits)) #define GETTEN (m) (((m) «22)» 22) #define GETSIX (m) ((m) »10) #define bit2o (ix, bit ) ((mt [(ix) j [(bit) »2)» (((bit) & 0x3) «2)) & Oxf) / 'lookup (ipaddr) - Direction Table Item Index for ipaddr 7

-23unsigned int lookup (uint32 ipaddr) {-23unsigned int lookup {uint32 ipaddr} {

uint32 ix; uint32 code; int32 diff; uint32 ten; uint32 six; int32 nhop; uint32 off; uint32 hbase; uint32 pntr; int32 kind; uint32 chunk; uint8 *p, *q; uint32 key;uint32 ix; uint32 code; int32 diff; uint32 ten; uint32 six; int32 nhop; uint32 off; uint32 hbase; uint32 pntr; int32 kind; uint32 chunk; uint8 * p, * q; uint32 key;

/* index k poľu kódových slov */ /* 16-bitové kódové slovo 7 /* rozdiel od TMAX 7 /* index k mt 7 /* šesť “extra” bitov z code */ /* smerník k nasledujúcemu skoku7 /* relatívny ukazovateľ smerníka 7 /* báza pre transformačnú tabuľku??7 /* vstup do transformačnej tabuľky7 /* druh pntr 7 /* index zväzku 7 /* smerník na prehľadávanie riedkeho zväzku 7 /* vyhľadávací kľúč v riedkom zväzku 7 /* časované od *HERE* 7 ix = EXTRACT (0, 12, ipaddr); code = int1 [ix]; ten = GETTEN (code); six = GETSIX (code);/ * index to code field * / / * 16-bit code word 7 / * unlike TMAX 7 / * index to mt 7 / * six “extra” bits from code * / / * pointer to next jump7 / * relative pointer 7 / * base table for transformation table 7 / * input to transformation table7 / * type pntr 7 / * volume index 7 / * pointer to search thin volume 7 / * search key in thin volume 7 / * timed from * HERE * Ix = EXTRACT (0, 12, ipaddr); code = int1 [ix]; ten = GETTEN (code); six = GETSIX;

if ((diff = (ten - TMAX)) >= 0) { nhop = (six | (diff«6)); goto end;if ((diff = (ten-TMAX))> = 0) {nhop = (six | (diff «6)); goto end;

} off = bit2o (ten, EXTRACT(12, 4, ipaddr));} off = bit2o (ten, EXTRACT (12,4 ipaddr));

hbase = base1[ix»2j;hbase = base1 [ix »2j;

pntr = htabl [hbase + six + off];pntr = htabl [hbase + six + off];

-24if ((kind = (pntr & 0x3))) { chunk = (pntr»2);-24if ((kind = (pntr & 0x3))) {chunk = (pntr &2);

if(-kind) { if(-kind) { key = EXTRACT(16, 8, ipaddr); p = q = c2s [chunk].vals [0]);if (-kind) {if (-kind) {key = EXTRACT (16,8, ipaddr); p = q = c2s [chunk] .vals [0]);

if (*(p + 3) > key) { p+= 4;if (* (p + 3)> key) {p + = 4;

};};

while (*p > key) {while (* p> key) {

P++;P ++;

};};

pntr = c2s [chunkj.rinfo [p - q];pntr = c2s [chunkj.rinfo [p - q];

} else { ix = EXTRACT (16, 4, ipaddr); code = c2dd [chunk] [ix]; ten = GETTEN (code); six = GETSIX (code);} else {ix = EXTRACT (16,4 ipaddr); code = c2dd [chunk] [ix]; ten = GETTEN (code); six = GETSIX;

if ((diff = (ten - TMAX)) >= 0) { nhop = (six | (diff«6)); goto end;if ((diff = (ten-TMAX))> = 0) {nhop = (six | (diff «6)); goto end;

} hbase = htab2ddbase [ (chunk«2) | (ix»2) ]; off = bit2o (ten, EXTRACT (20, 4, ipaddr));} hbase = htab2ddbase [(chunk 2) | (ix 2 2)]; off = bit2o (ten, EXTRACT (20,4 ipaddr));

-25pntr = htab2dd [hbase + six + off];-25pntr = htab2dd [hbase + six + off];

} } else { ix = EXTRACT (16, 4, ipaddr); code = c2d [chunk] [ix]; ten = GETTEN (code); six = GETSIX (code);}} else {ix = EXTRACT (16,4, ipaddr); code = c2d [chunk] [ix]; ten = GETTEN (code); six = GETSIX;

if ((diff = (ten - TMAX)) >= 0) { nhop = (six | (diff«6)); goto end;if ((diff = (ten-TMAX))> = 0) {nhop = (six | (diff «6)); goto end;

} hbase = htab2dbase [chunk];hbase = htab2dbase [chunk];

off = bit2o (ten, EXTRACT (16, 4, ipaddr));off = bit2o (ten, EXTRACT (16, 4, ipaddr));

pntr = htab2d [hbase + six + off];pntr = htab2d [hbase + six + off];

} if ((kind = (pntr & 0x3))) { chunk = (pntr»2);} if ((kind = (pntr & 0x3))) {chunk = (pntr »2);

if (--kind) { if (—kind) { key = EXTRACT (24, 8, ipaddr); p = q = c3s [chunk].vals [0]); if (*(p + 3) > key) { p +=4;if (--kind) {if (—kind) {key = EXTRACT (24,8, ipaddr); p = q = c3s [chunk] .vals [0]); if (* (p + 3)> key) {p + = 4;

};};

-26while (*p > key) { p++;-26while (* p> key) {p ++;

};};

pntr = c3s [chunk].rinfo [p - q];pntr = c3s [chunk] .rinfo [p-q];

} else { ix = EXTRACT (24, 4, ipaddr); code = c3dd [chunk] [ix]; ten = GETTEN (code); six = GETSIX (code);} else {ix = EXTRACT (24,4 ipaddr); code = c3dd [chunk] [ix]; ten = GETTEN (code); six = GETSIX;

if ((diff = (ten - TMAX)) >= 0) { nhop = (six | (diff«6)); goto end;if ((diff = (ten-TMAX))> = 0) {nhop = (six | (diff «6)); goto end;

} off = bit2o (ten, EXTRACT (28, 4, ipaddr)); hbase = htab3ddbase [ (chunk«2) | (ix»2) ]; pntr = htab3dd [hbase + six + off];} off = bit2o (ten, EXTRACT (28,4 ipaddr)); hbase = htab3ddbase [(chunk 2) | (ix 2 2)]; pntr = htab3dd [hbase + six + off];

} } else { ix = EXTRACT (24, 4, ipaddr);}} else {ix = EXTRACT (24,4 ipaddr);

code = c3d [chunk] [ix];code = c3d [chunk] [ix];

ten = GETTEN (code);ten = GETTEN (code);

six = GETSIX (code);six = GETSIX;

if ((diff = (ten - TMAX)) >= 0) { nhop = (six | (diff«6)); goto end;if ((diff = (ten-TMAX))> = 0) {nhop = (six | (diff «6)); goto end;

-27off = bit2o (ten, EXTRACT (28, 4, ipaddr)); hbase = htab3dbase [chunk]; pntr = htab3d [hbase + six + ofQ;-27off = bit2o (the one, EXTRACT (28,4 ipaddr)); hbase = htab3dbase [chunk]; pntr = htab3d [hbase + six + ofQ;

} }}}

} nhop = (pntr »2);} nhop = (pntr »2);

end;end;

/* časované po HERE! 7 return nhop;/ * timed after HERE! Return nhop;

}}

Je možné čítať aktuálnu hodnotu čitača hodinového cyklu na Alpha a Pentium Pro. Táto možnosť sa využila na merania doby vyhľadávania s vysokou presnosťou: jeden hodinový impulz je 5 nanosekúnd pri 200 MHz a 3 nanosekundy pri 333 MHz.It is possible to read the current value of the hour cycle counter on Alpha and Pentium Pro. This option was used to measure search time with high accuracy: one clock pulse is 5 nanoseconds at 200 MHz and 3 nanoseconds at 333 MHz.

Ideálne by celá odosielacia tabuľka bola umiestnená v rýchlej vyrovnávacej pamäti, takže vyhľadávania by sa uskutočňovali s nerušenou rýchlou vyrovnávacou pamäťou. To by emulovalo správanie priradených odosielacích prostriedkov. Avšak merania sa uskutočnili len na bežných pracovných staniciach všeobecného zamerania a je ťažké na takýchto systémoch kontrolovať obsah rýchlej vyrovnávacej pamäte. Rýchla vyrovnávacia pamäť je rušená, kedykoľvek sa uskutočňuje 1/0, dôjde k prerušeniu, alebo keď začína prebiehať iný proces. Dokonca nie je možné vytlačiť údaje o meraní alebo čítať novú IP adresu zo súboru bez rušenia rýchlej vyrovnávacej pamäte.Ideally, the entire send table would be cached, so searches would be performed with an undisturbed cache. This would emulate the behavior of the associated send resources. However, measurements have only been performed on common general-purpose workstations, and it is difficult to control the contents of the cache on such systems. The cache is disturbed whenever 1/0 is performed, there is an interruption, or when another process is starting. It is not even possible to print measurement data or read a new IP address from a file without disturbing the cache.

Použitý spôsob uskutočňuje každé vyhľadávanie dvakrát a meria sa doba vyhľadávania pre druhé vyhľadávanie. Týmto spôsobom sa prvé vyhľadávanie urobí s rušenou rýchlou vyrovnávacou pamäťou a druhé v rýchlej vyrovnávacej pamäti,The method used performs each search twice and measures the search time for the second search. In this way, the first search is done with the cache cached and the second in the cache,

-28pričom všetky nevyhnutné údaje sa vnútili do primárnej rýchlej vyrovnávacej pamäte prvým vyhľadávaním. Po každom páre vyhľadávaní sa údaje o meraní vytlačia a vyvolá sa nová adresa, čo je procedúra, ktorá znova ruší rýchlu vyrovnávaciu pamäť.-28when all the necessary data was forced into the primary cache by the first search. After each pair of searches, the measurement data is printed and a new address is called, a procedure that cancels the cache again.

Druhé vyhľadávanie bude rýchlejšie než vyhľadávania v odosielacích prostriedkoch, pretože údaje a inštrukcie sa presunuli do primárnej rýchlej vyrovnávacej pamäte, najbližšie k procesoru. Aby sa získala horná hranica pre dobu vyhľadávania, k meraným časom sa musí pripočítať ďalší čas, potrebný na pamäťové prístupy k sekundárnej rýchlej vyrovnávacej pamäti. Na testovanie všetkých dráh cez odosielaciu tabuľku sa doba vyhľadávania merala pre každú položku v smerovej tabuľke, vrátane položiek, pridaných rozšírením na úplný strom.The second search will be faster than the search resource, because the data and instructions have moved to the primary cache, closest to the processor. In order to obtain an upper limit for the search time, additional time required for memory accesses to the secondary cache must be added to the measured times. To test all paths through the send table, the search time was measured for each item in the direction table, including items added to the complete tree extension.

Priemerné doby vyhľadávania sa z týchto pokusov nedajú odvodiť, pretože nie je pravdepodobné, že by realistická prevádzková zmes mala rovnomernú pravdepodobnosť prístupu ku každej smerovej položke. Naviac, rozmiestnenie v prevádzkových obrazcoch bude udržiavať časti údajovej štruktúry, ku ktorým sa často pristupuje, v primárnej rýchlej vyrovnávacej pamäti a teda zníži priemernú dobu vyhľadávania. Nižšie vypočítané kritériá výkonnosti sú konzervatívne, pretože sa predpokladá, že ani jeden prístup do pamäte nebude mať zásah v primárnej rýchlej vyrovnávacej pamäti a že sa vždy vyskytne najhorší prípad doby vykonania. Realistické rýchlosti vyhľadávania budú vyššie.The average search times cannot be derived from these attempts because a realistic traffic mix is unlikely to have a uniform probability of access to each directional item. In addition, deployment in traffic patterns will keep parts of the data structure that are frequently accessed in the primary cache and thus reduce the average search time. The performance criteria calculated below are conservative, because it is assumed that neither memory access will hit the primary cache and that the worst case execution time will always occur. Realistic search speeds will be higher.

Tabuľka 1 ukazuje, že existuje len veľmi málo zväzkov na úrovni tri údajovej štruktúry. To spôsobuje, že je pravdepodobné, že veľká väčšina vyhľadávaní nepotrebuje prehľadať viac než dve úrovne, aby sa našiel nasledujúci skok. Preto sa prídavný čas pre pamäťové prístupy do sekundárnej rýchlej vyrovnávacej pamäte počíta pre osem namiesto najhoršieho prípadu dvanástich pamäťových prístupov. Ak by významný podiel vyhľadávaní mal dosiahnuť uvedených málo zväzkov, tieto by sa presunuli do primárnej rýchlej vyrovnávacej pamäte a všetkých dvanásť prístupov by sa stalo menej drahými.Table 1 shows that there are very few volumes at level three of the data structure. This makes it likely that the vast majority of searches do not need to search more than two levels to find the next jump. Therefore, the additional time for memory accesses to the secondary cache is calculated for eight instead of the worst case of twelve memory accesses. If a significant proportion of the searches were to reach these few volumes, they would move to the primary cache and all twelve hits would become less expensive.

Jeden pokus sa uskutočnil na Alpha 21164 s hodinovou frekvenciou 333 MHz; jeden cyklus trvá 3 nanosekundy. Prístupy do 8 kilobytovej primárnej rýchlejOne experiment was performed on Alpha 21164 with a 333 MHz clock frequency; one cycle lasts 3 nanoseconds. Accesses to 8 kilobytes of primary fast

-29vyrovnávacej pamäte sa uskutočnia v 2 cykloch a prístupy do sekundárnej 96 kilobytovej rýchlej vyrovnávacej pamäte vyžadujú 8 cyklov. Pozri tabuľku 2 na obr.-29 caches are performed in 2 cycles, and accesses to the secondary 96 kilobytes cache require 8 cycles. See Table 2 in FIG.

9.9th

Obr. 10 ukazuje distribúciu hodinových taktov, ktoré uplynuli počas druhého vyhľadávania pre Alpha na Sprint smerovej tabuľke z 1. januára. Najrýchlejšie pozorované vyhľadávania vyžadujú 17 hodinových cyklov. Toto je prípad, keď kódové slovo na prvej úrovni priamo kóduje index k tabuľke nasledujúcich skokov. Existuje veľmi málo takýchto smerových položiek. Pretože však každá takáto smerová položka kryje mnoho IP adries, skutočná prevádzka môže obsahovať veľa takýchto cieľových adries. Niektoré vyhľadávania vyžadujú 22 cyklov, čo musí byť ten istý prípad ako predošlý. Pokusy potvrdili, že keď sa čítač hodinových cyklov číta dvoma po sebe nasledujúcimi inštrukciami, rozdiel je niekedy 5 cyklov namiesto očakávanej 0.Fig. 10 shows the clock clock distribution that elapsed during the second Alpha search on the Sprint direction chart of January 1. The fastest observed searches require 17 hour cycles. This is the case when the code word at the first level directly encodes the index to the table of subsequent jumps. There are very few such directional items. However, since each such routing item covers many IP addresses, the actual traffic may contain many such destination addresses. Some searches require 22 cycles, which must be the same as the previous one. The experiments confirmed that when the clock cycle counter is read by two consecutive instructions, the difference is sometimes 5 cycles instead of the expected 0.

Nasledujúce maximum na obr. 10 je pri 41 hodinových cykloch, čo je prípad, keď smerník, nájdený na prvej úrovni, je indexom k tabuľke nasledujúcich skokov. Tradičné adresy triedy B spadajú do tejto kategórie. Maximá pri 52 až 53, 57, 62, 67 a 72 taktoch zodpovedajú nájdeniu smerníka po preskúšaní jednej, dvoch, troch, štyroch alebo piatich hodnôt v riedkom zväzku na úrovni 2. Veľké maximá pri 75 a 83 taktoch existujú, pretože na prehľadanie hustých a veľmi hustých zväzkov je potrebných veľa taktov. Niekoľko pozorovaní nad 83 zodpovedá smerníkom, nájdeným po prehľadaní riedkeho zväzku na úrovni 3, pravdepodobne v dôsledku zmien v dobe vykonania. Takéto zmeny môžu vyvolať konflikty v sekundárnej rýchlej vyrovnávacej pamäti alebo rozdiely v stave prúdov zreťazených inštrukcií a systéme rýchlej vyrovnávacej pamäte pred vyhľadávaním. Zvyšok pozorovaní nad 100 hodinových cyklov je spôsobený buď takýmito zmenami alebo neúspešnými pokusmi o zásah v rýchlej vyrovnávacej pamäti. 300 nanosekúnd by na jedno vyhľadávanie malo stačiť, keby všetky údaje boli v primárnej rýchlej vyrovnávacej pamäti.The following maximum in FIG. 10 is at 41 clock cycles, which is when the pointer found at the first level is an index to the table of subsequent jumps. Traditional Class B addresses fall into this category. The maxima at 52 to 53, 57, 62, 67 and 72 such correspond to finding a pointer after checking one, two, three, four or five values in a sparse bundle at level 2. Large maxima at 75 and 83 such exist because, for very dense bundles many bars are needed. A few observations above 83 correspond to the guidelines found after the scarcity of Level 3, probably due to changes at the time of implementation. Such changes can cause conflicts in the secondary cache or differences in the state of the concatenated instruction streams and the cache system before the search. The remainder of the observations above 100 clock cycles are caused by either such changes or unsuccessful attempts to hit the cache. 300 nanoseconds per search should suffice if all data is in the primary cache.

Rozdiel medzi prístupom k údajom v primárnej a sekundárnej rýchlej vyrovnávacej pamäti je 8 - 2 = 6 cyklov. Teda prehľadanie dvoch úrovní údajovejThe difference between data access in the primary and secondary cache is 8 - 2 = 6 cycles. Thus, two levels of data search

-30štruktúry v najhoršom prípade vyžaduje o 8 x 6 = 48 hodinových cyklov viac, než je naznačené na obr. 10. To znamená najviac 100 + 48 = 148 cyklov alebo 444 nanosekúnd pre najhorší prípad vyhľadávania, keď postačujú 2 úrovne. Teda Alpha by bol schopný urobiť najmenej 2,2 milióna vyhľadaní smeru za sekundu s odosielacou tabuľkou v sekundárnej rýchlej vyrovnávacej pamäti.-30 structures in the worst case require 8 x 6 = 48 hour cycles more than indicated in Figs. 10. This means a maximum of 100 + 48 = 148 cycles or 444 nanoseconds for the worst case search when 2 levels are sufficient. Thus, Alpha would be able to do at least 2.2 million directional searches per second with a send table in the secondary cache.

Ďalší pokus sa urobil na Pentium Pro s hodinovou frekvenciou 200 MHz; jeden cyklus trvá 5 nanosekúnd. Primárna 8-kilobytová rýchla vyrovnávacia pamäť má čakaciu dobu 2 cykly a sekundárna rýchla vyrovnávacia pamäť s 256 kilobytami má čakaciu dobu 6 cyklov. Pozri tabuľku 2.Another attempt was made on a Pentium Pro with a clock frequency of 200 MHz; one cycle lasts 5 nanoseconds. The primary 8 kilobytes cache has a 2-cycle wait time and the secondary 256 kilobytes cache has a 6-cycle wait time. See Table 2.

Obr. 11 znázorňuje distribúciu hodinových taktov, ktoré uplynuli počas druhého vyhľadávania pre Pentium Pro s tou istou odosielacou tabuľkou ako pre Alpha 21164. Sekvencia inštrukcií, ktorá vyvoláva čítač hodinových cyklov, vyžaduje 33 hodinových cyklov. Keď sa dve vyvolania vyskytnú bezprostredne za sebou, hodnoty čítača sa líšia o 33. Z tohto dôvodu sa všetky udávané časy zmenšili o 33.Fig. 11 shows the clock clock distribution that elapsed during the second search for the Pentium Pro with the same send table as for the Alpha 21164. The instruction sequence that invokes the clock cycle counter requires 33 clock cycles. When two invocations occur immediately in succession, the counter values differ by 33. For this reason, all reported times have been reduced by 33.

Najrýchlejšie pozorované vyhľadávania sú pri 11 hodinových cykloch, čo je približne rovnaká rýchlosť ako pri Alpha 21164. Maximum, zodpovedajúce prípadu, keď sa index nasledujúceho skoku našiel bezprostredne za prvou úrovňou, sa vyskytuje pri 25 hodinových cykloch. Maximá, zodpovedajúce riedkemu zväzku na úrovni 2, sú zoskupené tesne vedľa seba v rozsahu 36 až 40 hodinových cyklov. Zdá sa, že odlišná štruktúra rýchlej vyrovnávacej pamäte počítača Pentium zvláda lepšie lineárne skeny než štruktúra rýchlej vyrovnávacej pamäte počítača Alpha 21164.The fastest observed searches are at 11 clock cycles, which is approximately the same speed as the Alpha 21164. The maximum, corresponding to the case where the next jump index was found immediately after the first level, occurs at 25 clock cycles. The maxima corresponding to the sparse volume at level 2 are grouped side by side in a range of 36 to 40 hour cycles. The Pentium's different cache structure seems to handle better linear scans than the Alpha 21164's cache structure.

Keď sú zväzky na druhej úrovni husté a veľmi husté, vyhľadávanie vyžaduje 48 a 50 cyklov. Existuje tu niekoľko ďalších nepravidelných maxím až do 69, nad ktorými je už len veľmi málo pozorovaní. Je jasné, že 69 cyklov (345 nanosekúnd) postačuje na uskutočnenie vyhľadávania, keď sú všetky údaje v primárnej rýchlej vyrovnávacej pamäti.When the second-tier volumes are dense and very dense, the search requires 48 and 50 cycles. There are several other irregular peaks up to 69 above which there are very few observations. Clearly, 69 cycles (345 nanoseconds) are sufficient to perform a search when all data is in the primary cache.

Rozdiel v dobe prístupu medzi primárnou a sekundárnou rýchlou vyrovnávacou pamäťou je 20 nanosekúnd (4 cykly). Doba vyhľadávania pre Pentium Pro,The difference in access time between primary and secondary cache is 20 nanoseconds (4 cycles). Search Time for Pentium Pro,

-31 keď je potrebné preskúmať dve úrovne, je potom v najhoršom prípade 69 + 8 x 4 = 101 cyklov alebo 505 nanosekúnd. Pentium Pro môže urobiť najmenej 2,0 milióna vyhľadaní smerov za sekundu s odosielacou tabuľkou v sekundárnej rýchlej vyrovnávacej pamäti.-31 when two levels need to be examined, then in the worst case is 69 + 8 x 4 = 101 cycles or 505 nanoseconds. Pentium Pro can do at least 2.0 million directions per second searches with a send table in the secondary cache.

Malo by byť zrejmé, že tento vynález poskytuje zlepšený spôsob a systém IP vyhľadávania smerov, ktorý plne zodpovedá vyššie uvedeným cieľom a výhodám. Hoci vynález bol opísaný v spojitosti s jeho špecifickými uskutočneniami, odborníkom v tejto oblasti budú zrejmé jeho alternatívy, modifikácie a zmeny.It should be understood that the present invention provides an improved method and system of IP directional search that fully meets the above objectives and advantages. Although the invention has been described in connection with specific embodiments thereof, those skilled in the art will appreciate alternatives, modifications and changes thereto.

Vo vyššie opísanom uskutočnení je vyhľadávacia funkcia implementovaná v programovacom jazyku C. Odborníkom v oblasti programovania bude jasné, že možno použiť iné programovacie jazyky. Alternatívne môže byť vyhľadávacia funkcia implementovaná do hardvéru s použitím štandardných metód digitálnych konštrukcií, ako bude tiež jasné odborníkom na navrhovanie hardvéru.In the embodiment described above, the search function is implemented in C programming language. It will be clear to a person skilled in the art that other programming languages can be used. Alternatively, the search function can be implemented in hardware using standard methods of digital construction, as will also be apparent to those skilled in the design of hardware.

Vynález sa dá napríklad použiť pre iné konfigurácie počítačových systémov než systémov, používajúcich Alpha 21164 alebo Pentium Pro, iné spôsoby rezu prefixovým stromom, iné počty úrovní v strome, iné spôsoby reprezentácie mapovej tabuľky a iné spôsoby zakódovania kódových slov.For example, the invention can be used for computer system configurations other than Alpha 21164 or Pentium Pro systems, other prefix tree cuts, different tree counts, other map table representation methods, and other code word encoding methods.

Okrem toho sa vynález môže využiť pre Firewall vyhľadávania smerov.In addition, the invention can be used for direction finding firewall.

Claims (7)

PATENTOVÉ NÁROKYPATENT CLAIMS 1. Spôsob IP vyhľadávania smerov v smerovej tabuľke, obsahujúcej ako položky prefixy ľubovoľnej dĺžky s priradenou informáciou o nasledujúcom skoku, aby sa určilo, kam sa majú IP datagramy odoslať, ktorý zahrnuje kroky:A method of IP routing searches in a routing table comprising, as items of any length prefixes, associated with the following jump information, to determine where to send IP datagrams, comprising the steps of: zapamätania do pamäťových prostriedkov reprezentácie smerovej tabuľky vo forme úplného prefixového stromu (7), definovaného prefixami všetkých položiek smerovej tabuľky, doplneného tak, že každý uzol má buď žiadneho alebo dvoch následníkov, pričom všetkými pridanými následníkmi sú výstupy s tou istou informáciou o nasledujúcom skoku, ako má najbližší predchodca s informáciou o nasledujúcom skoku, alebo s nedefinovaným skokom, ak taký predchodca neexistuje, zapamätania do uvedených pamäťových prostriedkov reprezentácie bitového vektora (8), obsahujúceho údaje o reze cez prefixový strom (7) v aktuálnej hĺbke (D) s jedným bitom na možný uzol v aktuálnej hĺbke, pričom tento bit je nastavený na 1, ak tam existuje uzol v prefixovom strome (7), zapamätania do uvedených pamäťových prostriedkov poľa smerníkov prvej úrovne pre pravé hlavy, vrátane indexov k tabuľke nasledujúcich skokov, a pre koreňové hlavy, vrátane indexov k zväzku v nasledujúcej úrovni, rozdelenia uvedeného bitového vektora (8) na bitové masky určitej dĺžky, zapamätania do uvedených pamäťových prostriedkov poľa kódových slov, z ktorých každé kóduje riadkový index k mapovej tabuľke a relatívny ukazovateľ smerníka, zapamätania do uvedených pamäťových prostriedkov poľa bázových adries, prístupu ku kódovému slovu na mieste, ktoré zodpovedá prvej indexovej časti (ix) IP adresy v poli kódových slov, prístupu k položkovej časti mapovej tabuľky na mieste, ktoré zodpovedá stĺpcovej indexovej časti (bit) IP adresy a riadkovej indexovej časti (ten) kódového slova v mapovej tabuľke,storing in the memory means of the direction table representation in the form of a complete prefix tree (7) defined by the prefixes of all direction table entries, supplemented so that each node has either no or two successors, all successors added being outputs with the same jump information, such as the nearest predecessor having information about the next jump, or an undefined jump, if there is no such predecessor, storing in said memory means a representation of the bit vector (8) containing the section data through the prefix tree (7) at the current depth (D) a bit to a possible node at the current depth, which bit is set to 1 if there is a node in the prefix tree (7), memorizing to said first-level pointer array memory resources, including indexes to the following jumps table, and for the root head, including index in the next level, dividing said bit vector (8) into bit masks of a certain length, storing into said memory means a field of code words, each of which encodes a row index to the map table and a relative pointer pointer, storing into said memory means a base field address access to the codeword in place that corresponds to the first index part (ix) of the IP address in the codeword field, access to the item portion of the map table in place that corresponds to the column index part (bit) of the IP address and the row index part (ten) Codeword in the map table -33prístupu k bázovej adrese na mieste, ktoré zodpovedá druhej indexovej časti (bix) IP adresy v poli bázových adries, a prístupu k smerníku na mieste, ktoré zodpovedá bázovej adrese plus relatívnemu ukazovateľu (six) smerníka kódového slova plus položkovej časti mapovej tabuľky v poli smerníkov, vyznačujúci sa tým, že krok zapamätania do uvedených pamäťových prostriedkov reprezentácie možných bitových masiek v mapovej tabuľke zahrnuje krok zapamätania reprezentácie možných bitových masiek, ktoré majú tú vlastnosť, že ľubovoľný interval bitov, ktorého dĺžka je párnou mocninou dvoch a začína pri bitovom indexe, ktorý je násobkom tej istej mocniny dvoch, buď obsahuje samé nuly, alebo má najnižší bit nastavený na 1.-33 accessing a base address at a location that corresponds to a second index portion (bix) of an IP address in a base address field, and accessing a pointer at a location that corresponds to a base address plus a relative pointer (six) of the codeword pointer plus pointers, characterized in that the step of memorizing said memory means of representing possible bit masks in the map table comprises the step of memorizing a representation of possible bit masks having the property that any bit interval whose length is equal to two and starts at the bit index, which is a multiple of the same power of two, either contains all zeros or has the lowest bit set to 1. 2. Spôsob podľa nároku 1,vyznačujúci sa tým, že ak je smerníkom index k zväzku nasledujúcej úrovne, zahrnuje ďalší krok prístupu k zväzku druhej úrovne, aby sa našiel smerník v poli smerníkov zväzkov druhej úrovne pre pravé hlavy, vrátane indexu k tabuľke nasledujúcich skokov, a pre koreňové hlavy, vrátane indexu k zväzku tretej úrovne.The method of claim 1, wherein, if the pointer is an index to the next-level bundle, the next step includes accessing the second-level bundle to find the pointer in the second-level bundle directional array for the right heads, including the index to the following jumps table , and for the root heads, including the index to the third level bundle. 3. Spôsob podľa nároku 2, v y z n a č u j ú c i sa t ý m, že ak je smerníkom v poli smerníkov zväzkov druhej úrovne index k zväzku tretej úrovne, zahrnuje ďalší krok prístupu k zväzku tretej úrovne, aby sa našiel smerník v poli smerníkov zväzkov tretej úrovne, vrátane indexov k tabuľke nasledujúcich skokov.3. The method of claim 2, wherein if the pointer in the second-level bundle directional array is an index to a third-level bundle, it comprises the further step of accessing the third-level bundle to locate the pointer in the bundle directional array. level three, including indexes to the table of the next jumps. 4. Spôsob podľa ktoréhokoľvek z predchádzajúcich nárokov, vyznačujúci sa t ý m, že ak zväzok obsahuje 1 až 8 hláv, zväzok je riedky zväzok a je reprezentovaný poľom 8-bitových indexov hláv a ôsmimi 16-bitovými smerníkmi, ak zväzok obsahuje 9 až 64 hláv, zväzok je hustý zväzok a je reprezentovaný analogicky s prvou úrovňou,Method according to any one of the preceding claims, characterized in that if the bundle contains 1 to 8 heads, the bundle is a thin bundle and is represented by an 8-bit head index field and eight 16-bit pointers if the bundle contains 9 to 64 heads, the bundle is a dense bundle and is represented analogously to the first level, -34ak zväzok obsahuje 65 až 256 hláv, zväzok je veľmi hustý zväzok a je reprezentovaný analogicky s prvou úrovňou.-34a how the bundle contains 65 to 256 heads, the bundle is a very dense bundle and is represented analogously to the first level. 5. Systém na IP vyhľadávanie smerov v smerovej tabuľke, zahrnujúcej ako položky prefixy ľubovoľnej dĺžky s priradenou informáciou o nasledujúcom skoku v tabuľke nasledujúcich skokov, aby sa určilo, kam sa majú IP datagramy odoslať, smerovú tabuľku vo forme úplného prefixového stromu (7), definovaného prefixami všetkých položiek smerovej tabuľky, pričom každý uzol má buď žiadneho alebo dvoch následníkov, pričom všetkými pridanými následníkmi sú výstupy s tou istou informáciou o nasledujúcom skoku, ako má najbližší predchodca s informáciou o nasledujúcom skoku, alebo s nedefinovaným skokom, ak taký predchodca neexistuje, reprezentáciu bitového vektora (8), zahrnujúceho údaje o reze cez prefixový strom (7) v aktuálnej hĺbke (D) s jedným bitom na možný uzol v aktuálnej hĺbke, pričom tento bit je nastavený na 1, ak tam existuje uzol v prefixovom strome (7), pole smerníkov pre pravé hlavy, vrátane indexov k tabuľke nasledujúcich skokov, a pre koreňové hlavy, vrátane indexov k zväzku nasledujúcej úrovne, uvedený bitový vektor (8) rozdelený na bitové masky určitej dĺžky, mapovú tabuľku, obsahujúcu reprezentáciu možných bitových masiek, pole kódových slov, z ktorých každé kóduje riadkový index k mapovej tabuľke a relatívny ukazovateľ smerníka, a pole bázových adries, vyznačujúci sa tým, že možné bitové masky majú tú vlastnosť, že ľubovoľný interval bitov, ktorého dĺžka je párnou mocninou dvoch a začína pri bitovom indexe, ktorý je násobkom tej istej mocniny dvoch, buď obsahuje samé nuly, alebo má najnižší bit nastavený na 1.5. An IP routing system in a direction table, comprising as prefixes of any length with associated next hop information in the next hop table to determine where to send the IP datagrams a direction table in the form of a complete prefix tree (7), defined by prefixes of all direction table entries, with each node having either no or two successors, all successors added being outputs with the same next jump information as the next predecessor with the next jump information, or an undefined jump if there is no such predecessor , representing a bit vector (8) including section data through the prefix tree (7) at the current depth (D) with one bit per possible node at the current depth, which bit is set to 1 if there is a node in the prefix tree ( 7), a field of pointers for right heads, including indexes to the table below and for the root heads, including indexes to the next-level bundle, said bit vector (8) divided into bit masks of a certain length, a map table containing a representation of possible bit masks, an array of code words each coding a row index to the map table and a relative pointer pointer, and a base address field, characterized in that the possible bit masks have the property that any bit interval whose length is an even power of two and starts at a bit index that is a multiple of the same power of two, either contains the same or has the lowest bit set to 1. 6. Systém podľa nároku 5, vyznačujúci sa tým, že zväzkom nasledujúcej úrovne je zväzok druhej úrovne, reprezentovaný poľom smerníkovThe system of claim 5, wherein the next level bundle is a second level bundle represented by an array of pointers. -35zväzku druhej úrovne pre pravé hlavy, vrátane indexov k tabuľke nasledujúcich skokov, a pre koreňové hlavy, vrátane indexov k zväzku tretej úrovne.-35the second-level volume for the right-hand head, including indexes to the following jumps table, and for the root-head, including the indexes to the third-level bundle. 7. Systém podľa nároku 6, vyznačujúci sa tým, že zväzok tretej úrovne je reprezentovaný poľom smerníkov zväzku tretej úrovne, vrátane indexov k tabuľke nasledujúcich skokov.The system of claim 6, wherein the third-level bundle is represented by an array of third-level bundle pointers, including indexes to the table of subsequent jumps.
SK369-2000A 1997-09-15 1998-05-11 Method and system for fast routing lookups SK3692000A3 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
SE9703332A SE9703332D0 (en) 1997-05-09 1997-09-15 Method and system for fast routing lookups
PCT/SE1998/000854 WO1999014906A1 (en) 1997-09-15 1998-05-11 Method and system for fast routing lookups

Publications (1)

Publication Number Publication Date
SK3692000A3 true SK3692000A3 (en) 2000-09-12

Family

ID=20408258

Family Applications (1)

Application Number Title Priority Date Filing Date
SK369-2000A SK3692000A3 (en) 1997-09-15 1998-05-11 Method and system for fast routing lookups

Country Status (7)

Country Link
JP (1) JP2001517024A (en)
KR (1) KR20010030607A (en)
CA (1) CA2303118A1 (en)
EA (1) EA200000328A1 (en)
ID (1) ID24241A (en)
IL (1) IL134835A0 (en)
SK (1) SK3692000A3 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3570323B2 (en) * 1999-05-11 2004-09-29 日本電気株式会社 How to store prefixes for addresses
JP4565793B2 (en) * 1999-12-10 2010-10-20 エスエイテック・グループ・エー・ビー・リミテッド・ライアビリティ・カンパニー Method and apparatus for longest match address lookup
KR100364433B1 (en) * 2000-04-28 2002-12-11 학교법인 동국학원 IP address look-up method using a bit-vector table
US6880064B1 (en) 2000-06-21 2005-04-12 Mosaid Technologies, Inc. Method and apparatus for physical width expansion of a longest prefix match lookup table
KR100493099B1 (en) * 2000-12-22 2005-06-02 삼성전자주식회사 Route lookup and routing/forwarding table management for high-speed internet protocol router
KR100378599B1 (en) * 2001-04-02 2003-04-03 한국전자통신연구원 Routing Table Lookup Using Indirected RAM Indexing
KR20020067469A (en) * 2002-07-25 2002-08-22 크로스반도체기술 주식회사 System and method for destination address look-up of IP packet
JP6070863B2 (en) * 2013-01-29 2017-02-01 ▲ホア▼▲ウェイ▼技術有限公司Huawei Technologies Co.,Ltd. Packet processing method and forwarding element
JP6016215B2 (en) 2013-12-20 2016-10-26 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method, apparatus, and computer program for performing merge sorting of records having a trie tree structure with high efficiency
JP5960863B1 (en) * 2015-03-11 2016-08-02 エヌ・ティ・ティ・コミュニケーションズ株式会社 SEARCH DEVICE, SEARCH METHOD, PROGRAM, AND RECORDING MEDIUM
JP6205463B2 (en) * 2016-06-23 2017-09-27 エヌ・ティ・ティ・コミュニケーションズ株式会社 SEARCH DEVICE, SEARCH METHOD, PROGRAM, AND RECORDING MEDIUM

Also Published As

Publication number Publication date
JP2001517024A (en) 2001-10-02
CA2303118A1 (en) 1999-03-25
IL134835A0 (en) 2001-05-20
KR20010030607A (en) 2001-04-16
ID24241A (en) 2000-07-13
EA200000328A1 (en) 2000-10-30

Similar Documents

Publication Publication Date Title
US6266706B1 (en) Fast routing lookup system using complete prefix tree, bit vector, and pointers in a routing table for determining where to route IP datagrams
Zane et al. CoolCAMs: Power-efficient TCAMs for forwarding engines
US5946679A (en) System and method for locating a route in a route table using hashing and compressed radix tree searching
Waldvogel et al. Scalable high speed IP routing lookups
US6563823B1 (en) Multi-resolution tree for longest match address lookups
KR100748773B1 (en) Method and apparatus for longest match address lookup
Basu et al. Fast incremental updates for pipelined forwarding engines
Tzeng et al. On fast address-lookup algorithms
US6697363B1 (en) Method and apparatus for longest matching prefix determination in a communication network
US6526055B1 (en) Method and apparatus for longest prefix address lookup
EP1551141B1 (en) Apparatus and method using hashing for efficiently implementing an IP lookup solution in hardware
US7356033B2 (en) Method and apparatus for performing network routing with use of power efficient TCAM-based forwarding engine architectures
US6434144B1 (en) Multi-level table lookup
Waldvogel et al. Scalable high-speed prefix matching
WO2003069509A2 (en) Efficient ipv4/ipv6 best matching prefix method and apparatus
Warkhede et al. Multiway range trees: scalable IP lookup with fast updates
WO2002082322A1 (en) Compact data structures for pipelined message forwarding lookups
US20040015494A1 (en) Multi-bit patricia trees
US6804230B1 (en) Communication device with forwarding database having a trie search facility
SK3692000A3 (en) Method and system for fast routing lookups
US6996559B1 (en) IP address resolution methods and apparatus
WO2002098055A2 (en) Load balancing in ip address lookup
US6421660B1 (en) Enhanced searching method and apparatus for variable bit chains
US6961337B2 (en) Interleaved processing system for processing frames within a network router
US7570644B2 (en) Routing method for a telecommunications network and router for implementing said method

Legal Events

Date Code Title Description
FB9A Suspension of patent application procedure