A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
aodv-packet.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 IITP RAS
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Based on
7
* NS-2 AODV model developed by the CMU/MONARCH group and optimized and
8
* tuned by Samir Das and Mahesh Marina, University of Cincinnati;
9
*
10
* AODV-UU implementation by Erik Nordström of Uppsala University
11
* https://web.archive.org/web/20100527072022/http://core.it.uu.se/core/index.php/AODV-UU
12
*
13
* Authors: Elena Buchatskaia <borovkovaes@iitp.ru>
14
* Pavel Boyko <boyko@iitp.ru>
15
*/
16
#ifndef AODVPACKET_H
17
#define AODVPACKET_H
18
19
#include "ns3/enum.h"
20
#include "ns3/header.h"
21
#include "ns3/ipv4-address.h"
22
#include "ns3/nstime.h"
23
24
#include <iostream>
25
#include <map>
26
27
namespace
ns3
28
{
29
namespace
aodv
30
{
31
32
/**
33
* @ingroup aodv
34
* @brief MessageType enumeration
35
*/
36
enum
MessageType
37
{
38
AODVTYPE_RREQ
= 1,
//!< AODVTYPE_RREQ
39
AODVTYPE_RREP
= 2,
//!< AODVTYPE_RREP
40
AODVTYPE_RERR
= 3,
//!< AODVTYPE_RERR
41
AODVTYPE_RREP_ACK
= 4
//!< AODVTYPE_RREP_ACK
42
};
43
44
/**
45
* @ingroup aodv
46
* @brief AODV types
47
*/
48
class
TypeHeader
:
public
Header
49
{
50
public
:
51
/**
52
* constructor
53
* @param t the AODV RREQ type
54
*/
55
TypeHeader
(
MessageType
t =
AODVTYPE_RREQ
);
56
57
/**
58
* @brief Get the type ID.
59
* @return the object TypeId
60
*/
61
static
TypeId
GetTypeId
();
62
TypeId
GetInstanceTypeId
()
const override
;
63
uint32_t
GetSerializedSize
()
const override
;
64
void
Serialize
(
Buffer::Iterator
start)
const override
;
65
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
66
void
Print
(std::ostream& os)
const override
;
67
68
/**
69
* @returns the type
70
*/
71
MessageType
Get
()
const
72
{
73
return
m_type
;
74
}
75
76
/**
77
* Check that type if valid
78
* @returns true if the type is valid
79
*/
80
bool
IsValid
()
const
81
{
82
return
m_valid
;
83
}
84
85
/**
86
* @brief Comparison operator
87
* @param o header to compare
88
* @return true if the headers are equal
89
*/
90
bool
operator==
(
const
TypeHeader
& o)
const
;
91
92
private
:
93
MessageType
m_type
;
///< type of the message
94
bool
m_valid
;
///< Indicates if the message is valid
95
};
96
97
/**
98
* @brief Stream output operator
99
* @param os output stream
100
* @param h the TypeHeader
101
* @return updated stream
102
*/
103
std::ostream&
operator<<
(std::ostream& os,
const
TypeHeader
& h);
104
105
/**
106
* @ingroup aodv
107
* @brief Route Request (RREQ) Message Format
108
\verbatim
109
0 1 2 3
110
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
111
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
112
| Type |J|R|G|D|U| Reserved | Hop Count |
113
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
114
| RREQ ID |
115
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
116
| Destination IP Address |
117
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
118
| Destination Sequence Number |
119
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
120
| Originator IP Address |
121
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
122
| Originator Sequence Number |
123
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
124
\endverbatim
125
*/
126
class
RreqHeader
:
public
Header
127
{
128
public
:
129
/**
130
* constructor
131
*
132
* @param flags the message flags (0)
133
* @param reserved the reserved bits (0)
134
* @param hopCount the hop count
135
* @param requestID the request ID
136
* @param dst the destination IP address
137
* @param dstSeqNo the destination sequence number
138
* @param origin the origin IP address
139
* @param originSeqNo the origin sequence number
140
*/
141
RreqHeader
(uint8_t flags = 0,
142
uint8_t reserved = 0,
143
uint8_t hopCount = 0,
144
uint32_t
requestID = 0,
145
Ipv4Address
dst =
Ipv4Address
(),
146
uint32_t
dstSeqNo = 0,
147
Ipv4Address
origin =
Ipv4Address
(),
148
uint32_t
originSeqNo = 0);
149
150
/**
151
* @brief Get the type ID.
152
* @return the object TypeId
153
*/
154
static
TypeId
GetTypeId
();
155
TypeId
GetInstanceTypeId
()
const override
;
156
uint32_t
GetSerializedSize
()
const override
;
157
void
Serialize
(
Buffer::Iterator
start)
const override
;
158
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
159
void
Print
(std::ostream& os)
const override
;
160
161
// Fields
162
/**
163
* @brief Set the hop count
164
* @param count the hop count
165
*/
166
void
SetHopCount
(uint8_t count)
167
{
168
m_hopCount
= count;
169
}
170
171
/**
172
* @brief Get the hop count
173
* @return the hop count
174
*/
175
uint8_t
GetHopCount
()
const
176
{
177
return
m_hopCount
;
178
}
179
180
/**
181
* @brief Set the request ID
182
* @param id the request ID
183
*/
184
void
SetId
(
uint32_t
id
)
185
{
186
m_requestID
= id;
187
}
188
189
/**
190
* @brief Get the request ID
191
* @return the request ID
192
*/
193
uint32_t
GetId
()
const
194
{
195
return
m_requestID
;
196
}
197
198
/**
199
* @brief Set the destination address
200
* @param a the destination address
201
*/
202
void
SetDst
(
Ipv4Address
a)
203
{
204
m_dst
= a;
205
}
206
207
/**
208
* @brief Get the destination address
209
* @return the destination address
210
*/
211
Ipv4Address
GetDst
()
const
212
{
213
return
m_dst
;
214
}
215
216
/**
217
* @brief Set the destination sequence number
218
* @param s the destination sequence number
219
*/
220
void
SetDstSeqno
(
uint32_t
s)
221
{
222
m_dstSeqNo
= s;
223
}
224
225
/**
226
* @brief Get the destination sequence number
227
* @return the destination sequence number
228
*/
229
uint32_t
GetDstSeqno
()
const
230
{
231
return
m_dstSeqNo
;
232
}
233
234
/**
235
* @brief Set the origin address
236
* @param a the origin address
237
*/
238
void
SetOrigin
(
Ipv4Address
a)
239
{
240
m_origin
= a;
241
}
242
243
/**
244
* @brief Get the origin address
245
* @return the origin address
246
*/
247
Ipv4Address
GetOrigin
()
const
248
{
249
return
m_origin
;
250
}
251
252
/**
253
* @brief Set the origin sequence number
254
* @param s the origin sequence number
255
*/
256
void
SetOriginSeqno
(
uint32_t
s)
257
{
258
m_originSeqNo
= s;
259
}
260
261
/**
262
* @brief Get the origin sequence number
263
* @return the origin sequence number
264
*/
265
uint32_t
GetOriginSeqno
()
const
266
{
267
return
m_originSeqNo
;
268
}
269
270
// Flags
271
/**
272
* @brief Set the gratuitous RREP flag
273
* @param f the gratuitous RREP flag
274
*/
275
void
SetGratuitousRrep
(
bool
f);
276
/**
277
* @brief Get the gratuitous RREP flag
278
* @return the gratuitous RREP flag
279
*/
280
bool
GetGratuitousRrep
()
const
;
281
/**
282
* @brief Set the Destination only flag
283
* @param f the Destination only flag
284
*/
285
void
SetDestinationOnly
(
bool
f);
286
/**
287
* @brief Get the Destination only flag
288
* @return the Destination only flag
289
*/
290
bool
GetDestinationOnly
()
const
;
291
/**
292
* @brief Set the unknown sequence number flag
293
* @param f the unknown sequence number flag
294
*/
295
void
SetUnknownSeqno
(
bool
f);
296
/**
297
* @brief Get the unknown sequence number flag
298
* @return the unknown sequence number flag
299
*/
300
bool
GetUnknownSeqno
()
const
;
301
302
/**
303
* @brief Comparison operator
304
* @param o RREQ header to compare
305
* @return true if the RREQ headers are equal
306
*/
307
bool
operator==
(
const
RreqHeader
& o)
const
;
308
309
private
:
310
uint8_t
m_flags
;
///< |J|R|G|D|U| bit flags, see RFC
311
uint8_t
m_reserved
;
///< Not used (must be 0)
312
uint8_t
m_hopCount
;
///< Hop Count
313
uint32_t
m_requestID
;
///< RREQ ID
314
Ipv4Address
m_dst
;
///< Destination IP Address
315
uint32_t
m_dstSeqNo
;
///< Destination Sequence Number
316
Ipv4Address
m_origin
;
///< Originator IP Address
317
uint32_t
m_originSeqNo
;
///< Source Sequence Number
318
};
319
320
/**
321
* @brief Stream output operator
322
* @param os output stream
323
* @return updated stream
324
*/
325
std::ostream&
operator<<
(std::ostream& os,
const
RreqHeader
&);
326
327
/**
328
* @ingroup aodv
329
* @brief Route Reply (RREP) Message Format
330
\verbatim
331
0 1 2 3
332
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
333
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
334
| Type |R|A| Reserved |Prefix Sz| Hop Count |
335
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
336
| Destination IP address |
337
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
338
| Destination Sequence Number |
339
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
340
| Originator IP address |
341
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
342
| Lifetime |
343
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
344
\endverbatim
345
*/
346
class
RrepHeader
:
public
Header
347
{
348
public
:
349
/**
350
* constructor
351
*
352
* @param prefixSize the prefix size (0)
353
* @param hopCount the hop count (0)
354
* @param dst the destination IP address
355
* @param dstSeqNo the destination sequence number
356
* @param origin the origin IP address
357
* @param lifetime the lifetime
358
*/
359
RrepHeader
(uint8_t prefixSize = 0,
360
uint8_t hopCount = 0,
361
Ipv4Address
dst =
Ipv4Address
(),
362
uint32_t
dstSeqNo = 0,
363
Ipv4Address
origin =
Ipv4Address
(),
364
Time
lifetime =
MilliSeconds
(0));
365
/**
366
* @brief Get the type ID.
367
* @return the object TypeId
368
*/
369
static
TypeId
GetTypeId
();
370
TypeId
GetInstanceTypeId
()
const override
;
371
uint32_t
GetSerializedSize
()
const override
;
372
void
Serialize
(
Buffer::Iterator
start)
const override
;
373
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
374
void
Print
(std::ostream& os)
const override
;
375
376
// Fields
377
/**
378
* @brief Set the hop count
379
* @param count the hop count
380
*/
381
void
SetHopCount
(uint8_t count)
382
{
383
m_hopCount
= count;
384
}
385
386
/**
387
* @brief Get the hop count
388
* @return the hop count
389
*/
390
uint8_t
GetHopCount
()
const
391
{
392
return
m_hopCount
;
393
}
394
395
/**
396
* @brief Set the destination address
397
* @param a the destination address
398
*/
399
void
SetDst
(
Ipv4Address
a)
400
{
401
m_dst
= a;
402
}
403
404
/**
405
* @brief Get the destination address
406
* @return the destination address
407
*/
408
Ipv4Address
GetDst
()
const
409
{
410
return
m_dst
;
411
}
412
413
/**
414
* @brief Set the destination sequence number
415
* @param s the destination sequence number
416
*/
417
void
SetDstSeqno
(
uint32_t
s)
418
{
419
m_dstSeqNo
= s;
420
}
421
422
/**
423
* @brief Get the destination sequence number
424
* @return the destination sequence number
425
*/
426
uint32_t
GetDstSeqno
()
const
427
{
428
return
m_dstSeqNo
;
429
}
430
431
/**
432
* @brief Set the origin address
433
* @param a the origin address
434
*/
435
void
SetOrigin
(
Ipv4Address
a)
436
{
437
m_origin
= a;
438
}
439
440
/**
441
* @brief Get the origin address
442
* @return the origin address
443
*/
444
Ipv4Address
GetOrigin
()
const
445
{
446
return
m_origin
;
447
}
448
449
/**
450
* @brief Set the lifetime
451
* @param t the lifetime
452
*/
453
void
SetLifeTime
(
Time
t);
454
/**
455
* @brief Get the lifetime
456
* @return the lifetime
457
*/
458
Time
GetLifeTime
()
const
;
459
460
// Flags
461
/**
462
* @brief Set the ack required flag
463
* @param f the ack required flag
464
*/
465
void
SetAckRequired
(
bool
f);
466
/**
467
* @brief get the ack required flag
468
* @return the ack required flag
469
*/
470
bool
GetAckRequired
()
const
;
471
/**
472
* @brief Set the prefix size
473
* @param sz the prefix size
474
*/
475
void
SetPrefixSize
(uint8_t sz);
476
/**
477
* @brief Set the prefix size
478
* @return the prefix size
479
*/
480
uint8_t
GetPrefixSize
()
const
;
481
482
/**
483
* Configure RREP to be a Hello message
484
*
485
* @param src the source IP address
486
* @param srcSeqNo the source sequence number
487
* @param lifetime the lifetime of the message
488
*/
489
void
SetHello
(
Ipv4Address
src,
uint32_t
srcSeqNo,
Time
lifetime);
490
491
/**
492
* @brief Comparison operator
493
* @param o RREP header to compare
494
* @return true if the RREP headers are equal
495
*/
496
bool
operator==
(
const
RrepHeader
& o)
const
;
497
498
private
:
499
uint8_t
m_flags
;
///< A - acknowledgment required flag
500
uint8_t
m_prefixSize
;
///< Prefix Size
501
uint8_t
m_hopCount
;
///< Hop Count
502
Ipv4Address
m_dst
;
///< Destination IP Address
503
uint32_t
m_dstSeqNo
;
///< Destination Sequence Number
504
Ipv4Address
m_origin
;
///< Source IP Address
505
uint32_t
m_lifeTime
;
///< Lifetime (in milliseconds)
506
};
507
508
/**
509
* @brief Stream output operator
510
* @param os output stream
511
* @return updated stream
512
*/
513
std::ostream&
operator<<
(std::ostream& os,
const
RrepHeader
&);
514
515
/**
516
* @ingroup aodv
517
* @brief Route Reply Acknowledgment (RREP-ACK) Message Format
518
\verbatim
519
0 1
520
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
521
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
522
| Type | Reserved |
523
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
524
\endverbatim
525
*/
526
class
RrepAckHeader
:
public
Header
527
{
528
public
:
529
/// constructor
530
RrepAckHeader
();
531
532
/**
533
* @brief Get the type ID.
534
* @return the object TypeId
535
*/
536
static
TypeId
GetTypeId
();
537
TypeId
GetInstanceTypeId
()
const override
;
538
uint32_t
GetSerializedSize
()
const override
;
539
void
Serialize
(
Buffer::Iterator
start)
const override
;
540
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
541
void
Print
(std::ostream& os)
const override
;
542
543
/**
544
* @brief Comparison operator
545
* @param o RREP header to compare
546
* @return true if the RREQ headers are equal
547
*/
548
bool
operator==
(
const
RrepAckHeader
& o)
const
;
549
550
private
:
551
uint8_t
m_reserved
;
///< Not used (must be 0)
552
};
553
554
/**
555
* @brief Stream output operator
556
* @param os output stream
557
* @return updated stream
558
*/
559
std::ostream&
operator<<
(std::ostream& os,
const
RrepAckHeader
&);
560
561
/**
562
* @ingroup aodv
563
* @brief Route Error (RERR) Message Format
564
\verbatim
565
0 1 2 3
566
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
567
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
568
| Type |N| Reserved | DestCount |
569
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
570
| Unreachable Destination IP Address (1) |
571
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
572
| Unreachable Destination Sequence Number (1) |
573
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
574
| Additional Unreachable Destination IP Addresses (if needed) |
575
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
576
|Additional Unreachable Destination Sequence Numbers (if needed)|
577
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
578
\endverbatim
579
*/
580
class
RerrHeader
:
public
Header
581
{
582
public
:
583
/// constructor
584
RerrHeader
();
585
586
/**
587
* @brief Get the type ID.
588
* @return the object TypeId
589
*/
590
static
TypeId
GetTypeId
();
591
TypeId
GetInstanceTypeId
()
const override
;
592
uint32_t
GetSerializedSize
()
const override
;
593
void
Serialize
(
Buffer::Iterator
i)
const override
;
594
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
595
void
Print
(std::ostream& os)
const override
;
596
597
// No delete flag
598
/**
599
* @brief Set the no delete flag
600
* @param f the no delete flag
601
*/
602
void
SetNoDelete
(
bool
f);
603
/**
604
* @brief Get the no delete flag
605
* @return the no delete flag
606
*/
607
bool
GetNoDelete
()
const
;
608
609
/**
610
* @brief Add unreachable node address and its sequence number in RERR header
611
* @param dst unreachable IPv4 address
612
* @param seqNo unreachable sequence number
613
* @return false if we already added maximum possible number of unreachable destinations
614
*/
615
bool
AddUnDestination
(
Ipv4Address
dst,
uint32_t
seqNo);
616
/**
617
* @brief Delete pair (address + sequence number) from REER header, if the number of unreachable
618
* destinations > 0
619
* @param un unreachable pair (address + sequence number)
620
* @return true on success
621
*/
622
bool
RemoveUnDestination
(std::pair<Ipv4Address, uint32_t>& un);
623
/// Clear header
624
void
Clear
();
625
626
/**
627
* @returns number of unreachable destinations in RERR message
628
*/
629
uint8_t
GetDestCount
()
const
630
{
631
return
(uint8_t)
m_unreachableDstSeqNo
.size();
632
}
633
634
/**
635
* @brief Comparison operator
636
* @param o RERR header to compare
637
* @return true if the RERR headers are equal
638
*/
639
bool
operator==
(
const
RerrHeader
& o)
const
;
640
641
private
:
642
uint8_t
m_flag
;
///< No delete flag
643
uint8_t
m_reserved
;
///< Not used (must be 0)
644
645
/// List of Unreachable destination: IP addresses and sequence numbers
646
std::map<Ipv4Address, uint32_t>
m_unreachableDstSeqNo
;
647
};
648
649
/**
650
* @brief Stream output operator
651
* @param os output stream
652
* @return updated stream
653
*/
654
std::ostream&
operator<<
(std::ostream& os,
const
RerrHeader
&);
655
656
}
// namespace aodv
657
}
// namespace ns3
658
659
#endif
/* AODVPACKET_H */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Header
Protocol header serialization and deserialization.
Definition
header.h:33
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition
ipv4-address.h:31
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::aodv::RerrHeader
Route Error (RERR) Message Format.
Definition
aodv-packet.h:581
ns3::aodv::RerrHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
aodv-packet.cc:554
ns3::aodv::RerrHeader::GetDestCount
uint8_t GetDestCount() const
Definition
aodv-packet.h:629
ns3::aodv::RerrHeader::Clear
void Clear()
Clear header.
Definition
aodv-packet.cc:632
ns3::aodv::RerrHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
aodv-packet.cc:519
ns3::aodv::RerrHeader::m_reserved
uint8_t m_reserved
Not used (must be 0)
Definition
aodv-packet.h:643
ns3::aodv::RerrHeader::GetNoDelete
bool GetNoDelete() const
Get the no delete flag.
Definition
aodv-packet.cc:600
ns3::aodv::RerrHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
aodv-packet.cc:535
ns3::aodv::RerrHeader::RerrHeader
RerrHeader()
constructor
Definition
aodv-packet.cc:510
ns3::aodv::RerrHeader::m_flag
uint8_t m_flag
No delete flag.
Definition
aodv-packet.h:642
ns3::aodv::RerrHeader::operator==
bool operator==(const RerrHeader &o) const
Comparison operator.
Definition
aodv-packet.cc:640
ns3::aodv::RerrHeader::Serialize
void Serialize(Buffer::Iterator i) const override
Definition
aodv-packet.cc:541
ns3::aodv::RerrHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
aodv-packet.cc:529
ns3::aodv::RerrHeader::SetNoDelete
void SetNoDelete(bool f)
Set the no delete flag.
Definition
aodv-packet.cc:587
ns3::aodv::RerrHeader::AddUnDestination
bool AddUnDestination(Ipv4Address dst, uint32_t seqNo)
Add unreachable node address and its sequence number in RERR header.
Definition
aodv-packet.cc:606
ns3::aodv::RerrHeader::m_unreachableDstSeqNo
std::map< Ipv4Address, uint32_t > m_unreachableDstSeqNo
List of Unreachable destination: IP addresses and sequence numbers.
Definition
aodv-packet.h:646
ns3::aodv::RerrHeader::Print
void Print(std::ostream &os) const override
Definition
aodv-packet.cc:576
ns3::aodv::RerrHeader::RemoveUnDestination
bool RemoveUnDestination(std::pair< Ipv4Address, uint32_t > &un)
Delete pair (address + sequence number) from REER header, if the number of unreachable destinations >...
Definition
aodv-packet.cc:619
ns3::aodv::RrepAckHeader
Route Reply Acknowledgment (RREP-ACK) Message Format.
Definition
aodv-packet.h:527
ns3::aodv::RrepAckHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
aodv-packet.cc:462
ns3::aodv::RrepAckHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
aodv-packet.cc:474
ns3::aodv::RrepAckHeader::Print
void Print(std::ostream &os) const override
Definition
aodv-packet.cc:490
ns3::aodv::RrepAckHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
aodv-packet.cc:452
ns3::aodv::RrepAckHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
aodv-packet.cc:480
ns3::aodv::RrepAckHeader::operator==
bool operator==(const RrepAckHeader &o) const
Comparison operator.
Definition
aodv-packet.cc:495
ns3::aodv::RrepAckHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
aodv-packet.cc:468
ns3::aodv::RrepAckHeader::RrepAckHeader
RrepAckHeader()
constructor
Definition
aodv-packet.cc:444
ns3::aodv::RrepAckHeader::m_reserved
uint8_t m_reserved
Not used (must be 0)
Definition
aodv-packet.h:551
ns3::aodv::RrepHeader
Route Reply (RREP) Message Format.
Definition
aodv-packet.h:347
ns3::aodv::RrepHeader::GetAckRequired
bool GetAckRequired() const
get the ack required flag
Definition
aodv-packet.cc:396
ns3::aodv::RrepHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
aodv-packet.cc:316
ns3::aodv::RrepHeader::GetPrefixSize
uint8_t GetPrefixSize() const
Set the prefix size.
Definition
aodv-packet.cc:408
ns3::aodv::RrepHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
aodv-packet.cc:340
ns3::aodv::RrepHeader::Print
void Print(std::ostream &os) const override
Definition
aodv-packet.cc:358
ns3::aodv::RrepHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
aodv-packet.cc:328
ns3::aodv::RrepHeader::SetDstSeqno
void SetDstSeqno(uint32_t s)
Set the destination sequence number.
Definition
aodv-packet.h:417
ns3::aodv::RrepHeader::GetOrigin
Ipv4Address GetOrigin() const
Get the origin address.
Definition
aodv-packet.h:444
ns3::aodv::RrepHeader::SetHello
void SetHello(Ipv4Address src, uint32_t srcSeqNo, Time lifetime)
Configure RREP to be a Hello message.
Definition
aodv-packet.cc:422
ns3::aodv::RrepHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
aodv-packet.cc:306
ns3::aodv::RrepHeader::GetHopCount
uint8_t GetHopCount() const
Get the hop count.
Definition
aodv-packet.h:390
ns3::aodv::RrepHeader::SetOrigin
void SetOrigin(Ipv4Address a)
Set the origin address.
Definition
aodv-packet.h:435
ns3::aodv::RrepHeader::SetHopCount
void SetHopCount(uint8_t count)
Set the hop count.
Definition
aodv-packet.h:381
ns3::aodv::RrepHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
aodv-packet.cc:322
ns3::aodv::RrepHeader::m_dstSeqNo
uint32_t m_dstSeqNo
Destination Sequence Number.
Definition
aodv-packet.h:503
ns3::aodv::RrepHeader::SetLifeTime
void SetLifeTime(Time t)
Set the lifetime.
Definition
aodv-packet.cc:370
ns3::aodv::RrepHeader::SetAckRequired
void SetAckRequired(bool f)
Set the ack required flag.
Definition
aodv-packet.cc:383
ns3::aodv::RrepHeader::SetPrefixSize
void SetPrefixSize(uint8_t sz)
Set the prefix size.
Definition
aodv-packet.cc:402
ns3::aodv::RrepHeader::RrepHeader
RrepHeader(uint8_t prefixSize=0, uint8_t hopCount=0, Ipv4Address dst=Ipv4Address(), uint32_t dstSeqNo=0, Ipv4Address origin=Ipv4Address(), Time lifetime=MilliSeconds(0))
constructor
Definition
aodv-packet.cc:287
ns3::aodv::RrepHeader::GetLifeTime
Time GetLifeTime() const
Get the lifetime.
Definition
aodv-packet.cc:376
ns3::aodv::RrepHeader::SetDst
void SetDst(Ipv4Address a)
Set the destination address.
Definition
aodv-packet.h:399
ns3::aodv::RrepHeader::m_dst
Ipv4Address m_dst
Destination IP Address.
Definition
aodv-packet.h:502
ns3::aodv::RrepHeader::GetDstSeqno
uint32_t GetDstSeqno() const
Get the destination sequence number.
Definition
aodv-packet.h:426
ns3::aodv::RrepHeader::m_flags
uint8_t m_flags
A - acknowledgment required flag.
Definition
aodv-packet.h:499
ns3::aodv::RrepHeader::GetDst
Ipv4Address GetDst() const
Get the destination address.
Definition
aodv-packet.h:408
ns3::aodv::RrepHeader::m_hopCount
uint8_t m_hopCount
Hop Count.
Definition
aodv-packet.h:501
ns3::aodv::RrepHeader::m_prefixSize
uint8_t m_prefixSize
Prefix Size.
Definition
aodv-packet.h:500
ns3::aodv::RrepHeader::operator==
bool operator==(const RrepHeader &o) const
Comparison operator.
Definition
aodv-packet.cc:414
ns3::aodv::RrepHeader::m_origin
Ipv4Address m_origin
Source IP Address.
Definition
aodv-packet.h:504
ns3::aodv::RrepHeader::m_lifeTime
uint32_t m_lifeTime
Lifetime (in milliseconds)
Definition
aodv-packet.h:505
ns3::aodv::RreqHeader
Route Request (RREQ) Message Format.
Definition
aodv-packet.h:127
ns3::aodv::RreqHeader::GetId
uint32_t GetId() const
Get the request ID.
Definition
aodv-packet.h:193
ns3::aodv::RreqHeader::SetDst
void SetDst(Ipv4Address a)
Set the destination address.
Definition
aodv-packet.h:202
ns3::aodv::RreqHeader::GetHopCount
uint8_t GetHopCount() const
Get the hop count.
Definition
aodv-packet.h:175
ns3::aodv::RreqHeader::GetUnknownSeqno
bool GetUnknownSeqno() const
Get the unknown sequence number flag.
Definition
aodv-packet.cc:270
ns3::aodv::RreqHeader::m_originSeqNo
uint32_t m_originSeqNo
Source Sequence Number.
Definition
aodv-packet.h:317
ns3::aodv::RreqHeader::SetId
void SetId(uint32_t id)
Set the request ID.
Definition
aodv-packet.h:184
ns3::aodv::RreqHeader::GetOriginSeqno
uint32_t GetOriginSeqno() const
Get the origin sequence number.
Definition
aodv-packet.h:265
ns3::aodv::RreqHeader::RreqHeader
RreqHeader(uint8_t flags=0, uint8_t reserved=0, uint8_t hopCount=0, uint32_t requestID=0, Ipv4Address dst=Ipv4Address(), uint32_t dstSeqNo=0, Ipv4Address origin=Ipv4Address(), uint32_t originSeqNo=0)
constructor
Definition
aodv-packet.cc:127
ns3::aodv::RreqHeader::m_hopCount
uint8_t m_hopCount
Hop Count.
Definition
aodv-packet.h:312
ns3::aodv::RreqHeader::SetUnknownSeqno
void SetUnknownSeqno(bool f)
Set the unknown sequence number flag.
Definition
aodv-packet.cc:257
ns3::aodv::RreqHeader::GetOrigin
Ipv4Address GetOrigin() const
Get the origin address.
Definition
aodv-packet.h:247
ns3::aodv::RreqHeader::SetGratuitousRrep
void SetGratuitousRrep(bool f)
Set the gratuitous RREP flag.
Definition
aodv-packet.cc:219
ns3::aodv::RreqHeader::SetDestinationOnly
void SetDestinationOnly(bool f)
Set the Destination only flag.
Definition
aodv-packet.cc:238
ns3::aodv::RreqHeader::m_origin
Ipv4Address m_origin
Originator IP Address.
Definition
aodv-packet.h:316
ns3::aodv::RreqHeader::GetDestinationOnly
bool GetDestinationOnly() const
Get the Destination only flag.
Definition
aodv-packet.cc:251
ns3::aodv::RreqHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
aodv-packet.cc:165
ns3::aodv::RreqHeader::m_dst
Ipv4Address m_dst
Destination IP Address.
Definition
aodv-packet.h:314
ns3::aodv::RreqHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
aodv-packet.cc:149
ns3::aodv::RreqHeader::m_requestID
uint32_t m_requestID
RREQ ID.
Definition
aodv-packet.h:313
ns3::aodv::RreqHeader::SetHopCount
void SetHopCount(uint8_t count)
Set the hop count.
Definition
aodv-packet.h:166
ns3::aodv::RreqHeader::SetDstSeqno
void SetDstSeqno(uint32_t s)
Set the destination sequence number.
Definition
aodv-packet.h:220
ns3::aodv::RreqHeader::Print
void Print(std::ostream &os) const override
Definition
aodv-packet.cc:202
ns3::aodv::RreqHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
aodv-packet.cc:159
ns3::aodv::RreqHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
aodv-packet.cc:171
ns3::aodv::RreqHeader::m_reserved
uint8_t m_reserved
Not used (must be 0)
Definition
aodv-packet.h:311
ns3::aodv::RreqHeader::GetDstSeqno
uint32_t GetDstSeqno() const
Get the destination sequence number.
Definition
aodv-packet.h:229
ns3::aodv::RreqHeader::GetDst
Ipv4Address GetDst() const
Get the destination address.
Definition
aodv-packet.h:211
ns3::aodv::RreqHeader::SetOriginSeqno
void SetOriginSeqno(uint32_t s)
Set the origin sequence number.
Definition
aodv-packet.h:256
ns3::aodv::RreqHeader::GetGratuitousRrep
bool GetGratuitousRrep() const
Get the gratuitous RREP flag.
Definition
aodv-packet.cc:232
ns3::aodv::RreqHeader::m_dstSeqNo
uint32_t m_dstSeqNo
Destination Sequence Number.
Definition
aodv-packet.h:315
ns3::aodv::RreqHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
aodv-packet.cc:184
ns3::aodv::RreqHeader::operator==
bool operator==(const RreqHeader &o) const
Comparison operator.
Definition
aodv-packet.cc:276
ns3::aodv::RreqHeader::m_flags
uint8_t m_flags
|J|R|G|D|U| bit flags, see RFC
Definition
aodv-packet.h:310
ns3::aodv::RreqHeader::SetOrigin
void SetOrigin(Ipv4Address a)
Set the origin address.
Definition
aodv-packet.h:238
ns3::aodv::TypeHeader
AODV types.
Definition
aodv-packet.h:49
ns3::aodv::TypeHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Definition
aodv-packet.cc:63
ns3::aodv::TypeHeader::TypeHeader
TypeHeader(MessageType t=AODVTYPE_RREQ)
constructor
Definition
aodv-packet.cc:28
ns3::aodv::TypeHeader::operator==
bool operator==(const TypeHeader &o) const
Comparison operator.
Definition
aodv-packet.cc:112
ns3::aodv::TypeHeader::Print
void Print(std::ostream &os) const override
Definition
aodv-packet.cc:86
ns3::aodv::TypeHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
aodv-packet.cc:45
ns3::aodv::TypeHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition
aodv-packet.cc:57
ns3::aodv::TypeHeader::m_type
MessageType m_type
type of the message
Definition
aodv-packet.h:93
ns3::aodv::TypeHeader::m_valid
bool m_valid
Indicates if the message is valid.
Definition
aodv-packet.h:94
ns3::aodv::TypeHeader::IsValid
bool IsValid() const
Check that type if valid.
Definition
aodv-packet.h:80
ns3::aodv::TypeHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
aodv-packet.cc:51
ns3::aodv::TypeHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
aodv-packet.cc:35
ns3::aodv::TypeHeader::Get
MessageType Get() const
Definition
aodv-packet.h:71
uint32_t
ns3::aodv::MessageType
MessageType
MessageType enumeration.
Definition
aodv-packet.h:37
ns3::aodv::AODVTYPE_RREP
@ AODVTYPE_RREP
AODVTYPE_RREP.
Definition
aodv-packet.h:39
ns3::aodv::AODVTYPE_RREP_ACK
@ AODVTYPE_RREP_ACK
AODVTYPE_RREP_ACK.
Definition
aodv-packet.h:41
ns3::aodv::AODVTYPE_RERR
@ AODVTYPE_RERR
AODVTYPE_RERR.
Definition
aodv-packet.h:40
ns3::aodv::AODVTYPE_RREQ
@ AODVTYPE_RREQ
AODVTYPE_RREQ.
Definition
aodv-packet.h:38
ns3::MilliSeconds
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition
nstime.h:1356
ns3::aodv::operator<<
std::ostream & operator<<(std::ostream &os, const TypeHeader &h)
Stream output operator.
Definition
aodv-packet.cc:118
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
aodv
model
aodv-packet.h
Generated on Fri Dec 13 2024 18:20:36 for ns-3 by
1.11.0