lte: Discard packets arriving after UE context removal at EpcEnbApplication

Due to RLF the UE context deletion might get triggered during the reception of a packet by EpcEnbApplication from EpcSgwApplication. This patch will enable  EpcEnbApplication  to discard  such packets.
This commit is contained in:
ZorazeAli
2019-04-23 16:21:07 +02:00
parent 7ba7fd64dc
commit 73d42fac71
2 changed files with 12 additions and 4 deletions

View File

@@ -197,8 +197,10 @@ EpcEnbApplication::DoUeContextRelease (uint16_t rnti)
{
uint32_t teid = bidIt->second;
m_teidRbidMap.erase (teid);
NS_LOG_INFO ("TEID: " << teid << " erased");
}
m_rbidTeidMap.erase (rntiIt);
NS_LOG_INFO ("RNTI: " << rntiIt->first << " erased");
}
}
@@ -295,10 +297,15 @@ EpcEnbApplication::RecvFromS1uSocket (Ptr<Socket> socket)
packet->RemoveHeader (gtpu);
uint32_t teid = gtpu.GetTeid ();
std::map<uint32_t, EpsFlowId_t>::iterator it = m_teidRbidMap.find (teid);
NS_ASSERT_MSG (it != m_teidRbidMap.end (), "cell id = " << m_cellId);
m_rxS1uSocketPktTrace (packet->Copy ());
SendToLteSocket (packet, it->second.m_rnti, it->second.m_bid);
if (it == m_teidRbidMap.end ())
{
NS_LOG_WARN ("UE context at cell id " << m_cellId << " not found, discarding packet");
}
else
{
m_rxS1uSocketPktTrace (packet->Copy ());
SendToLteSocket (packet, it->second.m_rnti, it->second.m_bid);
}
}
void

View File

@@ -423,6 +423,7 @@ EpcPgwApplication::DoRecvDeleteBearerResponse (Ptr<Packet> packet)
for (auto &epsBearerId : msg.GetEpsBearerIds ())
{
// Remove de-activated bearer contexts from PGW side
NS_LOG_INFO ("PGW removing bearer " << (uint16_t) epsBearerId << " of IMSI " << imsi);
ueit->second->RemoveBearer (epsBearerId);
}
}