OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 IITP RAS | 3 * Copyright (c) 2009 IITP RAS |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 28 matching lines...) Expand all Loading... |
39 &AirtimeLinkMetricCalculator::SetTestLength), | 39 &AirtimeLinkMetricCalculator::SetTestLength), |
40 MakeUintegerChecker<uint16_t> (1) | 40 MakeUintegerChecker<uint16_t> (1) |
41 ) | 41 ) |
42 .AddAttribute ( "Dot11MetricTid", | 42 .AddAttribute ( "Dot11MetricTid", |
43 "TID used to calculate metric (data rate)", | 43 "TID used to calculate metric (data rate)", |
44 UintegerValue (0), | 44 UintegerValue (0), |
45 MakeUintegerAccessor ( | 45 MakeUintegerAccessor ( |
46 &AirtimeLinkMetricCalculator::SetHeaderTid), | 46 &AirtimeLinkMetricCalculator::SetHeaderTid), |
47 MakeUintegerChecker<uint8_t> (0) | 47 MakeUintegerChecker<uint8_t> (0) |
48 ) | 48 ) |
49 .AddAttribute ( "Dot11sMeshHeaderLength", | |
50 "Length of the mesh header", | |
51 UintegerValue (6), | |
52 MakeUintegerAccessor ( | |
53 &AirtimeLinkMetricCalculator::m_meshHeaderLength), | |
54 MakeUintegerChecker<uint16_t> (0) | |
55 ) | |
56 ; | 49 ; |
57 return tid; | 50 return tid; |
58 } | 51 } |
59 AirtimeLinkMetricCalculator::AirtimeLinkMetricCalculator () : | 52 AirtimeLinkMetricCalculator::AirtimeLinkMetricCalculator () |
60 m_overheadNanosec (0) | |
61 { | 53 { |
62 } | 54 } |
63 void | 55 void |
64 AirtimeLinkMetricCalculator::SetHeaderTid (uint8_t tid) | 56 AirtimeLinkMetricCalculator::SetHeaderTid (uint8_t tid) |
65 { | 57 { |
66 m_testHeader.SetDsFrom (); | 58 m_testHeader.SetDsFrom (); |
67 m_testHeader.SetDsTo (); | 59 m_testHeader.SetDsTo (); |
68 m_testHeader.SetTypeData (); | 60 m_testHeader.SetTypeData (); |
69 m_testHeader.SetQosTid (tid); | 61 m_testHeader.SetQosTid (tid); |
70 } | 62 } |
(...skipping 30 matching lines...) Expand all Loading... |
101 txVector.SetMode (mode); | 93 txVector.SetMode (mode); |
102 //calculate metric | 94 //calculate metric |
103 uint32_t metric = (uint32_t)((double)( /*Overhead + payload*/ | 95 uint32_t metric = (uint32_t)((double)( /*Overhead + payload*/ |
104 mac->GetPifs () + mac->GetSlot () + mac->GetEif
sNoDifs () + //DIFS + SIFS + AckTxTime = PIFS + SLOT + EifsNoDifs | 96 mac->GetPifs () + mac->GetSlot () + mac->GetEif
sNoDifs () + //DIFS + SIFS + AckTxTime = PIFS + SLOT + EifsNoDifs |
105 mac->GetWifiPhy ()->CalculateTxDuration (m_test
Frame->GetSize (), txVector, WIFI_PREAMBLE_LONG) | 97 mac->GetWifiPhy ()->CalculateTxDuration (m_test
Frame->GetSize (), txVector, WIFI_PREAMBLE_LONG) |
106 ).GetMicroSeconds () / (10.24 * (1.0 - failAvg)
)); | 98 ).GetMicroSeconds () / (10.24 * (1.0 - failAvg)
)); |
107 return metric; | 99 return metric; |
108 } | 100 } |
109 } // namespace dot11s | 101 } // namespace dot11s |
110 } // namespace ns3 | 102 } // namespace ns3 |
OLD | NEW |