diff --git a/examples/wimax/wimax-multicast.cc b/examples/wimax/wimax-multicast.cc index cf3d30066..3074ded7c 100644 --- a/examples/wimax/wimax-multicast.cc +++ b/examples/wimax/wimax-multicast.cc @@ -150,7 +150,7 @@ int main (int argc, char *argv[]) BSPosition = CreateObject (); BSPosition->SetPosition (Vector (1000, 0, 0)); - dev->GetPhy ()->SetMobility (BSPosition); + bsNodes.Get (0)->AggregateObject (BSPosition); bsDevs.Add (dev); if (verbose) { @@ -169,7 +169,7 @@ int main (int argc, char *argv[]) ss[i] = ssDevs.Get (i)->GetObject (); ss[i]->SetModulationType (WimaxPhy::MODULATION_TYPE_QAM16_12); - ss[i]->GetPhy ()->SetMobility (SSPosition[i]); + ssNodes.Get (i)->AggregateObject (SSPosition[i]); } diff --git a/src/applications/onoff/onoff-application.cc b/src/applications/onoff/onoff-application.cc index 3bb80f811..c86b279b8 100644 --- a/src/applications/onoff/onoff-application.cc +++ b/src/applications/onoff/onoff-application.cc @@ -133,6 +133,7 @@ void OnOffApplication::StartApplication() // Called at time specified by Start m_socket = Socket::CreateSocket (GetNode(), m_tid); m_socket->Bind (); m_socket->Connect (m_peer); + m_socket->ShutdownRecv (); } // Insure no pending event CancelEvents (); diff --git a/src/applications/packet-sink/packet-sink.cc b/src/applications/packet-sink/packet-sink.cc index b953c24e8..1ddf50c33 100644 --- a/src/applications/packet-sink/packet-sink.cc +++ b/src/applications/packet-sink/packet-sink.cc @@ -96,6 +96,7 @@ void PacketSink::StartApplication() // Called at time specified by Start m_socket = Socket::CreateSocket (GetNode(), m_tid); m_socket->Bind (m_local); m_socket->Listen (); + m_socket->ShutdownSend (); if (addressUtils::IsMulticast (m_local)) { Ptr udpSocket = DynamicCast (m_socket); diff --git a/src/devices/wimax/bs-link-manager.cc b/src/devices/wimax/bs-link-manager.cc index fcfae2bce..258a6952c 100644 --- a/src/devices/wimax/bs-link-manager.cc +++ b/src/devices/wimax/bs-link-manager.cc @@ -93,11 +93,12 @@ BSLinkManager::ProcessRangingRequest (Cid cid, RngReq rngreq) * m_bs->GetSymbolDuration ().GetSeconds ()); } - NS_ASSERT_MSG (Simulator::Now () >= m_bs->GetUlSubframeStartTime () && Simulator::Now () < irIntervalBoundary, - "Base station: Error while processing ranging request: out of time"); tries++; - PerformRanging (cid, rngreq); + if (Simulator::Now () >= m_bs->GetUlSubframeStartTime () && Simulator::Now () < irIntervalBoundary) + { + PerformRanging (cid, rngreq); + } } void diff --git a/src/devices/wimax/simple-ofdm-wimax-channel.cc b/src/devices/wimax/simple-ofdm-wimax-channel.cc index 314789740..aae4df055 100644 --- a/src/devices/wimax/simple-ofdm-wimax-channel.cc +++ b/src/devices/wimax/simple-ofdm-wimax-channel.cc @@ -145,23 +145,19 @@ SimpleOfdmWimaxChannel::Send (Time BlockTime, double rxPowerDbm = 0; Ptr senderMobility = 0; Ptr receiverMobility = 0; - if (phy->GetMobility ()) - { - senderMobility = phy->GetMobility ()->GetObject (); - } + senderMobility = phy->GetDevice ()->GetNode ()->GetObject (); for (std::list >::iterator iter = m_phyList.begin (); iter != m_phyList.end (); ++iter) { - double delay = 0; + Time delay = Seconds(0); if (phy != *iter) { - if ((*iter)->GetMobility ()) - { - receiverMobility = (*iter)->GetMobility ()->GetObject (); - } + double distance = 0; + receiverMobility = (*iter)->GetDevice ()->GetNode ()->GetObject (); if (receiverMobility != 0 && senderMobility != 0 && m_loss != 0) { - delay = (senderMobility->GetDistanceFrom (receiverMobility)) / 300000000LL; + distance = senderMobility->GetDistanceFrom (receiverMobility); + delay = Seconds(distance/300000000.0); rxPowerDbm = m_loss->CalcRxPower (rxPowerDbm, senderMobility, receiverMobility); } simpleOfdmSendParam * param = new simpleOfdmSendParam (fecBlock, @@ -183,7 +179,7 @@ SimpleOfdmWimaxChannel::Send (Time BlockTime, dstNode = dstNetDevice->GetObject ()->GetNode ()->GetId (); } Simulator::ScheduleWithContext (dstNode, - Seconds (delay) + BlockTime, + delay, &SimpleOfdmWimaxChannel::EndSend, this, *iter, @@ -196,7 +192,6 @@ SimpleOfdmWimaxChannel::Send (Time BlockTime, void SimpleOfdmWimaxChannel::EndSend (Ptr rxphy, simpleOfdmSendParam * param) { - // std::cout << "END_SEND "; rxphy->StartReceive (param->GetFecBlock (), param->GetBurstSize (), param->GetIsFirstBlock (), diff --git a/src/devices/wimax/simple-ofdm-wimax-phy.cc b/src/devices/wimax/simple-ofdm-wimax-phy.cc index 4ba774217..48329552f 100644 --- a/src/devices/wimax/simple-ofdm-wimax-phy.cc +++ b/src/devices/wimax/simple-ofdm-wimax-phy.cc @@ -311,12 +311,7 @@ SimpleOfdmWimaxPhy::EndSendFecBlock (WimaxPhy::ModulationType modulationType, } else { - Simulator::Schedule (Seconds (0), - &SimpleOfdmWimaxPhy::StartSendFecBlock, - this, - false, - modulationType, - direction); + StartSendFecBlock(false,modulationType,direction); } } @@ -392,7 +387,7 @@ SimpleOfdmWimaxPhy::StartReceive (const bvec &fecBlock, SetBlockParameters (burstSize, modulationType); m_blockTime = GetBlockTransmissionTime (modulationType); } - Simulator::Schedule (Seconds (0), + Simulator::Schedule (m_blockTime, &SimpleOfdmWimaxPhy::EndReceiveFecBlock, this, fecBlock, diff --git a/src/internet-stack/tcp-socket-impl.cc b/src/internet-stack/tcp-socket-impl.cc index 3b59a9496..a618d6fb3 100644 --- a/src/internet-stack/tcp-socket-impl.cc +++ b/src/internet-stack/tcp-socket-impl.cc @@ -674,10 +674,6 @@ TcpSocketImpl::ForwardUp (Ptr packet, Ipv4Address saddr, Ipv4Address dad Address fromAddress = InetSocketAddress (saddr, port); Address toAddress = InetSocketAddress (daddr, m_endPoint->GetLocalPort()); - if (m_shutdownRecv) - { - return; - } TcpHeader tcpHeader; packet->RemoveHeader (tcpHeader); @@ -735,7 +731,10 @@ Actions_t TcpSocketImpl::ProcessEvent (Events_t e) if (saveState < CLOSING && (m_state == CLOSING || m_state == TIMED_WAIT) ) { NS_LOG_LOGIC ("TcpSocketImpl peer closing, send EOF to application"); - NotifyDataRecv (); + if (!m_shutdownRecv) + { + NotifyDataRecv (); + } } if (needCloseNotify && !m_closeNotified) @@ -1296,7 +1295,10 @@ void TcpSocketImpl::NewRx (Ptr p, m_rxAvailable += p->GetSize (); RxBufFinishInsert (tcpHeader.GetSequenceNumber ()); m_rxBufSize += p->GetSize (); - NotifyDataRecv (); + if (!m_shutdownRecv) + { + NotifyDataRecv (); + } if (m_closeNotified) { NS_LOG_LOGIC ("Tcp " << this << " HuH? Got data after closeNotif"); @@ -1392,7 +1394,10 @@ void TcpSocketImpl::NewRx (Ptr p, m_rxAvailable += p->GetSize (); m_rxBufSize += p->GetSize(); RxBufFinishInsert(start); - NotifyDataRecv (); + if (!m_shutdownRecv) + { + NotifyDataRecv (); + } } else { // debug diff --git a/src/node/packet-socket.cc b/src/node/packet-socket.cc index 07ddee6f4..51b3fc2e4 100644 --- a/src/node/packet-socket.cc +++ b/src/node/packet-socket.cc @@ -43,7 +43,7 @@ PacketSocket::GetTypeId (void) MakeTraceSourceAccessor (&PacketSocket::m_dropTrace)) .AddAttribute ("RcvBufSize", "PacketSocket maximum receive buffer size (bytes)", - UintegerValue (0xffffffffl), + UintegerValue (131072), MakeUintegerAccessor (&PacketSocket::m_rcvBufSize), MakeUintegerChecker ()) ; diff --git a/src/node/tcp-socket.cc b/src/node/tcp-socket.cc index a5ed8e534..29eb0c518 100644 --- a/src/node/tcp-socket.cc +++ b/src/node/tcp-socket.cc @@ -45,7 +45,7 @@ TcpSocket::GetTypeId (void) MakeUintegerChecker ()) .AddAttribute ("RcvBufSize", "TcpSocket maximum receive buffer size (bytes)", - UintegerValue (0xffffffffl), + UintegerValue (131072), MakeUintegerAccessor (&TcpSocket::GetRcvBufSize, &TcpSocket::SetRcvBufSize), MakeUintegerChecker ()) diff --git a/src/node/udp-socket.cc b/src/node/udp-socket.cc index 9f399a346..ee54dbbdf 100644 --- a/src/node/udp-socket.cc +++ b/src/node/udp-socket.cc @@ -39,7 +39,7 @@ UdpSocket::GetTypeId (void) .SetParent () .AddAttribute ("RcvBufSize", "UdpSocket maximum receive buffer size (bytes)", - UintegerValue (0xffffffffl), + UintegerValue (131072), MakeUintegerAccessor (&UdpSocket::GetRcvBufSize, &UdpSocket::SetRcvBufSize), MakeUintegerChecker ()) diff --git a/test.py b/test.py index 67eee61a3..90061b95a 100755 --- a/test.py +++ b/test.py @@ -63,6 +63,7 @@ core_kinds = ["bvt", "core", "system", "unit"] # core_valgrind_skip_tests = [ "ns3-tcp-cwnd", + "nsc-tcp-loss", "ns3-tcp-interoperability", ]