TW536889B - IP address built-up and search method of router and device therefor - Google Patents

IP address built-up and search method of router and device therefor Download PDF

Info

Publication number
TW536889B
TW536889B TW90125380A TW90125380A TW536889B TW 536889 B TW536889 B TW 536889B TW 90125380 A TW90125380 A TW 90125380A TW 90125380 A TW90125380 A TW 90125380A TW 536889 B TW536889 B TW 536889B
Authority
TW
Taiwan
Prior art keywords
transfer table
address
order
order transfer
point
Prior art date
Application number
TW90125380A
Other languages
Chinese (zh)
Inventor
Shau-Yu Bin
Li-Chiau Wu
Original Assignee
Accton Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Accton Technology Corp filed Critical Accton Technology Corp
Priority to TW90125380A priority Critical patent/TW536889B/en
Application granted granted Critical
Publication of TW536889B publication Critical patent/TW536889B/en

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an IP address built-up and search method of router and device there for using compression technique to effectively reduce the memory space required by segment array of indirect lookup table and multiple next hop array so that the search frequency of memory is among 1 to 4 times and only one time memory search if pipeline transmission method is applied. Besides, when routing table is updated, the invention won't have to rebuild forwarding table and can quickly finish updating action.

Description

536889 A7 B7 五 、發明説明(1 ) tjl領域 本發明係關於一種使用於路由器(Γ 0 U t e r)之網際網路 協定(I n t e r n e t P r o t o c ο 1 ; I P )位址尋找方法,特別是關 於一種利用多階段轉送表(f 〇 w a r d i n g t a b 1 e )以求得i p 位址之尋找方法。 l明背景 由於網際網路的快速發展及網路交通流量趨於無法預測 的原因,原先的8 0/2 0法則(80%的交通流量在區域網 路,2 0 %的交通流量在廣域網路)已不再適用,加上超高 速網際網路(G i g a b i t E t h e r n e t)的興起,使得路由器成 為網路效能'的瓶頸。.一般而言,路由器内具有一個路由表 (R 〇 u t i n g T a b 1 e ),内含網路間的連結資訊,而路由器 在進行封包交換時即依據該路由表而進行路由資訊處理。 然而,由於路由器在進行路由資訊處理(R〇uUng Information Processing)時需耗費大量的資源,係造 成路由器減緩速度的重要原因之一。為了提升第三層(網 路層)處理封包交換的效能,因此必須有效地提升路由查 詢的能力。 對於每一個進入的封包,路由器必須藉由此封包的目 的位址在其路由表中執行一次1?位址搜尋以決定要送往那 一次落點。每一個路由表中的項目包含了:目的位址/網 路遮罩和輸出埠號。因CIDR的技術被提出,路由表中的 536889536889 A7 B7 V. Description of the invention (1) tjl field The present invention relates to an Internet Protocol (Internet Protocol) address finding method for a router (Γ 0 U ter), and particularly to a method for finding an address. A multi-stage forwarding table (f owardingtab 1 e) is used to find the IP address. Ming background. Due to the rapid development of the Internet and the tendency of network traffic to become unpredictable, the original 80/20 rule (80% of traffic flows in the local area network and 20% of traffic flows in the wide area network). ) Is no longer applicable, and the rise of the super high-speed Internet (G igabit E thernet) has made routers a bottleneck in network performance. Generally speaking, a router has a routing table (Ro otn ag t a b 1 e), which contains connection information between networks, and the router performs routing information processing based on the routing table when packet exchange is performed. However, because routers need to consume a lot of resources when performing routing information processing, it is one of the important reasons that cause routers to slow down. In order to improve the performance of the third layer (network layer) for packet switching, the ability to route queries must be effectively improved. For each incoming packet, the router must perform a 1? Address search in its routing table with the destination address of the packet to determine which destination to send to. Each entry in the routing table contains: destination address / network mask and output port number. Because CIDR technology is proposed, 536889 in the routing table

項目被^義為前置位元(㈣fix)/前置位元的長度和輸出 埠號,且該前置位元的長度係限制在〇到3 2之間。 IP位址搜尋機制即是在路由器中的路由表内,依每一 個進入的封包目的位址進行符合最長前置位元的找』 (Longest prefix atching) ’以便找出該封包所對應 足次洛點(n ext hop)。由於此過程較為複雜,目前大多 的路由器均使用軟體來實作,然其轉換速度並無法滿足現 今網路上龐大的流量’也使得IP位址搜尋成為目前網路上 最主要的瓶頸。 裝 一種改善路由器查詢能力之方法係習知之間接查表法 (indirect lookup)。該方法首先依照路由表内之前置位 元虛擬一相對應之二進位樹形結構(binary trie)i2,並 定義出各前置位元所佔據之lp位址。之後建構一區段陣列 (segment array)和複數個次落點陣列(next h〇pThe item is defined as ㈣fix / pre-bit length and output port number, and the length of the pre-bit is limited to 0 to 32. The IP address search mechanism is to find the longest prefix at the destination address of each incoming packet in the routing table in the router. Point (n ext hop). Due to the complexity of this process, most routers currently use software to implement it, but its conversion speed cannot meet the huge traffic on today's network. It also makes IP address search the most important bottleneck on the current network. One way to improve the router's query capability is to use indirect lookup. In this method, a binary binary trie i2 corresponding to a previously set element in the routing table is firstly defined, and an lp address occupied by each preceding bit is defined. Then construct a segment array and a plurality of sub-drop arrays (next h〇p

線 array),*IP位址搜尋機制即是利用該區段陣列和次落 點陣列之指引而找出該封包所對應之次落點。 圖1 Ο)至圖1 ( c )係該間接查表法之一實例。圖1 ( a)係 由路由表内之十個前置位元(編號A至J)虛擬至一相對應 之二進位樹形結構。圖1(b)係定義出各前置位元(編號A 至J)所佔據之IP位址。圖1(c)係將該前置位元分為兩個 半位元、、且(n i b b 1 e ),較高之半位元組係作為區段陣列j 3 之位止而較低之半位元組係作為複數個次落點陣列 -5- t紙張尺度適用τ關冢料(CNS) χ 297公愛)------ 536889 A7 B7Line array), * The IP address search mechanism is to use the guidance of the sector array and the sub-location array to find the sub-location corresponding to the packet. Fig. 10) to Fig. 1 (c) are examples of the indirect table lookup method. Figure 1 (a) is a virtual binary tree structure from the ten leading bits (numbered A to J) in the routing table. Figure 1 (b) defines the IP address occupied by each leading bit (numbers A to J). Figure 1 (c) divides the leading bit into two nibbles, and (nibb 1 e). The higher nibble is used as the position of the segment array j 3 and the lower half. Byte system is used as array of multiple sub-drops -5- t paper scale is applicable to τ Sekitsuka (CNS χ 297 public love) ------ 536889 A7 B7

14、14|和14"之位址’且該區段陣列”和複數個次落點 陣列14〜14 (内谷係依據編號八至】之各前置位元所佔據 裝 之ip位址而填入。例如,該區段陣列13之第—欄係記錄 次落點(當前置位元之位元數小於等於四)或指向次落點^ 列14〜14"足4旨標,第〔欄係該指標所對應之前置位元之 最長偏移k(前置位元之位元數減四)’且該指標所對應之 次落點陣列14〜14||共有2k個内容。該次落點陣列 14^i4"僅有一欄,係記錄次落點。待建構該區段陣列 和複數個次落點陣列14〜14,,之内容後,lp位址搜尋機制 即可利用封包之1?位址配合該區段陣列13和次落點陣列 1 4〜1 4 f |之指引,而找出該封包所對應之次落點。 然而, 點陣列1 4 憶體。 上述之間接查表法之區段陣列^ 〜14"在使用上並不具有彈性, 3和複數個次落 且需花費大量記 訂 另一種改善路由器查詢能力之方法係揭示於中華民國專 利公告號第四一〇二九二,發明名稱為「應用於超高速交 換式路由器之路由資訊建構及汗路徑查詢之方法與系統」 之專利說明書中。該方法係藉由壓縮的方式而使封包交換 時之輸出埠查詢次數不超過三次,且將轉送表的大小限制 於5 i2KB以下。然而,上述壓縮方法非常複雜,且當路 由器的連接有變更時,其相對的轉送表必須予以重建後才 可以得到最元整的路由表,在使用上非常的不方便。 -6 -14, 14 |, and 14 " addresses' and the segment array "and a plurality of sub-drop arrays 14 to 14 (inner valley is based on the IP address occupied by each of the preceding bits) Fill in. For example, the first-column of the sector array 13 records the sub-drop point (the number of bits in the current set bit is less than or equal to four) or points to the sub-drop point. Columns 14 ~ 14 " The column indicates the longest offset k of the previous set bit corresponding to this indicator (the number of bits of the leading bit minus four) 'and the second drop point array 14 ~ 14 || corresponding to this indicator has a total of 2k contents. The The sub-drop point array 14 ^ i4 " has only one column, which records the sub-drop points. After the content of the sector array and a plurality of sub-drop point arrays 14 ~ 14 is constructed, the lp address search mechanism can use the packet The 1? Address matches the guidance of the sector array 13 and the sub-drop array 1 4 ~ 1 4 f | to find the sub-drop corresponding to the packet. However, the dot array 14 recalls the memory. The array of sections of the table method ^ ~ 14 " is not flexible in use, 3 and multiple times and requires a lot of booking to improve another router query performance The method of force is disclosed in the patent specification of the Republic of China Patent Bulletin No. 410292, the invention name is "Method and System for Routing Information Construction and Khan Path Inquiry of Super High Speed Switching Router". This method The compression method is used to make the output port query times less than three times during packet exchange, and the size of the forwarding table is limited to 5 i2KB or less. However, the above compression method is very complicated, and when the connection of the router is changed, its The relative forwarding table must be reconstructed to get the most complete routing table, which is very inconvenient in use. -6-

536889 A7536889 A7

口 上所w,為了滿足網路上越來越多的使用者能夠 快速的使用’如何建構—個具有高度傳輸效率之路由器, 實為目前一件非常重要之課題。 發明之簡要說明 本發明之主要目的在提供一種路由器之ιρ位址建構和 尋找方法及其裝置。 i 為達成上述之目的,本發明之Ip位址建構和尋找方法 及其裝置為有效降低間接查表法之區段陣列之大小,係以 2 4個區段陣列内含為單位由左至右掃描計算出一 1 6位元 之壓縮位元映對碼或次落點,然後將所得結果置入該第一 1¾轉送表之次落點欄。因此整個區段陣列被分割為2 i2個 第一群組,且記錄於該第一階轉送表。當該第一群組之所 有1 6位兀之值均相同時,則該第一階轉送表之次落點/ 映對欄記錄一次落點;否則該第一階轉送表之次落點/映 對攔記錄一壓縮位元映對碼,且指標欄記錄該第二階轉送 表之位i止。由於壓縮位元映對碼纟值若^ 1m戈表該區段 陣列之相對應相鄰位元值不相等,因此經由累計該壓縮位 元映對碼之位元值為邏輯1之個數即可推得其相對應之該 第二階轉送表之内含個數。若前置位元之位元數小於 16,則該第二階轉送表之次落點/指標攔依據各次落點 在區段陣列之順序記錄。反之,二階轉送表之次落點 /指標欄記錄一指標,且最長偏移襴記綠一最長偏移。若 本紙張尺度適用中國國家標準(CNS) A4規格(210X 297公釐^ ------- 取長偏移之位元長度…,則需使用第三階轉送表和第 四a轉达表,否、則僅需使用第三階轉送表。另,依上述方 $依序計算出—16位元之壓縮位元映對碼或m炊 置人該第三階轉送表之次i點攔。由於本發 日係以V個次落點陣列内含進行掃描,因此整個次落點 陣列被分割為21”"h個第二群組(1叫〇代表前置位 兀(最長偏移之位元數減去Ip纟元數之一半),且文錄 於該第三階轉送表。當該第:群組之所有位元之值均相同 時,則孩第三階轉送表之次落點/映對搁記錄一次落點; 否則孩第三階轉送表之次落點/映對欄記綠—壓縮位元映 對碼’且指·標攔記錄該第四階轉送表之位址。由於壓縮位 元映對碼之值若為卜代表該次落科列之相對應相鄰位 元值不相等,因此經由累計該壓縮位元映對碼之位元值為 邏輯1之個數即可推得其相對應之該第四階轉送表之内含 個數。該第四階轉送表僅包含一次落點襴。 本晷月之路由器之IP位址建構和尋找方法及其裝置係 先將佔用記憶體較多之路由表壓縮成較小之轉送表,再予 以進行I P位址尋找。本發明具有下列優點: 1·記憶體查詢次數係介於一次至四次之間,且若使用管線 傳輸的万式(pipeline scheme),則只須一次的記憶 體查詢次數。 2.當路由表有變更時,不需重建轉送表,且可以很快速地 536889 A7In order to meet the needs of more and more users on the network, how to construct a router with high transmission efficiency is a very important issue at present. Brief Description of the Invention The main object of the present invention is to provide a method and a device for constructing and searching an IP address of a router. In order to achieve the above-mentioned object, the method and device for constructing and searching IP addresses of the present invention effectively reduce the size of the segment array of the indirect look-up table method. Scan to calculate a 16-bit compressed bit map or sub-drop, and then put the result in the sub-drop column of the first 1¾ transfer table. Therefore, the entire segment array is divided into 2 i2 first groups and recorded in the first-order transfer table. When all the 16-bit values of the first group are the same, the second drop point of the first-order transfer table / the first drop-down column is recorded; otherwise the second drop-point of the first-order transfer table / The mapping pair records a compressed bit mapping pair, and the index column records the position i of the second-order transfer table. Since the value of the compressed bitmap pair code is ^ 1m, the corresponding adjacent bit values of the sector array are not equal. Therefore, by accumulating the bit values of the compressed bitmap pair code, the number is logical 1, that is, It can be deduced that the number contained in the corresponding second-order forwarding table. If the number of leading bits is less than 16, the second drop point / index block of the second-order transfer table is recorded according to the order of each drop point in the sector array. Conversely, the second drop point / indicator column of the second-order transfer table records an indicator, and the longest offset is the green-longest offset. If this paper size is in accordance with the Chinese National Standard (CNS) A4 specification (210X 297 mm ^ ------- take the bit length of long offset ...), you need to use the third-order transfer table and the fourth a Table, if not, only the third-order transfer table is needed. In addition, according to the above-mentioned order, the -16-bit compressed bit mapping code or m can be set to the second point of the third-order transfer table. Stop. Because the Japanese system scans with V sub-drop arrays included, the entire sub-drop array is divided into 21 "" h second groups (1 is called 〇 for leading position (the longest deviation The number of bits shifted minus one and a half of the number of Ip 数), and the text is recorded in the third-order transfer table. When the values of all bits in the first: group are the same, the third-order transfer table The second drop point / map pair records a single drop point; otherwise, the second drop point / map pair column of the third-order transfer table is recorded with green-compressed bit map pair 'and means that the fourth-order transfer table is recorded. Address. If the value of the compressed bit mapping pair is equal to the value of the corresponding adjacent bit value of the subordinate column, the bits of the compressed bit mapping pair are accumulated. The number of logic 1 can be used to derive the corresponding number in the fourth-order forwarding table. The fourth-order forwarding table contains only one drop point. The IP address construction and The searching method and device are first compressing a routing table occupying more memory into a smaller forwarding table, and then searching for an IP address. The present invention has the following advantages: 1. The number of memory queries is between one and four If the pipeline scheme is used, only one memory query is required. 2. When the routing table is changed, there is no need to rebuild the forwarding table, and 536889 A7 can be quickly changed.

B7 完成更新的動作。 可使用於靜態隨機處理記憶體(SRAM)。 4·所需之記憶體空間很小。 本發明將依照後附圖式來說明,其中: 圖 1(a)? 1 / (c )係習知之路由器之Ϊ p位址建構和尋找方法 及其裝置; / 圖2係本發明之路由器之ιρ位址建構和尋找方法及並裝置 I 一實施例; Μ 裝 -:二I日月〈建構第一階轉送表和第〔階轉送表之一實 圖4係本發明之建構第三階轉送表和第 施例; θ ^ ^表之一實 圖本發明之建構第一階轉送表和第二階轉送表之流程 圖6係本發明之建構第三階轉送表 圖; ^ #迗表之流程 圖7係综合圖5和圖6之示意圖; 圖8係本發明之ιρ位址尋找方法之流程圖; 圖9係本發明之1?位址尋找方法之〜實施例;及 圖1 0係本發明之IΡ位址尋找裝置之—實施例 元件符 本紙張尺度適用中國國家標準(CNS) A4規格(21〇 X 297公釐) -9、 536889 A7 B7 五、發明説明(7 ) 11 路由表 13 區段陣列 2 1 第一階轉送表 23 第三階轉送表 2 11 次落點/映對襴 22 1 次落點/指標欄 23 1 次落點/指標欄 24 1 次落點欄 10 1 第一階轉送表 103 第三階轉送表 1 05 第四階轉送表 1 07 第二平行加法器 109 多工器 111 第二加法器 12二進位樹形結構 14、14’、Η,》 , 次落點陣列 2 2 第二階轉送表 24 第四階轉送表 2 12指標欄 2 2 2 最長偏移襴 2 3 2指標襴 102 弟二階轉送表 1〇4 第三階轉送表 106第一平行加法器 1〇8 比較器 110 第一加法器 1 12、1 12’遮羃器 較佳實施例說明 圖2^本發明之路由器之Ip位址建構和尋找方法及其裝 置《-實施例。為有效降低記憶體之需求及加快查詢之速 度,本實施例採用四組轉送表,分別為第一階轉送表 21、第二階轉送表22、第三階轉送表23和第四階轉送表 24,其中第一階轉送表21和第二階轉送表22對應至習知 之間接查表法之區段陣列1 3,而第三階轉送表2 3和第四 -10- 本紙張尺度適用中國國家標準(CNS) A4規格(210X 297公釐) 536889 A7 —------— —_ B7 五、發明説明(~71 -----— 階轉送表24對應至習知之間接查表法之次落點陣列1 4。 S第一階轉运表2 i包含一次落點/映對攔2丨1和指標欄 2若居/入落點/映對攔2 1 1内含一次落點,則該指標 欄2 12為空白(nuU);而若該次落點/映對欄2丨丨内含一 [、宿位元映對碼(C 〇 m P r e s s i ο η B i t M a p ; C B Μ ),則 孩指標攔2 1 2指向該第二階轉送表2 2之位址。該第二階轉 送表2 2包含一次落點/指標欄2 2 1和最長偏移欄2 2 2。若 居/入落點/扣標欄2 2 1内含一次落點,則該最長偏移襴 222為空白(nuU);而若該次落點/指標欄221内含_指 標’則該最長偏移欄222内含一最長偏移(1〇ngest offset)之位元數。該第三階轉送表23包含一次落點/映 對攔2 3 1和指標攔2 3 2。若該次落點/映對欄2 3 1包含一 次落點’則該指標欄2 3 2為空白(nuU);而若該次落點/ 映對攔2 3 1包含一壓縮位元映對碼,則該指標欄2 3 2指向 該第四階轉送表24之位址。該第四階轉送表24僅包含一 次落點欄2 4 1。 為有效降低間接查表法之區段陣列丨3之大小,本發明 係以2個區段陣列内含(e ^ t r y )為單位由左至右掃描計算 出一 1 6位元之壓縮位元映對碼或次落點,然後將所得結 果置入該第一階轉送表2 1之次落點欄2 1 1。一般而言,壓 縮位元映對碼係將最左之位元設為邏輯1 ,其餘之位元依 據區段陣列之相鄰位元而定。若相對應之區段陣列之相鄰 -11 - 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐) ^36889 A7B7 completes the update action. Can be used for static random processing memory (SRAM). 4. The required memory space is small. The present invention will be explained in accordance with the following drawings, in which: Figures 1 (a) to 1 / (c) are the conventional p-address construction and searching methods and devices thereof; / Figure 2 is the router of the present invention ιρ Address construction and searching method and parallel device I An embodiment; Μ 装-: 2 I Sun and Moon <construct the first order transfer table and the first [order transfer table] Figure 4 is the third order transfer of the construction of the present invention Table and the first embodiment; θ ^ ^ one of the tables is a real diagram of the construction of the first-order transfer table and second-order transfer table of the present invention 6 is a diagram of the construction of the third-order transfer table of the present invention; Flowchart 7 is a schematic diagram of FIG. 5 and FIG. 6; FIG. 8 is a flowchart of a method for searching for ιρ address of the present invention; FIG. 9 is a first embodiment of the method for searching for an address of the present invention; and FIG. The IP address finding device of the present invention—Example components The paper size is applicable to the Chinese National Standard (CNS) A4 specification (21 × 297 mm) -9, 536889 A7 B7 V. Description of the invention (7) 11 Routing table 13 Segment array 2 1 First-order transfer table 23 Third-order transfer table 2 11 hits / maps 22 1 hits / finger Column 23 1 drop point / indicator column 24 1 drop point column 10 1 First order transfer table 103 Third order transfer table 1 05 Fourth order transfer table 1 07 Second parallel adder 109 Multiplexer 111 Second addition Device 12 binary tree structure 14, 14 ', Η,》, sub-drop point array 2 2 second-order transfer table 24 fourth-order transfer table 2 12 index column 2 2 2 longest offset 襕 2 3 2 index 襕 102 The second-order transfer table 104. The third-order transfer table 106. The first parallel adder 1008, the comparator 110, the first adder 1, 12, and 12 '. Method and device for constructing and searching IP address-embodiment. In order to effectively reduce the memory requirements and speed up the query, this embodiment uses four sets of transfer tables, namely first-order transfer table 21, second-order transfer table 22, third-order transfer table 23, and fourth-order transfer table. 24, of which the first-order transfer table 21 and the second-order transfer table 22 correspond to the segment array 1 3 of the look-up table method, and the third-order transfer table 2 3 and the fourth-10- National Standard (CNS) A4 specification (210X 297 mm) 536889 A7 —------—— —_ B7 V. Description of the invention (~ 71 -----— Step transfer table 24 corresponds to the interrogation table The second drop point array of the law 1 4. The first-order transfer table 2 i contains a drop point / map pair 2 丨 1 and the index column 2 Ruoju / Insert point / map pair 2 1 1 contains a drop Point, the indicator column 2 12 is blank (nuU); and if the second drop point / mapping pair column 2 丨 丨 contains a [, sink element mapping code (C 〇m P ressi ο η B it M ap CB Μ), the child index block 2 1 2 points to the address of the second-order transfer table 22 2. The second-order transfer table 2 2 includes a drop point / indicator column 2 2 1 and a longest offset column 2 2 2. Ruoju / Incoming Point / Deduction 2 2 1 contains a drop point, the longest offset 襕 222 is blank (nuU); and if the drop point / indicator column 221 contains _indicator ', the longest offset column 222 contains a longest offset The number of bits of (10ngest offset). The third-order transfer table 23 includes a drop point / map pair 2 3 1 and an index block 2 3 2. If the second drop point / map pair 2 3 1 contains a time 'Falling point', the indicator column 2 3 2 is blank (nuU); and if the falling point / mapping pair 2 3 1 contains a compressed bit mapping pair, the indicator column 2 3 2 points to the fourth order The address of the transfer table 24. The fourth-order transfer table 24 only contains a drop-down column 2 4 1. In order to effectively reduce the size of the segment array of the indirect look-up table method 3, the present invention uses two segments of the array Scanning from left to right with (e ^ try) as the unit to calculate a 16-bit compressed bit map or sub-point, and then put the result in the first-order transfer table 2 sub-point 1 Column 2 1 1. In general, the compressed bit mapping code sets the leftmost bit to logic 1, and the remaining bits depend on the adjacent bits of the sector array. If the corresponding sector array Adjacent -11- This paper size applies to China National Standard (CNS) A4 (210 X 297 mm) ^ 36889 A7

位TCI值不相等’則相對應之壓縮位元映對碼為邏輯1, 反之d為邏輯0。由於本發明係以2 4個區段陣列内含 (,n:;y)為單位進行一次掃描,因此整個區段陣列被分割 =2^個第一群組,且記綠於該第一階轉送表2ι。當該第 群組之所有i 6位元之值均相同時,則該第一階轉送表 2 1之次落點/映對攔2 u記錄一次落㉝;否則該第一階轉 送表2 1之次落點/映對欄211記錄一壓縮位元映對碼,且 指標欄2 記錄該第二階轉送表22之位址。由於壓縮位元 映對碼之值右為i ’代表孩區段陣列之相對應相鄰位元值, 不相等’因此經由累計該壓縮位元映對碼之位元值為邏輯 1之個數二即可推得其相對應之該第二階轉送表22之内含個 數。若丽置位元之位元數小於! 6,則該第二階轉送表2 2 之次落點/指標攔22 &quot;衣據各次落點在區段陣列之順序記 錄。反之,該第二階轉送表22之次落點/指標搁221記錄 一指標’且最長偏移攔2 2 2記錄一最長偏移。 圖3係本發明之建構第一階轉送表21和第二階轉送表” 之一實施例。由於區段陣列13之前段内含 (aAAAAABBPDDDDDDD)之半位元組值sa屮]並: 全部相同,因此一壓縮位元映對碼經計算得出 1 0 0 0 00 1 0 1 1 0 0 0 0 00。又,因為該壓縮位元映對碼具有 4個位元值為邏輯1之位元,因此其相對應之第二階轉送 表22具有4個内含。另,區段陣列1 3之後段内含 -12- ^紙張尺度適用中國國家標準(CNS) A4規格(210X297公爱) '&quot; ~^—_____If the bit TCI values are not equal ', the corresponding compressed bit mapping code is logic 1; otherwise, d is logic 0. Since the present invention performs a scan using the (4,4,4) segment arrays containing (, n:; y) as a unit, the entire segment array is divided into 2 ^ first groups, and the green is recorded in the first stage Transfer Form 2ι. When the values of all the i 6 bits of the first group are the same, the first order transfer table 2 1 of the second drop point / map pair 2 u records a single failure; otherwise, the first order transfer table 2 1 The next drop / map pair field 211 records a compressed bit map pair, and the index column 2 records the address of the second-order transfer table 22. Because the value of the compressed bitmap pair is to the right i 'represents the corresponding adjacent bit value of the array of child segments, which are not equal', by accumulating the bit values of the compressed bitmap pair, the number of logical ones is 1. Second, the corresponding number contained in the second-order transfer table 22 can be derived. If the number of bits in Lai's set bit is less than! 6, then the second-order transfer table 22 of the second drop point / indicator block 22 &quot; records the order of each drop point in the sector array. On the other hand, the second landing point / index of the second-order transfer table 22 records an index &apos; and the longest offset block 2 2 2 records a longest offset. FIG. 3 is an embodiment of the construction of the first-order transfer table 21 and the second-order transfer table according to the present invention. As the segment array 13 contains the (aAAAAABBPDDDDDDD) nibble value sa 屮] and: all are the same Therefore, a compressed bitmap pair code is calculated to be 1 0 0 0 00 1 0 1 1 0 0 0 0 00. Also, because the compressed bitmap pair code has 4 bits with a value of logic 1 Therefore, the corresponding second-order transfer table 22 has 4 inclusions. In addition, the segment array 1 3 contains -12- ^ The paper size applies the Chinese National Standard (CNS) A4 specification (210X297 public love) ' &quot; ~ ^ —_____

