Skip to content

Commit 8e3083c

Browse files
committed
SDAP: Eliminate addSdapHeader NED parameter, infer it from DRB properties
Only add header if QFI cannot be restored on RX side: if there's more QFIs in that DRB, or QFI uses fallback DRB. Also: Throw on null DRB in RX path instead of silent fallback
1 parent c6a3e9d commit 8e3083c

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

simulations/nr/standalone/omnetpp_drb.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ sim-time-limit=20s
8888
{"drb": 1, "qfiList": [3, 4], "rlcType": "UM"}
8989
]
9090

91-
**.sdap.addSdapHeader = false #TEMP HACK
92-
9391
#------------------------------------#
9492
# Config VoIP-DL
9593
#

src/simu5g/stack/sdap/NrSdap.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ void NrSdap::initialize()
5151

5252
bool NrSdap::requiresSdapHeader(const DrbConfig *drb)
5353
{
54-
return par("addSdapHeader").boolValue(); // for now -- should come from RRC config
54+
// SDAP header is needed when the QFI cannot be unambiguously determined
55+
// from the DRB alone on the RX side:
56+
// - default DRB: may carry packets with unmapped QFIs (fallback traffic)
57+
// - multiple QFIs mapped: reverse mapping is ambiguous
58+
// Caller must ensure drb is not null.
59+
return drb->isDefault || drb->qfiList.size() > 1;
5560
}
5661

5762
bool NrSdap::shouldEnableReflectiveQos(int qfi)
@@ -198,6 +203,9 @@ void NrSdap::handleLowerPacket(inet::Packet *pkt)
198203
DrbId drbId = lteInfo ? lteInfo->getDrbId() : DRBID_NONE;
199204
MacNodeId ueId = (!isUe && lteInfo) ? lteInfo->getSourceId() : NODEID_NONE;
200205
const DrbConfig *drb = (drbId != DRBID_NONE) ? drbTable_.getDrb(DrbKey(ueId, drbId)) : nullptr;
206+
if (!drb)
207+
throw cRuntimeError("SDAP RX: Unknown DRB %d (ueId=%d) -- missing drbConfig entry?",
208+
(int)num(drbId), (int)num(ueId));
201209

202210
EV_INFO << "SDAP RX: Received packet from DRB " << drbId << ": " << pkt->peekAtFront() << "\n";
203211

src/simu5g/stack/sdap/NrSdap.ned

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ package simu5g.stack.sdap;
2222
// encapsulates the data with SDAP headers if needed, and forwards the packets
2323
// to the PDCP layer.
2424
//
25+
// An SDAP header is only added when the QFI cannot be unambiguously recovered
26+
// from the DRB alone on the RX side, i.e. when the DRB is the default DRB
27+
// (which may carry unmapped fallback traffic) or when it has multiple QFIs
28+
// mapped to it.
29+
//
2530
// Supports all 3GPP PDU session types (IPv4, IPv6, Ethernet, Unstructured)
2631
// via the pduSessionType field in drbConfig.
2732
//
@@ -50,7 +55,6 @@ simple NrSdap like INrSdap
5055
string binderModule = default("binder");
5156
object drbConfig = default([]); // JSON array: [{drb, ue, qfiList, rlcType, pduSessionType, upperProtocol, isDefault}, ...]; see banner comment for details
5257
string reflectiveQosTableModule = default(""); // UE only: path to ReflectiveQosTable module (empty = disabled)
53-
bool addSdapHeader = default(true);
5458
bool useReflectiveQos = default(false); // UE only
5559
@display("i=block/layer");
5660
gates:

0 commit comments

Comments
 (0)