RFMagus: Programming the Radio Environment With Networked Metasurfaces

The complexity and volatility of real-world radio environments often hamper wireless networks from achieving optimal performance. Recently, intelligent metasurfaces have been explored to dynamically reshape the radio propagation environment. However, existing systems are limited to standalone metasurfaces, only enabling one-time signal redirection/reshaping effects within their direct line-of-sight. They cannot effectively scale to cover larger areas. In this paper, we propose RFMagus, which employs a network of metasurfaces to overcome the limitation. We carefully optimize the configurations of the networked metasurfaces so that they can cooperatively and coherently propagate the analog signals towards the target regions. We have implemented the networked metasurfaces and deployed them in a variety of real-world environments. Experimental results demonstrate that RFMagus can effectively expand the coverage, improve the throughput, and operate transparently to different wireless standards.


INTRODUCTION
The promise of ubiquitous wireless connectivity often falters in complex real-world environments where communication links strain against the innate volatility of RF propagation.For example, mmWave signals suffer from spotty coverage and blockage due to high directionality and small wavelengths [45].Even in sub-6 GHz networks, the wireless links are hampered by the vagaries of indoor environments.The problem becomes particularly egregious in cluttered settings like factory floors, concrete buildings, and underground mines [13,55].For Internet of Things (IoT) systems based on low-profile radio devices, the quest for coverage is further frustrated by the limited transmit power, antenna gains, and receiver sensitivity.
To mitigate such issues, metasurfaces have been explored to reshape the RF environment and reprogram the propagation of wireless signals [12,16,32].They have shown many versatile functions, such as beamforming [4,15,58] to improve coverage or capacity and channel randomization [29] for security.However, existing systems mostly focused on functional verification of a standalone metasurface, which only captures a small fraction of the electromagnetic field from transmitter.They may still fall short in a large environment with scattered coverage holes.Devoting an entire building interior to an ultra-large metasurface seems to be a straightforward solution.However, the cost and complexity of deployment would quickly become prohibitive.More crucially, the far-field boundary, where most metasurfaces' functions start to manifest, may exceed hundreds of meters [4], far beyond the region of interest for indoor coverage.
In this paper, we propose RFMagus, a "divide-and-conquer" paradigm to effectively scale up metasurfaces.As illustrated in Figure 1, RFMagus employs a set of tightly coordinated metasurfaces to jointly transform the propagation environment and relay the signals toward target regions where users experience weak or no connectivity.RFMagus essentially divides the scalability challenge into distributed solutions.We refer to this paradigm as "networked metasurfaces".At first blush, networked metasurfaces may seem to resemble the classical multi-hop wireless relay networks.However, they are designed to harness the following unique advantages: 1) The metasurfaces function in analog domain and jointly manipulate the electromagnetic waves to precisely regulate the wireless environment.In contrast, traditional wireless relays [2,8,25,37,38,43,50] grapple with interrelay interference or congestion, even when serving the same traffic flow.2) Metasurfaces can be transparent to standard wireless protocols and can collaborate with existing devices (e.g., repeaters or access points) to extend their coverage [9].They do not require sophisticated multi-hop routing, transport, or distributed synchronization protocols which remain challenging in practice despite several decades of research.3) Owing to a thin form-factor, metasurface can be attached to the facades of the ambient environment.The deployment is less intrusive than relay nodes.They only reflect rather than receive and regenerate existing signals.So they can be much more energy efficient and even become self-sustainable [42].
To achieve the proposed vision of RFMagus, the optimal configuration of the networked metasurfaces is imperative, such that they coherently manipulate impinging electromagnetic waves toward constructive combination at the intended receiver location.Realizing such optimized operation necessitates knowledge of the channels between nodes in the RFMagus network, including the transmitter (Tx), receiver (Rx), and the metasurface relays.Conventional channel estimation techniques [49] either rely on dedicated transceiver hardware, conflicting with the simplicity and passive operation of metasurfaces or induce prohibitive measurement latency resulting from the high-dimensional channel matrices -with dimensions scaling in proportion to the number of meta-atoms comprising the metasurface network [41].
In RFMagus, we adopt a simple solution-using a statistical multipath fading model, particularly the Rician model [22], to approximate channel between nodes.Whereas statistical model may not perfectly replicate real-world conditions, we tailor it so as to capture primary characteristics of the channel, which suffices to guide the metasurface configurations.
Our key insight is that (known) relative locations between nodes largely determine Line-of-Sight (LoS) channel.In addition, beam patterns of a metasurface impact energy distribution between LoS component (i.e., mainlobe) and multipath component (i.e., sidelobes).Thus, the energy ratio between mainlobe and sidelobe can approximate the Rician  factor, which is pivotal in representing the effects of multipath.
Given the channel information, how to find configurations for the networked metasurfaces?Such configurations determine how a metasurface interacts with electromagnetic waves (i.e., redirection or reshaping) and how metasurfaces interact with each other (i.e., transmission path between metasurfaces).A brute-force search among all possible configurations is impossible due to the daunting problem space.For example, for a 4-metasurface network, each metasurface has 256 2-bit meta-atoms, the search space reaches 4 1024 !An alternative method is to cast the problem as multi-hop/multipath routing and decide on consecutive "next-hop" metasurfaces that form a path to propagate transmitted signals to the target region.The beamforming direction of each metasurface can then be mapped to its meta-atoms' configurations.However, these methods may either inadvertently encourage competition rather than collaboration among metasurfaces or focus on the beamforming gain of each metasurface while disregarding phase alignment among the metasurfaces, thereby inhibiting overall system performance.
In RFMagus, we cast the joint configuration of metasurfaces as a multivariable optimization problem.Then, we propose a collaborative configuration scheme which leverages an alternate optimization technique.In each iteration, we formulate a semidefinite relaxation (SDR) [51] to relax the non-convex optimization into a convex optimization, which ensures traceability while guaranteeing performance.The resulting solution not only optimizes configuration of individual metasurfaces, but also wave propagation paths across metasurfaces, so as to achieve constructive combination at Rx.
The aforementioned collaborative configuration scheme assumes known channel information.However, two practical issues may break the assumption.(1) Deployment errors, i.e., actual locations of metasurfaces may deviate from the model, which causes inaccurate channel information.To address this issue, we observe that the robustness of the end-to-end channel model against the offset indicates the resilience of the metasurface configuration solution.We then propose a channel similarity ratio to guide the practical deployment.(2) Unknown Rx location.The Rx locations may vary over time.Fortunately, we can leverage the beam scanning capability of the metasurfaces to estimate the relative distance/angle of the Rx and then approximate the channel information.
We take a sub-6 GHz wireless network as an example to build an RFMagus prototype.Each metasurface operates at 2.4 GHz and 5 GHz, consists of 16×16 meta-atoms and spans an area of 0.35×0.35 2 .Each meta-atom embeds two PIN diodes and provides four "ON/OFF" states, which can act as a 2-bit phase shifter (e.g., 0, /2, , or 3/2).Extensive experiments demonstrate that RFMagus can achieve 13.31 dB average (up to 26.96 dB) signal strength improvement and 1.61× average throughput gain.RFMagus also works reliably and transparently for different wireless standards (e.g., Bluetooth, Zigbee, and Wi-Fi) and communication modes (e.g., SISO and MIMO) in complex radio environments.
The main contributions of RFMagus can be summarized as follows.To our knowledge, RFMagus represents first metasurface network that offers a promising paradigm to program complicated RF environments.RFMagus leverages a collaborative configuration scheme to optimize metasurface configuration and signal propagation path simultaneously.We have validated its effectiveness through comprehensive experiments, demonstrating its potential to significantly enhance communication capabilities in challenging environments.

