proper source ip address aodv

91 views
Skip to first unread message

Lincy Elizebeth Jim

unread,
Dec 14, 2015, 11:44:45 PM12/14/15
to ns-3-users
hi all

i am using ns-3.23 and in aodv i am trying do the following
once the rerr is received by the source(origin of rreq) i need to cout "activdc"

 // If there is only one precursor, RERR SHOULD be unicast toward that precursor
  if (precursors.size () == 1)
    {
      RoutingTableEntry toPrecursor;
      if (m_routingTable.LookupValidRoute (precursors.front (), toPrecursor))
        {//lincy start
       Ptr<Ipv4L3Protocol> l3K = m_ipv4->GetObject<Ipv4L3Protocol> ();
       Ipv4InterfaceAddress ifaceLocal = l3K->GetAddress(1,0);//lincy end
       
          Ptr<Socket> socket = FindSocketWithInterfaceAddress (toPrecursor.GetInterface ());
          NS_ASSERT (socket);
          NS_LOG_LOGIC ("one precursor => unicast RERR to " << toPrecursor.GetDestination () << " from " << toPrecursor.GetInterface ().GetLocal ());
          std::cout<<ifaceLocal.GetLocal()<<"###"<<"unicast RERR to " << toPrecursor.GetDestination () << " from " << toPrecursor.GetInterface ().GetLocal ()<<"\n";//lincy
          Simulator::Schedule (Time (MilliSeconds (m_uniformRandomVariable->GetInteger (0, 10))), &RoutingProtocol::SendTo, this, socket, packet, precursors.front ());
          m_rerrCount++;
          RreqHeader rreqHeader;//lincy start
      //rerrHeader.SetOrigin (ifaceLocal.GetLocal ());
             Ipv4Address origin=rreqHeader.GetOrigin ();
 // Ipv4Address origin = header.GetSource ();
                    std::cout<<"ACTIVDC"<<origin<<"\n";
            if (IsMyOwnAddress (origin)){
                 //ActivateDC();//Lincy
 std::cout<<origin<<"ActivateDC";
                }  //lincy end


as can be seen from the screenshot i get 102.102.102.102 instead of 10.0.0.1

kindly guide
thanking in advance
lincy
Screenshot from 2015-12-15 15:38:42.png

Tommaso Pecorella

unread,
Dec 15, 2015, 4:56:44 AM12/15/15
to ns-3-users
I'm not surprised at all...
      RreqHeader rreqHeader;//lincy start
     
//rerrHeader.SetOrigin (ifaceLocal.GetLocal ());
     
Ipv4Address origin=rreqHeader.GetOrigin ();


What do you expect from a non-initialized header ?

Please double check your code.

T.

Konstantinos

unread,
Dec 15, 2015, 5:11:28 AM12/15/15
to ns-3-users
Hi Lincy,

You have this part in your code

RreqHeader rreqHeader;//lincy start
Ipv4Address origin=rreqHeader.GetOrigin ();

You create an 'empty' RreqHeader and from that you try to get the Origin, which, as expected, is the default value 102.102.102.102
Instead of creating an empty RreqHeader, you should use the received header. That does have the proper origin.

Regards,
K.

Lincy Elizebeth Jim

unread,
Dec 15, 2015, 11:43:12 PM12/15/15
to ns-3-users
Hi Tommaso and Konstantinos

When I do
// If there is only one precursor, RERR SHOULD be unicast toward that precursor
  if (precursors.size () == 1)
    {
      RoutingTableEntry toPrecursor;
      if (m_routingTable.LookupValidRoute (precursors.front (), toPrecursor))
        {//lincy start
       Ptr<Ipv4L3Protocol> l3K = m_ipv4->GetObject<Ipv4L3Protocol> ();
       Ipv4InterfaceAddress ifaceLocal = l3K->GetAddress(1,0);//lincy end
        
          Ptr<Socket> socket = FindSocketWithInterfaceAddress (toPrecursor.GetInterface ());
          NS_ASSERT (socket);
          NS_LOG_LOGIC ("one precursor => unicast RERR to " << toPrecursor.GetDestination () << " from " << toPrecursor.GetInterface ().GetLocal ());
          std::cout<<ifaceLocal.GetLocal()<<"###"<<"unicast RERR to " << toPrecursor.GetDestination () << " from " << toPrecursor.GetInterface ().GetLocal ()<<"\n";//lincy
          Simulator::Schedule (Time (MilliSeconds (m_uniformRandomVariable->GetInteger (0, 10))), &RoutingProtocol::SendTo, this, socket, packet, precursors.front ());
          m_rerrCount++;
        RreqHeader rreqHeader;//lincy start
     rreqHeader.SetOrigin (ifaceLocal.GetLocal ());

             Ipv4Address origin=rreqHeader.GetOrigin ();
 // Ipv4Address origin = header.GetSource ();
                    std::cout<<"ACTIVDC"<<origin<<"\n";
            if (IsMyOwnAddress (origin)){
                 //ActivateDC();//Lincy
 std::cout<<origin<<"ActivateDC";
                }  //lincy end

i get ACTIVDC printed out by all nodes ,My purpose is to just make the originator node of RREQ print ACTIVDC,Is there any way to select the origin node only and print ACTIVDC

thanking in advance

regards
lincy

Konstantinos

unread,
Dec 16, 2015, 3:30:51 AM12/16/15
to ns-3-users
Again that's expected to see that output in every node because 

RreqHeader rreqHeader;//lincy start
rreqHeader
.SetOrigin (ifaceLocal.GetLocal ());
Ipv4Address origin=rreqHeader.GetOrigin ();

You create an empty header, you tell it that the Origin is you (any node that has precursors.size () == 1 will call this) and then you say print ACTIVDC if Origin is you.
It will print it because it IS you!

As I mentioned in the previous reply the problem is here
RreqHeader rreqHeader;//lincy start

You should not create a NEW empty header. You should use the header that you have received!

Regards,
K.

Lincy Jim

unread,
Dec 17, 2015, 12:19:27 AM12/17/15
to ns-3-users

Hi Konstantinos

How to use the received header without declaring one in the method send rerr message

Kindly guide
Thanking in advance

--
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/IJUz_-s38oQ/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.

Lincy Jim

unread,
Dec 17, 2015, 6:31:33 PM12/17/15
to ns-3-users
Hi


I did this

void
RoutingProtocol::SendRerrWhenNoRouteToForward (Ipv4Address dst,
                                               uint32_t dstSeqNo, Ipv4Address origin) // when there is route error dc is activated and pamp signal is sent by src(initiator of rreq) node //lincy
{
  NS_LOG_FUNCTION (this);
  // A node SHOULD NOT originate more than RERR_RATELIMIT RERR messages per second.
  if (m_rerrCount == RerrRateLimit)
    {
      // Just make sure that the RerrRateLimit timer is running and will expire
      NS_ASSERT (m_rerrRateLimitTimer.IsRunning ());
      // discard the packet and return
      NS_LOG_LOGIC ("RerrRateLimit reached at " << Simulator::Now ().GetSeconds () << " with timer delay left "
                                                << m_rerrRateLimitTimer.GetDelayLeft ().GetSeconds ()
                                                << "; suppressing RERR");
      return;
    }
  RerrHeader rerrHeader;
  rerrHeader.SetOrigin (dst);//lincy
 
std::cout<<rerrHeader.GetOrigin()<<"rerrheader origin"<<"\n"; //now I can see the origin



Inorder to cout ACTIVDC  from received header
i did
 case HISTYPE_RERR:
      {     
        RecvError (packet, sender);

    Ptr<Ipv4L3Protocol> l3K = m_ipv4->GetObject<Ipv4L3Protocol> ();
    Ipv4InterfaceAddress ifaceLocal = l3K->GetAddress(1,0);
     std::cout << ifaceLocal.GetLocal() << "###" << sender<< ":recv rerr from this node "<<"\n";//lincy
        rerrHeader.GetOrigin ();
    
        break;
}

but I rerrHeader was not declared in this scope.

kindly guide

thanking in advance

lincy

--

Konstantinos

unread,
Dec 18, 2015, 4:59:51 AM12/18/15
to ns-3-users
Hi Lincy,

Is the switch case inside the SendRerrWhenNoRouteToForward?
If not, then clearly the rerrHeader is not in the scope [1].

The rerrHeader is available in the "RecvError" method
1536 {
1537  NS_LOG_FUNCTION (this << " from " << src);
1538  RerrHeader rerrHeader;
1539  p->RemoveHeader (rerrHeader);

[1] http://www.tutorialspoint.com/cplusplus/cpp_variable_scope.htm
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Lincy Jim

unread,
Dec 18, 2015, 6:06:26 AM12/18/15
to ns-3-users
Hi Konstantinos,

I tried to do rerrHeader.Getorigin()  in recverror method  but I am not getting the src ip address which I did get in sendrerrwhen no route to forward.I am getting 102.102.102.102
I had done the below in sendrerrwhennoroutetoforward method
 RerrHeader rerrHeader;
  rerrHeader.SetOrigin (dst);//lincy
 
std::cout<<rerrHeader.GetOrigin()<<"rerrheader origin"<<"\n"; //now I can see the origin ,i am getting 10.0.0.1 which is what is required.

kindly guide

thanking in advance
regards
lincy

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.

--
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/IJUz_-s38oQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Konstantinos

unread,
Dec 18, 2015, 6:28:25 AM12/18/15
to ns-3-users
Hi Lincy,

Where did you try to call the rerrHeader.GetOrigin?
In the RecvError it should be done AFTER the p->RemoveHeader(rerrHeader) which actually initializes the rerrHeader with the content from the packet.
If you called the GetOrigin BEFORE that, then the header is not yet initialized, hence the 102.102.102.102.

In the second case, the fact that you get an IP, is because you have set it with SetOrigin().
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@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.

--
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/IJUz_-s38oQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Lincy Jim

unread,
Jan 6, 2016, 6:35:03 PM1/6/16
to ns-3-users
Hi Konstantinos


Sorry for the delay

i tried

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.

--
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/IJUz_-s38oQ/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.

--
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/IJUz_-s38oQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Lincy Jim

unread,
Jan 6, 2016, 6:37:20 PM1/6/16
to ns-3-users
Hi Konstantinos


i tried

void
RoutingProtocol::RecvError (Ptr<Packet> p, Ipv4Address src )//recv  route error from node with address src
{
  NS_LOG_FUNCTION (this << " from " << src);

  RerrHeader rerrHeader;
  p->RemoveHeader (rerrHeader);
  rerrHeader.GetOrigin();//LINCY

and

   case HISTYPE_RERR:
      {     
        RecvError (packet, sender);
    Ptr<Ipv4L3Protocol> l3K = m_ipv4->GetObject<Ipv4L3Protocol> ();
    Ipv4InterfaceAddress ifaceLocal = l3K->GetAddress(1,0);
     std::cout << ifaceLocal.GetLocal() << "###" << sender<< ":recv rerr from this node "<<"\n";//lincy
       if (IsMyOwnAddress (rerrHeader.GetOrigin()))//lincy
          {std::cout<<"hiiiiii";}//lincy
      
        break;
      }

i still get rerrHeader not declared in this scope

kindly guide


apologise for the delay in replying

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.

--
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/IJUz_-s38oQ/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.

--
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/IJUz_-s38oQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Tommaso Pecorella

unread,
Jan 6, 2016, 7:30:53 PM1/6/16
to ns-3-users
Hi,

don't get me wrong, but you definitely need a C++ book.

Moreover, a simple google search could point you toward the right direction:
http://stackoverflow.com/questions/10056093/was-not-declared-in-this-scope-error

I want to stress the concept. I'm not trying to block your progress in the simulations or in ns-3. I say for your own good.
You must learn C++ a bit better, or you'll keep facing a number of problems that are all related to your poor language knowledge.
ns-3 is a complex system, and C++ is an unforgiving language. You must (at least) know its basics. Variables scope and initialization are in, more or less, the first chapter of any book.

If you need a good C++ book, we'll be happy to point you to some. There are also very good online courses, if you want, and they're free.

T.

Lincy Jim

unread,
Jan 6, 2016, 7:40:51 PM1/6/16
to ns-3-users
hi Tommaso

The case statement belongs to
void
RoutingProtocol::RecvHis (Ptr<Socket> socket)
{  //RerrHeader rerrHeader;//LINCY -----when i uncomment this ,it works fine but I need the origin  which comes with the rerr packet
given below


void
RoutingProtocol::RecvError (Ptr<Packet> p, Ipv4Address src )//recv  route error from node with address src
{
  NS_LOG_FUNCTION (this << " from " << src);

  RerrHeader rerrHeader;
  p->RemoveHeader (rerrHeader);
  rerrHeader.GetOrigin();//LINCY


kindly guide

thanking in advance

lincy

Tommaso Pecorella

unread,
Jan 6, 2016, 9:09:05 PM1/6/16
to ns-3-users
The answer is here:
and it's only one of many alternative ways to do what you're trying to do.

However, I'm convinced that I'm not doing a favor to you. I'm only delaying the inevitable: you must learn programming, and you're relying on other people to overcome even simple things. You can't keep on like this, sooner or later you'll face an issue and nobody will be there to help you, and you'll be doomed.

T.

Lincy Jim

unread,
Jan 6, 2016, 10:03:13 PM1/6/16
to ns-3-users
hi Tommaso

i have tried this

RoutingProtocol::RecvError (Ptr<Packet> p, Ipv4Address src )//recv  route error from node with address src
{
  NS_LOG_FUNCTION (this << " from " << src);

  RerrHeader rerrHeader;
//  p->RemoveHeader (rerrHeader); original code
  p->PeekHeader (rerrHeader);

  rerrHeader.GetOrigin();//LINCY

and
   case HISTYPE_RERR:
      {     
        RecvError (packet, sender);
    Ptr<Ipv4L3Protocol> l3K = m_ipv4->GetObject<Ipv4L3Protocol> ();
    Ipv4InterfaceAddress ifaceLocal = l3K->GetAddress(1,0);
     std::cout << ifaceLocal.GetLocal() << "###" << sender<< ":recv rerr from this node "<<"\n";//lincy
       if (IsMyOwnAddress (rerrHeader.GetOrigin()))//lincy
          {std::cout<<"hiiiiii";}//lincy
      
        break;
      }
as I thought removeheader removed the header from the buffer while peek header would not.I am still not able to nail this.
 (I just want to cout "hi" when the origin of the route request has received rerr.In the case statement I am able to see with std::cout the origin receiving rerr),i had done modifications in  the packet.h file wherein I added origin parameter to rerr)
i still get rerrHeader not declared in this scope

kindly guide


Lincy Jim

unread,
Jan 9, 2016, 5:14:37 AM1/9/16
to ns-3-users

Hi

I have tried this


   case HISTYPE_RERR:
      {     
        RecvError (packet, sender);
    Ptr<Ipv4L3Protocol> l3K = m_ipv4->GetObject<Ipv4L3Protocol> ();
    Ipv4InterfaceAddress ifaceLocal = l3K->GetAddress(1,0);
     std::cout << ifaceLocal.GetLocal() << "###" << sender<< ":recv rerr from this node "<<"\n";//lincy

RerrHeader rerrHeader;
//  p->RemoveHeader (rerrHeader);

  p->PeekHeader (rerrHeader);

  rerrHeader.GetOrigin();//LINCY

       if (IsMyOwnAddress (rerrHeader.GetOrigin()))//lincy


          {std::cout<<"hiiiiii";}//lincy
      
        break;
      }

I want to retrieve the get Origin information from rerr packet .Kindly let me know where I m wrong

Thanking you

Regards
Lincy Elizebeth Jim

Tommaso Pecorella

unread,
Jan 9, 2016, 10:35:15 AM1/9/16
to ns-3-users
Stating your goal for the n-th time is not going to help you achieve it.
Where I live, not even kids receive what they want simply because they ask it enough times, and I guess it's the same for you.
This is to point out that you DID state your goal at the thread start, and the threads are organized by thread... we see the history, we have memory, we forget nothing (and search engines help us on that).

I gave you a suggestion. You're applying it without understanding it. This is your mistake.
I already told you this. You're not trying to understand the code, you're simply assembling instruction without an apparent order. This is not programming, this is hoping that it will work. It won't work.

Now, think about it.
RecvError (packet, sender);
This function argument is the packet, and this function WILL modify the packet. In particular it will remove the RerrHeader.

What do you think it will happen if you, just a few lines after calling the above mentioned function, will try to remove the RerrHeader AGAIN from the packet ?
It's not a surprise if you have an error message, or a program hang.

That's why I did suggest to use PeekHeader, but you should have peeked the header before RecvError, not after.

Now, the real question is: why didn't you think to this ?

T.

Lincy Jim

unread,
Jan 10, 2016, 7:47:36 PM1/10/16
to ns-3-users
Hi Tommaso

I have tried this

 case HISTYPE_RERR:
      {     
         RerrOrigin(packet, sender);
            
         RecvError (packet, sender);
        
 
      // if (IsMyOwnAddress (rerrHeader.GetOrigin()))//lincy
       //  {std::cout<<"hiiiiii";}//lincy
      
       break;
      }

and

void RoutingProtocol::RerrOrigin(Ptr<Packet> p, Ipv4Address src )//lincy
{
               RerrHeader rerrHeader;

              p->PeekHeader (rerrHeader);
              std::cout<<rerrHeader.GetOrigin()<<"$$";

}

I am still not getting the desired output .Kindly guide


thanking in advance


regards
LINCY

Tommaso Pecorella

unread,
Jan 10, 2016, 9:04:58 PM1/10/16
to ns-3-users
Let me use my divination skills to acquire the knowledge of what output you got and what output you desired to get...

Let me be clear (and a bit harsh). You're asking assistance on some modified code, posting only snippets, and not giving us the possibility to run a sample script showing the issues you're facing. Moreover, you don't describe the exact problem (code hanging? unexpected output?).
Last but not least, you don't describe the corrective actions you're done. E.g., have you tried to verify that the packets you're bringing are the expected ones in the expected nodes ?
Does this seems logical to you ? To me no, and illogicality is something that makes me kinda nervous.

Please correct all the above points or we'll not be able to help (or try to help) you further. In other terms:
1) Code: post all the code modifications you did, possibly using a diff against the very latest ns-3-dev.
2) Sample script: post a small script showing the problem.
3) Describe with a few words, or by an example, the expected output.
4) Copy-paste the obtained output and/or the error you get. In case of a segmentation fault, post ALL the output lines from the program start to the program end. If they are more than 10, use an attachment.
5) Describe what you did try to fix the problem.


T.

Lincy Jim

unread,
Jan 10, 2016, 11:10:09 PM1/10/16
to ns-3-users
Hi

I ve modified the rerrheader which can be seen in diff2.text.I did this as I require the initiator node of rreq to confirm it has received the route error.
So i included get Origin in route error header.Inside the rerrheader packet i want to see the initiator node,for this the function RerrOrigin was used(finally the rerr has to reach the source of the rreq)The source shoud send another packet inorder to verify if the route error was genuine.For this I require the point where the source gets the rerr.


kindly guide

if anything more is required kindly let me know
diff.txt
diff2.txt
diff3.txt

Tommaso Pecorella

unread,
Jan 11, 2016, 5:28:17 PM1/11/16
to ns-3-users
Hi,

I'm deeply sorry, but when I tried to apply your patches on 3.24 or on 3-dev it gave me errors. This means that you are not using the latest ns-3 release.
Moreover, you did not include the example script, the expected output and the description of the problem (wrong output or crash).

My patience is not infinite.
Good luck,

T.

...

Lincy Jim

unread,
Jan 11, 2016, 6:18:38 PM1/11/16
to ns-3-users
Hi Tommaso

I am using 3.23 .do you want to me to do a diff on the code using 3.24.Since I ve added getorigin() for rerrheader in packet.h.I wanted to get the origin from the route error packet as well which is why i did the function  below in routing-protocol.h file of aodv
void RoutingProtocol::RerrOrigin(Ptr<Packet> p, Ipv4Address src )//lincy
{
               RerrHeader rerrHeader;

              p->PeekHeader (rerrHeader);
              std::cout<<rerrHeader.GetOrigin()<<"$$";

}

i then tried to call this function from the RecvAodv  function under the case statement given below
case HISTYPE_RERR:
      {      
         RerrOrigin(packet, sender);
             
         RecvError (packet, sender);
         
  
      // if (IsMyOwnAddress (rerrHeader.GetOrigin()))//lincy
       //  {std::cout<<"hiiiiii";}//lincy
       
       break;
      }

for eg., if the iniator of the RREQ IS 10.0.0.1 and destination is 10.0.0.30 ,from rerrheader packet when i call   std::cout<<rerrHeader.GetOrigin()<<"$$"; i expect to see 10.0.0.1.At present the output is blank.
I know in aodv there is a point where the initiator of RREQ ( source) receives the rerr,i am not able to find that part.

kindly guide

thanks in advance

lincy

Lincy Jim

unread,
Jan 11, 2016, 7:03:49 PM1/11/16
to ns-3-users
Hi Tommaso

I am using 3.23 .do you want to me to do a diff on the code using 3.24.Since I ve added getorigin() for rerrheader in packet.h.I wanted to get the origin from the route error packet as well which is why i did the function  below in routing-protocol.h file of aodv
void RoutingProtocol::RerrOrigin(Ptr<Packet> p, Ipv4Address src )//lincy
{
               RerrHeader rerrHeader;

              p->PeekHeader (rerrHeader);
              std::cout<<rerrHeader.GetOrigin()<<"$$";

}

i then tried to call this function from the RecvAodv  function under the case statement given below
case HISTYPE_RERR:
      {      
         RerrOrigin(packet, sender);
             
         RecvError (packet, sender);
         
  
      // if (IsMyOwnAddress (rerrHeader.GetOrigin()))//lincy
       //  {std::cout<<"hiiiiii";}//lincy
       
       break;
      }

for eg., if the iniator of the RREQ IS 10.0.0.1 and destination is 10.0.0.30 ,from rerrheader packet when i call   std::cout<<rerrHeader.GetOrigin()<<"$$"; i expect to see 10.0.0.1.At present the output is blank.
I know in aodv there is a point where the initiator of RREQ ( source) receives the rerr,i am not able to find that part.

I have attached the modified diff with the mistakes corrected

kindly guide

thanks in advance
diff1.txt
diff2.txt
diffpacket.txt
Reply all
Reply to author
Forward
0 new messages