Application: The Two-Way Relay Channel

The Canonical CF Application

The simplest setting that exposes what compute-and-forward actually buys is the two-way relay channel (TWRC): two users AA and BB want to exchange messages via a single relay RR, with no direct link between AA and BB. This captures everything from a cellular uplink-downlink pair via a base station through a satellite-mediated terrestrial link to two nodes communicating through an amplifier in a sensor network. Three strategies compete: classical routing (four orthogonal time slots), amplify- or-decode-forward (two slots with a MAC-then-broadcast split), and compute-and-forward (two slots, relay decodes the XOR or sum).

The punchline (Nam-Chung-Lee 2010): on a symmetric TWRC, CF achieves the capacity region within 12\tfrac{1}{2} bit per user, matching the best-known upper bound up to a constant gap. Neither AF nor DF does this — AF loses the full MAC gain to noise amplification; DF spends one slot decoding two messages it will immediately combine anyway. CF bypasses both failures by never decoding the individual users in the MAC phase. Zhang-Liew-Lam's 2006 physical-layer network coding (PNC) was the intuitive precursor; the Nazer-Gastpar framework is the rigorous generalisation. This section derives the TWRC rate region, compares strategies quantitatively, and sets up §4's identification of PNC as the integer-coefficient a=(1,1)T\mathbf{a} = (1, 1)^T case.

,

Definition:

Two-Way Relay Channel

The Gaussian two-way relay channel (TWRC) consists of three nodes:

  • Two users AA and BB, each with a message uA\mathbf{u}_A or uB\mathbf{u}_B to send to the other.
  • A relay RR with no message of its own.

Communication proceeds over two time slots:

Slot 1 (multiple-access phase). Both users transmit simultaneously: yR  =  hAxA+hBxB+wR,\mathbf{y}_R \;=\; h_A \mathbf{x}_A + h_B \mathbf{x}_B + \mathbf{w}_R, with per-user power PP and wRN(0,I)\mathbf{w}_R \sim \mathcal{N}( \mathbf{0}, \mathbf{I}). The relay computes some function of (uA,uB)(\mathbf{u}_A, \mathbf{u}_B).

Slot 2 (broadcast phase). The relay transmits xR\mathbf{x}_R at power PRP_R to both users: yA=gAxR+wA,yB=gBxR+wB.\mathbf{y}_A = g_A \mathbf{x}_R + \mathbf{w}_A, \qquad \mathbf{y}_B = g_B \mathbf{x}_R + \mathbf{w}_B. Each user then recovers the other's message using its own self-knowledge (e.g., uA\mathbf{u}_A XOR uB\mathbf{u}_B XOR uA\mathbf{u}_A = uB\mathbf{u}_B). A rate pair (RA,RB)(R_A, R_B) is achievable if both users eventually decode their target message with vanishing error.

,

TWRC Strategies: Symmetric Sum-Rate at SNR=20dB\text{SNR} = 20\,\text{dB}

StrategySlotsRelay functionSum-rate (bits/ch. use)Gap to cap.
Routing (4 slots)4 orthogonalRelay decodes each user separately12log2(1+SNR)/21.66\tfrac{1}{2} \log_2(1+\text{SNR}) / 2 \approx 1.66Huge
Amplify-and-forward2 (MA+BC)Relay scales yR\mathbf{y}_R and rebroadcasts12log2(1+SNR2/(2SNR+1))3.20\tfrac{1}{2} \log_2(1 + \text{SNR}^{2}/(2\text{SNR}+1)) \approx 3.20Medium
Decode-and-forward2 (MA+BC)Relay decodes both messages and XORsmin{12log2(1+SNR),14log2(1+2SNR)}3.33\min\{\tfrac{1}{2}\log_2(1+\text{SNR}), \tfrac{1}{4}\log_2(1+2\text{SNR})\} \approx 3.33Medium
Compute-and-forward2 (MA+BC)Relay decodes uA+uBmodΛ\mathbf{u}_A + \mathbf{u}_B \bmod \Lambda2R(h,(1,1))23.16=6.322 \cdot R(\mathbf{h}, (1,1)) \approx 2 \cdot 3.16 = 6.321/2\le 1/2 bit/user
Capacity upper bound2(cut-set)log2(1+SNR)6.66\log_2(1 + \text{SNR}) \approx 6.66

