Skip to content

Commit

Permalink
examples: rl-tcp: fix build with ns-3.38
Browse files Browse the repository at this point in the history
TcpWestwood has been removed
  • Loading branch information
a-andre authored and pgawlowicz committed May 9, 2023
1 parent bb54c88 commit f8638f2
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions examples/rl-tcp/sim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int main (int argc, char *argv[])
cmd.AddValue ("nLeaf", "Number of left and right side leaf nodes", nLeaf);
cmd.AddValue ("transport_prot", "Transport protocol to use: TcpNewReno, "
"TcpHybla, TcpHighSpeed, TcpHtcp, TcpVegas, TcpScalable, TcpVeno, "
"TcpBic, TcpYeah, TcpIllinois, TcpWestwood, TcpWestwoodPlus, TcpLedbat, "
"TcpBic, TcpYeah, TcpIllinois, TcpWestwoodPlus, TcpLedbat, "
"TcpLp, TcpRl, TcpRlTimeBased", transport_prot);
cmd.AddValue ("error_p", "Packet error rate", error_p);
cmd.AddValue ("bottleneck_bandwidth", "Bottleneck bandwidth", bottleneck_bandwidth);
Expand Down Expand Up @@ -180,19 +180,9 @@ int main (int argc, char *argv[])
Config::SetDefault ("ns3::TcpL4Protocol::RecoveryType",
TypeIdValue (TypeId::LookupByName (recovery)));
// Select TCP variant
if (transport_prot.compare ("ns3::TcpWestwoodPlus") == 0)
{
// TcpWestwoodPlus is not an actual TypeId name; we need TcpWestwood here
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ()));
// the default protocol type in ns3::TcpWestwood is WESTWOOD
Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS));
}
else
{
TypeId tcpTid;
NS_ABORT_MSG_UNLESS (TypeId::LookupByNameFailSafe (transport_prot, &tcpTid), "TypeId " << transport_prot << " not found");
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TypeId::LookupByName (transport_prot)));
}
TypeId tcpTid;
NS_ABORT_MSG_UNLESS (TypeId::LookupByNameFailSafe (transport_prot, &tcpTid), "TypeId " << transport_prot << " not found");
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TypeId::LookupByName (transport_prot)));

// Configure the error model
// Here we use RateErrorModel with packet error rate
Expand Down

0 comments on commit f8638f2

Please sign in to comment.