A PRIMER ON RFMAGUS 2.1 Design Choices
Why take a sub-6 GHz wireless network as an example usage scenario?Modern IoT network protocols (e.g., Bluetooth, ZigBee, LoRa, NB-IoT) often rely on the sub-6 GHz spectrum.Although less vulnerable to blockage than high-frequency millimeter-wave networks, the sub-6 GHz networks still suffer from RF propagation artifacts in challenging environments, such as concrete structures [3,19], manufacturing sites [11,27], underground mines [40], tunnels [7,24], etc. Worse still, the majority of today's IoT devices have a small power budget.So, the IoT links can be severely hampered by obstacles such as metal shelves, cabinets, and concrete walls, which result in large performance variations and degradation across locations [55].Moreover, due to cost and form-factor constraints, IoT radios are often equipped with only one or two antennas, precluding them from MIMO diversity gains.
The networked metasurface in RFMagus can help extend coverage of IoT transmitters to hard-to-reach regions and enhance link capacity between weakly connected nodes.Our experiments focus on sub-6 GHz networks partly because low-frequency metasurfaces are easy to prototype and fabricate.
Why not rely on multi-hop/multi-path routing to configure the networked metasurfaces?Multi-hop/multipath routing schemes assume that we can use a graph model to represent the nodes and then configure each metasurface to point its beam towards desired upstream/downstream nodes.To unravel the performance of such schemes in comparison to RFMagus, we conduct a simulation experiment where a single Tx serves an Rx under the assistance of metasurfaces.We arrange three metasurfaces in the shape of an equilateral triangle with a distance of 3 m in between, while the distance between the Tx and metasurface is set to 0.5 m.For the multi-path routing, we consider all potential paths toward the Rx.Note that the weight of each edge between nodes is defined as the ratio of the beamforming gain and the path loss.For RFMagus, here we adopt the alternate optimization (Sec.3) to search for the optimal configurations, assuming accurate channel information.
Figure 2 depicts the SNR distribution across 30 Rx locations.For most cases, the SNR of the multi-hop/multi-path routing is 9-15 dB lower than that of RFMagus.We identify the following reasons: (1) The routing methods are typically based on the physical distance between nodes and the link quality gain of each node, without considering the beam patterns of the metasurfaces and the interaction between the electromagnetic waves.(2) Multi-hop routing leads to competition instead of collaboration between the metasurfaces.(3) Multi-path routing disregards the phase alignment across metasurfaces when beamforming towards the same Rx.Therefore, to unleash the potential of networked metasurfaces, advanced "electromagnetic wave forwarding" strategies are needed, which pass the analog signals from multiple metasurfaces to multiple other metasurfaces and eventually coherently combine them at the Rx.

System Model
In this section, we introduce the beamforming model of a single metasurface and then extend it to model the interactions between networked metasurfaces.

2.2.1
Beamforming by single metasurface.Consider a square metasurface comprised of M meta-atoms, as illustrated in Figure 3. RF signals propagate through different distances before impinging upon a metasurface.The phase vector due to the incident path can be expressed as      ,  1 =     ,  1 . = 2/, where  is the signal wavelength.    ,  1 is a distance matrix of the Tx and M meta-atoms on the metasurface, i.e.,     ,  1 = [  ,1 , ...,   , ].Suppose the desired direction of the emerging wave is (, ), where  and  are the elevation and azimuth angles, respectively.Then, the ideal emerging phase vector is given as: ACM MobiCom '24, September 30-October 4, 2024 Li, et al where  = sin  cos  and  = sin  sin .  and   are axis and  -axis distances of the  ℎ meta-atom relative to the origin of the coordinate.For beamforming to work, the phase of the signal reflected by all the meta-atoms must be the same.Thus, to redirect the incident signal to (, ), the metasurface should generate an ideal phase compensation of: (2) 2.2.2 Extending to multiple metasurfaces.For ease of exposition, we focus on the interaction between two cascaded metasurfaces.The model can be readily extended to multimetasurface cascades.
In this scenario, the incident signal of the next metasurface is from the previous metasurface's emerging wave.The emerging electromagnetic wave from the  ℎ meta-atom of MTS 1 propagates through a distance  , before reaching the  ℎ meta-atom of MTS 2 , so the phase caused by the distance between the two meta-atoms is:  , .Then, we can conclude the phase matrix between MTS 1 and MTS 2 is Therefore, the incident phase of MTS 2 can be written as       2 =      ,  1 +      1 +     1,  2 .Similarly, for the desired direction of the emerging wave from MTS 2 , denoted as (, ), the theoretical phase vector       2 is given and can be expressed in Eq. 1.So the ideal phase compensation of MTS 2 is       2 =       2 −       2 .Subsequently, the emerging electromagnetic wave from MTS 2 goes through a distance and is received by Rx.The phase can be expressed as:      =       2 +       2 +       2 , , where       2 , =      2 , and      2 , = [ 1, , ...,   , ].
Therefore, the end-to-end channel of the two-metasurface cascade case is given as: where } denote the diagonal phase compensation matrix for the MTS 1 and MTS 2 , respectively.(•) is the amount of signal attenuation due to path loss. =  = 256 in our system.

