Problem about receiving packet by UE(User Equipment in LTE Network

87 views
Skip to first unread message

Ozan Cakmak

unread,
Mar 19, 2015, 12:37:53 AM3/19/15
to ns-3-...@googlegroups.com
Hi all

I am working on a project that connects an LTE UE node to the gateway of a .11s based mesh network. When the UE sends a packet to the gateway it succeeds, but when the gateway sends a packet the UE node is not able to receive the packet. We checked the IP addresses and ports, they all seem correct. Actually this is very similar to the scenario in lena-simple-epc.cc. Although I made use of this sample completely it failed.

Is there anyone who designed such a system before? What might be the problem?

Thank you in advance

Ozan.

Nat P

unread,
Mar 19, 2015, 4:34:45 AM3/19/15
to ns-3-...@googlegroups.com

Routing tables ?

Check with flowmonitor.

Ozan Cakmak

unread,
Mar 20, 2015, 2:35:07 AM3/20/15
to ns-3-...@googlegroups.com
I got this message.

msg="InternetStackHelper::Install (): Aggregating an InternetStack to 
a node with an existing Ipv4 object", file=../src/helper/internet- 
stack-helper.cc

My Scenario Step by Step
 
1- GATEWAY<----> MESH NETWORK: 
Gateway( defined as nodes(1) ) -- Mesh Network  (defined as nodes(2....24) ) Assume that we have 25 nodes. First node is my gateway, and others are smart meters. I successfully made connection between gateway and mesh network.

2-   GATEWAY<----> USER EQUIPMENT in LTE Environment :
After time between gateway and mesh network finish, I want to make a connection between gateway(defined as remoteHost) and UserEquipment(UE) in LTE NETWORK. Gateway successfully received packets from UE, but UE didn't receive packets from Gateway. Both of them sent packets each other.

I am sending my codes very shortly so that you can understand. This code that I tried to tell my scenario in my previous email. I am not sure but I  think InternetStacker makes a problem because Nodes(Global variable) are installed by internet before.  when I want to use nodes(1)[that was installed by internetStacker] for connection between this and UE. You can see this inside Run() function. I wrote this capital letters.

How can I overcome this problem? 

class MeshTest{
    public:
       int Run ();
NodeContainer nodes;

 private:
        InternetStackHelper internetStack;
        Ipv4InterfaceContainer interfaces;
 private:
        /// Create nodes and setup their mobility
        void CreateNodes ();
        
        /// Install internet m_stack on nodes
        void InstallInternetStack ();
        
        /// Install applications
        void InstallApplicationGatewayToSMs();  -> It works perfect
        void InstallApplicationSMsToGateway ();  -> It Works perfect
}        

void MeshTest::CreateNodes (){
    nodes.Create (m_size); // 25,36..etc
}

void MeshTest::InstallInternetStack (){
    // Config::SetDefault ("ns3::TcpL4Protocol::VariableRTO", BooleanValue (true));
    //InternetStackHelper internetStack;
    internetStack.Install (nodes);
    Ipv4AddressHelper address;
    address.SetBase ("10.1.1.0", "255.255.255.0");
    interfaces = address.Assign (meshDevices);
}

void MeshTest::void Run(){
 NS_LOG_INFO("LTE APP START");
    Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
    Ptr<PointToPointEpcHelper>  epcHelper = CreateObject<PointToPointEpcHelper> ();
    lteHelper->SetEpcHelper (epcHelper);
    
    Ptr<Node> pgw = epcHelper->GetPgwNode ();
    
    NS_LOG_INFO("SECOND STEP- GATEWAP SETUP");
 
    Ptr<Node> remoteHost = nodes.Get(0);
    NS_LOG_INFO("NODE 0 IP ADDRESS " <<  interfaces.GetAddress(0));
    internetStacker.Install (remoteHost); -------> THIS STATEMENT GENERATES AN ERROR!
    
    NS_LOG_INFO("THIRD STEP- CREATE INTERNET");
    // Create the Internet
    PointToPointHelper p2ph;
    p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
    p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
    p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
    NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);

    NS_LOG_INFO("FOURTH STEP- CONFIGURE REMOTEHOST IPv4 ADDRESS");
    Ipv4AddressHelper ipv4h;
    ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
    Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
    // interface 0 is localhost, 1 is the p2p device
    Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
    NS_LOG_INFO("remoteHostAddr--> " << remoteHostAddr);
    
    NS_LOG_INFO("FIFTH STEP- SET UP IPv4 ADDRESS for UE");
    Ipv4StaticRoutingHelper ipv4RoutingHelper; 
    Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
    remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
    
    NS_LOG_INFO("SIXTH STEP- CREATE UE_NODES and ENB_NODES");
    uint16_t numberOfNodes = 1; 
    double distance = 60.0;
    NodeContainer ueNodes;
    NodeContainer enbNodes;
    enbNodes.Create(numberOfNodes);
    ueNodes.Create(numberOfNodes);
   
    // Install Mobility Model
    Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
    for (uint16_t i = 0; i < numberOfNodes; i++)
    {
      positionAlloc->Add (Vector(distance * i, 0, 0));
    }
    
    NS_LOG_INFO("SEVENTH STEP- CREATE MOBILITY");
    MobilityHelper mobility;
    mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
    mobility.SetPositionAllocator(positionAlloc);
    mobility.Install(enbNodes);
    mobility.Install(ueNodes);

    // Install LTE Devices to the nodes
    NetDeviceContainer enbLteDevs = lteHelper->InstallEnbDevice (enbNodes);
    NetDeviceContainer ueLteDevs = lteHelper->InstallUeDevice (ueNodes);
  
    // Install the IP stack on the UEs
    internetStack.Install (ueNodes);
    Ipv4InterfaceContainer ueIpIface;
    ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevs));
  
  NS_LOG_INFO("EIGHTH STEP- ASSIGN IP ADDRESS to UES");
  // Assign IP address to UEs, and install applications
  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
    {
      Ptr<Node> ueNode = ueNodes.Get (u);
      // Set the default gateway for the UE
      Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
      ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
    }

   NS_LOG_INFO("NINTH STEP-  ATTACH one UE per eNodeB");
   // Attach one UE per eNodeB
   for (uint16_t i = 0; i < numberOfNodes; i++)
      {
        lteHelper->Attach (ueLteDevs.Get(i), enbLteDevs.Get(i));
        // side effect: the default EPS bearer will be activated
      }
    
    double interPacketInterval = 100;
   // Install and start applications on UEs and remote host
    uint16_t dlPort = 1234;
    uint16_t ulPort = 2000;
    ApplicationContainer clientApps;
    ApplicationContainer serverApps;

    for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
    {
      ++ulPort;
      PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (ueIpIface.GetAddress (u), dlPort));
      NS_LOG_INFO("UE--> "<< ueIpIface.GetAddress (u) << " and port: "<< dlPort<<" and mask: "<< ueIpIface.GetAddress (u).GetBroadcast());
      dlPacketSinkHelper.SetAttribute("TransMode", UintegerValue(1)); //UE
      
      PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (remoteHostAddr, ulPort));
      NS_LOG_INFO("REMOTEHOST--> "<< remoteHostAddr<< " and port: "<< ulPort<<" and mask: "<<remoteHostAddr.GetBroadcast());
      ulPacketSinkHelper.SetAttribute("TransMode", UintegerValue(0)); //RemoteHost
      
      serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get(u)));
      serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
      
      UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); //UE
      NS_LOG_INFO("U Number : " << u);
      
      dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
      dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
      dlClient.SetAttribute("TransMode", UintegerValue(1)); //UE

      UdpClientHelper ulClient (remoteHostAddr, ulPort);//RemoteHost
      ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
      ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
      ulClient.SetAttribute("TransMode", UintegerValue(0)); //RemoteHost
      
      clientApps.Add (dlClient.Install (remoteHost));
      clientApps.Add (ulClient.Install (ueNodes.Get(u)));

    }
  serverApps.Start (Seconds (250));
  clientApps.Start (Seconds (260));

  lteHelper->EnableTraces ();
  
  serverApps.Stop(Seconds(300));
  clientApps.Stop(Seconds(285)); 
  NS_LOG_INFO("THE END LTE");
Reply all
Reply to author
Forward
0 new messages