blob: c64bb7ef7b50374b9cd3c1992c8e824730d6d267 [file] [log] [blame]
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -07001/* -*- 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: Ilya Moiseenko <iliamo@cs.ucla.edu>
19 */
20
Alexander Afanasyev0c395372014-12-20 15:54:02 -080021#include "ndn-consumer.hpp"
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070022#include "ns3/ptr.h"
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080023#include "ns3/log.h"
24#include "ns3/simulator.h"
25#include "ns3/packet.h"
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070026#include "ns3/callback.h"
Alexander Afanasyeva46844b2011-11-21 19:13:26 -080027#include "ns3/string.h"
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080028#include "ns3/boolean.h"
29#include "ns3/uinteger.h"
Alexander Afanasyeva89bc102013-07-16 10:17:31 -070030#include "ns3/integer.h"
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080031#include "ns3/double.h"
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080032
Alexander Afanasyev0c395372014-12-20 15:54:02 -080033#include "ns3/ndn-app-face.hpp"
Alexander Afanasyev0c395372014-12-20 15:54:02 -080034#include "ns3/ndnSIM/utils/ndn-fw-hop-count-tag.hpp"
35#include "ns3/ndnSIM/utils/ndn-rtt-mean-deviation.hpp"
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070036
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080037#include <boost/ref.hpp>
Alexander Afanasyev781ea812011-12-15 22:42:09 -080038
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080039NS_LOG_COMPONENT_DEFINE("ndn.Consumer");
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070040
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070041namespace ns3 {
42namespace ndn {
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -080043
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080044NS_OBJECT_ENSURE_REGISTERED(Consumer);
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -080045
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070046TypeId
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080047Consumer::GetTypeId(void)
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070048{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080049 static TypeId tid =
50 TypeId("ns3::ndn::Consumer")
51 .SetGroupName("Ndn")
52 .SetParent<App>()
53 .AddAttribute("StartSeq", "Initial sequence number", IntegerValue(0),
54 MakeIntegerAccessor(&Consumer::m_seq), MakeIntegerChecker<int32_t>())
Alexander Afanasyev011b8592011-12-21 14:45:27 -080055
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080056 .AddAttribute("Prefix", "Name of the Interest", StringValue("/"),
57 MakeNameAccessor(&Consumer::m_interestName), MakeNameChecker())
58 .AddAttribute("LifeTime", "LifeTime for interest packet", StringValue("2s"),
59 MakeTimeAccessor(&Consumer::m_interestLifeTime), MakeTimeChecker())
Alexander Afanasyev781ea812011-12-15 22:42:09 -080060
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080061 .AddAttribute("RetxTimer",
62 "Timeout defining how frequent retransmission timeouts should be checked",
63 StringValue("50ms"),
64 MakeTimeAccessor(&Consumer::GetRetxTimer, &Consumer::SetRetxTimer),
65 MakeTimeChecker())
Alexander Afanasyev781ea812011-12-15 22:42:09 -080066
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080067 .AddTraceSource("LastRetransmittedInterestDataDelay",
68 "Delay between last retransmitted Interest and received Data",
69 MakeTraceSourceAccessor(&Consumer::m_lastRetransmittedInterestDataDelay))
Alexander Afanasyevedf24d92013-01-18 13:35:06 -080070
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080071 .AddTraceSource("FirstInterestDataDelay",
72 "Delay between first transmitted Interest and received Data",
73 MakeTraceSourceAccessor(&Consumer::m_firstInterestDataDelay));
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070074
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080075 return tid;
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070076}
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -080077
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080078Consumer::Consumer()
79 : m_rand(0, std::numeric_limits<uint32_t>::max())
80 , m_seq(0)
81 , m_seqMax(0) // don't request anything
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070082{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080083 NS_LOG_FUNCTION_NOARGS();
Alexander Afanasyev011b8592011-12-21 14:45:27 -080084
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080085 m_rtt = CreateObject<RttMeanDeviation>();
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070086}
Alexander Afanasyev781ea812011-12-15 22:42:09 -080087
88void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080089Consumer::SetRetxTimer(Time retxTimer)
Alexander Afanasyev781ea812011-12-15 22:42:09 -080090{
91 m_retxTimer = retxTimer;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080092 if (m_retxEvent.IsRunning()) {
93 // m_retxEvent.Cancel (); // cancel any scheduled cleanup events
94 Simulator::Remove(m_retxEvent); // slower, but better for memory
95 }
Alexander Afanasyev781ea812011-12-15 22:42:09 -080096
97 // schedule even with new timeout
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080098 m_retxEvent = Simulator::Schedule(m_retxTimer, &Consumer::CheckRetxTimeout, this);
Alexander Afanasyev781ea812011-12-15 22:42:09 -080099}
100
101Time
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800102Consumer::GetRetxTimer() const
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800103{
104 return m_retxTimer;
105}
106
107void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800108Consumer::CheckRetxTimeout()
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800109{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800110 Time now = Simulator::Now();
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800111
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800112 Time rto = m_rtt->RetransmitTimeout();
Alexander Afanasyev8a237522013-02-01 13:33:38 -0800113 // NS_LOG_DEBUG ("Current RTO: " << rto.ToDouble (Time::S) << "s");
Alexander Afanasyevbdc0d982011-12-16 01:15:26 -0800114
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800115 while (!m_seqTimeouts.empty()) {
116 SeqTimeoutsContainer::index<i_timestamp>::type::iterator entry =
117 m_seqTimeouts.get<i_timestamp>().begin();
118 if (entry->time + rto <= now) // timeout expired?
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800119 {
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800120 uint32_t seqNo = entry->seq;
121 m_seqTimeouts.get<i_timestamp>().erase(entry);
122 OnTimeout(seqNo);
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800123 }
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800124 else
125 break; // nothing else to do. All later packets need not be retransmitted
126 }
Alexander Afanasyev3183b5a2011-12-23 20:48:20 -0800127
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800128 m_retxEvent = Simulator::Schedule(m_retxTimer, &Consumer::CheckRetxTimeout, this);
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800129}
130
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700131// Application Methods
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800132void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800133Consumer::StartApplication() // Called at time specified by Start
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700134{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800135 NS_LOG_FUNCTION_NOARGS();
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700136
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800137 // do base stuff
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800138 App::StartApplication();
Alexander Afanasyev011b8592011-12-21 14:45:27 -0800139
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800140 ScheduleNextPacket();
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700141}
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800142
143void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800144Consumer::StopApplication() // Called at time specified by Stop
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700145{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800146 NS_LOG_FUNCTION_NOARGS();
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700147
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800148 // cancel periodic packet generation
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800149 Simulator::Cancel(m_sendEvent);
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700150
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800151 // cleanup base stuff
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800152 App::StopApplication();
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700153}
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800154
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700155void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800156Consumer::SendPacket()
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700157{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800158 if (!m_active)
159 return;
Alexander Afanasyev3183b5a2011-12-23 20:48:20 -0800160
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800161 NS_LOG_FUNCTION_NOARGS();
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800162
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800163 uint32_t seq = std::numeric_limits<uint32_t>::max(); // invalid
Alexander Afanasyev1ec705f2012-01-23 12:35:10 -0800164
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800165 while (m_retxSeqs.size()) {
166 seq = *m_retxSeqs.begin();
167 m_retxSeqs.erase(m_retxSeqs.begin());
168 break;
169 }
170
171 if (seq == std::numeric_limits<uint32_t>::max()) {
172 if (m_seqMax != std::numeric_limits<uint32_t>::max()) {
173 if (m_seq >= m_seqMax) {
174 return; // we are totally done
175 }
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800176 }
Alexander Afanasyev1ec705f2012-01-23 12:35:10 -0800177
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800178 seq = m_seq++;
179 }
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800180
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800181 //
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700182 shared_ptr<Name> nameWithSequence = make_shared<Name>(m_interestName);
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800183 nameWithSequence->appendSeqNum(seq);
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800184 //
185
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700186 shared_ptr<Interest> interest = make_shared<Interest>();
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800187 interest->SetNonce(m_rand.GetValue());
188 interest->SetName(nameWithSequence);
189 interest->SetInterestLifetime(m_interestLifeTime);
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800190
Alexander Afanasyevfaa01f92013-07-10 18:34:31 -0700191 // NS_LOG_INFO ("Requesting Interest: \n" << *interest);
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800192 NS_LOG_INFO("> Interest for " << seq);
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700193
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800194 WillSendOutInterest(seq);
Alexander Afanasyeve1aa9b92012-10-11 10:40:02 -0700195
Alexander Afanasyev1a0fff62013-01-19 14:29:51 -0800196 FwHopCountTag hopCountTag;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800197 interest->GetPayload()->AddPacketTag(hopCountTag);
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800198
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800199 m_transmittedInterests(interest, this, m_face);
200 m_face->ReceiveInterest(interest);
Alexander Afanasyeve1aa9b92012-10-11 10:40:02 -0700201
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800202 ScheduleNextPacket();
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700203}
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700204
Alexander Afanasyev011b8592011-12-21 14:45:27 -0800205///////////////////////////////////////////////////
206// Process incoming packets //
207///////////////////////////////////////////////////
208
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700209void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700210Consumer::OnData(shared_ptr<const Data> data)
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700211{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800212 if (!m_active)
213 return;
Alexander Afanasyev3183b5a2011-12-23 20:48:20 -0800214
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800215 App::OnData(data); // tracing inside
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800216
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800217 NS_LOG_FUNCTION(this << data);
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800218
Alexander Afanasyevfaa01f92013-07-10 18:34:31 -0700219 // NS_LOG_INFO ("Received content object: " << boost::cref(*data));
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800220
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800221 uint32_t seq = data->GetName().get(-1).toSeqNum();
222 NS_LOG_INFO("< DATA for " << seq);
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800223
Alexander Afanasyev1a0fff62013-01-19 14:29:51 -0800224 int hopCount = -1;
225 FwHopCountTag hopCountTag;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800226 if (data->GetPayload()->PeekPacketTag(hopCountTag)) {
227 hopCount = hopCountTag.Get();
228 }
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800229
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800230 SeqTimeoutsContainer::iterator entry = m_seqLastDelay.find(seq);
231 if (entry != m_seqLastDelay.end()) {
232 m_lastRetransmittedInterestDataDelay(this, seq, Simulator::Now() - entry->time, hopCount);
233 }
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800234
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800235 entry = m_seqFullDelay.find(seq);
236 if (entry != m_seqFullDelay.end()) {
237 m_firstInterestDataDelay(this, seq, Simulator::Now() - entry->time, m_seqRetxCounts[seq],
238 hopCount);
239 }
Alexander Afanasyev400aae12013-01-19 13:27:52 -0800240
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800241 m_seqRetxCounts.erase(seq);
242 m_seqFullDelay.erase(seq);
243 m_seqLastDelay.erase(seq);
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800244
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800245 m_seqTimeouts.erase(seq);
246 m_retxSeqs.erase(seq);
Alexander Afanasyev359bfb72012-01-09 18:42:50 -0800247
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800248 m_rtt->AckSeq(SequenceNumber32(seq));
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800249}
250
251void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700252Consumer::OnNack(shared_ptr<const Interest> interest)
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800253{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800254 if (!m_active)
255 return;
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800256
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800257 App::OnNack(interest); // tracing inside
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800258
Alexander Afanasyeve1b2a2d2012-11-16 11:53:42 -0800259 // NS_LOG_DEBUG ("Nack type: " << interest->GetNack ());
Alexander Afanasyev120bf312011-12-19 01:24:47 -0800260
Alexander Afanasyeve1b2a2d2012-11-16 11:53:42 -0800261 // NS_LOG_FUNCTION (interest->GetName ());
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800262
263 // NS_LOG_INFO ("Received NACK: " << boost::cref(*interest));
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800264 uint32_t seq = interest->GetName().get(-1).toSeqNum();
265 NS_LOG_INFO("< NACK for " << seq);
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800266 // std::cout << Simulator::Now ().ToDouble (Time::S) << "s -> " << "NACK for " << seq << "\n";
Alexander Afanasyev781ea812011-12-15 22:42:09 -0800267
268 // put in the queue of interests to be retransmitted
Alexander Afanasyeve1b2a2d2012-11-16 11:53:42 -0800269 // NS_LOG_INFO ("Before: " << m_retxSeqs.size ());
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800270 m_retxSeqs.insert(seq);
Alexander Afanasyeve1b2a2d2012-11-16 11:53:42 -0800271 // NS_LOG_INFO ("After: " << m_retxSeqs.size ());
Alexander Afanasyev3183b5a2011-12-23 20:48:20 -0800272
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800273 m_seqTimeouts.erase(seq);
Alexander Afanasyev3a3ce1a2013-01-31 11:26:11 -0800274
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800275 m_rtt->IncreaseMultiplier(); // Double the next RTO ??
276 ScheduleNextPacket();
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -0700277}
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -0700278
Alexander Afanasyev359bfb72012-01-09 18:42:50 -0800279void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800280Consumer::OnTimeout(uint32_t sequenceNumber)
Alexander Afanasyev359bfb72012-01-09 18:42:50 -0800281{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800282 NS_LOG_FUNCTION(sequenceNumber);
283 // std::cout << Simulator::Now () << ", TO: " << sequenceNumber << ", current RTO: " <<
284 // m_rtt->RetransmitTimeout ().ToDouble (Time::S) << "s\n";
Alexander Afanasyevb7ad2322012-01-17 22:54:49 -0800285
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800286 m_rtt->IncreaseMultiplier(); // Double the next RTO
287 m_rtt->SentSeq(SequenceNumber32(sequenceNumber),
288 1); // make sure to disable RTT calculation for this sample
289 m_retxSeqs.insert(sequenceNumber);
290 ScheduleNextPacket();
Alexander Afanasyev359bfb72012-01-09 18:42:50 -0800291}
292
Alexander Afanasyev79b2fb32013-04-12 11:24:55 -0700293void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800294Consumer::WillSendOutInterest(uint32_t sequenceNumber)
Alexander Afanasyev79b2fb32013-04-12 11:24:55 -0700295{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800296 NS_LOG_DEBUG("Trying to add " << sequenceNumber << " with " << Simulator::Now() << ". already "
297 << m_seqTimeouts.size() << " items");
Alexander Afanasyev79b2fb32013-04-12 11:24:55 -0700298
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800299 m_seqTimeouts.insert(SeqTimeout(sequenceNumber, Simulator::Now()));
300 m_seqFullDelay.insert(SeqTimeout(sequenceNumber, Simulator::Now()));
Alexander Afanasyev79b2fb32013-04-12 11:24:55 -0700301
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800302 m_seqLastDelay.erase(sequenceNumber);
303 m_seqLastDelay.insert(SeqTimeout(sequenceNumber, Simulator::Now()));
Alexander Afanasyev79b2fb32013-04-12 11:24:55 -0700304
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800305 m_seqRetxCounts[sequenceNumber]++;
Alexander Afanasyev79b2fb32013-04-12 11:24:55 -0700306
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800307 m_rtt->SentSeq(SequenceNumber32(sequenceNumber), 1);
Alexander Afanasyev79b2fb32013-04-12 11:24:55 -0700308}
309
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700310} // namespace ndn
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -0800311} // namespace ns3