Add new RLC interfaces to the generic RLC entity

This commit is contained in:
Manuel Requena
2011-09-07 16:40:08 +02:00
parent 65e50a218b
commit 6a6c33816e
3 changed files with 77 additions and 24 deletions

View File

@@ -19,19 +19,21 @@
*/
#include "lte-rlc.h"
#include "lte-mac-sap.h"
#include "ff-mac-sched-sap.h"
#include "lte-rlc-tag.h"
#include "ns3/log.h"
#include "ns3/simulator.h"
#include <ns3/log.h>
#include <ns3/simulator.h>
#include "ns3/lte-rlc.h"
#include "ns3/lte-rlc-tag.h"
// #include "lte-mac-sap.h"
#include "ns3/lte-rlc-sap.h"
// #include "ff-mac-sched-sap.h"
NS_LOG_COMPONENT_DEFINE ("LteRlc");
namespace ns3 {
///////////////////////////////////////
class LteRlcSpecificLteMacSapUser : public LteMacSapUser
@@ -39,7 +41,7 @@ class LteRlcSpecificLteMacSapUser : public LteMacSapUser
public:
LteRlcSpecificLteMacSapUser (LteRlc* rlc);
// inherited from LteMacSapUser
// Interface implemented from LteMacSapUser
virtual void NotifyTxOpportunity (uint32_t bytes);
virtual void NotifyHarqDeliveryFailure ();
virtual void ReceivePdu (Ptr<Packet> p);
@@ -78,14 +80,17 @@ LteRlcSpecificLteMacSapUser::ReceivePdu (Ptr<Packet> p)
///////////////////////////////////////
NS_OBJECT_ENSURE_REGISTERED (LteRlc);
LteRlc::LteRlc ()
: m_macSapProvider (0),
: m_rlcSapUser (0),
m_macSapProvider (0),
m_rnti (0),
m_lcid (0)
{
NS_LOG_FUNCTION (this);
m_rlcSapProvider = new LteRlcSpecificLteRlcSapProvider<LteRlc> (this);
m_macSapUser = new LteRlcSpecificLteMacSapUser (this);
}
@@ -99,7 +104,7 @@ TypeId LteRlc::GetTypeId (void)
.AddTraceSource ("RxPDU",
"PDU received.",
MakeTraceSourceAccessor (&LteRlc::m_rxPdu))
;
;
return tid;
}
@@ -120,9 +125,24 @@ LteRlc::SetLcId (uint8_t lcId)
LteRlc::~LteRlc ()
{
NS_LOG_FUNCTION (this);
delete (m_rlcSapProvider);
delete (m_macSapUser);
}
void
LteRlc::SetLteRlcSapUser (LteRlcSapUser * s)
{
NS_LOG_FUNCTION (this << s);
m_rlcSapUser = s;
}
LteRlcSapProvider*
LteRlc::GetLteRlcSapProvider ()
{
NS_LOG_FUNCTION (this);
return m_rlcSapProvider;
}
void
LteRlc::SetLteMacSapProvider (LteMacSapProvider * s)
{
@@ -139,9 +159,7 @@ LteRlc::GetLteMacSapUser ()
// //////////////////////////////////////
////////////////////////////////////////
NS_OBJECT_ENSURE_REGISTERED (LteRlcSm);
@@ -163,22 +181,28 @@ LteRlcSm::GetTypeId (void)
static TypeId tid = TypeId ("ns3::LteRlcSm")
.SetParent<LteRlc> ()
.AddConstructor<LteRlcSm> ()
;
;
return tid;
}
void
LteRlcSm::DoTransmitPdcpPdu (Ptr<Packet> p)
{
NS_LOG_FUNCTION (this);
}
void
LteRlcSm::DoReceivePdu (Ptr<Packet> p)
{
// RLC Performance evaluation
RlcTag rlcTag;
Time delay;
if (p->FindFirstMatchingByteTag (rlcTag))
if (p->FindFirstMatchingByteTag(rlcTag))
{
delay = Simulator::Now () - rlcTag.getSenderTimestamp ();
delay = Simulator::Now() - rlcTag.getSenderTimestamp ();
}
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize () << delay.GetNanoSeconds ());
m_rxPdu (m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds () );
m_rxPdu(m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds () );
}
void
@@ -190,10 +214,10 @@ LteRlcSm::DoNotifyTxOpportunity (uint32_t bytes)
params.lcid = m_lcid;
// RLC Performance evaluation
RlcTag tag (Simulator::Now ());
RlcTag tag (Simulator::Now());
params.pdu->AddByteTag (tag);
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes);
m_txPdu (m_rnti, m_lcid, bytes);
m_txPdu(m_rnti, m_lcid, bytes);
m_macSapProvider->TransmitPdu (params);
}