Practical
Issues.Although Eq. 4 can configure cascaded metasurfaces to beamform towards the Rx, it can not be directly applied to more complex collaborative strategies where multiple metasurfaces interact with multiple others.First, Eq. 4 assumes an ideal signal propagation.In reality, multipath effects can distort the channel information.Secondly, Eq. 4 disregards the cumulative phase error across the metasurfaces.Practical metasurfaces typically rely on phase shifters with limited resolution [13,30].In our prototype RF-Magus, each meta-atom is a 2-bit shifter with four possible phase states: 0,  2 , , or 3 2 .The phase shifters approximate the desired phase shift through a quantization rule: Therefore, each meta-atom inherently introduces phase quantization error, denoted as   =   −   , where   = Q 2bit  C .These phase errors accumulate as electromagnetic waves pass multiple collaborative reflections.Last but not least, deployment offset in practical implementation causes inaccurate distance information between nodes, which in turn distorts the model-based channel estimation that RFMagus uses to optimize the metasurface configuration.These practical issues must be carefully addressed for the networked metasurface collaboration to take effect.

OPTIMIZING THE CONFIGURATION OF NETWORKED METASURFACES
For ease of exposition, we first focus on a simple example case, i.e., collaboration between two metasurfaces, followed by a generalized description of multi-metasurface collaboration.Figure 4 illustrates a representative scenario where two metasurfaces collaborate so that the Rx, which falls in the NLoS region of Tx, can eventually be covered by Tx signals.It may also be the case that the Tx-Rx link is available but weak, and two metasurfaces together enhance the link quality.Without loss of generality, we assume Tx is the basestation or access point.The Tx and metasurfaces are all fixed with known locations, and the strategy of deploying metasurfaces is to make the field-of-views (FoVs) of multiple metasurfaces cover more areas while ensuring the LoS between metasurfaces.The Rx can be mobile, but for simplicity, we assume its location is known.We will discuss the practical situation with unknown Rx locations in Section 3.4.

A Two-Metasurface Collaboration Case
3.1.1Modeling the Multipath Channel among Networked Metasurfaces.In Figure 4, all channels to and from the metasurfaces (i.e., ℎ ℎ ℎ  ,  1 2 , ℎ ℎ ℎ   1 2 , , and ℎ ℎ ℎ   1 ,  2 ) are assumed to be Rician fading, which models a LoS path in conjection with many NLoS reflection paths.The channel between Tx and Rx (i.e., ℎ ℎ ℎ  , ) is assumed to be Rayleigh fading, as the Tx-Rx is fully blocked.Note that the channel can be modeled by Rician fading if the Rx falls within the LoS region of the Tx.Therefore, the channel ℎ ℎ ℎ   ,  between node   and node   can be expressed as follows: where    ,  is Rician factor for ℎ ℎ ℎ   ,  .We assume ḡ ḡ ḡ, =   (  ,   )    (  ,  ) and ĝ ĝ ĝ, are LoS and NLoS components in Rician fading channel, respectively.ĝ ĝ ĝ, is modeled by a complex Gaussian fading with zero mean and unit variance.We emphasize, unlike conventional per-packet channel estimation which must be sufficiently accurate to demodulate, this channel model is mainly used to characterize dominant modes of signal amplitude/phase distortion between nodes.Even a coarse model can guide metasurface collaboration.
Our focus is thus on the LoS path, plus the strong multipath components that can interact with the LoS.To this end, the Rician factor    ,  is vital.   ,  represents the relative strength of the LoS compared to the multipath.To approximate the    ,  , our key insight is that there is an intrinsic relationship between the property of the beam pattern and multipath effects.As illustrated in Figure 5, majority of the signal energy reflected by the metasurface is concentrated on the mainlobe, which points along the LoS by design.Whereas the sidelobes represent energy scattered due to multipath effects.Therefore,    ,  can be modeled by the magnitude ratio of mainlobe and sidelobes.In our RFMagus implementation, we only consider the strong sidelobes with a gain difference of less than 15 dB compared to the mainlobe.
The signal received at the Rx is given by:  = ℎ ℎ ℎ +  , where  and  represent the transmitted signals and received signals, respectively. is the additive white Gaussian noise (AWGN) with zero mean and variance  2 .The channel of networked metasurfaces is modeled as ℎ ℎ ℎ: 3.1.2Collaborative configuration scheme.The configuration scheme determines how the metasurfaces interact with each other and with the electromagnetic waves.Different configurations also determine how the RF signals propagate along the path(s) of multiple metasurfaces, which is crucial to the overall performance of RFMagus.The end goal of RF-Magus is to maximize the RSS at the Rx.Thus, RFMagus essentially needs to search for the optimized phase-coherent combination of each metasurface (i.e., ∠Φ Φ Φ   1 , ∠Φ Φ Φ   2 ) to improve the RSS towards Rx in Eq. 7.
However, based on the analysis in Section 2.2.3, the phase shifter quantization effect generates diverse phase errors among meta-atoms.When the metasurfaces engage in collaboration, cumulative phase errors may result in suboptimal or impaired system performance.A brute-force search to exhaust all configurations is impossible because the search space grows exponentially with the number of meta-atoms.
So, how to configure the metasurfaces with a low computational overhead?To solve this problem, we transform the multivariate optimization problem (i.e., optimizing the configurations of multiple metasurfaces simultaneously) into a univariate optimization problem (i.e., optimizing the configuration of a single metasurface at different time slices).Meanwhile, we calculate and compensate for quantization-induced phase errors during the optimization process.Specifically, we formulate the optimization problem as follows: The constraints in Eq. 8 are the range of boundary constraints for the continuous phase values of each meta-atom on MTS 1 and MTS 2 , respectively.
RFMagus adopts an alternate optimization technique to iteratively update each univariate until the ||ℎ ℎ ℎ|| 2 is maximized.We first randomly generate the continuous phase compensation of       1 and       2 for MTS 1 and MTS 2 , respectively.Next, we fix the       2 and optimize the continuous phase compensation of MTS 1 to  *  *  *    1 .We then quantize  *  *  *    1 using Eq. 5. We update the discrete phase compensation  2 ( *  *  *    1 ) →       1 and optimize the  *  *  *    2 .It is noted that we have quantified the  *  *  *    1 , so the phase error induced by quantification is a concern when optimizing  *  *  *    2 .Finally, we repeat the aforementioned steps until ||ℎ ℎ ℎ|| 2 converges.For each step of the iterative update, inspired by [51], we use semidefinite relaxation (SDR) to convert the non-convex problem of metasurface configuration optimization into a convex problem by relaxing the constraints, which can guarantee the convergence of the RFMagus' algorithm (Figure 6).Due to the relaxation, SDR may not provide the optimal solution to the objective function (in Eq. 8).Yet it strikes a balance between computational efficiency and solution quality.While verifying the output of the algorithm as the optimal solution is challenging, our extensive experiments demonstrate that RFMagus consistently achieves commendable performance with the current solutions (Section 6).In our implementation, we use an existing convex optimization software, CVX, to solve the convex optimization problem and obtain high-quality configurations 1 .The convergence time for two metasurfaces on an i7 11800H@2.30GHzlaptop typically spans seconds.
It is important to note that the optimized metasurface configurations based on Eq. 8 also optimize the propagation paths across all the metasurfaces.This is because each metasurface configuration generates a beam pattern corresponding to a set of signal propagation paths in space.Meanwhile, the configurations determine whether the paths will combine in a phase-coherent manner when arriving at the "next-hop".Ultimately, the optimization framework ensures that the signal paths are constructively combined at the Rx after traversing all or an optimized subset of metasurfaces.
The path loss caused by the "multiplicative fading" effect is present in scenarios with or without metasurfaces, such as when electromagnetic waves reflect off walls or metasurfaces.In our system, we compare the SNR improvement with and without metasurfaces.The path loss in both scenarios remains consistent.The SNR gain obtained by RFMagus results from the metasurfaces' beamforming effects, along with the phase-coherent combination of electromagnetic waves across metasurfaces which harnesses the previously unused multipath in the environment.The theoretical SNR gain of a networked metasurface when two metasurfaces collaborate can reach up to 31 dB (calculated in Eq.8).However, we find that the measured average SNR gain has about 15 dB attenuation compared to simulated results due to the real path loss and hardware imperfection of metasurface, PIN diodes, and the transmitter's antenna.

