Initial Access & Beam Alignment for mmWave and Terahertz Communications

The initial access in Millimeter wave (mmWave) 5G communications is very challenging and time consuming. In general, mmWave and terahertz communications require the use of directional antennas to seek narrow beams. However, due to this directionality, many issues can impact the beam alignment between transmitter and receiver. In this paper, we present a comprehensive survey of beam alignment and initial access in mmWave and terahertz 5G/6G systems. First, we present a detailed overview of initial access methods, techniques, and beam management procedures. Then, we classify recent works related to beam alignment based on their objective functions (i.e., latency, power allocation, QoS, energy consumption, cost). We also highlight the beam alignment in terahertz 6G, where we find that deep learning and reconfigurable intelligent surface are the two protagonists that help to achieve fast beam alignment.


I. INTRODUCTION A. MOTIVATION AND NEW TRENDS
With the exponential growth of data traffic and the high number of connected devices predicted to reach 29 billion in 2022 [1], future mobile networks are expected to improve spectral efficiency, reduce latency, and provide a better throughput experience across the radio cell. The 5G is designed to achieve low latency, high data rate, and high reliability. It can serve a large number of connected devices with low deployment cost [2]. 5G is being planned not only to support the various existing usage scenarios that will continue beyond today's networks but also to support a wide variety of new scenarios classified into three types of services (i.e., Enhanced Mobile BroadBand (eMBB), massive Machine-Type Communications (mMTC), Ultra-Reliable Low Latency Communication (URLLC)).
To meet these different requirements, many new 5G enabling technologies have been driven: • Peer-to-Peer (P2P) communications; • Millimeter Wave (mmWave); • Massive Multiple-Input Multiple-Output (MIMO); The associate editor coordinating the review of this manuscript and approving it for publication was Derek Abbott .
• Beamforming; • Full Duplex and green communications; • Non-Orthogonal Multiple Access (NOMA); • Virtualization: Network Function Virtualization (NFV) and Software-Defined Networking (SDN); • Network Slicing; • Cloud Native. 5G networks will be composed of nodes with various functionalities such as small cells and P2P user equipment, leading to a multi-tiered architecture. Given the complexity of network management and the hard coordination between multiple network levels, the network nodes will benefit from the feature of self-organization in resource allocation, load balancing, network orchestration, etc. Besides, The cloud-native is a new approach to develop architectures and provide 5G slicing services on a global scale [4].
Millimeter-Wave (MmWave) communication is considered as the key element in the 5G mobile network to meet the high data rate and scale up the system capacity due to its abundant spectrum (30 GHz-300 GHz). However, mmWave communications are susceptible to blockage (e.g., solid building, rain, plants, etc.), resulting in high signal attenuation and severe path loss. Therefore, directional beamforming and beam tracking technologies should be exploited to overcome the severe propagation loss, achieve array gains and expand the coverage area [5].
Initial Access (IA) is the key physical layer procedure that allows the UE to detect the close BS and make synchronization before continuing communication. In microwave systems, IA is performed by omnidirectional antennas that may prevent UEs from reaching far BS [6]. In contrast, mmWave 5G communications require beamforming strategies to avoid high signal attenuation and to target a narrow beam signal between UE and BS.
In mmWave networks with narrow beams, successful communication is established only when the transmitter and receiver beams are well aligned. In this context, selecting the best beam alignment is similar to finding the correct phase setting for all phase shifters on both transmitter and receiver. Beam alignment remains a crucial challenge impacting mobile communications in 5G and even in 6G wireless systems. Although the carrier frequency trend is evident, mmWave systems are still unable to support TeraBytes Per Second (Tbps) data rates, restricted by the total available consecutive bandwidth (i.e., less than 10 GHz in mmWave systems). Therefore, the terahertz band is emerging as a key wireless technology to meet future demands for 6G systems. However, the beam misalignment and outage are still challenging in 6G terahertz communications.

B. OUR CONTRIBUTION
The scope of this survey includes all research results on the efficient initial access and beam alignment in mmWave and terahertz 5G/6G systems to provide successful communication with high QoS. The performance can be affected by many properties, including search method, antenna type, beamforming, and access methods. Therefore, we present a detailed overview of initial access strategies, beam search techniques, and beam management procedures. This article examines the related literature over the period 2016-2021. The contributions of this survey are summarized as follows: • We present the beamforming basics in mmWave 5G communications; • We classify the papers providing beam alignment solutions based on their targeted objective functions (e.g., power allocation, latency, QoS, etc.). We also categorize the beam alignment methods in mmWave 5G either with or without channel estimation; • We provide an overview of the terahertz enabling technologies required to achieve key performance indicators; • We provide the solutions proposed to solve the beam alignment in terahertz communications.

C. RELATED SURVEYS
As summarized in Table 1, some previous surveys have already explored the field of initial access, beamforming, and beam alignment in mmWave and terahertz communications. These survey papers cover different features of mmWave and terahertz wireless channels, including devices, antennas, physical layer aspects, etc. Ghafoor et al. [7] present a comprehensive survey of medium access control (MAC) protocols for terahertz communications by providing the initial access mechanisms, requirements, and design challenges for different application areas. This survey highlights the deafness problem but not in a detailed way, and it does not present and classify the proposed solutions for beam alignment.
In [8], authors present an overview of emerging technologies for 5G systems. They present various hybrid beamforming architectures and approaches, multi-access technologies, channel estimation methods, beam alignment, and selection algorithms for mmWave 5G systems. This survey does not tackle the terahertz band. Similarly, papers [9], [10] and [11] provide a comprehensive survey of emerging technologies, recent advances, and beam management in mmWave 5G. Tekbiyik et al. [12] present a literature review of Reconfigurable Intelligent Surface (RIS) and terahertz communication. They also investigate the emerging challenges of RIS empowered terahertz systems. In [13], authors provide a survey on MAC schemes for wireless networks in mmWave and terahertz bands. They focus on critical challenges such as deafness, blockage, control channel selection, and mobility management. They also present a taxonomy of MAC protocols based on channel access mechanisms and network topologies. Although this study is very similar to ours in terms of initial access basics, techniques, features, and challenges, the beam alignment problem in mmWave and terahertz is not detailed, and the new approaches proposed to solve it have not been cited. To the best of our knowledge, this paper is the first one handling the initial access and beam alignment in mmWave and terahertz communications in a detailed manner and highlighting the new trends towards deploying reconfigurable intelligent surfaces and deep learning approaches.

D. ARTICLE STRUCTURE
This paper is organized as follows. Section II provides an overview of the initial access procedure and beamforming basics. Section III introduces a classification of beam alignment strategies based on their combination with important features as latency, power allocation, performance, and QoS. Section IV presents an overview of beamforming and beam alignment in 6G terahertz communications, including terahertz basics, applications, and key challenges. Moreover, we introduce the new viewpoint of using deep learning to establish fast beam alignment and to provide intelligent ubiquitous communications with a high data rate in the 6G wireless network. Also, we highlight the advantage of deploying  a reconfigurable intelligent surface to ensure beam alignment in 5G NR/6G communications. Section V provides hot topics and open challenges that need more investigations in future 6G terahertz communications, and section VI presents a summary and insights. Finally, we conclude the paper in section VII. The organization of the paper is illustrated in Figure 1.

II. INITIAL ACCESS & BEAMFORMING BASICS IN mmWave 5G SYSTEMS
The 5G new radio standards include new Physical (PHY) and Medium Access Control (MAC) layer functions to control directional communications and avoid mmWave interference issues. In the following, we describe these procedures and present the beamforming basics in mmWave 5G communications.

A. INITIAL ACCESS BEAM MANAGEMENT PROCEDURES
Directional links between the BS and UE require beam management procedures to achieve the initial access. These procedures are divided into four stages described as follows (See Figure 2):

1) BEAM SWEEPING
Beam sweeping is a technique to transmit and sweep beams in multiple directions at predefined intervals to cover a spatial area that holds the transmitter and receiver. The 5G NodeB (gNB) and UE carry out beam sweeping by transferring information to establish a successful communication based on the strongest detected beam [17]. As depicted in Figure 3, a Synchronization Signal (SS) burst set, that contains numerous Synchronization Signal Blocks (SSBs), is potentially used for gNB beam-sweeping transmission. The gNB transmits a sequence of SSB beams with various directions, and the UE detects the best beam among them. The SS burst set is limited to a 5 ms interval, and it is forwarded regularly. The UE assumes a default SS burst set periodicity of 20 ms for initial cell selection [18].   gNB resources and directions which help to detect the best uplink beam.

3) BEAM DETERMINATION
Beam determination is the selection of the convenient beam at the UE and/or the gNB.

4) BEAM REPORTING
The UE reports the beam quality and decision parameters to the Radio Access Network (RAN). There are two methods for beam reporting procedure: • Non-StandAlone mode (NSA): the 5G New Radio (NR) is interfaced with the Long Term Evolution (LTE) Evolved Packet Core (EPC) network, and the UE reports the optimal beam directions to the gNBs. Then, the gNB schedules an immediate random access opportunity to determine the direction with full beamforming gain [20].
• StandAlone mode (SA): the 5G NR is interfaced to the new 5G Core Network (5GC) (without LTE connection). Here, the UE waits for gNB to program a Random Access Channel (RACH). Each SS block designates one or more RACH with a specific direction and time/frequency offset.

B. INITIAL ACCESS SEARCH METHODS
Initial access enables a UE to establish a connection with a BS. The IA procedure, in mmWave frequencies, should be performed directionally, allowing the UE to determine the appropriate initial directions required for successful transmission.
In general, the IA enables the UE to: -Determine (discovery) the carrier frequency; -Synchronize the timing and the frequency; -Compute the signal quality to ensure that the BS with the best quality is selected throughout IA; -Determine the BS's preliminary operational information, such as bandwidth. According to [21], the IA procedure can be significantly delayed due to the need to find suitable alignment and highly directional transmissions between BS and UE. The choice of an efficient search method is crucial to obtain the highest possible beamforming gains. Hence, several known approaches are presented in the literature:

1) EXHAUSTIVE SEARCH
Exhaustive search is a brute force sequential search that conducts a random beam direction search at both the UE and BS nodes simultaneously [22]. The performed scans cover the entire angular space by employing narrow beams generated by a large number of antennas [23]. Once a UE starts random network access, it basically analyzes the BS beamforming vectors for synchronization signals. In addition, the received signal levels at each narrow beam on the UE side must be scanned for all beams on the BS side and inversely. The data-plane transmission is then selected from the beam vectors returning the highest signal levels. However, this approach has a high computational complexity since it costs extra cell discovery delays because of the random nature of UE locations and the shortage of relevant information.

