Professional Documents
Culture Documents
Time-to-Trigger (TTT) Used in LTE Handover Modeling - NetSim Support Portal
Time-to-Trigger (TTT) Used in LTE Handover Modeling - NetSim Support Portal
The following procedure can be followed to involve Time-to-Trigger parameter in NetSim LTE Simulations:
1. Open NetSim source code in Visual Studio 2015/2017/2019 by double-clicking on the NetSim.sln file present in
“<NetSim_Install_Directory>/src/Simulation” folder. (from NetSim v11.1 or higher versions, source codes should
be opened using Open Code option only)
2. Go to the LTE project through the solution explorer and open the file LTE.h. Add the lines of code highlighted in red
as shown below:
#define MAX_HARQ_PROCESS 8
LTE_Handover;
struct stru_LTE_Handover_Status
bool status;
double time;
NETSIM_ID targetENB;
https://support.tetcos.com/support/solutions/articles/14000084404-how-to-implement-time-to-trigger-ttt-used-in-lte-handover-modeling-
How to implement Time-to-Trigger(TTT) used in LTE Handover modeling? : NetSim Support Portal
};
LTE_Handover ** devices;
/* 3GPP TS 36.213
*7.1.7.2.1 Transport blocks not mapped to two or more layer spatial multiplexing
*For 110 1≤ NPRB ≤ , the TBS is given by the ( TBS I ,NPRB ) entry of Table 7.1.7.2.1-1.
*/
#define LTE_TBS_INDEX_MAX27
3. Go to LTE project through the solution explorer and open the file LTE.c. Add the lines of code highlighted in red in
fn_NetSim_LTE_Init() as shown below:
_declspec(dllexport) int fn_NetSim_LTE_Init()
int i;
devices[i]->status = false;
devices[i]->targetENB = 0;
devices[i]->time = 0.0;
return fn_NetSim_LTE_Init_F();
}
4. Go to LTE project through the solution explorer and open the file NAS.c. Add the line of code highlighted in red as
shown below:
#include "main.h"
#include "LTE.h"
//code modification
int i, count = 0;
double tempfavourablesnr = 0;
NETSIM_ID tempfavourabledevice;
NETSIM_ID enbid;
NETSIM_ID ueid;
//code modification
double dSNR = 0;
double dTargetSNR = 0;
NETSIM_ID target = 0;
NETSIM_ID ueId = 0;
((LTE_MAC_PACKET*)pstruEventDetails->pPacket->pstruMacData->Packet_MACProtocol)->MessageVar;
while (report)
if (report->nENBId == pstruEventDetails->nDeviceId)
//code modification
enbid = report->nENBId;
ueid = report->nUEId;
//code modification
ueId = report->nUEId;
break;
}
report = LIST_NEXT(report);
report = (LTE_MEASUREMENT_REPORT*)((LTE_MAC_PACKET*)pstruEventDetails->pPacket-
>pstruMacData->Packet_MACProtocol)->MessageVar;
while (report)
if (report->nENBId != pstruEventDetails->nDeviceId)
tempfavourabledevice = report->nENBId;
dTargetSNR = d;
report = LIST_NEXT(report);
if (devices[ueid]->targetENB == 0)
devices[ueid]->targetENB == enbid;
devices[ueid]->time = pstruEventDetails->dEventTime;
if (devices[ueid]->targetENB == tempfavourabledevice)
devices[ueid]->status = true;
devices[ueid]->time = pstruEventDetails->dEventTime;
}
https://support.tetcos.com/support/solutions/articles/14000084404-how-to-implement-time-to-trigger-ttt-used-in-lte-handover-modeling-
How to implement Time-to-Trigger(TTT) used in LTE Handover modeling? : NetSim Support Portal
else
report = (LTE_MEASUREMENT_REPORT*)((LTE_MAC_PACKET*)pstruEventDetails->pPacket-
>pstruMacData->Packet_MACProtocol)->MessageVar;
while (report)
if (report->nENBId == devices[ueid]->targetENB)
isPartofSameMME(pstruEventDetails->nDeviceId,
report->nENBId))
devices[ueid]->status = true;
devices[ueid]->targetENB = tempfavourabledevice;
devices[ueid]->time = pstruEventDetails->dEventTime;
break;
}
devices[ueid]->targetENB = tempfavourabledevice;
report = LIST_NEXT(report);
fn_NetSim_Packet_FreePacket(pstruEventDetails->pPacket);
NetSim_BUFFER* buffer;
NetSim_PACKET* packet;
packet = fn_NetSim_LTE_CreateCtrlPacket(pstruEventDetails->dEventTime,
LTEPacket_HandoverRequest,
devices[ueid]->targetENB,
pstruEventDetails->nDeviceId,
devices[ueid]->targetENB,
HO_REQUEST_SIZE);
macPacket->logicalChannel = LogicalChannel_CCCH;
macPacket->MessageType = LTEPacket_HandoverRequest;
packet->pstruMacData->Packet_MACProtocol = macPacket;
packet->pstruMacData->dontFree = true;
macPacket->MessageVar = request;
request->nSourceENB = pstruEventDetails->nDeviceId;
https://support.tetcos.com/support/solutions/articles/14000084404-how-to-implement-time-to-trigger-ttt-used-in-lte-handover-modeling-
How to implement Time-to-Trigger(TTT) used in LTE Handover modeling? : NetSim Support Portal
request->nTargetENB = devices[ueid]->targetENB;
request->nUEId = ueId;
((LTE_HO_INFO*)macPacket->MessageVar)->sourceMac = DEVICE_MACVAR(pstruEventDetails-
>nDeviceId, 1);
if (!fn_NetSim_GetBufferStatus(buffer))
pstruEventDetails->dPacketSize = HO_REQUEST_SIZE;
pstruEventDetails->nEventType = MAC_OUT_EVENT;
pstruEventDetails->nPacketId = packet->nPacketId;
pstruEventDetails->pPacket = NULL;
pstruEventDetails->szOtherDetails = NULL;
pstruEventDetails->nApplicationId = 0;
pstruEventDetails->nInterfaceId = 2;
pstruEventDetails->nSegmentId = 0;
fnpAddEvent(pstruEventDetails);
devices[ueid]->status = false;
return 1;
6. The new constant TIME_TO_TRIGGER that we have added to the code can be customized as per the requirement
and is currently set to 5 Seconds. Based on the value set, Handover will happen if the difference in signal strength
between the target and serving cell is greater than the Handover Margin(HANDOVER_DIFF) for a time period greater
than TIME_TO_TRIGGER.
7. After setting HANDOVER_DIFF and TIME_TO_TRIGGER parameters as per the requirement, right-click on the LTE
module in the solution explorer and select rebuild.
8. Upon a successful build, you will get a new libLTE.dll file in the “<NetSim_Install_Directory>/src/Simulation/DLL”
folder. (this step can be ignored in case of NetSim v11.1 or higher versions)
9. Copy this newly-built DLL file and replace it in the bin folder of NetSim after you rename the original libLTE.dll file
which is already existing there(as a backup). (this step can be ignored in case of NetSim v11.1 or higher versions)
10. Now upon running LTE simulations involving UE handovers, handover will be initiated only if the difference in signal
strength is more than the HANDOVER_DIFF for a time period greater than TIME_TO_TRIGGER specified by you.
11. You can then run multiple simulations of the same network scenario varying certain parameters such as seed
values, the velocity of devices, etc and take the average Number of Handovers and Throughput.
12. Record the results of every test case in an excel file and once all the test cases are complete plot graphs of
Number of Handovers versus Speed and Throughput versus speed.
A sample graph that was obtained upon running several simulations with the above code modifications is shown below:
https://support.tetcos.com/support/solutions/articles/14000084404-how-to-implement-time-to-trigger-ttt-used-in-lte-handover-modeling-
How to implement Time-to-Trigger(TTT) used in LTE Handover modeling? : NetSim Support Portal
https://support.tetcos.com/support/solutions/articles/14000084404-how-to-implement-time-to-trigger-ttt-used-in-lte-handover-modeling-