Skip to content

Commit 15a0b50

Browse files
torokati44avarga
authored andcommitted
RRC: pick the right leg for a multicast bearer's RX side
createIncomingConnection() chose between the LTE and NR leg with bool isNr = (registration_->getNodeType()==UE && isNrUe(lteInfo->getDestId())); //TODO FIXME! DOES NOT WORK FOR MULTICAST!!!!! Both the flag and the MAC lookup below it asked the same question -- which of this node's legs does the bearer belong to? -- and answered it with the destination id. For a unicast bearer that is correct, because the destination is this node. A multicast bearer has no single destination: getDestId() names the sender's LTE id, so an NR multicast bearer was built on the *LTE* leg of every receiver while the sender transmitted on its NR leg. The receiving NR MAC then had no descriptor for the arriving PDU and asserted in macPduUnmake(). For multicast the sender's id selects the leg instead: the frame goes out on the sender's leg and D2dUePhy::sendMulticast() hands it only to receivers whose isNrUe() matches the transmitting PHY's isNr_, so the receiving leg is the one matching the sender by construction. This also makes the function symmetric with createOutgoingConnection(), which already uses getSourceId() -- there the sender is this node -- and carries no such TODO. The MAC lookup now reuses the computed flag instead of repeating the expression. nr/cars D2DMulticast advances from t=5.13s to t=26.07s, the same point the LTE variant now reaches, so both RATs behave identically again. Remaining there: car[5], the first receiver of the *second* multicast group, still asserts even though it is provisioned -- traced far enough to confirm joinMulticastGroup() does find the stored flow and create its RX leg (node=1030/2054, group=32771, flow known), so that is a CID or timing mismatch rather than missing provisioning, and needs its own investigation. Full fingerprint suite 182/182 PASS, CSVs unchanged.
1 parent 5007fe7 commit 15a0b50

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/simu5g/stack/rrc/BearerManagement.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,16 @@ void BearerManagement::createIncomingConnection(const FlowId& flow, const Bearer
344344
// exist (e.g. re-establishment after a partial teardown); skip instead of
345345
// crashing on duplicate MAC/RLC/PDCP creation.
346346
DrbKey rlcId = flow.rxDrbKey();
347-
bool isNr = (registration_->getNodeType()==UE && isNrUe(flow.destId)); //TODO FIXME! DOES NOT WORK FOR MULTICAST!!!!!
347+
348+
// Which of this node's legs does the bearer belong to? For a unicast bearer the
349+
// destination *is* this node, so its id answers that. A multicast bearer has no single
350+
// destination -- destId then names some other node -- but it is transmitted on the
351+
// sender's leg and delivered only to peers on the matching leg (D2dUePhy::sendMulticast
352+
// skips receivers whose isNrUe() disagrees with the transmitting PHY's isNr_), so there
353+
// the sender's id selects the leg. This mirrors createOutgoingConnection(), which uses
354+
// sourceId because there the sender is this node.
355+
MacNodeId legNodeId = (flow.multicastGroupId != NODEID_NONE) ? flow.sourceId : flow.destId;
356+
bool isNr = (registration_->getNodeType() == UE && isNrUe(legNodeId));
348357
cModule *existingRlcEnt = lookupRlcEntityModule(rlcId, isNr);
349358
if (existingRlcEnt != nullptr && existingRlcEnt->gate("lowerIn")->isConnectedOutside()) {
350359
EV << "BearerManagement::createIncomingConnection - entities for " << rlcId.str() << " already exist, skipping\n";
@@ -361,7 +370,7 @@ void BearerManagement::createIncomingConnection(const FlowId& flow, const Bearer
361370
const DrbDesc& drb = materializeDrb(flow, req, flow.sourceId, rlcId, isNr);
362371

363372
MacNodeId senderId = flow.sourceId;
364-
auto mac = (registration_->getNodeType()==UE && isNrUe(flow.destId)) ? nrMacModule.get() : macModule.get(); //TODO FIXME! DOES NOT WORK FOR MULTICAST!!!!!
373+
auto mac = isNr ? nrMacModule.get() : macModule.get();
365374
LogicalCid lcid = mac->drbIdToLcid(flow.drbId);
366375
MacCid cid = MacCid(senderId, lcid);
367376
mac->configureLogicalChannel(cid, LogicalChannelConfig{drb.rlcMode, drb.soFraming, drb.snFieldLength, drb.lcg});

0 commit comments

Comments
 (0)