Generalization to More Metasurfaces
System model.We now generalize the above metasurface configuration scheme to multiple metasurfaces (in Figure 7).For simplicity, we define a node set  = { 0 ,  1 ,  2 , ... +1 }, where  0 denotes the Tx,  +1 the Rx, and the rest are metasurfaces.The channel ℎ ℎ ℎ   ,  between node   and node   can be expressed as Eq. 6.The end-to-end channel of multiple 1 Besides CVX, other convex optimization methods are also applicable, such as the Alternating Direction Method of Multipliers (ADMM).
(Rx)  Φ * Φ *   ) → Φ Φ Φ   ; Calculate ||ℎ ℎ ℎ|| 2 ; end for end while metasurfaces collaboration can be written as: where ℎ ℎ ℎ  is the channel of an available path from Tx to Rx.  ℎ is the number of available paths. is an array that consists of  metasurfaces in the  ℎ path, where  ≤ . is the index of elements in .
Collaborative configuration scheme for multiple metasurfaces.RFMagus controls the channels by configuring the metasurfaces.Therefore, after obtaining the channel information between different nodes, the aforementioned collaborative configuration scheme (in Sec.3.1.2)can be directly used to optimize the configurations and the propagation path for multiple metasurfaces.Maximizing ||ℎ ℎ ℎ|| 2 equivalently maximizes the RSS.The objective function is thus: RFMagus employs an iterative approach to configuring each metasurface in a loop until ||ℎ ℎ ℎ|| 2 converges.More details are presented in Algorithm 1.
Preliminary validation.We conduct a preliminary simulation experiment to verify the system performance using the above optimized configuration scheme.We arrange 3 metasurfaces in the shape of an equilateral triangle with a distance of 3 m in between, with the Tx separated by 0.5 m from the nearest metasurface.Figure 8 depicts the SNR improvement across 15 Rx locations.We see that as the number of meta-atoms in each metasurface increases simultaneously, the end-to-end SNR gain quickly increases.However, the gain tends to saturate afterward.This is because more metaatoms on the metasurface lead to a narrower beam pattern.The narrower beam from the "last-hop" metasurface might not fully cover the surface area of the "next-hop" metasurface, causing some regions to receive weaker signals.
For simplicity, the above metasurface configuration model assumes a single carrier frequency.However, the configuration can also be used in practical wideband communication systems, albeit at a slight performance degradation.As an example, we repeat the simulation for a 20 MHz wideband signal in the 5 GHz spectrum.Our experiments reveal that the performance of one single metasurface system and 3metasurfaces collaboration system drops by around 3% and 12%, respectively.The issue may be mitigated using advanced multi-band metasurface optimization method, such as [30].
Our current RFMagus design focuses on a single receiver.One potential solution is to create multi-armed beams towards multiple receivers.Alternatively, the metasurfaces can serve different users in a time-multiplexed manner.This is left for our future exploration.

