# Generating Datasets for Real-Time Scheduling on 5G New Radio
## 3 Problem Model  
The network considered in this paper includes a 5G base station and multiple users (as shown in Figure 1). The available frequency bandwidth of the base station is \(L\). A data flow can be upstream or downstream. Because the network topology is a star, in the following we ignore the direction of data flows. In the flow set \(F=\{f_{1},f_{2},\dots\}\), all flows have the same period \(P\). Each data flow \(f_{i}\) generates a packet \(v_{i}\) at time \(j\times P\), and \(v_{i}\) must obtain network resources before its deadline \((j+1)\times P\) so that it can be delivered to its destination in time. The packet set \(V\) includes all packets generated in one period. Since the packet set \(V\) in different periods are the same, we only consider how to schedule packets in one period. In the other periods, the schedules can be repeated. Packet \(v_{i}\) is characterized by a three-tuple \(<\)\(l_{j},c_{i},m_{i}\)\(>\), where \(l_{i}\) and \(c_{i}\) represent the frequency bandwidth and transmission time duration, respectively. The 5G numerology defines three subcarrier spacings for Frequency Range 1, including 180 kHz, 360 kHz, and 720 kHz, and the corresponding time slot lengths are 1 ms, 0.5 ms, and 0.25 ms, respectively. We define 180 kHz and 0.25 ms as the unit bandwidth and the unit time slot. As shown in Figure 2a, each small square represents a unit resource. Then, the three combinations of \(l_{i}\) and \(c_{i}\) are (1, 4), (2, 2), and (4, 1), all of which contain four resources. A packet can be transmitted within four resources regardless of its length, thus we omit the packet length in our problem model. The variable \(m_{i}\) represents the maximum transmission times of packet \(v_{i}\). Due to non-ideal channel conditions, retransmissions are necessary to improve reliability. The more transmissions, the higher the reliability of the packet. Different industrial applications have different reliability requirements: the reliability of control-related data should be 99.999% or 99.99999%, whereas the reliability of environmental data can be 99.9%. Thus, different packets need to specify different \(m_{i}\). In our network model, the maximum transmission times cannot be greater than \(M\), i.e., \(\forall v_{i}\in V,1\leq m_{i}\leq M\). We use a three-dimensional block to denote the resources assigned to a packet (as shown in Figure 2b). Thus, the schedule of packet \(v_{i}\) is to specify the coordinates \((x_{i},y_{i})\) of the upper-left corner of the base. Then, the resources used for one transmission are \(<\)\((x_{i},y_{i})\), \((x_{i}+c_{i},y_{i}+l_{i})\)\(>\) (these two diagonal coordinates represent a rectangle of resources); the resources for two transmissions are \(<\)  
transmission fails, the packet continues to occupy resources \(<\!\! (x_{i}+c_{i},y_{i})\), \((x_{i}+2\times c_{i},y_{i}+l_{i})\!\!>\) and is transmitted again; if it succeeds, the subsequent resources can be flexibly used by other packets. The flexible-use rule is shown in Figure 3a. If \(v_{i}\) covers \(v_{j}\), and \(v_{i}\) is successfully delivered after two transmissions, then \(v_{j}\) can use the resources assigned to \(v_{i}\)'s third transmission. If \(v_{i}\) cannot be delivered after two transmissions, then \(v_{j}\) cannot occupy \(v_{i}\)'s resources and cannot be transmitted. In addition to this rule, when network resources are sufficient, we do not allow any packets to be covered (as shown in Figure 3b). This is because covering \(v_{j}\) means \(v_{j}\) may not be transmitted and may have to be discarded. Only when the resources are insufficient can the high-reliability packets be allowed to cover the low-reliability packets. Last, but no less important, is that the resources assigned to \(v_{i}\) and \(v_{j}\) cannot conflict with each other (as shown in Figure 3c). Resource confliction will cause the second transmission of \(v_{i}\) to make \(v_{j}\) unable to be transmitted. However, the packets with the same number of transmissions are equally important and should not interfere with each other.