main content

nr tdd symbol based scheduling performance evaluation -凯发k8网页登录

this example models a symbol-based scheduling scheme in time division duplexing (tdd) mode and evaluates the network performance. symbol-based scheduling of resources allows shorter transmission durations spanning a few symbols in the slot. in tdd mode, physical uplink shared channel (pusch) and physical downlink shared channel (pdsch) transmissions are scheduled in the same frequency band with separation in time domain. you can customize the scheduling strategy and evaluate network performance. the performance of the scheduling strategy is evaluated in terms of achieved throughput and fairness in resource sharing.

introduction

the example considers the following operations within the gnb and ues that facilitate ul and dl transmissions and receptions.

the complete pusch or pdsch packet is transmitted in the first symbol of its allocated symbol set. receiver processes the packet in the symbol just after the last symbol in the allocated symbol set.

this example models:

  • configurable tdd dl-ul pattern.

  • slot-based and symbol-based dl and ul scheduling. ul scheduler ensures that the ues get the required pusch preparation time.

  • noncontiguous allocation of frequency domain resources in terms of resource block groups (rbgs).

  • configurable subcarrier spacing resulting in different slot durations.

  • configurable demodulation reference signal (dm-rs) properties.

  • asynchronous hybrid automatic repeat request (harq) mechanism.

  • periodic dl and ul application traffic pattern.

  • rlc operating in um mode.

  • single bandwidth part covering the entire carrier bandwidth.

following control packets are assumed to be sent out of band i.e. without the need of resources for transmission and assured error-free reception: ul assignment, dl assignment, buffer status report (bsr), pdsch feedback, and cqi report. these control packets follow the tdd dl and ul timings. for example, bsr and pdsch feedback are sent in ul time while resource assignments are sent in dl time.

tdd dl-ul pattern configuration

nr provides a flexible way of configuring the dl and ul resources. the parameters used to define a custom tdd configuration are:

  1. dl-ul transmission periodicity in ms.

  2. reference subcarrier spacing to calculate the number of slots in the dl-ul pattern. in this example, it is assumed to be same as actual subcarrier spacing used for transmission.

  3. number of consecutive full dl slots at the beginning of each dl-ul pattern.

  4. number of consecutive dl symbols in the beginning of the slot following the last full dl slot.

  5. number of consecutive full ul slots at the end of each dl-ul pattern.

  6. number of consecutive ul symbols in the end of the slot preceding the first full ul slot.

the example does not model flexible symbols, so the symbols with unspecified symbol type are assumed for guard period. here is an example of resulting tdd dl-ul pattern based on these parameters. this dl-ul pattern repeats itself in the timeline.

  • reference_scs = 15 khz (i.e. 1 ms slot), dlulperiodicity = 5 ms, numdlslots = 3, numdlsyms = 7, numulslots = 1, numulsyms = 5

number of slots in dl-ul periodicity with respect to reference scs of 15 khz, numslotsdlulperiodicity = 5

numberofguardsymbols = totalsymbolsinpattern - totalsymbolswithtypespecified

= (14 * numslotsdlulperiodicity) - (numdlslots*14 numdlsyms numulsyms numulslots*14)

= 2 symbols

scheduler

ul and dl schedulers distribute the ul and dl resources respectively among the ues. you can choose any one of the implemented scheduling strategies: proportional fair (pf), best cqi, or round-robin (rr). the various supported inputs to the schedulers are shown along with the scheduling strategies that consider them.

both ul and dl schedulers run at the start of a slot when the first symbol is a dl symbol. schedulers run in dl time so that assignments (ul and dl) can be instantly sent to ues in the dl direction. the run time of the scheduler algorithm as well as the propagation delay is assumed to be zero. the output of scheduling operations is an array of assignments. each assignment contains the information fields to fully define a pusch or pdsch transmission.

  • ul scheduler

the ul scheduling operation follows these two steps.

  1. select slots to be scheduled: the criteria used in this example selects all the upcoming slots (including the current one) containing unscheduled ul symbols that must be scheduled now. such slots must be scheduled now as they cannot be scheduled in the next slot with dl symbols, depending on the value of pusch preparation time capability of the ues. it ensures that the ul resources are scheduled as close as possible to the actual transmission time.

below are 2 examples to explain how ul slots are selected in this example for scheduling, based on pusch preparation time.

(i) assuming that the ues require pusch preparation time equivalent to 10 symbols, when the ul scheduler runs in slot-a, it does not select any slot for scheduling. because scheduling in the next slot (i.e. slot-b) provides enough pusch preparation time (14 symbols) for the ul transmission in slot-c. later, when the ul scheduler runs in slot-b, it selects both slot-c and slot-d for scheduling. slot-d is scheduled in slot-b itself (and not in slot-c) because slot-c is a full ul slot and hence does not have any dl symbols for sending the assignments in the dl direction.

(ii) assuming that the ues require pusch preparation time equivalent to 16 symbols, slot-c is scheduled in slot-a itself. because scheduling in slot-b would only provide 14 symbols of pusch preparation time to start transmission in slot-c. slot-d is scheduled in slot-b.

2. resource scheduling: if any slots are selected in the first step, assign the ul resources of those slots to the ues.

  • dl scheduler

the dl scheduler runs at each slot beginning with a dl symbol and assign resources of the first upcoming slot containing dl symbols. so, when the dl scheduler runs at the start of slot-a, it schedules dl resources of slot-b.

symbol based scheduling

nr allows the tti to start at any symbol position in the slot and with tti granularity in symbols. the figure shows the way ul scheduler operates in this example to schedule ul symbols of a slot with tti granularity of two symbols. the slot shown contains six ul symbols. scheduler completes the iteration of the ul symbols in three iterations with each iteration distributing the frequency resources of two symbols. the dl scheduler also follows a similar approach for dl scheduling.

scenario configuration

check if the communications toolbox wireless network simulation library support package is installed. if the support package is not installed, matlab® returns an error with a link to download and install the support package.

wirelessnetworksupportpackagecheck

configure simulation parameters in the simparameters structure.

rng('default'); % reset the random number generator
simparameters = []; % clear simparameters variable
simparameters.numframessim = 100; % simulation time in terms of number of 10 ms frames
simparameters.schedulingtype = 1; % set the value to 0 (slot-based scheduling) or 1 (symbol-based scheduling)

specify the number of ues in the cell, assuming that ues have sequential radio network temporary identifiers (rntis) from 1 to simparameters.numues. if you change the number of ues, ensure that the number of rows in simparameters.ueposition parameter equals to the value of simparameters.numues.

simparameters.numues = 4;
% assign position to the ues assuming that the gnb is at (0, 0, 0). n-by-3
% matrix where 'n' is the number of ues. each row has (x, y, z) position of a
% ue (in meters)
simparameters.ueposition = [100 0 0;
                            150 0 0;
                            300 0 0;
                            400 0 0];
% validate the ue positions
validateattributes(simparameters.ueposition,{'numeric'},{'nonempty','real','nrows',simparameters.numues,'ncols',3, ...
    'finite'},'simparameters.ueposition','ueposition');

set the channel bandwidth to 5 mhz and the subcarrier spacing (scs) to 15 khz as defined in 3gpp ts 38.104 section 5.3.2. the complete bandwidth is assumed to be allotted for pusch or pdsch.

simparameters.numrbs = 25;
simparameters.scs = 15; % khz
simparameters.dlbandwidth = 5e6; % hz
simparameters.ulbandwidth = 5e6; % hz
simparameters.dlcarrierfreq = 2.595e9; % hz
simparameters.ulcarrierfreq = 2.595e9; % hz

specify the tdd dl-ul pattern. the reference subcarrier spacing used for calculating slot duration for the pattern is assumed to be same as actual subcarrier spacing used for transmission as defined by simparameters.scs. keep only the symbols intended for guard period during dlulperiodicity with type (dl or ul) unspecified.

simparameters.dlulperiodicity = 5; % duration of the dl-ul pattern in ms
simparameters.numdlslots = 2; % number of consecutive full dl slots at the beginning of each dl-ul pattern
simparameters.numdlsyms = 8; % number of consecutive dl symbols in the beginning of the slot following the last full dl slot
simparameters.numulsyms = 4; % number of consecutive ul symbols in the end of the slot preceding the first full ul slot
simparameters.numulslots = 2; % number of consecutive full ul slots at the end of each dl-ul pattern

specify the scheduling strategy, the time domain resource assignment granualarity and the maximum limit on the rbs allotted for pdsch and pusch. the time domain resource assignment granualarity is applicable only for symbol-based scheduling. if the number of symbols (dl or ul) are less than the configured time domain resource assignment granularity, then a smaller valid granularity is chosen. for slot-based scheduling, biggest possible granularity in a slot is chosen. the rb transmission limit applies only to new transmissions and not to the retransmissions.

