src/wifi/model/wifi-mac.cc
author Junling Bu <linlinjavaer@gmail.com>
Sun, 22 Sep 2013 20:59:18 -0700
changeset 10204 7a102bb70a36
parent 10139 17a71cd49da3
child 10410 4d4eb8097fa3
permissions -rw-r--r--
bug 945: remove deprecated 802.11p code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7162
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     2
/*
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     3
 * Copyright (c) 2008 INRIA
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     4
 *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
2684
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     7
 * published by the Free Software Foundation;
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     8
 *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    12
 * GNU General Public License for more details.
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    13
 *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    14
 * You should have received a copy of the GNU General Public License
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    15
 * along with this program; if not, write to the Free Software
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    17
 *
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
68c643329c2b improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2602
diff changeset
    19
 */
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
#include "wifi-mac.h"
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
    21
#include "dcf.h"
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
#include "ns3/uinteger.h"
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
    23
#include "ns3/trace-source-accessor.h"
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
namespace ns3 {
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
NS_OBJECT_ENSURE_REGISTERED (WifiMac);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
WifiMac::GetDefaultMaxPropagationDelay (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
    32
  // 1000m
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
  return Seconds (1000.0 / 300000000.0);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
WifiMac::GetDefaultSlot (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    37
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    38
  // 802.11-a specific
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
  return MicroSeconds (9);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    40
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
WifiMac::GetDefaultSifs (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    44
  // 802.11-a specific
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
  return MicroSeconds (16);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    46
}
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    47
Time 
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    48
WifiMac::GetDefaultRifs (void)
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    49
{
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    50
  //802.11n specific
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    51
  return MicroSeconds (2);
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    52
}
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    53
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
WifiMac::GetDefaultEifsNoDifs (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    55
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    56
  return GetDefaultSifs () + GetDefaultCtsAckDelay ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    57
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
WifiMac::GetDefaultCtsAckDelay (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
  // 802.11-a specific: 6mb/s
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    62
  return MicroSeconds (44);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    63
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    64
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    65
WifiMac::GetDefaultCtsAckTimeout (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    66
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
    67
  /* Cts_Timeout and Ack_Timeout are specified in the Annex C
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
    68
     (Formal description of MAC operation, see details on the
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    69
     Trsp timer setting at page 346)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    70
  */
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    71
  Time ctsTimeout = GetDefaultSifs ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    72
  ctsTimeout += GetDefaultCtsAckDelay ();
4509
b2654e0f071d bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents: 4272
diff changeset
    73
  ctsTimeout += MicroSeconds (GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2);
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    74
  ctsTimeout += GetDefaultSlot ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    75
  return ctsTimeout;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    76
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    77
5958
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    78
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    79
WifiMac::GetDefaultBasicBlockAckDelay (void)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    80
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    81
  // This value must be rivisited
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    82
  return MicroSeconds (250);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    83
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    84
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    85
WifiMac::GetDefaultCompressedBlockAckDelay (void)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    86
{
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    87
  // This value must be rivisited was 68. 
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    88
 //CompressedBlockAckSize 32* 8*time it takes to transfer at the lowest rate (6Mb/s)+ aPhy-StartDelay(33)
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
    89
  return MicroSeconds (76);
5958
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    90
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    91
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    92
WifiMac::GetDefaultBasicBlockAckTimeout (void)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    93
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    94
  Time blockAckTimeout = GetDefaultSifs ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    95
  blockAckTimeout += GetDefaultBasicBlockAckDelay ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    96
  blockAckTimeout += MicroSeconds (GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    97
  blockAckTimeout += GetDefaultSlot ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    98
  return blockAckTimeout;
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
    99
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   100
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   101
WifiMac::GetDefaultCompressedBlockAckTimeout (void)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   102
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   103
  Time blockAckTimeout = GetDefaultSifs ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   104
  blockAckTimeout += GetDefaultCompressedBlockAckDelay ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   105
  blockAckTimeout += MicroSeconds (GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   106
  blockAckTimeout += GetDefaultSlot ();
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   107
  return blockAckTimeout;
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   108
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   109
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   110
void
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   111
WifiMac::SetBasicBlockAckTimeout (Time blockAckTimeout)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   112
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   113
  //this method must be implemented by QoS WifiMacs
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   114
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   115
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   116
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   117
WifiMac::GetBasicBlockAckTimeout (void) const
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   118
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   119
  //this method must be implemented by QoS WifiMacs
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   120
  return MicroSeconds (0);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   121
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   122
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   123
void
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   124
WifiMac::SetCompressedBlockAckTimeout (Time blockAckTimeout)
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   125
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   126
  //this methos must be implemented by QoS WifiMacs
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   127
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   128
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   129
Time
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   130
WifiMac::GetCompressedBlockAckTimeout (void) const
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   131
{
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   132
  //this method must be implemented by QoS WifiMacs
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   133
  return MicroSeconds (0);
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   134
}
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   135
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   136
TypeId
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   137
WifiMac::GetTypeId (void)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   138
{
2602
d9262bff6df2 add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2599
diff changeset
   139
  static TypeId tid = TypeId ("ns3::WifiMac")
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   140
    .SetParent<Object> ()
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   141
    .AddAttribute ("CtsTimeout", "When this timeout expires, the RTS/CTS handshake has failed.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   142
                   TimeValue (GetDefaultCtsAckTimeout ()),
3747
789e9a21ecbe bug 371: wifi-ap broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3599
diff changeset
   143
                   MakeTimeAccessor (&WifiMac::SetCtsTimeout,
789e9a21ecbe bug 371: wifi-ap broken
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3599
diff changeset
   144
                                     &WifiMac::GetCtsTimeout),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   145
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   146
    .AddAttribute ("AckTimeout", "When this timeout expires, the DATA/ACK handshake has failed.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   147
                   TimeValue (GetDefaultCtsAckTimeout ()),
3596
6c39b712a535 move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3212
diff changeset
   148
                   MakeTimeAccessor (&WifiMac::GetAckTimeout,
6c39b712a535 move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3212
diff changeset
   149
                                     &WifiMac::SetAckTimeout),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   150
                   MakeTimeChecker ())
5958
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   151
    .AddAttribute ("BasicBlockAckTimeout", "When this timeout expires, the BASIC_BLOCK_ACK_REQ/BASIC_BLOCK_ACK handshake has failed.",
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   152
                   TimeValue (GetDefaultBasicBlockAckTimeout ()),
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   153
                   MakeTimeAccessor (&WifiMac::GetBasicBlockAckTimeout,
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   154
                                     &WifiMac::SetBasicBlockAckTimeout),
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   155
                   MakeTimeChecker ())
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   156
    .AddAttribute ("CompressedBlockAckTimeout", "When this timeout expires, the COMPRESSED_BLOCK_ACK_REQ/COMPRESSED_BLOCK_ACK handshake has failed.",
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   157
                   TimeValue (GetDefaultCompressedBlockAckTimeout ()),
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   158
                   MakeTimeAccessor (&WifiMac::GetCompressedBlockAckTimeout,
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   159
                                     &WifiMac::SetCompressedBlockAckTimeout),
dd0accd82659 add block ack timeouts
Mirko Banchi <mk.banchi@gmail.com>
parents: 5747
diff changeset
   160
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   161
    .AddAttribute ("Sifs", "The value of the SIFS constant.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   162
                   TimeValue (GetDefaultSifs ()),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   163
                   MakeTimeAccessor (&WifiMac::SetSifs,
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   164
                                     &WifiMac::GetSifs),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   165
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   166
    .AddAttribute ("EifsNoDifs", "The value of EIFS-DIFS",
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   167
                   TimeValue (GetDefaultEifsNoDifs ()),
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   168
                   MakeTimeAccessor (&WifiMac::SetEifsNoDifs,
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   169
                                     &WifiMac::GetEifsNoDifs),
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   170
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   171
    .AddAttribute ("Slot", "The duration of a Slot.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   172
                   TimeValue (GetDefaultSlot ()),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   173
                   MakeTimeAccessor (&WifiMac::SetSlot,
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   174
                                     &WifiMac::GetSlot),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   175
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   176
    .AddAttribute ("Pifs", "The value of the PIFS constant.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   177
                   TimeValue (GetDefaultSifs () + GetDefaultSlot ()),
3599
721bd46c15f8 move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3596
diff changeset
   178
                   MakeTimeAccessor (&WifiMac::SetPifs,
721bd46c15f8 move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3596
diff changeset
   179
                                     &WifiMac::GetPifs),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   180
                   MakeTimeChecker ())
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   181
.AddAttribute ("Rifs", "The value of the RIFS constant.",
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   182
                   TimeValue (GetDefaultRifs ()),
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   183
                   MakeTimeAccessor (&WifiMac::SetRifs,
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   184
                                     &WifiMac::GetRifs),
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   185
                   MakeTimeChecker ())
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   186
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   187
    .AddAttribute ("MaxPropagationDelay", "The maximum propagation delay. Unused for now.",
2965
4b28e9740e3b get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2686
diff changeset
   188
                   TimeValue (GetDefaultMaxPropagationDelay ()),
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   189
                   MakeTimeAccessor (&WifiMac::m_maxPropagationDelay),
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   190
                   MakeTimeChecker ())
3212
0c00342d6a73 improve attribute documentation
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2965
diff changeset
   191
    .AddAttribute ("Ssid", "The ssid we want to belong to.",
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   192
                   SsidValue (Ssid ("default")),
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   193
                   MakeSsidAccessor (&WifiMac::GetSsid,
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   194
                                     &WifiMac::SetSsid),
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   195
                   MakeSsidChecker ())
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   196
    .AddTraceSource ("MacTx",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   197
                     "A packet has been received from higher layers and is being processed in preparation for "
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   198
                     "queueing for transmission.",
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   199
                     MakeTraceSourceAccessor (&WifiMac::m_macTxTrace))
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   200
    .AddTraceSource ("MacTxDrop",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   201
                     "A packet has been dropped in the MAC layer before being queued for transmission.",
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   202
                     MakeTraceSourceAccessor (&WifiMac::m_macTxDropTrace))
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   203
    .AddTraceSource ("MacPromiscRx",
4272
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   204
                     "A packet has been received by this device, has been passed up from the physical layer "
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   205
                     "and is being forwarded up the local protocol stack.  This is a promiscuous trace,",
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   206
                     MakeTraceSourceAccessor (&WifiMac::m_macPromiscRxTrace))
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   207
    .AddTraceSource ("MacRx",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   208
                     "A packet has been received by this device, has been passed up from the physical layer "
4272
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   209
                     "and is being forwarded up the local protocol stack.  This is a non-promiscuous trace,",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   210
                     MakeTraceSourceAccessor (&WifiMac::m_macRxTrace))
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   211
    .AddTraceSource ("MacRxDrop",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   212
                     "A packet has been dropped in the MAC layer after it has been passed up from the physical "
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   213
                     "layer.",
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   214
                     MakeTraceSourceAccessor (&WifiMac::m_macRxDropTrace))
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   215
#if 0
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   216
    // Not currently implemented in this device
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   217
    .AddTraceSource ("Sniffer",
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   218
                     "Trace source simulating a non-promiscuous packet sniffer attached to the device",
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   219
                     MakeTraceSourceAccessor (&WifiMac::m_snifferTrace))
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   220
#endif
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   221
  ;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   222
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   223
  return tid;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   224
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   225
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   226
void
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   227
WifiMac::SetMaxPropagationDelay (Time delay)
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   228
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   229
  m_maxPropagationDelay = delay;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   230
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   231
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   232
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   233
WifiMac::GetMsduLifetime (void) const
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   234
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   235
  return Seconds (10);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   236
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   237
Time
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   238
WifiMac::GetMaxPropagationDelay (void) const
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   239
{
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   240
  return m_maxPropagationDelay;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   241
}
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   242
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   243
void
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   244
WifiMac::NotifyTx (Ptr<const Packet> packet)
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   245
{
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   246
  m_macTxTrace (packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   247
}
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   248
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   249
void
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   250
WifiMac::NotifyTxDrop (Ptr<const Packet> packet)
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   251
{
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   252
  m_macTxDropTrace (packet);
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   253
}
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3749
diff changeset
   254
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   255
void
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   256
WifiMac::NotifyRx (Ptr<const Packet> packet)
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   257
{
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   258
  m_macRxTrace (packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   259
}
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   260
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   261
void
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   262
WifiMac::NotifyPromiscRx (Ptr<const Packet> packet)
4272
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   263
{
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   264
  m_macPromiscRxTrace (packet);
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   265
}
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   266
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   267
void
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   268
WifiMac::NotifyRxDrop (Ptr<const Packet> packet)
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   269
{
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   270
  m_macRxDropTrace (packet);
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   271
}
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   272
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   273
void
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   274
WifiMac::ConfigureStandard (enum WifiPhyStandard standard)
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   275
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   276
  switch (standard)
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   277
    {
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   278
    case WIFI_PHY_STANDARD_80211a:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   279
      Configure80211a ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   280
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   281
    case WIFI_PHY_STANDARD_80211b:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   282
      Configure80211b ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   283
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   284
    case WIFI_PHY_STANDARD_80211g:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   285
      Configure80211g ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   286
      break;
7482
35c01487f7f7 _Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents: 7385
diff changeset
   287
    case WIFI_PHY_STANDARD_80211_10MHZ:
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   288
      Configure80211_10Mhz ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   289
      break;
7482
35c01487f7f7 _Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents: 7385
diff changeset
   290
    case WIFI_PHY_STANDARD_80211_5MHZ:
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   291
      Configure80211_5Mhz ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   292
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   293
    case WIFI_PHY_STANDARD_holland:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   294
      Configure80211a ();
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   295
      break;
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   296
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   297
      Configure80211n_2_4Ghz ();
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   298
      break;
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   299
    case WIFI_PHY_STANDARD_80211n_5GHZ:
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   300
      Configure80211n_5Ghz ();
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   301
      break;
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   302
    default:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   303
      NS_ASSERT (false);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   304
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   305
    }
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   306
  FinishConfigureStandard (standard);
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   307
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   308
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   309
void
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   310
WifiMac::Configure80211a (void)
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   311
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   312
  SetSifs (MicroSeconds (16));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   313
  SetSlot (MicroSeconds (9));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   314
  SetEifsNoDifs (MicroSeconds (16 + 44));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   315
  SetPifs (MicroSeconds (16 + 9));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   316
  SetCtsTimeout (MicroSeconds (16 + 44 + 9 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   317
  SetAckTimeout (MicroSeconds (16 + 44 + 9 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   318
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   319
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   320
void
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   321
WifiMac::Configure80211b (void)
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   322
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   323
  SetSifs (MicroSeconds (10));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   324
  SetSlot (MicroSeconds (20));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   325
  SetEifsNoDifs (MicroSeconds (10 + 304));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   326
  SetPifs (MicroSeconds (10 + 20));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   327
  SetCtsTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   328
  SetAckTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   329
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   330
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   331
void
6597
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   332
WifiMac::Configure80211g (void)
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   333
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   334
  SetSifs (MicroSeconds (10));
6597
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   335
  // Note no support for Short Slot Time as yet
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   336
  SetSlot (MicroSeconds (20));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   337
  SetEifsNoDifs (MicroSeconds (10 + 304));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   338
  SetPifs (MicroSeconds (10 + 20));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   339
  SetCtsTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   340
  SetAckTimeout (MicroSeconds (10 + 304 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
6597
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   341
}
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   342
7fbc895f7361 Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents: 6331
diff changeset
   343
void
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   344
WifiMac::Configure80211_10Mhz (void)
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   345
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   346
  SetSifs (MicroSeconds (32));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   347
  SetSlot (MicroSeconds (13));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   348
  SetEifsNoDifs (MicroSeconds (32 + 88));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   349
  SetPifs (MicroSeconds (32 + 13));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   350
  SetCtsTimeout (MicroSeconds (32 + 88 + 13 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   351
  SetAckTimeout (MicroSeconds (32 + 88 + 13 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   352
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   353
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   354
void
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   355
WifiMac::Configure80211_5Mhz (void)
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   356
{
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   357
  SetSifs (MicroSeconds (64));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   358
  SetSlot (MicroSeconds (21));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   359
  SetEifsNoDifs (MicroSeconds (64 + 176));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   360
  SetPifs (MicroSeconds (64 + 21));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   361
  SetCtsTimeout (MicroSeconds (64 + 176 + 21 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   362
  SetAckTimeout (MicroSeconds (64 + 176 + 21 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
4680
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   363
}
a52c39181dd4 Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents: 4509
diff changeset
   364
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   365
void
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   366
WifiMac::Configure80211n_2_4Ghz (void)
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   367
{
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   368
  Configure80211g ();
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   369
  SetRifs(MicroSeconds (2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   370
  SetCtsTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   371
  SetAckTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   372
}
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   373
void
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   374
WifiMac::Configure80211n_5Ghz (void)
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   375
{
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   376
  Configure80211a ();
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   377
  SetRifs(MicroSeconds (2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   378
  SetCtsTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   379
  SetAckTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7482
diff changeset
   380
}
5747
a171e73c4dae add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents: 4720
diff changeset
   381
a171e73c4dae add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents: 4720
diff changeset
   382
void
6331
eee2eab36748 Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents: 6183
diff changeset
   383
WifiMac::ConfigureDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum AcIndex ac)
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   384
{
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   385
  /* see IEE802.11 section 7.3.2.29 */
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   386
  switch (ac)
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   387
    {
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   388
    case AC_VO:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   389
      dcf->SetMinCw ((cwmin + 1) / 4 - 1);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   390
      dcf->SetMaxCw ((cwmin + 1) / 2 - 1);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   391
      dcf->SetAifsn (2);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   392
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   393
    case AC_VI:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   394
      dcf->SetMinCw ((cwmin + 1) / 2 - 1);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   395
      dcf->SetMaxCw (cwmin);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   396
      dcf->SetAifsn (2);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   397
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   398
    case AC_BE:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   399
      dcf->SetMinCw (cwmin);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   400
      dcf->SetMaxCw (cwmax);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   401
      dcf->SetAifsn (3);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   402
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   403
    case AC_BK:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   404
      dcf->SetMinCw (cwmin);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   405
      dcf->SetMaxCw (cwmax);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   406
      dcf->SetAifsn (7);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   407
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   408
    case AC_BE_NQOS:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   409
      dcf->SetMinCw (cwmin);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   410
      dcf->SetMaxCw (cwmax);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   411
      dcf->SetAifsn (2);
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   412
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   413
    case AC_UNDEF:
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   414
      NS_FATAL_ERROR ("I don't know what to do with this");
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   415
      break;
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 6852
diff changeset
   416
    }
4720
15221757964f bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 4680
diff changeset
   417
}
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   418
} // namespace ns3