Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(178)

Issue 3613041: ns-3 print routing tables

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 5 months ago by Tom Henderson
Modified:
10 years, 5 months ago
CC:
ns-3-reviews_googlegroups.com
Visibility:
Public.

Description

This is a proposed merge patch for bugs 947 and 963. It pretty prints Ipv4 routing tables at specified times. Sample output (can be seen from running the modified examples): AODV example (examples/routing/aodv.cc printRoutes=1): Node: 0 Time: 8s AODV Routing table Destination Gateway Interface Flag Expire Hops 10.0.0.2 10.0.0.2 10.0.0.1 UP 3.00 1 10.0.0.10 10.0.0.2 10.0.0.1 DOWN 11.02 9 10.255.255.255 10.255.255.255 10.0.0.1 UP 9223372028.85 1 127.0.0.1 127.0.0.1 127.0.0.1 UP 9223372028.85 1 OLSR example (examples/wifi/wifi-simple-adhoc-grid tracing=1): Node: 24 Time: 30s Ipv4ListRouting table Priority: 10 Protocol: ns3::olsr::RoutingProtocol Destination NextHop Interface Distance 10.1.1.1 10.1.1.20 1 8 10.1.1.2 10.1.1.20 1 7 10.1.1.3 10.1.1.20 1 6 10.1.1.4 10.1.1.20 1 5 Nix example (examples/routing/nix-simple.cc) Node: 0 Time: 8s Ipv4ListRouting table Priority: 10 Protocol: ns3::Ipv4NixVectorRouting NixCache: Destination NixVector 10.1.3.2 011 Ipv4RouteCache: Destination Gateway Source OutputDevice 10.1.3.2 10.1.1.2 10.1.1.1 1 Global/static routing examples (examples/routing/dynamic-global-routing.cc) (formatted like "route -n", and note use of List routing table) Node: 6 Time: 12s Ipv4ListRouting table Priority: 0 Protocol: ns3::Ipv4StaticRouting Destination Gateway Genmask Flags Metric Ref Use Iface 127.0.0.0 0.0.0.0 255.0.0.0 U - - - 0 10.1.3.0 0.0.0.0 255.255.255.0 U - - - 1 172.16.1.0 0.0.0.0 255.255.255.0 U - - - 2 Priority: -10 Protocol: ns3::Ipv4GlobalRouting Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.1.3.1 0.0.0.0 UG - - - 1

Patch Set 1 #

Total comments: 1

Patch Set 2 : provide const version of Purge() #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+411 lines, -32 lines) Patch
M .hgignore View 2 chunks +2 lines, -1 line 0 comments Download
M examples/routing/aodv.cc View 4 chunks +11 lines, -1 line 0 comments Download
M examples/routing/dynamic-global-routing.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M examples/routing/nix-simple.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M examples/wireless/wifi-simple-adhoc-grid.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/helper/ipv4-routing-helper.h View 2 chunks +52 lines, -0 lines 0 comments Download
M src/helper/ipv4-routing-helper.cc View 1 chunk +57 lines, -1 line 0 comments Download
M src/node/ipv4-routing-protocol.h View 2 chunks +3 lines, -0 lines 0 comments Download
M src/routing/aodv/aodv-routing-protocol.h View 3 chunks +3 lines, -1 line 0 comments Download
M src/routing/aodv/aodv-routing-protocol.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M src/routing/aodv/aodv-rtable.h View 1 3 chunks +5 lines, -2 lines 0 comments Download
M src/routing/aodv/aodv-rtable.cc View 1 4 chunks +53 lines, -14 lines 1 comment Download
M src/routing/global-routing/model/ipv4-global-routing.h View 3 chunks +3 lines, -2 lines 0 comments Download
M src/routing/global-routing/model/ipv4-global-routing.cc View 7 chunks +54 lines, -5 lines 0 comments Download
M src/routing/list-routing/model/ipv4-list-routing.h View 2 chunks +2 lines, -0 lines 0 comments Download
M src/routing/list-routing/model/ipv4-list-routing.cc View 3 chunks +17 lines, -0 lines 0 comments Download
M src/routing/nix-vector-routing/ipv4-nix-vector-routing.h View 2 chunks +2 lines, -0 lines 0 comments Download
M src/routing/nix-vector-routing/ipv4-nix-vector-routing.cc View 2 chunks +46 lines, -0 lines 0 comments Download
M src/routing/olsr/model/olsr-routing-protocol.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/routing/olsr/model/olsr-routing-protocol.cc View 2 chunks +26 lines, -0 lines 0 comments Download
M src/routing/static-routing/model/ipv4-static-routing.h View 3 chunks +3 lines, -2 lines 0 comments Download
M src/routing/static-routing/model/ipv4-static-routing.cc View 4 chunks +53 lines, -3 lines 0 comments Download

Messages

Total messages: 3
Elena Buchatskaia
http://codereview.appspot.com/3613041/diff/1/src/routing/aodv/aodv-rtable.cc File src/routing/aodv/aodv-rtable.cc (left): http://codereview.appspot.com/3613041/diff/1/src/routing/aodv/aodv-rtable.cc#oldcode402 src/routing/aodv/aodv-rtable.cc:402: Purge (); Removing Purge() call may cause incorrect output, ...
10 years, 5 months ago (2010-12-14 19:56:02 UTC) #1
Tom Henderson
> Is it essential to make Print function constant? Not essential, but I think it ...
10 years, 5 months ago (2010-12-15 05:35:47 UTC) #2
Pavel Boyko
10 years, 5 months ago (2010-12-16 17:24:12 UTC) #3
Good feature, vote to merge it.

http://codereview.appspot.com/3613041/diff/3001/src/routing/aodv/aodv-rtable.cc
File src/routing/aodv/aodv-rtable.cc (right):

http://codereview.appspot.com/3613041/diff/3001/src/routing/aodv/aodv-rtable....
src/routing/aodv/aodv-rtable.cc:185: std::setw (14) << (m_lifeTime -
Simulator::Now ()).GetSeconds ();
Please treat m_lifeTime == Simulator::GetMaximumSimulationTime() separately,
e.g. print "Never" in the "Expire" column.

Overall, PrintRoutingTable() looks useful.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b