A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
lte-rlc-um.h
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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: Manuel Requena <manuel.requena@cttc.es>
19  */
20 
21 #ifndef LTE_RLC_UM_H
22 #define LTE_RLC_UM_H
23 
24 #include "ns3/lte-rlc-sequence-number.h"
25 #include "ns3/lte-rlc.h"
26 
27 #include <ns3/event-id.h>
28 #include <map>
29 
30 namespace ns3 {
31 
35 class LteRlcUm : public LteRlc
36 {
37 public:
38  LteRlcUm ();
39  virtual ~LteRlcUm ();
40  static TypeId GetTypeId (void);
41  virtual void DoDispose ();
42 
46  virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
47 
51  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId);
52  virtual void DoNotifyHarqDeliveryFailure ();
53  virtual void DoReceivePdu (Ptr<Packet> p);
54 
55 private:
56  void ExpireReorderingTimer (void);
57  void ExpireRbsTimer (void);
58 
59  bool IsInsideReorderingWindow (SequenceNumber10 seqNumber);
60 
61  void ReassembleOutsideWindow (void);
62  void ReassembleSnInterval (SequenceNumber10 lowSeqNumber, SequenceNumber10 highSeqNumber);
63 
64  void ReassembleAndDeliver (Ptr<Packet> packet);
65 
66  void DoReportBufferStatus ();
67 
68 private:
69  uint32_t m_maxTxBufferSize;
70  uint32_t m_txBufferSize;
71  std::vector < Ptr<Packet> > m_txBuffer; // Transmission buffer
72  std::map <uint16_t, Ptr<Packet> > m_rxBuffer; // Reception buffer
73  std::vector < Ptr<Packet> > m_reasBuffer; // Reassembling buffer
74 
75  std::list < Ptr<Packet> > m_sdusBuffer; // List of SDUs in a packet
76 
81 
82  SequenceNumber10 m_vrUr; // VR(UR)
83  SequenceNumber10 m_vrUx; // VR(UX)
84  SequenceNumber10 m_vrUh; // VR(UH)
85 
89  uint16_t m_windowSize;
90 
95  EventId m_rbsTimer;
96 
100  typedef enum { NONE = 0,
101  WAITING_S0_FULL = 1,
102  WAITING_SI_SF = 2 } ReassemblingState_t;
103  ReassemblingState_t m_reassemblingState;
104  Ptr<Packet> m_keepS0;
105 
110 
111 };
112 
113 
114 } // namespace ns3
115 
116 #endif // LTE_RLC_UM_H
void ReassembleAndDeliver(Ptr< Packet > packet)
Definition: lte-rlc-um.cc:587
virtual void DoTransmitPdcpPdu(Ptr< Packet > p)
Definition: lte-rlc-um.cc:84
SequenceNumber10 m_sequenceNumber
Definition: lte-rlc-um.h:80
SequenceNumber10 m_expectedSeqNumber
Definition: lte-rlc-um.h:109
virtual void DoNotifyTxOpportunity(uint32_t bytes, uint8_t layer, uint8_t harqId)
Definition: lte-rlc-um.cc:126
uint16_t m_windowSize
Definition: lte-rlc-um.h:89
EventId m_reorderingTimer
Definition: lte-rlc-um.h:94
an identifier for simulation events.
Definition: event-id.h:46
virtual void DoDispose()
Definition: lte-rlc-um.cc:70
a unique identifier for an interface.
Definition: type-id.h:44