# 5G NR SDAP

## Summary


Service Data Adaptation Protocol (SDAP) sublayer exists only in the user plane in both gNB and UE. It interfaces to upper layers via QoS flows and to the PDCP lower layer via Data Radio Bearers (DRBs). Traffic from QoS flows are mapped to suitable DRBs. This is an essential role of SDAP. SDAP layer doesn't exist in 4G/LTE since QoS flows were introduced only in 5G. 

Quality-of-Service (QoS) is implemented in 5G using **QoS Flows**. On the Uu air interface between gNB and UE, data packets are carried in DRBs. Rules are either configured or derived to map QoS flows to DRBs. This mapping is executed at SDAP.

## Discussion

### What are the main functions of SDAP sublayer?

The main service provided by SDAP to upper layers is the transfer of user plane data. From lower layers, SDAP expects in-sequence delivery of PDUs except when out-of-sequence delivery is configured by RRC at PDCP.  

Apart from the transfer of user plane data, SDAP maps QoS flows to DRBs in both DL and UL. It maps PC5 QoS flows to SL-DRB for sidelink communication. It marks packets with QoS flow ID (DL or UL) or PC5 QoS flow ID (SL). 

RRC configures the rules by which SDAP does the mapping.  When uplink mapping is omitted, UE monitors the equivalent downlink mapping and applies the same to the uplink. This is called **Reflective QoS**. Reflective QoS is not supported for sidelink. It's also not applicable if DL SDAP PDUs don't have a header. 


### Could you describe how SDAP sublayer handles a PDU session?

The SDAP sublayer can have multiple SDAP entities, one for each PDU session on the gNB-UE Uu interface. An SDAP entity establishment or release are initiated by RRC. 

The mapping of QoS flows to DRBs is not one to one; that is, multiple QoS flows can be mapped to a DRB. In the figure we show an example of a single PDU session with 4 QoS flows mapped to 3 DRBs. The first two flows are mapped to a single DRB. Each DRB is handled by a single PDCP entity, which may translate to one or two RLC entities depending on the RLC mode. 

In the uplink, a QoS flow is mapped to only one DRB at a time. A PDU session has at least one DRB. There's at most one **default DRB** in every PDU session. If there's no uplink mapping, SDAP PDU is sent on the default DRB. 

Packets belonging to different PDU sessions go on different DRBs. 


### Could you describe the format of an SDAP data PDU?

An SDAP data PDU includes an optional 1-byte header and a variable length payload. Payload length is communicated between SDAP and PDCP sublayers.

Presence of SDAP header in UL and DL are configured per DRB. A header isn't required if the DRB carries only one QoS flow. However, DL header presence is configured if reflective QoS is enabled. Any change to header presence is done in a synchronized manner such as a handover. 

DL SDAP header includes a 1-bit RDI (Reflective QoS flow to DRB mapping Indication), a 1-bit RQI (Reflective QoS Indication) and a 6-bit QFI. UL SDAP header includes QFI. When RDI=1, UE updates QoS flow to DRB mapping for uplink. When RQI=1, UE informs NAS that Service Data Flow (SDF) to QoS mapping rules have been updated. 1-bit D/C field is set to 1 to indicate data PDU. 1-bit R field is reserved. 

Non-GBR QoS flows can contain the Reflective QoS Attribute (RQA). This tells the NG-RAN to include QFI in downlink packets. UE may be configured to include QFI in uplink packets.  


### Which are the SDAP control PDUs?

SDAP has only one control PDU called **end-marker**. It's sent to indicate that a specific QoS flow is no longer mapped to the DRB/SL-DRB on which this control PDU is sent. The QoS flow is indicated with a 6-bit QFI/PQFI field. A 1-bit D/C field is set to zero to indicate control PDU. A 1-bit R field is reserved. 

When RRC configures a new mapping, SDAP will send the end-marker PDU on the previously mapped DRB or SL-DRB. The latter could be a previously configured DRB/SL-DRB or the default DRB/SL-DRB. 

## Milestones

Jun  
2017

At the 3GPP TSG-RAN WG2 #98 meeting, two proposals are made for SDAP operation: (a) QFI presence in SDAP PDU is configured semi-statically by RRC and can't be dynamically enabled or disabled; (b) SDAP header presence can be changed only via synchronized configuration such as a handover. 

Sep  
2017

SDAP specification TS 37.324 v1.0.0 is published. 

May  
2018

Jheng et al. of Mediatek Inc. file a patent detailing the operation of an apparatus that extracts from a downlink packet RQI and QFI. Subsequently, it derives the uplink Non-Access Stratum (NAS) mapping of Service Data Flow (SDF) to QoS flow. It's then able to send an uplink packet using this mapping. This is not actually an SDAP operation, since SDAP does only Access Stratum (AS) mapping of QoS flow to DRB.

Jun  
2018

As part of **Release 15** specifications, SDAP specification TS 37.324 v15.0.0 is approved and published. 

Jul  
2018

Li-Te Pan of ASUSTek Computer Inc. files a patent that restricts the network from changing the SDAP header presence configuration of the first DRB after it's established. The patent describes the challenges in changing this configuration. 

Mar  
2020

As part of Release 16 specifications, SDAP specification TS 37.324 v16.0.0 is published. This includes changes necessary for **sidelink communication**.