satellite-return-link-encapsulator.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd.
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: Jani Puttonen <jani.puttonen@magister.fi>
19  */
20 
21 #ifndef SATELLITE_RETURN_LINK_ENCAPSULATOR
22 #define SATELLITE_RETURN_LINK_ENCAPSULATOR
23 
26 
27 #include <ns3/event-id.h>
28 #include <ns3/mac48-address.h>
29 
30 #include <map>
31 
32 namespace ns3
33 {
34 
49 {
50  public:
55 
66  SatReturnLinkEncapsulator(Mac48Address encapAddress,
67  Mac48Address decapAddress,
68  Mac48Address sourceE2EAddress,
69  Mac48Address destE2EAddress,
70  uint8_t rcIndex,
71  uint32_t additionalHeaderSize = 0);
72 
77 
82  static TypeId GetTypeId(void);
83 
87  virtual void DoDispose();
88 
94  virtual void EnquePdu(Ptr<Packet> p, Mac48Address dest);
95 
103  virtual Ptr<Packet> NotifyTxOpportunity(uint32_t bytes,
104  uint32_t& bytesLeft,
105  uint32_t& nextMinTxO);
106 
113  virtual void ReceivePdu(Ptr<Packet> p);
114 
119  virtual void ReceiveAck(Ptr<SatArqAckMessage> ack);
120 
126  virtual uint32_t GetMinTxOpportunityInBytes() const;
127 
128  protected:
135  Ptr<Packet> GetNewRlePdu(uint32_t txOpportunityBytes,
136  uint32_t maxRlePduSize,
137  uint32_t additionalHeaderSize = 0);
138 
143  virtual void ProcessPdu(Ptr<Packet> p);
144 
149  void IncreaseFragmentId();
150 
154  void Reset();
155 
159  uint32_t m_txFragmentId;
164 
169 
174 
179 
184 
189  const uint32_t MAX_FRAGMENT_ID;
190 
195  const uint32_t MAX_PPDU_PACKET_SIZE;
196 
201  const uint32_t MAX_HL_PDU_PACKET_SIZE;
202 };
203 
204 } // namespace ns3
205 
206 #endif // SATELLITE_RETURN_LINK_ENCAPSULATOR
A base encapsulator implementation which does not support encapsulation, fragmentation or packing.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.