simparameters.schedulerstrategy = 'pf'; % supported scheduling strategies: 'pf', 'rr' and 'bestcqi'
simparameters.ttigranularity = 4;
simparameters.rballocationlimitul = 15; % for pusch
simparameters.rballocationlimitdl = 15; % for pdsch

set the ul scheduling related configurations - bsr periodicity and pusch preparation time. gnb ensures that pusch assignment is received at the ues at least puschpreptime ahead of the transmission time.

simparameters.bsrperiodicity = 1; % buffer status report transmission periodicity (in ms)
simparameters.puschpreptime = 200; % in microseconds

set the channel quality related configurations for the ues. channel quality is periodically improved or deteriorated by cqi delta for all rbs of a ue. whether channel conditions for a particular ue improve or deteriorate is randomly determined by: rb_cqi = rb_cqi /- cqidelta. however, the maximum allowed cqi value depends on the ue position and is determined by cqivsdistance mapping table. this mapping is only applicable when passthrough phy is used.

simparameters.channelupdateperiodicity = 0.2; % in sec
simparameters.cqidelta = 1;
% mapping between distance from gnb (first column in meters) and maximum achievable ul cqi value (second column)
simparameters.cqivsdistance = [ 
    200  15;
    300  12;
    500  10;    
    1000  8;
    1200  7];

specify the pusch and pdsch associated dmrs configurations.

simparameters.dmrstypeaposition = 2; % type-a dm-rs position as 2 or 3
% pusch dm-rs configuration
simparameters.puschdmrsadditionalpostypeb = 0;
simparameters.puschdmrsadditionalpostypea = 0;
simparameters.puschdmrsconfigurationtype = 1;
% pdsch dm-rs configuration
simparameters.pdschdmrsadditionalpostypeb = 0;
simparameters.pdschdmrsadditionalpostypea = 0;
simparameters.pdschdmrsconfigurationtype = 1;

application traffic configuration

set the periodic dl and ul application traffic pattern for ues.

% set the periodic dl and ul application traffic pattern for ues
dlappdatarate = 16e4*ones(simparameters.numues,1); % dl application data rate in kilo bits per second (kbps)
ulappdatarate = 16e4*ones(simparameters.numues,1); % ul application data rate in kbps
% validate the dl application data rate
validateattributes(dlappdatarate, {'numeric'},{'nonempty','vector','numel',simparameters.numues,'finite','>',0}, ...
    'dlappdatarate','dlappdatarate');
% validate the ul application data rate
validateattributes(ulappdatarate,{'numeric'},{'nonempty','vector','numel',simparameters.numues,'finite','>',0}, ...
    'ulappdatarate', 'ulappdatarate');

logging and visualization configuration

the cqivisualization and rbvisualization parameters control the display of the cqi visualization and the rb assignment visualization respectively. to enable the rb visualization plot, set the rbvisualization field to true.

simparameters.cqivisualization = false;
simparameters.rbvisualization = false;

set the enabletraces as true to log the traces. if the enabletraces is set to false, then cqivisualization and rbvisualization are disabled automatically and traces are not logged in the simulation. to speed up the simulation, set the enabletraces to false.

enabletraces = true;

the example updates the metrics plots periodically. set the number of updates during the simulation. number of steps must be less than or equal to number of slots in simulation

simparameters.nummetricssteps = 20;

write the logs to mat-files. the example uses these logs for post-simulation analysis and visualization.

parameterslogfile = 'simparameters'; % for logging the simulation parameters
simulationlogfile = 'simulationlogs'; % for logging the simulation traces
simulationmetricsfile = 'simulationmetrics'; % for logging the simulation metrics

derived parameters

compute the derived parameters based on the primary configuration parameters specified in the previous section and additionally set some example-specific constants.

simparameters.duplexmode = 1; % fdd (value as 0) or tdd (value as 1)
simparameters.ncellid = 1; % physical cell id
simparameters.position = [0 0 0]; % position of gnb in (x,y,z) coordinates

compute the number of slots in the simulation.

numslotssim = (simparameters.numframessim * 10 * simparameters.scs)/15;

determine the pdsch/pusch mapping type.

if simparameters.schedulingtype % symbol-based scheduling
    simparameters.puschmappingtype = 'b';
    simparameters.pdschmappingtype = 'b';
else % slot-based scheduling
    simparameters.puschmappingtype = 'a';
    simparameters.pdschmappingtype = 'a';
