Optimized Multiple-Bit-Flip Soft-Errors-Tolerant TCAM using Machine Learning

Received: February 11, 2022 Revised: March 25, 2022 Available online: March 29, 2022 Soft errors from radiations can change the data in electronic devices especially memory cells such as in TCAMs. The soft errors cause bit-flip errors that makes the data are corrupted in the network. This paper presents a novel machine learning for a multiple-bit-flip-tolerant TCAM that address soft errors problem using partial don't-care keys (X-keys). The general methodology is classified into two steps, i.e., statistical training and X-keys matching. First, we train the machine by collecting match probability of a filter by using X-keys that match the same locations as the search key. This method uses statistical training to determine the most efficient of number of don't cares. Moreover, in the statistical training, we also explore the maximum number of don't cares that produce best performance in covering the soft errors. Finally, the X-keys are implemented in the TCAM to correct bit-flip errors. The suitable number of don't cares in X-key is determined from the distribution of match probability of the X-keys so that the best degree of tolerance of the TCAM against soft errors is found. Match probabilities for various filters are shown. Experimental results demonstrate that the soft-error tolerance using statistical data has better soft-error tolerance than other methods. The proposed method is useful for soft-error tolerant TCAMs in routers and firewalls for robust networks.


INTRODUCTION
In the era of artificial intelligent and internet of things (IoT), the demands for high-reliability circuits are constantly increasing. For applications, such as financial transactions, aerospace communications, and military based networks, fault-tolerant circuits are indispensable to avoid faulty data.

Figure 1 Soft Error in TCAM
In networks, a special type of memory called ternary content addressable memory (TCAM) is often used to perform packet forwarding, access controlling, and filtering [1], [2]. A TCAM has three values, namely 0, 1, and don't-care. Fig. 1 illustrates a TCAM. It compares the input vector with the entire list of registered vectors simultaneously [3]. A TCAM is a de facto standard in routers and devices for packet classification in highspeed network applications [2]. Fig. 1 shows a cell in a TCAM. The search bits ( , ̅̅̅ ) are compared with stored bits. When a match occurs, the match line ( ) sends a signal to the priority encoder to produce the match address. However, a TCAM can be attacked by soft errors caused by radiations that changes the data of the memory cells [4], [5]. The soft errors cause bit-flip errors that makes the data in the network corrupted. Moreover, some hardware applications of soft error tolerant TCAMs using SRAM and GPU are presented in [6] and [7], respectively. This work is based on partial don't care keys used for detecting bit-flip errors. A novel method by using machine learning is proposed for improving the tolerance performance and the execution speed. The major contributions of this work are as follows: 1) The distribution of the match probability of a filter is found; 2) A suitable number of don't care bits for X-keys is determined by the mean from the statistical data; 3) The proposed method uses only one TCAM and requires no modification of the TCAM.
The organization of the paper is as follows: First, we explain the definition and the basic properties of classification function, softerror in TCAMs and partial-don't-care keys that are used in the research. Second, we explain the statistical properties of partialdon't-care keys that is used to optimize the parameters for resolve the bit flips caused by the soft errors. Third, we explain the proposed method which is the random X-keys for bit-flip errors detection using machine learning. Finally, we show the experimental results and conclude the paper.

DEFINITIONS AND BASIC PROPERTIES
First, we explain the definition and the basic properties of classification function, soft-error in TCAMs and partial-don'tcare keys that are used in the research.

Classification Functions
A TCAM consists of words, each of them representing a packet classifier rule [2].

Definition 1:
A classification function with fields is a mapping . is specified by a set of rules. A rule consists of fields, and each field is specified by an interval of bits.
A packet classifier is specified by source and destination addresses, source and destination ports, and the protocol type [2]. The works on the representation of classification functions are [8], [9].

Soft Errors in a TCAM Cell
Definition 2: A soft error in a TCAM cell is a non-permanent error that changes the value of the cell temporarily and may cause misclassification. Note that, in this work, the soft errors are assumed to occur randomly with the probability = / in a TCAM word, or words in a TCAM as a whole. Moreover, the errors, i.e., the changes of the stored values are assumed at the beginning of a test.

Partial Don't-Care Keys (X-keys)
Firstly, we define partial don't-care keys (X-keys). The X-keys are derived from the main search key that enters the TCAM for look-up operations.

Definition 4:
A partial don't-care key (X-key) is a search key with inserted don't-care bits. The key is used to detect a soft error in TCAM words [10].
We can set the number of don't-cares inserted in an X-key according to the estimated amount of soft errors. The ability to detect soft errors increases with the number of inserted don'tcares. In this work, we assume that the number of segmentations ( ) is maximum, i.e., the value of = , where is the number of bits in a TCAM word and the number of don't-care groups covers bits.

