cleanup virtual netdevice example
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue Jun 09 17:48:51 2009 +0100 (8 months ago)
changeset 45575644bae99850
parent 4556 e943b94bf523
child 4558 f9509a42bc87
cleanup virtual netdevice example
examples/virtual-net-device.cc
     1.1 --- a/examples/virtual-net-device.cc	Tue Jun 09 17:42:57 2009 +0100
     1.2 +++ b/examples/virtual-net-device.cc	Tue Jun 09 17:48:51 2009 +0100
     1.3 @@ -18,8 +18,6 @@
     1.4   * Originally authored by Steve McCanne, 12/19/1996
     1.5   */
     1.6  
     1.7 -// Port of ns-2/tcl/ex/simple.tcl to ns-3
     1.8 -//
     1.9  // Network topology
    1.10  //
    1.11  //  n0
    1.12 @@ -36,7 +34,7 @@
    1.13  // - UDP packet size of 210 bytes, with per-packet interval 0.00375 sec.
    1.14  //   (i.e., DataRate of 448,000 bps)
    1.15  // - DropTail queues 
    1.16 -// - Tracing of queues and packet receptions to file "simple-global-routing.tr"
    1.17 +// - Tracing of queues and packet receptions to file "virtual-net-device.tr"
    1.18  
    1.19  // Tunneling changes (relative to the simple-global-routing example):
    1.20  // n0 will receive an extra virtual interface with address 11.0.0.1
    1.21 @@ -45,6 +43,10 @@
    1.22  // The flows will be between 11.0.0.x (tunnel) addresses instead of 10.1.x.y ones
    1.23  // n3 will decide, on a per-packet basis, via random number, whether to
    1.24  // send the packet to n0 or to n1.
    1.25 +//
    1.26 +// Note: here we create a tunnel where IP packets are tunneled over
    1.27 +// UDP/IP, but tunneling directly IP-over-IP would also be possible;
    1.28 +// see src/node/ipv4-raw-socket-factory.h.
    1.29  
    1.30  #include <iostream>
    1.31  #include <fstream>
    1.32 @@ -174,7 +176,7 @@
    1.33    // Users may find it convenient to turn on explicit debugging
    1.34    // for selected modules; the below lines suggest how to do this
    1.35  #if 0 
    1.36 -  LogComponentEnable ("SimpleGlobalRoutingExample", LOG_LEVEL_INFO);
    1.37 +  LogComponentEnable ("VirtualNetDeviceExample", LOG_LEVEL_INFO);
    1.38  #endif
    1.39  
    1.40    // Set up some default values for the simulation.  Use the 
    1.41 @@ -265,8 +267,8 @@
    1.42    apps.Stop (Seconds (10.0));
    1.43  
    1.44    std::ofstream ascii;
    1.45 -  ascii.open ("tap-net-device.tr");
    1.46 -  PointToPointHelper::EnablePcapAll ("tap-net-device");
    1.47 +  ascii.open ("virtual-net-device.tr");
    1.48 +  PointToPointHelper::EnablePcapAll ("virtual-net-device");
    1.49    PointToPointHelper::EnableAsciiAll (ascii);
    1.50  
    1.51    NS_LOG_INFO ("Run Simulation.");