end

set the interval at which the example updates metrics visualization in terms of number of slots.

simparameters.metricsstepsize = ceil(numslotssim / simparameters.nummetricssteps);

specify one logical channel for each ue, and set the logical channel configuration for all nodes (ues and gnbs) in the example.

numlogicalchannels = 1;
simparameters.lchconfig.lcid = 4;

specify the rlc entity type in the range [0, 3]. the values 0, 1, 2, and 3 indicate rlc um unidirectional dl entity, rlc um unidirectional ul entity, rlc um bidirectional entity, and rlc am entity, respectively.

simparameters.rlcconfig.entitytype = 2;

construct information for rlc logger.

lchinfo = repmat(struct('rnti',[],'lcid',[],'entitydir',[]), [simparameters.numues 1]);
for idx = 1:simparameters.numues
    lchinfo(idx).rnti = idx;
    lchinfo(idx).lcid = simparameters.lchconfig.lcid;
    lchinfo(idx).entitydir = simparameters.rlcconfig.entitytype;
end

create rlc channel configuration structure.

rlcchannelconfigstruct.lcgid = 1; % mapping between logical channel and logical channel group id
rlcchannelconfigstruct.priority = 1; % priority of each logical channel
rlcchannelconfigstruct.pbr = 8; % prioritized bitrate (pbr), in kilobytes per second, of each logical channel
rlcchannelconfigstruct.bsd = 10; % bucket size duration (bsd), in ms, of each logical channel
rlcchannelconfigstruct.entitytype = simparameters.rlcconfig.entitytype;
rlcchannelconfigstruct.logicalchannelid = simparameters.lchconfig.lcid;

set the maximum rlc sdu length (in bytes) as per 3gpp ts 38.323

simparameters.maxrlcsdulength = 9000;

calculate maximum achievable cqi value for the ues based on their distance from the gnb

maxuecqis = zeros(simparameters.numues, 1); % to store the maximum achievable cqi value for ues
for ueidx = 1:simparameters.numues
    % based on the distance of the ue from gnb, find matching row in cqivsdistance mapping
    matchingrowidx = find(simparameters.cqivsdistance(:, 1) > simparameters.ueposition(ueidx,1));
    if isempty(matchingrowidx)
        maxuecqis(ueidx) = simparameters.cqivsdistance(end, 2);
    else
        maxuecqis(ueidx) = simparameters.cqivsdistance(matchingrowidx(1), 2);
    end
end

define initial ul and dl channel quality as an n-by-p matrix, where 'n' is the number of ues and 'p' is the number of rbs in the carrier bandwidth. the initial value of cqi for each rb, for each ue, is given randomly and is limited by the maximum achievable cqi value corresponding to the distance of the ue from gnb.

simparameters.initialchannelqualityul = zeros(simparameters.numues, simparameters.numrbs); % to store current ul cqi values on the rbs for different ues
simparameters.initialchannelqualitydl = zeros(simparameters.numues, simparameters.numrbs); % to store current dl cqi values on the rbs for different ues
for ueidx = 1:simparameters.numues
    % assign random cqi values for the rbs, limited by the maximum achievable cqi value
    simparameters.initialchannelqualityul(ueidx, :) = randi([1 maxuecqis(ueidx)], 1, simparameters.numrbs);
    % initially, dl and ul cqi values are assumed to be equal
    simparameters.initialchannelqualitydl(ueidx, :) = simparameters.initialchannelqualityul(ueidx, :);
end

gnb and ues setup

create the gnb and ue objects, initialize the channel quality information for ues and set up the logical channel at gnb and ue. the helper classes and create gnb and ue node respectively, containing the rlc and mac layer. for mac layer, uses the helper class to implement the gnb mac functionality and uses to implement the ue mac functionality. schedulers are implemented in (rr), (pf), (best cqi) . all the schedulers inherit from the base class which contains the core scheduling functionality. for rlc layer, both and use to implement the functionality of the rlc transmitter and receiver. passthrough phy layer for ue and gnb is implemented in and , respectively.

create the gnb node and add scheduler

gnb = hnrgnb(simparameters); 
switch(simparameters.schedulerstrategy)
    case 'rr' % round-robin scheduler
        scheduler = hnrschedulerroundrobin(simparameters);
    case 'pf' % proportional fair scheduler
        scheduler = hnrschedulerproportionalfair(simparameters);
    case 'bestcqi' % best cqi scheduler
        scheduler = hnrschedulerbestcqi(simparameters);
