Lines 57-65
void StartFlow(Ptr<Socket>, Ipv4Address,
|
Link Here
|
---|
|
57 |
void StartFlow(Ptr<Socket>, Ipv4Address, uint16_t); |
57 |
void StartFlow(Ptr<Socket>, Ipv4Address, uint16_t); |
58 |
void WriteUntilBufferFull (Ptr<Socket>, uint32_t); |
58 |
void WriteUntilBufferFull (Ptr<Socket>, uint32_t); |
59 |
|
59 |
|
|
|
60 |
static void |
61 |
CwndTracer (uint32_t oldval, uint32_t newval) |
62 |
{ |
63 |
NS_LOG_INFO ("Moving cwnd from " << oldval << " to " << newval); |
64 |
} |
65 |
|
60 |
int main (int argc, char *argv[]) |
66 |
int main (int argc, char *argv[]) |
61 |
{ |
67 |
{ |
62 |
|
|
|
63 |
// Users may find it convenient to turn on explicit debugging |
68 |
// Users may find it convenient to turn on explicit debugging |
64 |
// for selected modules; the below lines suggest how to do this |
69 |
// for selected modules; the below lines suggest how to do this |
65 |
// LogComponentEnable("TcpL4Protocol", LOG_LEVEL_ALL); |
70 |
// LogComponentEnable("TcpL4Protocol", LOG_LEVEL_ALL); |
Lines 67-75
int main (int argc, char *argv[])
|
Link Here
|
---|
|
67 |
// LogComponentEnable("PacketSink", LOG_LEVEL_ALL); |
72 |
// LogComponentEnable("PacketSink", LOG_LEVEL_ALL); |
68 |
// LogComponentEnable("TcpLargeTransfer", LOG_LEVEL_ALL); |
73 |
// LogComponentEnable("TcpLargeTransfer", LOG_LEVEL_ALL); |
69 |
|
74 |
|
70 |
|
|
|
71 |
// Allow the user to override any of the defaults and the above |
72 |
// Bind()s at run-time, via command-line arguments |
73 |
CommandLine cmd; |
75 |
CommandLine cmd; |
74 |
cmd.Parse (argc, argv); |
76 |
cmd.Parse (argc, argv); |
75 |
|
77 |
|
Lines 140-145
int main (int argc, char *argv[])
|
Link Here
|
---|
|
140 |
Socket::CreateSocket (n0n1.Get (0), TcpSocketFactory::GetTypeId ()); |
142 |
Socket::CreateSocket (n0n1.Get (0), TcpSocketFactory::GetTypeId ()); |
141 |
localSocket->Bind (); |
143 |
localSocket->Bind (); |
142 |
|
144 |
|
|
|
145 |
// Trace changes to the congestion window |
146 |
Config::ConnectWithoutContext ("/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow", MakeCallback (&CwndTracer)); |
147 |
|
143 |
// ...and schedule the sending "Application"; This is similar to what an |
148 |
// ...and schedule the sending "Application"; This is similar to what an |
144 |
// ns3::Application subclass would do internally. |
149 |
// ns3::Application subclass would do internally. |
145 |
Simulator::ScheduleNow (&StartFlow, localSocket, |
150 |
Simulator::ScheduleNow (&StartFlow, localSocket, |