2) ITERATIVE SEARCH
Iterative search operates a two-phase scanning of the angular space [24]. The scanning direction is established using a predetermined codebook [25]. In the first phase, the BS conducts an exhaustive search through different sectors in a sequential manner. After scanning the whole angular area, the BS decides the best sector based on the highest received SNR. The UE also determines the best direction to attain the BS. In the second phase, the BS sweeps the best-opted sector by using more antennas and narrow beams. The total number of search sectors in both phases remains the same. Referring to [26], the iterative search can decrease the delay of discovery at the cost of increasing the misdetection probability.

3) HIERARCHICAL SEARCH
The hierarchical search offers a trade-off between omnidirectional and exhaustive search approaches. This method is resumed in three phases. The first one is when the BS and UE nodes start with a single wide beam and then use the same array size to perform a sequential search in other spatial directions [27]. Following the completion of the scanning cycle, a single wide beam is chosen at the UE and BS in the initial stage. In the second phase, a group of restricted beams is determined within an angular range of the best-detected beam, and a further search is performed employing a single narrow beam over specific directions opted from all beams (e.g., four directions from 16 beams [28]). In the third phase, the searching procedure is repeated in the codebook until the highest signal is discovered using a pencil beam. The hierarchical search scheme can offer fast discovery [29], where refinements (e.g., selecting a correct combiner in the initial scanning) are required to enhance its performance [30]. However, the hierarchical codebook search necessitates immense computational complexity and extensive access time [28].

4) BISECTION SEARCH
A bisection search aims to identify the section with the highest received power for further refinement. The Angle of Arrival (AoA) or Angle of Departure (AoD) is split into two equal-sized sectors; which are sequentially scanned and progressively narrowing the beams in the succeeding stages based on the estimation outputs [31]. However, when the obtained result is affected by the noise, the deterministic bisection algorithm will mostly fail, because a single incorrect answer will redirect the search away from the correct path [32]. According to [33], in terms of enhancing throughput during the communication phase, the bisection scheme surpasses both iterative and exhaustive methods.

C. ANTENNA TYPE & RADIATION PATTERN
The beam detection process is classified into three steps, namely, link-level device discovery, sector-level alignment, and beam-level refinement. The omnidirectional or quasi-omnidirectional radiation pattern, wide or narrow beam are invented to meet the demands of these three stages [34].
The beam direction is determined by the type of transmitting and receiving antennas (i.e., omnidirectional or directional). The signal in omnidirectional antennas can radiate in all directions with similar energy. However, in directional antennas, the signal radiates in only one specific direction forming narrow beams and helps to cover a long distance as seen in Figure 4. As the gain of a directional antenna increases, the coverage distance increases, but the effective beamwidth decreases. Directional antennas are always used for long-range point-to-point and point-to-multi-point links rather than omnidirectional antennas. The omnidirectional antennas are recommended for sub-6 GHz networks, while directional antennas are advised for mmWave communications.
Realistic directional antennas consist of one or two main lobes and side/back lobes. For mathematical tractability, three simplified analytical directional antenna models are proposed in the literature, the sector model [35], the keyhole model [36], and the lemniscate model [37]. The sector model neglects the side lobes while the keyhole model is unable to picture the nulling capability 1 of realistic antennas (see Table 2 and Figure 5).

D. ANALOG, DIGITAL & HYBRID BEAMFORMING
Beamforming is a spatial filtering scheme for transmitting/receiving data signals from all antennas by manipulating phase and amplitude techniques at the BS to redirect beams of several antennas to the intended UE, enabling the implementation of Massive Multiple Input Multiple Output (M-MIMO) systems. MmWave communication is challenged by the issue of immense energy consumption due to the considerable number of RF chains; thus, combining analog and digital beamforming helps to reduce the number of RF chains [38], [39].
Beamforming architectures are grouped into three categories: analog, digital, and hybrid beamforming (See Figure 6).

1) ANALOG BEAMFORMING
The analog beamforming is constructed by employing a small number of quantized phase shifts to connect antennas over a network of digitally managed phase shifters to a single RF chain [40]. It should be taken into consideration that the Analog-to-Digital (AD) converter and RF frontend can get overloaded; thus, the self-interference has to be adequately reduced in the analog domain. The analog beamforming is less expensive and simpler than digital, although it reduces the degrees of freedom due to a single beamformer [41], [42].

2) DIGITAL BEAMFORMING
In digital beamforming, each antenna is equipped with its own RF chain. This offers a significant amount of freedom since it allows to manipulate the amplitude and the phase of the signal on each antenna. However, having a dedicated RF chain for each antenna is a hardware limitation, particularly in mmWave communication. As a result, fully digital beamforming in mmWave is costly and difficult to implement [40].

3) HYBRID BEAMFORMING
Hybrid beamforming is a combination of digital and analog beamforming, suggested for the mmWave M-MIMO system because of its ability to reduce hardware complexity and track the performance of fully digital beamforming.
Hybrid beamforming is cost-effective as it requires only a few RF chains using a network of digitally controlled phase shifters. Therefore, this can drastically decrease the hardware cost, and power consumption [43]. Instead of using phase shifters, the switching networks can be adopted [44].

E. ACCESS METHODS: OMA VS NOMA
During the initial detection phase, the BS may choose the same beam pair to cover multiple users having the same direction [45]. Nevertheless, the narrow beam may not be the most appropriate solution because it serves only one user [46]. Orthogonal Multiple Access (OMA) methods such as Division Multiple Access (SDMA) or Time Division Multiple Access (TDMA) cannot be thoroughly used when multiple users select the same beam. Therefore, NOMA methods are proposed to meet simultaneously multiple users at the same frequency and time [47]. As a result, using NOMA can increase the spectral performance, and bandwidth efficiency of mmWave mobile communications [48]- [50]. There are two main methods of NOMA: power domain and code domain [49]. The power domain NOMA is designed to cover multiple users with different transmission powers at the same time-frequency resource, while the code domain NOMA builds a sparse codebook for each user and then maps its data accordingly to the codebook [51]. NOMA uses superposition coding at the transmitter and successive interference cancellation (SIC) at the receiver.
Moreover, the high directionality of mmWave radiations provides highly correlated user's channels that make easy integration of NOMA in mmWave 5G communications. NOMA is considered as an effective multiple access method in mmWave communications for several reasons: • Strongly directional beams applied in millimeter-wave communications lead to correlated channels, which can degrade the performance of OMA schemes, thereby the need of NOMA [52].
• NOMA can improve bandwidth performance and support massive connectivity [53].
• It can provide high cell-edge throughput and small latency [54].

III. MmWave CHALLENGE: BEAM ALIGNMENT
This section introduces an overall categorization of the different beam alignment strategies presented in the literature. The majority of related works handled the problem as a multi-objective optimization approach between different features, but the important objective is to achieve convenient beam alignment in a small duration. In general, the beam alignment is ensured if the transmitter and the receiver are well aligned, as depicted in Figure 7. In the following, we present a global overview of the tradeoff between beam  alignment and other properties such as latency, power allocation, quality of service, and energy consumption.