Theorem: Nam-Chung-Lee: CF Is Within 1/2 Bit of TWRC Capacity

Consider the symmetric Gaussian TWRC with hA=hB=1h_A = h_B = 1, gA=gB=1g_A = g_B = 1, and common user power PP and relay power PRP_R. Let SNR=min(P,PR)\text{SNR} = \min(P, P_R). The capacity region of this channel satisfies CTWRC(SNR)    {(RA,RB):RA12log2(1+SNR),  RB12log2(1+SNR)}\mathcal{C}_{\rm TWRC}(\text{SNR}) \;\subseteq\; \{(R_A, R_B) : R_A \le \tfrac{1}{2} \log_2(1 + \text{SNR}), \; R_B \le \tfrac{1} {2} \log_2(1 + \text{SNR})\} (the cut-set bound), and the compute-and-forward strategy with integer coefficient a=(1,1)T\mathbf{a} = (1, 1)^T in the MA phase achieves the rate pair (12log2+ ⁣(12+SNR),12log2+ ⁣(12+SNR)),\left( \tfrac{1}{2} \log_2^+\!\left(\tfrac{1}{2} + \text{SNR}\right), \tfrac{1}{2} \log_2^+\!\left(\tfrac{1}{2} + \text{SNR}\right)\right), in each direction — within 12\tfrac{1}{2} bit per user of the cut-set bound for all SNR0\text{SNR} \ge 0.

At high SNR\text{SNR}, the cut-set bound grows like 12log2(SNR)\tfrac{1}{2} \log_2(\text{SNR}); the CF rate grows like 12log2(SNR)\tfrac{1}{2} \log_2 (\text{SNR}) as well. The gap 12log2(1+SNR)12log2(12+SNR)\tfrac{1}{2} \log_2(1+\text{SNR}) - \tfrac{1}{2} \log_2(\tfrac{1}{2} + \text{SNR}) is bounded above by 12log2(2)=12\tfrac{1}{2} \log_2(2) = \tfrac{1}{2} bit, achieved as SNR0\text{SNR} \to 0 and asymptotically vanishing as SNR\text{SNR} \to \infty. So CF is not only within a constant gap of capacity — at high SNR it is essentially tight.

,

Two-Way Relay: CF vs. Amplify/Decode-Forward Sum-Rate

Sum-rate of the symmetric two-way relay channel versus SNR, comparing four strategies: (i) routing (4 orthogonal slots), (ii) amplify-and-forward (2 slots), (iii) decode-and-forward (2 slots, relay decodes both messages and XORs), (iv) compute- and-forward with a=(1,1)T\mathbf{a} = (1, 1)^T. At moderate-to-high SNR the CF curve is the highest, and approaches the cut-set bound log2(1+SNR)\log_2(1 + \text{SNR}) as SNR\text{SNR} \to \infty — the "within 1/2 bit" Nam-Chung-Lee guarantee (Thm. TNam-Chung-Lee: CF Is Within 1/2 Bit of TWRC Capacity). At low SNR, DF can marginally outperform CF because the 12\tfrac{1}{2} bit gap matters proportionally more.

Parameters

Example: TWRC Rates at Symmetric SNR=20dB\text{SNR} = 20\,\text{dB}

Compare the per-user sum-rate of the symmetric Gaussian TWRC at SNR=20dB=100\text{SNR} = 20\,\text{dB} = 100 under routing, AF, DF, and CF. Which strategy is closest to the cut-set upper bound?

,

What About Asymmetric TWRC?

The 12\tfrac{1}{2}-bit gap of Thm. TNam-Chung-Lee: CF Is Within 1/2 Bit of TWRC Capacity assumes a symmetric TWRC: hA=hBh_A = h_B and gA=gBg_A = g_B. For asymmetric channels (hAhBh_A \neq h_B), the integer coefficient a=(1,1)T\mathbf{a} = (1, 1)^T is not necessarily optimal. With h=(1,2)T\mathbf{h} = (1, 2)^T, a=(1,2)T\mathbf{a} = (1, 2)^T is exact and CF achieves nearly the full MAC sum-rate; with h=(1,2)T\mathbf{h} = (1, \sqrt{2})^T, no integer vector is exact and CF pays a Diophantine-approximation penalty.

