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 #include <stdint.h>
32 
33 namespace ns3
34 {
35 
50 {
51  public:
56 
67  SatReturnLinkEncapsulator(Mac48Address encapAddress,
68  Mac48Address decapAddress,
69  Mac48Address sourceE2EAddress,
70  Mac48Address destE2EAddress,
71  uint8_t rcIndex,
72  uint32_t additionalHeaderSize = 0);
73 
78 
83  static TypeId GetTypeId(void);
84 
88  virtual void DoDispose();
89 
95  virtual void EnquePdu(Ptr<Packet> p, Mac48Address dest);
96 
104  virtual Ptr<Packet> NotifyTxOpportunity(uint32_t bytes,
105  uint32_t& bytesLeft,
106  uint32_t& nextMinTxO);
107 
114  virtual void ReceivePdu(Ptr<Packet> p);
115 
120  virtual void ReceiveAck(Ptr<SatArqAckMessage> ack);
121 
127  virtual uint32_t GetMinTxOpportunityInBytes() const;
128 
129  protected:
136  Ptr<Packet> GetNewRlePdu(uint32_t txOpportunityBytes,
137  uint32_t maxRlePduSize,
138  uint32_t additionalHeaderSize = 0);
139 
144  virtual void ProcessPdu(Ptr<Packet> p);
145 
150  void IncreaseFragmentId();
151 
155  void Reset();
156 
160  uint32_t m_txFragmentId;
165 
170 
175 
180 
185 
190  const uint32_t MAX_FRAGMENT_ID;
191 
196  const uint32_t MAX_PPDU_PACKET_SIZE;
197 
202  const uint32_t MAX_HL_PDU_PACKET_SIZE;
203 };
204 
205 } // namespace ns3
206 
207 #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.