A. BEAM ALIGNMENT TRADE-OFFS 1) BEAM ALIGNMENT & LATENCY
The current works highlight the interesting trade-off between latency and beamforming efficiency in beam alignment [55]- [57]. The narrow beamwidths provide high directive gain and high sum-rate but require increased delay for beam alignment. However, the wide beamwidths may accelerate the alignment process but provide small gains, limited coverage, and small throughput.
In [55], authors provide a comprehensive survey of initial access techniques in mmWave 5G communications. The crucial idea to avoid the poor propagation channel conditions in the mmWave network is to include directionality also in the initial synchronization phase. Their analyses prove the existence of a strong compromise between initial access delay and misdetection (or misalignment) probability. The exhaustive search provides good coverage with a small delay. On the other hand, the iterative techniques require a short time slot for angular search but provide bad coverage, and they are not suitable for edge users [58]. For specific scenarios such as urban and multi-path mmWave channels, exhaustive techniques are suitable, as they provide smaller total delay with respect to other initial access techniques. These techniques search the entire beam space to find the optimal beam pair, which involves significant latency. Therefore, in [56], a learning algorithm called Hierarchical Beam Alignment (HBA) is proposed to reduce the beam alignment latency. The proposed algorithm is an extension of the Hierarchical Optimistic Optimization (HOO) algorithm [59], that helps to select the best beam without having VOLUME 10, 2022 any prior knowledge on the channel, where instead of searching the entire beam space, the information is extracted from neighboring beams to identify the best one. Authors consider a P2P mmWave system in a static environment, equipped with N antennas on the transmitter side as seen in Figure 8. The system uses Uniform Linear Arrays (ULA) in both the transmitter and receiver, and each antenna is linked with a phase shifter to build narrow directional beams. The channel contains L paths (i.e., one LoS and L − 1 NLoS) and it can be expressed as follows: where 0 ≤ n ≤ N − 1.
• d: is the array element spacing; • λ: is the carrier wavelength; • g 0 and g l : are respectively the channel gains of the LoS path and the l-th NLoS path; • v 0 and v l : are the corresponding spatial angles of the channel for the LoS path and the l-th NLoS path. The problem is formulated as a stochastic Multi-Armed Bandit (MAB) aiming to select the beams sequentially through maximizing the Received Signal Strength (RSS). The system consists of T time slots with equal duration t ∈ {1, 2, . . . , T }. The set of candidate beams is denoted by B = {b 1 , b 2 , . . . , b N } and are considered as arms in the bandit theory. At the initial time slot t, the transmitter selects a beam denoted b t ∈ B. At the end of time slot t, the transmitter looks at the receiver's noisy RSS (i.e., r(b t )), which is treated as a reward. The main objective is to find the optimal beam selection policy {π ∈ } with is the set of all possible sequential beam selection policies, that maximizes the expected cumulative reward RSS in a given time of T slots. The expected cumulative regret is the difference between the selected beam reward and the maximum reward obtained by the optimal beam b * given by: The expected cumulative regret is defined as: where N π b i (T ) is the number of times where b i has been selected up to time slot T. Then the optimization problem of minimizing the expected cumulative regret (maximizing the cumulative reward) is expressed as: The experiment simulations prove the effectiveness of the proposed bandit learning algorithm that helps to recognize the optimal beam in low latency compared to traditional techniques.
In the same way, Haithem et al. [60] propose an Agile Link algorithm to find the best beam pair in a logarithmic number of measurements without scanning the entire beam space. Instead of forming a narrow beam and scanning the power along a single spatial direction each time, the Agile-Link employs a combination of phase shifters generating random multi-armed beams that scan multiple directions simultaneously and provide enough information to determine the RSS in all spatial directions.
MmWave MIMO 5G communications often use a large number of array elements to increase network gain and spatial selectivity. However, the narrow beams can cause a misalignment between the transmitter and receiver. The communication link between transmitter and receiver is established only if the beams are well aligned. For future low latency applications (e.g., Augmented Reality, Virtual Reality, drone, vehicle communications V2X), specific beamforming and beam tracking techniques are required to satisfy beam alignment with high reliability and low latency. For example, in V2X communications, the beam sweeping latency remains a dominating challenge to ensure beam alignment in mmWave 5G. In this context, authors in [61] provide latency-based beam sweeping sequences and geographic location for transmitter and receiver. They present four scenarios as follows: 1) Scenario 1 (S1): A common geographic reference is available; 2) Scenario 2 (S2): The beam sweeping sequence at the transmitter is available; 3) Scenario 3 (S3): S1 and S2 are not available; 4) Scenario 4 (S4): S1 and S2 are both available. For S2 and S3, where the geographic location is not available (i.e., a receiver may not know which beam direction can achieve beam alignment even if a receiver has prior knowledge about the beam sweeping sequence of a transmitter), two algorithms are proposed to provide the optimal latency of beam sweeping for both the transmitter and receiver.
In [62], authors handle the tradeoff between beam alignment and latency in mmWave V2V communications for a dynamic topology related to the movement of vehicles. The alignment time is given by: where: • ψ t x i and ψ r x j denote the sector-level beamwidths of transmitter vehicle (vTx) i and receiver vehicle (vRx) j respectively; • T p is the pilot transmission duration; • ϕ t x i,j and ϕ r x i,j denote the beamwidth of vTx and vRx. The achievable data rate for a time slot t of duration T t is given by: where W is the bandwidth of mmWave band.
They propose a new framework based on matching theory and swarm intelligence to optimize the beamwidth of transmitter and receiver. The beam measurement is based on CSI and Queue State Information (QSI), where CSI reflects the transmission timeliness, and QSI indicates the traffic property. The proposed Radio Resource Management (RRM) framework considers the impact of the targeted beamwidths on the interference at the vehicle receivers, the tradeoff between throughput and beam alignment latency, the intervehicle blocking, and the impact of the speed offset between vehicles on the beam alignment delay. Simulation results prove the high performance of the proposed scheme over multiple scenarios with different configurations.
The beam discovery phase may take a long time when the BS and the UE are using multiple directional antenna elements and those forming narrow beams. In this regard, authors in [57] address the tradeoff between beam alignment, latency, and energy consumption during initial access. They prove that using digital beamforming can reduce latency and energy consumption compared to analog beamforming. Also, they propose an RF architecture based on lowresolution Analog-to-Digital Converters (ADCs) in fully digital front-ends, that ensures minimum energy consumption and low latency for beam discovery, beam alignment, and data transmission.
To overcome the disadvantage of overhead, in the case of a large number of Mobile Stations (MS) or frequent handovers between cells, the authors in [63] suggest Compressed Sensing (CS)-based channel estimation method to retrieve the signal direction with a non-negative least square. The measurements are collected at the UEs from downlink beacon slots broadcasted by the BS in the initial acquisition phase. Each UE selects its strongest AoA as the beamforming VOLUME 10, 2022 direction for potential data transmission. The proposed method is especially appropriate for single-carrier multi-user mmWave communication; however, under low SNR conditions, the channels obtained by CS approaches tend to be overwhelmed by noise, which deteriorates the performance. Also, the complexity and accuracy are significant due to the size of the used dictionaries.
The training overhead of adaptive search-based algorithms remains high for large-scale antenna array systems. More significantly, in dynamic environments, mmWave channels vanish quickly, and the time duration of each coherence block is too small to allow sufficient time for exact and frequent beam alignment. A new integrated machine learning approach is proposed to address this challenge based on coordinated beamforming [64]. The main idea of the proposed solution is to exploit the signals obtained at coordinating BSs with merely omni or quasi-omni patterns, having negligible training load, to predict their RF beamforming vectors. Moreover, the proposed solution allows harvesting the gains of wide coverage and low latency coordinated beamforming with small coordination overhead, making it a promising solution for highly mobile mmWave applications.
In the same context, a predictive transmit-receive beam alignment solution is proposed to achieve good performance and low latency for small sample sets [65]. This algorithm is based on Gaussian Process (GP) to build a predictive mapping between transmitter and receiver beams. An advanced learning Bayesian algorithm is developed to handle the correlation between transmitter and receiver and the cumulative experience. Additionally, a novel mapping beam alignment algorithm is proposed considering both the beam prediction and the coordinate prediction to minimize the training time.

2) BEAM ALIGNMENT & POWER ALLOCATION
In beam alignment, the power allocation should be considered to reduce the beam training overhead emerging from the global channel state information with massive antennas. Several papers study the tradeoff between beam alignment and power allocation for uplink and downlink mmWave NOMA/OMA 5G communications. The problem has been addressed using different methods and algorithms (e.g., game theory, machine learning, optimization algorithms, etc). For example, in [66], authors propose a quantum game theory to achieve the beam alignment by maximizing the data rate for D2D communications where each device can adjust the antenna gain by scanning different beam directions. Having the same purpose, authors in [67] propose a non-cooperative game theory to get the best beam pair where each player aligns his beam until achieving maximum throughput. The utility function U of this game is defined as the capacity of the communication link from transmitter k to its receiver j multiplied by the probability of alignment. The utility function is given by: where: • ω k and ω j are respectively the beamwidths of transmitter and receiver; • P a is the alignment probability (see Appendix in paper [67]); • G T and G R are the transmission and reception gains; • P T is the transmit power; • P L is the path loss; • σ 2 is the constant thermal noise power. They provide a gradient descent learning algorithm to obtain the optimal beamwidths while making beam alignment decisions.
In [68] and [52], authors use exhaustive search to solve the joint beam alignment and power allocation for 2 users in downlink mmWave NOMA 5G. The issue is formulated as an optimization approach aiming to maximize the sum rate subject to power allocation constraint.
R i is the achievable sum rate of each user i ∈ {1, 2}, expressed by: where: • γ i is SINR of user i; • is the alignment probability; • T is the total duration of beam searching; • T t is the time duration of the two phases (beam alignment and data transmission); • ω t and ω r are respectively the beamwidth of transmitter and receiver; • P 1 and P 2 are the transmit power of users 1 and 2 respectively. The optimization problem in (8) was converted to a convex one depending only on R 1 and R 2 , and it is solved through an exact mathematical calculation using Lagrange Multiplier.
Similarly, authors in [69] address the impact of beam misalignment on downlink Hybrid Beamforming in mmWave NOMA systems (HB-NOMA) for multiple users. They propose an algorithm to maximize the sum rate with a design of digital and analog precoders. A lower bound for achievable sum-rate is derived for each user analyzing the perfect/imperfect beam alignment for LoS and NLoS channel in each group. Simulation results prove that HB-NOMA outperforms OMA, and the achievable sum rate can be impacted by both the alignment factor and the effective channel gain.
In [70], a joint initial access and power allocation problem is handled for a 2-user uplink mmWave NOMA network to achieve a high sum rate with minimum rate constraint for each user. Similarly, in [71], authors focus on the joint power allocation and beamforming design to achieve high energy efficiency for 2-users uplink mmWave NOMA system. The problem is decomposed into two sub-problems. As a result, two sub-optimal schemes have been derived, providing high energy efficiency compared to existing schemes and conventional mmWave OMA.
Hashemi et al. [72], proposed a MAB learning algorithm to increase the directivity gain through efficient beam alignment between the mmWave receiver and transmitter, considering that the probability of success is a unimodal function of the pointing direction. However, in general, the unimodal property is specific to mmWave and does not extend to multipath channel models.
In [73], a joint Tx-Rx beam alignment and power allocation approach is proposed to maximize the achievable sum-rate for multiple users. Authors consider analog beamforming for downlink mmWave NOMA communication. The problem is formulated as follows: where: • N bs is the number of antennas in BS side, and N k is the number of antennas in user side; • Constraint (10b): describes the minimum rate to be achieved for each user; • Constraint (10c): is the total transmission power that should not exceed the total power P max and the power of each user k should be positive; • Constraints (10d) and (10e): are the constant modulus constraints for transmitted and received beamforming vectors (i.e., [w] The problem is split into three sub-problems: 1) Finding the optimal power allocation for a fixed Tx-Rx beamforming vectors; 2) Finding the optimal receiver beamforming vector for a fixed transmitter beamforming vector; 3) Proposing a Boundary-Compressed Particle Swarm Optimization (BC-PSO) algorithm to get a sub-optimal solution.
Simulation results prove the efficiency of the sub-optimal solution in terms of achievable sum rate compared to conventional OMA mmWave. Similarly, authors in [70] propose a Particle Swarm Optimization (PSO) algorithm to solve the joint initial access and power allocation problem for 2-users uplink NOMA mmWave 5G communication. They also consider analog beamforming with a single RF chain without knowledge of CSI at both BS and UE. The problem is formulated as an optimization approach to maximize the sum rate subject to the minimum rate constraint for each user. This non-convex problem is solved separately in two stages: PSO-based IA problem to find the sub-optimal beamforming and PSO-based power allocation problem to find the sub-optimal power allocation for a NOMA system of 2 users. In [74], the mmWave NOMA downlink performance was analyzed by assuming random beamforming with a fixed power allocation for a higher number of users and perfect CSI.
In [75], to reduce the beam training delay caused by outage and beam misalignment, authors propose an optimization approach to minimize the beam training delay by jointly addressing power allocation and beamwidth subject to endto-end latency constraints. The problem is solved using an iterative PSO algorithm combined with the primal decomposition and penalty function method, where both the transmit power and beamwidths are updated iteratively.
In [76], authors address the beam misalignment or deafness problem caused by the user's mobility. They propose a joint user scheduling and power allocation framework to minimize the beam misalignment probability during user's mobility. They develop two scheduling algorithms: Static Grouping (SG) and Dynamic Grouping (DG), and two power allocation algorithms: Static Power Allocation (SPA) and Dynamic Power Allocation (DPA) that can be applied jointly or individually. Experiment results show that combining DG and SPA yields better performance in terms of minimizing outage probability, and conversely, combining DG and DPA provides high throughput.
The architecture based on hybrid beamforming with mmWave MIMO provides a high data rate for 5G service. NOMA can be used further to increase spectral efficiency. However, the narrow beams in mmWave MIMO NOMA may cause beam misalignment and thus degrade the data rate. In [77], authors propose a beam aggregation system aiming to generate virtual wide beams by combining the neighboring analog beams. As seen in Figure 9, the multi-user signals are conveyed in a single analog beam for conventional powerdomain NOMA. For example, in the lower of Figure 9(a), the user, which is not aligned with the center of beam direction, suffers from significant degradation on the received SNR. This results in unfairness among NOMA users. Conversely, with beam aggregation-based NOMA, as seen in Figure 9(b), the multi-user signals are conveyed in an aggregated virtual beam that serves all neighbor users. The authors also propose a multi-user pre-coding approach to enhance the system fairness through maximizing the achievable sum rate of VOLUME 10, 2022 clustered users. An artificial intelligence approach is proposed to solve the optimization problem based on Deep Neural Network (DNN) training.

