LEFT | RIGHT |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 29 matching lines...) Expand all Loading... |
40 */ | 40 */ |
41 NS_LOG_COMPONENT_DEFINE ("BearerDeactivateExample"); | 41 NS_LOG_COMPONENT_DEFINE ("BearerDeactivateExample"); |
42 int | 42 int |
43 main (int argc, char *argv[]) | 43 main (int argc, char *argv[]) |
44 { | 44 { |
45 | 45 |
46 uint16_t numberOfNodes = 1; | 46 uint16_t numberOfNodes = 1; |
47 uint16_t numberOfUeNodes = 3; | 47 uint16_t numberOfUeNodes = 3; |
48 double simTime = 1.1; | 48 double simTime = 1.1; |
49 double distance = 60.0; | 49 double distance = 60.0; |
50 double interPacketInterval = 100; | 50 uint64_t interPacketInterval = 100; |
51 | 51 |
52 // Command line arguments | 52 // Command line arguments |
53 CommandLine cmd; | 53 CommandLine cmd; |
54 cmd.AddValue ("numberOfNodes", "Number of eNodeBs + UE pairs", numberOfNodes); | 54 cmd.AddValue ("numberOfNodes", "Number of eNodeBs + UE pairs", numberOfNodes); |
55 cmd.AddValue ("simTime", "Total duration of the simulation [s])", simTime); | 55 cmd.AddValue ("simTime", "Total duration of the simulation [s])", simTime); |
56 cmd.AddValue ("distance", "Distance between eNBs [m]", distance); | 56 cmd.AddValue ("distance", "Distance between eNBs [m]", distance); |
57 cmd.AddValue ("interPacketInterval", "Inter packet interval [ms])", interPacke
tInterval); | 57 cmd.AddValue ("interPacketInterval", "Inter packet interval [ms])", interPacke
tInterval); |
58 cmd.Parse (argc, argv); | 58 cmd.Parse (argc, argv); |
59 | 59 |
60 Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); | 60 Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 ++ulPort; | 172 ++ulPort; |
173 ++otherPort; | 173 ++otherPort; |
174 PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAd
dress (Ipv4Address::GetAny (), dlPort)); | 174 PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAd
dress (Ipv4Address::GetAny (), dlPort)); |
175 PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAd
dress (Ipv4Address::GetAny (), ulPort)); | 175 PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAd
dress (Ipv4Address::GetAny (), ulPort)); |
176 PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddr
ess (Ipv4Address::GetAny (), otherPort)); | 176 PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddr
ess (Ipv4Address::GetAny (), otherPort)); |
177 serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get (u))); | 177 serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get (u))); |
178 serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); | 178 serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); |
179 serverApps.Add (packetSinkHelper.Install (ueNodes.Get (u))); | 179 serverApps.Add (packetSinkHelper.Install (ueNodes.Get (u))); |
180 | 180 |
181 UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); | 181 UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); |
182 dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds (static_cast<ui
nt64_t>(interPacketInterval)))); | 182 dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds (interPacketInt
erval))); |
183 dlClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); | 183 dlClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); |
184 | 184 |
185 UdpClientHelper ulClient (remoteHostAddr, ulPort); | 185 UdpClientHelper ulClient (remoteHostAddr, ulPort); |
186 ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds (static_cast<ui
nt64_t>(interPacketInterval)))); | 186 ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds (interPacketInt
erval))); |
187 ulClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); | 187 ulClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); |
188 | 188 |
189 UdpClientHelper client (ueIpIface.GetAddress (u), otherPort); | 189 UdpClientHelper client (ueIpIface.GetAddress (u), otherPort); |
190 client.SetAttribute ("Interval", TimeValue (MilliSeconds (static_cast<uint
64_t>(interPacketInterval)))); | 190 client.SetAttribute ("Interval", TimeValue (MilliSeconds (interPacketInter
val))); |
191 client.SetAttribute ("MaxPackets", UintegerValue (1000000)); | 191 client.SetAttribute ("MaxPackets", UintegerValue (1000000)); |
192 | 192 |
193 clientApps.Add (dlClient.Install (remoteHost)); | 193 clientApps.Add (dlClient.Install (remoteHost)); |
194 clientApps.Add (ulClient.Install (ueNodes.Get (u))); | 194 clientApps.Add (ulClient.Install (ueNodes.Get (u))); |
195 if (u + 1 < ueNodes.GetN ()) | 195 if (u + 1 < ueNodes.GetN ()) |
196 { | 196 { |
197 clientApps.Add (client.Install (ueNodes.Get (u + 1))); | 197 clientApps.Add (client.Install (ueNodes.Get (u + 1))); |
198 } | 198 } |
199 else | 199 else |
200 { | 200 { |
(...skipping 28 matching lines...) Expand all Loading... |
229 | 229 |
230 Simulator::Run (); | 230 Simulator::Run (); |
231 /*GtkConfigStore config; | 231 /*GtkConfigStore config; |
232 config.ConfigureAttributes();*/ | 232 config.ConfigureAttributes();*/ |
233 | 233 |
234 Simulator::Destroy (); | 234 Simulator::Destroy (); |
235 return 0; | 235 return 0; |
236 | 236 |
237 } | 237 } |
238 | 238 |
LEFT | RIGHT |