Skip to content

Commit 8294ff1

Browse files
committed
Pdcp: fix: fromDataPort() to use destId for MacCid
This is consistent with fromLowerLayer(), which uses sourceId. To use ctrlInfoToMacCid() would be WRONG. It returns the UE's nodeId, which ignores the fact that PDCP may have connections toward multiple gNB/eNB entities due to Dual Connectivity and Handovers. (Handovers are also offending becauses currently the old PDCP entities are NOT deleted on handover!). Note that for Dual Connectivity/Split Bearers, the split occurs (is supposed to occur) in the PDCP layer, ie. PDCP may have to "legs", ie. LCID is only valid in the context of the Master or Slave serving entity.
1 parent d173bed commit 8294ff1

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/simu5g/stack/pdcp/LtePdcp.cc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,19 @@ void LtePdcpBase::fromDataPort(cPacket *pktAux)
147147
emit(receivedPacketFromUpperLayerSignal_, pktAux);
148148

149149
auto pkt = check_and_cast<inet::Packet *>(pktAux);
150-
MacCid cid = analyzePacket(pkt);
150+
analyzePacket(pkt);
151+
152+
auto lteInfo = pkt->getTag<FlowControlInfo>();
153+
MacCid cid = MacCid(lteInfo->getDestId(), lteInfo->getLcid());
151154

152-
// get the PDCP entity for this LCID and process the packet
153-
EV << "Processing packet with CID " << cid << "\n";
154155
LteTxPdcpEntity *entity = lookupTxEntity(cid);
156+
157+
// get the PDCP entity for this LCID and process the packet
158+
EV << "fromDataPort in " << getFullPath() << " event #" << getSimulation()->getEventNumber()
159+
<< ": Processing packet " << pkt->getName() << " src=" << lteInfo->getSourceId() << " dest=" << lteInfo->getDestId()
160+
<< " multicast=" << lteInfo->getMulticastGroupId() << " direction=" << dirToA((Direction)lteInfo->getDirection())
161+
<< " ---> CID " << cid << (entity == nullptr ? " (NEW)" : " (existing)") << std::endl;
162+
155163
if (entity == nullptr)
156164
entity = createTxEntity(cid);
157165
entity->handlePacketFromUpperLayer(pkt);

0 commit comments

Comments
 (0)