3) BEAM ALIGNMENT & QoS
The mmWave applications for vehicular communications face a number of issues such as high path loss, limited communication range, and beam alignment overhead, etc. To overcome the high path loss, mmWave communications rely heavily on providing narrow directional beams with high beamforming gains that require specific channel estimation. However, the high mobility of vehicles results in fast environment change and beam misalignment and requires beam tracking procedure. Therefore, accurate channel estimation and beamforming techniques are desired to satisfy Quality of Service (QoS) for vehicular applications. A new framework of channel estimation and beam tracking is presented in [78]. Authors propose an algorithm for channel estimation named Robust Adaptive multi-Feedback (RAF) to minimize the beam alignment overhead and reduce the estimation error probability. They also propose a practical model for beam tracking based on Extended Kalman Filter (EKF) recursion, position, and velocity that provides a high performance compared to existing algorithms.
The beam misalignment between users in movement may deteriorate the QoS in mmWave 5G communications. In this context, authors in [79] consider a switching/resetting beam serving method based on power allocation, taking into account the contextual information of the vehicles. Simulation results prove the performance of this power-based switching method in terms of user throughput, connection stability, and QoS.
In [80], a simulation framework of generating a 5G mmWave MIMO dataset using ray tracing was proposed to generate vehicular channels with temporally-correlated vehicle trajectories. The authors have also investigated the performance of various Machine learning (ML) algorithms (e.g., Support Vector Clustering (SVC), Adaptive Boosting (AdaBoost), Decision trees, Random forests, DNN, and reinforcement learning) for beam pair selection in vehicleto-infrastructure settings. They have established that the deep-learning structure surpasses shallow ones regarding the precision for classification and root-mean-squared error for regression. However, the design of the environment characteristics was inexplicit, as well as the practical implementation issues were disregarded. In the same context, to achieve a high communication link of D2D devices, authors in [81] propose a NOMA-based reinforcement learning approach to maximize the throughput and minimize the outage probability. They propose two RL algorithms to allow devices to self-organize and learn pure/mixed equilibrium strategies in a wholly dispersed manner. Decentralized RL algorithms have been demonstrated to play a key role in permitting devices to self-organize and achieve sufficient performance even with incomplete data or under uncertainty.
In [82], the beam alignment problem is formulated as an optimization approach, aiming to enhance the quality of coverage of vehicular users (i.e., the sum rate) and maximize the number of mmWave links with high quality.
In general, the beam misalignment between BSs and UEs deteriorates the communication performance. To address this issue, many solutions have been proposed. In [83], authors use stochastic geometry to analyze the SINR, the cell load, and the user throughput in RAT small cells. To achieve beam alignment, they optimize the SINR and balance loads between tiers and RATs by proposing a cell association mechanism using two biases. Simulation results prove the effectiveness of deploying multi-RATs to ensure high QoS. Another solution based on cell discovery positioning algorithms is proposed in [84] that enables UE to reach mmWave BS. Hence, beam alignment is achieved with high performance, reduced overhead, and increased user tracking. Seamlessly, to support vehicle to infrastructure communications in urban scenarios, authors in [85] analyze the tradeoff between localization and data rate performance using theoretical bounds. They assign an algorithm to the operator to adjust the transmission power of the mmWave BS to meet the QoS requirements of various services.

4) BEAM ALIGNMENT & ENERGY CONSUMPTION
The mmWave 5G communications needs highly directional links to compensate for high path loss. However, establishing these links generates substantial latency and high energy consumption. Besides, the employment of large antenna arrays with beamforming requires accurate beam alignment between transmitter and receiver, resulting in considerable overhead. In [86], authors analyze the impact of resource energy consumption on performing correct beam alignment. Their study proves the effectiveness of exhaustive beam search than hierarchical search for large coherence block lengths.
In [87] and [88], an energy-efficient interactive beam alignment and data communication approach is proposed to minimize the energy consumption subject to minimum achievable rate constraints. In [88], authors use a sectored directional antenna model with uniform prior information on AoD and AoA. They propose a fixed-length fractional search method that decouples the beam alignment of transmitter and receiver. Simulation results using analog beamforming prove the performance of decoupled fractional search compared to exhaustive and bisection search in terms of jointly reducing power consumption and overhead.
In [87], the authors propose an optimization approach to minimize the energy consumption at the BS over a frame duration T fr while ensuring the QoS of the UE (i.e., achievable data rate and delay).  Markov Decision Process (MDP) formulation, the optimization problem is expressed as follows: where: • In (11a), E k is the energy incurred for the transmission of a beacon in slot k, f 0 presents the prior knowledge of the AoD/AoA pair; • (11b) presents the design variables in slot k expressed by the 4-tuple a k = (ξ k , P k , B k , R k ) where ξ k is the decision parameter of beam alignment (i.e., ξ k =1) or data transmission (ξ k =0). P k is the power, B k is the 2-dimensional (2D) beam, and R k is the achievable data rate; • (11c) denotes the 2D AoD/AoA defined by the BS-UE beam B k ; • (11d) presents the energy consumption in the beam alignment slots where φ s is the energy/rad 2 required to achieve false-alarm and misdetection probabilities; • (11e) presents the data rate constraints; • (11f) denotes the relation between energy and power where T B is the beacon signal duration. For the case of uniform prior information on AoD/AoD and perfect detection, authors prove the efficiency of a fixed-length beam alignment phase followed by data communication phase [87]. They demonstrate the optimality of a decoupled fractional search method. On the other hand, for the case of non-uniform prior on AoD/AoD, a heuristic approach is proposed to achieve better performance which proves that the uniform case is the worst one. The authors also analyze the impact of beam misdetection errors on energy consumption and throughput.
Another factor that may impact the beam alignment and energy consumption is the beamforming scheme. In [57], authors prove that both the discovery latency and energy consumption can be decreased by using fully digital front-ends with low resolution. They find that the energy consumed for the analog front-end is six times more than that of digital front-ends according to the size of the antenna arrays.

B. BEAM ALIGNMENT METHODS
Based on the literature, the beam alignment techniques in mmWave communications can be classified into two categories: with or without channel estimation. The mmWave beamforming training based on Channel State Information (CSI) estimation focuses on estimating the key features of the mmWave channel (i.e., User location, AoA, AoD, path gain, etc.) and then steering the transmitter and receiver beams. On the other hand, the mmWave beamforming training without CSI estimation detects the optimal Tx/Rx beams pair via spanning the whole or partial area around Tx/Rx based on the predefined codebooks. The beam alignment problem is handled for single user and multi-user perspectives, where the radio devices coordinate their beam strategies by using location information to reduce the coordination overhead.
In this section, we present the important research aiming to provide robust approaches for location-aided beam alignment in mmWave communications. We also present other beam alignment methods without prior knowledge of CSI (e.g., machine learning, agile link, contextual bandits, etc.). VOLUME 10, 2022

1) BEAM ALIGNMENT METHODS WITH CHANNEL ESTIMATION
A hierarchical hybrid beamforming training is proposed in [89]. The intuition consists in estimating the mmWave CSI using Compressive Sensing (CS) to construct training beamforming vectors with different beamwidths. Authors propose adaptive estimation algorithms for single and multi-path mmWave channels. Despite the low complexity, simulation results prove that the proposed algorithms outperform the conventional exhaustive search in terms of spectral efficiency and precoding gain. However, this approach still suffers from the problems of low coverage, low spectral efficiency, and high outage. In [90], the adoption of the Continuous Basis Pursuit (CBP) approach can construct a beamforming dictionary matrices which in turn help to reduce the estimation error probability for AoA/AoD and increase the estimation accuracy. Two novel multi-path channel estimation algorithms based on adaptive CS and CBP-based dictionary are proposed, which provide better estimation accuracy and higher spectral efficiency than the grid-based presented in [89].
Location-based mmWave beamforming training using CSI estimation based on CS was proposed in [91] and [92]. Some important constraining factors affecting the performance of location-aided beam alignment should be considered. First, the MS and BS are not expected to obtain location information with the same degree of accuracy. The position of the BS can be deduced with high accuracy, as it is static. On the other hand, the location of the MS, due to its mobility, is more difficult to derive. In [91], MS localization is used to define the MS uncertainty area and to reduce the number of beamforming training vectors needed for channel estimation using CS. Based on the estimated location error, a single-level beamforming training is performed to build the sensing matrix, then the BS and MS estimate the AoD and AoA of the mmWave channel. Besides, in [92], a locationbased mmWave multi-level beamforming using CS is proposed to find out the Tx/Rx beams and not only define the searching angle (i.e., AoA and AoD) but also adjust the used beamwidth of each level regarding the uncertainty area of the MS. This scheme provides low beamforming training complexity than [91]. However, if the MS is far from the BS, the beams searching angle from the estimated uncertainty area of MS location will be under the expected angular spread of the mmWave channel. As a result, this underestimation causes a high outage probability. Therefore, to overcome this issue, an adaptive beamforming training algorithm is presented in [93] to estimate the mmWave channel using CS-based on defining the location uncertainty area of the MS and considering the statistics of the angular spread of the mmWave channel.
Due to the mobility in the estimation procedure, the location state information received at the BS and UE is expected to be noisy, which can lead to performance degradation for beam alignment in mmWave massive MIMO communications. In [94], a robust location-aided beam alignment is proposed to reduce the alignment overhead and provide fast link establishment.
In urban micro-cell scenarios, the BS and the MS are assumed to be located outdoors; here, the beam alignment is realized using WiFi localization in mmWave communications. With the high accuracy of WiFi location, the mmWave AP expected to find the MS can be easily located, which overrides the search in all other existing mmWave APs. MmWave beamforming training, cell discovery, and association techniques using WiFi localization are proposed in [95] to furnish a high MS location estimation accuracy. The system architecture based on the WiFi/mmWave integration is connected to an AP controller that collects all metrics (e.g., RSS), carries out the MS localization, and provides the efficient MS-mmWave link establishment [96]. Similarly, in [97], a geometry-based scheme is proposed to mitigate the high complexity of initial access and control of mmWave communications.

