scheduleGrant: a capped grant marks a still-backlogged connection inactive (LteSchedulerEnb.cc:403).

Open Beginner friendly
#308 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
networking

Research direction

The bug is in scheduleGrant in src/simu5g/stack/mac/scheduler/LteSchedulerEnb.cc, around lines 403-408, where queueLength is set to 0 and active is set to false while backlog remains after a capped grant. Read that function alongside the candidate one-line change that computes queueLength from the pre-grant backlog. Done means a capped grant leaves a still-backlogged connection active, and uncapped grants behave as before.

Written by the indexing model from the issue text.

Description

Issue:

When the grant is capped (bytes < backlog), toServe reaches 0 in the band that exhausts the cap.

https://github.com/Unipisa/Simu5G/blob/466f9a96099bc4c82ea52ddfd0c936e32b4bf5b2/src/simu5g/stack/mac/scheduler/LteSchedulerEnb.cc#L403

Line 403 then evaluates uBytes > 0, sets queueLength = 0 while backlog remains, and line 408 reports active = false. A scheduler that honours active drops the connection from its active set.

Who is affected.

  • In UL the connection only comes back through the backlog callback on the next BSR. So the UE gets one transport block per SR / RAC → BSR cycle.
  • Uncapped callers (LteMaxCI) are unaffected: there toServe = queueLength, so both reach 0 together.

Candidate correction (one line):

-            queueLength = (uBytes > toServe) ? 0 : queueLength - uBytes;
+            queueLength = (uBytes > queueLength) ? 0 : queueLength - uBytes;

The new value is the pre-grant backlog minus the booked bytes, floored at 0.
Nothing else changes: not toServe, the band booking, the virtual-buffer or mirror drains, nor the quotas.

Dominant language
C++
Stars
236
Forks
118
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Unipisa/Simu5G

All issues in Unipisa/Simu5G

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.