A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-rlc-am.h
Go to the documentation of this file.
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_AM_H
22 #define LTE_RLC_AM_H
23 
24 #include "ns3/lte-rlc-sequence-number.h"
25 
26 #include "ns3/lte-rlc.h"
27 
28 #include <vector>
29 #include <map>
30 
31 namespace ns3 {
32 
36 class LteRlcAm : public LteRlc
37 {
38 public:
39  LteRlcAm ();
40  virtual ~LteRlcAm ();
41  static TypeId GetTypeId (void);
42 
46  virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
47 
51  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer);
52  virtual void DoNotifyHarqDeliveryFailure ();
53  virtual void DoReceivePdu (Ptr<Packet> p);
54 
55  void Start ();
56 
57 private:
63  void ExpireReorderingTimer (void);
64  void ExpirePollRetransmitTimer (void);
65 
67 //
68 // void ReassembleOutsideWindow (void);
69 // void ReassembleSnLessThan (uint16_t seqNumber);
70 //
71  void ReassembleAndDeliver (Ptr<Packet> packet);
72 
73 private:
74  std::vector < Ptr<Packet> > m_txonBuffer; // Transmission buffer
75  std::vector < Ptr<Packet> > m_txedBuffer; // Transmitted packets buffer
76 
77  struct RetxBuffer
78  {
80  uint16_t m_retxCount;
81  };
82 
83  std::vector < RetxBuffer > m_retxBuffer; // Retransmission buffer
84 
85  uint32_t m_txonBufferSize;
86  uint32_t m_retxBufferSize;
87  uint32_t m_txedBufferSize;
88 
91 
92  struct PduBuffer
93  {
95  std::list < Ptr<Packet> > m_byteSegments;
96 
98  uint16_t m_totalSize;
99  uint16_t m_currSize;
100  };
101 
102  std::map <uint16_t, PduBuffer > m_rxonBuffer; // Reception buffer
103 
104  Ptr<Packet> m_controlPduBuffer; // Control PDU buffer (just one PDU)
105 
106  // SDU reassembly
107 // std::vector < Ptr<Packet> > m_reasBuffer; // Reassembling buffer
108 //
109  std::list < Ptr<Packet> > m_sdusBuffer; // List of SDUs in a packet (PDU)
110 
114  // Transmitting side
119 
120  // Receiving side
126 
132 
136  uint16_t m_windowSize;
137 
144 
148  uint16_t m_maxRetxThreshold; // TODO How these parameters are configured???
149  uint16_t m_pollPdu;
150  uint16_t m_pollByte;
151 
155  typedef enum { NONE = 0,
160 
165 
166 };
167 
168 
169 } // namespace ns3
170 
171 #endif // LTE_RLC_AM_H