End to End delay calculation

4,318 views
Skip to first unread message

chitraxi raj

unread,
Apr 18, 2014, 7:12:45 AM4/18/14
to ns-3-...@googlegroups.com
Hello there!!
I want to calculate end to end delay between the two nodes for my code. I can't use flow monitor. What are the alternatives for it?

chitraxi raj

unread,
Apr 18, 2014, 8:02:48 AM4/18/14
to ns-3-...@googlegroups.com


On Friday, 18 April 2014 16:53:07 UTC+5:30, Konstantinos wrote:
Look at the UdpClient/Server example. (/examples/udp-client-server)

I did. I tried to use callback methods for source and receive packets. Here is the code. Kindly have a look


void SendPacket (Ptr<Socket> sSocket)
{
   Ptr<Packet> pkt;
       if(sent == 0)
    {
        senttime = Simulator::Now().GetSeconds();
        sent++;
    }
//    return senttime;
}

uint32_t currentSequenceNumber;
void ReceivePacket (Ptr<Socket> socket)
{
 
  NS_LOG_UNCOND ("Received One packet!");
 
   Ptr<Packet> packet;
   while(packet = socket->Recv())
    {
        SeqTsHeader seqTs;
        packet->RemoveHeader (seqTs);
         currentSequenceNumber = seqTs.GetSeq ();
        
        std::cout << "transmission time" << MacTx() << "\n";
        bytesTotal += packet->GetSize ();
              packetsReceived += 1;
   
//        delay = delay +  (Simulator::Now() - seqTs.GetTs());       
        throughput = (bytesTotal * 8) / (1024 * ( (Simulator::Now().GetSeconds ()) - senttime));
        }
    //throughput = (bytesTotal * 8) / (1024 * ( (Simulator::Now()).GetSeconds ()));
       //return delay;
     std::cout << "seq num " << currentSequenceNumber << "\n";
}


I tried to use seqTs to calculate delay but it doesn't show anything. The output I'm getting is like this

Received One packet!
transmission time+0.0ns
seq num 0

This shows that seqTs is not pointing anything. Why is that?

 

Konstantinos

unread,
Apr 18, 2014, 10:20:03 AM4/18/14
to ns-3-...@googlegroups.com
When you send the packet you do not add the SeqTsHeader, so when you receive it, it is not there to get it.

What is the MacTx() function you call?

chitraxi raj

unread,
Apr 18, 2014, 10:57:01 AM4/18/14
to ns-3-...@googlegroups.com


On Friday, 18 April 2014 19:50:03 UTC+5:30, Konstantinos wrote:
When you send the packet you do not add the SeqTsHeader, so when you receive it, it is not there to get it.

How do I add SeqTsHeader sir? 
What is the MacTx() function you call?
I was trying something wicked then. I tried to attach the actual code here but the file can't be uploaded for some reasons. So here is my code. Please take a look and suggest me additions. :)
INPUT:


#include...
....
...

using namespace ns3;

int packetsReceived = 0;
double throughput = 0;
uint32_t bytesTotal = 0;
int m_lossCounter=0;
uint32_t m_received=0;
uint32_t senttime = 0;
uint32_t sent = 0;
double delay = 0.0;




void SendPacket (Ptr<Socket> sSocket)
{
   Ptr<Packet> pkt;
       if(sent == 0)
    {
        senttime = Simulator::Now().GetSeconds();
        sent++;
    }
}

uint32_t currentSequenceNumber;
void ReceivePacket (Ptr<Socket> socket)
{
 
  NS_LOG_UNCOND ("Received One packet!");
 
   Ptr<Packet> packet;
   while(packet = socket->Recv())
    {
        SeqTsHeader seqTs;
        packet->RemoveHeader (seqTs);
         currentSequenceNumber = seqTs.GetSeq ();
       
        bytesTotal += packet->GetSize ();
              packetsReceived += 1;
   
//        delay = delay +  (Simulator::Now() - seqTs.GetTs());      
        throughput = (bytesTotal * 8) / (1024 * ( (Simulator::Now().GetSeconds ()) - senttime));
        }
       //return delay;
     std::cout << "seq num " << currentSequenceNumber << "\n";
}