Tolerating Deployment Offset
In practical implementation, the deployment locations of the metasurfaces may not exactly match those in the channel model.Fortunately, we observe that the metasurface configuration will remain robust as long as the end-to-end channel does not change significantly, given the deployment offset.This is simply because similar end-to-end channels entail similar metasurface configurations based on the analysis and optimization method in Sec.3.2.
For simplicity, we assume one metasurface has deployment offset.The extension where multiple metasurfaces have   deployment offsets can be directly accommodated.In Figure 9(a), suppose end-to-end channel without deployment offset is ℎ ℎ ℎ = ℎ ℎ ℎ  ,  Φ Φ Φ   ℎ ℎ ℎ  , .Due to deployment offsets, the channel becomes ĥ ĥ ĥ = ĥ ĥ ĥ, Φ Φ Φ   ĥ ĥ ĥ, , where ĥ ĥ ĥ, = (•)  (    ,  , d ) , ĥ ĥ ĥ, = (•)  (    , , d ) , d is the distance offset. (•) is the distance function.Here, we propose to use channel similarity ratio (CSR) to quantify the similarity between ground truth channel and offset channel: From Eq. 11, we can see CSR indicates a trade-off between system performance and deployment offset.A lower CSR generally corresponds to superior performance, as it signifies a higher degree of similarity between modeled and actual channel.
To validate the effectiveness of CSR, we conducted both simulation and real-world experiments.We set Tx-metasurface distance to 1 m and direction of the incident wave perpendicular to the metasurface.The distance between the Rx and the metasurface is 3 m.The direction of the emergent wave focuses on (0 • , 30 • ), and Rx is located in the same direction.We vary the metasurface deployment offset (i.e., d ) from -20 cm to 20 cm along Y-axis and from -6 • to 6 • rotate by Y-axis and Z-axis, respectively.Here, the positive/negative signs indicate a shift or rotation to the left/right or up/down.In Figure 9, we can see the system experiences only a 3 dB degradation when the offset or rotation reaches -6 cm or 6 cm or -3 • to 3 • , respectively.The results not only confirm the effectiveness of CSR but also underscore the substantial tolerance of the system to deployment errors.This is because the beamforming of the metasurface involves the cooperation of many meta-atoms, which means not all the meta-atoms on the metasurface lose effectiveness simultaneously when there is an offset in the deployment.This spatial diversity allows for adaptability, enabling the system to defend against the effects of metasurface offsets.Note that, due to the influence of multipath, the simulation and experiment results are slightly different, but the profile remains consistent.The aforementioned multi-metasurface configuration method models the end-to-end channel based on all node locations.Although RFMagus knows the locations of the metasurfaces and Tx beforehand based on prior knowledge, the Rx location may be unknown and vary over time in practice.

Configuration for Unknown User Locations
To overcome this problem, we propose to use approximated spatial information to guide the metasurface configuration.Specifically, if we can estimate the distance and direction of the Rx relative to the metasurfaces, then the channel information can be approximated through Eq. 6 and again apply the collaborative configuration scheme in Section 3.2.Following this principle, RFMagus offers two working modes: (i) Location-based Mode.When the Rx falls in the intersection of multiple metasurfaces' field-of-views (FoVs), we can use any two of such metasurfaces to localize the Rx.Specifically, as shown in Figure 10(a), each metasurface can leverage its beam scanning capability to search the Rx.We then use the beam direction with the maximum RSS reported from Rx to approximate the direction of the Rx relative to the metasurface.More details are described in Section 4. Since the metasurfaces' locations are known a priori, we can determine the Rx location using a trigonometric model as follows: where  11(a).We randomly select 10 locations to measure the angle of Rx.The corresponding cumulative distribution function (CDF) is shown in Figure 11(b).The minimum, median, and maximum AoA errors across all locations are 0 • , 1 • , and 3 • , respectively, which verifies the accuracy of the method.The residual AoA error is due to two factors: 1) slight differences in the mainlobe width of different directions caused by hardware and configuration differences, and 2) wider beamwidth of the mainlobe when the beamforming direction is towards the boundary of FoV, leading to ambiguity in RSS.
Tolerance ratio: AoA measurement errors may compromise the channel information, thus causing configuration bias.Fortunately, the typical beamwidth of the metasurfaces is wide enough to tolerate such errors.Here, we use a tolerance ratio metric   to represent the counteracting effect of beamforming on the AOA measurement error:   =     , where   is the angular error between AoA measurement and the ground truth.  is the mainlobe beamwidth.  < 1 represents the mainlobe beamwidth is larger than the angular error, which means the beamforming can effectively counteract the AOA measurement error.As an illustration, we run an experiment to evaluate the   in practical settings.Figure 11(a) shows the setup, where we deploy three metasurfaces and use two of them to localize the Rx over 10 random locations.Figure 12 demonstrates that: (1) The tolerance ratio is consistently less than 1, which means the measured angular error is obviously smaller than the mianlobe beamwidth of beamforming; (2) The metasurface's beamforming capability proves resilient against localization offset, which allows the Rx to work in a wider range.
(ii) Direction-based Mode.In cases where only one metasurface can reach the Rx, beam scanning can only help estimate the relative angle of the Rx.Direct modeling of the channel between the metasurface and the Rx is no longer feasible due to a lack of distance information.To overcome this issue, as shown in Figure 10(b), we note that the single supporting metasurface can be configured to beamform towards the Rx direction (Section 2.2.1).RFMagus then deems this supporting metasurface as a virtual Rx and again applies the configuration method in Section 3.2 to obtain the optimized configuration for all the other metasurfaces.
We conduct an experiment to illustrate the effectiveness of the method.The deployment layout is shown in Figure 13(a).Here, the Rx can only be supported by MTS 2 .The angle of Rx varies from −50 • to 50 • , and the distance of Rx varies from 0.8

SYSTEM WORKFLOW
We now summarize the system workflow of RFMagus.Similar to existing metasurface-based wireless communication systems [14,16,18,29], we assume a central controller can remotely configure the metasurfaces through a separate control channel, possibly based on low-rate and long-range radio interfaces such as LoRA.The controller of RFMagus knows the locations of metasurfaces before.The controller executes computational models in Sec. 3. In case when Rx is mobile, and the Rx also needs to establish a similar control channel with controller to periodically report its RSS (Sec.3.4).
During the data transmission stage, RFMagus first runs the location-or direction-based mode (Sec.3.4) to estimate the Rx location.It repeats this periodically, based on how often the Rx location changes over time.Given the Rx's location or angle information, along with the fixed Tx's and metasurfaces' locations, it runs the metasurface configuration optimization (Sec.3).To limit the computational latency, RFMagus can precompute the optimal metasurface configurations to build a look-up table.At runtime, it can directly map the estimated Rx location/angle to the optimal metasurface configurations.Note that RFMagus has intrinsic tolerance to the Rx location/angle estimation errors (Sec.3.4).So the performance will not be significantly impacted even if the look-up table only quantizes the locations into discrete grids.
To accommodate Rx nodes with unknown locations, the controller needs a simple protocol to coordinate the metasurfaces for location/angle estimation.First, it sequentially activates  metasurfaces to perform beam scanning using coarse, wide beams.The signal processing is done by the Rx which then reports its RSS to the controller.For example, consider a scenario where, upon receiving a packet under a particular configuration, the receiver embeds one bit inside its acknowledgment (ACK) to inform the controller whether the RSS has increased or not compared with the previous configuration, i.e., bit 1 and 0 represent increase and decrease, respectively.The controller then picks 2 metasurfaces with the strongest average RSS to perform fine-grained beam scanning, using narrower beams that evenly span each metasurface's FoV.The location/angle of the Rx and metasurface configurations are then determined following Sec.3.4.The end-to-end localization latency includes beam scanning latency and the feedback latency of per-beam signal strength.The latency varies based on controller hardware and feedback latency, e.g., for each configuration, 1MHz FPGA Kintex 7 takes 32us, while STM32H743IIT6 takes 660us.A Gigabit Ethernet or (e.g., 100Kbps) feedback channel between the controller and the metasurfaces yields a feedback overhead of only about 30ns or below 3.2ms, respectively.

