diff --git a/examples/isl-example.cc b/examples/isl-example.cc index f550b33..bab298a 100644 --- a/examples/isl-example.cc +++ b/examples/isl-example.cc @@ -24,7 +24,7 @@ main (int argc, char *argv[]) LogComponentEnable ("UdpClient", LOG_LEVEL_INFO); NodeContainer nodes; - nodes.Create (300); + nodes.Create (3); IslHelper isl; isl.SetDeviceAttribute ("DataRate", StringValue ("5Gbps")); @@ -43,24 +43,28 @@ main (int argc, char *argv[]) Ipv6InterfaceContainer interfaces = address.Assign (devices); UdpEchoServerHelper echoServer (9); + ApplicationContainer serverApps = echoServer.Install (nodes); + + ApplicationContainer clientApps; + UdpEchoClientHelper echoClient (devices.Get (0)->GetAddress (), 9); + echoClient.SetAttribute ("MaxPackets", UintegerValue (10)); + echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0))); + echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); for (uint32_t i = 1; i < nodes.GetN (); i++) { - ApplicationContainer serverApps = echoServer.Install (nodes.Get (i)); - serverApps.Start (Seconds (1.0)); - serverApps.Stop (Seconds (10.0)); - Address destAddress = interfaces.GetAddress (i, 0); - UdpEchoClientHelper echoClient (destAddress, 9); - echoClient.SetAttribute ("MaxPackets", UintegerValue (10)); - echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0))); - echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); + echoClient.SetAttribute ("RemoteAddress", AddressValue (destAddress)); - ApplicationContainer clientApps = echoClient.Install (nodes.Get (0)); - clientApps.Start (Seconds (2.0)); - clientApps.Stop (Seconds (10.0)); + clientApps.Add (echoClient.Install (nodes.Get (i-1))); } + clientApps.Start (Seconds (2.0)); + clientApps.Stop (Seconds (10.0)); + + serverApps.Start (Seconds (1.0)); + serverApps.Stop (Seconds (10.0)); + Simulator::Run (); Simulator::Destroy (); diff --git a/model/mock-channel.cc b/model/mock-channel.cc index 43d34e9..01f925a 100644 --- a/model/mock-channel.cc +++ b/model/mock-channel.cc @@ -118,6 +118,7 @@ bool MockChannel::Deliver ( Ptr dst, Time txTime) { + NS_LOG_FUNCTION (this << p << src->GetAddress () << dst->GetAddress () << txTime); Time delay = GetDelay (src, dst, txTime); /* Check if there is LOS between the source and destination */ @@ -149,7 +150,7 @@ MockChannel::TransmitStart ( Address destAddr, Time txTime) { - NS_LOG_FUNCTION (destAddr << this << p << srcId); + NS_LOG_FUNCTION (this << p << srcId << destAddr << txTime); NS_LOG_LOGIC ("UID is " << p->GetUid () << ")"); Ptr src = m_link[srcId]; diff --git a/model/mock-net-device.cc b/model/mock-net-device.cc index 0a7488f..b9eb988 100644 --- a/model/mock-net-device.cc +++ b/model/mock-net-device.cc @@ -370,7 +370,10 @@ MockNetDevice::SetReceiveErrorModel (Ptr em) void MockNetDevice::Receive (Ptr packet, Ptr senderDevice) { - NS_LOG_FUNCTION (this << packet); + NS_LOG_FUNCTION (this << packet << senderDevice); + + NS_LOG_DEBUG (GetAddress () << " receiving packet from " << senderDevice->GetAddress ()); + uint16_t protocol = 0; if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt (packet) )