536889 A7 B7536889 A7 B7

(CCCCCCCCCCCCCCCC)之半位元組值SAk[i]全部相 同,因此該第一階轉送表2 1之次落點/映對欄2 1丨直接儲 存C為次落點。以下之演算法可用於產生該第一階轉送表 21和第二階轉送表22之内含值。(CCCCCCCCCCCCCCCCCC) The nibble values SAk [i] are all the same, so the first-order transfer table 2 1 of the secondary point / map pair 2 1 丨 directly stores C as the secondary point. The following algorithm can be used to generate the embedded values of the first-order transfer table 21 and the second-order transfer table 22.

輸入:區段陣列(S e g m e π ί 一 a r r α少[7 ]) 輸出:第一階轉送表和第二階轉送表 / * S A ( [ζ ]代表區段陣列之第k個分群之第丨個内含 CBM([z·]代表16位元之CBM之值, L1FT[々]代表第一階轉送表之第免内含之值, L2FTH)·]代表第k個第一階轉送表之第y位元之内含*Input: Segment array (S egme π ί arr α less [7]) Output: First-order transfer table and second-order transfer table / * SA ([ζ] represents the kth group of the segment array Contains CBM ([z ·] represents the value of 16-bit CBM, L1FT [々] represents the first-inclusive value of the first-order transfer table, L2FTH) ·] represents the value of the k-th first-order transfer table Implied in bit y *

