lte: Add struct for the parameters of TxOpportunity and ReceivePdu
This commit is contained in:
@@ -134,8 +134,8 @@ public:
|
||||
virtual void UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId);
|
||||
virtual void NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId);
|
||||
// inherited from LteMacSapUser
|
||||
virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
|
||||
virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
|
||||
virtual void NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
|
||||
virtual void ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
|
||||
virtual void NotifyHarqDeliveryFailure ();
|
||||
|
||||
|
||||
@@ -162,15 +162,15 @@ void MemberLteCcmMacSapUser<C>::NotifyPrbOccupancy (double prbOccupancy, uint8_t
|
||||
}
|
||||
|
||||
template <class C>
|
||||
void MemberLteCcmMacSapUser<C>::NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
|
||||
void MemberLteCcmMacSapUser<C>::NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
|
||||
{
|
||||
m_owner->DoNotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
|
||||
m_owner->DoNotifyTxOpportunity (txOpParams);
|
||||
}
|
||||
|
||||
template <class C>
|
||||
void MemberLteCcmMacSapUser<C>::ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
void MemberLteCcmMacSapUser<C>::ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
|
||||
{
|
||||
m_owner->DoReceivePdu (p, rnti, lcid);
|
||||
m_owner->DoReceivePdu (rxPduParams);
|
||||
}
|
||||
|
||||
template <class C>
|
||||
|
||||
@@ -765,10 +765,15 @@ LteEnbMac::DoReceivePhyPdu (Ptr<Packet> p)
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
|
||||
//NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);
|
||||
|
||||
LteMacSapUser::ReceivePduParameters rxPduParams;
|
||||
rxPduParams.p = p;
|
||||
rxPduParams.rnti = rnti;
|
||||
rxPduParams.lcid = lcid;
|
||||
|
||||
//Receive PDU only if LCID is found
|
||||
if (lcidIt != rntiIt->second.end ())
|
||||
{
|
||||
(*lcidIt).second->ReceivePdu (p, rnti, lcid);
|
||||
(*lcidIt).second->ReceivePdu (rxPduParams);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1023,6 +1028,7 @@ LteEnbMac::DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind
|
||||
// Create DL PHY PDU
|
||||
Ptr<PacketBurst> pb = CreateObject<PacketBurst> ();
|
||||
std::map <LteFlowId_t, LteMacSapUser* >::iterator it;
|
||||
LteMacSapUser::TxOpportunityParameters txOpParams;
|
||||
|
||||
for (unsigned int i = 0; i < ind.m_buildDataList.size (); i++)
|
||||
{
|
||||
@@ -1054,7 +1060,13 @@ LteEnbMac::DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
|
||||
NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << (uint32_t)lcid<<" carrier id:"<<(uint16_t)m_componentCarrierId);
|
||||
NS_LOG_DEBUG (this << " rnti= " << rnti << " lcid= " << (uint32_t) lcid << " layer= " << k);
|
||||
(*lcidIt).second->NotifyTxOpportunity (ind.m_buildDataList.at (i).m_rlcPduList.at (j).at (k).m_size, k, ind.m_buildDataList.at (i).m_dci.m_harqProcess, m_componentCarrierId, rnti, lcid);
|
||||
txOpParams.bytes = ind.m_buildDataList.at (i).m_rlcPduList.at (j).at (k).m_size;
|
||||
txOpParams.layer = k;
|
||||
txOpParams.harqId = ind.m_buildDataList.at (i).m_dci.m_harqProcess;
|
||||
txOpParams.componentCarrierId = m_componentCarrierId;
|
||||
txOpParams.rnti = rnti;
|
||||
txOpParams.lcid = lcid;
|
||||
(*lcidIt).second->NotifyTxOpportunity (txOpParams);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -96,18 +96,26 @@ class LteMacSapUser
|
||||
{
|
||||
public:
|
||||
virtual ~LteMacSapUser ();
|
||||
/**
|
||||
* Parameters for LteMacSapUser::NotifyTxOpportunity
|
||||
*
|
||||
*/
|
||||
struct TxOpportunityParameters
|
||||
{
|
||||
uint32_t bytes; /**< the number of bytes to transmit */
|
||||
uint8_t layer; /**< the layer of transmission (MIMO) */
|
||||
uint8_t harqId; /**< the HARQ ID */
|
||||
uint8_t componentCarrierId; /**< the component carrier id */
|
||||
uint16_t rnti; /**< the C-RNTI identifying the UE */
|
||||
uint8_t lcid; /**< the logical channel id */
|
||||
};
|
||||
/**
|
||||
* Called by the MAC to notify the RLC that the scheduler granted a
|
||||
* transmission opportunity to this RLC instance.
|
||||
*
|
||||
* \param bytes the number of bytes to transmit
|
||||
* \param layer the layer of transmission (MIMO)
|
||||
* \param harqId the HARQ ID
|
||||
* \param componentCarrierId component carrier ID
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
* \param params the TxOpportunityParameters
|
||||
*/
|
||||
virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid) = 0;
|
||||
virtual void NotifyTxOpportunity (TxOpportunityParameters params) = 0;
|
||||
|
||||
/**
|
||||
* Called by the MAC to notify the RLC that an HARQ process related
|
||||
@@ -117,15 +125,22 @@ public:
|
||||
*/
|
||||
virtual void NotifyHarqDeliveryFailure () = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Parameters for LteMacSapUser::ReceivePdu
|
||||
*
|
||||
*/
|
||||
struct ReceivePduParameters
|
||||
{
|
||||
Ptr<Packet> p; /**< the RLC PDU to be received */
|
||||
uint16_t rnti; /**< the C-RNTI identifying the UE */
|
||||
uint8_t lcid; /**< the logical channel id */
|
||||
};
|
||||
/**
|
||||
* Called by the MAC to notify the RLC of the reception of a new PDU
|
||||
*
|
||||
* \param p the packet
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
* \param params the ReceivePduParameters
|
||||
*/
|
||||
virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) = 0;
|
||||
virtual void ReceivePdu (ReceivePduParameters params) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -186,27 +186,27 @@ LteRlcAm::DoTransmitPdcpPdu (Ptr<Packet> p)
|
||||
*/
|
||||
|
||||
void
|
||||
LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcAm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes);
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << txOpParams.bytes);
|
||||
|
||||
if (bytes < 4)
|
||||
if (txOpParams.bytes < 4)
|
||||
{
|
||||
// Stingy MAC: In general, we need more bytes.
|
||||
// There are a more restrictive test for each particular case
|
||||
NS_LOG_LOGIC ("TxOpportunity (size = " << bytes << ") too small");
|
||||
NS_ASSERT_MSG (false, "TxOpportunity (size = " << bytes << ") too small.\n"
|
||||
NS_LOG_LOGIC ("TxOpportunity (size = " << txOpParams.bytes << ") too small");
|
||||
NS_ASSERT_MSG (false, "TxOpportunity (size = " << txOpParams.bytes << ") too small.\n"
|
||||
<< "Your MAC scheduler is assigned too few resource blocks.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_statusPduRequested && ! m_statusProhibitTimer.IsRunning () )
|
||||
{
|
||||
if (bytes < m_statusPduBufferSize)
|
||||
if (txOpParams.bytes < m_statusPduBufferSize)
|
||||
{
|
||||
// Stingy MAC: We need more bytes for the STATUS PDU
|
||||
NS_LOG_LOGIC ("TxOpportunity (size = " << bytes << ") too small for the STATUS PDU (size = " << m_statusPduBufferSize << ")");
|
||||
NS_ASSERT_MSG (false, "TxOpportunity (size = " << bytes << ") too small for the STATUS PDU (size = " << m_statusPduBufferSize << ")\n"
|
||||
NS_LOG_LOGIC ("TxOpportunity (size = " << txOpParams.bytes << ") too small for the STATUS PDU (size = " << m_statusPduBufferSize << ")");
|
||||
NS_ASSERT_MSG (false, "TxOpportunity (size = " << txOpParams.bytes << ") too small for the STATUS PDU (size = " << m_statusPduBufferSize << ")\n"
|
||||
<< "Your MAC scheduler is assigned too few resource blocks.");
|
||||
return;
|
||||
}
|
||||
@@ -224,7 +224,7 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
for (sn = m_vrR; sn < m_vrMs; sn++)
|
||||
{
|
||||
NS_LOG_LOGIC ("SN = " << sn);
|
||||
if (!rlcAmHeader.OneMoreNackWouldFitIn (bytes))
|
||||
if (!rlcAmHeader.OneMoreNackWouldFitIn (txOpParams.bytes))
|
||||
{
|
||||
NS_LOG_LOGIC ("Can't fit more NACKs in STATUS PDU");
|
||||
break;
|
||||
@@ -267,9 +267,9 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
params.pdu = packet;
|
||||
params.rnti = m_rnti;
|
||||
params.lcid = m_lcid;
|
||||
params.layer = layer;
|
||||
params.harqProcessId = harqId;
|
||||
params.componentCarrierId = componentCarrierId;
|
||||
params.layer = txOpParams.layer;
|
||||
params.harqProcessId = txOpParams.harqId;
|
||||
params.componentCarrierId = txOpParams.componentCarrierId;
|
||||
|
||||
m_macSapProvider->TransmitPdu (params);
|
||||
|
||||
@@ -296,7 +296,7 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
|
||||
Ptr<Packet> packet = m_retxBuffer.at (seqNumberValue).m_pdu->Copy ();
|
||||
|
||||
if (( packet->GetSize () <= bytes )
|
||||
if (( packet->GetSize () <= txOpParams.bytes )
|
||||
|| m_txOpportunityForRetxAlwaysBigEnough)
|
||||
{
|
||||
// According to 5.2.1, the data field is left as is, but we rebuild the header
|
||||
@@ -353,9 +353,9 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
params.pdu = packet;
|
||||
params.rnti = m_rnti;
|
||||
params.lcid = m_lcid;
|
||||
params.layer = layer;
|
||||
params.harqProcessId = harqId;
|
||||
params.componentCarrierId = componentCarrierId;
|
||||
params.layer = txOpParams.layer;
|
||||
params.harqProcessId = txOpParams.harqId;
|
||||
params.componentCarrierId = txOpParams.componentCarrierId;
|
||||
|
||||
m_macSapProvider->TransmitPdu (params);
|
||||
|
||||
@@ -381,7 +381,7 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_LOGIC ("TxOpportunity (size = " << bytes << ") too small for retransmission of the packet (size = " << packet->GetSize () << ")");
|
||||
NS_LOG_LOGIC ("TxOpportunity (size = " << txOpParams.bytes << ") too small for retransmission of the packet (size = " << packet->GetSize () << ")");
|
||||
NS_LOG_LOGIC ("Waiting for bigger TxOpportunity");
|
||||
return;
|
||||
}
|
||||
@@ -391,11 +391,11 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
}
|
||||
else if ( m_txonBufferSize > 0 )
|
||||
{
|
||||
if (bytes < 7)
|
||||
if (txOpParams.bytes < 7)
|
||||
{
|
||||
// Stingy MAC: We need more bytes for new DATA PDUs.
|
||||
NS_LOG_LOGIC ("TxOpportunity (size = " << bytes << ") too small for DATA PDU");
|
||||
NS_ASSERT_MSG (false, "TxOpportunity (size = " << bytes << ") too small for DATA PDU\n"
|
||||
NS_LOG_LOGIC ("TxOpportunity (size = " << txOpParams.bytes << ") too small for DATA PDU");
|
||||
NS_ASSERT_MSG (false, "TxOpportunity (size = " << txOpParams.bytes << ") too small for DATA PDU\n"
|
||||
<< "Your MAC scheduler is assigned too few resource blocks.");
|
||||
return;
|
||||
}
|
||||
@@ -426,7 +426,7 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
rlcAmHeader.SetDataPdu ();
|
||||
|
||||
// Build Data field
|
||||
uint32_t nextSegmentSize = bytes - 4;
|
||||
uint32_t nextSegmentSize = txOpParams.bytes - 4;
|
||||
uint32_t nextSegmentId = 1;
|
||||
uint32_t dataFieldTotalSize = 0;
|
||||
uint32_t dataFieldAddedSize = 0;
|
||||
@@ -734,9 +734,9 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
params.pdu = packet;
|
||||
params.rnti = m_rnti;
|
||||
params.lcid = m_lcid;
|
||||
params.layer = layer;
|
||||
params.harqProcessId = harqId;
|
||||
params.componentCarrierId = componentCarrierId;
|
||||
params.layer = txOpParams.layer;
|
||||
params.harqProcessId = txOpParams.harqId;
|
||||
params.componentCarrierId = txOpParams.componentCarrierId;
|
||||
|
||||
m_macSapProvider->TransmitPdu (params);
|
||||
}
|
||||
@@ -749,21 +749,21 @@ LteRlcAm::DoNotifyHarqDeliveryFailure ()
|
||||
|
||||
|
||||
void
|
||||
LteRlcAm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcAm::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize ());
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << rxPduParams.p->GetSize ());
|
||||
|
||||
// Receiver timestamp
|
||||
RlcTag rlcTag;
|
||||
Time delay;
|
||||
NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing");
|
||||
p->RemovePacketTag (rlcTag);
|
||||
NS_ASSERT_MSG (rxPduParams.p->PeekPacketTag (rlcTag), "RlcTag is missing");
|
||||
rxPduParams.p->RemovePacketTag (rlcTag);
|
||||
delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
|
||||
m_rxPdu (m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds ());
|
||||
m_rxPdu (m_rnti, m_lcid, rxPduParams.p->GetSize (), delay.GetNanoSeconds ());
|
||||
|
||||
// Get RLC header parameters
|
||||
LteRlcAmHeader rlcAmHeader;
|
||||
p->PeekHeader (rlcAmHeader);
|
||||
rxPduParams.p->PeekHeader (rlcAmHeader);
|
||||
NS_LOG_LOGIC ("RLC header: " << rlcAmHeader);
|
||||
|
||||
if ( rlcAmHeader.IsDataPdu () )
|
||||
@@ -889,7 +889,7 @@ LteRlcAm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
else
|
||||
{
|
||||
NS_LOG_LOGIC ("Place PDU in the reception buffer ( SN = " << seqNumber << " )");
|
||||
m_rxonBuffer[ seqNumber.GetValue () ].m_byteSegments.push_back (p);
|
||||
m_rxonBuffer[ seqNumber.GetValue () ].m_byteSegments.push_back (rxPduParams.p);
|
||||
m_rxonBuffer[ seqNumber.GetValue () ].m_pduComplete = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,19 +55,14 @@ public:
|
||||
/**
|
||||
* MAC SAP
|
||||
*
|
||||
* \param bytes number of bytes
|
||||
* \param layer
|
||||
* \param harqId HARQ ID
|
||||
* \param componentCarrierId component carrier ID
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
* \param txOpParams the LteMacSapUser::TxOpportunityParameters
|
||||
*/
|
||||
virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
|
||||
/**
|
||||
* Notify HARQ delivery failure
|
||||
*/
|
||||
virtual void DoNotifyHarqDeliveryFailure ();
|
||||
virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
|
||||
|
||||
private:
|
||||
/**
|
||||
|
||||
@@ -111,9 +111,9 @@ LteRlcTm::DoTransmitPdcpPdu (Ptr<Packet> p)
|
||||
*/
|
||||
|
||||
void
|
||||
LteRlcTm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcTm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes << (uint32_t) layer << (uint32_t) harqId);
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << txOpParams.bytes << (uint32_t) txOpParams.layer << (uint32_t) txOpParams.harqId);
|
||||
|
||||
// 5.1.1.1 Transmit operations
|
||||
// 5.1.1.1.1 General
|
||||
@@ -129,9 +129,9 @@ LteRlcTm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
|
||||
Ptr<Packet> packet = (*(m_txBuffer.begin ()))->Copy ();
|
||||
|
||||
if (bytes < packet->GetSize ())
|
||||
if (txOpParams.bytes < packet->GetSize ())
|
||||
{
|
||||
NS_LOG_WARN ("TX opportunity too small = " << bytes << " (PDU size: " << packet->GetSize () << ")");
|
||||
NS_LOG_WARN ("TX opportunity too small = " << txOpParams.bytes << " (PDU size: " << packet->GetSize () << ")");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -148,9 +148,9 @@ LteRlcTm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
params.pdu = packet;
|
||||
params.rnti = m_rnti;
|
||||
params.lcid = m_lcid;
|
||||
params.layer = layer;
|
||||
params.harqProcessId = harqId;
|
||||
params.componentCarrierId = componentCarrierId;
|
||||
params.layer = txOpParams.layer;
|
||||
params.harqProcessId = txOpParams.harqId;
|
||||
params.componentCarrierId = txOpParams.componentCarrierId;
|
||||
|
||||
m_macSapProvider->TransmitPdu (params);
|
||||
|
||||
@@ -168,24 +168,24 @@ LteRlcTm::DoNotifyHarqDeliveryFailure ()
|
||||
}
|
||||
|
||||
void
|
||||
LteRlcTm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcTm::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize ());
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << rxPduParams.p->GetSize ());
|
||||
|
||||
// Receiver timestamp
|
||||
RlcTag rlcTag;
|
||||
Time delay;
|
||||
NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing");
|
||||
p->RemovePacketTag (rlcTag);
|
||||
NS_ASSERT_MSG (rxPduParams.p->PeekPacketTag (rlcTag), "RlcTag is missing");
|
||||
rxPduParams.p->RemovePacketTag (rlcTag);
|
||||
delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
|
||||
m_rxPdu (m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds ());
|
||||
m_rxPdu (m_rnti, m_lcid, rxPduParams.p->GetSize (), delay.GetNanoSeconds ());
|
||||
|
||||
// 5.1.1.2 Receive operations
|
||||
// 5.1.1.2.1 General
|
||||
// When receiving a new TMD PDU from lower layer, the receiving TM RLC entity shall:
|
||||
// - deliver the TMD PDU without any modification to upper layer.
|
||||
|
||||
m_rlcSapUser->ReceivePdcpPdu (p);
|
||||
m_rlcSapUser->ReceivePdcpPdu (rxPduParams.p);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -54,19 +54,14 @@ public:
|
||||
/**
|
||||
* MAC SAP
|
||||
*
|
||||
* \param bytes number of bytes
|
||||
* \param layer the layer
|
||||
* \param harqId HARQ ID
|
||||
* \param componentCarrierId component carrier ID
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
* \param txOpParams the LteMacSapUser::TxOpportunityParameters
|
||||
*/
|
||||
virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
|
||||
/**
|
||||
* Notify HARQ deliver failure
|
||||
*/
|
||||
virtual void DoNotifyHarqDeliveryFailure ();
|
||||
virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
|
||||
|
||||
private:
|
||||
/// Expire RBS timer function
|
||||
|
||||
@@ -124,14 +124,14 @@ LteRlcUm::DoTransmitPdcpPdu (Ptr<Packet> p)
|
||||
*/
|
||||
|
||||
void
|
||||
LteRlcUm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcUm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes);
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << txOpParams.bytes);
|
||||
|
||||
if (bytes <= 2)
|
||||
if (txOpParams.bytes <= 2)
|
||||
{
|
||||
// Stingy MAC: Header fix part is 2 bytes, we need more bytes for the data
|
||||
NS_LOG_LOGIC ("TX opportunity too small = " << bytes);
|
||||
NS_LOG_LOGIC ("TX opportunity too small = " << txOpParams.bytes);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ LteRlcUm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
LteRlcHeader rlcHeader;
|
||||
|
||||
// Build Data field
|
||||
uint32_t nextSegmentSize = bytes - 2;
|
||||
uint32_t nextSegmentSize = txOpParams.bytes - 2;
|
||||
uint32_t nextSegmentId = 1;
|
||||
uint32_t dataFieldTotalSize = 0;
|
||||
uint32_t dataFieldAddedSize = 0;
|
||||
@@ -387,9 +387,9 @@ LteRlcUm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
|
||||
params.pdu = packet;
|
||||
params.rnti = m_rnti;
|
||||
params.lcid = m_lcid;
|
||||
params.layer = layer;
|
||||
params.harqProcessId = harqId;
|
||||
params.componentCarrierId = componentCarrierId;
|
||||
params.layer = txOpParams.layer;
|
||||
params.harqProcessId = txOpParams.harqId;
|
||||
params.componentCarrierId = txOpParams.componentCarrierId;
|
||||
|
||||
m_macSapProvider->TransmitPdu (params);
|
||||
|
||||
@@ -407,23 +407,23 @@ LteRlcUm::DoNotifyHarqDeliveryFailure ()
|
||||
}
|
||||
|
||||
void
|
||||
LteRlcUm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcUm::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize ());
|
||||
NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << rxPduParams.p->GetSize ());
|
||||
|
||||
// Receiver timestamp
|
||||
RlcTag rlcTag;
|
||||
Time delay;
|
||||
NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing");
|
||||
p->RemovePacketTag (rlcTag);
|
||||
NS_ASSERT_MSG (rxPduParams.p->PeekPacketTag (rlcTag), "RlcTag is missing");
|
||||
rxPduParams.p->RemovePacketTag (rlcTag);
|
||||
delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
|
||||
m_rxPdu (m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds ());
|
||||
m_rxPdu (m_rnti, m_lcid, rxPduParams.p->GetSize (), delay.GetNanoSeconds ());
|
||||
|
||||
// 5.1.2.2 Receive operations
|
||||
|
||||
// Get RLC header parameters
|
||||
LteRlcHeader rlcHeader;
|
||||
p->PeekHeader (rlcHeader);
|
||||
rxPduParams.p->PeekHeader (rlcHeader);
|
||||
NS_LOG_LOGIC ("RLC header: " << rlcHeader);
|
||||
SequenceNumber10 seqNumber = rlcHeader.GetSequenceNumber ();
|
||||
|
||||
@@ -460,13 +460,13 @@ LteRlcUm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
)
|
||||
{
|
||||
NS_LOG_LOGIC ("PDU discarded");
|
||||
p = 0;
|
||||
rxPduParams.p = 0;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_LOGIC ("Place PDU in the reception buffer");
|
||||
m_rxBuffer[seqNumber.GetValue ()] = p;
|
||||
m_rxBuffer[seqNumber.GetValue ()] = rxPduParams.p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -54,16 +54,11 @@ public:
|
||||
/**
|
||||
* MAC SAP
|
||||
*
|
||||
* \param bytes the number of bytes
|
||||
* \param layer the layer
|
||||
* \param harqId the HARQ ID
|
||||
* \param componentCarrierId component carrier ID
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
* \param txOpParams the LteMacSapUser::TxOpportunityParameters
|
||||
*/
|
||||
virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
|
||||
virtual void DoNotifyHarqDeliveryFailure ();
|
||||
virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
|
||||
|
||||
private:
|
||||
/// Expire reordering timer
|
||||
|
||||
@@ -45,9 +45,9 @@ public:
|
||||
LteRlcSpecificLteMacSapUser (LteRlc* rlc);
|
||||
|
||||
// Interface implemented from LteMacSapUser
|
||||
virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
|
||||
virtual void NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters params);
|
||||
virtual void NotifyHarqDeliveryFailure ();
|
||||
virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
|
||||
virtual void ReceivePdu (LteMacSapUser::ReceivePduParameters params);
|
||||
|
||||
private:
|
||||
LteRlcSpecificLteMacSapUser ();
|
||||
@@ -64,9 +64,9 @@ LteRlcSpecificLteMacSapUser::LteRlcSpecificLteMacSapUser ()
|
||||
}
|
||||
|
||||
void
|
||||
LteRlcSpecificLteMacSapUser::NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcSpecificLteMacSapUser::NotifyTxOpportunity (TxOpportunityParameters params)
|
||||
{
|
||||
m_rlc->DoNotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
|
||||
m_rlc->DoNotifyTxOpportunity (params);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -76,9 +76,9 @@ LteRlcSpecificLteMacSapUser::NotifyHarqDeliveryFailure ()
|
||||
}
|
||||
|
||||
void
|
||||
LteRlcSpecificLteMacSapUser::ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcSpecificLteMacSapUser::ReceivePdu (LteMacSapUser::ReceivePduParameters params)
|
||||
{
|
||||
m_rlc->DoReceivePdu (p, rnti, lcid);
|
||||
m_rlc->DoReceivePdu (params);
|
||||
}
|
||||
|
||||
|
||||
@@ -217,41 +217,41 @@ LteRlcSm::DoTransmitPdcpPdu (Ptr<Packet> p)
|
||||
}
|
||||
|
||||
void
|
||||
LteRlcSm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcSm::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << p);
|
||||
NS_LOG_FUNCTION (this << rxPduParams.p);
|
||||
// RLC Performance evaluation
|
||||
RlcTag rlcTag;
|
||||
Time delay;
|
||||
NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing");
|
||||
p->RemovePacketTag (rlcTag);
|
||||
NS_ASSERT_MSG (rxPduParams.p->PeekPacketTag (rlcTag), "RlcTag is missing");
|
||||
rxPduParams.p->RemovePacketTag (rlcTag);
|
||||
delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
|
||||
NS_LOG_LOGIC (" RNTI=" << m_rnti
|
||||
<< " LCID=" << (uint32_t) m_lcid
|
||||
<< " size=" << p->GetSize ()
|
||||
<< " size=" << rxPduParams.p->GetSize ()
|
||||
<< " delay=" << delay.GetNanoSeconds ());
|
||||
m_rxPdu(m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds () );
|
||||
m_rxPdu(m_rnti, m_lcid, rxPduParams.p->GetSize (), delay.GetNanoSeconds () );
|
||||
}
|
||||
|
||||
void
|
||||
LteRlcSm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
|
||||
LteRlcSm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << bytes);
|
||||
NS_LOG_FUNCTION (this << txOpParams.bytes);
|
||||
LteMacSapProvider::TransmitPduParameters params;
|
||||
params.pdu = Create<Packet> (bytes);
|
||||
params.pdu = Create<Packet> (txOpParams.bytes);
|
||||
params.rnti = m_rnti;
|
||||
params.lcid = m_lcid;
|
||||
params.layer = layer;
|
||||
params.harqProcessId = harqId;
|
||||
params.componentCarrierId = componentCarrierId;
|
||||
params.layer = txOpParams.layer;
|
||||
params.harqProcessId = txOpParams.harqId;
|
||||
params.componentCarrierId = txOpParams.componentCarrierId;
|
||||
|
||||
// RLC Performance evaluation
|
||||
RlcTag tag (Simulator::Now());
|
||||
params.pdu->AddPacketTag (tag);
|
||||
NS_LOG_LOGIC (" RNTI=" << m_rnti
|
||||
<< " LCID=" << (uint32_t) m_lcid
|
||||
<< " size=" << bytes);
|
||||
m_txPdu(m_rnti, m_lcid, bytes);
|
||||
<< " size=" << txOpParams.bytes);
|
||||
m_txPdu(m_rnti, m_lcid, txOpParams.bytes);
|
||||
|
||||
m_macSapProvider->TransmitPdu (params);
|
||||
ReportBufferStatus ();
|
||||
|
||||
@@ -148,14 +148,9 @@ protected:
|
||||
/**
|
||||
* Notify transmit opportunity
|
||||
*
|
||||
* \param bytes number of bytes
|
||||
* \param layer the layer
|
||||
* \param harqId the HARQ ID
|
||||
* \param componentCarrierId component carrier ID
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
* \param params LteMacSapUser::TxOpportunityParameters
|
||||
*/
|
||||
virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid) = 0;
|
||||
virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters params) = 0;
|
||||
/**
|
||||
* Notify HARQ delivery failure
|
||||
*/
|
||||
@@ -163,11 +158,9 @@ protected:
|
||||
/**
|
||||
* Receive PDU function
|
||||
*
|
||||
* \param p the packet
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
* \param params the LteMacSapUser::ReceivePduParameters
|
||||
*/
|
||||
virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) = 0;
|
||||
virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters params) = 0;
|
||||
|
||||
LteMacSapUser* m_macSapUser; ///< MAC SAP user
|
||||
LteMacSapProvider* m_macSapProvider; ///< MAC SAP provider
|
||||
@@ -210,9 +203,9 @@ public:
|
||||
virtual void DoDispose ();
|
||||
|
||||
virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
|
||||
virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
|
||||
virtual void DoNotifyHarqDeliveryFailure ();
|
||||
virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -463,7 +463,14 @@ LteUeMac::RecvRaResponse (BuildRarListElement_s raResponse)
|
||||
{
|
||||
NS_FATAL_ERROR ("Function called on wrong componentCarrier");
|
||||
}
|
||||
lc0InfoIt->second.macSapUser->NotifyTxOpportunity (raResponse.m_grant.m_tbSize, 0, 0, m_componentCarrierId, m_rnti, lc0Lcid);
|
||||
LteMacSapUser::TxOpportunityParameters txOpParams;
|
||||
txOpParams.bytes = raResponse.m_grant.m_tbSize;
|
||||
txOpParams.layer = 0;
|
||||
txOpParams.harqId = 0;
|
||||
txOpParams.componentCarrierId = m_componentCarrierId;
|
||||
txOpParams.rnti = m_rnti;
|
||||
txOpParams.lcid = lc0Lcid;
|
||||
lc0InfoIt->second.macSapUser->NotifyTxOpportunity (txOpParams);
|
||||
lc0BsrIt->second.txQueueSize = 0;
|
||||
}
|
||||
}
|
||||
@@ -589,7 +596,11 @@ LteUeMac::DoReceivePhyPdu (Ptr<Packet> p)
|
||||
std::map <uint8_t, LcInfo>::const_iterator it = m_lcInfoMap.find (tag.GetLcid ());
|
||||
if (it != m_lcInfoMap.end ())
|
||||
{
|
||||
it->second.macSapUser->ReceivePdu (p, m_rnti, tag.GetLcid ());
|
||||
LteMacSapUser::ReceivePduParameters rxPduParams;
|
||||
rxPduParams.p = p;
|
||||
rxPduParams.rnti = m_rnti;
|
||||
rxPduParams.lcid = tag.GetLcid ();
|
||||
it->second.macSapUser->ReceivePdu (rxPduParams);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -650,6 +661,9 @@ LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg)
|
||||
}
|
||||
}
|
||||
NS_LOG_LOGIC (this << " UE " << m_rnti << ": UL-CQI notified TxOpportunity of " << dci.m_tbSize << " => " << bytesPerActiveLc << " bytes per active LC" << " statusPduMinSize " << statusPduMinSize);
|
||||
|
||||
LteMacSapUser::TxOpportunityParameters txOpParams;
|
||||
|
||||
for (it = m_lcInfoMap.begin (); it != m_lcInfoMap.end (); it++)
|
||||
{
|
||||
itBsr = m_ulBsrReceived.find ((*it).first);
|
||||
@@ -661,7 +675,13 @@ LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg)
|
||||
{
|
||||
if ((statusPduPriority) && ((*itBsr).second.statusPduSize == statusPduMinSize))
|
||||
{
|
||||
(*it).second.macSapUser->NotifyTxOpportunity ((*itBsr).second.statusPduSize, 0, 0, m_componentCarrierId, m_rnti, (*it).first);
|
||||
txOpParams.bytes = (*itBsr).second.statusPduSize;
|
||||
txOpParams.layer = 0;
|
||||
txOpParams.harqId = 0;
|
||||
txOpParams.componentCarrierId = m_componentCarrierId;
|
||||
txOpParams.rnti = m_rnti;
|
||||
txOpParams.lcid = (*it).first;
|
||||
(*it).second.macSapUser->NotifyTxOpportunity (txOpParams);
|
||||
NS_LOG_LOGIC (this << "\t" << bytesPerActiveLc << " send " << (*itBsr).second.statusPduSize << " status bytes to LC " << (uint32_t)(*it).first << " statusQueue " << (*itBsr).second.statusPduSize << " retxQueue" << (*itBsr).second.retxQueueSize << " txQueue" << (*itBsr).second.txQueueSize);
|
||||
(*itBsr).second.statusPduSize = 0;
|
||||
break;
|
||||
@@ -672,7 +692,13 @@ LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg)
|
||||
NS_LOG_LOGIC (this << "\t" << bytesPerActiveLc << " bytes to LC " << (uint32_t)(*it).first << " statusQueue " << (*itBsr).second.statusPduSize << " retxQueue" << (*itBsr).second.retxQueueSize << " txQueue" << (*itBsr).second.txQueueSize);
|
||||
if (((*itBsr).second.statusPduSize > 0) && (bytesForThisLc > (*itBsr).second.statusPduSize))
|
||||
{
|
||||
(*it).second.macSapUser->NotifyTxOpportunity ((*itBsr).second.statusPduSize, 0, 0, m_componentCarrierId, m_rnti, (*it).first);
|
||||
txOpParams.bytes = (*itBsr).second.statusPduSize;
|
||||
txOpParams.layer = 0;
|
||||
txOpParams.harqId = 0;
|
||||
txOpParams.componentCarrierId = m_componentCarrierId;
|
||||
txOpParams.rnti = m_rnti;
|
||||
txOpParams.lcid = (*it).first;
|
||||
(*it).second.macSapUser->NotifyTxOpportunity (txOpParams);
|
||||
bytesForThisLc -= (*itBsr).second.statusPduSize;
|
||||
NS_LOG_DEBUG (this << " serve STATUS " << (*itBsr).second.statusPduSize);
|
||||
(*itBsr).second.statusPduSize = 0;
|
||||
@@ -692,7 +718,13 @@ LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg)
|
||||
if ((*itBsr).second.retxQueueSize > 0)
|
||||
{
|
||||
NS_LOG_DEBUG (this << " serve retx DATA, bytes " << bytesForThisLc);
|
||||
(*it).second.macSapUser->NotifyTxOpportunity (bytesForThisLc, 0, 0, m_componentCarrierId, m_rnti, (*it).first);
|
||||
txOpParams.bytes = bytesForThisLc;
|
||||
txOpParams.layer = 0;
|
||||
txOpParams.harqId = 0;
|
||||
txOpParams.componentCarrierId = m_componentCarrierId;
|
||||
txOpParams.rnti = m_rnti;
|
||||
txOpParams.lcid = (*it).first;
|
||||
(*it).second.macSapUser->NotifyTxOpportunity (txOpParams);
|
||||
if ((*itBsr).second.retxQueueSize >= bytesForThisLc)
|
||||
{
|
||||
(*itBsr).second.retxQueueSize -= bytesForThisLc;
|
||||
@@ -712,7 +744,7 @@ LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg)
|
||||
// overestimate RLC overhead rather than
|
||||
// underestimate it and risk unneeded
|
||||
// segmentation which increases delay
|
||||
rlcOverhead = 4;
|
||||
rlcOverhead = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -720,7 +752,13 @@ LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg)
|
||||
rlcOverhead = 2;
|
||||
}
|
||||
NS_LOG_DEBUG (this << " serve tx DATA, bytes " << bytesForThisLc << ", RLC overhead " << rlcOverhead);
|
||||
(*it).second.macSapUser->NotifyTxOpportunity (bytesForThisLc, 0, 0, m_componentCarrierId, m_rnti, (*it).first);
|
||||
txOpParams.bytes = bytesForThisLc;
|
||||
txOpParams.layer = 0;
|
||||
txOpParams.harqId = 0;
|
||||
txOpParams.componentCarrierId = m_componentCarrierId;
|
||||
txOpParams.rnti = m_rnti;
|
||||
txOpParams.lcid = (*it).first;
|
||||
(*it).second.macSapUser->NotifyTxOpportunity (txOpParams);
|
||||
if ((*itBsr).second.txQueueSize >= bytesForThisLc - rlcOverhead)
|
||||
{
|
||||
(*itBsr).second.txQueueSize -= bytesForThisLc - rlcOverhead;
|
||||
|
||||
@@ -99,28 +99,28 @@ NoOpComponentCarrierManager::DoReportBufferStatus (LteMacSapProvider::ReportBuff
|
||||
}
|
||||
|
||||
void
|
||||
NoOpComponentCarrierManager::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
|
||||
NoOpComponentCarrierManager::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (rnti);
|
||||
NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << rnti);
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
|
||||
NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID " << (uint16_t) lcid);
|
||||
NS_LOG_DEBUG (this << " rnti= " << rnti << " lcid= " << (uint32_t) lcid << " layer= " << (uint32_t)layer<<" ccId="<< (uint32_t)componentCarrierId);
|
||||
(*lcidIt).second->NotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
|
||||
std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (txOpParams.rnti);
|
||||
NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << txOpParams.rnti);
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (txOpParams.lcid);
|
||||
NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID " << (uint16_t) txOpParams.lcid);
|
||||
NS_LOG_DEBUG (this << " rnti= " << txOpParams.rnti << " lcid= " << (uint32_t) txOpParams.lcid << " layer= " << (uint32_t)txOpParams.layer<<" ccId="<< (uint32_t)txOpParams.componentCarrierId);
|
||||
(*lcidIt).second->NotifyTxOpportunity (txOpParams);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
NoOpComponentCarrierManager::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
NoOpComponentCarrierManager::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (rnti);
|
||||
NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << rnti);
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
|
||||
std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (rxPduParams.rnti);
|
||||
NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << rxPduParams.rnti);
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (rxPduParams.lcid);
|
||||
if (lcidIt != rntiIt->second.end ())
|
||||
{
|
||||
(*lcidIt).second->ReceivePdu (p, rnti, lcid);
|
||||
(*lcidIt).second->ReceivePdu (rxPduParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,21 +101,16 @@ protected:
|
||||
virtual void DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameters params);
|
||||
/**
|
||||
* \brief Notify transmit opportunity.
|
||||
* \param bytes the number of bytes
|
||||
* \param layer the layer
|
||||
* \param harqId the HARQ ID
|
||||
* \param componentCarrierId the component carrier ID
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
*
|
||||
* \param txOpParams the LteMacSapUser::TxOpportunityParameters
|
||||
*/
|
||||
virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
|
||||
/**
|
||||
* \brief Receive PDU.
|
||||
* \param p the packet
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
*
|
||||
* \param rxPduParams the LteMacSapUser::ReceivePduParameters
|
||||
*/
|
||||
virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
|
||||
virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
|
||||
/// Notify HARQ delivery failure
|
||||
virtual void DoNotifyHarqDeliveryFailure ();
|
||||
/**
|
||||
|
||||
@@ -90,8 +90,8 @@ public:
|
||||
SimpleUeCcmMacSapUser (SimpleUeComponentCarrierManager* mac);
|
||||
|
||||
// inherited from LteMacSapUser
|
||||
virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
|
||||
virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
|
||||
virtual void NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
|
||||
virtual void ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
|
||||
virtual void NotifyHarqDeliveryFailure ();
|
||||
|
||||
|
||||
@@ -105,17 +105,17 @@ SimpleUeCcmMacSapUser::SimpleUeCcmMacSapUser (SimpleUeComponentCarrierManager* m
|
||||
}
|
||||
|
||||
void
|
||||
SimpleUeCcmMacSapUser::NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
|
||||
SimpleUeCcmMacSapUser::NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
|
||||
{
|
||||
NS_LOG_INFO ("SimpleUeCcmMacSapUser::NotifyTxOpportunity for ccId:"<<(uint32_t)componentCarrierId);
|
||||
m_mac->DoNotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
|
||||
NS_LOG_INFO ("SimpleUeCcmMacSapUser::NotifyTxOpportunity for ccId:"<<(uint32_t)txOpParams.componentCarrierId);
|
||||
m_mac->DoNotifyTxOpportunity (txOpParams);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SimpleUeCcmMacSapUser::ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
SimpleUeCcmMacSapUser::ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
|
||||
{
|
||||
m_mac->DoReceivePdu (p, rnti, lcid);
|
||||
m_mac->DoReceivePdu (rxPduParams);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -203,7 +203,7 @@ SimpleUeComponentCarrierManager::DoReportBufferStatus (LteMacSapProvider::Report
|
||||
NS_LOG_FUNCTION (this);
|
||||
NS_LOG_DEBUG ("BSR from RLC for LCID = " << (uint16_t)params.lcid);
|
||||
std::map <uint8_t, LteMacSapProvider*>::iterator it = m_macSapProvidersMap.find (0);
|
||||
NS_ABORT_MSG_IF (it == m_macSapProvidersMap.end (), "could not find Sap for ComponentCarrier ");
|
||||
NS_ABORT_MSG_IF (it == m_macSapProvidersMap.end (), "could not find Sap for ComponentCarrier");
|
||||
|
||||
NS_LOG_DEBUG ("Size of component carrier LC map "<< m_componentCarrierLcMap.size());
|
||||
|
||||
@@ -227,23 +227,28 @@ SimpleUeComponentCarrierManager::DoNotifyHarqDeliveryFailure ()
|
||||
|
||||
|
||||
void
|
||||
SimpleUeComponentCarrierManager::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
|
||||
SimpleUeComponentCarrierManager::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = m_lcAttached.find (lcid);
|
||||
NS_ASSERT_MSG (lcidIt != m_lcAttached.end (), "could not find LCID" << lcid);
|
||||
NS_LOG_DEBUG (this << " lcid= " << (uint32_t) lcid << " layer= " << (uint16_t) layer << " componentCarierId " << (uint16_t) componentCarrierId << " rnti " << rnti);
|
||||
NS_LOG_DEBUG (this << " MAC is asking component carrier id = " << (uint16_t) componentCarrierId <<" with lcid = " << (uint32_t) lcid << " to transmit "<< bytes<< " bytes");
|
||||
(*lcidIt).second->NotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = m_lcAttached.find (txOpParams.lcid);
|
||||
NS_ABORT_MSG_IF (lcidIt == m_lcAttached.end (), "could not find LCID" << (uint16_t) txOpParams.lcid);
|
||||
NS_LOG_DEBUG (this << " lcid = " << (uint32_t) txOpParams.lcid << " layer= "
|
||||
<< (uint16_t) txOpParams.layer << " componentCarierId "
|
||||
<< (uint16_t) txOpParams.componentCarrierId << " rnti " << txOpParams.rnti);
|
||||
|
||||
NS_LOG_DEBUG (this << " MAC is asking component carrier id = " << (uint16_t) txOpParams.componentCarrierId
|
||||
<< " with lcid = " << (uint32_t) txOpParams.lcid << " to transmit "<< txOpParams.bytes<< " bytes");
|
||||
(*lcidIt).second->NotifyTxOpportunity (txOpParams);
|
||||
}
|
||||
void
|
||||
SimpleUeComponentCarrierManager::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
|
||||
SimpleUeComponentCarrierManager::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = m_lcAttached.find (lcid);
|
||||
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = m_lcAttached.find (rxPduParams.lcid);
|
||||
NS_ABORT_MSG_IF (lcidIt == m_lcAttached.end (), "could not find LCID" << (uint16_t) rxPduParams.lcid);
|
||||
if (lcidIt != m_lcAttached.end ())
|
||||
{
|
||||
(*lcidIt).second->ReceivePdu (p, rnti, lcid);
|
||||
(*lcidIt).second->ReceivePdu (rxPduParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,21 +93,16 @@ protected:
|
||||
// forwarded from LteMacSapUser
|
||||
/**
|
||||
* \brief Notify TX opportunity function
|
||||
* \param bytes the number of bytes
|
||||
* \param layer the layer
|
||||
* \param harqId the HARQ ID
|
||||
* \param componentCarrierId the component carrier ID
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
*
|
||||
* \param txOpParams the LteMacSapUser::TxOpportunityParameters
|
||||
*/
|
||||
void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
|
||||
void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
|
||||
/**
|
||||
* \brief Receive PDU function
|
||||
* \param p the packet
|
||||
* \param rnti the RNTI
|
||||
* \param lcid the LCID
|
||||
*
|
||||
* \param rxPduParams the LteMacSapUser::ReceivePduParameters
|
||||
*/
|
||||
void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
|
||||
void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
|
||||
//forwarded from LteUeCcmRrcSapProvider
|
||||
/**
|
||||
* \brief Add LC function
|
||||
|
||||
@@ -484,13 +484,21 @@ LteTestMac::SendTxOpportunity (Time time, uint32_t bytes)
|
||||
haveContext = true;
|
||||
}
|
||||
}
|
||||
LteMacSapUser::TxOpportunityParameters txOpParmas;
|
||||
txOpParmas.bytes = bytes;
|
||||
txOpParmas.layer = 0;
|
||||
txOpParmas.componentCarrierId = 0;
|
||||
txOpParmas.harqId = 0;
|
||||
txOpParmas.rnti = 0;
|
||||
txOpParmas.lcid = 0;
|
||||
|
||||
if (haveContext)
|
||||
{
|
||||
Simulator::ScheduleWithContext (node->GetId (), time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, bytes, 0, 0, 0, 0, 0);
|
||||
Simulator::ScheduleWithContext (node->GetId (), time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, txOpParmas);
|
||||
}
|
||||
else
|
||||
{
|
||||
Simulator::Schedule (time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, bytes, 0, 0, 0, 0, 0);
|
||||
Simulator::Schedule (time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, txOpParmas);
|
||||
}
|
||||
|
||||
if (m_txOpportunityMode == RANDOM_MODE)
|
||||
@@ -558,6 +566,11 @@ LteTestMac::DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params)
|
||||
m_txPdus++;
|
||||
m_txBytes += params.pdu->GetSize ();
|
||||
|
||||
LteMacSapUser::ReceivePduParameters rxPduParams;
|
||||
rxPduParams.p = params.pdu;
|
||||
rxPduParams.rnti = params.rnti;
|
||||
rxPduParams.lcid = params.lcid;
|
||||
|
||||
if (m_device)
|
||||
{
|
||||
m_device->Send (params.pdu, m_device->GetBroadcast (), 0);
|
||||
@@ -565,7 +578,7 @@ LteTestMac::DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params)
|
||||
else if (m_macLoopback)
|
||||
{
|
||||
Simulator::Schedule (Seconds (0.1), &LteMacSapUser::ReceivePdu,
|
||||
m_macLoopback->m_macSapUser, params.pdu, params.rnti, params.lcid);
|
||||
m_macLoopback->m_macSapUser, rxPduParams);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -622,11 +635,18 @@ LteTestMac::DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameter
|
||||
|
||||
int32_t size = params.statusPduSize + params.txQueueSize + params.retxQueueSize;
|
||||
Time time = m_txOppTime;
|
||||
LteMacSapUser::TxOpportunityParameters txOpParmas;
|
||||
txOpParmas.bytes = m_txOppSize;
|
||||
txOpParmas.layer = 0;
|
||||
txOpParmas.componentCarrierId = 0;
|
||||
txOpParmas.harqId = 0;
|
||||
txOpParmas.rnti = params.rnti;
|
||||
txOpParmas.lcid = params.lcid;
|
||||
while (size > 0)
|
||||
{
|
||||
EventId e = Simulator::Schedule (time,
|
||||
&LteMacSapUser::NotifyTxOpportunity,
|
||||
m_macSapUser, m_txOppSize, 0, 0, 0, params.rnti, params.lcid);
|
||||
m_macSapUser, txOpParmas);
|
||||
m_nextTxOppList.push_back (e);
|
||||
size -= m_txOppSize;
|
||||
time += m_txOppTime;
|
||||
@@ -644,7 +664,11 @@ LteTestMac::Receive (Ptr<NetDevice> nd, Ptr<const Packet> p, uint16_t protocol,
|
||||
m_rxBytes += p->GetSize ();
|
||||
|
||||
Ptr<Packet> packet = p->Copy ();
|
||||
m_macSapUser->ReceivePdu (packet, 0, 0);
|
||||
LteMacSapUser::ReceivePduParameters rxPduParams;
|
||||
rxPduParams.p = packet;
|
||||
rxPduParams.rnti = 0;
|
||||
rxPduParams.lcid = 0;
|
||||
m_macSapUser->ReceivePdu (rxPduParams);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user