IMPLEMENTATION
Metasurface Prototype.RFMagus is implemented on dualband metasurfaces operating at 2.4 GHz and 5 GHz frequency bands.Each metasurface has a total area of 0.35×0.35 2 and consists of 16 × 16 meta-atoms separated by 19.5 mm.To ensure the reconfigurability of the metasurface, two PIN diodes (SMP1340-040LF [1]) are embedded into each metaatom.As a result, each meta-atom can act as a 2-bit shifter, with 4 possible phase shift values of 0, /2, , and 3/2, depending on bias voltage (0 V/5 V) applied to the PIN diodes.We carefully optimize the material and geometric parameters of the meta-atoms so that RFMagus metasurface can work across the two bands.From Figure 14, we see that the phase difference between each state is about /2 at 2.4 GHz and 5 GHz frequency bands, which means metasurface can provide four phase states (i.e., 0, /2, , 3/2).From Figure 15, we observe the reflection loss is larger than -3 dB in each stage at two separated frequency bands, implying the meta-atom causes negligible reflection loss in either ON or OFF state.
Meta-atom control.To independently control each metaatom, we employ a microcontroller (i.e., STM32H743IIT6 from STMicroelectronics) and 64 SN74LV595 shift registers to provide different DC voltages (0 V/5 V) for PIN diodes.We divide 256 meta-atoms into 16 groups, and each group has 4 shift registers which serially control 32 meta-atoms.
Experimental setup.For controlled experiments, we use two USRP N210 software-defined radios with UBX-40 daughterboards as the Rx and the Tx, respectively.We conduct extensive experiments in different indoor environments.In the default experimental setting, we use the 2-metasurface topology.We set the Tx-MTS 1 distance as 0.5 m, metasurface 1metasurface 2 distance as 3 m, and MTS 2 -Rx distance as 3 m.All devices are placed at a height of 1.1 m. Figure 16 is    Case 0 represents the metasurfaces in the "OFF" state.In this case, the SNR gain at the receiver is contingent upon reflection and transmission within the space.Conversely, when the metasurfaces are activated (Case 1/2/3), RFMagus achieves beamforming by aligning the phase of electromagnetic waves toward the desired direction.Figure 17(b) shows the SNR results for all 4 cases.Specifically, the SNR gain ranges from 5 to 15 dB as we increase the number of metasurfaces from 1 to 4. The results imply that networked metasurfaces can indeed boost communication performance in practical scenarios.

Overall Performance
To verify the system-level performance of RFMagus, we place multiple metasurfaces in an irregular fan-shaped conference room, as shown in Figure 18(a).The Tx and 4 metasurfaces are fixed at different locations.We measure the SNR when Rx is located over 20 random positions.Tx and Rx are the omnidirectional antenna.The results are shown in Figure 18(b).RFMagus exhibits a large capacity gain when the metasurfaces are "ON".For example, the 80th percentile of SNR is 18 dB and 23 dB when metasurfaces are "OFF" and "ON", i.e., RFMagus achieves an improvement of 27% on the SNR.Overall, the results imply that RFMagus can effectively boost the SNR through its networked metasurfaces.

Communication Performance
6.3.1 Performance in 3D scenarios.In experiment, we verify the performance of RFMagus in practical 3D scenarios.
Figure 19(a) shows the deployment layout, where 2 metasurfaces are used.The Rx is located at 5 positions in 3D space, where its height (i.e. the z-coordinate) ranges from 40 cm to 2.4 m above the ground, and the x-coordinate and ycoordinate are fixed.Equivalently, the Rx's elevation angles vary from −20 • to 35 • while the azimuth is fixed at 0 • .We measure SNR across 5 Rx positions.Figure 19(b) illustrates the results.With metasurfaces "ON", the Rx experiences a large SNR improvement of 3.59 to 9.93 dB.The largest SNR improvement occurs when the elevation angle is 0 • (i.e., the height is 1 m), where the mainlobe of the 3D beamforming has the maximum signal power.When Rx is located close to the ground, the reflected multipath is stronger, resulting in a relatively large SNR even when the metasurfaces are "OFF".

Performance across different IoT devices and protocols.
Here, we evaluate the throughput of RFMagus across different IoT devices and communication modes in a corner NLoS scenario, as shown in Figure 20(a).
Different IoT devices.Recall that RFMagus can be transparent to existing IoT communication standards.We verify this property through three kinds of IoT radios, i.e., Zigbee 3.0 with CC2530 radio, BLE 5.0 with CSRBC417 radio, and 2.4 GHz Wi-Fi with ESP32 radio.All IoT devices use the SISO communication mode.Figure 20(b) shows the throughput when metasurfaces are "ON" and "OFF", where "A∼C" indicates the results of three kinds of IoT devices.As we can see, with metasurfaces "ON", there is a consistent and notable throughput improvement (up to 33.69%) for all IoT devices.
SISO and MIMO modes..We evaluate the throughput performance in SISO and MIMO communication modes.We use two laptops equipped with AR9580 802.11n wireless NIC as transmitter and receiver, each with 3 antennas.We change the communication mode among 1 × 1 SISO, 2 × 2 MIMO and 3 × 3 MIMO, and use the iperf toolbox to collect throughput measurements.The results are shown in Figure 20(b), where "D∼F" indicate the throughput of different communication modes.We have two observations.First, for the SISO mode, RFMagus successfully enables the communication between Tx and Rx since they can not directly reach each other (e.g., throughput is N/A) when metasurfaces are off.Second, for the MIMO mode, RFMagus can achieve an average throughput improvement of 2.76 Mbps and 5.18 Mbps for 2×2 and   3×3 modes, which correspond to an improvement of up to 60.74% compared with baseline (i.e., metasurfaces "OFF").
Overall, RFMagus not only can enhance the coverage and link capacity of different IoT devices but also is transparent to their protocols and communication mode.