end
addscheduler(gnb, scheduler); % add scheduler to gnb
gnb.phyentity = hnrgnbpassthroughphy(simparameters); % add passthrough phy
configurephy(gnb, simparameters);
setphyinterface(gnb); % set the interface to phy layer

create the set of ue nodes.

ues = cell(simparameters.numues, 1);
for ueidx = 1:simparameters.numues
    simparameters.position = simparameters.ueposition(ueidx, :); % position of the ue
    ues{ueidx} = hnrue(simparameters, ueidx);
    ues{ueidx}.phyentity = hnruepassthroughphy(simparameters, ueidx); % add passthrough phy
    configurephy(ues{ueidx}, simparameters);
    setphyinterface(ues{ueidx}); % set the interface to phy layer
    % initialize the ul cqi values at gnb scheduler
    channelqualityinfoul = struct('rnti', ueidx, 'cqi', simparameters.initialchannelqualityul(ueidx, :));
    updatechannelqualityul(gnb.macentity.scheduler, channelqualityinfoul);
    
    % initialize the dl cqi values at gnb scheduler
    channelqualityinfodl = struct('rnti', ueidx, 'cqi', simparameters.initialchannelqualitydl(ueidx, :));
    updatechannelqualitydl(gnb.macentity.scheduler, channelqualityinfodl);
 
    % initialize the dl cqi values at ue for packet error probability estimation
    updatechannelqualitydl(ues{ueidx}.macentity, channelqualityinfodl);
    % setup logical channel at gnb for the ue
    configurelogicalchannel(gnb, ueidx, rlcchannelconfigstruct);
    % setup logical channel at ue
    configurelogicalchannel(ues{ueidx}, ueidx, rlcchannelconfigstruct);
    % create an object for on-off network traffic pattern and add it to the
    % specified ue. this object generates the uplink (ul) data traffic on the ue
    ulapp = networktrafficonoff('generatepacket', true, ...
        'ontime', simparameters.numframessim/100, 'offtime', 0, 'datarate', ulappdatarate(ueidx));
    ues{ueidx}.addapplication(ueidx, simparameters.lchconfig.lcid, ulapp);
    % create an object for on-off network traffic pattern for the specified
    % ue and add it to the gnb. this object generates the downlink (dl) data
    % traffic on the gnb for the ue
    dlapp = networktrafficonoff('generatepacket', true, ...
        'ontime', simparameters.numframessim/100, 'offtime', 0, 'datarate', dlappdatarate(ueidx));
    gnb.addapplication(ueidx, simparameters.lchconfig.lcid, dlapp);
end

simulation

% initialize wireless network simulator
nrnodes = [{gnb}; ues];
networksimulator = hwirelessnetworksimulator(nrnodes);

create objects to log rlc and mac traces.

if enabletraces
    % rlc metrics are logged for every 1 slot duration
    simrlclogger = hnrrlclogger(simparameters, lchinfo, networksimulator, gnb, ues);
    
    simschedulinglogger = hnrschedulinglogger(simparameters, networksimulator, gnb, ues);
    
    % create an object for cqi and rb grid visualization
    if simparameters.cqivisualization || simparameters.rbvisualization
        gridvisualizer = hnrgridvisualizer(simparameters, 'maclogger', simschedulinglogger);
    end
end

create an object for rlc and mac metrics visualization.

metricsvisualizer = hnrmetricsvisualizer(simparameters, 'enableschedulermetricsplots', true, ...
    'enablerlcmetricsplots', true, 'lchinfo', lchinfo, 'networksimulator', networksimulator, 'gnb', gnb, 'ues', ues);

run the simulation for the specified numframessim frames.

% calculate the simulation duration (in seconds) from 'numframessim'
simulationtime = simparameters.numframessim * 1e-2;
% run the simulation
run(networksimulator, simulationtime);

at the end of the simulation, the achieved value for system performance indicator is compared to their theoretical peak values (considering zero overheads). performance indicators displayed are achieved data rate (ul and dl), and achieved spectral efficiency (ul and dl). the peak values are calculated as per 3gpp tr 37.910.