static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
                             uint32_t pktCount, Time pktInterval )
{
  if (pktCount > 0)
    {
      socket->Send (Create<Packet> (pktSize));
      Simulator::Schedule (pktInterval, &GenerateTraffic,
                           socket, pktSize,pktCount-1, pktInterval);
    }
  else
    {
      socket->Close ();
    }

}

int main (int argc, char *argv[])
{
  std::string phyMode ("DsssRate1Mbps");
  uint32_t packetSize = 1024; // bytes
  uint32_t numPackets = 50;
  uint32_t nNodes = 30;
  double interval = 2.0; // seconds
 
  CommandLine cmd;

  cmd.AddValue ("phyMode", "Wifi Phy mode", phyMode);
  cmd.AddValue("nNodes", "Number of Nodes", nNodes);
  cmd.AddValue ("packetSize", "size of application packet sent", packetSize);
  cmd.AddValue ("numPackets", "number of packets generated", numPackets);
  cmd.AddValue ("interval", "interval (seconds) between packets", interval);

  cmd.Parse (argc, argv);
  // Convert to time object
  Time interPacketInterval = Seconds (interval);

 


  // disable fragmentation for frames below 2200 bytes
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("22000"));
  // turn off RTS/CTS for frames below 2200 bytes
  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200"));
  // Fix non-unicast data rate to be the same as that of unicast
  Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",
                      StringValue (phyMode));

  NodeContainer c;
  c.Create (nNodes);

  // The below set of helpers will help us to put together the wifi NICs we want
  WifiHelper wifi;
  wifi.SetStandard (WIFI_PHY_STANDARD_80211b);

  YansWifiPhyHelper wifiPhy =  YansWifiPhyHelper::Default ();
  // This is one parameter that matters when using FixedRssLossModel
  // set it to zero; otherwise, gain will be added
  //wifiPhy.Set ("RxGain", DoubleValue (0) );
  // ns-3 supports RadioTap and Prism tracing extensions for 802.11b
  wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);

  YansWifiChannelHelper wifiChannel;
  wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
  // The below FixedRssLossModel will cause the rss to be fixed regardless
  // of the distance between the two stations, and the transmit power
 // wifiChannel.AddPropagationLoss ("ns3::FixedRssLossModel","Rss",DoubleValue (rss));
  wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel");
  wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel","MinDistance",DoubleValue (100));
 
  wifiPhy.SetChannel (wifiChannel.Create ());

  // Add a non-QoS upper mac, and disable rate control
  NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
                                "DataMode",StringValue (phyMode),
                                "ControlMode",StringValue (phyMode));
  // Set it to adhoc mode
  wifiMac.SetType ("ns3::AdhocWifiMac");
  NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, c);

  Ns2MobilityHelper ns2 = Ns2MobilityHelper ("scratch/s30mob.tcl");
  ns2.Install ();
 
//  AodvHelper aodv;
  // OlsrHelper olsr;
  GpsrHelper gpsr;
 
  //aodv.Install();

  InternetStackHelper internet;
  internet.SetRoutingHelper (gpsr);
  internet.Install (c);
  gpsr.Install ();

  Ipv4AddressHelper ipv4;
  NS_LOG_INFO ("Assign IP Addresses.");
  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
  Ipv4InterfaceContainer i = ipv4.Assign (devices);

  
  uint16_t Port = 12345;
  
  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
 
 
 
  Ptr<Socket> source;
  source = Socket::CreateSocket (c.Get (11), tid);
  InetSocketAddress remote = InetSocketAddress (("10.1.1.27"), Port);
  source->Connect (remote);
  source->SetRecvCallback (MakeCallback (&SendPacket));

  Ptr<Socket> recvSink = Socket::CreateSocket (c.Get (26), tid);
  InetSocketAddress local = InetSocketAddress ((Ipv4Address::GetAny()), Port);
  recvSink->Bind (local);
  recvSink->SetRecvCallback (MakeCallback (&ReceivePacket));
 
 

  NS_LOG_UNCOND ("Testing " << numPackets  << " packets sent " );
 
 
  Simulator::ScheduleWithContext (source->GetNode ()->GetId (), Seconds (1.0), &GenerateTraffic, source, packetSize, numPackets, interPacketInterval);
  Simulator::Stop(Seconds (120));
  Simulator::Run ();

 

  Simulator::Destroy ();
  std::cout << "packets received are " << packetsReceived << "\n";
  std::cout << "Throughput is " << throughput << "\n";
  std::cout << "Delay is " << delay << "\n";
  return 0;
}