Lemma 1:
The different number of X-keys in a look-up table for multiple-bit-flip errors is: where is the number of fields (segmentations) in a TCAM word and is the number of don't-care groups in the X-keys. In this case, a don't-care group refers to a particular field whose all bits are set as don't-care bits [10].

Overview of the Proposed Method
In this work, we use machine learning to analyze the matching distribution of partial don't-care keys. However, the setting of the filter is found by examining the distributions of matching probability in the subsequent sections. After the trained X-keys are generated, they enter the TCAM, and the matching indices are checked by the index checker. Finally, it performs short scrubbing intervals by 10% of number of rules by referring the ECC SRAM.

STATISTICAL PROPERTIES OF PARTIAL DON'T CARE KEYS (X-KEYS)
In this section, we briefly explain our proposed method by analyzing and deriving the statistical properties of X-keys. The mean and the variance of the distribution of filter matching probability help to choose the number of don't cares in the Xkeys.

Mean and Variance
First, we define an event of an X-key with one inserted don't-care bit. From this, we find the distribution of filter matching probability.
Definition 5: Let be the probability of an X-key that is inserted with a don't-care bit at the index will match as the same index as the search key in a TCAM. Let be the random X-key with a don't-care bit at the index for various search keys. We assume the event of different index as an independent event. Thus, we have ( ) = .
The mean [13], [14] of the probability of an X-keys that is inserted with a don't-care bit at the index will match as the same index as the search key in a TCAM is derived as follows: First, the variance is derived as follows: Lemma 2: Let ( ) be a matching probability of an X-keys . Let be the mean of the probabilities ( 1 ), ( 2 ), ⋯ , ( ). Then, the mean of X-keys matches the same index in TCAM as the original search key is given by Second, the variance is derived as follows: Lemma 3: Let ( ) be the matching probability of an X-key . Let be the mean of the probabilities ( 1 ), ( 2 ), ⋯ , ( ). Then, the variance is given by

Match Probability
Since it is assumed that the event of matching of an X-key is independent, we have the probability of X-keys with number of don't-care bits as follows: Theorem 1: The probability of X-keys matching is where is the number of don't-care bits in an X-key.
Proof. By Definition 5, the independent event probability is assumed in the matching X-key for a don't-care bit at index. Then, we have the probability of number of don't-care bits by summing the smaller events. Thus, we have the theorem.
The generation of arrays with random X-keys is required to detect the soft errors by covering the errors.
As in [10], [11], and [12], we have the following theorem: Theorem 2: Soft errors can be detected by X-keys that cover all bits of the search key. If all the X-keys match the same word and the word is already refreshed, then the matched word is correct.
Proof. The correct match is represented by the intersection of all matched X-keys: where is the number of X-keys, is the correct match and is an X-key with relations ⊂ such that ⊄ , ≠ . If all of the X-keys match , then is proven to be the correct match, otherwise, some error(s) may have occurred.

Finding the Setting for the Filter using Statistical Properties
In this subsection, we find statistical properties of the filter by using random X-keys. Fig. 3 shows the flowchart of evaluation of a filter. First, we analyze the distribution by the X-keys. Then, from the distribution, we determine the number of X-keys and don't-care bits ( ). Then, we generate the random X-keys by the determined number of don't cares. Finally, if the tolerance does not meet the requirement, we increase the number of X-keys or change the number of don't cares.
Algorithm 1 shows the way to find the filter distribution. There is search keys and we add the number of don't care bits form 1 to − 1 bits. Next, it generates a random X-key (Line 7) by using . If matches the same index as ℎ , we increment the correct counter. Finally, the match probability for bits filter is .

RANDOM X-KEYS FOR BIT-FLIP ERRORS DETECTION USING MACHINE LEARNING
This section first describes previous methods in [10], [11], and [12]. It consists of random generation of X-keys, a TCAM, and an ECC-SRAM for handling the refresh the operation. In this paper, we improve the method by using statistical properties to determine the suitable random X-keys setting.

Random Generation of X-Keys
Algorithm 2 shows the procedure for obtaining a random X-key. If the number of don't-care bits is larger than a half of the total bits, we just randomize the care bits. Inside , the arrays are checked whether the bit has already been assigned (value 1) or not (value 0). When it randomizes the index, it puts the don't-care or the search key bit in the X-key. Finally, it returns the X-key. The collection of the random arrays of X-keys is stored in the . It iterates () function for times, where is the desired number of X-keys.

