Add support for MME UE S1AP ID in HandoverRequest X2 primitive
authorManuel Requena <manuel.requena@cttc.es>
Tue, 27 Nov 2012 23:55:25 +0100
changeset 9437 9c5081f582ad
parent 9436 3cc0554d7bf1
child 9438 05361705484a
Add support for MME UE S1AP ID in HandoverRequest X2 primitive
src/lte/model/epc-x2-header.cc
src/lte/model/epc-x2-header.h
src/lte/model/epc-x2-sap.h
src/lte/model/epc-x2.cc
src/lte/model/lte-enb-rrc.cc
--- a/src/lte/model/epc-x2-header.cc	Tue Nov 27 19:06:57 2012 +0100
+++ b/src/lte/model/epc-x2-header.cc	Tue Nov 27 23:55:25 2012 +0100
@@ -149,10 +149,11 @@
 
 EpcX2HandoverRequestHeader::EpcX2HandoverRequestHeader ()
   : m_numberOfIes (1 + 1 + 1 + 1),
-    m_headerLength (6 + 5 + 12 + (3 + 8 + 8 + 4)),
+    m_headerLength (6 + 5 + 12 + (3 + 4 + 8 + 8 + 4)),
     m_oldEnbUeX2apId (0xfffa),
     m_cause (0xfffa),
-    m_targetCellId (0xfffa)
+    m_targetCellId (0xfffa),
+    m_mmeUeS1apId (0xfffffffa)
 {
   m_erabsToBeSetupList.clear ();
 }
@@ -164,6 +165,7 @@
   m_oldEnbUeX2apId = 0xfffb;
   m_cause = 0xfffb;
   m_targetCellId = 0xfffb;
+  m_mmeUeS1apId = 0xfffffffb;
   m_erabsToBeSetupList.clear ();
 }
 
@@ -213,6 +215,7 @@
   i.WriteHtonU16 (14);              // id = UE_CONTEXT_INFORMATION
   i.WriteU8 (0);                    // criticality = REJECT
 
+  i.WriteHtonU32 (m_mmeUeS1apId);
   i.WriteHtonU64 (m_ueAggregateMaxBitRateDownlink);
   i.WriteHtonU64 (m_ueAggregateMaxBitRateUplink);
 
@@ -268,10 +271,11 @@
 
   i.ReadNtohU16 ();
   i.ReadU8 ();
+  m_mmeUeS1apId = i.ReadNtohU32 ();
   m_ueAggregateMaxBitRateDownlink = i.ReadNtohU64 ();
   m_ueAggregateMaxBitRateUplink   = i.ReadNtohU64 ();
   int sz = i.ReadNtohU32 ();
-  m_headerLength += 23;
+  m_headerLength += 27;
   m_numberOfIes++;
 
   for (int j = 0; j < sz; j++)
@@ -303,12 +307,13 @@
 void
 EpcX2HandoverRequestHeader::Print (std::ostream &os) const
 {
-  os << "OldEnbUeX2apId=" << m_oldEnbUeX2apId;
-  os << " Cause=" << m_cause;
-  os << " TargetCellId=" << m_targetCellId;
-  os << " UeAggrMaxBitRateDownlink= " << m_ueAggregateMaxBitRateDownlink;
-  os << " UeAggrMaxBitRateUplink= " << m_ueAggregateMaxBitRateUplink;
-  os << " NumOfBearers=" << m_erabsToBeSetupList.size ();
+  os << "OldEnbUeX2apId = " << m_oldEnbUeX2apId;
+  os << " Cause = " << m_cause;
+  os << " TargetCellId = " << m_targetCellId;
+  os << " MmeUeS1apId = " << m_mmeUeS1apId;
+  os << " UeAggrMaxBitRateDownlink = " << m_ueAggregateMaxBitRateDownlink;
+  os << " UeAggrMaxBitRateUplink = " << m_ueAggregateMaxBitRateUplink;
+  os << " NumOfBearers = " << m_erabsToBeSetupList.size ();
 
   std::vector <EpcX2Sap::ErabToBeSetupItem>::size_type sz = m_erabsToBeSetupList.size ();
   if (sz > 0)
@@ -365,6 +370,18 @@
   m_targetCellId = targetCellId;
 }
 