2) BEAM ALIGNMENT METHODS WITHOUT CHANNEL ESTIMATION
Some examples of the mmWave beam alignment methods without channel estimation are already presented in the other sections as exhaustive training, training-based beam sweeping, user context information, adaptive beamwidth based on multi-stage codebooks, deep learning, channel knowledge map, etc.
The beam alignment based on beam sweeping [58] does not depend on explicit channel estimation. Here, the transmit and received beams from predefined codebooks are applied sequentially with proper handling between the transmitter and receiver, whereupon the optimal beam pairs are selected. Although the beam scanning obviates sophisticated CSI estimation and beam selection, it results in high training overhead due to exhaustive search of Tx and Rx beamforming codebooks.
The beam alignment techniques based on channel estimation or beam sweeping lead to high training overhead, specifically for wireless systems with an increasing number of antennas. In [98], authors propose a new beam alignment approach, environment-aware and training-free, based on Channel Knowledge Map (CKM) [99] combined with user location information. CKM aims to enable knowledge of the radio environment by providing all relevant information about the inherent propagation channels. Two new CKM instances have been proposed for environment-aware and training-free beam alignment in mmWave massive MIMO systems (i.e., channel path map (CPM) and beam index map (BIM)). Compared to the existing beamforming training methods, the CKM-based beam alignment provides a high average data rate and helps to reduce the training overhead.
In [100], the authors design a new hierarchical codebook for beam alignment in mmWave systems, where all codewords are characterized by maximum main-lobe gain and minimum side-lobe gain. Similarly, in [101], a new phaseshifted DFT multi-resolution codebook design based on maximum beam gain was proposed to achieve beam alignment. However, the beam alignment methods based on codebook design and traditional beam training (e.g., hierarchical search, iterative search) do not provide high performance in terms of data rate and spectral efficiency. Therefore, in [102], authors study the impact of beam training on achieving maximum success rate, they propose an adaptive beam alignment scheme for mmWave MIMO systems. Two adaptive algorithms have been derived, Adaptive Hierarchical Traversal Beam Search (AHTBS) algorithm and Adaptive Hierarchical Iterative Beam Search (AHIBS) algorithm. These two algorithms aim to reduce the training time by employing a beam detection method and help to increase the average data rate. Moreover, the maximum transmission data rate is exploited as the beam training termination criterion.
In [103], a beam alignment method with partial beams using the ML approach is proposed without any prior knowledge of channel estimation, such as user location information. The neural network of the proposed scheme is first trained offline based on simulated environments and next online training of partial beams to predict the distribution of beams vectors. Unlike the beam alignment-based codebook designs, the proposed ML aligns beams of all users simultaneously while saving the training overhead.

C. BEAM ALIGNMENT IN mmWave COMMUNICATIONS: ARCHITECTURES, SEARCH METHODS AND ALGORITHMS
This section presents a global classification of related papers based on methods, design, and algorithms used for beam alignment in mmWave 5G systems. First, we present a comparative analysis of different architectures based on hybrid, analog, or digital beamforming and their influence on synchronization signal tractability, energy consumption, and beam training time (see Table 3). We analyze the impact of hardware constraints architecture on handling the beam alignment issue at mmWave communications. We also classify the papers based on the beam searching method and the type of algorithms used to solve the problem. The majority of articles attempt to solve the beam alignment problem with minimal latency and overhead, but without denying the importance of other factors such as energy consumption, power allocation, and QoS (see Figure 10).
Based on the studied papers in this survey, we show that digital beamforming outperforms analog and hybrid beamforming in terms of quality of service but might induce high cost and high energy consumption. In comparison, the analog beamforming, that employs a single RF chain to interconnect all the network elements, has the benefits of low cost and simple implementation. But, it does not have the flexibility required for base-band signal processing. The hybrid beamforming technique strikes a balance between digital and analog beamforming by deleting redundant RF chains to reduce system costs while maintaining massive network gain and serving multiple users with high performance.
The traditional beam searching methods as exhaustive, iterative, hierarchical, and bisection search can cause a substantial training overhead at mmWave communications. Therefore, many deep learning algorithms have been proposed to achieve fast beam alignment for both 5G and 6G wireless networks (see Figure 11). Researchers not only consider the latency problem but also the power allocation through converging toward NOMA access methods.
The dynamic environment for the vehicular network often suffers from QoS degradation related to movement, whereby fairness and machine learning schemes have been suggested to guarantee the QoS and achieve a high data rate.

IV. BEAMFORMING AND BEAM ALIGNMENT IN 6G TERAHERTZ COMMUNICATIONS
Nowadays, researchers have already started the investigation of 6G systems (i.e., vision, enabling technologies, and performance metrics). Studies [105]- [107] provide an overview of the enabling technologies required to achieve 6G key performance indicators, such as terahertz communications, RIS, Orbital Angular Momentum (OAM) based systems [108], Ultra-Massive MIMO (UM-MIMO) and Cloud-Centric network, etc.
This section presents the terahertz basics, including precoding, beamforming, and the key challenges. We provide the solutions proposed to solve the beam alignment in terahertz communication with the importance of using DNN and RIS.  A. TERAHERTZ BASICS: APPLICATIONS, BEAMFORMING, PRECODING, CHALLENGES By 2030, the entire world will be reliant on fast data speeds where the use of terahertz frequencies will be the key potential to serve multiple devices at high speed of the Internet. The terahertz or sub-millimeter band (0.1-10 THz) is considered as the key technology to meet the high requirements of the 6G wireless network. The terahertz spectrum is characterized by many features such as large bandwidth of tens to hundreds of GHz, high data rates, pico-second latency, integration of thousand of sub-millimeter antennas, small interference, etc.

1) TERAHERTZ APPLICATIONS
The terahertz frequencies have the potential to address the spectrum shortage problem while greatly increasing the capacity of conventional wireless systems (see Figure 12). VOLUME 10, 2022 Terahertz communication can stimulate many promising applications such as Tera-WiFi, Tera-IoT, Tera Integrated Access and Backhaul (IAB), Tera space communications, etc.
• Tera-WiFi (The next generation Tbps WLAN systems): Similar to WLAN systems, APs can be deployed in some locations such as shopping mall lobbies, subway station doors, and other indoor locations of high user mobility [109]. In terahertz bands, the AP offers the ability to send information to multiple users in different directions simultaneously by using the sub-array antenna structure. The ongoing expansion of AP equipment helps to provide successful communication services and increase the quality of the video (e.g., AR/VR services, HD holographic video conferences, ultra-high-resolution video formats, the download of HD videos, etc.) [110].
• Tera-IoT (Tbps Internet of nano Things in a wireless data center): Terahertz communications are predicted to reach a transmission rate of 100 Gbps [111], which can meet the communication rate requirement in future wireless data centers. Hypersurfaces 2 are potentially applicable in IoT, forming the overall behavior of an indoor or outdoor wireless programmable environment.
• Tera-IAB (Tbps Integrated Access Backhaul wireless networks): The objective of IAB is to deliver sustainable wireless backhauling using the New 3GPP Radio technology (NR) in the International Mobile Telecommunications (IMT) bands, also providing legacy cellular services in the same node. Thus, IAB is considered as a complement to microwave peer-to-peer backhauling in dense urban and sub-urban rollouts [112]. With the emerging deployments of small and pico-cells using street-level BSs, there is a demand for a wireless backhaul solution that allows backhauls to operate in NLoS conditions, the type of propagation scenarios for which the cellular radio access technologies were conceived.
• Tera Space Communications: In terahertz communications, the integrated satellite-terrestrial networks can offer high-throughput and speed data connectivity to people living in isolated areas with poor information infrastructure [113]. The terahertz spectrum can also provide high data rate space links between satellites and BSs, airplanes or vehicles, etc.

2) TERAHERTZ PRECODING
Among the aforementioned terahertz application scenarios, a major emerging issue is how to address the significant path loss of terahertz signals. Hence, terahertz precoding is a key technique to overcome this problem. Terahertz precoding is a channel adaptation technique that pre-patterns the transmitted signal according to the channel information. It is characterized by directional beams to avoid path loss. The main reason for creating a narrow pencil beam in a particular direction is to form a crew surface of electromagnetic waves transmitted by different antenna elements, and orthogonal to the target direction of propagation [114]. To achieve this goal, the incremental phase shifts which grow as a function of the antenna element label must be compensated at the individual antenna elements. In general, array gain refers to the power gain of the generated beam, which is proportional to the number of antennas, and beamwidth is related to the number of antennas. Terahertz precoding approaches are mostly focused on low RF complexity solutions by incorporating analog components. Based on the literature, three precoding techniques have been studied for 6G deployment (i.e., Hybrid precoding, Analog beamforming and Delay Phase precoding) [115]- [119]. Table 4 provides a detailed description of these three techniques.

3) TERAHERTZ BEAMFORMING AND BEAM STEERING ANTENNA PATTERNS
From a physical standpoint, beamforming is expected to regulate the radiation pattern of the antenna array. Beamforming is a technique used to control the power distribution of a single data stream in several directions. The use of array response vectors to establish directional beamforming in multiple directions is commonly named beam steering. The relationship between precoding, beamforming, and beam steering is illustrated in Figure 13. Most papers do not strictly separate the terms beamforming and precoding. Beamforming is sometimes treated as precoding.
Similar to mmWave communications, digital beamforming is not convenient for terahertz communications due to its high cost and power consumption. Therefore, using analog beamforming in the terahertz spectrum helps to minimize the power consumption by reducing the number of phase shifters required in the RF chain [120]. However, it is further constrained by the fact that analog phase shifters are digitally controlled and have only quantized phase values, which will considerably limit the analog beamforming performance. In contrast, hybrid beamforming is still the best method as it can have fewer RF channels than antennas and can achieve all-digital performance [120]. It is worth noting that the construction and commercialization of a complete array architecture for real terahertz frequencies with dynamic beamforming does not yet exist. However, some successful prototypes of terahertz antenna arrays based on new materials have been sampled in testbed environments, and some theoretical designs have been proposed.
In [121], the authors are speaking about technologies that do not exist and are providing an instructive survey on the deployment of these nonexistent technologies. They provide a comparison of four beamforming techniques: path length optics, phased arrays, leaky-wave antennas (LWA), and passive arrays (i.e., reflectarrays and transmitarays). Notable demonstrations have involved a monolithic CMOS beamforming integrated circuit [122], although this is not suitable for terahertz-range communications due to low antenna gain and narrow bandwidth. Another example introduced tilt into the pump beam of a photoconductive antenna to achieve an outgoing phase gradient [123], but this requires a highly advanced physical laser set-up that is not viable for network VOLUME 10, 2022  deployment. Leaky-wave antennas have been deployed for demonstrations of terahertz communications [124], but their frequency-scanning nature imposes stringent restrictions on achievable data rates and achievable beam patterns.
Various types of beam steering antennas based on different materials have been proposed, including horn antennas, lens antennas, microstrip antennas [122], [125], and on-chip antennas [126], reflectors [127], and slot antenna arrays with cavity [128]. Besides, methods such as photoconductive antennas [129] and silicon-based lenses [130] have been tried in the field of photonic. Other techniques for improving the antenna's performance have been proposed, such as packing multiple carrier layers with varying dielectric characteristics. Apart from metallic and dielectric antennas, novel materials-based antennas, such as carbon nanotubebased antennas, vanadium dioxide (VO2) [131] and planar graphene antennas [132], [133]. As can be seen from Table 5, Horn antennas are extensively applied in the low frequency near to microwave band due to their efficient directivity, high gain, and easy connection to the waveguide. Lens antennas are characterized by higher gain, efficient directivity, and their advantage to form an antenna array. On the other hand, Microstrip antennas are small in size and are commonly used; however, their weak directivity and low gain require further investigations in the future. Nevertheless, the performance of individual terahertz antennas (e.g., photoconductive antennas) is typically restricted by their small power transmission or limited dynamic beam steering capability. Hence, it is necessary to study large-scale terahertz antenna arrays that support high transmit power and tunable steering. The advantage is that the ultra-short wavelength of the terahertz band allows the integration of a large number of antenna arrays with a small footprint, thereby enabling high gain directional dynamic beamforming via antenna arrays. Despite the fact that some methods have been tested for the implementation of terahertz antenna arrays [134], these arrays only improve the directional gain and do not achieve dynamic beamforming.