displayperformanceindicators(metricsvisualizer);
peak ul throughput: 14.22 mbps. achieved cell ul throughput: 5.72 mbps
achieved ul throughput for each ue: [2.13        1.83           1        0.75]
achieved cell ul goodput: 5.18 mbps
achieved ul goodput for each ue: [1.94        1.67         0.9        0.67]
peak ul spectral efficiency: 2.84 bits/s/hz. achieved ul spectral efficiency for cell: 1.04 bits/s/hz 
peak dl throughput: 16.00 mbps. achieved cell dl throughput: 5.35 mbps
achieved dl throughput for each ue: [1.99        1.73        0.92        0.72]
achieved cell dl goodput: 4.82 mbps
achieved dl goodput for each ue: [1.78        1.56        0.82        0.64]
peak dl spectral efficiency: 3.20 bits/s/hz. achieved dl spectral efficiency for cell: 0.96 bits/s/hz

get the simulation metrics and save it in a mat-file. the simulation metrics are saved in a mat-file with the file name as simulationmetricsfile

metrics = getmetrics(metricsvisualizer);
save(simulationmetricsfile, 'metrics'); % save simulation metrics in a mat-file

simulation visualization

the five types of runtime visualization shown are:

  • display of cqi values for ues over the channel bandwidth: for details, see the 'channel quality visualization' figure.

  • display of resource grid assignment to ues: the 2-d time-frequency grid shows the resource allocation to the ues. for slot-based scheduling, it updates every 10 ms (frame length), and shows the rb allocation to the ues in the previous frame. for symbol-based scheduling, it updates every slot, and shows the rb allocation of symbols of the previous slot. for details, see the 'resource grid allocation' figure.

  • display of ul scheduling metrics plots: the 'uplink scheduler performance metrics' figure includes plots of the: ul throughput (per ue and cell), ul goodput (per ue and cell), resource share percentage among ues (out of the total ul resources) to convey the fairness of scheduling, and pending ul buffer status of the ues to show whether ues are getting sufficient resources. the maximum achievable data rate value for ul throughput is shown with a dashed line in throughput and goodput plots. the performance metrics plots update for every metricsstepsize slots. here, throughput is the number of bytes transmitted (including retransmissions) by a ue during a specified period, and goodput is the number of newly transmitted bytes by a ue during a specified period.

  • display of dl scheduling metrics plots: like uplink metrics plots, the 'downlink scheduler performance metrics' displays corresponding subplots for dl direction. the performance metrics plots update for every metricsstepsize slots. here, throughput is the number of bytes transmitted (including retransmissions) by a gnb during a specified period, and goodput is the number of newly transmitted bytes by a gnb during a specified period to each ue.

  • display of rlc metrics plot: the 'rlc metrics visualization' figure shows the number of bytes transmitted by rlc layer (per logical channel) for each ue. the rlc metrics plot updates for every metricsstepsize slots.

simulation logs

the parameters used for simulation and the simulation logs are saved in mat-files for post-simulation analysis and visualization. the simulation parameters are saved in mat-file with filename as the value of configuration parameter parameterslogfile. the per time step logs, scheduling assignment logs, and rlc logs are saved in the mat-file simulationlogfile. after the simulation, open it to load timesteplogs, schedulingassignmentlogs, and rlclogs in the workspace.

time step logs: the table shows a sample time step entry. each row of the table represents a symbol or a slot, based on the chosen scheduling type (symbol-based or slot-based). the information in a row is for dl, if the type of symbol (or slot) is dl. likewise, for ul symbol (or slot).

