├── README.md ├── hwmp.cc └── uav.cc /README.md: -------------------------------------------------------------------------------- 1 | # Fanet-NS3 2 | Red Fanet simulada en NS-3 con protocolos de enrutamiento AODV, OLSR, DSDV, DSR AODMV y HWMP 3 | 4 | NS-3 3.34 5 | 6 | Modelo de movilidad Gauss Markov 7 | -------------------------------------------------------------------------------- /hwmp.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "ns3/core-module.h" 4 | #include "ns3/network-module.h" 5 | #include "ns3/internet-module.h" 6 | #include "ns3/mobility-module.h" 7 | #include "ns3/wifi-module.h" 8 | #include "ns3/olsr-module.h" 9 | #include "ns3/applications-module.h" 10 | #include "ns3/netanim-module.h" 11 | #include "ns3/flow-monitor-module.h" 12 | #include "ns3/mesh-module.h" 13 | #include "ns3/mesh-helper.h" 14 | 15 | using namespace ns3; 16 | 17 | NS_LOG_COMPONENT_DEFINE ("HWMP"); 18 | 19 | int main (int argc, char *argv[]) 20 | { 21 | AnimationInterface *pAnim; 22 | 23 | double txp = 30; //dBm 24 | int nUav; 25 | int vel; 26 | std::cout<<"Ingrese el numero de nodos UAV: (N<255) \n"; 27 | std::cin>>nUav; 28 | std::cout<<"\n La red FANET contiene "<< nUav <<" nodos UAV \n"; 29 | std::cout<<"\n Ingrese la velocidad promedio maxima [m/s] (Esto modifica el parametro MeanVelocity): \n"; 30 | std::cin>>vel; 31 | int nSinks = 2; //numero de nodos sink (receptores) 32 | int iNodes = (nUav/2); //nodos intermedios 33 | int sender = iNodes + nSinks; //nodos emisores 34 | double TotalTime = 100; //segundos 35 | std::string rate ("100Kbps"); 36 | std::string tr_name ("fanet"); 37 | uint32_t packetSize = 512; // bytes 38 | double m_randomStart; ///< random start 39 | uint32_t m_nIfaces; ///< number interfaces 40 | bool m_chan; ///< channel 41 | bool m_pcap = true; ///< PCAP 42 | bool m_ascii = true; ///< ASCII 43 | std::string m_stack; ///< stack 44 | std::string m_root; ///< root 45 | std::string phyMode ("DsssRate11Mbps"); 46 | NetDeviceContainer meshDevices; 47 | /// Addresses of interfaces: 48 | Ipv4InterfaceContainer interfaces; 49 | /// MeshHelper. Report is not static methods 50 | MeshHelper mesh; 51 | AsciiTraceHelper ascii; 52 | m_randomStart= 0.1; 53 | 54 | m_nIfaces = 1; 55 | m_chan= false; 56 | m_stack = "ns3::Dot11sStack"; 57 | m_root = "ff:ff:ff:ff:ff:ff"; 58 | 59 | 60 | CommandLine cmd (__FILE__); 61 | cmd.AddValue ("nUav", "Numero de nodos", nUav);// 25,50 62 | cmd.Parse (argc, argv); 63 | 64 | if (m_ascii) 65 | { 66 | PacketMetadata::Enable (); 67 | } 68 | 69 | //Set Non-unicastMode rate to unicast mode 70 | Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",StringValue (phyMode)); 71 | 72 | NodeContainer uav; 73 | uav.Create (nUav); 74 | 75 | // wifi phy y canal con helpers 76 | WifiHelper wifi; 77 | wifi.SetStandard (WIFI_STANDARD_80211g); 78 | 79 | YansWifiPhyHelper wifiPhy;// = YansWifiPhyHelper::Default (); 80 | YansWifiChannelHelper wifiChannel; 81 | wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); 82 | wifiChannel.AddPropagationLoss ("ns3::RangePropagationLossModel"); 83 | wifiPhy.SetChannel (wifiChannel.Create ()); 84 | 85 | // mac, disable rate control 86 | WifiMacHelper wifiMac; 87 | wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", 88 | "DataMode",StringValue (phyMode), 89 | "ControlMode",StringValue (phyMode)); 90 | 91 | wifiPhy.Set ("TxPowerStart",DoubleValue (txp)); 92 | wifiPhy.Set ("TxPowerEnd", DoubleValue (txp)); 93 | wifiPhy.Set ("RxGain", DoubleValue (-95)); 94 | 95 | wifiMac.SetType ("ns3::AdhocWifiMac"); 96 | 97 | NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, uav); 98 | 99 | 100 | mesh = MeshHelper::Default (); 101 | if (!Mac48Address (m_root.c_str ()).IsBroadcast ()) 102 | { 103 | mesh.SetStackInstaller (m_stack, "Root", Mac48AddressValue (Mac48Address (m_root.c_str ()))); 104 | } 105 | else 106 | { 107 | //If root is not set, we do not use "Root" attribute, because it 108 | //is specified only for 11s 109 | mesh.SetStackInstaller (m_stack); 110 | } 111 | if (m_chan) 112 | { 113 | mesh.SetSpreadInterfaceChannels (MeshHelper::SPREAD_CHANNELS); 114 | } 115 | else 116 | { 117 | mesh.SetSpreadInterfaceChannels (MeshHelper::ZERO_CHANNEL); 118 | } 119 | mesh.SetMacType ("RandomStart", TimeValue (Seconds (m_randomStart))); 120 | // Set number of interfaces - default is single-interface mesh point 121 | mesh.SetNumberOfInterfaces (m_nIfaces); 122 | // Install protocols and return container if MeshPointDevices 123 | meshDevices = mesh.Install (wifiPhy, uav); 124 | 125 | std::stringstream ssSpeed; 126 | ssSpeed << "ns3::UniformRandomVariable[Min=0.0|Max=" << vel << "]"; 127 | 128 | MobilityHelper mobility; 129 | mobility.SetMobilityModel ("ns3::GaussMarkovMobilityModel", 130 | "Bounds", BoxValue (Box (0, 510, 0, 510, 0, 25)), 131 | "TimeStep", TimeValue (Seconds (0.5)), 132 | "Alpha", DoubleValue (0.85), 133 | "MeanVelocity", StringValue (ssSpeed.str ()), 134 | "MeanDirection", StringValue ("ns3::UniformRandomVariable[Min=0|Max=6.283185307]"), 135 | "MeanPitch", StringValue ("ns3::UniformRandomVariable[Min=0.05|Max=0.05]"), 136 | "NormalVelocity", StringValue ("ns3::NormalRandomVariable[Mean=0.0|Variance=0.0|Bound=0.0]"), 137 | "NormalDirection", StringValue ("ns3::NormalRandomVariable[Mean=0.0|Variance=0.2|Bound=0.4]"), 138 | "NormalPitch", StringValue ("ns3::NormalRandomVariable[Mean=0.0|Variance=0.02|Bound=0.04]")); 139 | mobility.SetPositionAllocator ("ns3::RandomBoxPositionAllocator", 140 | "X", StringValue ("ns3::UniformRandomVariable[Min=0|Max=1000]"), 141 | "Y", StringValue ("ns3::UniformRandomVariable[Min=0|Max=1000]"), 142 | "Z", StringValue ("ns3::UniformRandomVariable[Min=0|Max=25]")); 143 | mobility.Install (uav); 144 | 145 | if (m_pcap) 146 | wifiPhy.EnablePcapAll (std::string ("mp-")); 147 | wifiPhy.EnableAsciiAll (ascii.CreateFileStream ("test.tr")); 148 | 149 | InternetStackHelper internet; 150 | //internet.SetRoutingHelper (list); 151 | internet.Install (uav); 152 | 153 | 154 | Ipv4AddressHelper ipv4; 155 | NS_LOG_INFO ("Assign IP Addresses."); 156 | ipv4.SetBase ("10.0.0.0", "255.255.252.0"); 157 | Ipv4InterfaceContainer ifcont = ipv4.Assign (devices); 158 | 159 | uint16_t port = 9; 160 | 161 | for(int i = 0; i monitor = flowmon.InstallAll(); 181 | 182 | 183 | NS_LOG_INFO ("Run Simulation."); 184 | 185 | Simulator::Stop (Seconds (TotalTime)); 186 | pAnim= new AnimationInterface ("hwmp.xml"); 187 | pAnim->SetMaxPktsPerTraceFile(99999999999999); 188 | pAnim->SetMobilityPollInterval(Seconds(1)); 189 | pAnim->EnablePacketMetadata(true); 190 | 191 | uint32_t uavImg = pAnim->AddResource("/home/wellington/Downloads/uav.png"); 192 | for(uint32_t i=0;iUpdateNodeDescription (uav.Get (i), ""); 194 | Ptr wid= uav.Get (i); 195 | uint32_t nodeId = wid->GetId (); 196 | pAnim->UpdateNodeImage (nodeId, uavImg); 197 | pAnim->UpdateNodeColor(uav.Get(i), 255, 255, 0); 198 | pAnim->UpdateNodeSize (nodeId, 40.0,5.0);} 199 | Simulator::Run (); 200 | 201 | Ptr < Ipv4FlowClassifier > classifier = DynamicCast < Ipv4FlowClassifier >(flowmon.GetClassifier()); 202 | std::map < FlowId, FlowMonitor::FlowStats > stats = monitor->GetFlowStats(); 203 | 204 | double Delaysum = 0; 205 | uint64_t txPacketsum = 0; 206 | uint64_t rxPacketsum = 0; 207 | uint32_t txPacket = 0; 208 | uint32_t rxPacket = 0; 209 | uint32_t PacketLoss = 0; 210 | uint64_t txBytessum = 0; 211 | uint64_t rxBytessum = 0; 212 | double delay; 213 | double throughput = 0; 214 | int flowId = 0; 215 | 216 | for (std::map < FlowId, FlowMonitor::FlowStats > ::const_iterator iter = stats.begin(); iter != stats.end(); ++iter) { 217 | Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow(iter->first); 218 | NS_LOG_UNCOND("*****************************************"); 219 | NS_LOG_UNCOND("Flow ID: " << iter->first << " Src Addr " << t.sourceAddress << " Dst Addr " << t.destinationAddress); 220 | 221 | txPacket = iter->second.txPackets; 222 | rxPacket = iter->second.rxPackets; 223 | PacketLoss = txPacket - rxPacket; 224 | delay = iter->second.delaySum.GetMilliSeconds(); 225 | 226 | 227 | //<< iter->second.txBytes * 8.0 / 9.0 / 1000 / 1000 << " Mbps\n"; 228 | std::cout << " Tx Packets: " << iter->second.txPackets << "\n"; 229 | std::cout << " Rx Packets: " << iter->second.rxPackets << "\n"; 230 | std::cout << " Packet Loss: " << PacketLoss << "\n"; 231 | std::cout << " Tx Bytes: " << iter->second.txBytes << "\n"; 232 | std::cout << " Rx Bytes: " << iter->second.rxBytes << "\n"; 233 | std::cout << " Throughput: " << iter->second.rxBytes * 8.0 / 9.0 / 1000 / 1000 << " Mbps\n"; 234 | NS_LOG_UNCOND(" Per Node Delay: " << delay / txPacket << " ms"); 235 | std::cout << " PDR for current flow ID : " << ((rxPacket *100) / txPacket) << "%" << "\n"; 236 | 237 | 238 | 239 | flowId ++; 240 | 241 | txPacketsum += iter->second.txPackets; 242 | rxPacketsum += iter->second.rxPackets; 243 | txBytessum += iter->second.txBytes; 244 | rxBytessum += iter->second.rxBytes; 245 | Delaysum += iter->second.delaySum.GetMilliSeconds(); 246 | throughput += iter->second.rxBytes * 8.0 / 9.0 / 1000 / 1000; 247 | } 248 | 249 | NS_LOG_UNCOND("***********Resultados promedio*************"); 250 | std::cout<<" La red FANET contiene "<< nUav <<" nodos UAV \n"; 251 | std::cout<<" La velocidad de movimiento es: "<< vel <<" \n"; 252 | NS_LOG_UNCOND("Paquetes enviados = " << txPacketsum); 253 | NS_LOG_UNCOND("Paquetes recibidos = " << rxPacketsum); 254 | NS_LOG_UNCOND("Total Paquetes Perdidos = " << (txPacketsum-rxPacketsum)); 255 | NS_LOG_UNCOND("Total Bytes Enviados = "< 2 | #include 3 | #include "ns3/core-module.h" 4 | #include "ns3/network-module.h" 5 | #include "ns3/internet-module.h" 6 | #include "ns3/mobility-module.h" 7 | #include "ns3/wifi-module.h" 8 | #include "ns3/aodv-module.h" 9 | #include "ns3/olsr-module.h" 10 | #include "ns3/dsdv-module.h" 11 | #include "ns3/dsr-module.h" 12 | #include "ns3/applications-module.h" 13 | #include "ns3/netanim-module.h" 14 | #include "ns3/flow-monitor-module.h" 15 | #include "myapp.h" 16 | 17 | 18 | using namespace ns3; 19 | using namespace dsr; 20 | 21 | NS_LOG_COMPONENT_DEFINE ("uav"); 22 | 23 | int main (int argc, char *argv[]) 24 | { 25 | AnimationInterface *pAnim; 26 | double txp = 30; //dBm 27 | 28 | int nUav; 29 | int protocol; 30 | std::string m_protocolName; 31 | m_protocolName = "protocol"; 32 | int vel; 33 | std::cout<<"Ingrese el numero de nodos UAV: (N<255) \n"; 34 | std::cin>>nUav; 35 | std::cout<<"\n La red FANET contiene "<< nUav <<" nodos UAV \n"; 36 | std::cout<<"\n Ingrese el numero del protocolo (1=OLSR;2=AODV;3=DSDV;4=AOMDV; 5=DSR): \n"; 37 | std::cin>>protocol; 38 | std::cout<<"\n Ingrese la velocidad promedio maxima [m/s] (Esto modifica el parametro MeanVelocity): \n"; 39 | std::cin>>vel; 40 | int nSinks = 2; //numero de nodos sink (receptores) 41 | int iUav = (nUav/2); //nodos intermedios 42 | int sender = iUav + nSinks; //nodos emisores 43 | 44 | double TotalTime = 100; //segundos 45 | std::string rate ("100kbps"); 46 | std::string phyMode ("DsssRate11Mbps"); 47 | std::string tr_name ("fanet"); 48 | uint32_t packetSize = 512; // bytes 49 | uint32_t numPackets = 100000; 50 | 51 | 52 | //./waf --run "uav --nUav=50 --protocol=2" 53 | CommandLine cmd (__FILE__); 54 | cmd.AddValue ("nUav", "Numero de UAVs", nUav);// 100, 200, 300, 400, 500 55 | cmd.AddValue ("protocol", "1 AODV, 2 OLSR, 3 DSDV, ,4 AOMDV 5 DSR", protocol); 56 | cmd.Parse (argc, argv); 57 | 58 | //Set Non-unicastMode rate to unicast mode 59 | Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",StringValue (phyMode)); 60 | 61 | NodeContainer uav; 62 | uav.Create (nUav); 63 | 64 | //wifi phy y canal con helpers 65 | WifiHelper wifi; 66 | wifi.SetStandard (WIFI_STANDARD_80211g); 67 | 68 | YansWifiPhyHelper wifiPhy;// = YansWifiPhyHelper::Default (); 69 | YansWifiChannelHelper wifiChannel; 70 | wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); 71 | wifiChannel.AddPropagationLoss ("ns3::RangePropagationLossModel"); 72 | wifiPhy.SetChannel (wifiChannel.Create ()); 73 | 74 | // mac, disable rate control 75 | WifiMacHelper wifiMac; 76 | wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", 77 | "DataMode",StringValue (phyMode), 78 | "ControlMode",StringValue (phyMode)); 79 | 80 | wifiPhy.Set ("TxPowerStart",DoubleValue (txp)); 81 | wifiPhy.Set ("TxPowerEnd", DoubleValue (txp)); 82 | wifiPhy.Set ("RxGain", DoubleValue (-95)); 83 | 84 | wifiMac.SetType ("ns3::AdhocWifiMac"); 85 | NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, uav); 86 | 87 | std::stringstream ssSpeed; 88 | ssSpeed << "ns3::UniformRandomVariable[Min=0.0|Max=" << vel << "]"; 89 | 90 | 91 | MobilityHelper mobility; 92 | mobility.SetMobilityModel ("ns3::GaussMarkovMobilityModel", 93 | "Bounds", BoxValue (Box (0, 500, 0, 500, 10, 100)), 94 | "TimeStep", TimeValue (Seconds (0.5)), 95 | "Alpha", DoubleValue (0.85), 96 | "MeanVelocity", StringValue (ssSpeed.str ()), 97 | "MeanDirection", StringValue ("ns3::UniformRandomVariable[Min=0|Max=6.283185307]"), 98 | "MeanPitch", StringValue ("ns3::UniformRandomVariable[Min=0.05|Max=0.05]"), 99 | "NormalVelocity", StringValue ("ns3::NormalRandomVariable[Mean=0.0|Variance=0.0|Bound=0.0]"), 100 | "NormalDirection", StringValue ("ns3::NormalRandomVariable[Mean=0.0|Variance=0.2|Bound=0.4]"), 101 | "NormalPitch", StringValue ("ns3::NormalRandomVariable[Mean=0.0|Variance=0.02|Bound=0.04]")); 102 | mobility.SetPositionAllocator ("ns3::RandomBoxPositionAllocator", 103 | "X", StringValue ("ns3::UniformRandomVariable[Min=0|Max=500]"), 104 | "Y", StringValue ("ns3::UniformRandomVariable[Min=0|Max=500]"), 105 | "Z", StringValue ("ns3::UniformRandomVariable[Min=0|Max=25]")); 106 | mobility.Install (uav); 107 | 108 | 109 | AodvHelper aodv; 110 | OlsrHelper olsr; 111 | DsdvHelper dsdv; 112 | DsrHelper dsr; 113 | DsrMainHelper dsrMain; 114 | Ipv4ListRoutingHelper list; 115 | InternetStackHelper internet; 116 | 117 | if(protocol==1) 118 | { 119 | list.Add (olsr, 100); 120 | m_protocolName = "OLSR"; 121 | } 122 | else if(protocol==2) 123 | { 124 | list.Add (aodv, 100); 125 | m_protocolName = "AODV"; 126 | } 127 | else if(protocol==3) 128 | { 129 | list.Add (dsdv, 100); 130 | m_protocolName = "DSDV"; 131 | } 132 | else if (protocol==4) 133 | { 134 | list.Add (aodv, 100); 135 | m_protocolName = "AOMDV"; 136 | } 137 | else if (protocol==5) 138 | { 139 | m_protocolName = "DSR"; 140 | } 141 | else 142 | { 143 | NS_FATAL_ERROR ("Seleccione el protocolo adecuado:" << protocol); 144 | } 145 | 146 | if (protocol < 5) 147 | { 148 | internet.SetRoutingHelper (list); 149 | internet.Install (uav); 150 | } 151 | else if (protocol == 5) 152 | { 153 | internet.Install (uav); 154 | dsrMain.Install (dsr, uav); 155 | } 156 | 157 | 158 | 159 | NS_LOG_INFO ("assigning ip address"); 160 | 161 | Ipv4AddressHelper ipv4; 162 | NS_LOG_INFO ("Assign IP Addresses."); 163 | ipv4.SetBase ("10.0.0.0", "255.255.252.0"); 164 | Ipv4InterfaceContainer ifcont = ipv4.Assign (devices); 165 | 166 | uint16_t port = 9; 167 | 168 | /* Inicializar aplicaciones */ 169 | // Udp 170 | 171 | 172 | if (protocol==4) 173 | { 174 | for(int i=0;i ns3UdpSocket1 = Socket::CreateSocket (uav.Get (sender+i),UdpSocketFactory::GetTypeId ()); 183 | // Iniciar aplicacion para todos los nodos 184 | Ptr app1 = CreateObject (); 185 | app1->Setup (ns3UdpSocket1, sinkAddress1, packetSize, numPackets, DataRate (rate)); 186 | uav.Get (sender+i)->AddApplication (app1); 187 | ns3UdpSocket1->SetAllowBroadcast (true); 188 | app1->SetStartTime (Seconds (0.)); 189 | app1->SetStopTime (Seconds (TotalTime)); 190 | } 191 | } 192 | else 193 | { 194 | for(int i = 0; i monitor = flowmon.InstallAll(); 211 | 212 | wifiPhy.EnablePcap (m_protocolName, devices); 213 | NS_LOG_INFO ("Run Simulation"); 214 | 215 | Simulator::Stop (Seconds (TotalTime)); 216 | pAnim= new AnimationInterface ("uav.xml"); 217 | pAnim->SetMaxPktsPerTraceFile(99999999999999); 218 | pAnim->SetMobilityPollInterval(Seconds(1)); 219 | pAnim->EnablePacketMetadata(true); 220 | 221 | uint32_t uavImg = pAnim->AddResource("/home/wellington/Downloads/uav.png"); 222 | for(uint32_t i=0;iUpdateNodeDescription (uav.Get (i), ""); 224 | Ptr wid= uav.Get (i); 225 | uint32_t nodeId = wid->GetId (); 226 | pAnim->UpdateNodeImage (nodeId, uavImg); 227 | pAnim->UpdateNodeColor(uav.Get(i), 255, 255, 0); 228 | pAnim->UpdateNodeSize (nodeId, 40.0,5.0);} 229 | Simulator::Run (); 230 | 231 | Ptr < Ipv4FlowClassifier > classifier = DynamicCast < Ipv4FlowClassifier >(flowmon.GetClassifier()); 232 | std::map < FlowId, FlowMonitor::FlowStats > stats = monitor->GetFlowStats(); 233 | 234 | double Delaysum = 0; 235 | uint64_t txPacketsum = 0; 236 | uint64_t rxPacketsum = 0; 237 | uint32_t txPacket = 0; 238 | uint32_t rxPacket = 0; 239 | uint32_t PacketLoss = 0; 240 | uint64_t txBytessum = 0; 241 | uint64_t rxBytessum = 0; 242 | double delay; 243 | double throughput = 0; 244 | int flowId = 0; 245 | 246 | for (std::map < FlowId, FlowMonitor::FlowStats > ::const_iterator iter = stats.begin(); iter != stats.end(); ++iter) { 247 | Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow(iter->first); 248 | NS_LOG_UNCOND("*****************************************"); 249 | NS_LOG_UNCOND("Flow ID: " << iter->first << " Src Addr " << t.sourceAddress << " Dst Addr " << t.destinationAddress); 250 | 251 | txPacket = iter->second.txPackets; 252 | rxPacket = iter->second.rxPackets; 253 | PacketLoss = txPacket - rxPacket; 254 | delay = iter->second.delaySum.GetMilliSeconds(); 255 | 256 | 257 | //<< iter->second.txBytes * 8.0 / 9.0 / 1000 / 1000 << " Mbps\n"; 258 | std::cout << " Tx Packets: " << iter->second.txPackets << "\n"; 259 | std::cout << " Rx Packets: " << iter->second.rxPackets << "\n"; 260 | std::cout << " Packet Loss: " << PacketLoss << "\n"; 261 | std::cout << " Tx Bytes: " << iter->second.txBytes << "\n"; 262 | std::cout << " Rx Bytes: " << iter->second.rxBytes << "\n"; 263 | std::cout << " Throughput: " << iter->second.rxBytes * 8.0 / 9.0 / 1000 / 1000 << " Mbps\n"; 264 | NS_LOG_UNCOND(" Per Node Delay: " << delay / txPacket << " ms"); 265 | std::cout << " PDR for current flow ID : " << ((rxPacket *100) / txPacket) << "%" << "\n"; 266 | 267 | 268 | 269 | flowId ++; 270 | 271 | txPacketsum += iter->second.txPackets; 272 | rxPacketsum += iter->second.rxPackets; 273 | txBytessum += iter->second.txBytes; 274 | rxBytessum += iter->second.rxBytes; 275 | Delaysum += iter->second.delaySum.GetMilliSeconds(); 276 | throughput += iter->second.rxBytes * 8.0 / 9.0 / 1000 / 1000; 277 | } 278 | 279 | NS_LOG_UNCOND("***********Resultados promedio*************"); 280 | std::cout<<" La red FANET contiene "<< nUav <<" nodos UAV \n"; 281 | std::cout<<" El protocolo seleccionado es:"<< m_protocolName <<" \n"; 282 | std::cout<<" La velocidad de movimiento es: "<< vel <<" \n"; 283 | NS_LOG_UNCOND("Paquetes enviados = " << txPacketsum); 284 | NS_LOG_UNCOND("Paquetes recibidos = " << rxPacketsum); 285 | NS_LOG_UNCOND("Total Paquetes Perdidos = " << (txPacketsum-rxPacketsum)); 286 | NS_LOG_UNCOND("Total Bytes Enviados = "<