Loading...
Searching...
No Matches
satellite-ut-llc.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_UT_LLC_H
22#define SATELLITE_UT_LLC_H
23
24#include "satellite-llc.h"
25#include "satellite-queue.h"
26
27#include "ns3/ptr.h"
28
29#include <stdint.h>
30#include <vector>
31
32namespace ns3
33{
34
35class Packet;
36class Address;
37class Mac48Address;
40class SatNodeInfo;
41
48class SatUtLlc : public SatLlc
49{
50 public:
54 static TypeId GetTypeId(void);
55
59 SatUtLlc();
60
66 virtual ~SatUtLlc();
67
79 virtual Ptr<Packet> NotifyTxOpportunity(uint32_t bytes,
80 Mac48Address utAddr,
81 uint8_t rcIndex,
82 uint32_t& bytesLeft,
83 uint32_t& nextMinTxO);
84
93 virtual bool Enque(Ptr<Packet> packet, Address dest, uint8_t flowId);
94
99 void SetRequestManager(Ptr<SatRequestManager> rm);
100
105 Ptr<SatRequestManager> GetRequestManager() const;
106
112
121 virtual uint32_t GetNumSmallerPackets(uint32_t maxPacketSizeBytes) const;
122
127 virtual void SetNodeInfo(Ptr<SatNodeInfo> nodeInfo);
128
137 virtual uint32_t GetNBytesInQueue(Mac48Address utAddress) const;
138
147 virtual uint32_t GetNPacketsInQueue(Mac48Address utAddress) const;
148
153
158 void SetGwAddress(Mac48Address address);
159
160 protected:
164 void DoDispose();
165
170 virtual void CreateEncap(Ptr<EncapKey> key);
171
177 virtual void CreateEncap(Ptr<EncapKey> key, Ptr<SatQueue> providedQueue);
178
183 virtual void CreateDecap(Ptr<EncapKey> key);
184
191 virtual void GetSchedulingContexts(std::vector<Ptr<SatSchedulingObject>>& output) const;
192
198
204
205 private:
209 Ptr<SatRequestManager> m_requestManager;
210
217};
218
219} // namespace ns3
220
221#endif /* SATELLITE_UT_LLC_H */
SatLinkDir_t
Link direction used for packet tracing.
virtual uint32_t GetNBytesInQueue() const
Get the total number of (new) bytes in all encapsulators.
SatLlc()
Construct a SatLlc.
virtual uint32_t GetNPacketsInQueue() const
Get the total number of (new) packets in all encapsulators.
The SatNodeInfo implements a container for all needed node related information.
Callback< void, SatQueue::QueueEvent_t, uint8_t > QueueEventCallback
Callback to indicate queue related event.
SatRequestManager analyzes periodically or on-a-need-basis UT's buffer status for different RC indice...
SatSchedulingObject is on object which passes the LLC/encapsulator layer related information for MAC ...
void SetQueueStatisticsCallbacks()
Set queue statistics callbacks for each UT packet queue.
virtual void GetSchedulingContexts(std::vector< Ptr< SatSchedulingObject > > &output) const
Create and fill the scheduling objects based on LLC layer information.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
void SetMacQueueEventCallback(SatQueue::QueueEventCallback cb)
SatQueue::QueueEventCallback m_macQueueEventCb
Callback to send queue events to e.g.
Ptr< SatRequestManager > m_requestManager
Request manager handling the capacity requests.
void SetRequestManager(Ptr< SatRequestManager > rm)
Set a request manager for UT's LLC instance.
virtual void CreateDecap(Ptr< EncapKey > key)
Virtual method to create a new decapsulator 'on-a-need-basis' dynamically.
virtual ~SatUtLlc()
Destroy a SatUtLlc.
virtual uint32_t GetNumSmallerPackets(uint32_t maxPacketSizeBytes) const
Method checks how many packets are smaller or equal in size than the maximum packets size threshold s...
SatUtLlc()
Construct a SatUtLlc.
void SetGwAddress(Mac48Address address)
Set the GW address.
virtual void SetNodeInfo(Ptr< SatNodeInfo > nodeInfo)
Set the node info.
virtual void CreateEncap(Ptr< EncapKey > key)
Virtual method to create a new encapsulator 'on-a-need-basis' dynamically.
Ptr< SatRequestManager > GetRequestManager() const
Getter for the request manager.
void DoDispose()
Dispose of SatUtLLc.
static TypeId GetTypeId(void)
Derived form Object.
virtual bool Enque(Ptr< Packet > packet, Address dest, uint8_t flowId)
Called from higher layer (SatNetDevice) to enque packet to LLC.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
virtual Ptr< Packet > NotifyTxOpportunity(uint32_t bytes, Mac48Address utAddr, uint8_t rcIndex, uint32_t &bytesLeft, uint32_t &nextMinTxO)
Called from lower layer (MAC) to inform a Tx opportunity of certain amount of bytes.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.