Loading...
Searching...
No Matches
satellite-generic-stream-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_GENERIC_STREAM_ENCAPSULATOR
22#define SATELLITE_GENERIC_STREAM_ENCAPSULATOR
23
25
26#include "ns3/event-id.h"
27#include "ns3/mac48-address.h"
28
29#include <map>
30#include <stdint.h>
31
32namespace ns3
33{
34
49{
50 public:
55
66 SatGenericStreamEncapsulator(Mac48Address encapAddress,
67 Mac48Address decapAddress,
68 Mac48Address sourceE2EAddress,
69 Mac48Address destE2EAddress,
70 uint8_t flowId,
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
120 virtual uint32_t GetMinTxOpportunityInBytes() const;
121
122 protected:
129 Ptr<Packet> GetNewGsePdu(uint32_t txOpportunityBytes,
130 uint32_t maxGsePduSize,
131 uint32_t additionalHeaderSize = 0);
132
137 void IncreaseFragmentId();
138
143 virtual void ProcessPdu(Ptr<Packet> p);
144
148 void Reset();
149
154
163
168
173
178
184
189 static const uint32_t MAX_FRAGMENT_ID = 256;
190
195 static const uint32_t MAX_HL_PACKET_SIZE = 65536;
196};
197
198} // namespace ns3
199
200#endif // SATELLITE_GENERIC_STREAM_ENCAPSULATOR
SatBaseEncapsulator()
Default constructor not used.
uint32_t m_txFragmentId
Fragment id used in the packet transmissions.
static const uint32_t MAX_FRAGMENT_ID
The fragment is described with 8 bits, thus the maximum fragment id is 256.
uint32_t m_currRxPacketFragmentBytes
Currently received bytes of the fragmented packet.
virtual void DoDispose()
Dispose of this class instance.
virtual void EnquePdu(Ptr< Packet > p, Mac48Address dest)
Enqueue a Higher Layer packet to txBuffer.
SatGenericStreamEncapsulator()
Default constructor, not used.
static const uint32_t MAX_HL_PACKET_SIZE
The maximum packet size is described with 16 bits, thus, the maximum HL packet size is 65536 bytes.
uint32_t m_currRxFragmentId
Current fragment id in the reassembly process.
Ptr< Packet > GetNewGsePdu(uint32_t txOpportunityBytes, uint32_t maxGsePduSize, uint32_t additionalHeaderSize=0)
Get new packet performs the GSE fragmentation and encapsulation for a one single packet.
uint32_t m_currRxPacketSize
The total size of the ALPDU size reassembly process.
virtual ~SatGenericStreamEncapsulator()
Destructor for SatGenericStreamEncapsulator.
virtual Ptr< Packet > NotifyTxOpportunity(uint32_t bytes, uint32_t &bytesLeft, uint32_t &nextMinTxO)
Notify a Tx opportunity to this encapsulator.
virtual void ReceivePdu(Ptr< Packet > p)
Receive a packet, thus decapsulate and defragment/deconcatenate if needed.
virtual void ProcessPdu(Ptr< Packet > p)
Process the reception of individual GSE PDUs.
Ptr< Packet > m_currRxPacketFragment
Current packet in the reassembly process.
void IncreaseFragmentId()
Method increases the fragment id by one.
uint32_t m_minGseTxOpportunity
If the GSE opportunity is smaller than this, a NULL packet is returned.
virtual uint32_t GetMinTxOpportunityInBytes() const
Get minimum Tx opportunity in bytes, which takes the assumed header sizes into account.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.