KR20030097487A - CAM lookup table management method based on LPM. - Google Patents

CAM lookup table management method based on LPM. Download PDF

Info

Publication number
KR20030097487A
KR20030097487A KR1020020034879A KR20020034879A KR20030097487A KR 20030097487 A KR20030097487 A KR 20030097487A KR 1020020034879 A KR1020020034879 A KR 1020020034879A KR 20020034879 A KR20020034879 A KR 20020034879A KR 20030097487 A KR20030097487 A KR 20030097487A
Authority
KR
South Korea
Prior art keywords
data
pointer
cam
address
prefix length
Prior art date
Application number
KR1020020034879A
Other languages
Korean (ko)
Other versions
KR100420960B1 (en
Inventor
오상윤
곽동용
김봉태
Original Assignee
한국전자통신연구원
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 한국전자통신연구원 filed Critical 한국전자통신연구원
Priority to KR10-2002-0034879A priority Critical patent/KR100420960B1/en
Publication of KR20030097487A publication Critical patent/KR20030097487A/en
Application granted granted Critical
Publication of KR100420960B1 publication Critical patent/KR100420960B1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/74591Address table lookup; Address filtering using content-addressable memories [CAM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

Abstract

PURPOSE: A method and device for managing a contents addressable memory lookup table based on an LPM(Longest Prefix Matching) being used in an IPv4 is provided to reduce data updating time generally by locating an empty area between an area the prefix length thereof is 23-bit and 24-bit instead of the prefix length of '0' or '32' in a lookup table of an IPv4. CONSTITUTION: A pointer storage(510) stores sixty six pointers. A table managing unit(530) interfaces with a CPU(520) and controls pointers and a CAM(Contents Addressable Memory) control unit(550). The CAM control unit(550) interfaces with the table managing unit(530) and the pointer storage(510), and controls a CAM table storage(540). The table managing unit(530) receives a data appending command from the CPU(520), controls a pointer stored in the pointer storage(510), operates the CAM control unit(550), and updates the CAM table storage(540). The pointer storage(510) stores a pointer having position data of a CAM table, and stores two pairs of upper pointer and lower pointer the prefix lengths. The CAM control unit(550) receives a control command from the table managing unit(530) and the pointer storage(510), operates a CAM, and executes a retrieving command, a reading command, and a writing command.

Description

IPv4에서 사용되는 LPM 기반의 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리 방법 및 장치{CAM lookup table management method based on LPM.}CAM lookup table management method based on LPM based on LPM-based content addressable memory (CAM) lookup table used in IP4

본 발명은 컴퓨터 네트워크에서 라우팅(routing)을 수행하는 라우터(router)에 관한 것으로, 좀 더 구체적으로는 특히 IP(Internet Protocol) 패킷을 읽어 IP 패킷의 목적지 주소(destination address)를 참조하여 출력포트를 찾는 IP 룩업 테이블(lookup table) 관리방법에 관한 것이다.The present invention relates to a router that performs routing in a computer network. More specifically, an output port is referred to by reading an Internet Protocol (IP) packet and referring to a destination address of the IP packet. It relates to how to manage the lookup IP lookup table.

이때 목적지 주소(destination address)를 참조하여 다음 홉(hop)을 찾는 경우 IP 패킷의 목적지 주소(destination address)와 가장 긴 프리픽스(prefix)를 갖는 주소정보에서부터 일치하는 항목을 찾는 LPM(Longest Prefix Matching) 방법이 있는데, 이러한 LPM을 구현하는 데에는 여러 가지 방법이 있다.In this case, when a next hop is found by referring to a destination address, a longest prefix matching (LPM) that searches for a match from the address information having the longest prefix with the destination address of the IP packet. There are several ways to implement this LPM.

그중 한가지 방법은 낮은 주소로부터 높은 주소로 긴 프리픽스(prefix)를 갖는 데이터의 순으로 컨텐트 주소지정가능 메모리(CAM, Content Addressable Memory)를 사용하여 구현한다. 그리고, 길이 n의 데이터가 추가 될 때 길이 0의 프리픽스(prefix)를 갖는 항목부터 길이 n-1의 길이를 갖는 항목을 차례로 순서대로 높은 주소 방향으로 이동시킨 후 길이 n 의 프리픽스(prefix) 항목을 저장한다.One method is implemented using Content Addressable Memory (CAM) in order of data with long prefix from low address to high address. Then, when data of length n is added, items with a length 0 prefix are sequentially moved from the item having a length n-1 to a higher address direction in order, and then a prefix item of length n is moved. Save it.

그러나, 이 경우에는 평균적으로 길이가 16 보다 긴 프리픽스(prefix)를 갖는 항목을 추가하여야 할 경우에는 필요한 공간을 확보하기 위하여 16 회를 초과하는 이동을 하여야 한다는 문제점이 있어 이를 해결하여야 할 필요가 있다.However, in this case, if an item having a prefix longer than 16 on average needs to be added, there is a problem that more than 16 moves must be made in order to secure a necessary space. .

그리고, 다른 하나의 방법은 높은 주소로부터 낮은 주소로 긴 프리픽스(prefix)를 갖는 데이터의 순으로 컨텐트 주소지정가능 메모리(CAM, Content Addressable Memory)를 사용하여 구현할 수도 있다. 즉, 낮은 주소의 영역에 빈 영역을 두는 방법이다. 그러나, 이 경우에도 평균적으로 16 보다 짧은 프리픽스(prefix)를 갖는 항목을 추가하여야 할 경우에는 마찬가지로 여러 번 이동을 하여야 필요한 공간을 확보할 수 있다는 문제점이 있다.In addition, another method may be implemented by using a content addressable memory (CAM) in order of data having a long prefix from a high address to a low address. In other words, it is a way to leave a blank area in the low address area. However, even in this case, when an item having a prefix shorter than 16 is to be added on average, there is a problem in that necessary space must be moved several times.

상기한 문제를 해결하기 위해 본 발명에서는 IPv4 의 룩업 테이블에 있어서 빈 영역을 프리픽스(prefix) 길이가 0인 영역이나 32인 영역에 두지 않고 프리픽스(prefix) 길이가 23비트와 24비트 영역 사이에 위치하도록 함으로써 전체적으로 데이터 갱신 시간을 줄이는 방법을 제공하는 것을 목적으로 한다.In order to solve the above problem, in the present invention, in the IPv4 lookup table, a blank area is located between a 23-bit and a 24-bit area without having an empty area in an area having a prefix length of 0 or an area of 32. It aims to provide a way to reduce the data update time as a whole.

도 1은 라우터(router)에서 수행되는 라우팅(routing)을 위한 일반적인 포워딩 엔진(forwarding engine)의 블록도1 is a block diagram of a typical forwarding engine for routing performed in a router

도 2는 일반적인 룩업 테이블의 데이터 저장 상태 도면.2 is a data storage state diagram of a typical lookup table.

도 3은 종래의 프리픽스 길이 n의 데이터를 추가할 경우의 추가 방법 도면.3 is a diagram illustrating an additional method when adding data of a conventional prefix length n.

도 4는 본 발명의 프리픽스 길이 0비트에서 32비트까지의 프리픽스 데이터가 존재할 경우의 컨텐트 주소지정가능 메모리(CAM)내의 데이터 저장상태 도면.Fig. 4 is a diagram of a data storage state in a content addressable memory (CAM) in the presence of prefix data of prefix bits 0 to 32 bits of the present invention.

도 5는 본 발명의 포워딩 테이블 관리장치의 구성도.5 is a configuration diagram of a forwarding table management apparatus of the present invention.

도 6은 프리픽스 길이가 24 비트 이상인 경우의 i 비트 데이터의 CAM 저장상태 및 포인터를 표시한 도면.Fig. 6 is a diagram showing a CAM storage state and a pointer of i-bit data when the prefix length is 24 bits or more.

도 7은 프리픽스 길이가 24 비트 미만인 경우의 i 비트 데이터의 CAM 저장상태 및 포인터를 표시한 도면.Fig. 7 is a diagram showing a CAM storage state and a pointer of i-bit data when the prefix length is less than 24 bits.

도 8은 본 발명의 컨텐트 주소지정가능 메모리(CAM) 테이블에 데이터를 추가하는 과정을 나타내는 흐름도면.FIG. 8 is a flow diagram illustrating the process of adding data to a Content Addressable Memory (CAM) table of the present invention. FIG.

도 9는 프리픽스 길이 24 비트 이상인 경우 데이터의 CAM 테이블 추가 도면.Fig. 9 is a diagram illustrating the addition of a CAM table of data when the prefix length is 24 bits or more.

도 10은 프리픽스 길이 24 비트 미만인 경우 데이터의 CAM 테이블 추가 도면.Fig. 10 is a diagram illustrating the addition of a CAM table of data when the prefix length is less than 24 bits.

상기한 목적을 이루기 위하여 본 발명에서는, 소정의 프리픽스 길이를 갖는 데이터 영역 정보를 나타내는 하위 포인터와 및 상위 포인터를 구비하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블을 제공하는 단계; 상기 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블에 데이터를 추가하는 명령을 수신하고, 추가할 데이터의 프리픽스 길이와 소정의 값을 비교하는 단계; 상기 단계의 결과, 상기 추가할 데이터의 프리픽스 길이가 소정의 값 이상이면, 상기 각 데이터 밴드의 하위 포인터가 기억하는 주소 데이터를 상기 각 데이터 밴드의 상위포인터가 기억하는 주소 데이터 영역으로 순차적으로 이동시키는 단계; 및 상기 단계의 결과, 상기 추가할 데이터의 프리픽스 길이가 소정의 값 미만이면, 상기 각 데이터 밴드의 상위 포인터가 기억하는 주소 데이터를 상기 각 데이터 밴드의 하위포인터가 기억하는 주소 데이터 영역으로 순차적으로 이동시키는 단계를 포함하는 LPM(Longest Prefix Matching)을 사용하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리방법을 제공한다.To achieve the above object, the present invention provides a method of providing a content addressable memory (CAM) lookup table having a lower pointer and an upper pointer indicating data area information having a predetermined prefix length; Receiving a command to add data to the content addressable memory (CAM) lookup table and comparing a prefix length and a predetermined value of the data to be added; As a result of the above step, if the prefix length of the data to be added is greater than or equal to a predetermined value, the address data stored by the lower pointer of each data band is sequentially moved to the address data area stored by the upper pointer of each data band. step; And as a result of the step, if the prefix length of the data to be added is less than a predetermined value, the address data stored by the upper pointer of each data band is sequentially moved to the address data area stored by the lower pointer of each data band. A method of managing a content addressable memory (CAM) lookup table using Longest Prefix Matching (LPM), the method comprising:

상기 소정의 프리픽스 길이를 갖는 데이터 영역 정보를 나타내는 하위 포인터와 및 상위 포인터를 구비하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블을 제공하는 단계는 소정의 프리픽스 길이 이상의 프리픽스를 갖는 복수의 주소 데이터가 저장된 데이터 밴드마다, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 주소 데이터 중에서 주소가 가장 낮은 데이터의 주소정보를 저장하고 있는 하위 포인터와, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 주소 데이터 중에서 주소가 가장 높은 데이터 다음의 주소정보를 기억하고 있는 상위 포인터를 구비하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블을 제공하는 단계; 소정의 프리픽스 길이 미만의 프리픽스를 갖는 복수의 주소 데이터가 저장된 데이터 밴드마다, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 주소 데이터 중에서 주소가 가장 낮은 데이터의 다음의 주소정보를 저장하고 있는 하위 포인터와, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 주소 데이터 중에서 주소가 가장 높은 데이터의 주소정보를 기억하고 있는 상위 포인터를 구비하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블을 제공하는 단계를 구비함이 바람직하다.Providing a content addressable memory (CAM) lookup table having a lower pointer representing data area information having the predetermined prefix length and an upper pointer may store a plurality of address data having a prefix equal to or greater than a predetermined prefix length. For each data band, a lower pointer storing address information of data having the lowest address among a plurality of address data having the same prefix length stored in the data band, and an address among the plurality of address data having the same prefix length stored in the data band Providing a content addressable memory (CAM) lookup table having an upper pointer storing address information next to the highest data; A lower pointer storing next address information of data having the lowest address among a plurality of address data having the same prefix length stored in the data band for each data band in which a plurality of address data having a prefix less than a predetermined prefix length are stored; And providing a content addressable memory (CAM) lookup table having an upper pointer storing address information of data having the highest address among a plurality of address data having the same prefix length stored in the data band. desirable.

상기한 목적을 이루기 위하여 본 발명에서는, 프리픽스 길이에 따라서 데이터를 낮은 주소로부터 또는 높은 주소로부터 저장하는 룩업테이블을 포함하는 컨텐트 주소지정가능 메모리(CAM); 소정의 프리픽스 길이를 갖는 데이터 밴드 영역의 경계 데이터를 기억하는 하위포인터 및 상위포인터를 포함하는 포인터 저장부; 및 상기 데이터 밴드에 데이터를 추가하는 명령을 받아서 상기 포인터 저장부에 저장되어 있는 상위포인터와 하위포인터를 제어하고 상기 컨텐트 주소지정가능 메모리(CAM) 제어부를 구동하여 컨텐트 주소지정가능 메모리(CAM) 테이블을 갱신하는 테이블 관리부를 포함하는 LPM(Longest Prefix Matching)을 사용하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리장치를 제공한다.In order to achieve the above object, the present invention provides a memory device including: a content addressable memory (CAM) including a lookup table for storing data from a low address or a high address according to a prefix length; A pointer storage unit including a lower pointer and an upper pointer for storing boundary data of a data band region having a predetermined prefix length; And a command for adding data to the data band to control an upper pointer and a lower pointer stored in the pointer storage unit, and to drive the content addressable memory (CAM) controller to control a content addressable memory (CAM) table. Provided is a content addressable memory (CAM) lookup table management apparatus using Longest Prefix Matching (LPM), including a table management unit for updating a network.

상기한 목적을 이루기 위하여 본 발명에서는, 상기의 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공한다.In order to achieve the above object, the present invention provides a computer-readable recording medium having recorded thereon a program for executing the above method on a computer.

이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 일실시예를 상세히 설명한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 라우터(router)에서 수행되는 라우팅(routing)을 위한 일반적인 포워딩 엔진(forwarding engine)의 블록도이다.1 is a block diagram of a general forwarding engine for routing performed in a router.

라우터의 포워딩 엔진(110)은 들어오는 IP 패킷(100)에서 목적지 주소(destination address)를 추출하고, 상기 목적지 주소(destination address)에 해당하는 다음 홉(hop)을 구하기 위하여 다음 홉(hop) 결정부(120)는 다음 홉(hop)에 관한 정보를 가지고 있는 포워딩 테이블(forwarding table)(130)을 참조하여 다음 홉(hop)을 구하고, IP 패킷을 다음 홉(hop)으로 전달한다.The forwarding engine 110 of the router extracts a destination address from the incoming IP packet 100 and a next hop determiner to obtain a next hop corresponding to the destination address. 120 obtains the next hop with reference to forwarding table 130 having information about the next hop, and forwards the IP packet to the next hop.

이때 목적지 주소(destination address)를 참조하여 다음 홉(hop)을 찾는 경우 IP 패킷의 목적지 주소(destination address)와 가장 긴 프리픽스(prefix)를 갖는 주소정보에서부터 일치하는 항목을 찾는 LPM(Longest Prefix Matching) 방법이 있는데, 이러한 LPM을 구현하는 데에는 여러 가지 방법이 있다.In this case, when a next hop is found by referring to a destination address, a longest prefix matching (LPM) that searches for a match from the address information having the longest prefix with the destination address of the IP packet. There are several ways to implement this LPM.

도 2는 일반적인 룩업 테이블의 데이터 저장 상태 도면이다.2 is a data storage state diagram of a general lookup table.

일반적인 방법은 도 2와 같이 낮은 주소로부터 높은 주소로 긴 프리픽스(prefix)를 갖는 데이터의 순으로 컨텐트 주소지정가능 메모리(CAM, Content Addressable Memory)를 사용하여 구현한다. 즉 맨 위에는 길이 N/2-1의 프리픽스(prefix)를 갖는 항목(210)이 위치하고 그 다음에는 길이 N/2-2의 프리픽스(prefix)를 갖는 항목(220)이 위치하게 된다. 이런 순서대로 높은 주소 방향으로 길이 1의 프리픽스(prefix)를 갖는 항목(230)이 위치하고, 길이 0의 프리픽스(prefix)를 갖는 항목(240)이 위치한다. 그리고 맨 아래에는 빈 영역이 존재한다.The general method is implemented using a content addressable memory (CAM) in order of data having a long prefix from a low address to a high address as shown in FIG. 2. In other words, an item 210 having a prefix of length N / 2-1 is located at the top, followed by an item 220 having a prefix of length N / 2-2. In this order, an item 230 having a length 1 prefix is located in the high address direction, and an item 240 having a length 0 prefix is located. And at the bottom there is an empty area.

도 3은 종래의 프리픽스 길이 n의 데이터를 추가할 경우의 추가 방법 도면이다.3 is a diagram illustrating an additional method in the case of adding data of a conventional prefix length n.

길이 n의 데이터가 추가 될 때 길이 0의 프리픽스(prefix)를 갖는 항목(310)부터 길이 n-1의 길이를 갖는 항목(320)을 차례로 순서대로 높은 주소 방향으로 이동시킨 후 길이 n 의 프리픽스(prefix) 항목(330)을 저장한다. 그러나, 평균적으로 길이가 N/4 보다 긴 프리픽스(prefix)를 갖는 항목을 추가하여야 할 경우에는 필요한 공간을 확보하기 위하여 N/4 회를 초과하는 이동을 하여야 한다.When data of length n is added, items 310 having a length 0 prefix are sequentially moved from an item 320 having a length n-1 to a high address direction in order, and then a prefix of length n prefix) stores the item 330. However, if you need to add an item with a prefix longer than N / 4 on average, you must make more than N / 4 moves to make room for the required space.

도 4는 본 발명의 프리픽스 길이 0비트에서 32비트까지의 프리픽스 데이터가 존재할 경우의 컨텐트 주소지정가능 메모리(CAM)내의 데이터 저장상태 도면이다.FIG. 4 is a diagram illustrating a data storage state in a content addressable memory (CAM) when there is prefix data having a prefix length of 0 bits to 32 bits.

즉, IPv4의 룩업 테이블에 있어서 빈 영역을 프리픽스(prefix) 길이가 0 비트인 영역에 두지 않고 프리픽스(prefix) 길이 23비트, 24비트 영역 사이에 둠으로써 전체적으로 데이터 갱신 시간을 줄인다.That is, in the IPv4 lookup table, the data update time is reduced overall by placing the free area between the 23-bit and 24-bit regions of the prefix length rather than the region having the prefix length of 0 bits.

도 5는 본 발명의 테이블 관리장치의 구성도이다.5 is a block diagram of a table management device of the present invention.

본 발명의 테이블 관리장치(500)는 66개의 포인터를 저장하고 있는 포인터 저장부(510), 중앙처리부(CPU, Central Processing Unit)(520)와 인터페이스를 갖고 포인터와 컨텐트 주소지정가능 메모리(CAM) 제어부를 제어하는 테이블 관리부(530), 테이블 관리부 및 포인터 저장부와 인터페이스를 갖고 컨텐트 주소지정가능 메모리(CAM) 테이블 저장부(540)를 제어하는 컨텐트 주소지정가능 메모리(CAM) 제어부(550)로 구성된다.The table management apparatus 500 of the present invention has an interface with a pointer storage unit 510, a central processing unit (CPU) 520, which stores 66 pointers, and a pointer and a content addressable memory (CAM). To the content addressable memory (CAM) control unit 550 having an interface with the table management unit 530, the table management unit and the pointer storage unit controlling the control unit, and controlling the content addressable memory (CAM) table storage unit 540. It is composed.

테이블 관리부(530)는 중앙처리부(CPU)(520)로부터 데이터 추가 명령을 받아서 포인터 저장부(510)에 저장되어 있는 포인터를 제어하고 컨텐트 주소지정가능 메모리(CAM) 제어부(550)를 구동하여 컨텐트 주소지정가능 메모리(CAM) 테이블(540)을 갱신한다.The table manager 530 receives a data addition command from the CPU 520, controls a pointer stored in the pointer storage 510, and drives a content addressable memory (CAM) controller 550 to control content. Update the addressable memory (CAM) table 540.

포인터 저장부(510)는 컨텐트 주소지정가능 메모리(CAM) 테이블의 위치 데이터를 갖는 포인터를 저장하고 있으며, 프리픽스(prefix) 길이 0비트의 상위포인터 UP(0), 하위포인터 LP(0)의 두 쌍의 포인터로부터 프리픽스(prefix) 길이 32비트의상위포인터 UP(32), 하위포인터 LP(32)의 두 쌍의 포인터까지의 모두 66개의 포인터를 저장하고 있다.The pointer storage unit 510 stores a pointer having position data of a content addressable memory (CAM) table, and includes two pointers, an upper pointer UP (0) and a lower pointer LP (0) having a prefix length of 0 bits. 66 pointers are stored from the pair of pointers to the two pairs of pointers 32 of the prefix length 32 bits of the upper pointer UP 32 and the lower pointer LP 32.

컨텐트 주소지정가능 메모리(CAM) 제어부(550)는 테이블 관리부(530)와 포인터 저장부(510)로부터 제어명령을 받아서 컨텐트 주소지정가능 메모리(CAM)를 구동하여 데이터의 검색, 읽기, 쓰기 명령 등을 수행한다.The content addressable memory (CAM) control unit 550 receives a control command from the table manager 530 and the pointer storage unit 510 to drive the content addressable memory (CAM) to search for, read, and write data. Do this.

도 6은 프리픽스 길이가 24 비트 이상인 경우의 i 비트 데이터의 CAM 저장상태 및 포인터 도면이다.FIG. 6 is a diagram illustrating a CAM storage state and a pointer of i-bit data when the prefix length is 24 bits or more.

즉, 66 개의 포인터 중 프리픽스(prefix) 길이 24 비트 이상의 상위 및 하위 포인터는 도 6과 같은 주소 데이터를 갖게 된다. 즉 하위포인터는 프리픽스(prefix) 길이가 같은 데이터 중 주소가 가장 낮은 데이터를 가리키고 상위포인터는 프리픽스(prefix) 길이가 같은 데이터 중 주소가 가장 높은 데이터 다음의 데이터를 가리키게 된다. 도 6에서 (610)은 길이 i 비트의 프리픽스(prefix)를 갖는 데이터의 띠(band)이고, (620)은 길이 i-1 비트의 프리픽스(prefix)를 갖는 데이터의 띠(band)이다.That is, among the 66 pointers, upper and lower pointers having a prefix length of 24 bits or more have address data as shown in FIG. 6. That is, the lower pointer refers to the data having the lowest address among the data having the same prefix length, and the upper pointer refers to the data following the data having the highest address among the data having the same prefix length. In FIG. 6, 610 is a band of data having a prefix of length i bits, and 620 is a band of data having a prefix of length i-1 bits.

도 7은 프리픽스 길이가 24 비트 미만인 경우의 i 비트 데이터의 CAM 저장상태 및 포인터 도면이다.7 is a diagram showing the CAM storage state and pointer of i-bit data when the prefix length is less than 24 bits.

즉, 나머지 프리픽스 길이 24 비트 미만의 상위 및 하위 포인터는 도 7과 같은 주소 데이터를 갖게 된다. 하위포인터는 프리픽스(prefix) 길이가 같은 데이터 중 주소가 가장 낮은 데이터의 다음 데이터를 가리키고 상위포인터는 프리픽스(prefix) 길이가 같은 데이터 중 주소가 가장 높은 데이터를 가리키게 된다. 도 7에서 (710)은 길이 i비트의 프리픽스(prefix)를 갖는 데이터의 띠(band)이고 (720)은 길이 i-1비트의 프리픽스(prefix)를 갖는 데이터의 띠(band)이다. 길이 0비트의 띠(band) 데이터는 디폴트(default) 데이터로 일치하는 프리픽스(prefix)가 없을 경우에 사용하는 데이터로 보통 1개의 데이터를 갖는다.That is, upper and lower pointers having a remaining prefix length of less than 24 bits have address data as shown in FIG. 7. The lower pointer points to the next data of the data having the lowest address among the data having the same prefix length, and the upper pointer points to the data having the highest address among the data having the same prefix length. In FIG. 7, 710 is a band of data having a prefix of length i bits, and 720 is a band of data having a prefix of length i-1 bits. Band data of length 0 bits is used when there is no prefix that matches the default data, and usually has one data.

도 8은 본 발명의 컨텐트 주소지정가능 메모리(CAM) 테이블에 데이터를 추가하는 과정을 나타낸 흐름도면이다.8 is a flowchart illustrating a process of adding data to a content addressable memory (CAM) table of the present invention.

우선, 데이터 추가에 필요한 상위포인터 및 하위포인터를 초기화한다(810).First, an upper pointer and a lower pointer required for data addition are initialized (810).

그리고, 상기 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블에 데이터를 추가하는 명령을 수신하고(820), 추가할 데이터의 프리픽스(prefix) 길이를 판단한다(830). 추가할 데이터의 프리픽스(prefix) 길이가 24 이상이면, 상기 각 데이터 밴드의 하위 포인터가 기억하는 주소 데이터를 상기 각 데이터 밴드의 상위포인터가 기억하는 주소 데이터 영역에 저장하고 상위포인터, 하위포인터를 조정한다(840).In operation 830, a command for adding data to the content addressable memory (CAM) lookup table is received, and a prefix length of the data to be added is determined (830). If the prefix length of the data to be added is 24 or more, the address data stored by the lower pointer of each data band is stored in the address data area stored by the upper pointer of each data band, and the upper and lower pointers are adjusted. (840).

그리고, 추가할 주소 데이터의 프리픽스(prefix) 길이가 24 미만이면, 상기 각 데이터 밴드의 상위 포인터가 기억하는 주소 데이터를 상기 각 데이터 밴드의 하위포인터가 기억하는 주소 데이터 영역에 저장하고 상위포인터, 하위포인터를 조정한다(850).When the prefix length of the address data to be added is less than 24, the address data stored by the upper pointer of each data band is stored in the address data area stored by the lower pointer of each data band, and the upper pointer and lower Adjust the pointer (850).

이렇게 해서 빈 영역이 생기면 그 영역에 데이터를 추가한다(860). 그리고 더 추가할 데이터가 있는지 판단해서(870) 추가할 데이터가 있으면 다시 처음으로 가서 데이터 추가명령을 기다린다.If an empty area is created in this manner, data is added to the area (860). If there is data to be added (870), if there is data to be added, it goes back to the beginning and waits for a data adding command.

이제 도 9 및 도 10을 참조하여 컨텐트 주소지정가능 메모리(CAM) 테이블에 데이터를 추가하는 과정을 상세히 설명한다.A process of adding data to a content addressable memory (CAM) table will now be described in detail with reference to FIGS. 9 and 10.

도 9는 프리픽스 길이 24 비트 이상인 경우 데이터의 CAM 테이블 추가 도면이다.FIG. 9 is a diagram for adding a CAM table of data when the prefix length is 24 bits or more. FIG.

중앙처리부(CPU)(520)로부터 데이터 추가 명령을 테이블 관리부(530)가 받으면 추가할 데이터의 프리픽스(prefix) 비트 길이 정보를 24와 비교하여 24 이상이면 빈 영역의 하위주소에 추가하고 24 미만이면 상위주소에 입력한다. 추가할 데이터의 프리픽스(prefix) 비트 길이가 24 이상이면 길이가 24 비트 프리픽스(prefix)를 갖는 데이터의 띠(band)가 빈 영역의 낮은 주소에 있으므로 LP(24)의 데이터를 UP(24)에 옮기면(즉, LP(24)가 가리키는 데이터를 읽어서 UP(24)가 가리키는 공간에 쓰면)(910), UP(25) 즉 LP(24)의 데이터 공간이 비어 있게 된다. 따라서, 이 공간에 LP(25)의 데이터를 옮기면(920), UP(26) 즉 LP(25)의 데이터 공간이 비어있게 되고 순차적으로 데이터를 옮겨 추가하여야 할 길이 i 비트의 프리픽스(prefix) 데이터 공간의 UP(i)에 데이터를 추가함으로써 테이블 갱신이 완료된다.When the table manager 530 receives a data addition command from the CPU 520, the prefix bit length information of the data to be added is compared with 24 to add to the lower address of an empty area and to be less than 24. Enter in the upper address. If the prefix bit length of the data to be added is 24 or more, the data of the LP 24 is transferred to the UP 24 because the band of the data having the 24-bit prefix is located at a low address of an empty area. Moving it (ie, reading the data pointed to by LP 24 and writing it to the space pointed by UP 24) 910, the data space of UP 25, or LP 24, becomes empty. Therefore, if the data of the LP 25 is moved to this space (920), the data space of the UP (26), that is, the LP (25) becomes empty, and i-prefix data of length i bits to be moved and added sequentially. The table update is completed by adding data to UP (i) of the space.

도 10은 프리픽스 길이 24 비트 미만인 경우 데이터의 CAM 테이블 추가 도면이다.FIG. 10 is an additional diagram of a CAM table of data when the prefix length is less than 24 bits. FIG.

추가할 데이터의 프리픽스(prefix) 비트 길이가 24 비트 미만이면, 길이가 23 비트 프리픽스(prefix)를 갖는 데이터의 띠(band)가 빈 영역의 낮은 주소에 있으므로, UP(23)의 데이터를 LP(23)에 옮기면(즉, UP(23)가 가리키는 데이터를 읽어서 LP(23)가 가리키는 공간에 쓰면)(1010), UP(23) 즉 LP(22)의 데이터 공간이 비어있게 된다. 따라서, 이 공간에 UP(22)의 데이터를 옮기면(1020), UP(22) 즉 LP(21)의 데이터 공간이 비어있게 되고 순차적으로 데이터를 옮겨 추가하여야 할 길이 i 비트의 프리픽스(prefix) 데이터 공간의 LP(i)에 데이터를 추가함으로써 테이블 갱신이 완료된다.If the prefix bit length of the data to be added is less than 24 bits, since the band of data having a 23-bit prefix is at a low address of an empty area, the data of the UP 23 is stored in LP ( 23) (i.e., reading the data pointed by the UP 23 and writing it to the space pointed by the LP 23) 1010, the data space of the UP 23 or LP 22 becomes empty. Therefore, if the data of the UP 22 is moved to this space (1020), the data space of the UP 22, that is, the LP 21 becomes empty, and i-prefix data of length i bits to be moved and added sequentially. The table update is completed by adding data to the LP (i) of the space.

한편, 상술한 본 발명의 실시예들은 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하고, 컴퓨터로 읽을 수 있는 기록매체를 이용하여 상기 프로그램을 동작시키는 범용 디지털 컴퓨터에서 구현될 수 있다.Meanwhile, the above-described embodiments of the present invention can be written as a program that can be executed in a computer, and can be implemented in a general-purpose digital computer that operates the program using a computer-readable recording medium.

상기 컴퓨터로 읽을 수 있는 기록매체는 마그네틱 저장매체(예를 들면, 롬, 플로피 디스크, 하드디스크 등), 광학적 판독 매체(예를 들면, 씨디롬, 디브이디 등) 및 캐리어 웨이브(예를 들면, 인터넷을 통한 전송)와 같은 저장매체를 포함한다.The computer-readable recording medium may be a magnetic storage medium (for example, a ROM, a floppy disk, a hard disk, etc.), an optical reading medium (for example, a CD-ROM, DVD, etc.) and a carrier wave (for example, the Internet). Storage medium).