4) TERAHERTZ DEVICES
The terahertz band's position between the microwave and infrared (IR) frequency ranges creates a challenge on signal creation and detection. The frequency range between 0.1 and 10 THz has been known as the terahertz gap, as the methods used for creating and detecting such radiation are presumed to be less sophisticated. On the one hand, electron-transporting transistors and other quantum devices are restricted at around 300 GHz. Devices operating above these frequencies tend to be inefficient because semiconductor technologies are unable to efficiently convert electrical energy into electromagnetic radiation at this specific spectrum [16]. High terahertz frequencies require fast alternating currents, whereby the electronic devices will not be able to travel far enough to operate before the polarity of the voltage changes and the electrons change direction. On the other hand, the wavelength of photonic devices may be reduced to just 10 µm (about 30 THz) [113]. This is owing to rapid transitions of electrons between energy levels, making it difficult to regulate the small discrete energy jumps required to produce photons at terahertz frequencies. With high attenuation, devices with strong performance, such as higher output power and low noise level, are required to optimize the link budget and enhance the communication data rate. There are three types of devices that convert terahertz signals: electronic, plasmonic, and photonic devices. Works on these technologies are in progress to choose the best one of each scenario based on the required data rate, distance, and sensitivity; we present in Table 6 a comparison of their features. In the following, we present examples of each type considering their advantages for beam steering in low and high terahertz frequencies:

a: ELECTRONIC APPROACH
The purpose of this strategy is to push the boundaries of existing microwave and mmWave device technologies in order to create terahertz systems. The most common devices used to provide a terahertz carrier signal in an electronic approach are Resonant Tunneling Diodes (RTDs), Traveling Wave Tubes (TWTs), and IMPact ionization Avalanche Transit Time (IMPATT) diodes using frequency multiplying chains to convert lower-frequency signals [144]. In addition, different device technologies can be used to construct frequency multipliers:

1) Complementary Metal-Oxide-Semiconductor (CMOS):
In recent years, CMOS-based sources have advanced quickly. The CMOS technology is characterized by high-level integration, a tiny form factor, and a low cost. The ability of CMOS to operate at high frequencies allows solutions in the lower band of the terahertz spectrum. This has been accomplished by putting an active multiplier chain, or a voltage-controlled oscillator (VCO) into the CMOS device [145]. Various triplers are used to double the frequency from a lower band to the terahertz frequency band using nanoscale CMOS technology, where the consideration for CMOS terahertz circuits is enabled by technological scaling [146]. CMOS transmitters have reached up to 105 Gbps data rates at 300 GHz utilizing a 40-nm CMOS technology [147]. Silicon CMOS and Silicon-Germanium (SiGe) BiCMOS technologies are highly compatible with existing electronic systems [148]. However, at frequencies up to a few hundreds of GHz, their highest transmission power does not exceed a few milliwatts per element [149].

2) Monolithic Microwave Integrated Circuits (MMIC):
The incorporation of a large number of tiny transistors into a small chip enables creating circuits that are several times smaller, cheaper, and faster than those built with discrete electronic components. In this context, to enhance the transmission power and the maximum frequency, semiconductor materials such as Indium Phosphide (InP), Gallium Arsenide (GaAs), and Gallium Nitride GaN) are used to create different MMIC compatible techniques, including Heterojunction Bipolar Transistors (HBTs) and High Electron Mobility Transistors (HEMT) [150]- [152]. This leads to higher doping density in the base, resulting in lower base resistance while increasing gain. HBTs provide a higher cutoff frequency, greater voltage handling capabilities, and lower capacitive coupling with the substrate compared to traditional bipolar transistors [153].
SiGe HBTs are predicted to reach 700 GHz cutoff frequencies [154], and initial systems have already been accomplished. The high-power performance of GaN HEMTs has drawn interest in recent years. In comparison to rival technologies such as GaAs and InP devices, GaN HEMT technology shows promise for broadband wireless communication systems due to its high electrical breakdown field and fast saturation carrier speed [155]. In [156], a fully integrated MMIC chipset, using GaAs HEMT at 300 GHz, has been presented for handling up to 64 Gbit/s in Quadrature Phase Shift Keying (QPSK) signaling at meter ranges. Compared to CMOS, HBT and HEMT technologies have been used in the literature to provide higher frequency sources with larger output powers. However, CMOS, given its cheaper cost and better integration densities, remains an intriguing alternative for terahertz technology.

b: PHOTONIC APPROACH
The purpose of this approach is to extend the limits of photonic methods used in optical wireless systems down to the terahertz range. In the following, we present three dominated techniques for photonic generation, modulation, and detection of terahertz signals: 1) Quantum Cascade Lasers (QCLs): QCLs are semiconductor lasers that generate low-energy photons with mid-IR and terahertz frequencies [157]. Their frequency range is above 2-3 THz. QCLs have made rapid advancements in frequency coverage, power output, and operating temperature. QCLs are applied in most Free Space Optical Communication (FSOC) systems, achieving the highest data rates by using continuous wave lasers driven by a Direct Current (DC) bias and a radio frequency (RF) modulation signal. In [158], the authors developed an all-photonic terahertz communication link at 2.5-6.5 THz using a quantum well photodetector at the transmitter and a QCL working in pulse mode at the receiver. Also, the authors in [159] were able to increase the frequency to 4.1 THz using a QCL that runs in continuous wave mode. QCLs have a huge potential in terms of being used as a light source in future mid-IR FSOC transceivers and may be directly modulated using a high-speed digital signal. Authors in [160] review the QCL based FSOC by analyzing experimental demonstrations of two advanced modulation formats, namely four-level Pulse Amplitude Modulation (PAM-4) and Discrete Multitone (DMT) modulation. They have proven the successful modulation and reception of a transmission data rate of up to 4 Gb/s. Despite generating power outputs of up to a few hundred mWs at cryogenic temperatures, the challenge is to guarantee practical power figures when operating at room temperature [113]. 2) Unitravelling Carrier Photodiode (UTC-PD): With the growth of photonics technology, the speed of signal processing systems has been improved drastically. Photodiodes are instances of these devices that can achieve both high speed and high saturation, enabling the processing of high capacity communication systems [161]. Using a high-saturation-power photodiode in conjunction with an optical amplifier reduces the need for post-amplification circuitry, increases bandwidth, and simplifies receiver configuration. UTC works as a down-converter to terahertz frequencies. The UTC-PD, which was primarily designed as an ultrafast photodiode for optical communications, has a greater output power saturation than traditional photodiodes [162]. However, because of the space charge effect at the carrier transport zone, even at the UTC-PD, the output power is saturated over a certain amount. Hence, arrayed UTC-PDs [163] can be used to avoid this issue. 3) Photoconductive antennas: The use of photoconductive antennas is another method for downconverting optical signals to the terahertz band [164]. A photoconductive antenna is typically a conventional terahertz metal antenna printed on a photoconductive substrate [165].
Photocarriers are excited at the antenna gap when it is irradiated by an optical signal. The carriers are subsequently accelerated along with the antenna structure by a DC bias field, generating the emission of terahertz photons. The performance of photoconductive antennas is defined by the features of a femtosecond laser pulse, the antenna electrodes geometry, and photoconductive semiconductor substrate. In particular, the shape of the electrodes may be tailored to regulate the terahertz radiation's operating bandwidth, polarization, and beam pattern. The fundamental drawback of this method is its low conversion efficiency, which results in low emitted power. In [166], authors improve the output power of terahertz photoconductive antennas array by using improved arrays based on crossfingers structure.

c: PLASMONIC APPROACH (OR HYBRID APPROACH)
The objective of this approach is to construct devices that work at terahertz frequencies without the need to up-convert from the microwave range or down-convert from the optical spectrum by utilizing the features of plasma waves. In addition to the electronic and photonic processes, new materials provide another way to ensure the high-performance of terahertz antennas. In plasmonics, electromagnetic waves are used to stimulate the electrons on the surface of a metal and to produce oscillations at optical frequencies [167]. An advantage of these Surface Plasmon Polaritons (SPPs) is their ability to be confined to an ultra-compact field much smaller than optical wavelength [168]. SPPs also oscillate at optical frequencies, allowing them to convey data over wide bandwidths. In addition, Graphene is a two-dimensional form of graphite that has unique electronic and optical features [169]. Compared to traditional electronic materials, Graphene is highly tunable in terahertz frequencies as carrier densities can be easily managed by an electrical gating and doping [170]; thus, it can be used to implement devices that support dynamic beamforming. It has paved the way for terahertz nano-devices capable of operating at room temperature. Graphene-based terahertz components have demonstrated highly promising results in terms of terahertz wave generation, radiation, and detection by exploiting the features of SPP waves [171]. The size gap between the two conventional technologies (i.e., electronics and photonics) is an obvious barrier to advances in many areas of modern science, but it can be addressed by the emerging field of plasmonics [172]. Surface plasmons have a speed equal to that of light as shown in Figure 14 and a wavelength of a few tens of nano-meters. Plasmonics will provide better synergy between electronic and photonic devices. They have similar sizes of electronic components and similar operating speeds of photonic devices.