+uint32_t
+EpcX2HandoverRequestHeader::GetMmeUeS1apId () const
+{
+  return m_mmeUeS1apId;
+}
+
+void
+EpcX2HandoverRequestHeader::SetMmeUeS1apId (uint32_t mmeUeS1apId)
+{
+  m_mmeUeS1apId = mmeUeS1apId;
+}
+
 std::vector <EpcX2Sap::ErabToBeSetupItem>
 EpcX2HandoverRequestHeader::GetBearers () const
 {
--- a/src/lte/model/epc-x2-header.h	Tue Nov 27 19:06:57 2012 +0100
+++ b/src/lte/model/epc-x2-header.h	Tue Nov 27 23:55:25 2012 +0100
@@ -101,6 +101,9 @@
   uint16_t GetTargetCellId () const;
   void SetTargetCellId (uint16_t targetCellId);
 
+  uint32_t GetMmeUeS1apId () const;
+  void SetMmeUeS1apId (uint32_t mmeUeS1apId);
+
   std::vector <EpcX2Sap::ErabToBeSetupItem> GetBearers () const;
   void SetBearers (std::vector <EpcX2Sap::ErabToBeSetupItem> bearers);
 
@@ -120,6 +123,7 @@
   uint16_t          m_oldEnbUeX2apId;
   uint16_t          m_cause;
   uint16_t          m_targetCellId;
+  uint32_t          m_mmeUeS1apId;
   uint64_t          m_ueAggregateMaxBitRateDownlink;
   uint64_t          m_ueAggregateMaxBitRateUplink;
   std::vector <EpcX2Sap::ErabToBeSetupItem> m_erabsToBeSetupList;
--- a/src/lte/model/epc-x2-sap.h	Tue Nov 27 19:06:57 2012 +0100
+++ b/src/lte/model/epc-x2-sap.h	Tue Nov 27 23:55:25 2012 +0100
@@ -210,6 +210,7 @@
     uint16_t            cause;
     uint16_t            sourceCellId;
     uint16_t            targetCellId;
+    uint32_t            mmeUeS1apId;
     uint64_t            ueAggregateMaxBitRateDownlink;
     uint64_t            ueAggregateMaxBitRateUplink;
     std::vector <ErabToBeSetupItem> bearers;
--- a/src/lte/model/epc-x2.cc	Tue Nov 27 19:06:57 2012 +0100
+++ b/src/lte/model/epc-x2.cc	Tue Nov 27 23:55:25 2012 +0100
@@ -195,6 +195,7 @@
           params.cause          = x2HoReqHeader.GetCause ();
           params.sourceCellId   = cellsInfo->m_remoteCellId;
           params.targetCellId   = x2HoReqHeader.GetTargetCellId ();
+          params.mmeUeS1apId    = x2HoReqHeader.GetMmeUeS1apId ();
           params.ueAggregateMaxBitRateDownlink = x2HoReqHeader.GetUeAggregateMaxBitRateDownlink ();
           params.ueAggregateMaxBitRateUplink   = x2HoReqHeader.GetUeAggregateMaxBitRateUplink ();
           params.bearers        = x2HoReqHeader.GetBearers ();
@@ -203,6 +204,7 @@
           NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
           NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
           NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
+          NS_LOG_LOGIC ("mmeUeS1apId = " << params.mmeUeS1apId);
           NS_LOG_LOGIC ("cellsInfo->m_localCellId = " << cellsInfo->m_localCellId);
           NS_ASSERT_MSG (params.targetCellId == cellsInfo->m_localCellId,
                          "TargetCellId mismatches with localCellId");
@@ -317,6 +319,7 @@
   NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
   NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
   NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
+  NS_LOG_LOGIC ("mmeUeS1apId  = " << params.mmeUeS1apId);
 
   NS_ASSERT_MSG (m_x2InterfaceSockets.find (params.targetCellId) != m_x2InterfaceSockets.end (),
                  "Missing infos for targetCellId = " << params.targetCellId);
@@ -334,6 +337,7 @@
   x2HoReqHeader.SetOldEnbUeX2apId (params.oldEnbUeX2apId);
   x2HoReqHeader.SetCause (params.cause);
   x2HoReqHeader.SetTargetCellId (params.targetCellId);
+  x2HoReqHeader.SetMmeUeS1apId (params.mmeUeS1apId);
   x2HoReqHeader.SetUeAggregateMaxBitRateDownlink (params.ueAggregateMaxBitRateDownlink);
   x2HoReqHeader.SetUeAggregateMaxBitRateUplink (params.ueAggregateMaxBitRateUplink);
   x2HoReqHeader.SetBearers (params.bearers);
--- a/src/lte/model/lte-enb-rrc.cc	Tue Nov 27 19:06:57 2012 +0100
+++ b/src/lte/model/lte-enb-rrc.cc	Tue Nov 27 23:55:25 2012 +0100
@@ -1037,6 +1037,7 @@
   params.cause          = EpcX2SapProvider::HandoverDesirableForRadioReason;
   params.sourceCellId   = m_cellId;
   params.targetCellId   = cellId;
+  params.mmeUeS1apId    = 1234567;
   params.ueAggregateMaxBitRateDownlink = 200 * 1000;
   params.ueAggregateMaxBitRateUplink = 100 * 1000;
   params.bearers = ueManager->GetErabList ();
@@ -1050,6 +1051,7 @@
   NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
   NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
   NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
+  NS_LOG_LOGIC ("mmmUeS1apId = " << params.oldEnbUeX2apId);
   NS_LOG_LOGIC ("rrcContext   = " << params.rrcContext);
 
   m_x2SapProvider->SendHandoverRequest (params);
@@ -1124,6 +1126,7 @@
   NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId);
   NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId);
   NS_LOG_LOGIC ("targetCellId = " << params.targetCellId);
+  NS_LOG_LOGIC ("mmeUeS1apId = " << params.mmeUeS1apId);
 
   NS_ASSERT (params.targetCellId == m_cellId);