src/wifi/model/wifi-mac.cc
changeset 10139 17a71cd49da3
parent 7482 35c01487f7f7
child 10204 7a102bb70a36
equal deleted inserted replaced
10138:2f8e35b43d11 10139:17a71cd49da3
    42 WifiMac::GetDefaultSifs (void)
    42 WifiMac::GetDefaultSifs (void)
    43 {
    43 {
    44   // 802.11-a specific
    44   // 802.11-a specific
    45   return MicroSeconds (16);
    45   return MicroSeconds (16);
    46 }
    46 }
       
    47 Time 
       
    48 WifiMac::GetDefaultRifs (void)
       
    49 {
       
    50   //802.11n specific
       
    51   return MicroSeconds (2);
       
    52 }
    47 Time
    53 Time
    48 WifiMac::GetDefaultEifsNoDifs (void)
    54 WifiMac::GetDefaultEifsNoDifs (void)
    49 {
    55 {
    50   return GetDefaultSifs () + GetDefaultCtsAckDelay ();
    56   return GetDefaultSifs () + GetDefaultCtsAckDelay ();
    51 }
    57 }
    76   return MicroSeconds (250);
    82   return MicroSeconds (250);
    77 }
    83 }
    78 Time
    84 Time
    79 WifiMac::GetDefaultCompressedBlockAckDelay (void)
    85 WifiMac::GetDefaultCompressedBlockAckDelay (void)
    80 {
    86 {
    81   // This value must be rivisited
    87   // This value must be rivisited was 68. 
    82   return MicroSeconds (68);
    88  //CompressedBlockAckSize 32* 8*time it takes to transfer at the lowest rate (6Mb/s)+ aPhy-StartDelay(33)
       
    89   return MicroSeconds (76);
    83 }
    90 }
    84 Time
    91 Time
    85 WifiMac::GetDefaultBasicBlockAckTimeout (void)
    92 WifiMac::GetDefaultBasicBlockAckTimeout (void)
    86 {
    93 {
    87   Time blockAckTimeout = GetDefaultSifs ();
    94   Time blockAckTimeout = GetDefaultSifs ();
   169     .AddAttribute ("Pifs", "The value of the PIFS constant.",
   176     .AddAttribute ("Pifs", "The value of the PIFS constant.",
   170                    TimeValue (GetDefaultSifs () + GetDefaultSlot ()),
   177                    TimeValue (GetDefaultSifs () + GetDefaultSlot ()),
   171                    MakeTimeAccessor (&WifiMac::SetPifs,
   178                    MakeTimeAccessor (&WifiMac::SetPifs,
   172                                      &WifiMac::GetPifs),
   179                                      &WifiMac::GetPifs),
   173                    MakeTimeChecker ())
   180                    MakeTimeChecker ())
       
   181 .AddAttribute ("Rifs", "The value of the RIFS constant.",
       
   182                    TimeValue (GetDefaultRifs ()),
       
   183                    MakeTimeAccessor (&WifiMac::SetRifs,
       
   184                                      &WifiMac::GetRifs),
       
   185                    MakeTimeChecker ())
       
   186 
   174     .AddAttribute ("MaxPropagationDelay", "The maximum propagation delay. Unused for now.",
   187     .AddAttribute ("MaxPropagationDelay", "The maximum propagation delay. Unused for now.",
   175                    TimeValue (GetDefaultMaxPropagationDelay ()),
   188                    TimeValue (GetDefaultMaxPropagationDelay ()),
   176                    MakeTimeAccessor (&WifiMac::m_maxPropagationDelay),
   189                    MakeTimeAccessor (&WifiMac::m_maxPropagationDelay),
   177                    MakeTimeChecker ())
   190                    MakeTimeChecker ())
   178     .AddAttribute ("Ssid", "The ssid we want to belong to.",
   191     .AddAttribute ("Ssid", "The ssid we want to belong to.",
   284       Configure80211p_CCH ();
   297       Configure80211p_CCH ();
   285       break;
   298       break;
   286     case WIFI_PHY_STANDARD_80211p_SCH:
   299     case WIFI_PHY_STANDARD_80211p_SCH:
   287       Configure80211p_SCH ();
   300       Configure80211p_SCH ();
   288       break;
   301       break;
       
   302     case WIFI_PHY_STANDARD_80211n_2_4GHZ:
       
   303       Configure80211n_2_4Ghz ();
       
   304       break;
       
   305     case WIFI_PHY_STANDARD_80211n_5GHZ:
       
   306       Configure80211n_5Ghz ();
       
   307       break;
   289     default:
   308     default:
   290       NS_ASSERT (false);
   309       NS_ASSERT (false);
   291       break;
   310       break;
   292     }
   311     }
   293   FinishConfigureStandard (standard);
   312   FinishConfigureStandard (standard);
   358 void
   377 void
   359 WifiMac::Configure80211p_SCH (void)
   378 WifiMac::Configure80211p_SCH (void)
   360 {
   379 {
   361   Configure80211_10Mhz ();
   380   Configure80211_10Mhz ();
   362 }
   381 }
       
   382 void
       
   383 WifiMac::Configure80211n_2_4Ghz (void)
       
   384 {
       
   385   Configure80211g ();
       
   386   SetRifs(MicroSeconds (2));
       
   387   SetCtsTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
       
   388   SetAckTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
       
   389 }
       
   390 void
       
   391 WifiMac::Configure80211n_5Ghz (void)
       
   392 {
       
   393   Configure80211a ();
       
   394   SetRifs(MicroSeconds (2));
       
   395   SetCtsTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
       
   396   SetAckTimeout (MicroSeconds (10 + 52 + 20 + GetDefaultMaxPropagationDelay ().GetMicroSeconds () * 2));
       
   397 }
   363 
   398 
   364 void
   399 void
   365 WifiMac::ConfigureDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum AcIndex ac)
   400 WifiMac::ConfigureDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum AcIndex ac)
   366 {
   401 {
   367   /* see IEE802.11 section 7.3.2.29 */
   402   /* see IEE802.11 section 7.3.2.29 */