Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/apps/mode4App/Mode4App.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,22 @@ void Mode4App::initialize(int stage)
period_ = par("period");
priority_ = par("priority");
duration_ = par("duration");
delay50ms_ = par("delay50ms");
delay100ms_ = par("delay100ms");

sentMsg_ = registerSignal("sentMsg");
camGen_ = registerSignal("camGen");
delay_ = registerSignal("delay");
rcvdMsg_ = registerSignal("rcvdMsg");
cbr_ = registerSignal("cbr");

double delay = 0.001 * intuniform(0, 1000, 0);
scheduleAt((simTime() + delay).trunc(SIMTIME_MS), selfSender_);
SimTime jitter = uniform(SimTime(0, SIMTIME_MS), SimTime(1000, SIMTIME_MS));
if (delay50ms_){
jitter = uniform(SimTime(0, SIMTIME_MS), SimTime(50, SIMTIME_MS));
}
else if (delay100ms_){
jitter = uniform(SimTime(0, SIMTIME_MS), SimTime(100, SIMTIME_MS));
}
scheduleAt(simTime() + SimTime(100, SIMTIME_MS) + jitter, selfSender_);
}
}

Expand Down Expand Up @@ -110,7 +118,7 @@ void Mode4App::handleSelfMessage(cMessage* msg)
packet->setControlInfo(lteControlInfo);

Mode4BaseApp::sendLowerPackets(packet);
emit(sentMsg_, (long)1);
emit(camGen_, (int)1);

scheduleAt(simTime() + period_, selfSender_);
}
Expand All @@ -125,5 +133,5 @@ void Mode4App::finish()

