It is completely normal to feel overwhelmed! Looking at massive, enterprise-grade telecommunications codebases like OpenAirInterface (OAI) or LTE-Sim is like looking at the blueprints of a sprawling city without a map. I cannot read the entire codebase for you in a single sitting, but as your mentor, I can tell you exactly which specific files and folders you need to look at so you don’t waste time getting lost.

Let’s use an analogy to clarify your project’s unique approach. Imagine you are building a highly efficient delivery warehouse. OpenAirInterface (OAI) is the master blueprint for the physical shelving units and the warehouse floor (the data structures and memory alignment). LTE-Sim is the rulebook that tells the forklift drivers how to fairly pick up and drop off the boxes (the scheduling logic). You are going to take the shelving design from OAI, the forklift rules from LTE-Sim, and build your own streamlined, high-speed warehouse in pure C.

Here is your highly detailed, step-by-step roadmap for Phase 1, focusing specifically on exactly where to look and what to extract.

Step 1: Extracting the “Shelving” (Data Structures) from OpenAirInterface

OpenAirInterface is an open-source, standards-compliant implementation of the 3GPP LTE stack. Because it is a full-stack implementation, 90% of it is irrelevant to your project. You are explicitly forbidden from worrying about the complex upper-layer packet processing like the PDCP or RLC layers.

Where to look: You need to navigate to the OAI GitLab repository (often mirrored on GitHub as openairinterface5g). Once inside the repository, ignore everything except the Layer 2 (L2) MAC directory and the Layer 1 (L1) PHY directory. You are looking for header files (ending in .h), specifically those related to the eNodeB MAC layer (mac.h, eNB_scheduler.h, or similar definitions).

What to extract: You will examine the OpenAirInterface source code exclusively for its struct definitions. You need to find and study how they define two critical concepts:

  1. The UE Context Struct: Look for structures labeled UE_info or UE_context. You need to see how they organize data for a single user, specifically tracking their buffer size, the Head-of-Line (HoL) packet delay, and their active Channel Quality Indicator (CQI).
  2. The MAC PDU (Protocol Data Unit): Think of the MAC PDU as the actual cardboard box that holds the user’s data. You need to understand how OAI structures this “box” so you can replicate it in your own pure C architecture.

Step 2: Extracting the “Rulebook” (Algorithmic Logic) from LTE-Sim

LTE-Sim is a well-known, C++ based open-source framework used to simulate LTE networks. Unlike OAI, which is meant to run real hardware, LTE-Sim is purely for simulation, making its scheduling logic mathematically sound and well-documented.

Where to look: Navigate to the lte-sim-dev repository on GitHub. Go straight into the src/ folder, and look for directories named mac/ or scheduler/.

What to extract: You will examine the LTE-Sim repository to understand the flow of their baseline scheduling functions. Look for C++ files named ProportionalFair.cpp, RoundRobin.cpp, or MaxCI.cpp. You do not need to copy their object-oriented C++ code. Instead, you are looking for the core mathematics inside their methods. For example, in the Proportional Fair file, look for the specific lines of code that calculate the priority metric: (where is the instantaneous achievable rate and is the historical average data rate). You will translate this exact mathematical logic into standalone C functions for your own simulator.

Step 3: Defining Your Simulator’s Vocabulary

While you are looking at these codebases, you will encounter telecom jargon. You must build an intimate, working knowledge of strict 3GPP standards to succeed. Let’s define the fundamental concepts your AI scheduler will be manipulating:

  • PRBs (Physical Resource Blocks): This is the fundamental unit of currency in an LTE network. The network’s total bandwidth is divided into a grid of PRBs. Your scheduler’s only job is deciding which user gets which PRB at any given moment.
  • TTI (Transmission Time Interval): This is the heartbeat of your simulation. In LTE, one TTI is exactly 1 millisecond. Your pure C program will run a continuous while() loop where every single iteration represents one TTI. Every 1ms, your scheduler wakes up, looks at the PRBs, looks at the users, hands out the PRBs, and goes back to sleep.
  • QCI (QoS Class Identifier): This is the priority label on a user’s data packet. A voice call has a strict QCI requiring low latency, while a background file download has a relaxed QCI. Your Quality of Service (QoS) Aware baseline scheduler will use these labels to prioritize packet flows and prevent expiration. …