Wilson-Narayanan-Pfister-Sprintson (2010) and Nam-Chung-Lee (2011) extended the constant-gap result to asymmetric TWRCs using optimised a\mathbf{a}^* chosen from the channel; the gap grows to log2(1+SNRκ2)\log_2(1 + \text{SNR} \kappa^2) where κ\kappa is a Diophantine-mismatch parameter, but remains bounded over bounded SNR. For the curriculum we focus on the symmetric case; asymmetric refinements are deferred to exercises.

,

Historical Note: The TWRC in Theory: From Shannon 1961 to Nam-Chung-Lee 2010

1961-2011

The two-way channel was introduced by Shannon in his 1961 "Two-way communication channels" paper — one of the first studies of network information theory. Shannon asked: what rate pairs can two users exchange over a shared medium? For the general two-way channel (direct links, no relay), Shannon gave an inner bound that is still not known to be tight 60 years later — one of the longest-standing open problems in information theory.

The relay-mediated two-way channel admits a cleaner answer. Wu-Chou-Chan (2005) first proposed a two-slot network-coded protocol using digital XOR at the relay. Popovski-Yomo (2006) extended it to wireless with analog superposition. Zhang-Liew-Lam (2006) — in the MobiCom paper that coined "physical-layer network coding" — showed that the XOR can be extracted from the analog sum itself, doubling the slot efficiency. Katti-Gollakota- Katabi (2007) demonstrated this experimentally in a MIT testbed called ANC (Analog Network Coding).

The information-theoretic characterisation came later. Oechtering and colleagues (2008–2009) computed the exact achievable region. Nam-Chung-Lee (2010) — the paper that sits at the heart of this section — proved the 12\tfrac{1}{2}-bit constant-gap via lattice codes. Nazer-Gastpar (2011) then framed all of this as the K=2K = 2 specialisation of compute-and-forward, making the TWRC the pedagogical gateway to the general CF framework. The lineage is Shannon \to network coding \to PNC \to lattice CF — forty years of convergence on a two-slot lattice protocol that is nearly optimal.

,

Two-Slot Compute-and-Forward TWRC Protocol

Complexity: Encoding: O(n)O(n) lattice lookups per user. MMSE decoding at relay: O(nlogn)O(n \log n) per block with standard lattice decoders. Total latency: 22 channel blocks of nn symbols each.
# Two-way relay channel: users A, B exchange messages via relay R
# Nested lattices: Lambda_c subset Lambda_s, shared by both users
# Channel: y_R = h_A * x_A + h_B * x_B + w_R (slot 1)
# y_A = g_A * x_R + w_A, y_B = g_B * x_R + w_B (slot 2)
# ----- Encoding (at each user k in {A, B}) -----
Pick message u_k in Lambda_c intersect V(Lambda_s)
Generate dither d_k ~ Uniform(V(Lambda_s)) # shared with R
Transmit x_k = (u_k - d_k) mod Lambda_s # power P
# ----- Slot 1: MAC phase, relay decodes v = u_A + u_B mod Lambda_s -----
Relay receives y_R = h_A * x_A + h_B * x_B + w_R
Choose integer a = (1, 1) [symmetric TWRC]
Compute alpha = SNR * (h^T a) / (1 + SNR * ||h||^2)
Compute y_R_eff = alpha * y_R + d_A + d_B
Decode v_hat = argmin over v_lat in Lambda_c of
|| (y_R_eff - v_lat) mod Lambda_s ||^2
# ----- Slot 2: BC phase, relay transmits v_hat, users recover -----
Relay transmits x_R ~ v_hat (scaled to power P_R)
User A receives y_A = g_A * x_R + w_A
User A decodes v_hat from y_A (single-user Lambda_c decoder)
User A recovers u_B = (v_hat - u_A) mod Lambda_s # A knows u_A
User B recovers u_A = (v_hat - u_B) mod Lambda_s # B knows u_B
return u_A (to B), u_B (to A)

The protocol's elegance lies in two moves. In slot 1 the relay decodes only the sum, not the individual messages — avoiding the MAC cut that limits DF. In slot 2 each user subtracts its own message from the decoded sum, turning the XOR broadcast into a point-to-point code.