Mode4App::~Mode4App()
{
binder_->unregisterNode(nodeId_);
// binder_->unregisterNode(nodeId_);
}
4 changes: 3 additions & 1 deletion src/apps/mode4App/Mode4App.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ class Mode4App : public Mode4BaseApp {
int nextSno_;
int priority_;
int duration_;
bool delay50ms_;
bool delay100ms_;
simtime_t period_;

simsignal_t sentMsg_;
simsignal_t camGen_;
simsignal_t delay_;
simsignal_t rcvdMsg_;
simsignal_t cbr_;
Expand Down
10 changes: 6 additions & 4 deletions src/apps/mode4App/mode4App.ned
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ import lte.apps.mode4App.Mode4BaseApp;
simple Mode4App like Mode4BaseApp
{
parameters:
int packetSize = default(10); // Size of the actual packet itself
int priority = default(3); // Priority of the packets sent
int packetSize = default(190); // Size of the actual packet itself
int priority = default(0); // Priority of the packets sent
int duration = default(1000); // MS before packet must be dropped
double period @unit("s") = default(0.1s);
int macNodeId = default(0);
bool delay50ms = default(false);
bool delay100ms = default(true);

@signal[sentMsg];
@statistic[sentMsg](title="Messages sent"; unit=""; source="sentMsg"; record=sum,vector);
@signal[camGen];
@statistic[camGen](title="Messages sent"; unit=""; source="camGen"; record=sum,vector);
@signal[delay];
@statistic[delay](title="Message Delay"; unit="s"; source="delay"; record=mean,vector);
@signal[rcvdMsg];
Expand Down
2 changes: 2 additions & 0 deletions src/common/LteCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ enum LtePhyFrameType
RACPKT,
D2DMODESWITCHPKT,
SCIPKT,
RESPKT,
UNKNOWN_TYPE
};

Expand All @@ -482,6 +483,7 @@ const LtePhyFrameTable phytypes[] = {
ELEM(GRANTPKT),
ELEM(D2DMODESWITCHPKT),
ELEM(SCIPKT),
ELEM(RESPKT),
ELEM(UNKNOWN_TYPE)
};

Expand Down
2 changes: 2 additions & 0 deletions src/common/LteControlInfo.msg
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class FlowControlInfoNonIp extends LteControlInfo {
long duration;
long srcAddr;
long dstAddr;
int RRI;
int messageCategory;
simtime_t creationTime;
}
//
Expand Down
43 changes: 34 additions & 9 deletions src/stack/mac/LteMac.ned
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ simple LteMacIPBase like LteMac {

bool ipBased = default(true);

double delayStartUp @unit(s) = default(0s);

//# Mac Queues
int queueSize @unit(B) = default(2MiB); // MAC Buffers queue size

Expand Down Expand Up @@ -138,7 +140,7 @@ simple LteMacIPBase like LteMac {
gates:
//#
//# Gates connecting RLC and MAC Layers
//#
//#

input RLC_to_MAC; // RLC to MAC
output MAC_to_RLC; // MAC to RLC
Expand All @@ -159,6 +161,8 @@ simple LteMacNonIPBase like LteMac {
@display("i=block/mac");

bool ipBased = default(false);

double delayStartUp @unit(s) = default(0s);

string interfaceTableModule = default("");

Expand Down Expand Up @@ -383,19 +387,37 @@ simple LteMacVUeMode4 extends LteMacNonIPBase
double probResourceKeep = default(0.4);
bool useCBR = default(false);
bool packetDropping = default(false);
bool rriLookup = default(false);
bool crLimit = default(false);
bool limeric = default(false);
bool usage = default(false);
bool adaptiveRRI = default(false);

double cbrTarget = default(0.68);
double alpha = default(0.016);
double beta = default(0.0012);
double gPlusMax = default(0.0005);
double gMinusMax = default(-0.00025);
double deltaMax = default(0.03);
double deltaMin = default(0.0006);
bool dccMechanism = default(false);

bool adjacencyPSCCHPSSCH = default(true);
bool randomScheduling = default(false);
bool nonPeriodic = default(false);
bool alwaysReschedule = default(false);
bool noTransmissions = default(false);

bool usePreconfiguredTxParams = default(false);
// Signals

// Signals
//
// Must haves:
// Grant break due to no time
// Grant break due to no large enough MCS
// Selected MCS
// Selected number of subchannels
// Packet size on break
// Packet size on break
// Maximum capacity on grant break

@signal[grantStartTime];
Expand Down Expand Up @@ -426,20 +448,23 @@ simple LteMacVUeMode4 extends LteMacNonIPBase
@statistic[grantRequests](title="Total number of requested grants"; source="grantRequests"; record=sum,vector);
@signal[packetDropDCC];
@statistic[packetDropDCC](title="Packet drop due to DCC mechanism"; source="packetDropDCC"; record=sum,vector);
@signal[rriChange];
@statistic[rriChange](title="RRI Change due to mechanism"; source="rriChange"; record=sum,vector);
@signal[resourceReselectionCounter];
@statistic[resourceReselectionCounter](title="ResourceReselectionCounter selectedNumber of transmissions"; source="resourceReselectionCounter"; record=sum,vector);
@signal[retainGrant];
@statistic[retainGrant](title="retainGrant if grant is maintained properly"; source="retainGrant"; record=sum,vector);
@signal[channelOccupancyRatio];
@statistic[channelOccupancyRatio](title="Channel Occupancy Ratio"; source="channelOccupancyRatio"; record=mean,vector);
@signal[limericDelta];
@statistic[limericDelta](title="Occupancy limit dictated by limeric"; source="limericDelta"; record=mean,vector);
@signal[crLimit];
@statistic[crLimit](title="CR limit for node"; source="crLimit"; record=mean,vector);

@signal[macNodeID];
@statistic[macNodeID](title="Reports Mac NodeID to allow for trans to nodeID"; source="macNodeID"; record=vector);
}

simple LteMacVUeMode4NonSPS extends LteMacVUeMode4
{
@class("LteMacVUeMode4NonSPS");
}

//
// eNodeB MAC layer of LTE stack
//
Expand Down
7 changes: 7 additions & 0 deletions src/stack/mac/buffer/harq/LteHarqBufferTx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ void LteHarqBufferTx::forceDropProcess(unsigned char acid)
numEmptyProc_++;
}

void LteHarqBufferTx::forceDropSelectedProcess()
{
(*processes_)[selectedAcid_]->forceDropProcess();
selectedAcid_ = HARQ_NONE;
numEmptyProc_++;
}

void LteHarqBufferTx::forceDropUnit(unsigned char acid, Codeword cw)
{
bool reset = (*processes_)[acid]->forceDropUnit(cw);
Expand Down
2 changes: 2 additions & 0 deletions src/stack/mac/buffer/harq/LteHarqBufferTx.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ class LteHarqBufferTx
*/
void dropProcess(unsigned char acid);

void forceDropSelectedProcess();

/**
* Sends simulated HARQNACK to all units of the process which contains
* the one whose id is specified as parameter.
Expand Down
6 changes: 5 additions & 1 deletion src/stack/mac/layer/LteMacBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ void LteMacBase::initialize(int stage)
/* Create buffers */
queueSize_ = par("queueSize");
maxBytesPerTti_ = par("maxBytesPerTti");
simtime_t startUpDelay = par("delayStartUp");
if (startUpDelay == 0 || startUpDelay < NOW){
startUpDelay = NOW;
}

/* Get reference to binder */
binder_ = getBinder();
Expand All @@ -322,7 +326,7 @@ void LteMacBase::initialize(int stage)
/* Start TTI tick */
ttiTick_ = new cMessage("ttiTick_");
ttiTick_->setSchedulingPriority(1); // TTI TICK after other messages
scheduleAt(NOW + TTI, ttiTick_);
scheduleAt(startUpDelay + TTI, ttiTick_);
totalOverflowedBytes_ = 0;
macBufferOverflowDl_ = registerSignal("macBufferOverflowDl");
macBufferOverflowUl_ = registerSignal("macBufferOverflowUl");
Expand Down
Loading