From e260786566fef9efe815e087eecbd7bcd13f3be2 Mon Sep 17 00:00:00 2001 From: Manuel Requena Date: Tue, 17 Jul 2012 12:12:34 +0200 Subject: [PATCH 1/4] Some typos --- src/lte/model/eps-bearer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lte/model/eps-bearer.h b/src/lte/model/eps-bearer.h index 989ffce27..2e0835de3 100644 --- a/src/lte/model/eps-bearer.h +++ b/src/lte/model/eps-bearer.h @@ -46,8 +46,8 @@ struct GbrQosInformation struct AllocationRetentionPriority { uint8_t priorityLevel; // /< 1-15; 1 = highest - bool preemprionCapability; // /< true if bearer can preempt others - bool preemprionVulnerability; // true if bearer can be preempted by others + bool preemptionCapability; // /< true if bearer can preempt others + bool preemptionVulnerability; // true if bearer can be preempted by others }; /** From 2ea6e569563443c65237e3507e5c895507a170d1 Mon Sep 17 00:00:00 2001 From: Manuel Requena Date: Fri, 20 Jul 2012 17:34:18 +0200 Subject: [PATCH 2/4] Add parameters of the X2 SAP --- src/lte/model/epc-x2-sap.cc | 9 +++ src/lte/model/epc-x2-sap.h | 111 +++++++++++++++++++++++------------- 2 files changed, 81 insertions(+), 39 deletions(-) diff --git a/src/lte/model/epc-x2-sap.cc b/src/lte/model/epc-x2-sap.cc index d8ad89615..07faf67c5 100644 --- a/src/lte/model/epc-x2-sap.cc +++ b/src/lte/model/epc-x2-sap.cc @@ -23,6 +23,15 @@ namespace ns3 { +EpcX2Sap::~EpcX2Sap () +{ +} + +EpcX2Sap::ErabToBeSetupItem::ErabToBeSetupItem () : + erabLevelQosParameters (EpsBearer (EpsBearer::GBR_CONV_VOICE)) +{ +} + EpcX2SapProvider::~EpcX2SapProvider () { } diff --git a/src/lte/model/epc-x2-sap.h b/src/lte/model/epc-x2-sap.h index ea34cda09..f9603673e 100644 --- a/src/lte/model/epc-x2-sap.h +++ b/src/lte/model/epc-x2-sap.h @@ -22,15 +22,84 @@ #define EPC_X2_SAP_H #include "ns3/packet.h" +#include "ns3/eps-bearer.h" +#include "ns3/ipv4-address.h" namespace ns3 { class Node; -class Packet; + +/** + * The X2 SAP defines the service offered + */ + +/** + * \brief Common structures for EpcX2SapProvider and EpcX2SapUser + */ +class EpcX2Sap +{ +public: + virtual ~EpcX2Sap (); + + struct ErabToBeSetupItem + { + uint16_t erabId; + EpsBearer erabLevelQosParameters; + bool dlForwarding; + Ipv4Address transportLayerAddress; + uint32_t gtpTeid; + + ErabToBeSetupItem (); + }; + + struct ErabAdmittedItem + { + uint16_t erabId; + uint32_t ulGtpTeid; + uint32_t dlGtpTeid; + }; + + struct ErabNotAdmittedItem + { + uint16_t erabId; + uint16_t cause; + }; + + enum IdCause + { + HandoverDesirableForRadioReason, + TimeCriticalHandover + }; + + + struct HandoverRequestParams + { + uint16_t oldEnbUeX2apId; + uint16_t cause; + uint16_t sourceCellId; + uint16_t targetCellId; + uint64_t ueAggregateMaxBitRateDownlink; + uint64_t ueAggregateMaxBitRateUplink; + std::vector bearers; + Ptr rrcContext; + }; + + struct HandoverRequestAckParams + { + uint16_t oldEnbUeX2apId; + uint16_t newEnbUeX2apId; + uint16_t sourceCellId; + uint16_t targetCellId; + std::vector admittedBearers; + std::vector notAdmittedBearers; + Ptr rrcContext; + }; + +}; -class EpcX2SapProvider +class EpcX2SapProvider : public EpcX2Sap { public: virtual ~EpcX2SapProvider (); @@ -39,24 +108,6 @@ public: * Parameters of the API primitives */ - struct HandoverRequestParams - { - uint16_t cause; - uint16_t sourceCellId; - uint16_t targetCellId; - std::list bearers; - Ptr rrcContext; - }; - - struct HandoverRequestAckParams - { - uint16_t cause; - uint16_t sourceCellId; - uint16_t targetCellId; - std::list bearers; - Ptr rrcContext; - }; - /** * SAP primitives */ @@ -72,7 +123,7 @@ public: }; -class EpcX2SapUser +class EpcX2SapUser : public EpcX2Sap { public: virtual ~EpcX2SapUser (); @@ -80,24 +131,6 @@ public: /** * Parameters of the API primitives */ - - struct HandoverRequestParams - { - uint16_t cause; - uint16_t sourceCellId; - uint16_t targetCellId; - std::list bearers; - Ptr rrcContext; - }; - - struct HandoverRequestAckParams - { - uint16_t cause; - uint16_t sourceCellId; - uint16_t targetCellId; - std::list bearers; - Ptr rrcContext; - }; /** * SAP primitives From a030fb77d21f3e9279d0c49eb13b7e19a9232ef5 Mon Sep 17 00:00:00 2001 From: Manuel Requena Date: Fri, 20 Jul 2012 17:35:08 +0200 Subject: [PATCH 3/4] Use the new X2 SAP parameters --- src/lte/model/lte-enb-rrc.cc | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index 0ac5be740..6229efbff 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -458,13 +458,25 @@ LteEnbRrc::SendHandoverRequest (Ptr ueNode, Ptr sourceEnbNode, Ptr ueRrc = ueNode->GetDevice (0)->GetObject ()->GetRrc (); + uint16_t rnti = ueRrc->GetRnti (); EpcX2SapProvider::HandoverRequestParams params; - params.sourceCellId = sourceEnbNode->GetDevice (0)->GetObject ()->GetCellId (); - params.targetCellId = targetEnbNode->GetDevice (0)->GetObject ()->GetCellId (); + params.oldEnbUeX2apId = rnti; + params.cause = EpcX2SapProvider::HandoverDesirableForRadioReason; + params.sourceCellId = sourceEnbNode->GetDevice (0)->GetObject ()->GetCellId (); + params.targetCellId = targetEnbNode->GetDevice (0)->GetObject ()->GetCellId (); + params.ueAggregateMaxBitRateDownlink = 200 * 1000; + params.ueAggregateMaxBitRateUplink = 100 * 1000; + + std::string rrcData ("abcdefghijklmnopqrstuvwxyz"); + params.rrcContext = Create ((uint8_t const *) rrcData.data (), rrcData.length ()); + NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId); NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId); NS_LOG_LOGIC ("targetCellId = " << params.targetCellId); + NS_LOG_LOGIC ("rrcContext = " << params.rrcContext << " : " << rrcData); m_x2SapProvider->SendHandoverRequest (params); } @@ -480,15 +492,27 @@ LteEnbRrc::DoRecvHandoverRequest (EpcX2SapUser::HandoverRequestParams params) NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST"); + NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId); NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId); NS_LOG_LOGIC ("targetCellId = " << params.targetCellId); + + uint8_t rrcData [100]; + params.rrcContext->CopyData (rrcData, params.rrcContext->GetSize ()); + NS_LOG_LOGIC ("rrcContext = " << rrcData); NS_LOG_LOGIC ("Send X2 message: HANDOVER REQUEST ACK"); EpcX2SapProvider::HandoverRequestAckParams ackParams; + ackParams.oldEnbUeX2apId = params.oldEnbUeX2apId; + ackParams.newEnbUeX2apId = params.oldEnbUeX2apId + 100; ackParams.sourceCellId = params.sourceCellId; ackParams.targetCellId = params.targetCellId; - + + NS_LOG_LOGIC ("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId); + NS_LOG_LOGIC ("newEnbUeX2apId = " << ackParams.newEnbUeX2apId); + NS_LOG_LOGIC ("sourceCellId = " << ackParams.sourceCellId); + NS_LOG_LOGIC ("targetCellId = " << ackParams.targetCellId); + m_x2SapProvider->SendHandoverRequestAck (ackParams); } @@ -499,6 +523,8 @@ LteEnbRrc::DoRecvHandoverRequestAck (EpcX2SapUser::HandoverRequestAckParams para NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST ACK"); + NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId); + NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId); NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId); NS_LOG_LOGIC ("targetCellId = " << params.targetCellId); } From a81a4848b32b641dc162447cd2df2819c83c7b66 Mon Sep 17 00:00:00 2001 From: Manuel Requena Date: Fri, 20 Jul 2012 18:22:13 +0200 Subject: [PATCH 4/4] Add doxygen documentation to the X2 SAP --- src/lte/model/epc-x2-sap.h | 54 ++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/src/lte/model/epc-x2-sap.h b/src/lte/model/epc-x2-sap.h index f9603673e..ce8c01ff8 100644 --- a/src/lte/model/epc-x2-sap.h +++ b/src/lte/model/epc-x2-sap.h @@ -31,7 +31,14 @@ namespace ns3 { class Node; /** - * The X2 SAP defines the service offered + * The X2 SAP defines the service between the X2 entity and the RRC entity. + * + * The X2 SAP follows the specification 3GPP TS 36.423: "X2 application protocol (X2AP)" + * + * The service primitives corresponds to the X2AP procedures and messages and + * the service parameters corresponds to the Information Elements + * + * Note: Any reference in this file refers to the 3GPP TS 36.423 specification */ /** @@ -42,6 +49,11 @@ class EpcX2Sap public: virtual ~EpcX2Sap (); + /** + * E-RABs to be setup item as + * it is used in the HANDOVER REQUEST message. + * See section 9.1.1.1 for further info about the parameters + */ struct ErabToBeSetupItem { uint16_t erabId; @@ -53,6 +65,11 @@ public: ErabToBeSetupItem (); }; + /** + * E-RABs admitted item as + * it is used in the HANDOVER REQUEST ACKNOWLEDGE message. + * See section 9.1.1.2 for further info about the parameters + */ struct ErabAdmittedItem { uint16_t erabId; @@ -60,6 +77,11 @@ public: uint32_t dlGtpTeid; }; + /** + * E-RABs not admitted item as + * it is used in the HANDOVER REQUEST ACKNOWLEDGE message. + * See section 9.1.1.2 for further info about the parameters + */ struct ErabNotAdmittedItem { uint16_t erabId; @@ -73,6 +95,11 @@ public: }; + /** + * \brief Parameters of the HANDOVER REQUEST message. + * + * See section 9.1.1.1 for further info about the parameters + */ struct HandoverRequestParams { uint16_t oldEnbUeX2apId; @@ -85,6 +112,11 @@ public: Ptr rrcContext; }; + /** + * \brief Parameters of the HANDOVER REQUEST ACKNOWLEDGE message. + * + * See section 9.1.1.2 for further info about the parameters + */ struct HandoverRequestAckParams { uint16_t oldEnbUeX2apId; @@ -99,17 +131,17 @@ public: }; +/** + * These service primitives of this part of the X2 SAP + * are provided by the X2 entity and issued by RRC entity + */ class EpcX2SapProvider : public EpcX2Sap { public: virtual ~EpcX2SapProvider (); /** - * Parameters of the API primitives - */ - - /** - * SAP primitives + * Service primitives */ virtual void SendHandoverRequest (HandoverRequestParams params) = 0; @@ -123,17 +155,17 @@ public: }; +/** + * These service primitives of this part of the X2 SAP + * are provided by the RRC entity and issued by the X2 entity + */ class EpcX2SapUser : public EpcX2Sap { public: virtual ~EpcX2SapUser (); /** - * Parameters of the API primitives - */ - - /** - * SAP primitives + * Service primitives */ virtual void RecvHandoverRequest (HandoverRequestParams params) = 0;