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/event-id.h>
25 #include <ns3/lte-rlc-sequence-number.h>
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  virtual void DoDispose ();
43 
47  virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
48 
52  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId);
53  virtual void DoNotifyHarqDeliveryFailure ();
54  virtual void DoReceivePdu (Ptr<Packet> p);
55 
56 private:
62  void ExpireReorderingTimer (void);
63  void ExpirePollRetransmitTimer (void);
64 
66 //
67 // void ReassembleOutsideWindow (void);
68 // void ReassembleSnLessThan (uint16_t seqNumber);
69 //
70  void ReassembleAndDeliver (Ptr<Packet> packet);
71 
72  void DoReportBufferStatus ();
73 
74 private:
75  std::vector < Ptr<Packet> > m_txonBuffer; // Transmission buffer
76  std::vector < Ptr<Packet> > m_txedBuffer; // Transmitted packets buffer
77 
78  struct RetxBuffer
79  {
81  uint16_t m_retxCount;
82  };
83 
84  std::vector < RetxBuffer > m_retxBuffer; // Retransmission buffer
85 
86  uint32_t m_txonBufferSize;
87  uint32_t m_retxBufferSize;
88  uint32_t m_txedBufferSize;
89 
92 
93  struct PduBuffer
94  {
96  std::list < Ptr<Packet> > m_byteSegments;
97 
99  uint16_t m_totalSize;
100  uint16_t m_currSize;
101  };
102 
103  std::map <uint16_t, PduBuffer > m_rxonBuffer; // Reception buffer
104 
105  Ptr<Packet> m_controlPduBuffer; // Control PDU buffer (just one PDU)
106 
107  // SDU reassembly
108 // std::vector < Ptr<Packet> > m_reasBuffer; // Reassembling buffer
109 //
110  std::list < Ptr<Packet> > m_sdusBuffer; // List of SDUs in a packet (PDU)
111 
115  // Transmitting side
120 
121  // Receiving side
127 
133 
137  uint16_t m_windowSize;
138 
146 
150  uint16_t m_maxRetxThreshold; // TODO How these parameters are configured???
151  uint16_t m_pollPdu;
152  uint16_t m_pollByte;
153 
157  typedef enum { NONE = 0,
162 
167 
168 };
169 
170 
171 } // namespace ns3
172 
173 #endif // LTE_RLC_AM_H