satellite-time-tag.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_TIME_TAG_H
22 #define SATELLITE_TIME_TAG_H
23 
24 #include <ns3/nstime.h>
25 #include <ns3/tag.h>
26 
27 namespace ns3
28 {
29 
30 /*
31  * There are 4 classes defined here: SatTimeTag, SatPhyTimeTag, SatMacTimeTag,
32  * and SatDevTimeTag. Except of the name difference, they share
33  * exactly the same definitions.
34  */
35 
41 class SatTimeTag : public Tag
42 {
43  public:
48  static TypeId GetTypeId(void);
49 
54  virtual TypeId GetInstanceTypeId(void) const;
55 
59  SatTimeTag();
60 
65  SatTimeTag(Time senderTimestamp);
66 
71  virtual void Serialize(TagBuffer i) const;
72 
77  virtual void Deserialize(TagBuffer i);
78 
83  virtual uint32_t GetSerializedSize() const;
84 
89  virtual void Print(std::ostream& os) const;
90 
95  Time GetSenderTimestamp(void) const;
96 
101  void SetSenderTimestamp(Time senderTimestamp);
102 
103  private:
105 };
106 
112 class SatPhyTimeTag : public Tag
113 {
114  public:
119  static TypeId GetTypeId(void);
120 
125  virtual TypeId GetInstanceTypeId(void) const;
126 
130  SatPhyTimeTag();
131 
136  SatPhyTimeTag(Time senderTimestamp);
137 
142  virtual void Serialize(TagBuffer i) const;
143 
148  virtual void Deserialize(TagBuffer i);
149 
154  virtual uint32_t GetSerializedSize() const;
155 
160  virtual void Print(std::ostream& os) const;
161 
166  Time GetSenderTimestamp(void) const;
167 
172  void SetSenderTimestamp(Time senderTimestamp);
173 
174  private:
176 };
177 
183 class SatPhyLinkTimeTag : public Tag
184 {
185  public:
190  static TypeId GetTypeId(void);
191 
196  virtual TypeId GetInstanceTypeId(void) const;
197 
202 
207  SatPhyLinkTimeTag(Time senderTimestamp);
208 
213  virtual void Serialize(TagBuffer i) const;
214 
219  virtual void Deserialize(TagBuffer i);
220 
225  virtual uint32_t GetSerializedSize() const;
226 
231  virtual void Print(std::ostream& os) const;
232 
237  Time GetSenderLinkTimestamp(void) const;
238 
243  void SetSenderLinkTimestamp(Time senderLinkTimestamp);
244 
245  private:
247 };
248 
254 class SatMacTimeTag : public Tag
255 {
256  public:
261  static TypeId GetTypeId(void);
262 
267  virtual TypeId GetInstanceTypeId(void) const;
268 
272  SatMacTimeTag();
273 
278  SatMacTimeTag(Time senderTimestamp);
279 
284  virtual void Serialize(TagBuffer i) const;
285 
290  virtual void Deserialize(TagBuffer i);
291 
296  virtual uint32_t GetSerializedSize() const;
297 
302  virtual void Print(std::ostream& os) const;
303 
308  Time GetSenderTimestamp(void) const;
309 
314  void SetSenderTimestamp(Time senderTimestamp);
315 
316  private:
318 };
319 
325 class SatMacLinkTimeTag : public Tag
326 {
327  public:
332  static TypeId GetTypeId(void);
333 
338  virtual TypeId GetInstanceTypeId(void) const;
339 
344 
349  SatMacLinkTimeTag(Time senderTimestamp);
350 
355  virtual void Serialize(TagBuffer i) const;
356 
361  virtual void Deserialize(TagBuffer i);
362 
367  virtual uint32_t GetSerializedSize() const;
368 
373  virtual void Print(std::ostream& os) const;
374 
379  Time GetSenderLinkTimestamp(void) const;
380 
385  void SetSenderLinkTimestamp(Time senderLinkTimestamp);
386 
387  private:
389 };
390 
396 class SatDevTimeTag : public Tag
397 {
398  public:
403  static TypeId GetTypeId(void);
404 
409  virtual TypeId GetInstanceTypeId(void) const;
410 
414  SatDevTimeTag();
415 
420  SatDevTimeTag(Time senderTimestamp);
421 
426  virtual void Serialize(TagBuffer i) const;
427 
432  virtual void Deserialize(TagBuffer i);
433 
438  virtual uint32_t GetSerializedSize() const;
439 
444  virtual void Print(std::ostream& os) const;
445 
450  Time GetSenderTimestamp(void) const;
451 
456  void SetSenderTimestamp(Time senderTimestamp);
457 
458  private:
460 };
461 
467 class SatDevLinkTimeTag : public Tag
468 {
469  public:
474  static TypeId GetTypeId(void);
475 
480  virtual TypeId GetInstanceTypeId(void) const;
481 
486 
491  SatDevLinkTimeTag(Time senderTimestamp);
492 
497  virtual void Serialize(TagBuffer i) const;
498 
503  virtual void Deserialize(TagBuffer i);
504 
509  virtual uint32_t GetSerializedSize() const;
510 
515  virtual void Print(std::ostream& os) const;
516 
521  Time GetSenderTimestamp(void) const;
522 
527  void SetSenderTimestamp(Time senderTimestamp);
528 
529  private:
531 };
532 
533 } // namespace ns3
534 
535 #endif /* SATELLITE_TIME_TAG_H */
Time tag used to identify the time when packet is enqueued at device level.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatDevTimeTag.
SatDevTimeTag()
Default constructor.
static TypeId GetTypeId(void)
Get the type ID.
virtual uint32_t GetSerializedSize() const
Get serialized size of SatDevTimeTag.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
void SetSenderTimestamp(Time senderTimestamp)
Set sender time stamp of this tag.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatDevTimeTag.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatDevTimeTag.
Time GetSenderTimestamp(void) const
Get sender time stamp of this tag.
Time tag used to identify the time when packet is enqueued at MAC level.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatMacTimeTag.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatMacTimeTag.
SatMacTimeTag()
Default constructor.
static TypeId GetTypeId(void)
Get the type ID.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
virtual uint32_t GetSerializedSize() const
Get serialized size of SatMacTimeTag.
void SetSenderTimestamp(Time senderTimestamp)
Set sender time stamp of this tag.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatMacTimeTag.
Time GetSenderTimestamp(void) const
Get sender time stamp of this tag.
Time tag used to identify the time when packet is enqueued at PHY on first link between GW and UT lev...
void SetSenderTimestamp(Time senderTimestamp)
Set sender time stamp of this tag.
Time GetSenderTimestamp(void) const
Get sender time stamp of this tag.
SatPhyTimeTag()
Default constructor.
virtual uint32_t GetSerializedSize() const
Get serialized size of SatPhyTimeTag.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatPhyTimeTag.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatPhyTimeTag.
static TypeId GetTypeId(void)
Get the type ID.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatPhyTimeTag.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
Time tag used to identify the time when packet is enqueued at LLC level.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
virtual uint32_t GetSerializedSize() const
Get serialized size of SatTimeTag.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatTimeTag.
Time GetSenderTimestamp(void) const
Get sender time stamp of this tag.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatTimeTag.
static TypeId GetTypeId(void)
Get the type ID.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatTimeTag.
void SetSenderTimestamp(Time senderTimestamp)
Set sender time stamp of this tag.
SatTimeTag()
Default constructor.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.