Konstantinos

unread,
Apr 18, 2014, 11:47:42 AM4/18/14
to ns-3-...@googlegroups.com
I do not understand what you want to do with the two sockets you create and the received callbacks.

Please read and understand the /examples/udp-client-server/udp-client-server.cc 
All you have to get from that, is the application part, so your source is a client and your destination a server.


On Friday, April 18, 2014 3:57:01 PM UTC+1, chitraxi raj wrote:


On Friday, 18 April 2014 19:50:03 UTC+5:30, Konstantinos wrote:
When you send the packet you do not add the SeqTsHeader, so when you receive it, it is not there to get it.

How do I add SeqTsHeader sir? 

chitraxi raj

unread,
Apr 18, 2014, 6:01:52 PM4/18/14
to ns-3-...@googlegroups.com


On Friday, 18 April 2014 21:17:42 UTC+5:30, Konstantinos wrote:
I do not understand what you want to do with the two sockets you create and the received callbacks.
Letme try to explain this code.


uint16_t Port = 12345;
  
  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
Ptr<Socket> recvSink = Socket::CreateSocket (c.Get (26), tid); //Receiving sink at node 26

  InetSocketAddress local = InetSocketAddress ((Ipv4Address::GetAny()), Port);
  recvSink->Bind (local);
  recvSink->SetRecvCallback (MakeCallback (&ReceivePacket)); //callback to ReceivePacket


void ReceivePacket (Ptr<Socket> socket)
{
 
  NS_LOG_UNCOND ("Received One packet!"); //Whenever it receives a packet

 
   Ptr<Packet> packet;
   while(packet = socket->Recv())
  {
        SeqTsHeader seqTs;
        packet->RemoveHeader (seqTs);
         currentSequenceNumber = seqTs.GetSeq ();
       
        bytesTotal += packet->GetSize ();
              packetsReceived += 1;
   
        delay = delay +  (Simulator::Now() - seqTs.GetTs());       //Delay calculation (It doesn't calculate. I need help for this, seqTs returns 0)
        throughput = (bytesTotal * 8) / (1024 * ( (Simulator::Now().GetSeconds ()) - senttime)); //Correctly calculates for IP level.
        }
     std::cout << "seq num " << currentSequenceNumber << "\n"; //Just to check sequence number
}

 Ptr<Socket> source;
  source = Socket::CreateSocket (c.Get (11), tid); //Source at node 11
  InetSocketAddress remote = InetSocketAddress (("10.1.1.27"), Port); //sends data to node 26
    source->Connect (remote);
  source->SetRecvCallback (MakeCallback (&SendPacket)); //Make Callback to SendPacket
void SendPacket (Ptr<Socket> sSocket) //Just to return transmission time of first packet which is useful to find throughput (throughput

{
   Ptr<Packet> pkt;
       if(sent == 0)
    {
        senttime = Simulator::Now().GetSeconds(); //stores transmission time of first packet sent in senttime. Senttime is used for throughput calculation in Receive callback.
        sent++;
    }
}
I hope I made my code clear. Now kindly suggest me what addition do I need to make to calculate end to end delay in this code?

Please read and understand the /examples/udp-client-server/udp-client-server.cc 
All you have to get from that, is the application part, so your source is a client and your destination a server.

I thought you were talking about /src/applications/udp-server.cc and udp-client.cc.
I read /examples/udp-client-server/udp-client-server.cc and unfortunately I don't understand how it'll be helpful to calculate delay.

Konstantinos

unread,
Apr 18, 2014, 6:50:11 PM4/18/14
to ns-3-...@googlegroups.com
When I said I do not understand your code, I meant that I do not understand why you have that callback on SendPacket. Perhaps you have not understood how your code really works. This will be triggered when node 11 receives a packet. If you do not send a packet to that node, it will not be triggered.

The first and any subsequent packets are generated from the GenerateTraffic method. 
Yes, the udp-server/client.cc files I was referring which you can see in action in the example. If you run that example you can get in the output the delay and if you read more carefully the code, you can see how it was generated. Partially you have done it by reading a SeqTsHeader when you receive, but you have to add that header in the packet you generate (code in the client part)

chitraxi raj

unread,
Apr 18, 2014, 9:48:18 PM4/18/14
to ns-3-...@googlegroups.com


On Saturday, 19 April 2014 04:20:11 UTC+5:30, Konstantinos wrote:
When I said I do not understand your code, I meant that I do not understand why you have that callback on SendPacket. Perhaps you have not understood how your code really works. This will be triggered when node 11 receives a packet. If you do not send a packet to that node, it will not be triggered.

The first and any subsequent packets are generated from the GenerateTraffic method.

I realized my mistake sir!! I worked it out 2-3 hours back. :) SendPacket callback was so needless. Sill me!! And yes I did make changes in GenerateTraffic and now I'm getting some real output(througput at IP level) However, delay, I'm still working on it.

This question is out of the context for this thread, but I'm getting lesser throughput and PDR for my sumo mobility scenario as compared to PDR and throughput of AODV and OLSR protocols. Do you have any remarks for that sir?
 

chitraxi raj

unread,
Apr 19, 2014, 7:40:54 AM4/19/14
to ns-3-...@googlegroups.com
Sir I tried to run udp-server.cc file but it stopped at build. And I'm following the same procedure as shown in that file. Still I get sequence number as zero. I tried to print the IP address which also results in zeros. You're right. Im not able to send the packet header to my call back. Can you help me with it?

Tommaso Pecorella

unread,
Apr 19, 2014, 9:05:04 AM4/19/14
to ns-3-...@googlegroups.com
Hi,

please try to explain more clearly the issue. What is that stopped at build ?

Also, if you need your code checked, please send it (attached in an attachment, see above the "Attach a file" link).

T.

chitraxi raj

unread,
Apr 19, 2014, 10:16:42 AM4/19/14
to ns-3-...@googlegroups.com


I'm attaching both the files here:
my code and the udp-server.cc which i tried to run.kindly suggest me to how to add packet header so that i can differentiate TX and RX values for each recived packed to calculate delay.

error is:

Build failed
 -> task in 'udp-server' failed (exit status 1):
    {task 59849424: cxxprogram udp-server.cc.1.o -> udp-server}
['/usr/bin/g++', '-pthread', '-pthread', '-Wl,-Bsymbolic-functions', '-Wl,-z,relro', 'scratch/udp-server.cc.1.o', '-o', '/home/chitraxi/Downloads/repos/tarballs/ns-allinone-3.17/ns-3.17/build/scratch/udp-server', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--no-as-needed', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L/usr/lib', '-lns3.17-test-debug', '-lns3.17-csma-layout-debug', '-lns3.17-point-to-point-layout-debug', '-lns3.17-netanim-debug', '-lns3.17-lte-debug', '-lns3.17-spectrum-debug', '-lns3.17-antenna-debug', '-lns3.17-aodv-debug', '-lns3.17-dsdv-debug', '-lns3.17-dsr-debug', '-lns3.17-mesh-debug', '-lns3.17-olsr-debug', '-lns3.17-csma-debug', '-lns3.17-wimax-debug', '-lns3.17-applications-debug', '-lns3.17-virtual-net-device-debug', '-lns3.17-uan-debug', '-lns3.17-energy-debug', '-lns3.17-flow-monitor-debug', '-lns3.17-nix-vector-routing-debug', '-lns3.17-tap-bridge-debug', '-lns3.17-visualizer-debug', '-lns3.17-internet-debug', '-lns3.17-bridge-debug', '-lns3.17-point-to-point-debug', '-lns3.17-mpi-debug', '-lns3.17-wifi-debug', '-lns3.17-buildings-debug', '-lns3.17-propagation-debug', '-lns3.17-mobility-debug', '-lns3.17-config-store-debug', '-lns3.17-tools-debug', '-lns3.17-stats-debug', '-lns3.17-emu-debug', '-lns3.17-fd-net-device-debug', '-lns3.17-topology-read-debug', '-lns3.17-network-debug', '-lns3.17-core-debug', '-lrt', '-lgsl', '-lgslcblas', '-lm', '-lgtk-x11-2.0', '-lgdk-x11-2.0', '-latk-1.0', '-lgio-2.0', '-lpangoft2-1.0', '-lpangocairo-1.0', '-lgdk_pixbuf-2.0', '-lcairo', '-lpango-1.0', '-lfreetype', '-lfontconfig', '-lgobject-2.0', '-lglib-2.0', '-lxml2', '-lsqlite3', '-lpython2.7']
 
