A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
packet-loss-counter.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007,2008,2009 INRIA, UDCAST
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Amine Ismail <amine.ismail@sophia.inria.fr>
18
* <amine.ismail@udcast.com>
19
*
20
*/
21
22
#ifndef PACKET_LOSS_COUNTER_H
23
#define PACKET_LOSS_COUNTER_H
24
25
#include "ns3/address.h"
26
#include "ns3/application.h"
27
#include "ns3/event-id.h"
28
#include "ns3/ptr.h"
29
30
namespace
ns3
31
{
32
33
class
Socket;
34
class
Packet;
35
45
class
PacketLossCounter
46
{
47
public
:
52
PacketLossCounter
(uint8_t bitmapSize);
53
~PacketLossCounter
();
58
void
NotifyReceived
(uint32_t seq);
63
uint32_t
GetLost
()
const
;
68
uint16_t
GetBitMapSize
()
const
;
74
void
SetBitMapSize
(uint16_t size);
75
76
private
:
82
bool
GetBit
(uint32_t seqNum);
88
void
SetBit
(uint32_t seqNum,
bool
val);
89
90
uint32_t
m_lost
;
91
uint16_t
m_bitMapSize
;
92
uint32_t
m_lastMaxSeqNum
;
93
uint8_t*
m_receiveBitMap
;
94
};
95
}
// namespace ns3
96
97
#endif
/* PACKET_LOSS_COUNTER_H */
ns3::PacketLossCounter
A class to count the number of lost packets.
Definition:
packet-loss-counter.h:46
ns3::PacketLossCounter::SetBit
void SetBit(uint32_t seqNum, bool val)
Set a sequence number to a given state.
Definition:
packet-loss-counter.cc:85
ns3::PacketLossCounter::NotifyReceived
void NotifyReceived(uint32_t seq)
Record a successfully received packet.
Definition:
packet-loss-counter.cc:111
ns3::PacketLossCounter::m_lastMaxSeqNum
uint32_t m_lastMaxSeqNum
Last sequence number seen.
Definition:
packet-loss-counter.h:92
ns3::PacketLossCounter::GetBit
bool GetBit(uint32_t seqNum)
Check if a sequence number in the window has been received.
Definition:
packet-loss-counter.cc:78
ns3::PacketLossCounter::PacketLossCounter
PacketLossCounter(uint8_t bitmapSize)
Constructor.
Definition:
packet-loss-counter.cc:32
ns3::PacketLossCounter::m_lost
uint32_t m_lost
Lost packets counter.
Definition:
packet-loss-counter.h:90
ns3::PacketLossCounter::SetBitMapSize
void SetBitMapSize(uint16_t size)
Set the size of the window used to compute the packet loss.
Definition:
packet-loss-counter.cc:56
ns3::PacketLossCounter::m_receiveBitMap
uint8_t * m_receiveBitMap
Received packets in the window size.
Definition:
packet-loss-counter.h:93
ns3::PacketLossCounter::GetBitMapSize
uint16_t GetBitMapSize() const
Return the size of the window used to compute the packet loss.
Definition:
packet-loss-counter.cc:49
ns3::PacketLossCounter::GetLost
uint32_t GetLost() const
Get the number of lost packets.
Definition:
packet-loss-counter.cc:71
ns3::PacketLossCounter::~PacketLossCounter
~PacketLossCounter()
Definition:
packet-loss-counter.cc:42
ns3::PacketLossCounter::m_bitMapSize
uint16_t m_bitMapSize
Window size.
Definition:
packet-loss-counter.h:91
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
applications
model
packet-loss-counter.h
Generated on Sun Mar 3 2024 17:10:54 for ns-3 by
1.9.1