blob: d5f4438b92a126769b15542fb549a282cb8935ed [file] [log] [blame]
Alexander Afanasyevc74a6022011-08-15 20:01:35 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
Alexander Afanasyevab1d5602011-08-17 19:17:18 -07002/*
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>
Ilya Moiseenko172763c2011-10-28 13:21:53 -070019 * Ilya Moiseenko <iliamo@cs.ucla.edu>
Alexander Afanasyevab1d5602011-08-17 19:17:18 -070020 */
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070021
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070022#include "ccnx-l3-protocol.h"
23
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070024#include "ns3/packet.h"
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070025#include "ns3/node.h"
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070026#include "ns3/log.h"
27#include "ns3/callback.h"
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070028#include "ns3/uinteger.h"
29#include "ns3/trace-source-accessor.h"
30#include "ns3/object-vector.h"
Alexander Afanasyevcbe92ae2011-12-16 13:06:18 -080031#include "ns3/pointer.h"
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070032#include "ns3/boolean.h"
Alexander Afanasyev07827182011-12-13 01:07:32 -080033#include "ns3/string.h"
Alexander Afanasyev4975f732011-12-20 17:52:19 -080034#include "ns3/simulator.h"
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -070035#include "ns3/random-variable.h"
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070036
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070037#include "ns3/ccnx-header-helper.h"
38
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070039#include "ccnx-face.h"
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070040#include "ccnx-forwarding-strategy.h"
41#include "ccnx-interest-header.h"
42#include "ccnx-content-object-header.h"
Alexander Afanasyev78057c32012-07-06 15:18:46 -070043#include "ccnx-fib-impl.h"
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070044
Alexander Afanasyev52e9aa92011-11-15 20:23:20 -080045#include "ccnx-net-device-face.h"
46
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070047#include <boost/foreach.hpp>
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080048#include <boost/lambda/lambda.hpp>
Alexander Afanasyeva5bbe0e2011-11-22 17:28:39 -080049#include <boost/lambda/bind.hpp>
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080050
51using namespace boost::tuples;
Alexander Afanasyeva5bbe0e2011-11-22 17:28:39 -080052namespace ll = boost::lambda;
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070053
54NS_LOG_COMPONENT_DEFINE ("CcnxL3Protocol");
55
56namespace ns3 {
57
Alexander Afanasyev7112f482011-08-17 14:05:57 -070058const uint16_t CcnxL3Protocol::ETHERNET_FRAME_TYPE = 0x7777;
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070059
Alexander Afanasyev07827182011-12-13 01:07:32 -080060
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070061NS_OBJECT_ENSURE_REGISTERED (CcnxL3Protocol);
62
63TypeId
64CcnxL3Protocol::GetTypeId (void)
65{
66 static TypeId tid = TypeId ("ns3::CcnxL3Protocol")
67 .SetParent<Ccnx> ()
Alexander Afanasyev070aa482011-08-20 00:38:25 -070068 .SetGroupName ("Ccnx")
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070069 .AddConstructor<CcnxL3Protocol> ()
Alexander Afanasyevcbe92ae2011-12-16 13:06:18 -080070 .AddAttribute ("FaceList", "List of faces associated with CCNx stack",
71 ObjectVectorValue (),
72 MakeObjectVectorAccessor (&CcnxL3Protocol::m_faces),
73 MakeObjectVectorChecker<CcnxFace> ())
74
Alexander Afanasyevbab81b12012-02-04 14:20:09 -080075 .AddAttribute ("EnableNACKs", "Enabling support of NACKs",
Alexander Afanasyev082dbca2012-02-14 18:43:13 -080076 BooleanValue (false),
Alexander Afanasyevbab81b12012-02-04 14:20:09 -080077 MakeBooleanAccessor (&CcnxL3Protocol::m_nacksEnabled),
78 MakeBooleanChecker ())
Alexander Afanasyevde009992012-02-04 18:54:54 -080079 .AddAttribute ("CacheUnsolicitedData", "Cache overheard data that have not been requested",
80 BooleanValue (false),
81 MakeBooleanAccessor (&CcnxL3Protocol::m_cacheUnsolicitedData),
82 MakeBooleanChecker ())
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070083 ;
84 return tid;
85}
86
87CcnxL3Protocol::CcnxL3Protocol()
Alexander Afanasyevab1d5602011-08-17 19:17:18 -070088: m_faceCounter (0)
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070089{
90 NS_LOG_FUNCTION (this);
91}
92
93CcnxL3Protocol::~CcnxL3Protocol ()
94{
95 NS_LOG_FUNCTION (this);
96}
97
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070098/*
99 * This method is called by AddAgregate and completes the aggregation
100 * by setting the node in the ccnx stack
101 */
102void
103CcnxL3Protocol::NotifyNewAggregate ()
104{
Alexander Afanasyev3a4a0b32012-06-28 14:14:22 -0700105 // not really efficient, but this will work only once
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700106 if (m_node == 0)
107 {
Alexander Afanasyev3a4a0b32012-06-28 14:14:22 -0700108 m_node = GetObject<Node> ();
109 if (m_node != 0)
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700110 {
Alexander Afanasyev3a4a0b32012-06-28 14:14:22 -0700111 NS_ASSERT_MSG (m_pit != 0 && m_fib != 0 && m_contentStore != 0 && m_forwardingStrategy != 0,
112 "PIT, FIB, and ContentStore should be aggregated before CcnxL3Protocol");
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700113 }
114 }
Alexander Afanasyev3a4a0b32012-06-28 14:14:22 -0700115 if (m_pit == 0)
116 {
117 m_pit = GetObject<CcnxPit> ();
118 }
119 if (m_fib == 0)
120 {
121 m_fib = GetObject<CcnxFib> ();
122 }
123 if (m_forwardingStrategy == 0)
124 {
125 m_forwardingStrategy = GetObject<CcnxForwardingStrategy> ();
126 }
Alexander Afanasyevd9fecdd2012-06-08 16:22:24 -0700127 if (m_contentStore == 0)
128 {
Alexander Afanasyev3a4a0b32012-06-28 14:14:22 -0700129 m_contentStore = GetObject<CcnxContentStore> ();
Alexander Afanasyevd9fecdd2012-06-08 16:22:24 -0700130 }
131
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700132 Object::NotifyNewAggregate ();
133}
134
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700135void
136CcnxL3Protocol::DoDispose (void)
137{
138 NS_LOG_FUNCTION (this);
139
Alexander Afanasyev45b92d42011-08-14 23:11:38 -0700140 for (CcnxFaceList::iterator i = m_faces.begin (); i != m_faces.end (); ++i)
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700141 {
142 *i = 0;
143 }
Alexander Afanasyev98256102011-08-14 01:00:02 -0700144 m_faces.clear ();
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700145 m_node = 0;
Alexander Afanasyevd02a5d62011-11-21 11:01:51 -0800146
147 // Force delete on objects
Alexander Afanasyev18252852011-11-21 13:35:31 -0800148 m_forwardingStrategy = 0; // there is a reference to PIT stored in here
Alexander Afanasyevd02a5d62011-11-21 11:01:51 -0800149 m_pit = 0;
150 m_contentStore = 0;
Alexander Afanasyev18252852011-11-21 13:35:31 -0800151 m_fib = 0;
152
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700153 Object::DoDispose ();
154}
155
156uint32_t
Alexander Afanasyev7112f482011-08-17 14:05:57 -0700157CcnxL3Protocol::AddFace (const Ptr<CcnxFace> &face)
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700158{
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -0700159 NS_LOG_FUNCTION (this << &face);
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700160
Alexander Afanasyevab1d5602011-08-17 19:17:18 -0700161 face->SetId (m_faceCounter); // sets a unique ID of the face. This ID serves only informational purposes
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700162
Alexander Afanasyeva67e28c2011-08-31 21:16:25 -0700163 // ask face to register in lower-layer stack
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -0700164 face->RegisterProtocolHandler (MakeCallback (&CcnxL3Protocol::Receive, this));
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700165
Alexander Afanasyev45b92d42011-08-14 23:11:38 -0700166 m_faces.push_back (face);
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800167 m_faceCounter++;
Alexander Afanasyev0ab833e2011-08-18 15:49:13 -0700168 return face->GetId ();
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700169}
170
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700171void
172CcnxL3Protocol::RemoveFace (Ptr<CcnxFace> face)
173{
174 // ask face to register in lower-layer stack
175 face->RegisterProtocolHandler (MakeNullCallback<void,const Ptr<CcnxFace>&,const Ptr<const Packet>&> ());
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800176
177 // just to be on a safe side. Do the process in two steps
Alexander Afanasyev4a5c2c12011-12-12 18:50:57 -0800178 std::list<boost::reference_wrapper<const CcnxPitEntry> > entriesToRemoves;
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700179 NS_ASSERT_MSG (false, "Need to be repaired");
180 // BOOST_FOREACH (const CcnxPitEntry &pitEntry, *m_pit)
181 // {
182 // m_pit->modify (pitEntry,
183 // ll::bind (&CcnxPitEntry::RemoveAllReferencesToFace, ll::_1, face));
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800184
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700185 // // If this face is the only for the associated FIB entry, then FIB entry will be removed soon.
186 // // Thus, we have to remove the whole PIT entry
187 // if (pitEntry.m_fibEntry->m_faces.size () == 1 &&
188 // pitEntry.m_fibEntry->m_faces.begin ()->m_face == face)
189 // {
190 // entriesToRemoves.push_back (boost::cref (pitEntry));
191 // }
192 // }
Alexander Afanasyev4a5c2c12011-12-12 18:50:57 -0800193 BOOST_FOREACH (const CcnxPitEntry &removedEntry, entriesToRemoves)
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800194 {
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700195 m_pit->erase (removedEntry);
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800196 }
197
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700198 CcnxFaceList::iterator face_it = find (m_faces.begin(), m_faces.end(), face);
199 NS_ASSERT_MSG (face_it != m_faces.end (), "Attempt to remove face that doesn't exist");
200 m_faces.erase (face_it);
201}
202
Alexander Afanasyev45b92d42011-08-14 23:11:38 -0700203Ptr<CcnxFace>
Alexander Afanasyev98256102011-08-14 01:00:02 -0700204CcnxL3Protocol::GetFace (uint32_t index) const
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700205{
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -0700206 BOOST_FOREACH (const Ptr<CcnxFace> &face, m_faces) // this function is not supposed to be called often, so linear search is fine
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700207 {
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -0700208 if (face->GetId () == index)
209 return face;
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700210 }
211 return 0;
212}
213
Alexander Afanasyev52e9aa92011-11-15 20:23:20 -0800214Ptr<CcnxFace>
215CcnxL3Protocol::GetFaceByNetDevice (Ptr<NetDevice> netDevice) const
216{
217 BOOST_FOREACH (const Ptr<CcnxFace> &face, m_faces) // this function is not supposed to be called often, so linear search is fine
218 {
219 Ptr<CcnxNetDeviceFace> netDeviceFace = DynamicCast<CcnxNetDeviceFace> (face);
220 if (netDeviceFace == 0) continue;
221
222 if (netDeviceFace->GetNetDevice () == netDevice)
223 return face;
224 }
225 return 0;
226}
227
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700228uint32_t
Alexander Afanasyev98256102011-08-14 01:00:02 -0700229CcnxL3Protocol::GetNFaces (void) const
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700230{
Alexander Afanasyev98256102011-08-14 01:00:02 -0700231 return m_faces.size ();
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700232}
233
Alexander Afanasyev98256102011-08-14 01:00:02 -0700234// Callback from lower layer
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700235void
Alexander Afanasyev0ab833e2011-08-18 15:49:13 -0700236CcnxL3Protocol::Receive (const Ptr<CcnxFace> &face, const Ptr<const Packet> &p)
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700237{
Alexander Afanasyevd459ec32012-04-30 13:58:20 -0700238 if (!face->IsUp ())
239 return;
240
241 NS_LOG_DEBUG (*p);
242
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700243 NS_LOG_LOGIC ("Packet from face " << *face << " received on node " << m_node->GetId ());
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700244
Alexander Afanasyev45b92d42011-08-14 23:11:38 -0700245 Ptr<Packet> packet = p->Copy (); // give upper layers a rw copy of the packet
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700246 try
247 {
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700248 CcnxHeaderHelper::Type type = CcnxHeaderHelper::GetCcnxHeaderType (p);
Alexander Afanasyeva67e28c2011-08-31 21:16:25 -0700249 switch (type)
250 {
251 case CcnxHeaderHelper::INTEREST:
252 {
253 Ptr<CcnxInterestHeader> header = Create<CcnxInterestHeader> ();
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700254
255 // Deserialization. Exception may be thrown
256 packet->RemoveHeader (*header);
257 NS_ASSERT_MSG (packet->GetSize () == 0, "Payload of Interests should be zero");
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800258
259 if (header->GetNack () > 0)
260 OnNack (face, header, p/*original packet*/);
261 else
262 OnInterest (face, header, p/*original packet*/);
Alexander Afanasyeva67e28c2011-08-31 21:16:25 -0700263 break;
264 }
265 case CcnxHeaderHelper::CONTENT_OBJECT:
266 {
267 Ptr<CcnxContentObjectHeader> header = Create<CcnxContentObjectHeader> ();
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700268
269 static CcnxContentObjectTail contentObjectTrailer; //there is no data in this object
270
271 // Deserialization. Exception may be thrown
272 packet->RemoveHeader (*header);
273 packet->RemoveTrailer (contentObjectTrailer);
274
275 OnData (face, header, packet/*payload*/, p/*original packet*/);
Alexander Afanasyeva67e28c2011-08-31 21:16:25 -0700276 break;
277 }
278 }
279
280 // exception will be thrown if packet is not recognized
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700281 }
282 catch (CcnxUnknownHeaderException)
283 {
284 NS_ASSERT_MSG (false, "Unknown CCNx header. Should not happen");
Alexander Afanasyevd459ec32012-04-30 13:58:20 -0700285 NS_LOG_ERROR ("Unknown CCNx header. Should not happen");
286 return;
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700287 }
Alexander Afanasyev98256102011-08-14 01:00:02 -0700288}
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700289
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800290void
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800291CcnxL3Protocol::OnNack (const Ptr<CcnxFace> &incomingFace,
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800292 Ptr<CcnxInterestHeader> &header,
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800293 const Ptr<const Packet> &packet)
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800294{
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800295 NS_LOG_FUNCTION (incomingFace << header << packet);
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800296 m_inNacks (header, incomingFace);
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800297
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700298 Ptr<CcnxPitEntry> pitEntry = m_pit->Lookup (*header);
299 if (pitEntry == 0)
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800300 {
301 // somebody is doing something bad
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800302 m_dropNacks (header, NON_DUPLICATED, incomingFace);
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800303 return;
304 }
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800305
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700306 // CcnxPitEntryIncomingFaceContainer::type::iterator inFace = pitEntry->m_incoming.find (incomingFace);
307 CcnxPitEntryOutgoingFaceContainer::type::iterator outFace = pitEntry->m_outgoing.find (incomingFace);
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800308
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700309 if (outFace == pitEntry->m_outgoing.end ())
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800310 {
Alexander Afanasyev8f5a9bb2011-12-18 19:49:02 -0800311// NS_ASSERT_MSG (false,
312// "Node " << GetObject<Node> ()->GetId () << ", outgoing entry should exist for face " << boost::cref(*incomingFace) << "\n" <<
313// "size: " << pitEntry.m_outgoing.size ());
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800314
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800315 // m_dropNacks (header, NON_DUPLICATE, incomingFace);
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800316 return;
317 }
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800318
Alexander Afanasyev0a61c342011-12-06 12:48:55 -0800319 // This was done in error. Never, never do anything, except normal leakage. This way we ensure that we will not have losses,
320 // at least when there is only one client
321 //
322 // incomingFace->LeakBucketByOnePacket ();
Alexander Afanasyeve67a97f2011-11-29 14:28:59 -0800323
Alexander Afanasyev23d2b542011-12-07 18:54:46 -0800324 NS_LOG_ERROR ("Nack on " << boost::cref(*incomingFace));
325
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700326 m_pit->modify (pitEntry,
Alexander Afanasyev5a595072011-11-25 14:49:07 -0800327 ll::bind (&CcnxPitEntry::SetWaitingInVain, ll::_1, outFace));
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800328
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800329 // If NACK is NACK_GIVEUP_PIT, then neighbor gave up trying to and removed it's PIT entry.
330 // So, if we had an incoming entry to this neighbor, then we can remove it now
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800331
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800332 if (header->GetNack () == CcnxInterestHeader::NACK_GIVEUP_PIT)
333 {
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700334 m_pit->modify (pitEntry,
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800335 ll::bind (&CcnxPitEntry::RemoveIncoming, ll::_1, incomingFace));
336 }
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800337
Alexander Afanasyev78057c32012-07-06 15:18:46 -0700338 StaticCast<CcnxFibImpl> (m_fib)->modify (pitEntry->m_fibEntry,
339 ll::bind (&CcnxFibEntry::UpdateStatus,
340 ll::_1, incomingFace, CcnxFibFaceMetric::NDN_FIB_YELLOW));
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800341
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700342 if (pitEntry->m_incoming.size () == 0) // interest was actually satisfied
Alexander Afanasyev23d2b542011-12-07 18:54:46 -0800343 {
344 // no need to do anything
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800345 m_dropNacks (header, AFTER_SATISFIED, incomingFace);
Alexander Afanasyev23d2b542011-12-07 18:54:46 -0800346 return;
347 }
348
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700349 if (!pitEntry->AreAllOutgoingInVain ()) // not all ougtoing are in vain
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800350 {
Alexander Afanasyev23d2b542011-12-07 18:54:46 -0800351 NS_LOG_DEBUG ("Not all outgoing are in vain");
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800352 // suppress
353 // Don't do anything, we are still expecting data from some other face
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800354 m_dropNacks (header, SUPPRESSED, incomingFace);
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800355 return;
356 }
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800357
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800358 Ptr<Packet> nonNackInterest = Create<Packet> ();
359 header->SetNack (CcnxInterestHeader::NORMAL_INTEREST);
360 nonNackInterest->AddHeader (*header);
361
362 bool propagated = m_forwardingStrategy->
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700363 PropagateInterest (*pitEntry, incomingFace, header, nonNackInterest);
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800364
Alexander Afanasyev23d2b542011-12-07 18:54:46 -0800365 // // ForwardingStrategy will try its best to forward packet to at least one interface.
366 // // If no interests was propagated, then there is not other option for forwarding or
367 // // ForwardingStrategy failed to find it.
Alexander Afanasyeve67a97f2011-11-29 14:28:59 -0800368 if (!propagated)
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800369 {
370 m_dropNacks (header, NO_FACES, incomingFace); // this headers doesn't have NACK flag set
371 GiveUpInterest (pitEntry, header);
372 }
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800373}
374
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700375// Processing Interests
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800376//
377// !!! Key point.
378// !!! All interests should be answerred!!! Either later with data, immediately with data, or immediately with NACK
Alexander Afanasyeva67e28c2011-08-31 21:16:25 -0700379void CcnxL3Protocol::OnInterest (const Ptr<CcnxFace> &incomingFace,
380 Ptr<CcnxInterestHeader> &header,
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700381 const Ptr<const Packet> &packet)
Alexander Afanasyev98256102011-08-14 01:00:02 -0700382{
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800383 m_inInterests (header, incomingFace);
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700384
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700385 Ptr<CcnxPitEntry> pitEntry = m_pit->Lookup (*header);
386 if (pitEntry == 0)
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700387 {
388 pitEntry = m_pit->Create (*header);
389 }
Ilya Moiseenkod83eb0d2011-11-16 15:23:46 -0800390
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700391 if (pitEntry == 0)
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700392 {
393 // if it is still not created, then give up processing
394 m_dropInterests (header, PIT_LIMIT, incomingFace);
395 return;
396 }
397
398 bool isNew = pitEntry->m_incoming.size () == 0 && pitEntry->m_outgoing.size () == 0;
399 bool isDuplicated = m_pit->CheckIfDuplicate (pitEntry, *header);
Alexander Afanasyev120bf312011-12-19 01:24:47 -0800400
Alexander Afanasyev7f3e49e2012-04-30 00:17:07 -0700401 NS_LOG_FUNCTION (header->GetName () << header->GetNonce () << boost::cref (*incomingFace) << isDuplicated);
402
403 /////////////////////////////////////////////////////////////////////////////////////////
404 /////////////////////////////////////////////////////////////////////////////////////////
405 /////////////////////////////////////////////////////////////////////////////////////////
406 // //
407 // !!!! IMPORTANT CHANGE !!!! Duplicate interests will create incoming face entry !!!! //
408 // //
409 /////////////////////////////////////////////////////////////////////////////////////////
410 /////////////////////////////////////////////////////////////////////////////////////////
411 /////////////////////////////////////////////////////////////////////////////////////////
412
413 // Data is not in cache
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700414 CcnxPitEntry::in_iterator inFace = pitEntry->m_incoming.find (incomingFace);
415 CcnxPitEntry::out_iterator outFace = pitEntry->m_outgoing.find (incomingFace);
Alexander Afanasyev7f3e49e2012-04-30 00:17:07 -0700416
417 bool isRetransmitted = false;
418
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700419 if (inFace != pitEntry->m_incoming.end ())
Alexander Afanasyev7f3e49e2012-04-30 00:17:07 -0700420 {
421 // CcnxPitEntryIncomingFace.m_arrivalTime keeps track arrival time of the first packet... why?
422
423 isRetransmitted = true;
424 // this is almost definitely a retransmission. But should we trust the user on that?
425 }
426 else
427 {
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700428 m_pit->modify (pitEntry,
Alexander Afanasyev7f3e49e2012-04-30 00:17:07 -0700429 ll::var(inFace) = ll::bind (&CcnxPitEntry::AddIncoming, ll::_1, incomingFace));
430 }
431 //////////////////////////////////////////////////////////////////////////////////
432 //////////////////////////////////////////////////////////////////////////////////
433 //////////////////////////////////////////////////////////////////////////////////
434
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800435 if (isDuplicated)
Ilya Moiseenko172763c2011-10-28 13:21:53 -0700436 {
Alexander Afanasyev7f3e49e2012-04-30 00:17:07 -0700437 NS_LOG_DEBUG ("Received duplicatie interest on " << *incomingFace);
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800438 m_dropInterests (header, DUPLICATED, incomingFace);
439
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800440 /**
441 * This condition will handle "routing" loops and also recently satisfied interests.
442 * Every time interest is satisfied, PIT entry (with empty incoming and outgoing faces)
443 * is kept for another small chunk of time.
444 */
Ilya Moiseenko172763c2011-10-28 13:21:53 -0700445
Alexander Afanasyevbab81b12012-02-04 14:20:09 -0800446 if (m_nacksEnabled)
447 {
448 NS_LOG_DEBUG ("Sending NACK_LOOP");
449 header->SetNack (CcnxInterestHeader::NACK_LOOP);
450 Ptr<Packet> nack = Create<Packet> ();
451 nack->AddHeader (*header);
452
453 incomingFace->Send (nack);
454 m_outNacks (header, incomingFace);
455 }
Ilya Moiseenko172763c2011-10-28 13:21:53 -0700456
Alexander Afanasyevcf133f02011-09-06 12:13:48 -0700457 return;
458 }
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800459
460 Ptr<Packet> contentObject;
Alexander Afanasyevc86c2832011-12-23 02:56:22 -0800461 Ptr<const CcnxContentObjectHeader> contentObjectHeader; // used for tracing
462 Ptr<const Packet> payload; // used for tracing
463 tie (contentObject, contentObjectHeader, payload) = m_contentStore->Lookup (header);
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800464 if (contentObject != 0)
465 {
Alexander Afanasyev7f3e49e2012-04-30 00:17:07 -0700466 NS_ASSERT (contentObjectHeader != 0);
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800467 NS_LOG_LOGIC("Found in cache");
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800468
Alexander Afanasyevd459ec32012-04-30 13:58:20 -0700469 OnDataDelayed (contentObjectHeader, payload, contentObject);
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800470 return;
471 }
472
Alexander Afanasyev0a61c342011-12-06 12:48:55 -0800473 // update PIT entry lifetime
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700474 m_pit->modify (pitEntry,
Alexander Afanasyev0a61c342011-12-06 12:48:55 -0800475 ll::bind (&CcnxPitEntry::UpdateLifetime, ll::_1,
476 header->GetInterestLifetime ()));
477
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700478 if (outFace != pitEntry->m_outgoing.end ())
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800479 {
Alexander Afanasyeve192a2a2012-04-09 14:57:54 -0700480 NS_LOG_DEBUG ("Non duplicate interests from the face we have sent interest to. Don't suppress");
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800481 // got a non-duplicate interest from the face we have sent interest to
482 // Probably, there is no point in waiting data from that face... Not sure yet
483
484 // If we're expecting data from the interface we got the interest from ("producer" asks us for "his own" data)
485 // Mark interface YELLOW, but keep a small hope that data will come eventually.
486
487 // ?? not sure if we need to do that ?? ...
488
Alexander Afanasyev78057c32012-07-06 15:18:46 -0700489 StaticCast<CcnxFibImpl> (m_fib)->modify(pitEntry->m_fibEntry,
490 ll::bind (&CcnxFibEntry::UpdateStatus,
491 ll::_1, incomingFace, CcnxFibFaceMetric::NDN_FIB_YELLOW));
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800492 }
Alexander Afanasyeve192a2a2012-04-09 14:57:54 -0700493 else
494 if (!isNew && !isRetransmitted)
495 {
496 // Suppress this interest if we're still expecting data from some other face
497 NS_LOG_DEBUG ("Suppress interests");
498 m_dropInterests (header, SUPPRESSED, incomingFace);
499 return;
500 }
Alexander Afanasyeva7a2b8b2011-11-28 18:19:09 -0800501
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800502 /////////////////////////////////////////////////////////////////////
503 // Propagate
504 /////////////////////////////////////////////////////////////////////
505
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800506 bool propagated = m_forwardingStrategy->
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700507 PropagateInterest (*pitEntry, incomingFace, header, packet);
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800508
Alexander Afanasyevd459ec32012-04-30 13:58:20 -0700509 if (!propagated && isRetransmitted) //give another chance if retransmitted
Alexander Afanasyev0a61c342011-12-06 12:48:55 -0800510 {
511 // increase max number of allowed retransmissions
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700512 m_pit->modify (pitEntry,
Alexander Afanasyev0a61c342011-12-06 12:48:55 -0800513 ll::bind (&CcnxPitEntry::IncreaseAllowedRetxCount, ll::_1));
514
515 // try again
516 propagated = m_forwardingStrategy->
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700517 PropagateInterest (*pitEntry, incomingFace, header, packet);
Alexander Afanasyev0a61c342011-12-06 12:48:55 -0800518 }
519
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800520 // ForwardingStrategy will try its best to forward packet to at least one interface.
521 // If no interests was propagated, then there is not other option for forwarding or
522 // ForwardingStrategy failed to find it.
Alexander Afanasyeve67a97f2011-11-29 14:28:59 -0800523 if (!propagated)
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800524 {
Alexander Afanasyev120bf312011-12-19 01:24:47 -0800525 NS_LOG_DEBUG ("Not propagated");
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800526 m_dropInterests (header, NO_FACES, incomingFace);
527 GiveUpInterest (pitEntry, header);
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800528 }
Alexander Afanasyev9d313d42011-11-25 13:36:15 -0800529}
530
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700531void
Alexander Afanasyev7f3e49e2012-04-30 00:17:07 -0700532CcnxL3Protocol::OnDataDelayed (Ptr<const CcnxContentObjectHeader> header,
533 Ptr<const Packet> payload,
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700534 const Ptr<const Packet> &packet)
535{
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700536 // 1. Lookup PIT entry
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700537 Ptr<CcnxPitEntry> pitEntry = m_pit->Lookup (*header);
538 if (pitEntry != 0)
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700539 {
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700540 //satisfy all pending incoming Interests
541 BOOST_FOREACH (const CcnxPitEntryIncomingFace &incoming, pitEntry->m_incoming)
542 {
543 incoming.m_face->Send (packet->Copy ());
544 m_outData (header, payload, false, incoming.m_face);
545 NS_LOG_DEBUG ("Satisfy " << *incoming.m_face);
546
547 // successfull forwarded data trace
548 }
549
550 if (pitEntry->m_incoming.size () > 0)
551 {
552 // All incoming interests are satisfied. Remove them
553 m_pit->modify (pitEntry,
554 ll::bind (&CcnxPitEntry::ClearIncoming, ll::_1));
555
556 // Remove all outgoing faces
557 m_pit->modify (pitEntry,
558 ll::bind (&CcnxPitEntry::ClearOutgoing, ll::_1));
559
560 // Set pruning timout on PIT entry (instead of deleting the record)
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700561 m_pit->MarkErased (pitEntry);
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700562 }
563 }
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700564 else
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700565 {
566 NS_LOG_DEBUG ("Pit entry not found (was satisfied and removed before)");
567 return; // do not process unsoliced data packets
568 }
569}
570
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700571// Processing ContentObjects
Alexander Afanasyev19426ef2011-11-23 20:55:28 -0800572void
573CcnxL3Protocol::OnData (const Ptr<CcnxFace> &incomingFace,
574 Ptr<CcnxContentObjectHeader> &header,
575 Ptr<Packet> &payload,
576 const Ptr<const Packet> &packet)
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700577{
Ilya Moiseenko172763c2011-10-28 13:21:53 -0700578
Alexander Afanasyev1aeaf922012-04-23 13:48:09 -0700579 NS_LOG_FUNCTION (incomingFace << header->GetName () << payload << packet);
Alexander Afanasyevc86c2832011-12-23 02:56:22 -0800580 m_inData (header, payload, incomingFace);
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700581
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700582 // 1. Lookup PIT entry
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700583 Ptr<CcnxPitEntry> pitEntry = m_pit->Lookup (*header);
584 if (pitEntry != 0)
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700585 {
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700586 // Note that with MultiIndex we need to modify entries indirectly
Alexander Afanasyevc74a6022011-08-15 20:01:35 -0700587
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700588 CcnxPitEntry::out_iterator out = pitEntry->m_outgoing.find (incomingFace);
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700589
590 // If we have sent interest for this data via this face, then update stats.
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700591 if (out != pitEntry->m_outgoing.end ())
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700592 {
Alexander Afanasyev78057c32012-07-06 15:18:46 -0700593 StaticCast<CcnxFibImpl> (m_fib)->modify (pitEntry->m_fibEntry,
594 ll::bind (&CcnxFibEntry::UpdateFaceRtt,
595 ll::_1,
596 incomingFace,
597 Simulator::Now () - out->m_sendTime));
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700598 }
599 else
600 {
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800601 // Unsolicited data, but we're interested in it... should we get it?
602 // Potential hole for attacks
Alexander Afanasyeva46844b2011-11-21 19:13:26 -0800603
Alexander Afanasyevde009992012-02-04 18:54:54 -0800604 if (m_cacheUnsolicitedData)
605 {
606 // Optimistically add or update entry in the content store
607 m_contentStore->Add (header, payload);
608 }
609 else
610 {
611 NS_LOG_ERROR ("Node "<< m_node->GetId() <<
612 ". PIT entry for "<< header->GetName ()<<" is valid, "
613 "but outgoing entry for interface "<< boost::cref(*incomingFace) <<" doesn't exist\n");
614 }
Alexander Afanasyev19426ef2011-11-23 20:55:28 -0800615 // ignore unsolicited data
616 return;
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700617 }
618
Alexander Afanasyev19426ef2011-11-23 20:55:28 -0800619 // Update metric status for the incoming interface in the corresponding FIB entry
Alexander Afanasyev78057c32012-07-06 15:18:46 -0700620 StaticCast<CcnxFibImpl>(m_fib)->modify (pitEntry->m_fibEntry,
621 ll::bind (&CcnxFibEntry::UpdateStatus, ll::_1,
622 incomingFace, CcnxFibFaceMetric::NDN_FIB_GREEN));
Alexander Afanasyev19426ef2011-11-23 20:55:28 -0800623
624 // Add or update entry in the content store
625 m_contentStore->Add (header, payload);
626
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700627 m_pit->modify (pitEntry,
628 ll::bind (&CcnxPitEntry::RemoveIncoming, ll::_1, incomingFace));
629
630 if (pitEntry->m_incoming.size () == 0)
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700631 {
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700632 // Set pruning timout on PIT entry (instead of deleting the record)
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700633 m_pit->MarkErased (pitEntry);
Alexander Afanasyevff8c5d62012-04-25 15:14:51 -0700634 }
635 else
636 {
Alexander Afanasyev3a4a0b32012-06-28 14:14:22 -0700637 OnDataDelayed (header, payload, packet);
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700638 }
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700639 }
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700640 else
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700641 {
Alexander Afanasyev1aeaf922012-04-23 13:48:09 -0700642 NS_LOG_DEBUG ("Pit entry not found");
Alexander Afanasyevde009992012-02-04 18:54:54 -0800643 if (m_cacheUnsolicitedData)
644 {
645 // Optimistically add or update entry in the content store
646 m_contentStore->Add (header, payload);
647 }
648 else
649 {
650 // Drop data packet if PIT entry is not found
651 // (unsolicited data packets should not "poison" content store)
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700652
Alexander Afanasyevde009992012-02-04 18:54:54 -0800653 //drop dulicated or not requested data packet
654 m_dropData (header, payload, UNSOLICITED, incomingFace);
655 }
Alexander Afanasyev78cf0c92011-09-01 19:57:14 -0700656 return; // do not process unsoliced data packets
657 }
658}
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700659
660void
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700661CcnxL3Protocol::GiveUpInterest (Ptr<CcnxPitEntry> pitEntry,
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800662 Ptr<CcnxInterestHeader> header)
663{
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700664 NS_LOG_FUNCTION (this);
665
Alexander Afanasyevbab81b12012-02-04 14:20:09 -0800666 if (m_nacksEnabled)
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800667 {
Alexander Afanasyevbab81b12012-02-04 14:20:09 -0800668 Ptr<Packet> packet = Create<Packet> ();
669 header->SetNack (CcnxInterestHeader::NACK_GIVEUP_PIT);
670 packet->AddHeader (*header);
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800671
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700672 BOOST_FOREACH (const CcnxPitEntryIncomingFace &incoming, pitEntry->m_incoming)
Alexander Afanasyevbab81b12012-02-04 14:20:09 -0800673 {
Alexander Afanasyevde009992012-02-04 18:54:54 -0800674 NS_LOG_DEBUG ("Send NACK for " << boost::cref (header->GetName ()) << " to " << boost::cref (*incoming.m_face));
Alexander Afanasyevbab81b12012-02-04 14:20:09 -0800675 incoming.m_face->Send (packet->Copy ());
676
677 m_outNacks (header, incoming.m_face);
678 }
Alexander Afanasyevbab81b12012-02-04 14:20:09 -0800679
Alexander Afanasyev1aeaf922012-04-23 13:48:09 -0700680 // All incoming interests cannot be satisfied. Remove them
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700681 m_pit->modify (pitEntry,
Alexander Afanasyev1aeaf922012-04-23 13:48:09 -0700682 ll::bind (&CcnxPitEntry::ClearIncoming, ll::_1));
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800683
Alexander Afanasyev1aeaf922012-04-23 13:48:09 -0700684 // Remove also outgoing
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700685 m_pit->modify (pitEntry,
Alexander Afanasyev1aeaf922012-04-23 13:48:09 -0700686 ll::bind (&CcnxPitEntry::ClearOutgoing, ll::_1));
Alexander Afanasyev120bf312011-12-19 01:24:47 -0800687
Alexander Afanasyev1aeaf922012-04-23 13:48:09 -0700688 // Set pruning timout on PIT entry (instead of deleting the record)
Alexander Afanasyevf034cbd2012-06-29 14:28:31 -0700689 m_pit->MarkErased (pitEntry);
Alexander Afanasyev1aeaf922012-04-23 13:48:09 -0700690 }
Alexander Afanasyevf377b332011-12-16 15:32:12 -0800691}
692
Alexander Afanasyev08d984e2011-08-13 19:20:22 -0700693} //namespace ns3