5) TERAHERTZ KEY CHALLENGES
Despite the potential features of terahertz communications, their operating conditions at sub-millimeter frequencies cause several challenges, including wireless propagation loss, signal coverage, deafness, terahertz wavelength, fast channel fluctuation, intermittent connection and terahertz networking, and processing power consumption [173]. In this section, we focus only on the well-known problem of beam misalignment (i.e., deafness), and the other terahertz challenges are detailed in section V.
The deafness problem is induced by the directivity of razorsharp 3 beams that makes the alignment between a transmitter and receiver more challenging. In addition, selecting the suitable control channel makes the procedure of network identification and coupling more difficult due to the need to avoid deafness issue and provide a large transmission coverage area. In the following, we present the different methods, beamforming techniques, and algorithms used to solve the beam alignment problem in the 6G wireless network.

B. BEAM ALIGNMENT IN TERAHERTZ COMMUNICATIONS
Beam misalignment is considered as one of the primary obstacles in terahertz wireless networks. The communication links in the terahertz spectrum suffer from high channel attenuation whereby the use of beam tracking and beamforming approaches. Several factors can impact the beam alignment in terahertz communication (e.g., the antenna pattern, the distance between transmitter and receiver, the antenna motion model, the beamforming design, the mobility, etc.). A study was carried out to determine the impact of beam misalignment in terahertz communications using different antenna motion models [174]. Authors have focused on deriving the predicted values of transmitter and receiver gains in fronthaul and backhaul links in case of stochastic beam misalignment considering four different models of antenna motion: (i) Gaussian motion of a single antenna; (ii) Gaussian motion of both transmitter and receiver antennas; (iii) 2-Dimensional (2D) Gaussian motion of a single antenna; and (iv) 2D Gaussian motion of one antenna and one-dimensional Gaussian motion of the other [174]. Their results prove that the distance between transmitter and receiver is an important factor as the relative antenna's velocity depends on the distance. Also, the antenna movement may deteriorate the antenna gain and therefore cause high beam misalignment. Choosing the convenient antenna motion model is a crucial parameter to reduce the impact of beam misalignment.
The user equipment movement is a crucial challenge to enable efficient and reliable terahertz communication links. The fast mobility of terahertz UEs can cause beam misalignment between transmitter and receiver beams, thus generating outages and leading to link capacity degradation [175]. Therefore, a new mathematical framework is proposed to analyze the impact of micro-mobility on the capacity and outage in terahertz communications.
The beam alignment procedure may introduce large latency to find the optimal beam pair. Hence, a Hierarchical Beam Alignment (HBA) algorithm based on multi-armed bandit is proposed to minimize the beam alignment latency in terahertz communications [176]. This hierarchical structure is based on prior knowledge of channel frequency-selective fading to accelerate the beam alignment process. Simulation results prove the performance of HBA in terms of reducing BA latency compared to the exhaustive search method.

C. DEEP LEARNING VIEWPOINT FOR FAST INITIAL ACCESS AND RELIABLE BEAM ALIGNMENT
The 6G is expected to provide intelligent wireless connectivity with sub-millisecond latency and a high data rate (Terabits per second). However, communication in terahertz frequencies suffers from high path loss and intense shadowing where the necessity of beamforming methods. Therefore, beam alignment becomes more important in the 6G network, where intelligent algorithms should be developed to find the best beamwidth for high data transmission.
In this context, a DNN framework named DeepAI is proposed to achieve fast initial access through mapping the RSS to get the best-oriented beam [177]. The authors propose a Sequential Feature Selection (SFS) algorithm that provides efficient and reliable beam pairs for DeepIA's inputs in the case of the LoS mmWave channel. However, in NLoS scenarios, the SFS is unable to improve the accuracy and performance of DeepAI. Simulation results prove that DeepAI provides better performance than Conventional Beam Sweeping (CBS). Similarly, authors in [178] propose a deep learning-based beam selection algorithm suitable for 5G NR and 6G wireless networks.
Integrating localization information in mobile terminals helps to improve communication efficiency regarding channel estimation, beam alignment, and network utilization. Hence, the authors provide a detailed study on Integrated Localization and Communication (ILAC) toward 6G systems [179] presenting the different localization approaches and techniques.
The beam alignment methods can be classified into two broad categories, namely interactive and non-interactive methods. The interactive methods depend on prior knowledge where the probing beams for each packet can be changed based on the feedback received from prior packets. However, in non-interactive methods, the transmitter forwards a set of packets through a fixed set of probing beams and then assigns a data beam to the receiver based on the feedback received. In general, the interactive beam alignment is more performant than the non-interactive one. In [180], authors investigate a scenario of a single-user uplink interactive beam alignment where the BS employs various probing beams to sweep different angular directions. However, as the BS measurements are noisy, it is difficult to detect the narrow beam achieving the best AoA. Thus, the authors propose a DNN algorithm based on a Recurrent Neural Network (RNN) that provides high SINR. VOLUME 10, 2022 The 6G wireless network is supposed to support massive Internet of Things (IoT) devices with a very high data rate, whereby the requirement of a fast beam alignment. Hence, to overcome the overhead issue and the high power consumption, a Wireless Beam Modulation (WBM) process is proposed in [181] to support multiple IoT devices. This process helps to align the various signal's transmission paths with their corresponding antenna direction. For fast beam alignment, authors use a shared multi-beam search algorithm for beam alignment, which splits the search area into several sectors. Subsequently, the RF module pairs of IoT devices are pooled for parallel beam search.

D. RECONFIGURABLE INTELLIGENT SURFACE FOR BEAM ALIGNMENT
The Reconfigurable Intelligent Surface (RIS), see Figure 15, will play a crucial role in UM-MIMO systems with minimal cost and negligible energy consumption [182]. RIS can handle the relevant parameters of an arriving wave, such as frequency, amplitude, and phase, and then reflect this received wave to the desired destination without involving any sophisticated signal processing. The beam alignment and channel estimation for the RIS-aided mmWave MIMO system can be achieved based on prior location information provided by third-party tracking systems (e.g., satellite navigation) [183].
The authors of [184] examined combining the power allocation, phase shift optimization, and hybrid beamforming scheme for downlink multi-user RIS-aided mmWave-NOMA. The purpose of this strategy was to increase the network's total sum-rate in a NOMA system, considering the RIS phase shifts, power allocation at the AC, and hybrid beamforming.
In [185] an alternative optimization and successive convex approximation were employed to collectively optimize the beamforming vectors and power allocation for the RISassisted mmWave-NOMA system. The results show that the RIS can improve the mmWave-NOMA system's coverage range, precisely when the direct BS to users' links is obstructed.
RIS may even be able to dynamically use a subset of their surface for beam alignment and signal reflection to achieve a flexible equilibrium between reflection gain and beamwidth [186].
During channel estimation, the user location information can also help achieve fast beam alignment; however, this privacy is often ignored in previous works using traditional architecture. In [187], a new privacy-preserving design with RIS and Federated Learning (FL) is proposed to improve the spectrum efficiency in sub-mmWave communications by maximizing the achievable sum rate.
The innovative RIS, also known as hyper-surfaces [10], may be used to customize electromagnetic wave absorbing, reflecting, polarization, and phase shifting, among other things, to regulate the propagation of terahertz signals.
The RIS implementation in 5G NR/6G is particularly suitable for beam alignment, as the signals reflected from all the unit cells in RIS to the received can be phase-aligned, which helps to improve the signal spectrum and throughput [188]. The intelligent reflecting surface in terahertz communication can be employed to address the issues of signal blockage, beam alignment, and propagation loss through exploiting joint active and passive beam training [189].
To achieve beam alignment, three phases are required [190]. The first one aims to find the best codebook (i.e., the optimal reflecting sector or wide beam) for RIS. There is a single pair of wide beams that covers both the BS-RIS and the RIS-user links. In the aligned case, the user tries to find the optimal RIS codeword based on the pulse slot (the time slot of power pulse) as seen in Figure 16.
The second phase consists of finding the narrow BS-user beam pair while RIS is disabled. First, the user detects the wide beam pair with maximum power. Then, a fast hierarchical search is used to find the narrow beam on the user side. By the end, the user sends its optimal beam to the BS, and this later uses also fast hierarchical search to find the optimal narrow beam on the BS side (see Figure 17).
The third phase aims to find the BS-RIS-user narrow beam pair where RIS is turned on. There exist two propagation paths: the BS-user path, already reached in phase 2, and the BS-RIS user path, determined using the three steps used in phase 2 (see Figure 18).
The majority of works related to RIS involve singlehop RIS-assisted systems, where a single RIS is typically deployed between the BS and the users. In practice, similar to multi-hop relay systems, several RISs can be used to address the severe signal blockage between the BS and the users. In [191], authors propose a multi-hop RIS-assisted communication system to mitigate the significant propagation attenuations. The problem is formulated as a non-convex optimization based on hybrid beamforming aiming to maximize the sum-rate while respecting the constraint of transmit signal power. As the problem is NP-hard, the authors propose a deep reinforcement learning framework to find the optimal solutions. Simulation results prove that the proposed scheme   helps to increase the coverage range by 50% compared to traditional alternating beamforming methods without RIS or with single-hop RIS [192], [193].

E. BEAM ALIGNMENT TECHNIQUES IN TERAHERTZ COMMUNICATIONS
This section provides a classification of papers related to beam alignment in terahertz communications based on methods, designs, and algorithms used in B5G/6G systems. As shown in Table 7, the papers dealing with the problem of beam alignment in terahertz are few compared to those related to mmWave. By analyzing the proposed solutions, we notice that the deep learning algorithms are the common ones able to achieve fast beam alignment in 6G systems. Also, the deployment of RIS-based network systems can help to avoid blockage, beam misalignment, and propagation loss.

V. HOT TOPICS AND OPEN CHALLENGES
This section presents other open issues that require further investigations and must be addressed in future terahertz communications, such as the complex transceiver design, the construction of the terahertz antenna array, the terahertz channel model, the terahertz beam tracking, the 3D networking reliability, etc.