View File

@@ -30,12 +30,17 @@
#include "ns3/object.h"
#include "ns3/lte-rlc-sap.h"
#include "ns3/lte-mac-sap.h"
namespace ns3 {
class LteMacSapProvider;
class LteMacSapUser;
// class LteRlcSapProvider;
// class LteRlcSapUser;
//
// class LteMacSapProvider;
// class LteMacSapUser;
/**
* This abstract base class defines the API to interact with the Radio Link Control
@@ -45,6 +50,7 @@ class LteMacSapUser;
class LteRlc : public Object // SimpleRefCount<LteRlc>
{
friend class LteRlcSpecificLteMacSapUser;
friend class LteRlcSpecificLteRlcSapProvider<LteRlc>;
public:
LteRlc ();
virtual ~LteRlc ();
@@ -67,7 +73,21 @@ public:
/**
*
*
* \param s the MAC SAP Providerto be used by this LTE_RLC
* \param s the RLC SAP user to be used by this LTE_RLC
*/
void SetLteRlcSapUser (LteRlcSapUser * s);
/**
*
*
* \param s the RLC SAP Provider interface offered to the PDCP by this LTE_RLC
*/
LteRlcSapProvider* GetLteRlcSapProvider ();
/**
*
*
* \param s the MAC SAP Provider to be used by this LTE_RLC
*/
void SetLteMacSapProvider (LteMacSapProvider * s);
@@ -80,9 +100,15 @@ public:
// TODO MRE What is the sense to duplicate all the interfaces here???
protected:
// methods forwarded by LteMacSapUser
// Interface forwarded by LteRlcSapProvider
virtual void DoTransmitPdcpPdu (Ptr<Packet> p) = 0;
LteRlcSapUser* m_rlcSapUser;
LteRlcSapProvider* m_rlcSapProvider;
// Interface forwarded by LteMacSapUser
virtual void DoNotifyTxOpportunity (uint32_t bytes) = 0;
virtual void DoNotifyHarqDeliveryFailure () = 0;
virtual void DoReceivePdu (Ptr<Packet> p) = 0;
@@ -121,6 +147,7 @@ public:
virtual ~LteRlcSm ();
static TypeId GetTypeId (void);
virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
virtual void DoNotifyTxOpportunity (uint32_t bytes);
virtual void DoNotifyHarqDeliveryFailure ();
virtual void DoReceivePdu (Ptr<Packet> p);

View File

@@ -25,7 +25,8 @@ def build(bld):
'model/lte-rlc-header.cc',
'model/lte-rlc-um.cc',
'model/lte-rlc-tag.cc',
'model/eps-bearer.cc',
'model/lte-rlc-sdu-status-tag.cc',
'model/eps-bearer.cc',
'model/lte-net-device.cc',
'model/lte-enb-net-device.cc',
'model/lte-ue-net-device.cc',
@@ -98,6 +99,7 @@ def build(bld):
'model/lte-rlc-header.h',
'model/lte-rlc-um.h',
'model/lte-rlc-tag.h',
'model/lte-rlc-sdu-status-tag.h',
'model/eps-bearer.h',
'model/lte-net-device.h',
'model/lte-enb-net-device.h',