For&gt;t=〇to212-1 do { CBM^[0] == 1, flag = 0? y = q If SA,[0]=指標 then {建構一相對應之第三階轉送表 L2FTJ0]—(第二階轉送表之位址,最長偏移之 位元長度) j = 1For &gt; t = 〇to212-1 do {CBM ^ [0] == 1, flag = 0? Y = q If SA, [0] = index then {construct a corresponding third-order transfer table L2FTJ0] — ( Address of the second-order forwarding table, the longest offset bit length) j = 1

Flag = 1Flag = 1

For ί = 1 to 15 do 、13- 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐) 536889 A7 B7 五、發明説明(For ί = 1 to 15 do 、 13- The paper size is applicable to China National Standard (CNS) A4 (210 X 297 mm) 536889 A7 B7 V. Description of the invention (

If SA^[/] = SA^[/-1] then CBM^[/] ^ 〇 Else { CBM,[/] = 1 flag = 1If SA ^ [/] = SA ^ [/-1] then CBM ^ [/] ^ 〇 Else {CBM, [/] = 1 flag = 1

I f S A J z·]=指標丈 h e n {建構一相對應之L 3 F T L2FT》|j·]=(第三階轉送表之位址,最長偏 移之位元長度) }I f S A J z ·] = index h e n {construct a corresponding L 3 F T L2FT》 | j ·] = (the address of the third-order transfer table, the longest offset bit length)}

Else L2FI^L/] — (SA々[Z·],空白)Else L2FI ^ L /] — (SA々 [Z ·], blank)

If flag = 0 then L1FT[々]—(SA 灸[0],空白)If flag = 0 then L1FT [々] — (SA moxibustion [0], blank)

Else LI FT [灸]—(CBM*,第k個第二階轉送表、上 、衣之位 址) } 若最長偏移之位元長度大於4,則需使用第三階轉送表 23和第四階轉送表24,否則僅需使用第三階轉送表23。 為有效降低間接查表法之次落點陣列之大小,本發明係以 24個次落點陣列内含(en try )為單位由左至右掃描計算出 -14 - 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐) 536889 A7 B7Else LI FT [Moxibustion] — (CBM *, k-th second-order transfer table, top, and clothing address)} If the longest offset bit length is greater than 4, you need to use the third-order transfer table 23 and the first Fourth-order transfer table 24, otherwise only third-order transfer table 23 is needed. In order to effectively reduce the size of the sub-drop array of the indirect look-up table method, the present invention calculates from the left to the right by using the 24 sub-drop array inclusion (en try) as a unit. -14-This paper standard applies to Chinese national standards (CNS) A4 size (210 X 297 mm) 536889 A7 B7

一 1 6位7C之壓縮位元映對碼或次落點,然後將所得結果 置入3第一 1¾轉送表2 3之次落點攔2 3 1。由於本發明係以 24個次落點陣列内含(entry)進行掃描,因此整個次落點 陣列被分割為個第二群組(length代表前置位元 之最長偏移之位元數減去IP位元數之一半),且記錄於該 第三階轉送表2 3。當該第二群組之所有位元之值均相同 時,則該第三階轉送表23之次落點/映對攔231記錄一次 落點;否則該第三階轉送表2 3之次落點/映對欄2 3 1記錄 一壓縮位元映對碼,且指標欄2 3 2記錄該第四階轉送表2 4 之位址。由於壓縮位元映對碼之值若為1,代表該次落點 陣列之相對應相鄰位元值不相等,因此經由累計該壓縮位 元映對碼之位元值為邏輯1之個數即可推得其相對應之該 第四階轉送表24之内含個數。該第四階轉送表24僅包含 一次落點櫚2 4 1。 圖4係本發明之建構第三階轉送表2 3和第四階轉送表2 4 之一實施例。由於次落點陣列之前段内含 (AAAAAABBBDDDDDDD)之半位元組值HNAk[i]並 未全部相同,因此一壓縮位元映對碼經計算得出 1000001001000000。又,因為該壓縮位元映對碼具有 3個位元值為邏輯1之位元,因此其相對應之第四階轉送 表24具有3個内含。另,次落點矩陣之後段内含 (EEEEEEEEEEEEEEEE)之半位元組值HNAk[i]全部 -15- 本紙張尺度適用中國國家標準(CNS) A4規格(210X297公釐) 536889 A7 一____ Β7 五、發明説明(13 ) 相同,因此該第三階轉送表2 3之次落點/映對欄2 3 1直接 儲存E為次落點。以下之演算法可用於產生該第三階轉送 表23和第四階轉送表24之内含值。 星·三階轉iCAja第四階棘送轰g^FT/I^FT^^ 輸入:次洛點矩陣/一/20户―array [/]) 輸出:第三階轉送表和第四階轉送表 / * N Η A七[/ ]代表第k個次落點矩陣之第i個内含, CBMJz·]代表16位元之CBM之值, L3FT[A:]代表第三階轉送表之第灸内含之值, L4FT々[/]代表第k個第四階轉送表之第/位元之内含~A 16-bit 7C compressed bit maps to a pair of codes or sub-drop points, and then places the result in 3 first 1¾ transfer table 2 3 sub-drop points 2 3 1. Since the present invention scans with an entry of 24 sub-drop arrays, the entire sub-drop array is divided into a second group (length represents the number of bits of the longest offset of the preceding bits minus One-half the number of IP bits), and recorded in the third-order transfer table 23. When the values of all the bits of the second group are the same, the second drop point of the third-order transfer table 23 records a single drop point; otherwise, the third-order transfer table 23 has a second drop point. The dot / mapping pair column 2 3 1 records a compressed bit mapping pair, and the index column 2 3 2 records the address of the fourth-order transfer table 24. Since the value of the compressed bitmap pair code is 1, it means that the corresponding adjacent bit values of the sub-drop array are not equal. Therefore, by accumulating the bit values of the compressed bitmap pair code, the number is logical 1. The corresponding number in the fourth-order transfer table 24 can be derived. The fourth-order transfer table 24 contains only one landing point 2 4 1. FIG. 4 shows an embodiment of a third-order transfer table 23 and a fourth-order transfer table 24 according to the present invention. Since the half-byte values HNAk [i] contained in the previous paragraph of the sub-drop array (AAAAAABBBDDDDDDD) are not all the same, a compressed bitmap pair code is calculated to be 1000001001000000. In addition, since the compressed bit map has three bits whose value is a logical one, the corresponding fourth-order transfer table 24 has three inclusions. In addition, the following paragraph contains the half-byte value HNAk [i] of (EEEEEEEEEEEEEEEE) -15- This paper size applies the Chinese National Standard (CNS) A4 specification (210X297 mm) 536889 A7 one ____ Β7 5. The description of the invention (13) is the same, so the third-order transfer table 2 3 of the second drop point / map pair 2 3 1 directly stores E as the second drop point. The following algorithm can be used to generate the embedded values of the third-order transfer table 23 and the fourth-order transfer table 24. Star · Third-Order Transfer iCAja Fourth-Order Spinner G ^ FT / I ^ FT ^^ Input: Cilop Point Matrix / One / 20 Household ―array [/]) Output: Third-order Transfer Table and Fourth-Order Transfer Table / * N Η AVII [/] represents the i-th inclusion of the k-th sub-drop matrix, CBMJz ·] represents the value of the 16-bit CBM, and L3FT [A:] represents the third-order transfer table The value contained in moxibustion, L4FT々 [/] represents the content of the / bit of the kth fourth-order transfer table ~

If 最長偏移 &lt;4 then L3FT = NHAIf longest offset &lt; 4 then L3FT = NHA

Else { For 免=0 to · 4 - 1 do CBM々[0] = 1,flag = 0,y· = 〇 For/=ltol5do 0Else {For exempt = 0 to · 4-1 do CBM々 [0] = 1, flag = 0, y · = 〇 For / = ltol5do 0

Else { CBM々[/] = 1 -16- 本紙張尺度適用中國國家標準(CNS) A4規格(210x 297公釐) 536889Else {CBM々 [/] = 1 -16- This paper size applies to China National Standard (CNS) A4 (210x 297 mm) 536889

L4FT山·] = NHA 山.] = y + 1, flag = 1L4FT Mountain ·] = NHA Mountain.] = Y + 1, flag = 1

If flag = 〇 then L3FT⑷—(NHA 山·],空白) Else L3FT〇] — ( CBM々的位址) 圖5係本發明之建構第一階轉送表2丨和第二階轉送表u 之机私圖。在步驟5 〇,本發明啟始。在步驟5丨,依間接 旦表法求得區段陣列和複數個次落點陣列。在步驟W, X 2個區#又陣列内含為單位進行一次掃描,且將整個區段 陣列分割為2 1 2個第一群組。在步驟5 3,判斷是否第一群 組之所有1 6位元之值均相同。若答案為肯定的,則進入 步驟54,否則進入步驟55。在步驟54,該第一階轉送表 之次落點/映對攔記錄一次落點,且指標攔記錄空白。在 步驟5 5 ’该第-p!轉送表之次落點/映對襴記錄一壓縮 位元映對碼 且指標欄記錄該第二階轉送表之位址。在步 驟56 ’判斷是否前置位元之位元數小於16。若答案為肯 j的,則進入步驟57,否則進入步驟58。在步驟”,該 第一 1¾轉送表之/入落點/指標欄依序且不重複地記錄在區 段陣列内之次落點,且最長偏移欄記錄〇。在步驟5 8,該 -17-If flag = 〇then L3FT⑷— (NHA Hill ·], blank) Else L3FT〇] — (Address of CBM々) Figure 5 shows the construction of the first-order transfer table 2 and the second-order transfer table u of the present invention. Private image. At step 50, the invention begins. In step 5 丨, the segment array and the plurality of sub-drop arrays are obtained according to the indirect table method. In step W, the X 2 area # is scanned once in the array as a unit, and the entire segment array is divided into 2 1 2 first groups. In step 53, it is determined whether the values of all 16 bits of the first group are the same. If the answer is yes, go to step 54, otherwise go to step 55. In step 54, the first-order transfer table records the second point / mapping point and the index point record is blank. In step 5 5 ′, the second landing point / map pair of the -p! Transfer table records a compressed bit map pair and the index column records the address of the second-order transfer table. At step 56 ', it is determined whether the number of bits of the preceding bit is less than 16. If the answer is yes, go to step 57; otherwise, go to step 58. In step ", the / fall point / indicator column of the first 1¾ transfer table is sequentially and non-repetitively recorded in the second drop point in the segment array, and the longest offset column is recorded. In step 5 of 8,- 17-

B7 五、發明説明( 第、1¾轉!£表(次落點/指標攔記錄一指標,且最長偏移 攔記錄一最長偏移。在步驟59,本發明結束。 、圖6係本發明之建構第三階轉送表2 3和第四階轉送表μ 、:私圖。在步驟6 〇,本發明啟始。在步驟6 1,是否第 一群組之最長偏移大於4。若答案為肯定的,則進入步驟 6 3,否則進入步驟6 2。在步驟6 2,利用第三階轉送表記 錄次落點。在步驟63,以24個次落點陣列内含進行掃 描,且將整個次落點陣列被分割為2length·4個第二群組。 在步風6 4,疋否第一群組之所有位元之值均相同。若答 案為肯定的,則進入步驟65,否則進入步驟66。在步驟 6 5,該第三階轉送表之次落點/映對攔記錄一次落點, 且指標攔填入空白。在步驟6 6,該第三階轉送表之次落 點/映對攔記錄一壓縮位元映對碼,且指標攔記錄該第四 階轉送表之位址。在步驟6 7,該第四階轉送表記錄一次 落點。在步驟6 8,本發明結束。 圖7係综合圖5和圖6之示意圖,並據此得到第一至第四 階轉送表21〜24。 圖8係本發明之I p位址尋找方法之流程圖。在步驟8 〇, 本發明啟始。在步驟8 1,以I p位址之由左起算第〇至第1 1 位元作為存取第一階轉送表之位址。在步驟82,是否第 一階轉送表之指標欄為空白。若答案為肯定的,則進入步 驟8 3,否則進入步驟8 4。在步騾8 3,該第一階轉送表之 -18- 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐) 536889 A7B7 V. Description of the invention (first, 1¾ turns! £ table (secondary point / index block records an index, and the longest offset block records a longest offset. At step 59, the present invention ends.) Figure 6 shows the invention Construct the third-order transfer table 23 and the fourth-order transfer table μ,: private map. In step 60, the invention starts. In step 61, whether the longest offset of the first group is greater than 4. If the answer is If yes, go to step 6 3, otherwise go to step 6 2. In step 62, use the third-order transfer table to record the sub-drops. In step 63, scan the array of 24 sub-drops and scan the whole The array of sub-drops is divided into 2length · 4 second groups. At Step 6 4 , whether the values of all bits in the first group are the same. If the answer is yes, go to step 65, otherwise enter Step 66. At step 65, the second drop point of the third-order transfer table records the first drop point, and the indicator block is filled in blank. At step 66, the second drop point of the third-order transfer table / The mapping block records a compressed bit mapping pair, and the index block records the address of the fourth-order transfer table. In step 67, the The fourth-order transfer table records a drop point. At step 68, the present invention ends. Figure 7 is a schematic diagram of Figures 5 and 6, and the first to fourth-order transfer tables 21 to 24 are obtained accordingly. Figure 8 The flowchart of the method for finding the IP address of the invention. In step 80, the invention starts. In step 81, the 0th to 11th bits from the left of the IP address are counted as the first order of access. The address of the transfer table. In step 82, is the indicator column of the first-order transfer table blank? If the answer is yes, go to step 8 3, otherwise go to step 84. At step 8 3, the first step Transfer Form No.-18- This paper size applies to China National Standard (CNS) A4 (210 X 297 mm) 536889 A7

次落點/映對攔得 、a — …主、 彳/入洛點。在步騾8 4,由該第一階轉 运表之次落點/映斟 ^ τ 吹對欄仵到一壓縮位元映對碼,由指標欄 传到該第二階榦样本、 、 轉^表&lt;起始位址,且由IP位址之第12至 1 5位元配合耸厫一 ^ ~ ^俩位兀映對碼得到該第二階轉送表之相 對位址。在步驟β ς ί X , ^ 8 5,查是否第二階轉送表之最長偏移 欄為0。若答案為音佘 為3疋的,則進入步驟8 6,否則進入步騾 8 7—在步驟8 6,該第二階轉送表之次落點/映對攔得到 ^ % 87 以孩弟二階轉送表之最長偏移攔之 : 多為111由1P位址之第16至(m+11)位元得到該第 :階轉运表〈相對位址。在步驟8 8,檢查是否第三階轉 送表之指標欄為空白。若答案為肯定的,則進入步驟 。則進入步騾9 0。在步驟8 9,該第三階轉送表之次 洛點/映對襴得到次落點。在步騾9〇,&amp;該第三階轉送 表之次落點/映對攔得到一壓縮位元映對碼,由指標欄得 到該:四階轉送表之起始位址…IP位址之第(m+12) 位元土( m + 1 5 )位元配合該壓縮位元映對碼得到該第四階 轉送表之相對位址。在#驟91,㈣二階轉送表之次落 點/映對襴得到次落點。在步驟9 2,本發明結束。 圖9係本發明之IP位址尋找方法之一實施例,其中為方 便敘述j IP位址係以8位元表示。首先,以ιρ位址之前兩 位兀(第0和第1位元)作為存取第一階轉送表21之位址。 若相對應之第一階轉送表2丨之内含之指標攔212為空白, -19- ----- 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐) 536889 五、發明説明( 則該次洛點/映料納 陕對欄211之值即代表次落點。反之,則該 次洛點/映顏·避j。+ 、十襴211&lt;值(1011)代表一壓縮位元映對 碼。IP位址之笫9心楚a/、- “ m 弟2和弟3位兀係用於計算該IP位址位於該 壓縮位:映對碼之第幾個邏輯】之位元,以本例而言,係 位於孩第二階轉送表22之第二個内含。由於該第二階轉 送表22之最長偏移值為3,因此取1?位址之第4位元作為 存取该弟二階轉逆矣,2 士上 ' 、 得込表2 3义位址。若相對應之第三階轉送 表23之内含之指標攔2 3 2為空白,則該次落點/映對欄 2 3 1之值即代表次^ ,點。反之,則該次落點/映對梅⑴1 足值(11 1〇)代表一壓縮位元映對碼。15&gt;位址之第5和第6 位^係用於冲算该j p位址位於該壓縮位元映對碼之第幾個 邏輯1心位元,以本例而言,係位於該第四階轉送表24之 弟一個内έ。以下之演算法可用於I p查表運算。 !£查表運 輸入·第一至第四階轉送表(LIFT至L4FT) 輸出:次落點 / L1F 丁 [ki]_I代表第一階轉送表之第]^個内含之次落 點/映對,The second drop point / mapping pair, a —… the main, 彳 / 彳 洛 point. At step 8 4, the second order of the first-order transfer table / mapping ^ τ blows the pair to a compressed bit mapping pair, and the index column passes to the second-order dry sample,, transfer ^ Table &lt; start address, and the 12th to 15th bits of the IP address are used to match the ^ ~ ^ two bit mapping pairs to obtain the relative address of the second-order transfer table. In step β ς X, ^ 8 5, check whether the longest offset column of the second-order transfer table is 0. If the answer is 3 疋, go to step 8 6; otherwise, go to step 8 7—at step 86, the second point of the second-order transfer table / map pair gets ^% 87. The longest offset of the transfer table: 111 is obtained from the 16th to (m + 11) bits of the 1P address. The first-order transfer table <relative address. In step 88, check whether the indicator column of the third-order transfer table is blank. If the answer is yes, then go to step. Then enter step 9 0. In step 89, the second drop point of the third-order transfer table is obtained. At step 90, & the second drop point / map pair of the third-order transfer table obtains a compressed bit map pair code, which is obtained from the indicator column: the start address of the fourth-order transfer table ... IP address The (m + 12) th bit (m + 1 5) th bit is matched with the compressed bitmap to obtain the relative address of the fourth-order transfer table. At step # 91, the second point / map pair of the second-order transfer table gets the second point. At step 92, the invention ends. FIG. 9 is an embodiment of the IP address finding method of the present invention, in which the IP address is expressed in 8 bits for convenience. First, the two bits (0th and 1st bits) before the ιρ address are used as the address for accessing the first order transfer table 21. If the corresponding index block 212 included in the corresponding first-order transfer table 2 丨 is blank, -19- ----- This paper size applies to China National Standard (CNS) A4 (210 X 297 mm) 536889 5 2. Description of the invention (then the value of the Luo point / information of Shaanxi on the column 211 represents the second falling point. On the contrary, the value of the Luo point / inflection of Yan Shaanxi avoids j. A compressed bit mapping pair. The 9th address of the IP address a /,-"m 2 and 3 are used to calculate that the IP address is located in the compressed bit: the logic of the mapping pair. The bit in [], in this example, is located in the second inclusion of the second-order transfer table 22. Because the longest offset value of the second-order transfer table 22 is 3, the address of 1? The 4th bit is used to access the second-order reversal of the brother, 2 shang ', and get the meaning of Table 23. If the corresponding index contained in the corresponding third-order transfer table 23 is blank, Then the value of the second drop point / map pair 2 31 represents the second ^, point. Otherwise, the second drop point / map pair Mei 1 full value (11 1 0) represents a compressed bit map pair code. 15 &gt; The 5th and 6th bits of the address ^ are used to calculate the j The p-address is located at the logical 1-heart bit of the compressed bit-mapping code. For this example, it is located in the fourth-order transfer table 24. The following algorithm can be used for I p Table lookup operation.! £ Lookup table input · First to fourth order transfer tables (LIFT to L4FT) output: second drop point / L1F Ding [ki] _I represents the first] ^ of the first order transfer table Second landing point / mapping pair,

LlFTfkJ.P代表第一階轉送表之第、個内含之指 標, L2FTkl[k2].I代表第二階轉送表之第“個内含之次 落點/映對, -20-LlFTfkJ.P represents the first and second embedded index of the first-order transfer table, and L2FTkl [k2] .I represents the second embedded order of the second-order transfer point / map pair, -20-

本紙張尺度適用中國國家標準(CNS) Αϋ^ΐ〇 x 297公董)- 536889 A7 B7 五、發明説明(18 ) L2FTkl[k2].L代表第二階轉送表之第k2個内含之最 大偏移值, L3FTk2[k3].I代表第三階轉送表之第k3個内含之次 落點/映對, L3FTk2[k3].P代表第三階轉送表之第k2個内含之指 標, L4FTk3[k4]代表第四階轉送表之第k4個内含之次落 點This paper size applies to the Chinese National Standard (CNS) Αϋ ^ ΐ〇x 297 public director)-536889 A7 B7 V. Description of the invention (18) L2FTkl [k2] .L represents the maximum of the k2th contained in the second-order transfer table Offset value, L3FTk2 [k3] .I represents the k3th embedded point / mapping pair in the third-order transfer table, and L3FTk2 [k3] .P represents the k2th embedded index in the third-order transfer table , L4FTk3 [k4] represents the k4th implied second landing point of the fourth-order transfer table