Algorithm 2 Arrays of Random X-keys( )
, and , where ℎ is the input to match a TCAM word, is X-keys generated from ℎ , is the number of bits, and is the number of don'tcare bits, as well as is the number of X-keys. Output: Random x-keys .*/ 01: The arrays of X-keys will be stored in   Fig. 4 show the proposed ML-TCAM scheme. First, we train the X-keys using statistical properties and enter the X-keys to the TCAM memory. If the indices of the matching Xkeys are the same, thus perfect match is reached, otherwise we detect the bit flip errors from the different indices (Line 12). Next, some filters are refreshed by using the ECC SRAM to recover the errors (Line 18). Fig. 5 shows the steps for covering whole bits by random X-keys. We reduce the number of random ranges when a bit has already been assigned to a don't care bit.

EXPERIMENTAL RESULTS
We evaluated the proposed method by packet classification benchmarks generated by ClassBench [15]. Then, we used these benchmarks and evaluated by the computer program in OSX with i7 Intel machine and 8 GB memory. Table 1 shows the number of search keys as well as the number of rules of ACL1-5, FW1-5, and IPC1-2 filters. We derived match probability of the filters for different numbers don't-care bits from 1 to 103. In this case, the number of bits in the TCAM is 104 which consists of source address (32 bits), destination address (32 bits), source port (16 bits), destination port (16 bits), and protocol type (8 bits). First, we compare our proposed method with KX-TCAM [12] for = . In [12], all-possible perfect match X-keys are generated by the permutation of and , where is the number of bits and is the number of don't-cares in the X-keys. As shown in Table 1, the proposed perfect match using random X-keys is faster than the perfect match X-keys [12] up to 7.65 times.
Next, we evaluated the filter distributions with Algorithm 1. To obtain more accurate and smooth distributions, we iterated the samples 100 times. Fig. 6 shows the match probability of the 40 filters. We approximated the distribution by the cumulative distribution of normal function by calculating the mean .   Figure 6 shows the characteristics of the filters. Thus, we can determine a suitable number of don't care keys for the X-keys. The statistical result is very useful for finding a right setting for each filter, so that the X-keys detect the soft errors at desired tolerance of soft errors. The resume of the mean values are shown in the bottom row of Table 1. The match probability is given by: The ratio of misclassifications is given by: Furthermore, we evaluated the ACL5 filter in particular. This is because the misclassification ratios of ACL5 is higher than others. As shown in Fig. 6, the ACL5 drops at the largest number of don't-care bits. It is also indicated by the largest value which is 94. In this experiment, we assigned the number of X-keys as 2, 3, 4, and 5. Then, we ran Algorithm 3 when the numbers of don'tcare bits were 85 to 95. As shown in Fig. 7, the lowest misclassification ratio was obtained when the number of don'tcare bits was 91. It also indicates that more random X-keys will increase the tolerance of the TCAM. However, for the case where the number of X-keys is 4, the tolerance is similar to the case where the number of X-keys is 5. Fig. 8 shows the time performance.
Finally, we compare our proposed method with other existing methods. In this experiment, we used the filters in Table 1 and compared the performance of other methods: TCAM Scrubbing (TS) [16], TCAM Checker (TC) [17], XTCAM [9], KX-TCAM(4,2) [10], [11], [12], and random X-Keys whose number of don't-care bits = 40 and = 100, as well as the proposed random X-Keys whose number of don't-care bits Mean ( ). The value of the misclassification ratio shows the average of all filters (ACL, FW, IPC). As shown in Fig. 9, random X-Keys with = performs betters in higher bit flips (1 < ) up to more than 2 times compared to TCAM Scrubbing (TS) and TCAM Checker (TC), and 6 times better than other settings of number of don't cares for the random X-Keys. This indicates that by knowing the characteristic of the filters from their statistical data, we can improve the soft-error tolerance of the TCAM.

CONCLUSIONS
This paper has proposed a soft-error-tolerant TCAM for multiplebit-flip errors using randomly generated partial don't-care keys (X-keys). First, we obtained the statistical data of X-keys that match the same locations as the search key. After that, we assumed the distribution of filters to estimate the number of don't-care bits in X-keys. Finally, the X-key were implemented in TCAM to correct bit-flip errors. Moreover, the suitable number of don't-care bits in an X-keys was determined from the distribution of X-keys so that the appropriate degree of tolerance of the TCAM against soft errors was found. Match probabilities for various filters were shown. Experimental results demonstrated that the soft-error tolerance using statistical data has better softerror tolerance than other methods up to more than 6 times and it is faster up to 7.65 times compared to other methods. Moreover, our method simplifies the generation of X-keys and helps to find the proper number of don't-care bits in the X-keys. The proposed method is useful for soft-error tolerant TCAMs in routers for robust communications. In the future, researches on the implementations of soft-error tolerant systems on embedded devices such as FPGAs, GPUs, or even specific ASICs are open to be explored.