Matching Integer Intervals by Minimal Sets of Binary Words with don’t cares
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.
- 1.Kempke, R., McAuley, A.: Ternary CAM memory architecture and methodology. US Patent 5, 841–874 (August 1996)Google Scholar
- 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.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.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.Lakshminarayanan, K., Rangarajan, A., Venkatachary, S.: Algorithms for advanced packet classification with Ternary CAMs. In: SIGCOMM, pp. 193–204 (2005)Google Scholar
- 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.Gilbert, E.: Gray codes and paths on the n-cube. Bell Systems Technical Journal 37, 815–826 (1958)Google Scholar
- 9.Gray, F.: Pulse code communications. US Patent 2,632,058 (March 1953)Google Scholar
- 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