Index: src/lte/model/lte-enb-rrc.cc |
=================================================================== |
--- a/src/lte/model/lte-enb-rrc.cc |
+++ b/src/lte/model/lte-enb-rrc.cc |
@@ -143,7 +143,7 @@ |
m_sourceX2apId (0), |
m_sourceCellId (0), |
m_needPhyMacConfiguration (false) |
-{ |
+{ |
NS_LOG_FUNCTION (this); |
} |
@@ -314,27 +314,27 @@ |
return tid; |
} |
-void |
+void |
UeManager::SetSource (uint16_t sourceCellId, uint16_t sourceX2apId) |
{ |
m_sourceX2apId = sourceX2apId; |
m_sourceCellId = sourceCellId; |
} |
-void |
+void |
UeManager::SetImsi (uint64_t imsi) |
{ |
m_imsi = imsi; |
} |
void |
-UeManager::SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gtpTeid, Ipv4Address transportLayerAddress) |
+UeManager::SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gtpTeid, Ipv4Address transportLayerAddress, Ipv6Address transportLayerAddressV6) |
{ |
NS_LOG_FUNCTION (this << (uint32_t) m_rnti); |
Ptr<LteDataRadioBearerInfo> drbInfo = CreateObject<LteDataRadioBearerInfo> (); |
uint8_t drbid = AddDataRadioBearerInfo (drbInfo); |
- uint8_t lcid = Drbid2Lcid (drbid); |
+ uint8_t lcid = Drbid2Lcid (drbid); |
uint8_t bid = Drbid2Bid (drbid); |
NS_ASSERT_MSG ( bearerId == 0 || bid == bearerId, "bearer ID mismatch (" << (uint32_t) bid << " != " << (uint32_t) bearerId << ", the assumption that ID are allocated in the same way by MME and RRC is not valid any more"); |
drbInfo->m_epsBearerIdentity = bid; |
@@ -342,13 +342,14 @@ |
drbInfo->m_logicalChannelIdentity = lcid; |
drbInfo->m_gtpTeid = gtpTeid; |
drbInfo->m_transportLayerAddress = transportLayerAddress; |
+ drbInfo->m_transportLayerAddressV6 = transportLayerAddressV6; |
if (m_state == HANDOVER_JOINING) |
{ |
- // setup TEIDs for receiving data eventually forwarded over X2-U |
+ // setup TEIDs for receiving data eventually forwarded over X2-U |
LteEnbRrc::X2uTeidInfo x2uTeidInfo; |
x2uTeidInfo.rnti = m_rnti; |
- x2uTeidInfo.drbid = drbid; |
+ x2uTeidInfo.drbid = drbid; |
std::pair<std::map<uint32_t, LteEnbRrc::X2uTeidInfo>::iterator, bool> |
ret = m_rrc->m_x2uTeidInfoMap.insert (std::pair<uint32_t, LteEnbRrc::X2uTeidInfo> (gtpTeid, x2uTeidInfo)); |
NS_ASSERT_MSG (ret.second == true, "overwriting a pre-existing entry in m_x2uTeidInfoMap"); |
@@ -468,7 +469,7 @@ |
//populating RadioResourceConfigDedicated information element as per 3GPP TS 36.331 version 9.2.0 |
rrcd.havePhysicalConfigDedicated = true; |
rrcd.physicalConfigDedicated = m_physicalConfigDedicated; |
- |
+ |
//populating RRCConnectionReconfiguration message as per 3GPP TS 36.331 version 9.2.0 Release 9 |
LteRrcSap::RrcConnectionReconfiguration msg; |
msg.haveMeasConfig = false; |
@@ -489,7 +490,7 @@ |
m_s1SapProvider->DoSendReleaseIndication (imsi,rnti,bearerId); |
} |
-void |
+void |
UeManager::ScheduleRrcConnectionReconfiguration () |
{ |
NS_LOG_FUNCTION (this); |
@@ -522,7 +523,7 @@ |
} |
} |
-void |
+void |
UeManager::PrepareHandover (uint16_t cellId) |
{ |
NS_LOG_FUNCTION (this << cellId); |
@@ -578,7 +579,7 @@ |
} |
-void |
+void |
UeManager::RecvHandoverRequestAck (EpcX2SapUser::HandoverRequestAckParams params) |
{ |
NS_LOG_FUNCTION (this); |
@@ -590,14 +591,14 @@ |
// is expected to be sent transparently to the UE; however, here we |
// decode the message and eventually reencode it. This way we can |
// support both a real RRC protocol implementation and an ideal one |
- // without actual RRC protocol encoding. |
+ // without actual RRC protocol encoding. |
Ptr<Packet> encodedHandoverCommand = params.rrcContext; |
LteRrcSap::RrcConnectionReconfiguration handoverCommand = m_rrc->m_rrcSapUser->DecodeHandoverCommand (encodedHandoverCommand); |
m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, handoverCommand); |
SwitchToState (HANDOVER_LEAVING); |
- m_handoverLeavingTimeout = Simulator::Schedule (m_rrc->m_handoverLeavingTimeoutDuration, |
- &LteEnbRrc::HandoverLeavingTimeout, |
+ m_handoverLeavingTimeout = Simulator::Schedule (m_rrc->m_handoverLeavingTimeoutDuration, |
+ &LteEnbRrc::HandoverLeavingTimeout, |
m_rrc, m_rnti); |
NS_ASSERT (handoverCommand.haveMobilityControlInfo); |
m_rrc->m_handoverStartTrace (m_imsi, m_rrc->m_cellId, m_rnti, handoverCommand.mobilityControlInfo.targetPhysCellId); |
@@ -632,7 +633,7 @@ |
return BuildRadioResourceConfigDedicated (); |
} |
-LteRrcSap::RrcConnectionReconfiguration |
+LteRrcSap::RrcConnectionReconfiguration |
UeManager::GetRrcConnectionReconfigurationForHandover () |
{ |
NS_LOG_FUNCTION (this); |
@@ -711,6 +712,7 @@ |
etbsi.erabLevelQosParameters = it->second->m_epsBearer; |
etbsi.dlForwarding = false; |
etbsi.transportLayerAddress = it->second->m_transportLayerAddress; |
+ etbsi.transportLayerAddressV6 = it->second->m_transportLayerAddressV6; |
etbsi.gtpTeid = it->second->m_gtpTeid; |
ret.push_back (etbsi); |
} |
@@ -740,7 +742,7 @@ |
} |
} |
-void |
+void |
UeManager::RecvHandoverPreparationFailure (uint16_t cellId) |
{ |
NS_LOG_FUNCTION (this << cellId); |
@@ -758,11 +760,11 @@ |
} |
} |
-void |
+void |
UeManager::RecvSnStatusTransfer (EpcX2SapUser::SnStatusTransferParams params) |
{ |
NS_LOG_FUNCTION (this); |
- for (std::vector<EpcX2Sap::ErabsSubjectToStatusTransferItem>::iterator erabIt |
+ for (std::vector<EpcX2Sap::ErabsSubjectToStatusTransferItem>::iterator erabIt |
= params.erabsSubjectToStatusTransferList.begin (); |
erabIt != params.erabsSubjectToStatusTransferList.end (); |
++erabIt) |
@@ -777,7 +779,7 @@ |
} |
} |
-void |
+void |
UeManager::RecvUeContextRelease (EpcX2SapUser::UeContextReleaseParams params) |
{ |
NS_LOG_FUNCTION (this); |
@@ -788,7 +790,7 @@ |
// methods forwarded from RRC SAP |
-void |
+void |
UeManager::CompleteSetupUe (LteEnbRrcSapProvider::CompleteSetupUeParameters params) |
{ |
NS_LOG_FUNCTION (this); |
@@ -933,7 +935,7 @@ |
} |
} |
-void |
+void |
UeManager::RecvRrcConnectionReestablishmentRequest (LteRrcSap::RrcConnectionReestablishmentRequest msg) |
{ |
NS_LOG_FUNCTION (this); |
@@ -958,14 +960,14 @@ |
SwitchToState (CONNECTION_REESTABLISHMENT); |
} |
-void |
+void |
UeManager::RecvRrcConnectionReestablishmentComplete (LteRrcSap::RrcConnectionReestablishmentComplete msg) |
{ |
NS_LOG_FUNCTION (this); |
SwitchToState (CONNECTED_NORMALLY); |
} |
-void |
+void |
UeManager::RecvMeasurementReport (LteRrcSap::MeasurementReport msg) |
{ |
uint8_t measId = msg.measResults.measId; |
@@ -1109,8 +1111,8 @@ |
{ |
NS_LOG_FUNCTION (this); |
const uint8_t MAX_DRB_ID = 32; |
- for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID; |
- drbid != m_lastAllocatedDrbid; |
+ for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID; |
+ drbid != m_lastAllocatedDrbid; |
drbid = (drbid + 1) % MAX_DRB_ID) |
{ |
if (drbid != 0) // 0 is not allowed |
@@ -1194,51 +1196,51 @@ |
return rrcd; |
} |
-uint8_t |
+uint8_t |
UeManager::GetNewRrcTransactionIdentifier () |
{ |
return ++m_lastRrcTransactionIdentifier; |
} |
-uint8_t |
+uint8_t |
UeManager::Lcid2Drbid (uint8_t lcid) |
{ |
NS_ASSERT (lcid > 2); |
return lcid - 2; |
} |
-uint8_t |
+uint8_t |
UeManager::Drbid2Lcid (uint8_t drbid) |
{ |
return drbid + 2; |
} |
-uint8_t |
+uint8_t |
UeManager::Lcid2Bid (uint8_t lcid) |
{ |
NS_ASSERT (lcid > 2); |
return lcid - 2; |
} |
-uint8_t |
+uint8_t |
UeManager::Bid2Lcid (uint8_t bid) |
{ |
return bid + 2; |
} |
-uint8_t |
+uint8_t |
UeManager::Drbid2Bid (uint8_t drbid) |
{ |
return drbid; |
} |
-uint8_t |
+uint8_t |
UeManager::Bid2Drbid (uint8_t bid) |
{ |
return bid; |
} |
-void |
+void |
UeManager::SwitchToState (State newState) |
{ |
NS_LOG_FUNCTION (this << ToString (newState)); |
@@ -1355,7 +1357,7 @@ |
UintegerValue (0), // default tx-mode |
MakeUintegerAccessor (&LteEnbRrc::m_defaultTransmissionMode), |
MakeUintegerChecker<uint8_t> ()) |
- .AddAttribute ("EpsBearerToRlcMapping", |
+ .AddAttribute ("EpsBearerToRlcMapping", |
"Specify which type of RLC will be used for each type of EPS bearer. ", |
EnumValue (RLC_SM_ALWAYS), |
MakeEnumAccessor (&LteEnbRrc::m_epsBearerToRlcMapping), |
@@ -1373,7 +1375,7 @@ |
.AddAttribute ("SrsPeriodicity", |
"The SRS periodicity in milliseconds", |
UintegerValue (40), |
- MakeUintegerAccessor (&LteEnbRrc::SetSrsPeriodicity, |
+ MakeUintegerAccessor (&LteEnbRrc::SetSrsPeriodicity, |
&LteEnbRrc::GetSrsPeriodicity), |
MakeUintegerChecker<uint32_t> ()) |
@@ -1583,14 +1585,14 @@ |
m_macSapProvider = s; |
} |
-void |
+void |
LteEnbRrc::SetS1SapProvider (EpcEnbS1SapProvider * s) |
{ |
m_s1SapProvider = s; |
} |
-EpcEnbS1SapUser* |
+EpcEnbS1SapUser* |
LteEnbRrc::GetS1SapUser () |
{ |
return m_s1SapUser; |
@@ -1809,7 +1811,7 @@ |
return true; |
} |
-void |
+void |
LteEnbRrc::SetForwardUpCallback (Callback <void, Ptr<Packet> > cb) |
{ |
m_forwardUpCallback = cb; |
@@ -1869,10 +1871,10 @@ |
Ptr<UeManager> ueManager = GetUeManager (rnti); |
ueManager->PrepareHandover (cellId); |
- |
+ |
} |
-void |
+void |
LteEnbRrc::DoCompleteSetupUe (uint16_t rnti, LteEnbRrcSapProvider::CompleteSetupUeParameters params) |
{ |
NS_LOG_FUNCTION (this << rnti); |
@@ -1900,35 +1902,35 @@ |
GetUeManager (rnti)->RecvRrcConnectionReconfigurationCompleted (msg); |
} |
-void |
+void |
LteEnbRrc::DoRecvRrcConnectionReestablishmentRequest (uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentRequest msg) |
{ |
NS_LOG_FUNCTION (this << rnti); |
GetUeManager (rnti)->RecvRrcConnectionReestablishmentRequest (msg); |
} |
-void |
+void |
LteEnbRrc::DoRecvRrcConnectionReestablishmentComplete (uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentComplete msg) |
{ |
NS_LOG_FUNCTION (this << rnti); |
GetUeManager (rnti)->RecvRrcConnectionReestablishmentComplete (msg); |
} |
-void |
+void |
LteEnbRrc::DoRecvMeasurementReport (uint16_t rnti, LteRrcSap::MeasurementReport msg) |
{ |
NS_LOG_FUNCTION (this << rnti); |
GetUeManager (rnti)->RecvMeasurementReport (msg); |
} |
-void |
+void |
LteEnbRrc::DoDataRadioBearerSetupRequest (EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters request) |
{ |
Ptr<UeManager> ueManager = GetUeManager (request.rnti); |
- ueManager->SetupDataRadioBearer (request.bearer, request.bearerId, request.gtpTeid, request.transportLayerAddress); |
+ ueManager->SetupDataRadioBearer (request.bearer, request.bearerId, request.gtpTeid, request.transportLayerAddress, request.transportLayerAddressV6); |
} |
-void |
+void |
LteEnbRrc::DoPathSwitchRequestAcknowledge (EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters params) |
{ |
Ptr<UeManager> ueManager = GetUeManager (params.rnti); |
@@ -1986,7 +1988,7 @@ |
it != req.bearers.end (); |
++it) |
{ |
- ueManager->SetupDataRadioBearer (it->erabLevelQosParameters, it->erabId, it->gtpTeid, it->transportLayerAddress); |
+ ueManager->SetupDataRadioBearer (it->erabLevelQosParameters, it->erabId, it->gtpTeid, it->transportLayerAddress, it->transportLayerAddressV6); |
EpcX2Sap::ErabAdmittedItem i; |
i.erabId = it->erabId; |
ackParams.admittedBearers.push_back (i); |
@@ -2127,7 +2129,7 @@ |
NS_LOG_LOGIC ("ueData = " << params.ueData); |
NS_LOG_LOGIC ("ueData size = " << params.ueData->GetSize ()); |
- std::map<uint32_t, X2uTeidInfo>::iterator |
+ std::map<uint32_t, X2uTeidInfo>::iterator |
teidInfoIt = m_x2uTeidInfoMap.find (params.gtpTeid); |
if (teidInfoIt != m_x2uTeidInfoMap.end ()) |
{ |
@@ -2140,7 +2142,7 @@ |
} |
-uint16_t |
+uint16_t |
LteEnbRrc::DoAllocateTemporaryCellRnti () |
{ |
NS_LOG_FUNCTION (this); |
@@ -2253,7 +2255,7 @@ |
NS_LOG_FUNCTION (this); |
bool found = false; |
uint16_t rnti; |
- for (rnti = m_lastAllocatedRnti + 1; |
+ for (rnti = m_lastAllocatedRnti + 1; |
(rnti != m_lastAllocatedRnti - 1) && (!found); |
++rnti) |
{ |
@@ -2289,7 +2291,7 @@ |
m_s1SapProvider->UeContextRelease (rnti); |
} |
// need to do this after UeManager has been deleted |
- RemoveSrsConfigurationIndex (srsCi); |
+ RemoveSrsConfigurationIndex (srsCi); |
} |
TypeId |
@@ -2368,7 +2370,7 @@ |
*/ |
static const uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636}; |
-void |
+void |
LteEnbRrc::SetSrsPeriodicity (uint32_t p) |
{ |
NS_LOG_FUNCTION (this << p); |
@@ -2389,7 +2391,7 @@ |
NS_FATAL_ERROR ("illecit SRS periodicity value " << p << ". Allowed values: " << allowedValues.str ()); |
} |
-uint32_t |
+uint32_t |
LteEnbRrc::GetSrsPeriodicity () const |
{ |
NS_LOG_FUNCTION (this); |
@@ -2409,7 +2411,7 @@ |
NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ()); |
if (m_ueSrsConfigurationIndexSet.size () >= g_srsPeriodicity[m_srsCurrentPeriodicityId]) |
{ |
- NS_FATAL_ERROR ("too many UEs (" << m_ueSrsConfigurationIndexSet.size () + 1 |
+ NS_FATAL_ERROR ("too many UEs (" << m_ueSrsConfigurationIndexSet.size () + 1 |
<< ") for current SRS periodicity " |
<< g_srsPeriodicity[m_srsCurrentPeriodicityId] |
<< ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity"); |
@@ -2436,7 +2438,7 @@ |
else |
{ |
// look for released ones |
- for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++) |
+ for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++) |
{ |
std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi); |
if (it == m_ueSrsConfigurationIndexSet.end ()) |
@@ -2446,7 +2448,7 @@ |
break; |
} |
} |
- } |
+ } |
} |
return m_lastAllocatedConfigurationIndex; |
@@ -2462,7 +2464,7 @@ |
m_ueSrsConfigurationIndexSet.erase (it); |
} |
-uint8_t |
+uint8_t |
LteEnbRrc::GetLogicalChannelGroup (EpsBearer bearer) |
{ |
if (bearer.IsGbr ()) |
@@ -2475,7 +2477,7 @@ |
} |
} |
-uint8_t |
+uint8_t |
LteEnbRrc::GetLogicalChannelPriority (EpsBearer bearer) |
{ |
return bearer.qci; |