Common Mistake: Both Users Need Their Dithers at the Relay

Mistake:

Forgetting that in the nested-lattice CF protocol the dithers dA,dB\mathbf{d}_A, \mathbf{d}_B at each user are shared with the relay — not broadcast in the air. If the dithers are unknown to the relay, the relay cannot form yR=αyR+dA+dB\mathbf{y}_R' = \alpha \mathbf{y}_R + \mathbf{d}_A + \mathbf{d}_B and the crypto-lemma argument breaks: the effective noise no longer has mean zero.

Correction:

In practice the dithers are generated from a pseudo-random seed shared in advance between each user and the relay (e.g., via a common pilot sequence or a key-exchange phase). This is inexpensive: a 128-bit seed regenerates an infinite dither sequence. It is not secret data — the dither exists to make the crypto-lemma uniformity hold, nothing more. The PNC protocol (§4) achieves a similar effect without dithers by using a finite-alphabet structured codebook; for asymptotic AWGN-capacity achievability, nested lattices with shared dithers are the standard construction.

Why This Matters: TWRC in Modern Wireless: Integrated Access and Backhaul

5G NR introduced Integrated Access and Backhaul (IAB) in Release 16: a hub gNB serves user equipments through wireless relay gNBs that also backhaul their traffic over the same spectrum. Architecturally, the IAB-relay plays the role of "RR" in a multi-user TWRC: users send uplink data, the relay forwards to the hub, the hub sends downlink data, the relay forwards to users — four logical traffic flows over shared spectrum.

5G NR does not implement compute-and-forward — it uses orthogonal time-frequency splitting for the four flows. But the information-theoretic analysis of this section predicts that a CF-based IAB relay could double the throughput of the backhaul link at high SNR. Chapter 20 discusses massive-MIMO coded modulation, where the role of lattice codes extends to precoded uplink-downlink combinations — a spiritual continuation of TWRC CF in higher dimensions.

See full treatment in Chapter 20

Quick Check

Why does compute-and-forward outperform decode-and-forward on the symmetric Gaussian TWRC at high SNR?

CF uses a single codebook while DF uses two; one codebook is cheaper.

The MA decode in DF is limited by 12log(1+2SNR)/2\tfrac{1}{2} \log(1 + 2\text{SNR})/2, while CF's MA rate is 12log(1/2+SNR)\tfrac{1}{2} \log(1/2 + \text{SNR}) per user — asymptotically identical but CF is tighter at finite SNR.

DF must decode both messages at the relay — limited by the MAC-sum capacity 12log2(1+2SNR)\tfrac{1}{2} \log_2(1+2\text{SNR}) — while CF only decodes the sum, limited by the single-user effective rate 12log2(1/2+SNR)\tfrac{1}{2} \log_2(1/2 + \text{SNR}) which is log2SNR/2\log_2 \text{SNR}/2 worth larger at high SNR.

CF never requires synchronisation, while DF does.

Two-way relay channel (TWRC)

A three-node network in which two users AA and BB exchange messages via a single relay RR. No direct ABA \leftrightarrow B link exists. The canonical CF application, operating in two time slots (multiple-access + broadcast); Nam-Chung-Lee proved CF achieves capacity within 12\tfrac{1}{2} bit per user.

Related: Forward Reference: Compute-and-Forward (Ch. 18), physical-layer network coding, relay channel

Key Takeaway

On the symmetric Gaussian two-way relay channel, compute-and- forward with integer coefficient a=(1,1)T\mathbf{a} = (1, 1)^T achieves a per-user rate of 12log2+(1/2+SNR)\tfrac{1}{2} \log_2^+ (1/2 + \text{SNR}), within 12\tfrac{1}{2} bit per user of the cut-set capacity bound for all SNR (Nam-Chung-Lee 2010). Over two slots (MA + BC), this doubles the classical routing throughput and strictly outperforms both AF and DF at moderate-to-high SNR. The key move: the relay decodes uA+uBmodΛs\mathbf{u}_A + \mathbf{u}_B \bmod \Lambda_s — a single lattice point — and each user recovers the other's message by subtracting its own.