Repository navigation
cell M6: handover execution — two-phase command, TSF continuity, conditional fallback - #530
Conversation
… source relay, UE switch with TSF continuity and fallback tools/ran-controller (RAN_HO_EXECUTE=1): - an A3 candidate becomes a HoCommand: the target's lowest free id and first free position, a RAN_HO_LEAD_SF lead, and the TSF delta from the DUs' reports; - two-phase: the target first, the source on the target's ack, and a cancel to the target if the source refuses; - ran.ho_done when the target reports the UE; the old key is retired and the moved UE gets its dwell. examples/cell: - target DU: pre-admits the UE under the commanded id and publishes its grant for the switch instant; handles a cancel. - source DU: airs the tagged HoIe until the switch, then releases the UE only if it stopped uplinking there; otherwise kept (make-before-break). - UE: accepts the newest fresh IE (HoReceiver) and buffers the target's grant maps. At the instant it shifts its clock (TsfSync::ShiftRemote, new), takes the target identity and runs the target's map. With no target grant within CELL_HO_FALLBACK_SF it returns to the source. - fix: a DU with no UE now paces its main loop to its superframe (its sf, and so its reported network superframe, ran away). - build_du_beacon takes extra IEs. Rig (testrig m5_ran_coord.sh, forced with RAN_A3_OFFSET_DB=-2): - normal: switch at source sf 143 = target sf 137, the target's effective sf for the grant. The target heard the UE in slot from the first superframe (1115/1117). Released at +21; ran.ho_done at +5. - target killed after staging: the UE fell back at +10, the source kept it and its uplink stayed in slot (1092/1092). ctest 92/92 (TsfSync ShiftRemote selftest added). docs/cell-m6.md. Refs #260 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PR Summary by QodoExecute two-phase cell handovers with TSF continuity and fallback
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1.
|
CU: - a failed or timed-out handover cancels the target's reservation, retried until acknowledged; a Stale reply (a reordered copy) is no verdict; nothing is sent to a DU without a network superframe; - a retired key expires by time, so a later UE can reuse the id; - the cancel decision reads the target flag before it is overwritten. DU: - a cancel acts only on the id that DU staged or published, and is kept until the live map no longer has the UE; - the arrival is recorded before the registry admit (no joiner race); - an arrival past its window expires (cell.ho.target_expired), and a deferred arrival removes only its own grant from the pass's map; - no handover IE aired and no arrival published while Lost. UE: the ACK-responder re-arm is retried until the radio takes it. Rig (testrig scripts/m6_handover.sh, 5 normal + 3 target-crash, 90 s each): all pass. Interruption 1/1/1 sf (min/median/max), CU done latency 5/6/16 sf, fallback 10/10/10 sf. docs/cell-m6.md updated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Qodo review addressed in 31e9ff1:
ctest 92/92. |
|
All 11 code findings resolved. The two open items are requirement gaps, deliberately out of this PR's scope:
Merging under skip-qodo-gate. |
Part of M6 (#260), epic #254. On top of #530 (handover execution). - **Common sequence:** a UE's uplink is its hardware beacon, stamped with its egress TSF, so `seq = round(egress / P)` is identical in every DU's copy. The UE needs no change. - **DU:** forwards its own UEs' uplinks to the CU (F1 v5 `Uplink`). With `CELL_DAPS=1` (the default), during a handover it also forwards the UE's other identity: the target forwards the source identity before the switch, and the source forwards the target identity after. - **CU:** `UlStreams` delivers each uplink once per UE stream over `SeqDedup`. The handover command aliases the target identity onto the source's stream, so the stream runs on across the switch. It logs `ran.ul_gap` for every delivery gap and `ran.ul` summaries. - **`cell_m6` ctest:** a simulated crossing (two lossy paths, the identity flip, the source dying), the alias, the common seq, and the F1 round trip. Rig (testrig `scripts/m6_daps.sh`, 3 runs per mode; the source DU is killed the moment its UE accepts the handover, about 2 s before the switch): | uplinks missing from the crossing UE's stream | min | median | max | |---|---|---|---| | DAPS | 0 | 0 | 1 | | no DAPS | 13 | 14 | 14 | ctest 92/92. Still open: downlink duplication, the different-channel (sequential) DAPS variant, and security pre-staging. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Part of M6 (#260), epic #254: **different-channel handover**, on top of #530 and #531. - **Command and IE:** `HoCommand.target_channel` comes from the target DU's report, and `HoIe.channel` travels with it (IE v2, F1 v6). - **UE:** at the switch it shifts its clock by the TSF delta (no target beacon needed first), takes the target identity, and **stops its uplink beacon → retunes (`FastRetune`) → restarts it on the new channel**. It logs the retune time and the first serving beacon after it. - **Deadline to return:** with no target grant within `CELL_HO_FALLBACK_SF`, the UE retunes back to the source, which still holds it. This bounds the deaf time. - **Trigger:** with one radio per DU, no DU hears a UE across channels, so the A3 has no neighbour value to compare. **UE measurement gaps are the next step.** Until then, `RAN_HO_FORCE=SRC:UE:TGT@SECONDS` forces one handover through the normal execution path. Rig (testrig `scripts/m6_handover.sh --channel2 157`: ch149 → ch157, 5 normal + 3 runs with the target killed after staging; all pass): | KPI | min | median | max | |---|---|---|---| | `FastRetune` (8852CE, 11 retunes) | 23.5 ms | 23.6 ms | 23.7 ms | | first target beacon after the retune | 37 ms | 52 ms | 101 ms | | interruption (sf, first in-slot uplink at the target) | 2 | 2 | 3 | | target crash: fallback / source uplink missed (sf) | 10 / 10 | 10 / 10 | 10 / 10 | The switch lands on the target's effective superframe in every run: clock continuity holds across the channel change. ctest 92/92. Details in `docs/cell-m6.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Part of M6 (#260), epic #254. Step 2b: handover execution on top of #528 (observe-only A3) and #529 (command and IE). Full write-up in
docs/cell-m6.md.RAN_HO_EXECUTE=1):HoCommand: the target's free id and position, the switch instant and the TSF delta;ran.ho_donewhen the target reports the UE.TsfSync::ShiftRemote, new, selftested), takes its target identity and runs the target's buffered map. Conditional: with no target grant within 10 superframes it returns to the source.Rig (two PTP cells; the crossing is forced with
RAN_A3_OFFSET_DB=-2, as the UEs are stationary):ran.ho_done+5ctest 92/92. Not yet: DAPS (duplicated uplink plus
SeqDedup), an emulated moving crossing, and different-channel handover.🤖 Generated with Claude Code