Loading...
Searching...
No Matches
satellite-fwd-link-scheduler-time-slicing.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: Bastien Tauran <bastien.tauran@viveris.fr>
19 */
20
21#ifndef SAT_FWD_LINK_SCHEDULER_TIME_SLICING_H
22#define SAT_FWD_LINK_SCHEDULER_TIME_SLICING_H
23
25
26#include "ns3/pointer.h"
27
28#include <map>
29#include <stdint.h>
30#include <utility>
31#include <vector>
32
33namespace ns3
34{
35
47
49{
50 public:
55 static TypeId GetTypeId(void);
56
64
72 SatFwdLinkSchedulerTimeSlicing(Ptr<SatBbFrameConf> conf,
73 Mac48Address address,
74 double carrierBandwidthInHz);
75
84 virtual void NotifyConstructionCompleted() override;
85
92
98 virtual std::pair<Ptr<SatBbFrame>, const Time> GetNextFrame();
99
103 virtual void ClearAllPackets();
104
105 private:
109 void DoDispose(void);
110
114 void ScheduleBbFrames();
115
120
127 void GetSchedulingObjects(std::vector<Ptr<SatSchedulingObject>>& output);
128
129 /*
130 * Give the total sending time of all the BBFrames in all the slices.
131 * @return The total duration.
132 */
133 Time GetTotalDuration();
134
135 /*
136 * Send a control packet to the UT to inform which slices to subscribe
137 * @param address The MAC address of the UT
138 * @param slices The slices id the destination must subscribe to.
139 */
140 void SendTimeSliceSubscription(Mac48Address address, std::vector<uint8_t> slices);
141
142 /*
143 * Compute if a new BBFrame can be openned while respecting symbol rate constraints.
144 * @param address The MAC destination address of the BBFrame
145 * @param priorityClass The priority class of the new BBFrame
146 * @param modcod The modcod of the new BBFrame
147 * @return true if a new BBFrame can be openned
148 */
149 bool CanOpenBbFrame(Mac48Address address, uint32_t priorityClass, SatEnums::SatModcod_t modcod);
150
151 /*
152 * Compute the number of symbols to send for a slice, including a new BBFrame to be open
153 * @param sliceId The slice tested.
154 * @param modcod The modcod of the new BBFrame. If is SAT_NONVALID_MODCOD, the new BBFrame is
155 * ignored. \return The total number of symbols for all the BBFrames.
156 */
157 uint32_t GetSymbols(uint8_t sliceId, SatEnums::SatModcod_t modcod);
158
162 std::map<uint8_t, Ptr<SatBbFrameContainer>> m_bbFrameContainers;
163
168 std::map<Mac48Address, uint8_t> m_slicesMapping;
169
173 std::map<uint8_t, uint32_t> m_symbolsSent;
174
179
185
190};
191
192} // namespace ns3
193
194#endif /* SAT_FWD_LINK_SCHEDULER_TIME_SLICING_H */
SatModcod_t
Modulation scheme and coding rate for DVB-S2.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.