lte: Extend EpcMme, EpcSgw and EpcPgw App to remove UE context

This commit is contained in:
Vignesh Babu
2019-04-12 14:30:10 +02:00
committed by ZorazeAli
parent 3856351336
commit bfdbffc215
3 changed files with 16 additions and 2 deletions

View File

@@ -236,6 +236,7 @@ EpcMmeApplication::RemoveBearer (Ptr<UeInfo> ueInfo, uint8_t epsBearerId)
if (bit->bearerId == epsBearerId)
{
ueInfo->bearersToBeActivated.erase (bit);
ueInfo->bearerCounter = ueInfo->bearerCounter - 1;
break;
}
++bit;
@@ -352,7 +353,18 @@ EpcMmeApplication::DoRecvDeleteBearerRequest (GtpcHeader &header, Ptr<Packet> pa
for (auto &ebid : msg.GetEpsBearerIds ())
{
epsBearerIds.push_back (ebid);
RemoveBearer (it->second, ebid); //schedules function to erase, context of de-activated bearer
/*
* This condition is added to not remove bearer info at MME
* when UE gets disconnected since the bearers are only added
* at beginning of simulation at MME and if it is removed the
* bearers cannot be activated again unless scheduled for
* addition of the bearer during simulation
*
*/
if (it->second->cellId == 0)
{
RemoveBearer (it->second, ebid); //schedules function to erase, context of de-activated bearer
}
}
msgOut.SetEpsBearerIds (epsBearerIds);
msgOut.SetTeid (imsi);

View File

@@ -57,6 +57,8 @@ void
EpcPgwApplication::UeInfo::RemoveBearer (uint8_t bearerId)
{
NS_LOG_FUNCTION (this << (uint16_t) bearerId);
std::map<uint8_t, uint32_t >::iterator it = m_teidByBearerIdMap.find (bearerId);
m_tftClassifier.Delete (it->second); //delete tft
m_teidByBearerIdMap.erase (bearerId);
}

View File

@@ -369,7 +369,7 @@ EpcSgwApplication::DoRecvDeleteBearerCommand (Ptr<Packet> packet)
Ptr<Packet> packetOut = Create <Packet> ();
packetOut->AddHeader (msgOut);
NS_LOG_DEBUG ("Send DeleteBearerCommand to PGW " << m_pgwAddr);
m_s11Socket->SendTo (packetOut, 0, InetSocketAddress (m_pgwAddr, m_gtpcUdpPort));
m_s5cSocket->SendTo (packetOut, 0, InetSocketAddress (m_pgwAddr, m_gtpcUdpPort));
}
void