23 #ifndef SATELLITE_CONTROL_MESSAGE_H
24 #define SATELLITE_CONTROL_MESSAGE_H
30 #include <ns3/header.h>
31 #include <ns3/mac48-address.h>
32 #include <ns3/nstime.h>
33 #include <ns3/object.h>
34 #include <ns3/simulator.h>
102 virtual void SetMsgId(uint32_t msgId);
131 virtual void Serialize(TagBuffer i)
const;
143 virtual void Print(std::ostream& os)
const;
345 void SetDaTimeslot(Mac48Address utId, uint8_t frameId, Ptr<SatTimeSlotConf> conf);
361 void SetRaChannel(uint32_t raChannel, uint8_t frameId, uint16_t timeSlotCount);
1424 uint32_t
Send(uint32_t sendId);
1432 Ptr<SatControlMessage>
Read(uint32_t recvId);
The packet for the Automatic Repeat reQuest (ARQ) acknowledgment (ACK) messages.
uint8_t GetFlowId() const
Get the sequence number to be ACK'ed.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
virtual uint32_t GetSizeInBytes() const
Get real size of the ACK message, which can be used to e.g.
void SetSequenceNumber(uint8_t sn)
Set the sequence number to be ACK'ed.
void SetFlowId(uint8_t sn)
Set the flow id to be ACK'ed.
static TypeId GetTypeId(void)
methods derived from base classes
uint8_t GetSequenceNumber() const
Get the sequence number to be ACK'ed.
SatArqAckMessage()
Constructor for SatArqAckMessage.
~SatArqAckMessage()
Destructor for SatArqAckMessage.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
This control message is used to give time, power and frequency correction to UTs.
int16_t GetFrequencyCorrection() const
Get the frequency correction.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
SatCmtMessage()
Constructor for SatCmtMessage.
uint8_t GetGroupId() const
Get the group ID.
uint8_t m_burstTimeScaling
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
void SetPowerCorrection(uint8_t powerCorrection)
Set the power correction.
~SatCmtMessage()
Destructor for SatCmtMessage.
void SetGroupId(uint8_t groupId)
Set the group ID.
void SetLogonId(uint8_t logonId)
Set the logon ID.
int16_t m_frequencyCorrection
static TypeId GetTypeId(void)
methods derived from base classes
uint8_t GetLogonId() const
Get the logon ID.
virtual uint32_t GetSizeInBytes() const
Get real size of the message.
uint8_t m_powerCorrection
int8_t m_burstTimeCorrection
void SetBurstTimeCorrection(int32_t burstTimeCorrection)
Set the burst time correction.
void SetFrequencyCorrection(int16_t frequencyCorrection)
Set the frequency correction.
uint8_t GetPowerCorrection() const
Get the powercorrection.
int16_t GetBurstTimeCorrection() const
Get the burst time correction.
C/N0 (CNI) estimation report message.
void SetCnoEstimate(double cno)
Set C/N0 estimate.
double GetCnoEstimate() const
Get C/N0 estimate.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
virtual uint32_t GetSizeInBytes() const
Get real size of the CR message, which can be used to e.g.
SatCnoReportMessage()
Constructor for SatCnoReportMessage.
double m_linkCNo
C/N0 estimate.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
~SatCnoReportMessage()
Destructor for SatCnoReportMessage.
static TypeId GetTypeId(void)
methods derived from base classes
Abstract satellite control message class.
virtual uint32_t GetSizeInBytes() const =0
Get real size of the control message.
static TypeId GetTypeId(void)
methods derived from base classes
SatControlMessage()
Default constructor for SatControlMessage.
virtual SatControlMsgTag::SatControlMsgType_t GetMsgType() const =0
Get message specific type.
~SatControlMessage()
Destructor.
The container to store control messages.
Ptr< SatControlMessage > Read(uint32_t recvId)
Read a control message.
std::map< uint32_t, Ptr< SatControlMessage > > ReservedCtrlMsgMap_t
std::map< uint32_t, CtrlMsgMapValue_t > CtrlMsgMap_t
bool m_deleteOnRead
Flag to tell, if message is deleted from container when read (get).
uint32_t Send(uint32_t sendId)
Add a control message.
void CleanUpIdMap(uint32_t recvId)
Do clean up for the Ctrl msg id map.
uint32_t ReserveIdAndStore(Ptr< SatControlMessage > controlMsg)
Reserve an id and store a control message.
~SatControlMsgContainer()
Destructor for SatControlMsgContainer.
std::pair< Time, Ptr< SatControlMessage > > CtrlMsgMapValue_t
std::map< uint32_t, uint32_t > CtrlIdMap_t
SatControlMsgContainer()
Default constructor for SatControlMsgContainer.
Time m_storeTime
Time to store a message in container.
ReservedCtrlMsgMap_t m_reservedCtrlMsgs
void EraseFirst()
Erase first item from container.
This class implements a tag that is used to identify control messages (packages).
~SatControlMsgTag()
Destructor for SatControlMsgTag.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of methods.
virtual uint32_t GetSerializedSize(void) const
Get serialized size of methods.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of methods.
static TypeId GetTypeId(void)
methods derived from base classes
SatControlMsgType_t
Definition for different types of control messages.
@ SAT_CR_CTRL_MSG
SAT_CR_CTRL_MSG.
@ SAT_ARQ_ACK
SAT_ARQ_ACK.
@ SAT_LOGON_RESPONSE_CTRL_MSG
SAT_LOGON_RESPONSE_CTRL_MSG.
@ SAT_SLICE_CTRL_MSG
SAT_SLICE_CTRL_MSG.
@ SAT_TIMU_CTRL_MSG
SAT_TIMU_CTRL_MSG.
@ SAT_HR_CTRL_MSG
SAT_HR_CTRL_MSG.
@ SAT_LOGOFF_CTRL_MSG
SAT_LOGOFF CTRL_MSG.
@ SAT_CN0_REPORT
SAT_CN0_REPORT.
@ SAT_NON_CTRL_MSG
SAT_NON_CTRL_MSG.
@ SAT_LOGON_CTRL_MSG
SAT_LOGON_CTRL_MSG.
@ SAT_CMT_CTRL_MSG
SAT_CMT_CTRL_MSG.
@ SAT_TBTP_CTRL_MSG
SAT_TBTP_CTRL_MSG.
@ SAT_NCR_CTRL_MSG
SAT_NCR_CTRL_MSG.
@ SAT_RA_CTRL_MSG
SAT_RA_CTRL_MSG.
virtual uint32_t GetMsgId() const
Get message type specific identifier.
void SetMsgType(SatControlMsgType_t type)
Set type of the control message.
SatControlMsgType_t GetMsgType(void) const
Get type of the control message.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
virtual void SetMsgId(uint32_t msgId)
Set message type specific identifier.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of methods.
SatControlMsgTag()
Constructor for SatControlMsgTag.
SatControlMsgType_t m_msgType
The packet for the Capacity Request (CR) messages.
static TypeId GetTypeId(void)
methods derived from base classes
virtual uint32_t GetSizeInBytes() const
Get real size of the CR message, which can be used to e.g.
RequestContainer_t m_requestData
std::map< RequestDescriptor_t, uint16_t > RequestContainer_t
Define type RequestContainer_t.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
SatCrMessage()
Constructor for SatCrMessage.
static const uint32_t CONTROL_MSG_COMMON_HEADER_SIZE_IN_BYTES
RCST_status + power headroom = 1 Byte CNI = 1 Byte Least margin transmission mode request = 1 Byte.
uint32_t GetNumCapacityRequestElements() const
The number of capacity request elements.
static const uint32_t CONTROL_MSG_TYPE_VALUE_SIZE_IN_BYTES
Type field of the CR control element.
void SetCnoEstimate(double cno)
Set C/N0 estimate.
const RequestContainer_t GetCapacityRequestContent() const
Get the capacity request content.
std::pair< uint8_t, SatEnums::SatCapacityAllocationCategory_t > RequestDescriptor_t
Define type RequestDescriptor_t.
~SatCrMessage()
Destructor for SatCrMessage.
void AddControlElement(uint8_t rcIndex, SatEnums::SatCapacityAllocationCategory_t cac, uint32_t value)
Add a control element to capacity request.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
bool IsNotEmpty() const
Has the CR non-zero content.
SatCrBlockSize_t m_crBlockSizeType
Control element size is defined by attribute.
double GetCnoEstimate() const
Get C/N0 estimate.
double m_forwardLinkCNo
C/N0 estimate.
SatCapacityAllocationCategory_t
Definition for different types of Capacity Request (CR) messages.
Handover recommendation control message (Tagged by SatControlMsgTag with type value SAT_HR_CTRL_MSG)
~SatHandoverRecommendationMessage()
Destructor for SatRaMessage.
uint32_t m_satId
Recommended sat ID.
uint32_t m_beamId
Recommended beam ID.
uint32_t GetRecommendedBeamId() const
Get the recommended beam ID.
uint32_t GetRecommendedSatId() const
Get the recommended sat ID.
void SetRecommendedBeamId(uint32_t beamId)
Set recommended beam ID.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
void SetRecommendedSatId(uint32_t beamId)
Set recommended sat ID.
virtual uint32_t GetSizeInBytes() const
Get real size of the random access message, which can be used to e.g.
SatHandoverRecommendationMessage()
Constructor for SatRaMessage.
static TypeId GetTypeId(void)
methods derived from base classes
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
This control message is used to inform the UT that it has been deconnected by GW (Tagged by SatContro...
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
SatLogoffMessage()
Constructor for SatLogoffMessage.
virtual uint32_t GetSizeInBytes() const
Get real size of the message.
~SatLogoffMessage()
Destructor for SatLogoffMessage.
static TypeId GetTypeId(void)
methods derived from base classes
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
This control message is used to inform the GW that a UT wants to connect (Tagged by SatControlMsgTag ...
~SatLogonMessage()
Destructor for SatLogonMessage.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
static TypeId GetTypeId(void)
methods derived from base classes
SatLogonMessage()
Constructor for SatLogonMessage.
virtual uint32_t GetSizeInBytes() const
Get real size of the message.
This control message is used to inform the UT of a connection success (Tagged by SatControlMsgTag wit...
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
uint32_t GetRaChannel() const
Get the RA channel to talk into.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
void SetRaChannel(uint32_t raChannel)
Set the RA channel to talk into.
~SatLogonResponseMessage()
Destructor for SatLogonResponseMessage.
static TypeId GetTypeId(void)
methods derived from base classes
virtual uint32_t GetSizeInBytes() const
Get real size of the message.
SatLogonResponseMessage()
Constructor for SatLogonResponseMessage.
This control message is used to broadcast NCR date to UTs.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
void SetNcrDate(uint64_t ncr)
Set the NCR date (ticks 27MHz).
uint16_t m_ncrDateExtension
~SatNcrMessage()
Destructor for SatNcrMessage.
virtual uint32_t GetSizeInBytes() const
Get real size of the message.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
SatNcrMessage()
Constructor for SatNcrMessage.
static TypeId GetTypeId(void)
methods derived from base classes
uint64_t GetNcrDate() const
Get the NCR date (ticks 27MHz).
Random access load control message (Tagged by SatControlMsgTag with type value SAT_RA_CTRL_MSG)
uint8_t GetAllocationChannelId() const
Get allocation chanel ID.
void SetBackoffProbability(uint16_t backoffProbability)
Set backoff probability.
uint16_t m_backoffProbability
Backoff probability.
static TypeId GetTypeId(void)
methods derived from base classes
SatRaMessage()
Constructor for SatRaMessage.
uint16_t GetBackoffProbability() const
Get backoff probability.
void SetAllocationChannelId(uint8_t allocationChannel)
Set allocation channel ID.
uint16_t GetBackoffTime() const
Get backoff time.
uint8_t m_allocationChannelId
Allocation channel ID.
static const uint32_t RA_CONTROL_MSG_HEADER_SIZE_IN_BYTES
Common header of the random access element.
virtual uint32_t GetSizeInBytes() const
Get real size of the random access message, which can be used to e.g.
void SetBackoffTime(uint16_t backoffTime)
Set backoff time.
uint16_t m_backoffTime
Backoff time.
~SatRaMessage()
Destructor for SatRaMessage.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
This control message is used to inform the UT it has to subscribe to a new slice.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
static TypeId GetTypeId(void)
methods derived from base classes
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
Mac48Address m_address
Address associated to this slice.
uint32_t GetSliceId() const
Get the new slice to subscribe.
void SetAddress(Mac48Address address)
Set the address associated to this slice.
Mac48Address GetAddress() const
Get the ddress associated to this slice.
virtual uint32_t GetSizeInBytes() const
Get real size of the message.
uint8_t m_sliceId
New slice to subscribe.
~SatSliceSubscriptionMessage()
Destructor for SatRaMessage.
SatSliceSubscriptionMessage()
Constructor for SatRaMessage.
void SetSliceId(uint8_t sliceId)
Set the new slice to subscribe.
The packet for the Terminal Burst Time Plan (TBTP) messages.
SatTbtpMessage()
Default constructor for SatTbtpHeader.
std::map< uint8_t, uint16_t > RaChannelMap_t
static const uint32_t m_tbtpFrameBodySizeInBytes
Size of the frame body.
uint32_t m_superframeCounter
~SatTbtpMessage()
Destructor for SatTbtpHeader.
void Dump() const
Dump all the contents of the TBTP.
RaChannelMap_t m_raChannels
void SetRaChannel(uint32_t raChannel, uint8_t frameId, uint16_t timeSlotCount)
Set a RA time slot information.
uint32_t GetFrameInfoSize() const
Get size of frame info size in this TBTP message.
DaTimeSlotMap_t m_daTimeSlots
uint32_t GetSuperframeCounter()
Get counter of the super frame in this TBTP message.
static TypeId GetTypeId(void)
methods derived from base classes
void SetSuperframeCounter(uint32_t counter)
Set counter of the super frame in this TBTP message.
uint8_t m_assignmentFormat
std::vector< Ptr< SatTimeSlotConf > > DaTimeSlotConfContainer_t
Container for time slot configurations in time slot map item DaTimeSlotMapItem_t.
const DaTimeSlotInfoItem_t & GetDaTimeslots(Address utId)
Get the information of the DA time slots.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
std::pair< uint8_t, DaTimeSlotConfContainer_t > DaTimeSlotInfoItem_t
Item for DA time slot information.
std::set< uint8_t > m_frameIds
static const uint32_t m_tbtpBodySizeInBytes
Size of message body without frame info and slot assignment info.
uint8_t GetSuperframeSeqId()
Get sequence id of the super frame in this TBTP message.
uint8_t m_superframeSeqId
uint32_t GetTimeSlotInfoSizeInBytes() const
Get size of the time slot in bytes.
std::map< Address, DaTimeSlotInfoItem_t > DaTimeSlotMap_t
const RaChannelInfoContainer_t GetRaChannels() const
Get the information of the RA channels.
virtual uint32_t GetSizeInBytes() const
Get real size of the TBTP message, which can be used to e.g.
std::set< uint8_t > RaChannelInfoContainer_t
Container for RA channel information.
const DaTimeSlotInfoItem_t m_emptyDaSlotContainer
Empty DA slot container to be returned if there are not DA time slots.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
void SetDaTimeslot(Mac48Address utId, uint8_t frameId, Ptr< SatTimeSlotConf > conf)
Set a DA time slot information.
TIM unicast control message (Tagged by SatControlMsgTag with type value SAT_TIMU_CTRL_MSG)
Address GetSatAddress() const
void SetGwAddress(Address address)
virtual uint32_t GetSizeInBytes() const
Get real size of the random access message, which can be used to e.g.
Address GetGwAddress() const
static TypeId GetTypeId(void)
methods derived from base classes
Address m_satAddress
Satellite mac address of the new gateway.
uint32_t m_beamId
Allocated beam ID.
SatTimuMessage()
Constructor for SatRaMessage.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
void SetAllocatedSatId(uint32_t beamId)
Set allocated sat ID.
void SetAllocatedBeamId(uint32_t beamId)
Set allocated beam ID.
Address m_gwAddress
Mac address of the new gateway.
uint32_t GetAllocatedSatId() const
Get the allocated sat ID.
uint32_t GetAllocatedBeamId() const
Get the allocated beam ID.
uint32_t m_satId
Allocated sat ID.
SatControlMsgTag::SatControlMsgType_t GetMsgType() const
Get type of the message.
void SetSatAddress(Address address)
~SatTimuMessage()
Destructor for SatRaMessage.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.