Downlink transmission for selected users only

44 views
Skip to first unread message

Resting Platypus

unread,
Oct 7, 2019, 1:28:56 PM10/7/19
to ns-3-users
Hi,

I am running lena-simple-epc.cc on NS-3.29. As far as I can understand from looking at the LENA documentation and source code on NS-3, the Dl/Ul traces are hooked to the EPS bearers and Radio bearers. I want to allow all the UE's to transmit in uplink direction, however, I would like the downlink transmission only to selected UEs, say all UEs except the UEs with IMSI values 2 and 3. I did a lot of trials and errors including erasing the entry from Dl RLC Buffer of the corresponding IMSI values. That didn't work and I realized that the bearers nonetheless get activated for these UEs and thus there is a corresponding entry in DlMacStats, DlRlcStats, DlPdcpStats. So I tried changing the PointToPointEpcHelper:ActivateEpsBearer(ueDev, imsi, bearer, tft) method as follows:
uint8_t
PointToPointEpcHelper::ActivateEpsBearer (Ptr<NetDevice> ueDevice, uint64_t imsi, Ptr<EpcTft> tft, EpsBearer bearer)
{
  NS_LOG_FUNCTION (this << ueDevice << imsi);

  // we now retrieve the IPv4/IPv6 address of the UE and notify it to the SGW;
  // we couldn't do it before since address assignment is triggered by
  // the user simulation program, rather than done by the EPC   
  Ptr<Node> ueNode = ueDevice->GetNode (); 
  Ptr<Ipv4> ueIpv4 = ueNode->GetObject<Ipv4> ();
  Ptr<Ipv6> ueIpv6 = ueNode->GetObject<Ipv6> ();
  NS_ASSERT_MSG (ueIpv4 != 0 || ueIpv6 != 0, "UEs need to have IPv4/IPv6 installed before EPS bearers can be activated");

  if (ueIpv4)
    {
      int32_t interface =  ueIpv4->GetInterfaceForDevice (ueDevice);
      if (interface >= 0 && ueIpv4->GetNAddresses (interface) == 1)
        {
          Ipv4Address ueAddr = ueIpv4->GetAddress (interface, 0).GetLocal ();
          NS_LOG_LOGIC (" UE IPv4 address: " << ueAddr);
          m_sgwPgwApp->SetUeAddress (imsi, ueAddr);
        }
    }
  if (ueIpv6)
    {
      int32_t interface6 =  ueIpv6->GetInterfaceForDevice (ueDevice);
      if (interface6 >= 0 && ueIpv6->GetNAddresses (interface6) == 2)
        {
          Ipv6Address ueAddr6 = ueIpv6->GetAddress (interface6, 1).GetAddress ();
          NS_LOG_LOGIC (" UE IPv6 address: " << ueAddr6);
          m_sgwPgwApp->SetUeAddress6 (imsi, ueAddr6);
        }
    }

 

 uint8_t bearerId = 0;

   uint8_t bearerId = 0;

  if(imsi == 2 || imsi == 3)
  {
  NS_LOG_INFO("Bearers for IMSI 2 and 3 not activated");

  }
  else
  {
  bearerId = m_mme->AddBearer (imsi, tft, bearer);
  }

  Ptr<LteUeNetDevice> ueLteDevice = ueDevice->GetObject<LteUeNetDevice> ();
  if (ueLteDevice)
  {
  Simulator::ScheduleNow (&EpcUeNas::ActivateEpsBearer, ueLteDevice->GetNas (), bearer, tft);
  }

  return bearerId;
}


I suppose EpcUeNas::ActivateEpsBearer takes care of activating radio bearer in uplink direction and EpcMmeApplication helps in activating Dl bearers. According to this undstanding, the DlMasStats should not show an entry for IMSI = 2 and IMSI =3, which actually is the case in my simulation. However, the UlMacStats also doesn't have an entry for these two UEs. Can anyone please help me with this problem. The UlMacStats should have an entry for these two UEs but not the DlMacStats.  I am also attaching the corresponding files for further consideration. Please help!



DlMacStats.txt
UlMacStats.txt
Reply all
Reply to author
Forward
0 new messages