udp-server.cc
gandhinagar100_3.cc

Konstantinos

unread,
Apr 19, 2014, 2:58:35 PM4/19/14
to ns-3-...@googlegroups.com
The udp-server.cc can not be run as it is; for example ./waf --run udp-server. Simply because it is just the implementation of a class, not a simulation scenario.

To calculate the delay, as I have already told you, you need to add the SeqTsHeader in the sending packets.
See the UdpClient which sends the packets and particularly the send function

150 void
152 {
153  NS_LOG_FUNCTION (this);
155  SeqTsHeader seqTs;
156  seqTs.SetSeq (m_sent);
157  Ptr<Packet> p = Create<Packet> (m_size-(8+4)); // 8+4 : the size of the seqTs header
158  p->AddHeader (seqTs);
159 ...
170  if ((m_socket->Send (p)) >= 0)

In your scenario you create a packet and you send it. 
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, uint32_t pktCount, Time pktInterval ) {
 
if (pktCount > 0)
 
{
 socket
->Send (Create<Packet> (pktSize));
...

So, the change you have to make is simply (a) create the packet outside the Send, (b) add the header as above and (c) send that packet.

chitraxi raj

unread,
Apr 20, 2014, 3:56:09 AM4/20/14
to ns-3-...@googlegroups.com
SOLVED!! I don't have enough words to thank you sir!! Now I can finally calculate delay for GPSR and GPCR which was not possible using Flow Monitor. I and my project mate Urvik Upadhyay, both are thanking you from bottom of our heart for your constant help and support. :)

And I'm posting my code here so that if anyone needs help to calculate delay and throughput without help of flow monitor, they can use this function.

void ReceivePacket (Ptr<Socket> socket)
{
 
  NS_LOG_UNCOND
("Received One packet!");

 
   
Ptr<Packet> packet ;
   
while(packet = socket->Recv())
   
{
       
SeqTsHeader seqTsx;
        packet
->RemoveHeader (seqTsx);
         currentSequenceNumber
= seqTsx.GetSeq ();

       
            bytesTotal
+= packet->GetSize ();
                  packetsReceived
+= 1;

       
            rcv
= Simulator::Now().GetMilliSeconds();
            sqhd
= seqTsx.GetTs().GetMilliSeconds();
           
            std
::cout << "Seq No " << currentSequenceNumber << " Tx " << sqhd << "\n";//Just to check seq number and Tx time
             delay
= delay +  (rcv - sqhd); //delay calculation
       
   
}
             xx
= rcv - senttime;    
               
        throughput
= (bytesTotal * 8 * 1000) / (1024 * xx); //throughput calculation
 
}




static void GenerateTraffic (Ptr<Socket> socket/* Ptr<Packet> p*/, uint32_t pktSize,
                             uint32_t pktCount
, Time pktInterval )
{
 
if (pktCount > 0)
   
{
       
SeqTsHeader seqTs;
      seqTs
.SetSeq (pktCount);
     
Ptr<Packet> p = Create<Packet> (packetSize-(8+4)); // 8+4 : the size of the seqTs header
      p
->AddHeader (seqTs);
      socket
->Send (p);
      NS_LOG_UNCOND
("Sending "<< pktCount  << " packet! \n");
     
if(pktCount == 50)
   
{
        senttime
= Simulator::Now().GetMilliSeconds();

Changsik Lee

unread,
Apr 28, 2014, 3:35:09 AM4/28/14
to ns-3-...@googlegroups.com
Hi, all

As concerned with end-to-end delay,

I have some troubles.

Could you look over my code?

Different to your code,

I used 'Rx' which is described in packetsink.cc for receiving packets,

and upd-client-application for sending packets.

However, different from my expectation, it doesn't show anything.

I think that Callback is not fired for Rx.

What's the problem of my code?

2014년 4월 20일 일요일 오후 4시 56분 9초 UTC+9, chitraxi raj 님의 말:
chang2.cc

Changsik Lee

unread,
Apr 28, 2014, 8:51:13 AM4/28/14
to ns-3-...@googlegroups.com
Hi,

thank you for replying.

As your advice, I used  Config::ConnectWithoutContext("/NodeList/*/ApplicationList/*/$ns3::PacketSink/Rx", MakeCallback(&Rx));

and I revised 'RX' as described packetsink.h

void Rx (Ptr<const Packet> packet, const Address &from)

{

        SeqTsHeader seqTs;
        packet->RemoveHeader (seqTs);

        r_time = Simulator::Now().GetMilliSeconds();
        s_time = seqTs.GetTs().GetMilliSeconds();
 
        delay = (r_time - s_time); //delay calculation
        
}

But, I received some error messages:

error : passing 'const ns3::Packet' as 'this' argument of 'uint32_t ns3::Packet:RemoveHeader (ns3::Header&)' discards qualifiers

What does this error message mean?

Help me.

2014년 4월 28일 월요일 오후 5시 21분 6초 UTC+9, Konstantinos 님의 말:
Check the API for PacketSink application to find the correct config path. The one you use now is not correct.

Konstantinos

unread,
Apr 28, 2014, 9:04:47 AM4/28/14
to ns-3-...@googlegroups.com
The packet you pass as variable in the Rx method is a const, that means you are not allowed to change it, and when you call RemoveHeader, you actually try to change it.

Solutions: You can (1) make a non-const copy from that packet or (2) use PeekHeader() instead.

Changsik Lee

unread,
Apr 28, 2014, 9:35:39 AM4/28/14
to ns-3-...@googlegroups.com
Thank you a lot!

PeekHeader works.

However, there's still no update calculating the delay.

result output is:

enabling EPC
Attached Ues to ENBs
Delay is 0

I think MakeCallback for Rx is not still fired, which is a similar problem mentioned by questioner.


2014년 4월 28일 월요일 오후 10시 4분 47초 UTC+9, Konstantinos 님의 말:

Konstantinos

unread,
Apr 28, 2014, 9:42:47 AM4/28/14
to ns-3-...@googlegroups.com
To check if the Rx fires, you can simply put a NS_LOG in there.

If again it does not fire, then probably you do not receive a packet, and the problem may be elsewhere. You can use the debugger or NS_LOG to check if you actually receive a packet or not.

Changsik Lee

unread,
Apr 28, 2014, 10:04:08 AM4/28/14
to ns-3-...@googlegroups.com
I've already checked if a packet is received or not.

When I use FlowMoitor, there are some results. (if there is no received packet, it would not show any result)

By some possibility, should I declare again 'Send' function which is described in upd-client.cc ?

2014년 4월 28일 월요일 오후 10시 42분 47초 UTC+9, Konstantinos 님의 말:

Konstantinos

unread,
Apr 28, 2014, 10:13:55 AM4/28/14
to ns-3-...@googlegroups.com
See answers inline


On Monday, April 28, 2014 3:04:08 PM UTC+1, Changsik Lee wrote:
I've already checked if a packet is received or not.


Did you check if the Rx trace fires in the way I suggested? using simply a NS_LOG.
 
When I use FlowMoitor, there are some results. (if there is no received packet, it would not show any result)


What type of results? Do you see there Received packets? Or just Tx? 
 
By some possibility, should I declare again 'Send' function which is described in upd-client.cc ?


No, since you use UdpClient as your source, there is no need to declare again any function, you use the udp-client.cc file.

Konstantinos

unread,
Apr 28, 2014, 10:30:32 AM4/28/14
to ns-3-...@googlegroups.com
Just run your scenario and I got compilation error here 

    Config::SetDefault ("ns3::UdpClient::Interval", TimeValue (MilliSeconds(0.01)));  //default 1

which is correct (the error) since the MiliSeconds() requires a uint64_t as input and not a double/float you give.
So, if you just want the interval to be 1ms, just put MiliSeconds(1). If you want to be 0.01ms = 10000ns --> NanoSeconds(10000).

After modifying this, and putting a NS_LOG in the Rx (as already told you*) I got this output

enabling EPC
Attached Ues to eNBs
Rx Packet
17
Rx Packet
16
Rx Packet
19
Rx Packet
18
...


(*) NS_LOG_UNCOND ("Rx Packet"); and NS_LOG_UNCOND(delay);

Changsik Lee

unread,
Apr 28, 2014, 10:43:17 AM4/28/14
to ns-3-...@googlegroups.com
Yes, It works!

I'm very grateful for everything you've done for me.

Then, if i want to get the end-to-end delay of each packet, I only need to save each value at a array, right?

Thank you again!

2014년 4월 28일 월요일 오후 11시 30분 32초 UTC+9, Konstantinos 님의 말:

Konstantinos

unread,
Apr 28, 2014, 10:49:37 AM4/28/14
to ns-3-...@googlegroups.com
In principle yes.

Yacine Henou

unread,
May 7, 2014, 10:56:40 AM5/7/14
to ns-3-...@googlegroups.com
Thank you a lot for these functions :) I have some request:
First, Can you explain me what refer to "xx"  and "rcv". 
second, i have "Seq No 0 Tx 0" which is not normally. Have you same thing ? 
Thank you. 

Konstantinos

unread,
Apr 18, 2014, 7:23:07 AM4/18/14
to ns-3-...@googlegroups.com
Look at the UdpClient/Server example. (/examples/udp-client-server)

Konstantinos

unread,
Apr 28, 2014, 4:21:06 AM4/28/14
to ns-3-...@googlegroups.com
Check the API for PacketSink application to find the correct config path. The one you use now is not correct.

On Monday, April 28, 2014 8:35:09 AM UTC+1, Changsik Lee wrote:

HADJI MERIEM

unread,
May 20, 2016, 5:01:10 AM5/20/16
to ns-3-users
Hi
pleas,
if you like it can you tell me how you get the fichier.tcl thank you very much in advance

Giorgos Anysios

unread,
Jul 22, 2016, 4:10:59 AM7/22/16
to ns-3-users
Hi to all and congratulations for your good advice.

Hi chitraxi raj I copy pasted your code, I defined the variables. But it doesn't print me the end-to-end delay. Could you please tell me what I have to do to take the results?

Thanks in Advance


George

nana barimah appiah

unread,
Dec 26, 2017, 12:22:25 PM12/26/17
to ns-3-users
Hi, I'm working on an Epidemic routing project and I'm stuck at a point which I really need help. I want to get the number of messages delivered and the message delivery latency. I will appreciate if someone helps me out. Thank you.

Tommaso Pecorella

unread,
Dec 26, 2017, 4:09:33 PM12/26/17
to ns-3-users
Hi,

please read the posting guidelines and start a new thread, describing exactly what you did and how.
In the posting guidelines you'll find a detailed analysis of what we need to provide any meaningful help.


T.

nana barimah appiah

unread,
Dec 26, 2017, 4:12:18 PM12/26/17
to ns-3-...@googlegroups.com
Okay, thank you for the response.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/2FgUgDkZOBg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages