A class to count the number of lost packets. More...
#include "packet-loss-counter.h"
Public Member Functions | |
| PacketLossCounter (uint8_t bitmapSize) | |
| Constructor.  More... | |
| ~PacketLossCounter () | |
| uint16_t | GetBitMapSize (void) const | 
| Return the size of the window used to compute the packet loss.  More... | |
| uint32_t | GetLost (void) const | 
| Get the number of lost packets.  More... | |
| void | NotifyReceived (uint32_t seq) | 
| Record a successfully received packet.  More... | |
| void | SetBitMapSize (uint16_t size) | 
| Set the size of the window used to compute the packet loss.  More... | |
Private Member Functions | |
| bool | GetBit (uint32_t seqNum) | 
| Check if a sequence number in the window has been received.  More... | |
| void | SetBit (uint32_t seqNum, bool val) | 
| Set a sequence number to a given state.  More... | |
Private Attributes | |
| uint16_t | m_bitMapSize | 
| Window size.  More... | |
| uint32_t | m_lastMaxSeqNum | 
| Last sequence number seen.  More... | |
| uint32_t | m_lost | 
| Lost packets counter.  More... | |
| uint8_t * | m_receiveBitMap | 
| Received packets in the window size.  More... | |
A class to count the number of lost packets.
This class records the packet lost in a client/server transmission leveraging a sequence number. All the packets outside a given window (i.e., too old wit respect to the last sequence number seen) are considered lost,
Definition at line 45 of file packet-loss-counter.h.
| ns3::PacketLossCounter::PacketLossCounter | ( | uint8_t | bitmapSize | ) | 
Constructor.
| bitmapSize | The window size. Must be a multiple of 8. | 
Definition at line 31 of file packet-loss-counter.cc.
References NS_LOG_FUNCTION, and SetBitMapSize().
 Here is the call graph for this function:| ns3::PacketLossCounter::~PacketLossCounter | ( | ) | 
Definition at line 41 of file packet-loss-counter.cc.
References m_receiveBitMap, and NS_LOG_FUNCTION.
      
  | 
  private | 
Check if a sequence number in the window has been received.
| seqNum | the sequence number. | 
Definition at line 77 of file packet-loss-counter.cc.
References m_bitMapSize, m_receiveBitMap, and NS_LOG_FUNCTION.
Referenced by NotifyReceived().
 Here is the caller graph for this function:| uint16_t ns3::PacketLossCounter::GetBitMapSize | ( | void | ) | const | 
Return the size of the window used to compute the packet loss.
Definition at line 48 of file packet-loss-counter.cc.
References m_bitMapSize, and NS_LOG_FUNCTION.
Referenced by ns3::UdpServer::GetPacketWindowSize().
 Here is the caller graph for this function:| uint32_t ns3::PacketLossCounter::GetLost | ( | void | ) | const | 
Get the number of lost packets.
Definition at line 70 of file packet-loss-counter.cc.
References m_lost, and NS_LOG_FUNCTION.
Referenced by PacketLossCounterTestCase::DoRun(), and ns3::UdpServer::GetLost().
 Here is the caller graph for this function:| void ns3::PacketLossCounter::NotifyReceived | ( | uint32_t | seq | ) | 
Record a successfully received packet.
| seq | the packet sequence number | 
Definition at line 110 of file packet-loss-counter.cc.
References GetBit(), m_bitMapSize, m_lastMaxSeqNum, m_lost, NS_LOG_FUNCTION, NS_LOG_INFO, and SetBit().
Referenced by PacketLossCounterTestCase::DoRun(), and ns3::UdpServer::HandleRead().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  private | 
Set a sequence number to a given state.
| seqNum | the sequence number. | 
| val | false if the packet has not been received. | 
Definition at line 84 of file packet-loss-counter.cc.
References m_bitMapSize, m_receiveBitMap, and NS_LOG_FUNCTION.
Referenced by NotifyReceived().
 Here is the caller graph for this function:| void ns3::PacketLossCounter::SetBitMapSize | ( | uint16_t | size | ) | 
Set the size of the window used to compute the packet loss.
| size | The window size. Must be a multiple of 8. | 
Definition at line 55 of file packet-loss-counter.cc.
References m_bitMapSize, m_receiveBitMap, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by PacketLossCounter(), and ns3::UdpServer::SetPacketWindowSize().
 Here is the caller graph for this function:
      
  | 
  private | 
Window size.
Definition at line 90 of file packet-loss-counter.h.
Referenced by GetBit(), GetBitMapSize(), NotifyReceived(), SetBit(), and SetBitMapSize().
      
  | 
  private | 
Last sequence number seen.
Definition at line 91 of file packet-loss-counter.h.
Referenced by NotifyReceived().
      
  | 
  private | 
Lost packets counter.
Definition at line 89 of file packet-loss-counter.h.
Referenced by GetLost(), and NotifyReceived().
      
  | 
  private | 
Received packets in the window size.
Definition at line 92 of file packet-loss-counter.h.
Referenced by GetBit(), SetBit(), SetBitMapSize(), and ~PacketLossCounter().