Commit 9d361386 authored by aligungr's avatar aligungr

RLS developments

parent f8029dd7
...@@ -254,13 +254,14 @@ struct NwUeRlsToRls : NtsMessage ...@@ -254,13 +254,14 @@ struct NwUeRlsToRls : NtsMessage
DOWNLINK_RRC, DOWNLINK_RRC,
RADIO_LINK_FAILURE, RADIO_LINK_FAILURE,
TRANSMISSION_FAILURE, TRANSMISSION_FAILURE,
ASSIGN_SERVING_CELL,
} present; } present;
// RECEIVE_RLS_MESSAGE // RECEIVE_RLS_MESSAGE
// UPLINK_RRC // UPLINK_RRC
// DOWNLINK_RRC // DOWNLINK_RRC
// SIGNAL_CHANGED // SIGNAL_CHANGED
// UPLINK_DATA // ASSIGN_SERVING_CELL
int cellId{}; int cellId{};
// RECEIVE_RLS_MESSAGE // RECEIVE_RLS_MESSAGE
......
...@@ -23,7 +23,7 @@ namespace nr::ue ...@@ -23,7 +23,7 @@ namespace nr::ue
{ {
RlsControlTask::RlsControlTask(TaskBase *base, uint64_t sti) RlsControlTask::RlsControlTask(TaskBase *base, uint64_t sti)
: m_mainTask{}, m_udpTask{}, m_pduMap{}, m_sti{sti}, m_pendingAck{} : m_mainTask{}, m_udpTask{}, m_pduMap{}, m_sti{sti}, m_pendingAck{}, m_servingCell{}
{ {
m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "rls-ctl"); m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "rls-ctl");
} }
...@@ -59,11 +59,14 @@ void RlsControlTask::onLoop() ...@@ -59,11 +59,14 @@ void RlsControlTask::onLoop()
handleRlsMessage(w->cellId, *w->msg); handleRlsMessage(w->cellId, *w->msg);
break; break;
case NwUeRlsToRls::UPLINK_DATA: case NwUeRlsToRls::UPLINK_DATA:
handleUplinkDataDelivery(w->cellId, w->psi, std::move(w->data)); handleUplinkDataDelivery(w->psi, std::move(w->data));
break; break;
case NwUeRlsToRls::UPLINK_RRC: case NwUeRlsToRls::UPLINK_RRC:
handleUplinkRrcDelivery(w->cellId, w->pduId, w->rrcChannel, std::move(w->data)); handleUplinkRrcDelivery(w->cellId, w->pduId, w->rrcChannel, std::move(w->data));
break; break;
case NwUeRlsToRls::ASSIGN_SERVING_CELL:
m_servingCell = w->cellId;
break;
default: default:
m_logger->unhandledNts(msg); m_logger->unhandledNts(msg);
break; break;
...@@ -111,10 +114,13 @@ void RlsControlTask::handleRlsMessage(int cellId, rls::RlsMessage &msg) ...@@ -111,10 +114,13 @@ void RlsControlTask::handleRlsMessage(int cellId, rls::RlsMessage &msg)
m_pendingAck[cellId].push_back(m.pduId); m_pendingAck[cellId].push_back(m.pduId);
if (m.pduType == rls::EPduType::DATA) if (m.pduType == rls::EPduType::DATA)
{
if (cellId != m_servingCell)
{ {
// NOTE: Data packet may be received from a cell other than serving cell // NOTE: Data packet may be received from a cell other than serving cell
// (This is not a problem for RRC, but for DATA), normally we should avoid this, no need for now. // Ignore the packet if this is the case. Other cell can only send RRC, but not DATA
(void)cellId; return;
}
auto *w = new NwUeRlsToRls(NwUeRlsToRls::DOWNLINK_DATA); auto *w = new NwUeRlsToRls(NwUeRlsToRls::DOWNLINK_DATA);
w->psi = static_cast<int>(m.payload); w->psi = static_cast<int>(m.payload);
...@@ -186,7 +192,7 @@ void RlsControlTask::handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::Rr ...@@ -186,7 +192,7 @@ void RlsControlTask::handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::Rr
m_udpTask->send(cellId, msg); m_udpTask->send(cellId, msg);
} }
void RlsControlTask::handleUplinkDataDelivery(int cellId, int psi, OctetString &&data) void RlsControlTask::handleUplinkDataDelivery(int psi, OctetString &&data)
{ {
rls::RlsPduTransmission msg{m_sti}; rls::RlsPduTransmission msg{m_sti};
msg.pduType = rls::EPduType::DATA; msg.pduType = rls::EPduType::DATA;
...@@ -194,7 +200,7 @@ void RlsControlTask::handleUplinkDataDelivery(int cellId, int psi, OctetString & ...@@ -194,7 +200,7 @@ void RlsControlTask::handleUplinkDataDelivery(int cellId, int psi, OctetString &
msg.payload = static_cast<uint32_t>(psi); msg.payload = static_cast<uint32_t>(psi);
msg.pduId = 0; msg.pduId = 0;
m_udpTask->send(cellId, msg); m_udpTask->send(m_servingCell, msg);
} }
void RlsControlTask::onAckControlTimerExpired() void RlsControlTask::onAckControlTimerExpired()
......
...@@ -30,6 +30,7 @@ class RlsControlTask : public NtsTask ...@@ -30,6 +30,7 @@ class RlsControlTask : public NtsTask
std::unordered_map<uint32_t, rls::PduInfo> m_pduMap; std::unordered_map<uint32_t, rls::PduInfo> m_pduMap;
uint64_t m_sti; uint64_t m_sti;
std::unordered_map<int, std::vector<uint32_t>> m_pendingAck; std::unordered_map<int, std::vector<uint32_t>> m_pendingAck;
int m_servingCell;
public: public:
explicit RlsControlTask(TaskBase *base, uint64_t sti); explicit RlsControlTask(TaskBase *base, uint64_t sti);
...@@ -47,7 +48,7 @@ class RlsControlTask : public NtsTask ...@@ -47,7 +48,7 @@ class RlsControlTask : public NtsTask
void handleRlsMessage(int cellId, rls::RlsMessage &msg); void handleRlsMessage(int cellId, rls::RlsMessage &msg);
void handleSignalChange(int cellId, int dbm); void handleSignalChange(int cellId, int dbm);
void handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::RrcChannel channel, OctetString &&data); void handleUplinkRrcDelivery(int cellId, uint32_t pduId, rrc::RrcChannel channel, OctetString &&data);
void handleUplinkDataDelivery(int cellId, int psi, OctetString &&data); void handleUplinkDataDelivery(int psi, OctetString &&data);
void onAckControlTimerExpired(); void onAckControlTimerExpired();
void onAckSendTimerExpired(); void onAckSendTimerExpired();
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment