Removing Entries in static routing table

76 views
Skip to first unread message

karthik karra

unread,
May 10, 2016, 11:26:19 AM5/10/16
to ns-3-users
I couldn't find any method to remove the entries in static routing table of a node. Can anyone please suggest if there is one or any other alternative to remove entries from table.

Thanks,
Karra.

Konstantinos

unread,
May 10, 2016, 11:32:49 AM5/10/16
to ns-3-users
Hi,

Have you looked closely in the API?
There is "RemoveRoute" method for the corresponding route (also similar for multicast)

Regards,
K.

karthik karra

unread,
May 10, 2016, 11:36:55 AM5/10/16
to ns-3-...@googlegroups.com
Sorry for the post. Yes, just before your reply I found it.

Thanks for the reply.

--
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/t9Wgl8SWH-U/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.

karthik karra

unread,
May 16, 2016, 7:51:19 AM5/16/16
to ns-3-users
Hi K,

The above method works fine if we have just one entry with that particular Interface number.

But what if we have multiple entries with the same interface number and want to remove a particular entry.

When I was trying for my scenario, RemoveRoute() is deleting the entry which is needed rather than the other one.

Any thoughts ??

Thanks,
Karra.

On Tuesday, May 10, 2016 at 9:06:55 PM UTC+5:30, karthik karra wrote:
Sorry for the post. Yes, just before your reply I found it.

Thanks for the reply.
On Tue, May 10, 2016 at 9:02 PM, Konstantinos <dinos.k...@gmail.com> wrote:
Hi,

Have you looked closely in the API?
There is "RemoveRoute" method for the corresponding route (also similar for multicast)

Regards,
K.

On Tuesday, May 10, 2016 at 4:26:19 PM UTC+1, karthik karra wrote:
I couldn't find any method to remove the entries in static routing table of a node. Can anyone please suggest if there is one or any other alternative to remove entries from table.

Thanks,
Karra.

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

Konstantinos

unread,
May 16, 2016, 8:05:38 AM5/16/16
to ns-3-users
Hi

The RemoveRoute() method removed one particular entry with index 'i'. Remember that counting starts from zero. 
The method removes the entry which is told to delete. If you pass a wrong argument, that's your mistake. If you pass a correct argument but the result is wrong, you can post a bug report.

If you want to delete multiple entries, you will need to call the method multiple times.

Using the GetNRoutes() method you can get the total number of routes you have.
By comparing your criteria, e.g. Interface/Destination/Gateway etc, you can identify the particular route (using the GetRoute() method to get each route) that you want to delete.

karthik karra

unread,
May 16, 2016, 8:42:13 AM5/16/16
to ns-3-...@googlegroups.com
Hi K,

In the attached picture, I want to remove the entry "Destination=>10.1.1.1 with default gateway=>10.1.1.2 with interface number=>1" but when ever I give "RemoveRoute(1)" its removing "10.1.1.0".

And you mentioned counting starts from "Zero" sorry I didn't get that.

 

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

Konstantinos

unread,
May 16, 2016, 9:14:32 AM5/16/16
to ns-3-users
Hi,

In this table I can see 9 entries.
The requested entry (DST=10.1.1.1, GTW=10.1.1.2) is the fifth entry of the table. So RemoveRoute(4) should be the correct call.
When you do RemoveRoute(1), you delete the second entry which correctly is the 10.1.1.0 according to your printout.

When I say that counting starts from zero, I mean that the indexes for tables, vectors etc start from 0, not 1.
So the first element of a table is element_0, the second is element_1 etc. 
This will impact how you would try to access e.g. the entry in your table. If you want to delete the FIRST entry, you delete entry=0. 
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/t9Wgl8SWH-U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

karthik karra

unread,
May 16, 2016, 9:43:59 AM5/16/16
to ns-3-...@googlegroups.com
Thanks for your reply. It worked.

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/t9Wgl8SWH-U/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/t9Wgl8SWH-U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages