Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2011 University of California, Los Angeles |
| 4 | * |
| 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 |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 19 | */ |
| 20 | |
| 21 | #include "per-fib-limits.h" |
| 22 | |
| 23 | #include "ns3/ndn-interest-header.h" |
| 24 | #include "ns3/ndn-content-object-header.h" |
| 25 | #include "ns3/ndn-pit.h" |
| 26 | #include "ns3/ndn-pit-entry.h" |
| 27 | |
| 28 | #include "ns3/assert.h" |
| 29 | #include "ns3/log.h" |
| 30 | #include "ns3/simulator.h" |
Alexander Afanasyev | 6a3bb13 | 2012-08-15 09:47:35 -0700 | [diff] [blame] | 31 | #include "ns3/random-variable.h" |
Alexander Afanasyev | ccbd834 | 2012-08-16 16:54:39 -0700 | [diff] [blame] | 32 | #include "ns3/double.h" |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 33 | |
| 34 | #include <boost/foreach.hpp> |
| 35 | #include <boost/lambda/lambda.hpp> |
| 36 | #include <boost/lambda/bind.hpp> |
| 37 | namespace ll = boost::lambda; |
| 38 | |
| 39 | NS_LOG_COMPONENT_DEFINE ("ndn.fw.PerFibLimits"); |
| 40 | |
| 41 | namespace ns3 { |
| 42 | namespace ndn { |
| 43 | namespace fw { |
| 44 | |
| 45 | NS_OBJECT_ENSURE_REGISTERED (PerFibLimits); |
| 46 | |
| 47 | TypeId |
| 48 | PerFibLimits::GetTypeId (void) |
| 49 | { |
| 50 | static TypeId tid = TypeId ("ns3::ndn::fw::PerFibLimits") |
| 51 | .SetGroupName ("Ndn") |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 52 | .SetParent <super> () |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 53 | .AddConstructor <PerFibLimits> () |
| 54 | ; |
| 55 | return tid; |
| 56 | } |
| 57 | |
| 58 | PerFibLimits::PerFibLimits () |
| 59 | { |
| 60 | } |
| 61 | |
| 62 | void |
| 63 | PerFibLimits::DoDispose () |
| 64 | { |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 65 | super::DoDispose (); |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 66 | } |
| 67 | |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 68 | void |
| 69 | PerFibLimits::RemoveFace (Ptr<Face> face) |
| 70 | { |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 71 | for (PitQueueMap::iterator item = m_pitQueues.begin (); |
| 72 | item != m_pitQueues.end (); |
| 73 | item ++) |
| 74 | { |
| 75 | item->second.Remove (face); |
| 76 | } |
| 77 | m_pitQueues.erase (face); |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 78 | |
| 79 | super::RemoveFace (face); |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 83 | bool |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 84 | PerFibLimits::TrySendOutInterest (Ptr<Face> inFace, |
| 85 | Ptr<Face> outFace, |
| 86 | Ptr<const InterestHeader> header, |
| 87 | Ptr<const Packet> origPacket, |
| 88 | Ptr<pit::Entry> pitEntry) |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 89 | { |
| 90 | NS_LOG_FUNCTION (this << pitEntry->GetPrefix ()); |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 91 | // totally override all (if any) parent processing |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 92 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 93 | if (pitEntry->GetFwTag<PitQueueTag> () != boost::shared_ptr<PitQueueTag> ()) |
| 94 | { |
| 95 | pitEntry->UpdateLifetime (Seconds (0.10)); |
| 96 | NS_LOG_DEBUG ("Packet is still in queue and is waiting for its processing"); |
| 97 | return true; // already in the queue |
| 98 | } |
| 99 | |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 100 | if (header->GetInterestLifetime () < Seconds (0.1)) |
| 101 | { |
| 102 | NS_LOG_DEBUG( "What the fuck? Why interest lifetime is so short? [" << header->GetInterestLifetime ().ToDouble (Time::S) << "s]"); |
| 103 | } |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 104 | |
| 105 | pit::Entry::out_iterator outgoing = |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 106 | pitEntry->GetOutgoing ().find (outFace); |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 107 | |
| 108 | if (outgoing != pitEntry->GetOutgoing ().end ()) |
| 109 | { |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 110 | // just suppress without any other action |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 111 | return false; |
| 112 | } |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 113 | |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 114 | NS_LOG_DEBUG ("Limit: " << outFace->GetLimits ().m_curMaxLimit << ", outstanding: " << outFace->GetLimits ().m_outstanding); |
| 115 | |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 116 | if (outFace->GetLimits ().IsBelowLimit ()) |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 117 | { |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 118 | pitEntry->AddOutgoing (outFace); |
| 119 | |
| 120 | //transmission |
| 121 | Ptr<Packet> packetToSend = origPacket->Copy (); |
| 122 | outFace->Send (packetToSend); |
| 123 | |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 124 | DidSendOutInterest (outFace, header, origPacket, pitEntry); |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 125 | return true; |
| 126 | } |
| 127 | else |
| 128 | { |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 129 | NS_LOG_DEBUG ("Face limit for " << header->GetName ()); |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 130 | } |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 131 | |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 132 | // hack |
| 133 | // offset lifetime, so we don't keep entries in queue for too long |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 134 | // pitEntry->OffsetLifetime (Seconds (0.010) + ); |
| 135 | // std::cerr << (pitEntry->GetExpireTime () - Simulator::Now ()).ToDouble (Time::S) * 1000 << "ms" << std::endl; |
| 136 | pitEntry->OffsetLifetime (Seconds (-pitEntry->GetInterest ()->GetInterestLifetime ().ToDouble (Time::S))); |
| 137 | pitEntry->UpdateLifetime (Seconds (0.10)); |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 138 | |
| 139 | // const ndnSIM::LoadStatsFace &stats = GetStatsTree ()[header->GetName ()].incoming ().find (inFace)->second; |
| 140 | const ndnSIM::LoadStatsFace &stats = GetStatsTree ()["/"].incoming ().find (inFace)->second; |
| 141 | double weight = std::min (1.0, stats.GetSatisfiedRatio ().get<0> ()); |
| 142 | if (weight < 0) |
| 143 | { |
| 144 | // if stats is unknown, gracefully accept interest with normal priority |
| 145 | weight = 1.0; |
| 146 | } |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 147 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 148 | bool enqueued = m_pitQueues[outFace].Enqueue (inFace, pitEntry, weight); |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 149 | |
| 150 | // if (Simulator::GetContext () == 6) |
| 151 | // { |
| 152 | // // std::cerr << "Attempt to enqueue packet for " << pitEntry->GetPrefix () << ": " << (enqueued?"succeeded":"failed") << std::endl; |
| 153 | // } |
| 154 | |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 155 | if (enqueued) |
| 156 | { |
| 157 | NS_LOG_DEBUG ("PIT entry is enqueued for delayed processing. Telling that we forwarding possible"); |
| 158 | return true; |
| 159 | } |
| 160 | else |
| 161 | return false; |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 162 | } |
| 163 | |
| 164 | void |
| 165 | PerFibLimits::WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry) |
| 166 | { |
| 167 | NS_LOG_FUNCTION (this << pitEntry->GetPrefix ()); |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 168 | super::WillEraseTimedOutPendingInterest (pitEntry); |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 169 | |
Alexander Afanasyev | c23a3e3 | 2012-08-28 00:16:23 -0700 | [diff] [blame^] | 170 | // if (pitEntry->GetOutgoing ().size () == 0) |
| 171 | // { |
| 172 | // Ptr<InterestHeader> nackHeader = Create<InterestHeader> (*pitEntry->GetInterest ()); |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 173 | |
Alexander Afanasyev | c23a3e3 | 2012-08-28 00:16:23 -0700 | [diff] [blame^] | 174 | // NS_ASSERT (pitEntry->GetFwTag<PitQueueTag> () != boost::shared_ptr<PitQueueTag> ()); |
| 175 | // if (pitEntry->GetFwTag<PitQueueTag> ()->IsLastOneInQueues ()) |
| 176 | // { |
| 177 | // nackHeader->SetNack (100); |
| 178 | // } |
| 179 | // else |
| 180 | // { |
| 181 | // nackHeader->SetNack (101); |
| 182 | // } |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 183 | |
Alexander Afanasyev | c23a3e3 | 2012-08-28 00:16:23 -0700 | [diff] [blame^] | 184 | // Ptr<Packet> pkt = Create<Packet> (); |
| 185 | // pkt->AddHeader (*nackHeader); |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 186 | |
Alexander Afanasyev | c23a3e3 | 2012-08-28 00:16:23 -0700 | [diff] [blame^] | 187 | // for (pit::Entry::in_container::iterator face = pitEntry->GetIncoming ().begin (); |
| 188 | // face != pitEntry->GetIncoming ().end (); |
| 189 | // face ++) |
| 190 | // { |
| 191 | // face->m_face->Send (pkt->Copy ()); |
| 192 | // } |
| 193 | // } |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 194 | |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 195 | PitQueue::Remove (pitEntry); |
| 196 | |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 197 | for (pit::Entry::out_container::iterator face = pitEntry->GetOutgoing ().begin (); |
| 198 | face != pitEntry->GetOutgoing ().end (); |
| 199 | face ++) |
| 200 | { |
Alexander Afanasyev | 6a3bb13 | 2012-08-15 09:47:35 -0700 | [diff] [blame] | 201 | face->m_face->GetLimits ().RemoveOutstanding (); |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 202 | } |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 203 | |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 204 | ProcessFromQueue (); |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | |
| 208 | void |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 209 | PerFibLimits::WillSatisfyPendingInterest (Ptr<Face> inFace, |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 210 | Ptr<pit::Entry> pitEntry) |
| 211 | { |
| 212 | NS_LOG_FUNCTION (this << pitEntry->GetPrefix ()); |
Alexander Afanasyev | 31cb469 | 2012-08-17 13:08:20 -0700 | [diff] [blame] | 213 | super::WillSatisfyPendingInterest (inFace, pitEntry); |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 214 | |
| 215 | PitQueue::Remove (pitEntry); |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 216 | |
| 217 | for (pit::Entry::out_container::iterator face = pitEntry->GetOutgoing ().begin (); |
| 218 | face != pitEntry->GetOutgoing ().end (); |
| 219 | face ++) |
| 220 | { |
Alexander Afanasyev | 6a3bb13 | 2012-08-15 09:47:35 -0700 | [diff] [blame] | 221 | face->m_face->GetLimits ().RemoveOutstanding (); |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 222 | } |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 223 | |
| 224 | ProcessFromQueue (); |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 228 | void |
| 229 | PerFibLimits::ProcessFromQueue () |
| 230 | { |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 231 | NS_LOG_FUNCTION (this); |
| 232 | |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 233 | for (PitQueueMap::iterator queue = m_pitQueues.begin (); |
| 234 | queue != m_pitQueues.end (); |
| 235 | queue++) |
| 236 | { |
Alexander Afanasyev | 91e1128 | 2012-08-21 17:23:11 -0700 | [diff] [blame] | 237 | Ptr<Face> outFace = queue->first; |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 238 | |
| 239 | NS_LOG_DEBUG ("Processing " << *outFace); |
Alexander Afanasyev | 91e1128 | 2012-08-21 17:23:11 -0700 | [diff] [blame] | 240 | |
| 241 | while (!queue->second.IsEmpty () && outFace->GetLimits ().IsBelowLimit ()) |
| 242 | { |
| 243 | // now we have enqueued packet and have slot available. Send out delayed packet |
| 244 | Ptr<pit::Entry> pitEntry = queue->second.Pop (); |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 245 | NS_ASSERT_MSG (pitEntry != 0, "There *have to* be an entry in queue"); |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 246 | |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 247 | // hack |
| 248 | // offset lifetime back, so PIT entry wouldn't prematurely expire |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 249 | |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 250 | // std::cerr << Simulator::GetContext () << ", Lifetime before " << (pitEntry->GetExpireTime () - Simulator::Now ()).ToDouble (Time::S) << "s" << std::endl; |
| 251 | pitEntry->OffsetLifetime (Seconds (-0.10) + Seconds (pitEntry->GetInterest ()->GetInterestLifetime ().ToDouble (Time::S))); |
| 252 | // std::cerr << Simulator::GetContext () << ", Lifetime after " << (pitEntry->GetExpireTime () - Simulator::Now ()).ToDouble (Time::S) << "s" << std::endl; |
| 253 | |
Alexander Afanasyev | 91e1128 | 2012-08-21 17:23:11 -0700 | [diff] [blame] | 254 | pitEntry->AddOutgoing (outFace); |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 255 | |
Alexander Afanasyev | 91e1128 | 2012-08-21 17:23:11 -0700 | [diff] [blame] | 256 | Ptr<Packet> packetToSend = Create<Packet> (); |
Alexander Afanasyev | ff03395 | 2012-08-23 15:45:52 -0700 | [diff] [blame] | 257 | Ptr<InterestHeader> header = Create<InterestHeader> (*pitEntry->GetInterest ()); |
| 258 | NS_LOG_DEBUG ("Adjust interest lifetime to " << pitEntry->GetExpireTime () - Simulator::Now () << "s"); |
| 259 | // header->SetInterestLifetime ( |
| 260 | // // header->GetInterestLifetime () - () |
| 261 | // pitEntry->GetExpireTime () - Simulator::Now () |
| 262 | // ); |
| 263 | // std::cerr << "New lifetime: " << (pitEntry->GetExpireTime () - Simulator::Now ()).ToDouble (Time::S) << "s" << std::endl; |
| 264 | packetToSend->AddHeader (*header); |
Alexander Afanasyev | 0ffa716 | 2012-08-21 22:39:22 -0700 | [diff] [blame] | 265 | |
| 266 | NS_LOG_DEBUG ("Delayed sending for " << pitEntry->GetPrefix ()); |
Alexander Afanasyev | 91e1128 | 2012-08-21 17:23:11 -0700 | [diff] [blame] | 267 | outFace->Send (packetToSend); |
| 268 | DidSendOutInterest (outFace, pitEntry->GetInterest (), packetToSend, pitEntry); |
| 269 | } |
Alexander Afanasyev | 5db9217 | 2012-08-21 16:52:07 -0700 | [diff] [blame] | 270 | } |
| 271 | } |
| 272 | |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 273 | void |
| 274 | PerFibLimits::DidReceiveValidNack (Ptr<Face> inFace, |
| 275 | uint32_t nackCode, |
| 276 | Ptr<pit::Entry> pitEntry) |
| 277 | { |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 278 | // NS_LOG_FUNCTION (this << pitEntry->GetPrefix ()); |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 279 | PitQueue::Remove (pitEntry); |
| 280 | |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 281 | |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 282 | Ptr<InterestHeader> nackHeader = Create<InterestHeader> (*pitEntry->GetInterest ()); |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 283 | nackHeader->SetNack (100); |
| 284 | Ptr<Packet> pkt = Create<Packet> (); |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 285 | pkt->AddHeader (*nackHeader); |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 286 | |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 287 | for (pit::Entry::in_container::iterator face = pitEntry->GetIncoming ().begin (); |
| 288 | face != pitEntry->GetIncoming ().end (); |
| 289 | face ++) |
| 290 | { |
| 291 | face->m_face->Send (pkt->Copy ()); |
| 292 | } |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 293 | |
Alexander Afanasyev | 98c16e0 | 2012-08-28 00:02:02 -0700 | [diff] [blame] | 294 | |
| 295 | |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 296 | for (pit::Entry::out_container::iterator face = pitEntry->GetOutgoing ().begin (); |
| 297 | face != pitEntry->GetOutgoing ().end (); |
| 298 | face ++) |
| 299 | { |
| 300 | face->m_face->GetLimits ().RemoveOutstanding (); |
| 301 | } |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 302 | |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 303 | m_pit->MarkErased (pitEntry); |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 304 | |
Alexander Afanasyev | 6f101fc | 2012-08-23 16:34:34 -0700 | [diff] [blame] | 305 | ProcessFromQueue (); |
Alexander Afanasyev | 08b7d9e | 2012-08-23 10:53:46 -0700 | [diff] [blame] | 306 | } |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 307 | |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 308 | |
| 309 | } // namespace fw |
| 310 | } // namespace ndn |
| 311 | } // namespace ns3 |