Supporting bidirectional communication.
Owing to the reciprocity of the electromagnetic wave propagation, the metasurface configurations optimized for the downlink (Tx-Rx) can similarly apply to the uplink (Rx-Tx).In this experiment, we evaluate such bidirectional communication by using a three-metasurface scenario as an example (Figure 21).Specifically, MTS 2 is deployed along the 30 • angle relative to MTS 1 with a 3 m separation.The Rx is close to MTS 2 , and there are 21 test locations for it.For each Rx's test location, we measure the SNR of uplink (i.e., from Rx to Tx) and downlink (i.e., from Tx to Rx) when metasurfaces are "ON" and "OFF", respectively.Figure 21(a) shows most test locations have a low SNR when metasurfaces are off.In contrast, the SNR of most locations is improved significantly when metasurfaces are on (in Figure 21(b)).The average SNR improvement is 13.31 dB and 13.09 dB for uplink and downlink, respectively.The results demonstrate RFMagus can seamlessly facilitate uplink communication even though its optimization scheme assumes downlink channel defaultly.6.3.4Temporal stability.We now evaluate RFMagus temporal stability by generating a set of events around the communication link.We intentionally create various stationary blockers and dynamic environmental changes so as to vary the multipath environment, as illustrated in Figure 22(a).From the results in Figure 22(b), We can see that small changes in the environment (involving tables, chairs, etc.) hardly affect RFMagus' performance.When a large, strong reflector (metal cabinet) is placed in close proximity to the metasurface (i.e.,0 cm), the improvement of signal strength decreases notably by 4.8 dB.In addition, when human movement occurs without occluding the LoS path between the nodes (i.e., the distance between the human and LoS path is about 80 cm ), RFMagus can sustain high performance; Otherwise, the performance experiences a notable drop, about 7 dB.The extreme cases occur when a LoS path is attenuated significantly by dynamic blockers or a strong sidelobe from the metasurface is enhanced by a strong reflector.Dealing with such cases will entail more vigilance to the ambient reflectors.We expect existing solutions in sensing-assisted mmWave link adaptation may be applicable [46,48].But this is beyond the scope of the present work.

Performance under user mobility
We now examine the performance of RFMagus in mobile scenarios.As shown in Figure 23(a), we move the Rx along a predefined 3 m trajectory with two constant speeds: 0.5 m/s (slow) and 1.0 m/s (normal).In each case, RFMagus configures two metasurfaces in real time to accurately beam the reflected signal towards Rx. Figure 23 (b) and (c) show the real-time SNR measurements at the Rx.When metasurfaces are "ON", RFMagus can consistently achieve an improved SNR for both speed settings, compared to the baseline when metasurfaces are "OFF".These results demonstrate RFMagus can work well for indoor human mobility scenarios.We leave the exploration of high-speed scenarios as future work.