A. TERAHERTZ TRANSCEIVER DESIGN
The current transceiver design is not suitable for terahertz communications, as the transceivers need to be wideband, which is considered as a major challenge. The frequency band of the signal to be generated is too high for conventional oscillators and too low for optical photon emitters. This issue is called the ''Terahertz gap''. The terahertz band frequencies require highly advanced signal processing to deal with massive propagation loss [194]; thus, strong innovation is needed. Another critical challenge is designing antennas and amplifiers that can handle the ultra-wideband transmission for terahertz communications [113]. The semiconductor industry will help to overcome these issues; however, finding new designs for very dense antenna arrays is required to address the tiny wavelengths and physical size of RF transistors similar to the element spacing in terahertz arrays. Other factors that must be considered when manufacturing terahertz-enabled transceivers are high power, high sensitivity, and low noise. Hence, the distance and transmission power should be taken into account in the transceiver design. Besides, a link budget analysis model for terahertz communication system requirements can help to evaluate prospective link distances, bit rates, system bandwidths, and mobility support based on the technical specifications of terahertz band transceivers and the physical characteristics of the propagation medium, such as free-space loss to provide an overview of the challenges and opportunities [195]. Among the standard alternatives for terahertz signal generators and detectors are Silicon-Germanium (SiGe), Gallium Nitride (GaN), Gallium Arsenide (GaAs), and Indium Phosphide (InP), but the transmission distance of GaN, GaAs, and InP based transceivers is limited [196]. Therefore, designing a new terahertz transceiver that considers the power gain, the transmission distance, the phase noise, the non-linear amplifier, and modulation has become a vital necessity. The nanomaterials (e.g., graphene) and the CMOS can be used in innovative transceiver architectures within terahertz-enabled equipment [197]. The terahertz channels features are highly dependent on the characteristics and the density of the materials in the environment. Therefore establishing a common channel model is challenging, whereby further investigations on the channel models are required. The high Free-Space Path Loss (FSPL) can be compensated by the high gain antennas used in terahertz communication due to the high directivity components of the signal [198]. For example, using terahertz for indoor WLAN applications, with a transmit power of 10 mW or 1 W, a terahertz wireless system could provide high-speed Gbps WLAN services to space station crew modules [199]. Assuming that there is an additional path loss of 10 dB due to atmospheric attenuation for 0.5 THz signals traveling over a distance of 10 meters. Thus, to compensate the FSPL and atmospheric attenuation, a 30 dB gain antenna is required. Here, the dielectric and phased-array antennas can be used to enhance the indoor terahertz applications by providing high gain to mitigate the FSPL and furnishing alternative propagation paths for NLoS links. The large-scale phased array antennas can concentrate electromagnetic energy in pre-defined directions by aligning the phases and amplitudes of the array elements according to the beam interference pattern. The transmission of higher frequencies increases the complexity and parallelism of the RF hardware, and the narrower beamwidth leads to signal acquisition and beam tracking difficulties in mobile applications [200]. In addition to these technological limitations, other factors must be included in categorizing the RF spectrum as the penetration through various materials and reflections from surfaces. Similar to mmWave communications, beamforming is highly required to avoid the significant propagation losses in terahertz communication systems. However, beamforming requires channel state information, which is challenging to get in the case of large array size [201]. In the terahertz spectrum, the beam alignment is achieved when beam switching is realized before beam tracking. If the beam alignment fails, the beam tracking system will require beam switching to VOLUME 10, 2022 re-establish communication links [202]. The existing beam tracking schemes are based on user mobility, or codebook design [203]. Despite achieving acceptable performance for narrowband systems, these schemes are not suitable for terahertz wideband systems as the codebook design for beam switching is computationally complicated due to the large size of the networks. These schemes will suffer from significant performance degradation as hybrid precoding structures cannot compensate for the primary beam split effect in wideband terahertz large MIMO systems [204]. The beam training induces high overhead and delays when users are moving; hence, an efficient beam tracking approach is required for terahertz systems [205]. Furthermore, the small wavelength and severe path loss significantly limit scattering in terahertz communications. In addition, the 3D beamforming based on a large-scale phased array may help to avoid severe path loss, as scanning beams have higher directivity [206]. However, this 3D scheme is inefficient and time-consuming during the beam scanning procedure. From proposals, a fast beam scanning strategy is provided by Peng et al. [207] to balance between the precision and complexity and to achieve beam alignment in a specific scenario of indoor terahertz communication through carrying out lower frequency via exhaustive scanning. The arisen question is: can this approach be applied for other 6G terahertz applications? The suggested scheme uses a lot of frequency resources that induce high power consumption. In this context, reinforcement learning approaches are required to predict human movement and find the most appropriate direction. Holographic beamforming is also a dynamic advanced approach based on software-defined antennas with low cost, low power hardware architecture, and compact size. Therefore, more studies are needed to provide beam tracking-based learning methods for future 6G terahertz scenarios.

C. TERAHERTZ COVERAGE/RANGE
The terahertz coverage planning faces challenges similar to those of mmWave systems, for example, the availability of LoS paths between transmitter and receiver, the high propagation losses, the directional terahertz beams, power limitations, etc. Therefore, the terahertz systems should provide coverage from various sites to guarantee connection reliability. Proper tools would need to be created to facilitate the planning process, which would require the use of exact 3D representations of the surroundings. As a result of the large number of antennas that must be installed, automation of the planning process will be required, as human planning of an ultra-dense network is unacceptably laborious and time-consuming. The reflectarray and UM-MIMO antenna systems can be considered as alternatives for power limitation and propagation loss to extend coverage range [208]. The reflectarrays help to provide directional terahertz beams, and the UM-MIMO systems aim to expand the communication range and enhance the achievable data rate using beamforming and spatial multiplexing techniques that help directing antenna beams to multiple users.

D. TERAHERTZ NETWORKING
The 6G wireless network must be able to handle 3D communications. This requires coordinated studies on different topics such as 3D propagation measurement and modeling, new methods for 3D frequency and network planning for resource management, mobility, and routing. At the network layer, new routing approaches must be considered, including novel RIS, active relaying nodes, and passive dielectric mirrors to overcome LoS blockage and provide directional links. Moreover, a joint design and routing protocol-based deep learning can be adopted to get dynamic routes in real-time without impacting the network throughput. For classical macroscale applications, IPv6 is suitable. However, for nanoscale communications, more sophisticated addressing paradigms, such as hierarchical fashioned, must be investigated [113]. The aggregated traffic flowing over the network significantly increases with the implementation of wireless ultra-highspeed connections.
At the transport layer, congestion control and end-to-end trusted transit are both heavily burdened. Therefore, to handle the traffic dynamics in 6G terahertz communication networks, the TCP congestion control window techniques need to be considerably reviewed and updated. Considering the high data rate and ultra-low latency requirements in 6G terahertz systems, the mesh networking architecture should be deployed to fully exploit concurrent transmission opportunities to extend the network coverage for different applications. The link-layer can be merged with network and transport layers in the mesh network, enabling direct communication between a pair of nano-nodes, which helps to optimize MAC, routing, and transport functions [209].

E. SECURITY
The terahertz communication spectrum has multiple features that provide a much higher level of security and resiliency against attacks due to the spread spectrum along with low transmit power, beamforming with pencil-shaped beams, the requirement for LoS, small user coverage, and frequency hopping over a wide range of frequencies. Despite these advantages, links can be damaged by blockages, reflections through surfaces and small-scale device mobility [210]. Terahertz communications may suffer from authentication security [211], malicious behavior, and risks of attacks and threats [212]. Hence, achieving a high degree of security and privacy in 6G terahertz systems is a practical challenge [213]. The electromagnetic signature of terahertz frequencies can be used for the physical layer authentication process [214]. Despite the fact that high-frequencies and pencil beams in terahertz communications present a challenge for eavesdroppers compared to lower frequencies, the possibility of terahertz eavesdropping has not yet been characterized. For a transmitted signal in narrow beams, the eavesdropper could still intercept it [215]. The blockchain-based technologies in 6G applications can be relatively safe but still be the target of malicious behaviors. In this regard, a comprehensive survey in the literature presents the different promising emerging technologies of the 6G network (i.e., real-time intelligent edge computing, distributed artificial intelligence, quantum communications, intelligent radio, and 3D intercom) and their related security and privacy issues [211].

VI. SUMMARY AND INSIGHTS
Based on the studied papers in this survey, we realize that the beam alignment in mmWave/terahertz systems can be impacted by several factors, including beamforming, the type of antenna models, the beamwidth, the cell boundary determined by RSS, blockage, the coverage area, the link distance, the transceiver design, the beam searching methods, the access methods, the architecture design, the mobility, etc.
Achieving beam alignment and mobility management at terahertz systems is more complex than at mmWave frequencies. The mmWave communication range is 10x longer than the terahertz range, the terahertz LoS beams are notably narrower, and their links are less penetrating. Thus, more sensitive blockage mitigation methods and highly accurate prediction engines must be considered for terahertz bands. For example, blockages need to be predicted with a marginal error less than the pencil beam radius. Therefore, the guarantee of a durable LoS terahertz link is significantly related to the available information on the user's mobility. In particular, this will be crucial for future applications such as holography and AR/XR that require stable terahertz links at all times. The molecular absorption has a strong effect at terahertz frequencies, but it has been often neglected for lower frequencies (mmWave and below 6 GHz). Compared to terahertz frequencies, the mmWave frequency band has more multipath, high power NLoS links and requires larger LoS beams. Table 8 provides a simple comparison between mmWave and terahertz frequencies.
One potential strategy to facilitate the beam alignment process in a high-energy efficient manner is the deployment of RIS-compatible terahertz architectures. It will design hierarchical multi-resolution codebooks that help to find the optimal phase-shift matrix. Besides, adopting specific antennas as phased-array antennas can perform fast beam alignment. However, the choice of a convenient terahertz antenna depends on the application, the use case, and the environment. Deep learning algorithms can achieve fast beam alignment and data transmission for multiple channel clusters in terahertz systems. Dynamic scanning is also a highly desirable target, as it could enable automatic beam alignment of future terahertz links.

VII. CONCLUSION
With the deployment of 5G network, providing fast and reliable initial access in mmWave communications becomes a necessity. The beam alignment becomes more challenging when using narrow beams at higher frequencies, and IA needs to be repeated frequently until finding the best beam pair of transmitter and receiver. The IA is a costly process in terms of latency, transmit power and computational costs, and if it is not properly coordinated, the communications system may fail to reach high data rates. This paper provides a contemporary survey of IA search methods, beam management procedures, and beam alignment issues in 5G communications and beyond. We present a classification of papers on beam alignment, including their architectures, methods, algorithms, and objective functions. However, with the tremendous emergence of smart devices and the rapid expansion of IoT networks, 5G will be unable to fully fulfill the growing technological standards, such as autonomous, ultra-large-scale, extremely dynamic, and fully intelligent services. Therefore, 6G is envisioned to provide such services with high quality of experience. In this paper, we present the 6G enabling technologies, and we shed light on terahertz basics, including terahertz applications, beamforming, precoding, and key challenges. The beam misalignment is one of the critical issues to be addressed in terahertz communications where some solutions have been proposed, and more investigations are required. We also highlight the deep learning viewpoint to enable fast initial access and reliable beam alignment.