each row contains the following information:

  • timestamp: timestamp (in milliseconds)

  • frame: frame number.

  • slot: slot number in the frame.

  • symbol: symbol number in the slot (only for symbol-based scheduling).

  • type: symbol (or slot) type as 'dl', 'ul', or 'guard'. for slot-based scheduling, type can only be dl/ul. as the slot containing the guard symbols is assumed to be a dl slot with guard symbols at the end of the slot.

  • rbg allocation bitmap: n-by-p bitmap matrix, where n is the number of ues and p is the number of rbgs in the bandwidth. if an rbg is assigned to a particular ue, the corresponding bit is set to 1. for example, [ 0 0 1 1 0 1 0 1 0 1 0 0 0; 1 1 0 0 0 0 0 0 0 0 1 0 0; 0 0 0 0 1 0 1 0 1 0 0 1 1; 0 0 0 0 0 0 0 0 0 0 0 0 0] means, that the bandwidth has 13 rbgs and ue-1 is assigned the rbg indices 2, 3, 5, 7, and 9; ue-2 is assigned the rbg indices: 0, 1, and 10; ue-3 is assigned the rbg indices: 4, 6, 8, 11, and 12; and ue-4 is not assigned any rbg.

  • mcs: row vector of length n where n is the number of ues. each value corresponds to the modulation and coding scheme (mcs) index for the pusch or pdsch transmission. for example, [10 12 8 -1] means that only ue-1, ue-2, and ue-3 are assigned ul resources (symbol type is 'ul') for this symbol and use mcs values 10, 12, and 8, respectively.

  • harq process: row vector of length n, where n is the number of ues. the value is the harq process id used by ue for the pusch transmission or used by gnb for pdsch transmission. for example, [0 3 6 -1] means that only ue-1, ue-2, and ue-3 are assigned ul resources (symbol type is 'ul') for this symbol and use the harq process ids 0, 3, and 6, respectively.

  • ndi: row vector of length n, where n is the number of ues. the value is the ndi flag value in the assignment for pusch or pdsch transmission. for example, [0 0 1 -1] means that only ue-1, ue-2, and ue-3 are assigned ul resources for this symbol and use the ndi flag values (which determine whether a new transmission or a retransmission is done) are 0, 0, and 1, respectively.

  • tx type: tx type specifies the transmission type (new transmission or retransmission). row vector of length n, where n is the number of ues. possible values are either 'newtx', 'retx', or 'notx'. 'notx' means that the ue is not allotted pusch or pdsch resources. for example: ['newtx' 'newtx' 'retx' 'notx'] means that only ue-1, ue-2, and ue-3 are assigned ul resources for this symbol. ue-1 and ue-2 transmit a new packet from the specified harq process, while ue-3 retransmits the packet in the buffer of the specified harq process.

  • cqi for ues: n-by-p matrix, where n is the number of ues and p is the number of rbs in the bandwidth. a matrix element at position (i, j) corresponds to the cqi value for ue with rnti i at rb j.

  • harq ndi status: n-by-p matrix, where n is the number of ues and p is the number of harq processes. a matrix element at position (i, j) is the last received ndi flag at ue i for dl or ul harq process id j. for new transmissions, this value and the ndi flag in the pusch or pdsch assignment must toggle for the harq process in the assignment.

  • throughput bytes: row vector of length n, where n is the number of ues. the values represent ul or dl mac bytes transmitted by or for the ues in this symbol. note that the total throughput bytes for the complete pusch or pdsch transmission are shown in the row corresponding to the first symbol of the transmission.

  • goodput bytes: row vector of length n, where n is the number of ues. the values represent new ul or dl transmission mac bytes transmitted by or for the ues in this symbol. like throughput, all the goodput bytes for the complete pusch or pdsch are shown in the row corresponding to first symbol of the transmission.

  • buffer status of ues: row vector of length n, where n is the number of ues. the values represent the amount of ul direction pending buffers at ues (or dl direction pending buffers for ues at gnb).

scheduling assignment logs: information of all the scheduling assignments and related information is logged in this table. each row is one ul or dl assignment. for details of log format, see the 'simulation logs' section of example.

rlc logs: each row in the rlc logs represents a slot and contains this information:

  • timestamp: timestamp (in milliseconds)

  • frame: frame number.

  • slot: slot number in the frame.

  • ue rlc statistics: n-by-p cell, where n is the product of the number of ues and the number of logical channels, and p is the number of statistics collected. each row represents statistics of a logical channel in a ue. the last row contains the cumulative rlc statistics of the entire simulation.

  • gnb rlc statistics: n-by-p cell, where n is the product of the number of ues and the number of logical channels, and p is the number of statistics collected. each row represents statistics of a logical channel of a ue at gnb. the last row contains the cumulative rlc statistics of the entire simulation.