Get(IP,a,b)代表一函數,其回覆IP位址由左方起算 之第a至第b位元之值*/ j^GeUIPH 1)Get (IP, a, b) represents a function that responds to the values of the a-th to b-th bits of the IP address from the left * / j ^ GeUIPH 1)

If LlFTtkJ.P^ 空白 then 回覆 LIFTtkJ.I Else {j2 = Get(IP,12,15) j^LlFTUH.I之第0至第』2位元之具有邏輯1之 位元個數 j3= j3- 1If LlFTtkJ.P ^ blank then reply LIFTtkJ.I Else {j2 = Get (IP, 12,15) j ^ LlFTUH.I The number of bits with logic 1 from the 0th to the 2nd bit j3 = j3- 1

If L2FTjl[j3].L-空 白 then 回 覆If L2FTjl [j3] .L-empty white then reply

L2FTjl[j3].IL2FTjl [j3] .I

If L2FTjl[j3].L ^ 4 then 回 覆 L3FTj3[Get(IP?16?L2FTj1[j3].L+15)].I Else -21 - 本紙張尺度適用中國國家標準(CNS) A4規格(210 x 297公釐) 536889 A7 B7 五、發明説明(19 { j4 = Get(IP5i69L2FTjl[j3].L+l 1)If L2FTjl [j3] .L ^ 4 then Reply to L3FTj3 [Get (IP? 16? L2FTj1 [j3] .L + 15)]. I Else -21-This paper size applies to China National Standard (CNS) A4 specifications (210 x 297 mm) 536889 A7 B7 V. Description of the invention (19 {j4 = Get (IP5i69L2FTjl [j3] .L + l 1)

If L3FTj3[j4].P=空 then 回覆 L3FTj3[j4].I Else { j5 = Get(IP5i6?L2FTjl[j3].L+125L2FTjl[j 3] .L+ 1 5) j6 — L2FTj3[j4].l之第〇至第j5位元之邏輯i 之個數 j6= j6-l 回覆 L4FTj4[j6] ,圖10係本發明之lp位址尋找裝置之一實施例,包含一 第隖轉迈表101(包含16位元之次落點/映對欄及16位元 之指標攔)、m送表1G2(包含16位元之次落點/ 映對攔及8位元之最長偏移欄)、一第三階轉送表ι〇3 (包 含1 6位元之次落點/映對欄及丨6位元之指標欄)、一第三 階轉送表1〇4(包含8位元之次落點攔)、_第四階轉送表 1 〇 5 (包含8位元之次落點欄)、兩個平行加法器1 〇 6和 107、一比較器、兩個加法器和、一多工器 1〇9及兩遮羃器112和112,。11&gt;位址為位元〇至位元31, 其中符號代表IP位址之第a位元至第b位元,而似〇為 536889 A7 ---------B7 五、發明説明(~^~) &quot; ' --- 存取第一階轉送表101之位址。若所存取之指標欄為空 =’則將次落點/映對欄之值輸出至該多工器1〇9。該遮 羃崙112係用於轉換似,彳至16位元遮羃;若似丨丨之值為 0001,則16位元遮羃為110〇〇〇〇〇〇〇〇〇〇〇〇〇 ;似丨丨之值 為0010,則16位元遮羃為1110〇〇〇〇〇〇〇〇〇〇〇〇 ;並依 此類推。該平行加法器106係用於計算次落點/映對攔之 值和I遮羃器1 1 2處理後之值之邏輯丨之個數,且其輸出 係作為存取第二階轉送表丨〇2之相對位址。該加法器工工〇 係用於將指標(代表存取第二階轉送表1〇2之起始位址)和 忒平行加法器106之輸出(代表存取第二階轉送表1〇2之相 對位址)相加,且產生存取第二階轉送表1〇2之位址。若 所存取之第二階轉送表102之最長偏移攔為〇,則將次落 點/映對襴之值輸出至該多工器109。該比較器1〇8係用於 比較最長偏移值是否大於4 ;若答案是肯定的,則尋找該 第三階轉換表丨〇3,否則尋找另一第三階轉換表。該 平行加法器1 07係用於計算次落點/映對欄之值和經遮羃 器1 1 2處理後之值之邏輯丨之個數,且其輸出係作為存取 第四階轉送表丨〇 5之相對位址。該加法器1 1 1係用於將指 標(代表存取第四階轉送表1 〇 5之起始位址)和該平行加法 器1 〇 7之輸出(代表存取第四階轉送表丨〇 5之相對位址)相 加,且產生存取第四階轉送表105之位址。該遮羃器112f 之功能同遮羃器1 1 2,係用於轉換咕至丨6位元遮羃。該 -23- 本紙張尺度適用中國國家標準(CNS) A4規格(210X 297公釐) 536889 A7If L3FTj3 [j4] .P = empty then reply L3FTj3 [j4] .I Else {j5 = Get (IP5i6? L2FTjl [j3] .L + 125L2FTjl [j 3] .L + 1 5) j6 — L2FTj3 [j4] .l Number of logic i of the 0th to j5th bits j6 = j6-l Reply L4FTj4 [j6], FIG. 10 is an embodiment of the lp address finding device of the present invention, and includes a first transition table 101 ( Contains a 16-bit sub-drop / map pair and a 16-bit indicator block), m send table 1G2 (including a 16-bit sub-drop / map pair and an 8-bit longest offset column), a The third-level transfer table ι03 (including the 16-bit secondary drop point / map pair column and the 6-bit indicator column), the third-level transfer table 104 (including the 8-bit secondary drop point) Stop), _ fourth-order transfer table 1 05 (including the 8-bit second drop point column), two parallel adders 10 and 107, a comparator, two adders, and a multiplexer 1 〇9 and two shutters 112 and 112 ,. 11 &gt; The address is from bit 0 to bit 31, where the symbol represents bit a to bit b of the IP address, and it seems that 0 is 536889 A7 --------- B7 V. Description of the invention (~ ^ ~) &Quot; '--- Access the address of the first order forwarding table 101. If the accessed index column is empty = ’, then the value of the next drop point / map pair column is output to the multiplexer 109. The cover 112 is used to convert the cover to the 16-bit cover; if the value of the cover is 0001, then the 16-bit cover is 110,000,000,000,000,000; It seems that the value is 0010, and the 16-bit mask is 11100000000000000; and so on. The parallel adder 106 is used to calculate the number of logics of the value of the second landing point / map pair and the value processed by the I mask 1 12, and its output is used to access the second-order transfer table 丨〇2 relative address. The adder tool 0 is used for indexing (representing the starting address of accessing the second-order transfer table 102) and the output of the parallel adder 106 (representing accessing the second-order transfer table 102). Relative address) are added, and an address for accessing the second-order transfer table 102 is generated. If the longest offset of the accessed second-order transfer table 102 is 0, the value of the second drop point / map pair is output to the multiplexer 109. The comparator 108 is used to compare whether the longest offset value is greater than 4; if the answer is yes, then look for the third-order conversion table, otherwise, look for another third-order conversion table. The parallel adder 1 07 is used to calculate the number of logical values of the value of the second drop point / map pair and the value processed by the masker 1 12, and its output is used to access the fourth-order transfer table. Relative address of 丨 〇5. The adder 1 1 1 is used for indexing (representing the start address of the fourth-order transfer table 1 05) and the output of the parallel adder 1 107 (representing the access to the fourth-order transfer table 丨 〇 The relative address of 5) is added, and an address for accessing the fourth-order transfer table 105 is generated. The masker 112f has the same function as the masker 1 12 and is used to convert the Go to 6-bit mask. The -23- This paper size applies to Chinese National Standard (CNS) A4 (210X 297 mm) 536889 A7

第四階轉送表105之次落點/映對欄之值輸出 109。 β夕詻 …表1為本發明和習知之間接查表法及中華民國專利公告 唬第四一〇二九二之執行效能和硬體需求之比較分析表。 經由表1之分析’可確認本發明無論在執行效能和硬體花 費 &lt; 表現上均較習知技藝優良。The value of the second landing point / mapping pair column of the fourth-order transfer table 105 outputs 109. β evening… Table 1 is a comparative analysis table of the implementation efficiency and hardware requirements of the invention and the conventional table of knowledge and the patent announcement of the Republic of China. From the analysis of Table 1, it can be confirmed that the present invention is superior to conventional techniques in terms of performance and hardware cost &lt; performance.

本發明之技術内容及技術特點巳揭示如上,然而熟悉本 項技術之人士仍可能基於本發明之教示及揭示而作種種不 背離本發明精神之替換及修飾。因此,本發明之保護範圍 應不限於實施例所揭示者,而應包括各種不背離本發明之 替換及修飾,並為以下之申請專利範圍所涵蓋。 -24- 本紙張尺度適用中國國家標準(CNS) Α4規格(210X 297公釐) 裝 訂 線·The technical content and technical features of the present invention are disclosed as above. However, those skilled in the art may still make various substitutions and modifications based on the teaching and disclosure of the present invention without departing from the spirit of the present invention. Therefore, the protection scope of the present invention should not be limited to those disclosed in the embodiments, but should include various substitutions and modifications that do not depart from the present invention, and are covered by the following patent application scope. -24- This paper size applies to China National Standard (CNS) Α4 size (210X 297mm) binding line ·

Claims (1)

8 8 8 8 A BCD8 8 8 8 A BCD 轉種:由器之IP位址建構方法,係以至少包含第一階 元二…階轉送表以記錄相對於路由表之前置位 和/入洛點,包含下列步驟·· 法求得區段陣列和複數個次落點陣列; 、£ &amp;陣列分割為複數個第一群組; Μ二广且〈Ip位址之所有16位元之值均相同,則 ::階轉送表之次落點/映對欄記綠-次落點且第- 运表之指標搁記錄空白,否則該次落點/映對爛 =錄一壓縮位元映對碼且第-階轉送表之指標欄記錄 弟一階轉送表之位址; 若路由表之前置位元之位元數小S 16,則第二階轉送 表之入落點/和標欄依序且不重複地記錄區段陣列内 :次落點且第二階轉送表之最長偏移欄記錄0,否則該 第二階轉送表之次落點/指標欄記錄一指標,且第二 1¾轉送表之最長偏移欄記錄一最長偏移; 右第一群組心最長偏移大於4,則利用第三階轉送表記 錄次落點,否則將次落點陣列分割為複數個第二群 組; 若第一群組之I P位址之所有位元之值均相同,則第三 階轉送表之次落點/映對欄記錄一次落點且第三階轉 送表之指標攔填入空白,否則該第三階轉送表之次落 點/映對欄記錄一壓縮位元映對碼且該第三階轉送表 -25- 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐) 536889Variation: The method of constructing the IP address of the router is to include at least the first order two ... the order transfer table to record the set and / or entered points relative to the routing table before, including the following steps ... Array and multiple sub-drop arrays;, £ &amp; The array is divided into multiple first groups; M Erguang and the values of all 16 bits of the <Ip address are the same, then: the sub-drop of the step transfer table The dot / map pair column is recorded with the green-second drop point and the index of the-table is blank, otherwise the second drop point / map pair is bad = a compressed bit map pair is recorded and the index column record of the -order transfer table is recorded The address of the first-order transfer table; if the number of bits set before the routing table is less than S 16, the entry points and sum columns of the second-order transfer table are sequentially and non-repetitively recorded in the segment array. : The second drop point and the longest offset column of the second-order transfer table record 0, otherwise the second drop point / indicator column of the second-order transfer table records an indicator, and the longest offset column of the second 1¾ transfer table records a longest Offset; the longest offset of the first group of right is greater than 4, then the third order transfer table is used to record the second drop point, otherwise the second drop point is arrayed Divided into multiple second groups; if the values of all bits of the IP address of the first group are the same, the second drop point / map pair in the third-order transfer table records a single drop point and the third-order transfer Fill in the blank of the index of the table, otherwise, the second drop point / map pair of the third-order transfer table records a compressed bit map pair code and the third-order transfer table-25-This paper size applies to the Chinese National Standard (CNS ) A4 size (210 X 297 mm) 536889 申請專利範圍 义指標襴記錄該第西階轉送表之位址;及 利用第四階轉送表記錄一次落點。 2·如申請專利範圍帛丨项所述之路由器之ιρ位址建構方 法,其中該區段陣列係以24個内含為單位進行一次掃 描’且將整個區段陣列分割為個第—群組。 3·如申請專利範圍帛i項所述之路由器之lp位址建構方 法’其中該次落點陣列係以24個内含進行掃描,且將 整個次落點陣列被分割為2丨e n g t h · 4 _ , 個罘二群組,其中 length代表最長偏移。 裝 路由K I P位址*找万法,係用於如中請專利範 圍弟一項之路由器之IP位址建構方法中尋找ιρ位 址,包含下列步驟: 以IP位址之X個位元作為存取第—階轉送表之位址; 若第-階轉送表之存取内含之指標襴為空白,則由第 -階轉送表之次落點/映對襴得到次落點,否則由該 第-階轉送表之次落點/映對搁得到__位元㈣ 碼且由該第-階轉送表之指標搁得到該第二表 之起始位址; ' 由I P位址之其餘1 6 - X個位元配合該 得到該第二階轉送表之相對位址; 若該第二階轉送表之存取内含之最長 长偏移欄為〇 ,則由 該第二階轉送表之次落點/映對欄得 于h人洛點,否則 -26-Scope of patent application Meaning index: record the address of the west-order transfer table; and use the fourth-order transfer table to record the landing point. 2. The method for constructing ιρ address of a router as described in the scope of the patent application, wherein the sector array is scanned once with 24 internal units and the entire sector array is divided into a first group. . 3. The method for constructing the lp address of the router as described in the scope of the patent application (i), wherein the sub-drop array is scanned with 24 inclusions, and the entire sub-drop array is divided into 2 ength · 4 _, Two groups, where length represents the longest offset. Install the routing KIP address * Find Wanfa, which is used to find the IP address in the method of constructing the IP address of the router in the patent scope, including the following steps: Use the X bits of the IP address as storage Take the address of the first-order transfer table; if the index 襕 included in the access of the first-order transfer table is blank, then the second point of the first-order transfer table / map pairing is used to obtain the second order, otherwise the The second landing point / mapping pair of the first-order transfer table holds the __bit ㈣ code and the index of the second-order transfer table holds the starting address of the second table; 'from the remaining 1 of the IP address 6-X bits are matched to obtain the relative address of the second-order transfer table; if the longest offset column included in the access of the second-order transfer table is 0, the The second drop point / map pairing point is obtained from h Ren Luo point, otherwise -26- 536889 As Β8 C8536889 As Β8 C8 以該第二階轉送表之最長偏 位址之第16至(m+11)位 對位址; 移搁之最長偏移m,由IP &amp;得到該第三階轉送表之相 若該第三階轉送表之存取 該第三階轉送表之次落點 由該第三階轉送表之次落 映對碼,且由該第三階轉 轉送表之起始位址; 内含之指標欄為空白,則由 /晚對襴得到次落點,否則 * /映對襴得到一壓·縮位元 送表之指標欄得到該第四階 由IP位址之第(m+12)位元 至(m+15)位元配合該壓 縮位元映對碼得到該第四階轉送表之相對位址;且 由該第四階轉送表之存取内厶 丁叫門^足次洛點/映對攔得到 5.如申請專利範圍第4項所述之路由器之ιρ位址尋找方 法,其中以IP位址之由左起算第〇至第u位元作為 存取第一階轉送表之位址。 •種路由器之1 P尋找裝置,係用於如申請專利範圍第 項之路由器之I P位址建構方法中尋找丨p位址,包 含: I 一第一階轉送表,包含次落點/映對欄及指標襴,且該 第一階轉送表係以該I P位址之X個位元作為存取位 址; 一第一遮羃器,係用於遮羃該I p位址之其餘丨6〜X個 -27- 536889Use the 16th to (m + 11) bit-pair address of the longest partial address of the second-order transfer table; the longest offset m shifted from IP &amp; Access to the third-order forwarding table The second landing point of the third-order forwarding table is matched by the second-order mapping of the third-order forwarding table, and the starting address of the third-order forwarding table; If the indicator column is blank, the second drop point will be obtained from the / night pair, otherwise * / the mapping pair will get a compression and shrinkage bit. The indicator column of the table will get the fourth order (m + 12) of the IP address. Bit-to- (m + 15) bits and the compressed bit mapping pairs are used to obtain the relative address of the fourth-order transfer table; and the accessor of the fourth-order transfer table is called ^ Zujiluo Point / mapping pairs are obtained. 5. The method for searching the ιρ address of the router as described in item 4 of the scope of patent application, in which the 0th to uth bits from the left of the IP address are used as the first-order transfer table. Address. • 1 P searching device for routers, which is used to find IP addresses in the IP address construction method of routers under the scope of patent application, including: I a first-order forwarding table, including sub-location / mapping pairs Columns and indicators, and the first-order forwarding table uses X bits of the IP address as the access address; a first masker is used to mask the rest of the IP address. 6 ~ X -27- 536889 &amp;元; —第一平行加法器,連接至該第一階轉送表之次落點/ 映對欄和該第一遮羃器,用於產生存取該第二階轉送 表之相對位址; 一第一加法器,係用於加總該第一階轉送表之指標和 該第一平行加法器之輸出; 一第二階轉送表,包含次落點/映對欄及最長偏移攔, 且該第二階轉送表係以該第一加法器之輸出作為存取 位址; 一第三階轉送表,包含次落點/映對欄及指標欄,且該 第三階轉送表係以該第二階轉送表之最長偏移襴之最 長偏移索引該I p位址而作為其存取位址; 第一遮羃器’係用於遮羃該I p位址之其餘1 6〜χ個 位元; 一第二平行加法器,連接至該第三階轉送表之次落點/ 映對攔和該第二遮羃器,用於產生存取該第四階轉送 表之相對位址; 一第二加法器,係用於加總該第三階轉送表之指標和 該第二平行加法器之輸出; 一第四階轉送表,包含次落點欄,且該第四階轉适表 係以該第二加法器之輸出作為存取位址;及 一多工器,連接至該第一階轉送表之次落點/映對蝴、 -28 -&amp;yuan;-a first parallel adder connected to the second drop / map pair of the first-order transfer table and the first shader for generating a relative address for accessing the second-order transfer table ; A first adder, which is used to sum up the index of the first-order transfer table and the output of the first parallel adder; a second-order transfer table, which includes a second drop point / map pair and the longest offset stop And the second-order transfer table uses the output of the first adder as an access address; a third-order transfer table includes a sub-point / map pair column and an index column, and the third-order transfer table is The I p address is indexed by the longest offset 最长 of the longest offset 该 of the second-order transfer table as its access address; the first masker 'is used to block the rest of the I p address 1 6 ~ Χ bits; a second parallel adder connected to the second drop point / map pair of the third-order transfer table and the second masker for generating the relative access to the fourth-order transfer table Address; a second adder, which is used to sum the index of the third-order transfer table and the output of the second parallel adder; a fourth-order The sending table includes a secondary drop point column, and the fourth-order conversion table uses the output of the second adder as an access address; and a multiplexer connected to the secondary drop-point of the first-order transfer table / Mapping butterfly, -28- 本紙張尺度適用中國國家標準(CNS) A4規格(210 X 297公釐) 536889 A8 B8 C8 D8This paper size applies to China National Standard (CNS) A4 (210 X 297 mm) 536889 A8 B8 C8 D8 六、申請專利範圍 該第二階轉送表之次落點/指標襴、該第三階轉送表、 次落點/映對攔及該第四階轉送表之次落點欄。 7 ·如申請專利範圍第6項所述之I P尋找裝置,其另包4 一比較器及一僅包含次落點攔之第三階轉送表,若^ 二階轉送表之最長偏移值大於4,則尋找該包含次落點 /映對攔和指標欄之第三階轉換表,否則尋找該僅包含 次落點欄之第三階轉換表。 8 .如申請專利範圍第6項所述之路由器之I p尋找裝置, 其中該第一階轉送表係以IP位址之由左起算第〇至第 1 1位元作為存取位址。 -29- 本紙張尺度適用中國画家標準(CNS) A4規格(210X 297公釐)6. Scope of patent application The second order point / indicator of the second order transfer table, the third order point, the second order point / map pair, and the second order point in the fourth order table. 7 · The IP finding device as described in item 6 of the scope of patent application, which additionally includes a comparator and a third-order transfer table containing only the second drop point block. If the longest offset value of the second-order transfer table is greater than 4 , Then look for the third-level conversion table that includes the second drop point / map pair and the indicator column, otherwise look for the third-level conversion table that includes only the second drop point column. 8. The IP searching device of the router according to item 6 of the scope of patent application, wherein the first-order forwarding table uses the 0th to 11th bits from the left of the IP address as the access address. -29- This paper size applies to Chinese Painter Standard (CNS) A4 (210X 297mm)
TW90125380A 2001-10-15 2001-10-15 IP address built-up and search method of router and device therefor TW536889B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW90125380A TW536889B (en) 2001-10-15 2001-10-15 IP address built-up and search method of router and device therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW90125380A TW536889B (en) 2001-10-15 2001-10-15 IP address built-up and search method of router and device therefor

Publications (1)

Publication Number Publication Date
TW536889B true TW536889B (en) 2003-06-11

Family

ID=29268263

Family Applications (1)

Application Number Title Priority Date Filing Date
TW90125380A TW536889B (en) 2001-10-15 2001-10-15 IP address built-up and search method of router and device therefor

Country Status (1)

Country Link
TW (1) TW536889B (en)

Similar Documents

Publication Publication Date Title
TW468116B (en) High speed Internet protocol address lookups method for saving memory
EP1168723B1 (en) Method and apparatus for longest matching prefix determination in a communication network
US6243720B1 (en) Address translation method and system having a forwarding table data structure
US6067574A (en) High speed routing using compressed tree process
US7443841B2 (en) Longest prefix matching (LPM) using a fixed comparison hash table
US7433871B2 (en) Efficient ipv4/ipv6 best matching prefix method and apparatus
US8325721B2 (en) Method for selecting hash function, method for storing and searching routing table and devices thereof
EP1562337B1 (en) Filter based longest prefix match algorithm
JP4452183B2 (en) How to create a programmable state machine data structure to parse the input word chain, how to use the programmable state machine data structure to find the resulting value corresponding to the input word chain, deep wire speed A method for performing packet processing, a device for deep packet processing, a chip embedding device, and a computer program including programming code instructions (method and device for deep packet processing)
Van Lunteren et al. Fast and scalable packet classification
US6985483B2 (en) Methods and systems for fast packet forwarding
Tzeng et al. On fast address-lookup algorithms
JP3735471B2 (en) Packet relay device and LSI
US6792423B1 (en) Hybrid longest prefix match and fixed match searches
KR100586461B1 (en) Method, Hardware Architecture and Recording Medium for Searching IP Address by Using Pipeline Binary Tree
CN1784678A (en) System and method for efficiently searching a forwarding database that is split into a bounded number of sub-databases having a bounded size
CN102405622A (en) Methods and devices for binary tree construction, compression and lookup
WO2003021906A1 (en) Method and system for classifying binary strings
Tzeng Longest prefix search using compressed trees
US7085235B2 (en) Method and apparatus for constructing and searching IP address
WO2006131045A1 (en) A method for storing and searching e.164 number domain name
WO2009132556A1 (en) A data searching method and apparatus
US6996559B1 (en) IP address resolution methods and apparatus
TWI239476B (en) Address search
Hsieh et al. A classified multisuffix trie for IP lookup and update

Legal Events

Date Code Title Description
GD4A Issue of patent certificate for granted invention patent
MM4A Annulment or lapse of patent due to non-payment of fees