이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.So far I looked at the center of the preferred embodiment for the present invention. Those skilled in the art will appreciate that the present invention can be implemented in a modified form without departing from the essential features of the present invention. Therefore, the disclosed embodiments should be considered in descriptive sense only and not for purposes of limitation. The scope of the present invention is shown in the claims rather than the foregoing description, and all differences within the scope will be construed as being included in the present invention.

상술한 바와 같이 본 발명은, 추가되는 데이터의 프리픽스(prefix) 길이 분포가 24비트를 경계로 양분되는 경우 평균적으로 프리픽스(prefix) 길이 데이터의 이동횟수를 감소시키고 전체적으로 데이터 갱신 시간을 줄이는 효과가 있다. 따라서 많은 데이터를 갱신할 경우에 짧은 시간 동안에 전체 데이터를 갱신할 수 있는 장점이 있다.As described above, the present invention has an effect of reducing the number of shifts of the prefix length data and reducing the data update time as a whole when the prefix length distribution of the additional data is divided into 24 bits. . Therefore, when updating a lot of data, there is an advantage that can update the entire data in a short time.

Claims (8)

(a) 소정의 프리픽스 길이를 갖는 데이터 영역 정보를 나타내는 하위 포인터와 및 상위 포인터를 구비하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블을 제공하는 단계;(a) providing a content addressable memory (CAM) lookup table having a lower pointer representing data area information having a predetermined prefix length and an upper pointer; (b) 상기 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블에 데이터를 추가하는 명령을 수신하고, 추가할 데이터의 프리픽스 길이와 소정의 값을 비교하는 단계;(b) receiving a command to add data to the content addressable memory (CAM) lookup table and comparing a prefix length and a predetermined value of the data to be added; (c) 상기 (b) 단계의 결과, 상기 추가할 데이터의 프리픽스 길이가 소정의 값 이상이면, 상기 각 데이터 밴드의 하위 포인터가 기억하는 주소 데이터를 상기 각 데이터 밴드의 상위포인터가 기억하는 주소 데이터 영역으로 순차적으로 이동시키는 단계; 및(c) As a result of step (b), if the prefix length of the data to be added is greater than or equal to a predetermined value, the address data stored by the upper pointer of each data band stores the address data stored by the lower pointer of each data band. Sequentially moving to regions; And (d) 상기 (b) 단계의 결과, 상기 추가할 데이터의 프리픽스 길이가 소정의 값 미만이면, 상기 각 데이터 밴드의 상위 포인터가 기억하는 주소 데이터를 상기 각 데이터 밴드의 하위포인터가 기억하는 주소 데이터 영역으로 순차적으로 이동시키는 단계를 포함하는 LPM(Longest Prefix Matching)을 사용하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리방법.(d) If the prefix length of the data to be added is less than a predetermined value as a result of step (b), the address data stored by the lower pointer of each data band stores the address data stored by the upper pointer of each data band. A method of managing a content addressable memory (CAM) lookup table using Longest Prefix Matching (LPM), comprising sequentially moving to an area. 제1항에 있어서, 상기 (a) 단계는The method of claim 1, wherein step (a) (a1) 프리픽스의 길이가 소정의 값 이상인 데이터 밴드에는, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 데이터 중에서 주소가 가장 낮은 데이터의 주소정보를 기억하고 있는 하위 포인터와, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 데이터 중에서 주소가 가장 높은 데이터의 다음 주소정보를 기억하고 있는 상위 포인터를 구비하는 단계; 및(a1) A data pointer having a prefix length equal to or greater than a predetermined value includes a lower pointer storing address information of data having the lowest address among a plurality of data having the same prefix length stored in the data band, and the prefix stored in the data band. Providing an upper pointer storing next address information of data having the highest address among a plurality of data having the same length; And (a2) 프리픽스의 길이가 소정의 값 미만인 데이터 밴드에는, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 데이터 중에서 주소가 가장 낮은 데이터의 다음 주소정보를 기억하고 있는 하위 포인터와, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 데이터 중에서 주소가 가장 높은 데이터의 주소정보를 기억하고 있는 상위 포인터를 구비하는 단계를 포함하는 것을 특징으로 하는 LPM(Longest Prefix Matching)을 사용하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리방법.(a2) In a data band having a prefix length less than a predetermined value, a lower pointer storing next address information of data having the lowest address among a plurality of data having the same prefix length stored in the data band, and stored in the data band. A content addressable memory (CAM) using Longest Prefix Matching (LPM), characterized by comprising an upper pointer storing address information of data having the highest address among a plurality of data having the same prefix length. How to manage lookup tables. 제1항 또는 제2항에 있어서, 상기 소정의 값은The method according to claim 1 or 2, wherein the predetermined value is 24 인 것을 특징으로 하는 LPM(Longest Prefix Matching)을 사용하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리방법.24. A method of managing a content addressable memory (CAM) lookup table using Longest Prefix Matching (LPM), characterized in that: 프리픽스 길이에 따라서 데이터를 낮은 주소로부터 또는 높은 주소로부터 저장하는 룩업테이블을 포함하는 컨텐트 주소지정가능 메모리(CAM);A content addressable memory (CAM) including a lookup table for storing data from a low address or from a high address according to a prefix length; 소정의 프리픽스 길이를 갖는 데이터 밴드 영역의 경계 데이터를 기억하는 하위포인터 및 상위포인터를 포함하는 포인터 저장부; 및A pointer storage unit including a lower pointer and an upper pointer for storing boundary data of a data band region having a predetermined prefix length; And 상기 데이터 밴드에 데이터를 추가하는 명령을 받아서 상기 포인터 저장부에 저장되어 있는 상위포인터와 하위포인터를 제어하고 상기 컨텐트 주소지정가능 메모리(CAM) 제어부를 구동하여 컨텐트 주소지정가능 메모리(CAM) 테이블을 갱신하는 테이블 관리부를 포함하는 LPM(Longest Prefix Matching)을 사용하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리장치.A command to add data to the data band is used to control an upper pointer and a lower pointer stored in the pointer storage unit, and to drive the content addressable memory (CAM) control unit to generate a content addressable memory (CAM) table. A content addressable memory (CAM) lookup table management device using Longest Prefix Matching (LPM) including a table management unit for updating. 제4항에 있어서, 상기 포인터 저장부는The method of claim 4, wherein the pointer storage unit 프리픽스의 길이가 소정의 값 이상인 데이터 밴드에는, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 데이터 중에서 주소가 가장 낮은 데이터의 주소정보를 기억하고 있는 하위 포인터와, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 데이터 중에서 주소가 가장 높은 데이터의 다음 주소정보를 기억하고 있는 상위 포인터를 구비하고,A data band having a prefix length equal to or greater than a predetermined value includes a lower pointer storing address information of data having the lowest address among a plurality of data having the same prefix length stored in the data band, and having the same prefix length stored in the data band. An upper pointer storing next address information of data having the highest address among the plurality of data; 프리픽스의 길이가 소정의 값 미만인 데이터 밴드에는, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 데이터 중에서 주소가 가장 낮은 데이터의 다음 주소정보를 기억하고 있는 하위 포인터와, 상기 데이터 밴드에 저장된 프리픽스 길이가 같은 복수의 데이터 중에서 주소가 가장 높은 데이터의 주소정보를 기억하고 있는 상위 포인터를 구비하는 것을 특징으로 하는 LPM(Longest Prefix Matching)을 사용하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리장치.A data band having a prefix length less than a predetermined value includes a lower pointer storing next address information of data having the lowest address among a plurality of data having the same prefix length stored in the data band, and a prefix length stored in the data band. A content addressable memory (CAM) lookup table management apparatus using Longest Prefix Matching (LPM), characterized by having an upper pointer storing address information of data having the highest address among a plurality of data. 제4항에 있어서, 상기 테이블 관리부는The method of claim 4, wherein the table management unit 추가할 데이터의 프리픽스 길이가 소정의 값 이상이면, 상기 각 데이터 밴드의 하위 포인터가 기억하는 주소 데이터를 상기 각 데이터 밴드의 상위포인터가 기억하는 주소영역으로 순차적으로 이동시키고, 추가할 데이터의 프리픽스 길이가 소정의 값 미만이면, 상기 각 데이터 밴드의 상위 포인터가 기억하는 주소의 데이터를 상기 각 데이터 밴드의 하위포인터가 기억하는 주소영역으로 순차적으로 이동시키는 것을 특징으로 하는 LPM(Longest Prefix Matching)을 사용하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리장치.If the prefix length of the data to be added is equal to or greater than a predetermined value, the address data stored by the lower pointer of each data band is sequentially moved to the address area stored by the upper pointer of each data band, and the prefix length of the data to be added When L is less than a predetermined value, Longest Prefix Matching (LPM) is used, which sequentially moves data of an address stored by an upper pointer of each data band to an address area stored by a lower pointer of each data band. A content addressable memory (CAM) lookup table management device. 제5항 또는 제6항에 있어서, 상기 소정의 값은The method of claim 5 or 6, wherein the predetermined value is 24 인 것을 특징으로 하는 LPM(Longest Prefix Matching)을 사용하는 컨텐트 주소지정가능 메모리(CAM) 룩업 테이블 관리장치.24. A Content Addressable Memory (CAM) lookup table management device using Longest Prefix Matching (LPM), characterized in that the value of 24. 제1항 내지 제3항 중 어느 한 항에 기재된 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.A computer-readable recording medium having recorded thereon a program for executing the method according to any one of claims 1 to 3.
KR10-2002-0034879A 2002-06-21 2002-06-21 CAM lookup table management method based on LPM. KR100420960B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR10-2002-0034879A KR100420960B1 (en) 2002-06-21 2002-06-21 CAM lookup table management method based on LPM.

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR10-2002-0034879A KR100420960B1 (en) 2002-06-21 2002-06-21 CAM lookup table management method based on LPM.

