65 // Set up some default values for the simulation. Use the |
65 // Set up some default values for the simulation. Use the |
66 |
66 |
67 Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); |
67 Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); |
68 Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("448kb/s")); |
68 Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("448kb/s")); |
69 |
69 |
70 //DefaultValue::Bind ("DropTailQueue::m_maxPackets", 30); |
70 //DefaultValue::Bind ("DropTailQueue::m_maxPackets", 30); |
71 |
71 |
72 // Allow the user to override any of the defaults and the above |
72 // Allow the user to override any of the defaults and the above |
73 // DefaultValue::Bind ()s at run-time, via command-line arguments |
73 // DefaultValue::Bind ()s at run-time, via command-line arguments |
74 CommandLine cmd; |
74 CommandLine cmd; |
75 cmd.Parse (argc, argv); |
75 cmd.Parse (argc, argv); |
107 NetDeviceContainer nd12 = p2p.Install (n12); |
107 NetDeviceContainer nd12 = p2p.Install (n12); |
108 p2p.SetDeviceAttribute ("DataRate", StringValue ("1500kbps")); |
108 p2p.SetDeviceAttribute ("DataRate", StringValue ("1500kbps")); |
109 p2p.SetChannelAttribute ("Delay", StringValue ("10ms")); |
109 p2p.SetChannelAttribute ("Delay", StringValue ("10ms")); |
110 NetDeviceContainer nd32 = p2p.Install (n32); |
110 NetDeviceContainer nd32 = p2p.Install (n32); |
111 NetDeviceContainer nd34 = p2p.Install (n34); |
111 NetDeviceContainer nd34 = p2p.Install (n34); |
112 |
112 |
113 // Later, we add IP addresses. |
113 // Later, we add IP addresses. |
114 NS_LOG_INFO ("Assign IP Addresses."); |
114 NS_LOG_INFO ("Assign IP Addresses."); |
115 Ipv4AddressHelper ipv4; |
115 Ipv4AddressHelper ipv4; |
116 ipv4.SetBase ("10.1.1.0", "255.255.255.0"); |
116 ipv4.SetBase ("10.1.1.0", "255.255.255.0"); |
117 Ipv4InterfaceContainer i02 = ipv4.Assign (nd02); |
117 Ipv4InterfaceContainer i02 = ipv4.Assign (nd02); |
118 |
118 |
119 ipv4.SetBase ("10.1.2.0", "255.255.255.0"); |
119 ipv4.SetBase ("10.1.2.0", "255.255.255.0"); |
120 Ipv4InterfaceContainer i12 = ipv4.Assign (nd12); |
120 Ipv4InterfaceContainer i12 = ipv4.Assign (nd12); |
121 |
121 |
122 ipv4.SetBase ("10.1.3.0", "255.255.255.0"); |
122 ipv4.SetBase ("10.1.3.0", "255.255.255.0"); |
123 Ipv4InterfaceContainer i32 = ipv4.Assign (nd32); |
123 Ipv4InterfaceContainer i32 = ipv4.Assign (nd32); |
124 |
124 |
125 ipv4.SetBase ("10.1.4.0", "255.255.255.0"); |
125 ipv4.SetBase ("10.1.4.0", "255.255.255.0"); |
126 Ipv4InterfaceContainer i34 = ipv4.Assign (nd34); |
126 Ipv4InterfaceContainer i34 = ipv4.Assign (nd34); |