From de1319ba775a91c73c7fca5a7597083d39e8d206 Mon Sep 17 00:00:00 2001
From: Tom Henderson 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:
+Changes to existing API:
+
+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));
+
+are replaced by one call to:
+
+GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
+
+
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. diff --git a/doc/manual/emulation.texi b/doc/manual/emulation.texi index 2da41b556..3cfb4c019 100644 --- a/doc/manual/emulation.texi +++ b/doc/manual/emulation.texi @@ -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 diff --git a/examples/emu-ping.cc b/examples/emu-ping.cc index 45151324e..0a9fc0b4f 100644 --- a/examples/emu-ping.cc +++ b/examples/emu-ping.cc @@ -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 diff --git a/examples/tap-wifi-dumbbell.cc b/examples/tap-wifi-dumbbell.cc index 3930e5325..eda8adc72 100644 --- a/examples/tap-wifi-dumbbell.cc +++ b/examples/tap-wifi-dumbbell.cc @@ -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