Publications (2)

Publication Number Publication Date
KR20030097487A true KR20030097487A (en) 2003-12-31
KR100420960B1 KR100420960B1 (en) 2004-03-02

Family

ID=32388017

Family Applications (1)

Application Number Title Priority Date Filing Date
KR10-2002-0034879A KR100420960B1 (en) 2002-06-21 2002-06-21 CAM lookup table management method based on LPM.

Country Status (1)

Country Link
KR (1) KR100420960B1 (en)

Also Published As

Publication number Publication date
KR100420960B1 (en) 2004-03-02

Similar Documents

Publication Publication Date Title
US6842791B2 (en) Method and apparatus for memory efficient fast VLAN lookups and inserts in hardware-based packet switches
US7774538B2 (en) Method for ternary contents address memory table management
JP3250544B2 (en) Transfer destination search method, transfer destination search device, search table recording medium, and search program recording medium
US10778583B2 (en) Chained longest prefix matching in programmable switch
US6665297B1 (en) Network routing table
US20080192754A1 (en) Routing system and method for managing rule entries of ternary content addressable memory in the same
KR102195836B1 (en) Method for managing index
US11687594B2 (en) Algorithmic TCAM based ternary lookup
US6611832B1 (en) Data structure for longest-matching prefix searching and updating method for search table data structures
US20040133590A1 (en) Tree data structure with range-specifying keys and associated methods and apparatuses
CN101620623A (en) Method and device for managing list item of content addressable memory CAM
US6574701B2 (en) Technique for updating a content addressable memory
US6532516B1 (en) Technique for updating a content addressable memory
US10515015B2 (en) Hash table-based mask length computation for longest prefix match caching
US6590898B1 (en) Method and apparatus for routing data packets
KR100413528B1 (en) LPM-based CAM look-up-table managing method, the apparatus thereof and the recording medium thereof
US6925503B2 (en) Method and system for performing a longest prefix match search
US20030225964A1 (en) Managing a position-dependent data set that is stored in a content addressable memory array at a network node
US6996664B2 (en) Ternary content addressable memory with enhanced priority matching
JP2006246488A (en) Network router, address processing method, and computer program
KR100420960B1 (en) CAM lookup table management method based on LPM.
KR102057055B1 (en) Method for managing index
KR100420959B1 (en) CAM lookup table management method based on LPM.
Ghosh et al. A hash based architecture of longest prefix matching for fast IP processing
EP2003820B1 (en) Method and device of learning forwarding feature information

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20130205

Year of fee payment: 10

FPAY Annual fee payment

Payment date: 20140123

Year of fee payment: 11

FPAY Annual fee payment

Payment date: 20150126

Year of fee payment: 12

FPAY Annual fee payment

Payment date: 20160127

Year of fee payment: 13

FPAY Annual fee payment

Payment date: 20170124

Year of fee payment: 14

LAPS Lapse due to unpaid annual fee