{'fraction_non_alphanumeric': 0.026513489800394825, 'fraction_numerical': 0.0065529721430138185, 'mean_word_length': 4.5003770170411705, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Error Comparison Based Patching (ECP) for Medium Access Control of Cell-free Massive MIMO Networks in 6G Terahertz Band Communications

The future Internet is supposed to support a myriad of applications that generate many bursts of multimedia traffic. While the classical cell-based architecture of wireless networks cannot scale up to meet the area trafﬁc capacity and connection density requirements put forth by 6G, Terahertz band for cell-free massive MIMO is regarded as a promising solution. However, the medium access control in Terahertz band communication is significantly different from that of previous generations due to the distinct channel characteristics of Terahertz band. A good match to Terahertz communication is cell-free massive MIMO network architecture, where the antenna beams are located irregularly, coordination among base stations is required to improve the throughput. In this paper, we propose an error comparison based patching where replicated packets transmitted from different access points in various directions (locations) are compared with each other, section by section, based on the degree of consistency between a data packet and its corresponding polling data bits. The error comparison based patching puts together the best sections among replicas of a data packet to form a good one. In the performance evaluation, we demonstrate that the proposed error comparison based patching can significantly improve the percentage of intermittent blocking fading of the data packets in THz band communications for a cell-free massive MIMO network architecture by as high as 80 percent.


Introduction
It is known that the need for both higher data rates and larger channel bandwidths necessitate the incorporation of Terahertz (THz) and sub-THz spectrum within 6G [1,2,3]. At THz, intermittent block fading (IBF) phenomenon makes stable signal quality more challenging than lower frequency band [3,4,5,6]. For example, limited diffraction and surrounding objects behave as full blockers; Oxygen may absorb signals of specific frequencies; Foliage may cause intermittent signal degradation; Dynamic blockage caused by moving humans [6,7,8]. On the other hand, hyper real-time multimedia such as holographic teleportation remains one of the key applications and demands huge transmission bandwidth for extra short latency requirement [6,9]. Since THz bands provide huge bandwidth with easily blocked signals, a large number of access points (APs) and reflective surfaces are needed to guarantee wide-area coverage [6,10,11,12]. However, we note that fading, blocking, interference, and so on, result in severe degradation of the quality of experience (QoE). On top of that the lack of efficient medium access control (MAC) makes things worse [13,14]. Moreover, constrained resources of Internet of Things (IoT) devices and extremely fast data rate make complex processing nearly impossible.
The MAC schemes in THz band communications require certain measure in order to overcome both the deafness problem and line of sight (LoS) blockage, among others [6]. The former refers to as the misalignment of the highly directional transmission beam between a pair of transceivers. In contrast to the conventional RF systems with omnidirectional antennas where ALOHA is typically used [15,16], the MAC protocols designed for THz band require sharp beam focus in order to provide higher gain and long distance transmission. A good beam alignment strategy is normally required to steer beams towards destined devices with high accuracy as a deafness avoidance measure to increase the channel throughput [17,18]. The latter indicates that the received power of a user device may undergo deep fading due to the blockage of the LoS path to the device. For example, attenuation by the human body can be as high as 20 dB at 60 GHz and above [7,8]. Multi-hop schemes at the THz bands have been proposed to form alternative routes in case of the occurrence of blockage. However, multi-hop requires both a careful link-level scheduling and neighbor discovery process to achieve high throughput [19,20].
On the side of network architecture, the main difference between cell-free massive MIMO and classic massive MIMO communication systems is that, instead of associating each user terminal to a cell with a base station equipped with a large number of antenna elements, the former removes cell boundaries using a subset of access points (APs), serve an end user device simultaneously in a coordinated manner.
In coordinated cell-free massive MIMO, APs can share with each other the data to be sent to end user devices, and data received from end user devices, and vice versa [21,22]. Cell-free massive MIMO systems demonstrate much higher throughput compared to small cells and are more robust to impacts such as shadow fading, blocking, as well as noise.
Alternatively, we propose an error comparison based patching (ECP) technique for medium access control in cell-free massive MIMO network architecture.
Instead of packing a very large number of antenna elements at a single base station, the cell-free massive MIMO forms a coordinated framework consisting of multiple APs, each with a small number of antennas, where a single user is served by more than one APs at the same time, overcoming the disadvantage of bad channel conditions such as IBF. The ECP intends to select the best section of a packet (with minimal IBF) through comparing replicas of a packet, section by section, to form a selected packet, where replicas of a packet are logically partitioned through section masking. In the process of error comparison, the equivalent sections of replicas are compared with their corresponding polling data sections, independently, and the sections with the fewest inconsistency is chosen. We illustrate the error comparison using an example with two replicas of a packet, transmitted from two separate APs to an end user device. Let 11 and 21 denote the polling data bits for the first section of data packets 11 and 21 , respectively. In a perfect channel condition, the polling data bits should be identical to corresponding data bits of the original packet. Due to the adversarial channel conditions e.g., IBF mentioned above, some of the bits are ruined. A data bit is still the same as its corresponding polling bit, the pair of bits is called to be consistent. Otherwise, they are inconsistent. If the number of inconsistent pair of bits between 11 and 11 is greater than that between 21 and 21 , then, the section 1 of 1 is most likely to be of more error bits than the corresponding section of 2 . Consequently, section 1 of 2 is patched onto the corresponding section of 1 . The process continues for each of the remaining sections of 1 and 2 .
Since multimedia communication does not require error-free communication, removing errors induced by IBF as much as possible can significantly improve the quality of experience. The performance evaluation demonstrates that the BER performance is significantly improved through ECP.
All in all, our motivation is very simple, compute the degree of consistency between data bits of a packet and the corresponding polling bits in the polling data packet, section by section, and compare them with the replicas of a packet from other AP(s) as a basis of selection of preferred sections. The contributions of this paper are as follows. First, we introduce the concept of ECP, and show how it can be used in medium access control for THz band communication. Secondly, we delineate the selection and patching algorithms of ECP for MAC. Thirdly, we provide the performance evaluation for the proposed selection algorithms and demonstrate the effectiveness of ECP in mitigating the impact of IBF.
The ECP is well suited for the Terahertz communication in 6G, where intermittent signal interruption and signal blocking are rampant, for the following reasons. First, the adaptive adjustment of redundancy is flexible in both the initial value and the rate of increment/decrement of redundancy. The ECP is highly scalable, a feature highly desirable for cell-free massive MIMO, where the number of APs for each receiver can vary dynamically. The ECP does not need to know the number of APs ahead of time.
Secondly, the light processing requirement of ECP is ideal for low power, low cost IoT devices. The ECP requires primitive operations only, such as "AND", "XOR", and "ADD", and no complex operations are required. Thirdly, patching can remove the IBF completely if a section of a data packet is free of IBF. This paper is organized as follows. In Section 2, we show the systems model based on a cell-free massive MIMO network architecture. In Section 3, we delineate the transmitting and receiving protocols. The performance evaluation and a conclusion are given in Sections 4 and 5, respectively.

The Systems Model of ECP
In ECP, if a data bit is consistent with its corresponding polling data bit, the likelihood that the data bit is correct is much higher than the likelihood that the data bit is wrong. Therefore, the data section with fewer number of inconsistent pairs is deemed as the preferred section. To demonstrate the feasibility of implementation, we describe the systems models as follows.
1. We assume that a cell-free massive MIMO network architecture is composed of a large number of APs , and each user device is able to receive a varying number of replicas of a packet, separately, one replica from each AP. Similarly, for the uplink, more than one APs receive the replica of a user packet, where the replicas can be patched together to form a better shaped user packet at a pool of processors.
For the sake of clarity, we assume the scenario for the downlink throughout this paper.

The number of replicas
can be dynamically adjusted based on the result of patching. If the patched packet of a user device is of poor quality, more APs can be added to serve that user device. On the other hand, the number of serving APs can be reduced when the quality of received packets of a user device is very good.
In case that a replica from a specific AP does not contribute to the final state of the packet, it is switched to serve other user devices.
3. Each data packet of bits is divided into sections, each of which is of equal length bits. There are / polling bits for each data packet, where is the polling ratio, which equals the total number of polling bits divided by the total number of bits in a packet. 4. Each transmitter sends one polling data packet along with data packets. One the other hand, each receiver gets that amount of packets from each of the transmiters.
5. For the ease of manipulation, a packet is a logical array. The types of packets include data packets, one bit masking filter, one polling data packet, and a section masking filter, as described below. The former three are required for both transmitter and the receiver, and the last one is needed only for the receiver to do the error comparison on a section basis. All four types of packets are of the same length.
6. For the sake of efficiency, each polling data packet is the aggregation of polling bits of data packets in an interleaved fashion. The bit masking filter is for the extraction of polling bits from each of data packets, masking the bits of the data packet not to be polled. A bit masking filter has "1s" in elements corresponding to the polling data bits and "0s" for the remaining elements. There the bit error rate of a section ranges between 0 and 50 percent depending on the percentage of a section hit by an IBF. In the worst case, the entire section is hit, the bit error rate is 50 percent.

Foundation of the ECP
The term error comparison refers to the process that we compare the corresponding sections of the transmitted replicas in sequence such that the section not hit by fading is chosen. The process requires comparing the consistent bits among the corresponding sections, where a consistent bit requires a data bit be the same as its corresponding polling bit. Subsections 3.1 and 3.2 describe the packet structure and control procedure, respectively. Figure 1: The Packet structure of the ECP at a user device Figure 1 shows the relation between the data packets and the corresponding polling data packet at a user device. Each packet at a node is polled at an interval of 9 bits as indicated by the horizontal arrows. The polling data packet starts with the first bits of each of the data packets followed by the second bits of each of the data packets, third bits of each of the data packets, and so on.

3.1.The Packet Structure
The term of error comparison can be illustrated by the following example.
Assume that there are two packets, 1 , and 2 , each of which is logically divided into sections. Let 1 and 2 denote the polling bits corresponding to 1 , and 2 , respectively, we then take an XOR operation to find the inconsistence bits between the data packet and the polling bits. To make it easy to explain, we use the term "reference" to describe the relationship between data bit and polling bit. There are two types of references (self-reference and cross-reference) and two types of designated packets (pivotal packet and opponent packets) in ECP, as shown in Figure 2. replicas. Initially, the first data packet is designated as the pivotal data packet.
Definition 2: Pivotal polling data packet is the fixed interval of bits in the aggregated polling data packet for data packets, where is the polling ratio.
Normally, the pivotal polling data packet starts with the first bit of the packet.

Definition 3: Opponent data packet is the packet used in the error comparison with
the pivotal data packet. If a section of the opponent data packet is of lower degree of inconsistence, then the corresponding section of the pivotal data packet is updated through patching.
Definition 4: Opponent polling data packet shares aggregated polling data packet with pivotal polling data packet. Each of the − 1 opponent polling data packets is of a fixed interval of bits which starts with a different bit location other than the first bit.
Definition 5: Self-reference is the XOR operation between the data packet and its corresponding polling bits of the same packet.

Note:
We use the term self-reference distance to denote the number of inconsistency bits of self-reference.
Definition 6: Cross-reference is the XOR operation between the data packet and its opponent's polling bit.

The Control Procedure of ECP
In the down link scenario using ECP, we assume that a device is able to receive a data packet for different APs simultaneously, where each replica of a data packet may experience IBF independently and can change dynamically. Each user device performs ECP processing. In contrast, for the uplink scenario, a data packet transmitted from a user device is received by neighboring APs. A processor pool is responsible for processing the replicas of a packet. In Protocols I and II below, we describe how a transmitter prepares the packets for transmission and how a receiver processes the received packets.
In ECP, each of the transmitters at an AP extracts the polling bits from each of the logically partitioned sections and appends it to the packet for transmission, and the receiver at the device. The polling bit masking filter is used to filter out the polling bits of a packet. Since a polling data packet is of the same length as a data packet, it is shared by data packets. Each time a polling bits of a data packet is copied onto the polling packet, the polling bit masking filter is circularly shifted by one bit to get ready for the next data packet. After shifting the polling bit masking filter − 1 times, the polling packet is full. Within the polling data packet, the polling bits for The transmit protocol computes the polling data bits for a group of multimedia data packets in a sequential fashion. The results are data packets and one polling data packet. Assuming a downlink scenario, each of the data packet is transmitted times from different APs, one replica for each of the APs, but the polling data packet is transmitted once since it is the aggregation of the polling bits for the data packets. The input of the protocol includes data packets and bit masking filters. Since the operations between the uplink and downlink are similar, we will just describe the downlink one.

Protocol I: The Transmitter Protocol (Downlink Scenario)
In the downlink scenario, each of the APs performs the same operations below Input: data packets of an AP to be transmitted, 1 ≤ ≤ , and bit masking filter . The polling data packet is initialized to be all zeros.

Remark 1:
It is possible to have one polling data packet for each of the data packets. Then each polling data packet can be transmitted immediately without waiting for all the polling data bits of data packets be extracted. The packet encoding rate would be lower in order to gain a reduced processing delay.

Protocol II: The Receiver Protocol (Self-Reference Distance Based Selection)
When doing error comparison, the process begins with the initial pair of packets.
Without loss of generality, initially, replicas 1 and 2 of a data packet are designated as the pivotal data packet and the opponent data packet, respectively. After one round of error comparison, the pivotal data packet may or may not be updated. When all replicas are done through the error comparison, the bit masking filter is circularly shifted by one bit to get ready for the next data packet. Repeat the same process for the next − 1 data packets. Note that each user device has polling data packets for processing × data packets, and each data packet has replicas coming from different APs, one for each.
Recall that each user device receives the replicas for each of data packets and polling data packets, one from each of the APs, respectively. Therefore, the procedure starts with first of the data packets, and attempts to find the best sections of a data packet from the replicas, one section at a time. For each of the replicas, it designates replica one as the pivotal replica, and compares each section with the corresponding section of the remaining − 1 replicas. The comparison is based on the distance of self-reference. If the distance of self-reference of the pivotal 13 replica is smaller than that of the self-reference of the opponent replica, then copy the section of the opponent replica onto the corresponding section of the pivotal replica.
In practical implementation, the value of can vary dynamically. Each end user device accumulates as many replicas of a packet as possible and performs the following operations to get the patched data packet.
When doing error comparison between a pair of replicas, a selection algorithm is required, where the comparison of consistency is based on the distance of self-reference of a pair of packets. The result of self-reference distance of the pivotal packet is compared with that of its opponent's packet. The selection is to choose the section of the data packet that has a shorter self-reference distance.
Definition 7: Self-reference distance is defined as the XOR operation between the data section of a packet and the corresponding section of the pivotal data packet. It measures the number of inconsistent pairs of bits. A short distance indicates a high likelihood of a good data section.
For each of the sections of a data packet, find the section with the smallest self-reference distance among packets. Without loss of generality, let the packet one be the pivotal data packet, and compare the self-reference distance of the pivotal packet with the self-reference distance of each of remaining − 1 packets (opponent packets).
1. If the self-reference distance of the pivotal data packet is smaller than the opponent's self-reference distance, then do nothing and move on to the next opponent data packet.
2. If the self-reference distance of the pivotal data packet is greater than the opponent's self-reference distance, then copy the section of the opponent data packet along with the corresponding polling data packet to the pivotal data packet and pivotal polling data packet, respectively. Move on to the next opponent data packet.
In the protocol, there are three loops, where the outermost loop is for each packet, the middle loop is for each of a packet and the inner loop is for each of the replicas.
The core of processing is in the decision of whether to do patching based on self-reference distance between the pivotal section and the opponent section.
/* the current section of pivotal packet has fewer consistent bits */ ( Note that the inner product also produces the number of consistency bits between the data packet and the polling data packet. However, we note that the inner product of two null bits produces null. Therefore, we compute the number of consistency bits when both are ones, and both are zeros, separately, as indicated by the expressions The former computes the self-reference distance between the data packet and the polling data packet when both bits are ones, and the latter returns the self-reference distance when both bits are zeros.
There are two important parameters in ECP: the number of sections per packet and the polling ratio. For a fixed length of data packet, the greater the number of sections per packet, the more likely that we are able to get a cleaner section at the end of processing of a section. However, the tradeoff is more processing time required, which contributes to the delay. As for the polling ratio, there exists a tradeoff between the probability of faulty/missed patching and the redundancy. If the polling ratio is high, then the redundancy is high, which reduces the probability of faulty/missed patching.

Remark 3:
An end user device cannot decide the number of received replicas, . It is simply up to the environment at the receiver end. In general, the higher the number of replicas, the greater the improvement of the IBF with ECP.

Performance Evaluation
In THz band, the IBF causes many error bits in the packet. We use a simple modeling of the IBF, assuming that the duration of a section of a packet is longer than an IBF, where an IBF is most likely to be hit within the section. Let and denote the IBF in a section of a data packet and the IBF in a section of a polling data packet for the ℎ replica, where 1 ≤ ≤ . Both and follow uniform distribution. The notation ( ) represents the minimum of IBF of 1 , 2 ,…, . Let ( ( )) denote the expected value of minimum IBF for replicas of a data packet. We analyze ( ( )) as follows.

The Expected Value of IBF Using ECP
There are two models used in the analysis of the ECP. In Model 1, we assume that the polling data packets are protected perfectly such that there are very few error bits in transmission. Hence, if a data bit is inconsistent with the corresponding polling data bit, we may conclude that the data bit is most likely in error. In Model II, both the data packet and polling data packet are unprotected and have the same probability of getting hit by an IBF. If there is an inconsistency between the data bit and polling data bit, both the polling data bit and the data bit have an equal probability of being faulty.

Model I
We analyze the expected value of ( ) assuming that the polling data packet is with protection. Protecting the polling data packet with error control coding can lower the expected value of ( ), at the expense of increased redundancy.
Model I enhances the effectiveness of ECP since it eliminates the probability of both the missed patching and the faulty patching.
Since the ECP decides which replica of a section to choose and patch onto the pivotal packet based on the polling results, there is a risk of faulty patching and missed patching. The former refers to the decision to patch opponent data section with a larger IBF onto the corresponding pivotal data section with a smaller IBF. Whereas, the latter indicates the decision not to patch opponent data section onto the corresponding pivotal section despite the fact that the opponent data section has a smaller IBF.
In Model I, we attempt to find the expected value of the smallest IBF among the corresponding data sections of replicas of a data packet. Consequently, the problem can be reformulated as follows.
Given random numbers in the range [0,1], how to find the expected value of the smallest random number. Before we compute the expected value, we first define the notation: ( ) represents the smallest of the sequence of random numbers: 1 , … , , each of which falls in the range between 0 and 1. For clarity, we divide it into two cases.

Proposition 1:
where 1 ( ( )) is the expected value of ( ) for a single permutation.
By substitution of variable, we know that  Figure 3 shows the ( ( )) for Model I. We have also performed a simulation runs of 100000 runs to verify the results shown in Figure 3. As shown in Table 1, the simulation results and the curve for Proposition 1 in Figure 3 are almost identical.

Model II
We now consider the case that the polling data packet is not protected. Given a section of a data packet and its corresponding section of the polling data packet in a replica, the probability distribution of the combined IBF of a section in a replica is obtained by taking the larger value of the IBF of either the polling data section or the data section where " " denotes an arbitrary replica between 1 and .
The XOR operation between the data section and polling data section (self-reference distance) produces an combined IBF, , that is equal to the of the two.
Since the probability distribution of is the same as , we simply use to represent either of the two.

Proposition 3:
Let be the larger value of either the IBF at the data section, , or the IBF at the corresponding polling data section, , for the ℎ replica. We have <Proof> Assuming that > , the IBF of the polling data section must be between 0 and . Considering the fact that there are two permutations, the probability distribution of the combined IBF is as follows.
Without loss of generality, we assume that is the larger one. By Bayes' theorem, the probability that = is equal to the fraction, that meets the condition > . Due to reciprocity, we get the same fraction for the condition < . Since , and have the same distribution, we use to denote either of the two, where , and are between 0 and 1 with a uniform distribution. We hence obtain ( ) as follows.
The expected value of IBF for data section with replicas using Model II, ( ( )), is computed in Propositions 5 and 6 as follows.
where 2 ( ( )) denotes the expected value of minimum combined IBF for replicas using Model II. Note that the minimum can be either the data section or the polling data section.
<Proof> Since the probability distribution of IBF for Model II is ( ) = 2 , the expected value of IBF for either data section or polling data section with replicas for a single instance 1 < 2 … < can be expressed as follows.
Proposition 5: <Proof> Since the probability of minimum IBF is split equally between the data section and the polling data section, the expected value of IBF for data sections of Model II is as follows.
We also perform simulations runs for Model II as shown in Table 2. For each of the replicas, we generate a pair of random numbers, one for a data section, and one for the corresponding pivotal data section. The combined IBF of a replica is represented by the larger value. We then find the minimum of the larger values of the replicas, 2 ( ( )). However, ( ( )) is the expected value of the IBF of data section of the selected replicas. By (21), ( ( )) equals three quarters of 2 ( ( )), the simulation results, shown in Table 2, match (21) perfectly.

Faulty patching and Missed patching
The probability of faulty patching and missed patching can affect the performance of the proposed ECP. We formally define the terms: faulty patching and missed patching as follows.

Definition 8: Faulty
Patching describes the situation of making a bad decision when comparing the pair of pivotal data packet and pivotal polling data packet with the pair of opponent data packet and the opponent polling data packet. For instance, the IBF in the pivotal section is smaller than that of the opponent section but a decision is made to patch the opponent section to the pivotal section due to the polling results that the number of consistent bits of the opponent section is greater than that of the pivotal section.
Definition 9: Missed Patching describes the case that the replica of opponent data section is not patched onto the corresponding pivotal data packet despite the fact that the replica of opponent data section is of a smaller IBF.
To illustrate the phenomenon of missed patching and faulty patching when making comparison, let 1 , 1 , , and denote the IBF for the data section of the pivotal packet, the IBF for the polling data section of the pivotal data packet, the IBF for the data section of the opponent data packet, and the IBF for the polling data section of the opponent packet, respectively.
As shown in Table 3, the event of missed patching states that the opponent data section has a smaller IBF but is not selected for patching because the pivotal packet has a larger IBF.
( 1 , 1 ) < ( , ) and 1 > Similarly, the event of faulty patching states that the opponent data section is patched onto the pivotal packet even though the IBF of the data section of the opponent packet is greater than that of the pivotal data section.
( 1 , 1 ) > ( , ) and 1 < Faulty patching Patching No patching Missed patching Table 4 below shows all the possible states of the IBFs between two data packets and their corresponding pivotal data packets. Depending on their ranking of IBF, missed patching and faulty patching can occur. Both of which contribute to the gap between the curves of Model I and Model II. In Table 4, the ranking of 1 to 4 corresponds to the IBF from high to low. For Model I in Table 4  Note that symbol "A" stands for anomaly patching, which can be either missed patching or faulty patching. Since there are 6 out of 24 permutations which result in anomalies and all permutations have the same probability of occurring, the probability of anomaly patching is 0.25.

The Expected Value of IBF for the Beta Distribution
For the Beta distribution, we adopt three different sets of shaping parameters of and : ( = 0.55, =0.55), ( = 1, = 1), and ( = 1, = 3), corresponding to the urn shaped distribution, the uniform distribution, and the declining distribution, respectively, as shown in Figure 5 below.  The probability of faulty patching depends on the polling ratio, the number of bits per section, and the bit error rate in a section is affected greatly by the percentage of the section hit by IBF. Once a section is hit, the BER in a section increases significantly. Therefore, we prefer to have at least a clean section with high probability. A faulty patching may or may not affect the final result in a section. It depends on which section it occurs. If faulty patching occurs in the early stage in a sequence of selection for patching from 2 to , it is likely that it will be corrected in the later stage.

The Impact of Clean Sections
We first define the term of clean section and then show how it can affect the performance.
Definition 10: Clean section is a term used to describe the fact that both a data section and its corresponding polling data section are not hit by an IBF. If either data section or a polling data section is hit by an IBF, the self-reference distance is rather high. If a clean section exists in one of the replicas of a packet, a clean data section can be When the number of sections increases for a fixed length of a packet, the probability of at least a clean section increases. A clean section is very important in the sense that the result of patching for that section is guaranteed to be free of IBF at the end of patching. Therefore, the greater the probability of at least a clean section, the better the result. Let's and denote the probability that a section hit by an IBF and the probability that at least a clean section exists for replicas of a packet, respectively. We compute as follows.
(26) Figure 7 shows the relationship among , , and . As the number of replicas increases, the probability of at least a clean section increases significantly at low value of .

Remark 7:
The combined IBF of a replica equals larger value of either the IBF at the data section, , or the IBF at the corresponding polling data section, , for the ℎ replica. Practically, due to the misalignment of the pair of IBFs, the combined IBF can be slightly larger. However, the impact is limited to a slight increase of the missed patching and faulty patching in Model II.

Resource Allocation of APs
In the ECP, the number of assigned APs, , varies among user devices. There are two approaches for the allocation of resources: (1) Pre-allocated scheme (2) Adaptively allocated. Normally, the allocation of APs is in combination with sub-channels and time slots. Therefore, the resources are treated as a three dimensional cube with three axes assigned for # of sub-channels, # of APs, and # of time slots, respectively. For the pre-allocated scheme, a three dimensional cube is divided into mini-blocks of varying dimensions. For example, a cube of dimensions 3 × 3 × 3, can be divided into blocks of dimensions (2,2,2), (3,1,3), (2,2,1), and (1,2,3). In the pre-allocated scheme, each block is fixed ahead of time. Each device is assigned a block based on data rate requirements and the number of APs required to meet the QoS requirements. For example, if a user device requires a higher data rate may selects (3,1,3). If a user device requires more of APs, it may select (2,2,2). In the adaptive allocation, a user device determines its requirements in terms of data rate and QoS, which can be translated into a type of block. The problem is now how to house all the blocks into cubes such that a minimum number of cubes are needed. The problem is related to the bin-packing problem, where heuristic solutions exist [23].

Conclusion
In THz band, signal misalignment and blockage are more severe due to severe signal reflection, diffraction, and scattering loss. Removing bit errors induced by IBF in super real-time is a must for satisfactory user experience. In this paper, the core of the ECP is to compare each of the − 1 pairs of sections between the pivotal packet (the first replica of a packet) and each of the remaining − 1 replicas of a packet. If the difference of section and its corresponding polling bits of the pivotal packet is greater than that of the opponent section and its corresponding polling bits, patch the opponent section onto the pivotal packet. The process goes through each of the packets in the group. For each pair of replicas, the comparison is performed on a section by section basis.
Patching removes the possible impact of IBF. By patching together the selected sections, the impact of an IBF on the QoS is significantly reduced. The determination of which section to patch is based on the selection algorithm to choose from the buddy sections (data section and the corresponding data section in a replica). We have presented a selection algorithm based on self-referencing. In the performance evaluation, we provide two models of the probability of distribution of the IBF. In both models, we assume that the probability distribution of IBF is always uniform.
In both Models, the comparison of ECP is based on self-distance. Model I assumes that the polling data section is well protected such that the IBF of the polling data section is always smaller than that of the corresponding data section. There is no possibility of patching anomaly. In Model II, the IBF of a section is a composite value of both the data section and the corresponding polling data section, there is a 1/4 probability of anomaly patching. The discrepancy between Model I and Model II is mainly due to the missed patching and faulty patching. As the number of replicas increases, the discrepancy increases. In the performance evaluation of the ECP, we have demonstrated that the ECP approach can significantly reduce the impact of IBF on the transmission quality. Lastly, we show how to allocate APs dynamically to meet the QoS requirements of users' devices.