A Discrete-Event Network Simulator
API
peer-management-protocol-mac.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 IITP RAS
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Kirill Andreev <andreev@iitp.ru>
19  */
20 
21 #ifndef PEER_MANAGEMENT_PROTOCOL_MAC_H
22 #define PEER_MANAGEMENT_PROTOCOL_MAC_H
23 
24 #include "ns3/mesh-wifi-interface-mac-plugin.h"
25 
26 namespace ns3 {
27 class MeshWifiInterfaceMac;
28 namespace dot11s {
29 class PeerManagementProtocol;
30 class IeConfiguration;
31 class IePeerManagement;
32 class PeerManagementProtocol;
43 {
44 public:
45  PeerManagementProtocolMac (uint32_t interface, Ptr<PeerManagementProtocol> protocol);
47 
48  // Inherited from plugin abstract class
50  bool Receive (Ptr<Packet> packet, const WifiMacHeader & header);
52  void UpdateBeacon (MeshWifiBeacon & beacon) const;
53  int64_t AssignStreams (int64_t stream);
55  // \{
56  void Report (std::ostream &) const;
57  void ResetStats ();
58  uint32_t GetLinkMetric (Mac48Address peerAddress);
59  // \}
60 
61 private:
64 
65  friend class PeerManagementProtocol;
66  friend class PeerLink;
68  // \{
74  {
75  uint8_t subtype;
76  uint16_t aid;
78  uint16_t qos;
79  };
85  // \}
87  void TxError (WifiMacHeader const &hdr);
88  void TxOk (WifiMacHeader const &hdr);
90  void SetBeaconShift (Time shift);
93  Mac48Address peerAddress,
94  Mac48Address peerMpAddress,
95  uint16_t aid,
96  IePeerManagement peerElement,
97  IeConfiguration meshConfig
98  );
100  Mac48Address GetAddress () const;
102  // \{
103  struct Statistics
104  {
105  uint16_t txOpen;
106  uint16_t txConfirm;
107  uint16_t txClose;
108  uint16_t rxOpen;
109  uint16_t rxConfirm;
110  uint16_t rxClose;
111  uint16_t dropped;
112  uint16_t brokenMgt;
113  uint16_t txMgt;
114  uint32_t txMgtBytes;
115  uint16_t rxMgt;
116  uint32_t rxMgtBytes;
117  uint16_t beaconShift;
118 
119  Statistics ();
120  void Print (std::ostream & os) const;
121  };
122 
123 private:
127  // \{
129  uint32_t m_ifIndex;
131  // \}
132 };
133 
134 } // namespace dot11s
135 } // namespace ns3
136 
137 #endif /* PEER_MANAGEMENT_PROTOCOL_MAC_H */
138 
Ptr< Packet > CreatePeerLinkOpenFrame()
Parses the start of the frame, where no WifiInformationElements exist.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void SetBeaconShift(Time shift)
BCA functionality.
void SetPeerManagerProtcol(Ptr< PeerManagementProtocol > protocol)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
PeerManagementProtocolMac(uint32_t interface, Ptr< PeerManagementProtocol > protocol)
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
Update frame before it will be forwarded down.
uint32_t GetLinkMetric(Mac48Address peerAddress)
Ptr< Packet > CreatePeerLinkCloseFrame()
Parses the start of the frame, where no WifiInformationElements exist.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Common interface for mesh point interface MAC plugins.
void SendPeerLinkManagementFrame(Mac48Address peerAddress, Mac48Address peerMpAddress, uint16_t aid, IePeerManagement peerElement, IeConfiguration meshConfig)
an EUI-48 address
Definition: mac48-address.h:43
Mac48Address GetAddress() const
debug only, used to print established links
Beacon is beacon header + list of arbitrary information elements.
PlinkFrameStart ParsePlinkFrame(Ptr< const Packet > packet)
Parses the start of the frame, where no WifiInformationElements exist.
PeerManagementProtocolMac & operator=(const PeerManagementProtocolMac &)
void UpdateBeacon(MeshWifiBeacon &beacon) const
Update beacon before it will be formed and sent.
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
This is plugin to Mesh WiFi MAC, which implements interface to dot11s peer management protocol: it ta...
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Process received frame.
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Each plugin must be installed on interface to work.
void TxError(WifiMacHeader const &hdr)
Closes link when a proper number of successive transmissions have failed.
Ptr< Packet > CreatePeerLinkConfirmFrame()
Parses the start of the frame, where no WifiInformationElements exist.
Implements the IEEE 802.11 MAC header.
802.11s Peer Management Protocol model