each row of the ue and gnb rlc statistics table represents a logical channel of a ue and contains:

  • rnti: radio network temporary identifier of a ue.

  • lcid: logical channel identifier.

  • txdatapdu: number of data pdus sent by rlc to mac layer.

  • txdatabytes: number of data bytes sent by rlc to mac layer.

  • retxdatapdu: number of data pdus retransmitted by rlc to mac layer.

  • retxdatabytes: number of data bytes retransmitted by rlc to mac layer.

  • txcontrolpdu: number of control pdus sent by rlc to mac layer.

  • txcontrolbytes: number of control bytes sent by rlc to mac layer.

  • txpacketsdropped: number of rlc sdus dropped by rlc due to tx buffer overflow.

  • txbytesdropped: number of bytes dropped by rlc due to tx buffer overflow.

  • timerpollretransmittimedout: number of times the poll retransmit timer expired.

  • rxdatapdu: number of data pdus received by rlc from mac layer.

  • rxdatabytes: number of data bytes received by rlc from mac layer.

  • rxdatapdudropped: number of received data pdus from mac which are dropped by rlc layer.

  • rxdatabytesdropped: number of received data bytes from mac which are dropped by rlc layer.

  • rxdatapduduplicate: number of duplicate pdus received by rlc from mac layer.

  • rxdatabytesduplicate: number of duplicate data bytes received by rlc from mac layer.

  • rxcontrolpdu: number of control pdus received by rlc from mac layer.

  • rxcontrolbytes: number of control bytes received by rlc from mac layer.

  • timerreassemblytimedout: number of times the reassembly timer expired.

  • timerstatusprohibittimedout: number of times the status prohibit timer expired.

you can run the script to get a post-simulation visualization of logs. in the post-simulation script, you are provided with variable islogreplay, which provides these options to visualize 'resource grid allocation' and 'channel quality visualization' figures.

  • set islogreplay to true for a replay of the simulation logs.

  • set islogreplay to false to analyze the details of a particular frame or a particular slot of a frame. in the 'resource grid allocation' window, input the frame number and slot number to visualize the resource assignment of the particular slot, if scheduling type is symbol-based. for slot-based scheduling, enter the frame number to visualize the resource assignment for the entire frame. the frame number entered here controls the frame number for 'channel quality visualization' figure too.

if enabletraces
    % read the logs and write them to mat-files
    % get the logs
    simulationlogs = cell(1,1);
    loginfo = struct('timesteplogs',[], 'schedulingassignmentlogs',[] ,'rlclogs', []);
    [loginfo.timesteplogs] = getschedulinglogs(simschedulinglogger);
    loginfo.schedulingassignmentlogs = getgrantlogs(simschedulinglogger); % scheduling assignments log
    loginfo.rlclogs = getrlclogs(simrlclogger); % rlc statistics logs
    simulationlogs{1} = loginfo;
    save(simulationlogfile, 'simulationlogs'); % save simulation logs in a mat-file
    save(parameterslogfile, 'simparameters'); % save simulation parameters in a mat-file
end

further exploration

you can use this example to further explore these options.

custom scheduling

you can modify the existing scheduling strategy to implement a custom one. example explains how to create a custom scheduling strategy and plug it into system-level simulation.

use 5g toolbox™ physical layer

you can also switch from passthrough phy layer to 5g toolbox™ physical layer processing by creating phy objects using and . for more details, see 'gnb and ues setup' section of .

use rlc am

you can also switch the operating mode of an rlc entity from um to acknowledged mode (am) by modifying the input structure fields entitytype and seqnumfieldlength in the configurelogicalchannel function of . set the entitytype to 3 and seqnumfieldlength to either 12 or 18. to explore the rlc am functionality, add these fields to the input structiure.

  • pollretransmittimer: timer used by the transmitting side of an rlc am entity in order to retransmit a poll

  • pollpdu: parameter used by the transmitting side of an rlc am entity to trigger a poll based on number of pdus

  • pollbyte: parameter used by the transmitting side of an rlc am entity to trigger a poll based on number of sdu bytes

  • maxretransmissions: maximum number of retransmissions corresponding to an rlc sdu, including its segments

  • statusprohibittimer: timer used by the receiving side of an rlc am entity in order to prohibit frequent transmission of status pdus

based on the chosen scheduling strategy, this example demonstrates the assignment of ul and dl resources to multiple ues by the gnb. ul and dl scheduling performance is analyzed based on runtime plots of throughput, goodput, resource share fairness, and pending buffer status of the ues. a more thorough post-simulation analysis by using the saved logs gives a detailed picture of the operations happening on a per symbol or per slot basis.

references

[1] 3gpp ts 38.214. “nr; physical layer procedures for data.” 3rd generation partnership project; technical specification group radio access network.

[2] 3gpp ts 38.321. “nr; medium access control (mac) protocol specification.” 3rd generation partnership project; technical specification group radio access network.

[3] 3gpp ts 38.322. “nr; radio link control (rlc) protocol specification.” 3rd generation partnership project; technical specification group radio access network.

[4] 3gpp ts 38.331. “nr; radio resource control (rrc) protocol specification.” 3rd generation partnership project; technical specification group radio access network.

related topics

网站地图