{"id":230,"date":"2021-08-16T07:04:52","date_gmt":"2021-08-16T00:04:52","guid":{"rendered":"https:\/\/dgway.com\/blog_E\/?p=230"},"modified":"2021-09-21T10:09:38","modified_gmt":"2021-09-21T03:09:38","slug":"whats-tcam","status":"publish","type":"post","link":"https:\/\/dgway.com\/blog_E\/2021\/08\/16\/whats-tcam\/","title":{"rendered":"What&#8217;s TCAM?"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"290\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/Head-1-1024x290.jpg\" alt=\"\" class=\"wp-image-235\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/Head-1-1024x290.jpg 1024w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/Head-1-300x85.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/Head-1-768x217.jpg 768w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/Head-1-1536x435.jpg 1536w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/Head-1-2048x580.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>TCAM <\/strong>stands for <strong>Ternary Content-addressable Memory<\/strong>. It is a kind of CAM. Then, What the CAM is? <strong>CAM <\/strong>is Content-addressable Memory. The principle of CAM is giving CAM a keyword. Then, the user gets an address to go. Like going to the 8 floors library, asking the librarian where the book named \u201cLord of the ring : the fellowship of the ring\u201d is. Then, the librarian gives a location such as 8th floor, shelf A, row C and column B. CAM\u2019s principle is retrieving fixed-length keywords and searching in the rule table. Giving an address to the user as the answer. In addition, the keyword must only be \u201c0\u201d or \u201c1\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"420\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/RAMCAM-1024x420.jpg\" alt=\"\" class=\"wp-image-234\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/RAMCAM-1024x420.jpg 1024w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/RAMCAM-300x123.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/RAMCAM-768x315.jpg 768w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/RAMCAM-1536x630.jpg 1536w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/RAMCAM.jpg 1816w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>CAM <\/strong>works opposite to <strong>RAM<\/strong>. RAM is working by giving it a location. After That, the user retrieves the data. For easy to understand, from the last example in the library, the user knows the location which is 8th floor , shelf A, row C and column B. but user does not know what the book is until the user gets to the location.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/TCAM-1024x300.jpg\" alt=\"\" class=\"wp-image-233\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/TCAM-1024x300.jpg 1024w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/TCAM-300x88.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/TCAM-768x225.jpg 768w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/TCAM-1536x450.jpg 1536w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/TCAM.jpg 1929w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now, The question is: How does <strong>TCAM<\/strong> work? <strong>TCAM <\/strong>works similarly to CAM but there are slightly different. Users must give CAM a full keyword in order to get the result. <strong>TCAM<\/strong>, on the other hand, requires only a part of the keywords but the length needs to be equal to the full keyword. Let\u2019s go back to the library example again but this time it is different. When the user requests the location of \u201cLord of the ring : xxx xxxxxxxxxx xx xxx xxxx\u201d. The Librarian of CAM version would not give an answer due to \u201cLord of the ring : xxx xxxxxxxxxx xx xxx xxxx\u201d is not recognized. Users have to input the \u201cxxx xxxxxxxxxx xx xxx xxxx\u201d part to get the answer. To contrast, the librarian of the <strong>TCAM <\/strong>version would give the answer even though it gets the \u201cLord of the ring : xxx xxxxxxxxxx xx xxx xxxx\u201d keyword. But the answers might not be an \u201c8th floor , shelf A, row C and column B\u201d. The answer depends on the rules table of <strong>TCAM<\/strong>. The reason <strong>TCAM <\/strong>is able to give an answer with unreadable inputs. Because <strong>TCAM <\/strong>accepts \u201cX\u201d or \u201cdon\u2019t care\u201d inputs not only \u201c0\u201d or \u201c1\u201d in CAM\u2019s principle.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Application<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"382\" src=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/application-1-1024x382.jpg\" alt=\"\" class=\"wp-image-232\" srcset=\"https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/application-1-1024x382.jpg 1024w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/application-1-300x112.jpg 300w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/application-1-768x287.jpg 768w, https:\/\/dgway.com\/blog_E\/wp-content\/uploads\/2021\/08\/application-1.jpg 1457w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Most applications on <strong>TCAM <\/strong>are found in high-end Network devices for example routers and switches with fancy options. CAM is a perfect solution to increase speed of route lookup, package forwarding and package classification. To be easy to understand, MAC is fixed-length information in a package. When the package reaches the switch or router, they need to tell the package where to go. If the switch is composed of <strong>TCAM<\/strong>. Just match the MAC in the rule table and the package knows where to go. Without <strong>TCAM<\/strong>, Router or Switch goes to RAM address by address to search for the matched MAC they are looking for. Then, tell the packet where to go. RAM takes more time than using <strong>TCAM <\/strong>to get the same result. However, there are some cons by using <strong>TCAM <\/strong>which is price. Due <strong>TCAM <\/strong>might be a dedicated chip opposite to the RAM. RAM might be embedded in the CPU which is cheaper than using the other chip to do the same action.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Conclusion<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CAM is like a search engine in circuit with a fixed-length of keyword to search and accept only \u201c0\u201d or \u201c1\u201d input. <strong>TCAM <\/strong>is a developed version of CAM that accepts \u201cdon\u2019t care\u201d input but the keyword is still fixed-length. CAM is working opposite to RAM. CAM is using a keyword to find the location. RAM is going to the location and gets the data. Therefore, CAM is mostly used in network devices due its ability to find the way which is the job of router or switch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More info about TCAM on FPGA, please visit<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/dgway.com\/ASIP_E.html#tCAMIP\">https:\/\/dgway.com\/ASIP_E.html#tCAMIP<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TCAM stands for Ternary Content-addressable Memory. It is a kind of CAM. Then, What the CAM is? CAM is Content-addressable Memory. The principle of CAM is giving CAM a keyword. Then, the user gets an address to go. Like going to the 8 floors library, asking the librarian where the book named \u201cLord of the ring : the fellowship of&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":236,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security"],"_links":{"self":[{"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/comments?post=230"}],"version-history":[{"count":4,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/posts\/230\/revisions\/269"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/media\/236"}],"wp:attachment":[{"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dgway.com\/blog_E\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}