Impact of System Parameters
Incident power.In this experiment, we sweep through different Tx power settings to understand how incident power affects the performance improvement of RFMagus.We use capacity enhancement as the metric, which is calculated based on the SNR and channel bandwidth.The distance between the Rx and the metasurface is set as 10 m.We increase the incident power from 1 dBm to 30 dBm.From Figure 24, we can see that the improvement of channel capacity is relatively stable and does not change with the Tx power since RFMagus enhances SNR gain by aligning the phase of electromagnetic waves without any active power amplifiers.This implies that no sophisticated gain control is needed on the metasurfaces, unlike traditional radio receivers.
In reality, the distance and relative angle between Tx and metasurface may change.Thus we explore the impact of different Tx-metasurface distances and angles on the system performance.We conduct experiments in two cases (i.e., impact of distance and angle) for measuring SNR when metasurfaces are "ON" and "OFF".
Tx-metasurface distances.In experiment, we place the Rx 0.5 m away from MTS 1 and deploy MTS 2 along the 30 •  Li, et al    We can clearly see the SNR improvement compared to the baseline (i.e., metasurfaces off).The observations confirm the utilization of metasurfaces consistently improves SNR.
Tx-metasurface angles.In this experiment, we move the Tx along a semicircle (2 m radius) from 0 • to 80 • with a step of 10 • , as shown in Figure 26(a).From the measurement results in Figure 26(b), we observe that RFMagus can effectively improve the SNR when the incident angle varies from 0 • to 70 • .However, the SNR improvement diminishes when the angle is more than 80 • since the metasurfaces' FoV is narrower than half-space, and incident wave is almost parallel to the metasurface.When the metasurfaces are off, they are no different from ambient reflectors that cause multipath reflections, so the SNR at the Rx varies with different Tx-metasurface incident angles.
Metasurface-to-metasurface distances.The distance between metasurfaces may vary in real settings due to physical deployment constraints.To evaluate the impact, we fix the relative angle between two metasurfaces and increase their distance from 2 m to 10 m with a step size of 1m by moving the MTS 2 together with the Rx, as illustrated in Figure 27(a).Note that the distance (1 m) and angle (45 • ) between Rx and MTS 2 remain unchanged.The results are shown in Figure 27(b).Compared to the baseline when the metasurfaces are "OFF", RFMagus consistently improves the SNR even when the distance between metasurfaces is up to 10 m.This is because the beamforming coverage expands in a fan-like pattern as the distance increases.This allows the beam emitted from the "last-hop" metasurface to fully cover the smaller surface area of the "next-hop" metasurface.
Metasurface-to-metasurface angles.To evaluate the impact of the angle between metasurfaces, we change the angle (i.e.,  in the Figure 28

RELATED WORK
Wireless relays.To extend the wireless coverage, a straightforward solution is to deploy amplify-and-forward relays [2,8,25].For example, MoVR [2] employs such relays to enable mmWave links to detour blockage and adapt to mobility.FastForward [8] uses full-duplex relays to constructively forward signals.Yet, when applying to a new wireless standard, these approaches require unwieldy modifications to the network protocol stack or radio hardware, which is cumbersome and induces high implementation costs.In contrast, RFMagus is a standard-agnostic and cost-effective solution.Unlike traditional relays, it obviates the need for sophisticated selfinterference cancellation circuits and power amplifiers.
An alternative way of extending wireless coverage is to deploy many access points (APs), which are essentially digital decode-and-forward relays forming a mesh network [37,38,43,50].Such methods require more sophisticated hardware for the PHY layer and interference management protocols on the MAC layer.In contrast, RFMagus metasurfaces do not generate RF signals themselves and act like RF mirrors which reshape analog channel between transmitter and receiver.
RFMagus: Programming the Radio Environment With Networked Metasurfaces ACM MobiCom '24, September 30-October 4, 2024 The metasurfaces do not suffer from self-interference, then, no separate interference management protocol is needed.Metasurfaces and intelligent reflecting surfaces.Metasurfaces consist of many periodic and artificial meta-atoms [20,28,33,34,53].Each meta-atom can manipulate the phase of impinging electromagnetic waves, and beamform or resteer the EM signals toward an intended direction so as to extend the network coverage.For example, Li et al. [31] use an 81-element single-layer reflect-array to perform reflective beamforming.MilliMirror [42] introduces a 3D printed metasurface to resteer mmWave beams to illuminate coverage blind spots.However, the beamforming patterns are fixed at manufacturing time and cannot be dynamically adjusted.Recent studies proposed to add electronic components (i.e., varactors [10,14,21] or PIN diodes [52,56,57]) into the metasurface.For instance, ScatterMIMO [16] uses an area-efficient surface to enhance the MIMO channel conditions and link capacity.RFlens [18] uses 256 dedicated meta-atoms as 1-bit phase shifters to achieve beamforming.These methods only support one round of resteering and reshaping of the RF signals, and cannot arbitrarily scale the coverage region.
In contrast, RFMagus leverages networked metasurfaces to overcome such deficiencies.Many existing standalone metasurface designs can potentially be transformed into networked metasurfaces based on the mechanisms in RFMagus.
Coordinating multiple metasurfaces.A few recent systems use multiple metasurfaces to enhance wireless link quality [23,26,35,39,54].For example, Han et al. [23] utilize two metasurfaces to enhance the capacity of the LoS channels.Huang et al. [26] use multiple metasurfaces to establish multi-hop links which detour LoS obstruction.However, existing multi-metasurface systems only focus on theoretical modeling and simulation verification.By contrast, RFMagus is the first to build practical networked metasurfaces and conduct extensive end-to-end experiments to evaluate their effectiveness.In addition, to select the optimal set of cascaded metasurfaces, prior systems [5,36,47] mainly leverage graph theoretic solutions such as the shortest-path algorithms.Such algorithms still treat the metasurfaces the same way as classical multi-hop relays which handle digitized packets.Yet, to achieve optimal performance, multiple metasurfaces may need to form sophisticated radiation patterns to pass the signals in parallel to multiple other metasurfaces, which cannot be represented by the graph models.

DISCUSSION AND FUTURE WORK
Channel model and channel estimation.RFMagus uses a simple channel model to optimize the metasurface configurations.Direct estimation of the channel between metasurfaces relies on the dedicated transceiver hardware, conflicting with the simplicity and passive operation of metasurfaces.It also induces prohibitive measurement latency resulting from the high-dimensional channel matrices -with dimensions scaling in proportion to the number of metaatoms comprising the metasurface network.Recently, many researchers have attempted to achieve a low-complexity optimal channel estimation protocol [44].Adopting these methods to improve the ability to characterize the channel information in RFMagus is our future work.
Multiple users.RFMagus can potentially leverage Time Division Duplex (TDD) method to support multiple transmittersreceivers simultaneously.How to support multi-users at the same time in the networked metasurface is a new field [56,59].In future, we will look into integrating some of the recent advances in this line of research into RFMagus.
Deployment strategy.The current deployment strategy of RFMagus is to make the FoVs of multiple metasurfaces cover more areas effectively while ensuring the LoS between metasurfaces.How to improve the performance of networked metasurfaces by carefully designing a deployment strategy in a complex and demanding environment is a new, challenging, open problem.Recent research investigated similar problems of metasurface deployment [6,17].For example, the ray tracing-based wireless channel model method [17] can be used to model the wireless environment and optimize the locations of metasurfaces.As future work, we will look into integrating some of the recent advances in this line of research into RFMagus.

CONCLUSION
This paper presents RFMagus, the first RF environment reshaping paradigm based on a metasurface network for expanding the NLoS RF coverage.By designing the collaborative configuration scheme, RFMagus can simultaneously achieve optimized metasurface configuration and optimized path selection among a cascaded set of metasurfaces to reach the destination region.RFMagus is transparent to IoT devices and protocols.RFMagus can also be generalized to different frequency bands and different PHY layer technologies.Field study shows that RFMagus can enable 13.31 dB average signal strength improvement (up to 26.96 dB).

Figure 6 :
Figure 6: The convergence of the RFMagus algorithm.

Figure 9 :
Figure 9: Illustration and experimental results of CSR.
Localization based mode.

Figure 10 :
Figure 10: Two working modes of metasurface configuration based on spatial information.
The CDF of AoA error.

Figure 11 :
Figure 11: The performance of AoA measurement.

Figure 13 :
Figure 13: The performance of direction-based mode.

Figure 19 :
Figure 19: The performance under the 3D scenario.

Figure 20 :
Figure 20: Results across different IoT devices and protocols.

Figure 21 :Figure 22 :
Figure 21: The performance of uplink and downlink.

Figure 23 :
Figure 23: The experimental results under different walking speeds.
(a)) between MTS 1 and MTS 2 from 0 • to 60 • while fixing their distance as 3 m.The Rx-MTS 2 distance is 3 m.The results in Figure 28(b) imply that RFMagus is robust to different angle setups between metasurfaces and achieves a consistent SNR gain.However, the improvement diminishes as the boundary is approached since each metasurface has a limited FoV (i.e., [−60 • , 60 • ]).
and   =    −    .   and    represent the AoA between node   , node   , and Rx, respectively.   and    represent the angle between node   , node   , and the normal line, respectively.   ,  represents the center-to-center distance between node   and node   .Here, ,  ∈ [1, ].Additionally,    , +1 and    , +1 represent the distances between the center of node   , node   , and Rx.