Matching Integer Intervals by Minimal Sets of Binary Words with don’t cares

  • Wojciech Fraczak
  • Wojciech Rytter
  • Mohammadreza Yazdani
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5029)


An interval [p,q], where 0 ≤ p ≤ q < 2 n , can be considered as the set X of n-bit binary strings corresponding to encodings of all integers in [p,q]. A word w with don’t care symbols is matching the set L(w) of all words of the length |w| which can differ only on positions containing a don’t care. A set Y of words with don’t cares is matching X iff X  = ∪  w ∈ Y L(w). For a set X of codes of integers in [p,q] we ask for a minimal size set Y of words with don’t cares matching X. Such a problem appears in the context of network processing engines using Ternary Content Addressable Memory (TCAM) as a lookup table for IP packet header fields. The set Y is called a template in this paper, and it corresponds to a TCAM representation of an interval. It has been traditionally calculated by a heuristic called “prefix match”, which can produce a result of the size approximately twice larger than the minimal one. In this paper we present two fast (linear time in the size of the input and the output) algorithms for finding minimal solutions for two natural encodings of integers: the usual binary representation (lexicographic encoding) and the reflected Gray code.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Kempke, R., McAuley, A.: Ternary CAM memory architecture and methodology. US Patent 5, 841–874 (August 1996)Google Scholar
  2. 2.
    Kohonen, T.: Content-Addressable Memories. Springer, New York (1980)zbMATHGoogle Scholar
  3. 3.
    Davis, G., Jeffries, C., Lunteren, J.: Method and system for performing range rule testing in a ternary content addressable memory. US Patent 6, 886,073 (April 2005)Google Scholar
  4. 4.
    Jeong, H.J., Song, I.S., Kwon, T.G., Lee, Y.K.: A multi-dimension rule update in a tcam-based high-performance network security system. In: AINA 2006: Proceedings of the 20th International Conference on Advanced Information Networking and Applications. AINA 2006, Washington, DC, USA, vol. 2, pp. 62–66. IEEE Computer Society, Los Alamitos (2006)CrossRefGoogle Scholar
  5. 5.
    Srinivasan, V., Varghese, G., Suri, S., Waldvogel, M.: Fast and scalable layer four switching. In: SIGCOMM 1998: Proceedings of the ACM SIGCOMM 1998 conference on Applications, technologies, architectures, and protocols for computer communication, pp. 191–202. ACM, New York (1998)CrossRefGoogle Scholar
  6. 6.
    Lakshminarayanan, K., Rangarajan, A., Venkatachary, S.: Algorithms for advanced packet classification with Ternary CAMs. In: SIGCOMM, pp. 193–204 (2005)Google Scholar
  7. 7.
    Liu, H.: Efficient mapping of range classifier into ternary-cam. In: HOTI 2002: Proceedings of the 10th Symposium on High Performance Interconnects HOT Interconnects (HotI 2002), Washington, DC, USA, p. 95. IEEE Computer Society, Los Alamitos (2002)Google Scholar
  8. 8.
    Gilbert, E.: Gray codes and paths on the n-cube. Bell Systems Technical Journal 37, 815–826 (1958)Google Scholar
  9. 9.
    Gray, F.: Pulse code communications. US Patent 2,632,058 (March 1953)Google Scholar
  10. 10.
    Brayton, R., Hachtel, G., McMullen, C., Sangiovanni-Vincentelli, A.: Logic Minimization Algorithms for VLSI Synthesis. Kluwer Academic Publishers, Dordrecht (1984)zbMATHGoogle Scholar
  11. 11.
    Fraczak, W., Rytter, W., Yazdani, M.: TCAM representations of intervals of integers encoded by binary trees. In: Proceedings of IWOCA Conference, Lake Macquarie, Newcastle, Australia (November 2007)Google Scholar
  12. 12.
    Coudert, O.: Two-level logic minimization: an overview. Integr. VLSI J 17(2), 97–140 (1994)zbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Wojciech Fraczak
    • 1
    • 3
  • Wojciech Rytter
    • 2
    • 4
  • Mohammadreza Yazdani
    • 3
  1. 1.Dépt d’informatiqueUniversité du Québec en OutaouaisGatineauCanada
  2. 2.Inst. of InformaticsWarsaw UniversityWarsawPoland
  3. 3.Dept. of Systems and Computer Eng.Carleton UniversityOttawaCanada
  4. 4.Department of Mathematics and InformaticsCopernicus UniversityTorunPoland

Personalised recommendations