Loading...
Searching...
No Matches
satellite-return-link-encapsulator-arq.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_ARQ
22#define SATELLITE_RETURN_LINK_ENCAPSULATOR_ARQ
23
28
29#include "ns3/event-id.h"
30#include "ns3/mac48-address.h"
31
32#include <map>
33#include <stdint.h>
34
35namespace ns3
36{
37
54{
55 public:
60
71 SatReturnLinkEncapsulatorArq(Mac48Address encapAddress,
72 Mac48Address decapAddress,
73 Mac48Address sourceE2EAddress,
74 Mac48Address destE2EAddress,
75 uint8_t rcIndex,
76 uint32_t additionalHeaderSize = 0);
77
86 virtual void NotifyConstructionCompleted() override;
87
92
97 static TypeId GetTypeId(void);
98
102 virtual void DoDispose();
103
111 virtual Ptr<Packet> NotifyTxOpportunity(uint32_t bytes,
112 uint32_t& bytesLeft,
113 uint32_t& nextMinTxO);
114
121 virtual void ReceivePdu(Ptr<Packet> p);
122
127 virtual void ReceiveAck(Ptr<SatArqAckMessage> ack);
128
133 virtual uint32_t GetTxBufferSizeInBytes() const;
134
135 private:
141 void ArqReTxTimerExpired(uint8_t seqNo);
142
147 void CleanUp(uint8_t sequenceNumber);
148
155 uint32_t ConvertSeqNo(uint8_t seqNo) const;
156
161
166 void RxWaitingTimerExpired(uint32_t sn);
167
172 void SendAck(uint8_t seqNo) const;
173
177 Ptr<SatArqSequenceNumber> m_seqNo;
178
182 std::map<uint8_t, Ptr<SatArqBufferContext>> m_txedBuffer; // Transmitted packets buffer
183 std::map<uint8_t, Ptr<SatArqBufferContext>> m_retxBuffer; // Retransmission buffer
186
191
196
202
208
213
218
223
228 std::map<uint32_t, Ptr<SatArqBufferContext>> m_reorderingBuffer;
229};
230
231} // namespace ns3
232
233#endif // SATELLITE_RETURN_LINK_ENCAPSULATOR_ARQ
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.