118 // Allow the user to override any of the defaults and the above |
118 // Allow the user to override any of the defaults and the above |
119 // Bind ()s at run-time, via command-line arguments |
119 // Bind ()s at run-time, via command-line arguments |
120 CommandLine::Parse (argc, argv); |
120 CommandLine::Parse (argc, argv); |
121 |
121 |
122 NS_LOG_INFO ("Create nodes."); |
122 NS_LOG_INFO ("Create nodes."); |
123 Ptr<Node> n0 = Create<InternetNode> (); |
123 Ptr<Node> n0 = CreateObject<InternetNode> (); |
124 Ptr<Node> n1 = Create<InternetNode> (); |
124 Ptr<Node> n1 = CreateObject<InternetNode> (); |
125 Ptr<Node> n2 = Create<InternetNode> (); |
125 Ptr<Node> n2 = CreateObject<InternetNode> (); |
126 Ptr<Node> n3 = Create<InternetNode> (); |
126 Ptr<Node> n3 = CreateObject<InternetNode> (); |
127 Ptr<Node> n4 = Create<InternetNode> (); |
127 Ptr<Node> n4 = CreateObject<InternetNode> (); |
128 Ptr<Node> n5 = Create<InternetNode> (); |
128 Ptr<Node> n5 = CreateObject<InternetNode> (); |
129 Ptr<Node> n6 = Create<InternetNode> (); |
129 Ptr<Node> n6 = CreateObject<InternetNode> (); |
130 |
130 |
131 // We create the channels first without any IP addressing information |
131 // We create the channels first without any IP addressing information |
132 NS_LOG_INFO ("Create channels."); |
132 NS_LOG_INFO ("Create channels."); |
133 Ptr<PointToPointChannel> channel0 = |
133 Ptr<PointToPointChannel> channel0 = |
134 PointToPointTopology::AddPointToPointLink ( |
134 PointToPointTopology::AddPointToPointLink ( |
189 |
189 |
190 // Create the OnOff application to send UDP datagrams of size |
190 // Create the OnOff application to send UDP datagrams of size |
191 // 210 bytes at a rate of 448 Kb/s |
191 // 210 bytes at a rate of 448 Kb/s |
192 NS_LOG_INFO ("Create Applications."); |
192 NS_LOG_INFO ("Create Applications."); |
193 uint16_t port = 9; // Discard port (RFC 863) |
193 uint16_t port = 9; // Discard port (RFC 863) |
194 Ptr<OnOffApplication> ooff = Create<OnOffApplication> ( |
194 Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> ( |
195 n0, |
195 n0, |
196 InetSocketAddress ("10.1.3.2", port), |
196 InetSocketAddress ("10.1.3.2", port), |
197 "Udp", |
197 "Udp", |
198 ConstantVariable (1), |
198 ConstantVariable (1), |
199 ConstantVariable (0), |
199 ConstantVariable (0), |