src/helper/qos-wifi-mac-helper.h
author Mirko Banchi <mk.banchi@gmail.com>
Fri, 24 Apr 2009 10:21:37 +0200
changeset 4408 76a169b3db3d
child 4648 e72d6bc8b814
permissions -rw-r--r--
add qos MACs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4408
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     2
/*
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     3
 * Copyright (c) 2009 MIRKO BANCHI
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     4
 *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as 
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     8
 *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    12
 * GNU General Public License for more details.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    13
 *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    17
 *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    18
 * Author: Mirko Banchi <mk.banchi@gmail.com>
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    19
 */
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    20
#ifndef QOS_WIFI_MAC_HELPER_H
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    21
#define QOS_WIFI_MAC_HELPER_H
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    22
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    23
#include "wifi-helper.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    24
#include "ns3/qos-utils.h"
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    25
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    26
#include <map>
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    27
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    28
namespace ns3 {
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    29
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    30
class QosWifiMacHelper : public WifiMacHelper
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    31
{
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    32
public:
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    33
  QosWifiMacHelper ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    34
  virtual ~QosWifiMacHelper ();
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    35
  /**
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    36
   * Create a mac helper in a default working state.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    37
   */
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    38
  static QosWifiMacHelper Default (void);
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    39
  /**
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    40
   * \param type the type of ns3::WifiMac to create.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    41
   * \param n0 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    42
   * \param v0 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    43
   * \param n1 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    44
   * \param v1 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    45
   * \param n2 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    46
   * \param v2 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    47
   * \param n3 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    48
   * \param v3 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    49
   * \param n4 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    50
   * \param v4 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    51
   * \param n5 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    52
   * \param v5 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    53
   * \param n6 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    54
   * \param v6 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    55
   * \param n7 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    56
   * \param v7 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    57
   *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    58
   * All the attributes specified in this method should exist
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    59
   * in the requested mac.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    60
   */
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    61
  void SetType (std::string type,
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    62
                std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    63
                std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    64
                std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    65
                std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    66
                std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    67
                std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    68
                std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    69
                std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    70
  /**
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    71
   * \param accessClass access class for which we are setting aggregator. Possibilities
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    72
   *  are: AC_BK, AC_BE, AC_VI, AC_VO.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    73
   * \param aggregatorType type of aggregator.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    74
   * \param n0 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    75
   * \param v0 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    76
   * \param n1 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    77
   * \param v1 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    78
   * \param n2 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    79
   * \param v2 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    80
   * \param n3 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    81
   * \param v3 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    82
   *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    83
   * All the attributes specified in this method should exist
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    84
   * in the requested aggregator.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    85
   */
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    86
  void SetMsduAggregatorForAc (AccessClass accessClass, std::string type,
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    87
                               std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    88
                               std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    89
                               std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    90
                               std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    91
  /**
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    92
   * \param accessClass access class for which we are setting edca params. Possibilities
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    93
   *  are: AC_BK, AC_BE, AC_VI, AC_VO.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    94
   * \param n0 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    95
   * \param v0 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    96
   * \param n1 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    97
   * \param v1 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    98
   * \param n2 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    99
   * \param v2 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   100
   * \param n3 the name of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   101
   * \param v3 the value of the attribute to set
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   102
   */
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   103
  void SetEdcaParametersForAc (AccessClass accessClass,
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   104
                               std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   105
                               std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   106
                               std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   107
                               std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ());
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   108
private:
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   109
  /**
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   110
   * \returns a newly-created MAC object.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   111
   *
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   112
   * This method implements the pure virtual method defined in \ref ns3::WifiMacHelper.
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   113
   */
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   114
  virtual Ptr<WifiMac> Create (void) const;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   115
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   116
  ObjectFactory m_mac;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   117
  std::map<AccessClass, ObjectFactory> m_queues;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   118
  std::map<AccessClass, ObjectFactory> m_aggregators;
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   119
};
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   120
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   121
} //namespace ns3
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   122
76a169b3db3d add qos MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
   123
#endif /* QOS_WIFI_MAC_HELPER_H */