fix examples and documentation for CalcChecksum changes

This commit is contained in:
Tom Henderson
2009-06-19 07:50:05 -07:00
parent ba656765ea
commit de1319ba77
4 changed files with 27 additions and 9 deletions

View File

@@ -79,6 +79,23 @@ fragmentation and reassembly.
<h2>Changes to existing API:</h2>
<ul>
<li><b>CalcChecksum attribute changes</b>
<p>Four IPv4 CalcChecksum attributes (which enable the computation of
checksums that are disabled by default) have been collapsed into one global
value in class Node. These four calls:
<pre>
Config::SetDefault ("ns3::Ipv4L3Protocol::CalcChecksum", BooleanValue (true));
Config::SetDefault ("ns3::Icmpv4L4Protocol::CalcChecksum", BooleanValue (true));
Config::SetDefault ("ns3::TcpL4Protocol::CalcChecksum", BooleanValue (true));
Config::SetDefault ("ns3::UdpL4Protocol::CalcChecksum", BooleanValue (true));
</pre>
are replaced by one call to:
<pre>
GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
</pre>
</p>
</li>
<li><b>CreateObject changes</b>
<p>CreateObject is now able to construct objects with a non-default constructor.
If you used to pass attribute lists to CreateObject, you must now use CreateObjectWithAttributes.

View File

@@ -131,6 +131,14 @@ merged.
@section Usage
Any mixing of ns-3 objects with real objects will typically require that
ns-3 compute checksums in its protocols. By default, checksums are not
computed by ns-3. To enable checksums (e.g. UDP, TCP, IP), users must set
the attribute @code{ChecksumEnabled} to true, such as follows:
@verbatim
GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
@end verbatim
@subsection Emu Net Device
The usage of the @code{Emu} net device is straightforward once the network of

View File

@@ -102,10 +102,7 @@ main (int argc, char *argv[])
// Since we are going to be talking to real-world machines, we need to enable
// calculation of checksums in our protocols.
//
Config::SetDefault ("ns3::Ipv4L3Protocol::CalcChecksum", BooleanValue (true));
Config::SetDefault ("ns3::Icmpv4L4Protocol::CalcChecksum", BooleanValue (true));
Config::SetDefault ("ns3::TcpL4Protocol::CalcChecksum", BooleanValue (true));
Config::SetDefault ("ns3::UdpL4Protocol::CalcChecksum", BooleanValue (true));
GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
//
// In such a simple topology, the use of the helper API can be a hindrance

View File

@@ -132,11 +132,7 @@ main (int argc, char *argv[])
cmd.Parse (argc, argv);
GlobalValue::Bind ("SimulatorImplementationType", StringValue ("ns3::RealtimeSimulatorImpl"));
Config::SetDefault ("ns3::Ipv4L3Protocol::CalcChecksum", BooleanValue (true));
Config::SetDefault ("ns3::Icmpv4L4Protocol::CalcChecksum", BooleanValue (true));
Config::SetDefault ("ns3::TcpL4Protocol::CalcChecksum", BooleanValue (true));
Config::SetDefault ("ns3::UdpL4Protocol::CalcChecksum", BooleanValue (true));
GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
//
// The topology has a Wifi network of four nodes on the left side. We'll make