View | Details | Raw Unified | Return to bug 2520
Collapse All | Expand All

(-)a/examples/wireless/wifi-tcp.cc (-2 / +62 lines)
 Lines 62-68    Link Here 
62
{
62
{
63
  uint32_t payloadSize = 1472;                       /* Transport layer payload size in bytes. */
63
  uint32_t payloadSize = 1472;                       /* Transport layer payload size in bytes. */
64
  std::string dataRate = "100Mbps";                  /* Application layer datarate. */
64
  std::string dataRate = "100Mbps";                  /* Application layer datarate. */
65
  std::string tcpVariant = "ns3::TcpNewReno";        /* TCP variant type. */
65
  std::string tcpVariant = "TcpNewReno";             /* TCP variant type. */
66
  std::string phyRate = "HtMcs7";                    /* Physical layer bitrate. */
66
  std::string phyRate = "HtMcs7";                    /* Physical layer bitrate. */
67
  double simulationTime = 10;                        /* Simulation time in seconds. */
67
  double simulationTime = 10;                        /* Simulation time in seconds. */
68
  bool pcapTracing = false;                          /* PCAP Tracing is enabled or not. */
68
  bool pcapTracing = false;                          /* PCAP Tracing is enabled or not. */
 Lines 71-77    Link Here 
71
  CommandLine cmd;
71
  CommandLine cmd;
72
  cmd.AddValue ("payloadSize", "Payload size in bytes", payloadSize);
72
  cmd.AddValue ("payloadSize", "Payload size in bytes", payloadSize);
73
  cmd.AddValue ("dataRate", "Application data ate", dataRate);
73
  cmd.AddValue ("dataRate", "Application data ate", dataRate);
74
  cmd.AddValue ("tcpVariant", "Transport protocol to use: TcpTahoe, TcpReno, TcpNewReno, TcpWestwood, TcpWestwoodPlus ", tcpVariant);
74
  cmd.AddValue ("tcpVariant", "Transport protocol to use: TcpNewReno, "
75
                "TcpHybla, TcpHighSpeed, TcpHtcp, TcpVegas, TcpScalable, TcpVeno, "
76
                "TcpBic, TcpYeah, TcpIllinois, TcpWestwood, TcpWestwoodPlus ", tcpVariant);
75
  cmd.AddValue ("phyRate", "Physical layer bitrate", phyRate);
77
  cmd.AddValue ("phyRate", "Physical layer bitrate", phyRate);
76
  cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
78
  cmd.AddValue ("simulationTime", "Simulation time in seconds", simulationTime);
77
  cmd.AddValue ("pcap", "Enable/disable PCAP Tracing", pcapTracing);
79
  cmd.AddValue ("pcap", "Enable/disable PCAP Tracing", pcapTracing);
 Lines 81-86    Link Here 
81
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("999999"));
83
  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("999999"));
82
  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("999999"));
84
  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("999999"));
83
85
86
  // Select TCP variant
87
  if (tcpVariant.compare ("TcpNewReno") == 0)
88
    {
89
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::GetTypeId ()));
90
    }
91
  else if (tcpVariant.compare ("TcpHybla") == 0)
92
    {
93
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHybla::GetTypeId ()));
94
    }
95
  else if (tcpVariant.compare ("TcpHighSpeed") == 0)
96
    {
97
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHighSpeed::GetTypeId ()));
98
    }
99
  else if (tcpVariant.compare ("TcpVegas") == 0)
100
    {
101
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpVegas::GetTypeId ()));
102
    }
103
  else if (tcpVariant.compare ("TcpScalable") == 0)
104
    {
105
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpScalable::GetTypeId ()));
106
    }
107
  else if (tcpVariant.compare ("TcpHtcp") == 0)
108
    {
109
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHtcp::GetTypeId ()));
110
    }
111
  else if (tcpVariant.compare ("TcpVeno") == 0)
112
    {
113
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpVeno::GetTypeId ()));
114
    }
115
  else if (tcpVariant.compare ("TcpBic") == 0)
116
    {
117
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpBic::GetTypeId ()));
118
    }
119
  else if (tcpVariant.compare ("TcpYeah") == 0)
120
    {
121
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpYeah::GetTypeId ()));
122
    }
123
  else if (tcpVariant.compare ("TcpIllinois") == 0)
124
    {
125
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpIllinois::GetTypeId ()));
126
    }
127
  else if (tcpVariant.compare ("TcpWestwood") == 0)
128
    { // the default protocol type in ns3::TcpWestwood is WESTWOOD
129
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
130
      Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN));
131
    }
132
  else if (tcpVariant.compare ("TcpWestwoodPlus") == 0)
133
    {
134
      Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
135
      Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS));
136
      Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN));
137
    }
138
  else
139
    {
140
      NS_LOG_DEBUG ("Invalid TCP version");
141
      exit (1);
142
    }
143
  
84
  /* Configure TCP Options */
144
  /* Configure TCP Options */
85
  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (payloadSize));
145
  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (payloadSize));
86
146

Return to bug 2520