Research
Research
#include <fstream>
#include "ns3/core-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/internet-module.h"
#include "ns3/applications-module.h"
#include "ns3/network-module.h"
#include "ns3/packet-sink.h"
//step1: add the following header files
#include "ns3/flow-monitor.h"
#include "ns3/flow-monitor-helper.h"
#include "ns3/traffic-control-module.h"
uint32_t maxBytes = 0;
NodeContainer nodes;
nodes.Create (2);
PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue
("500Kbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue
("5ms"));
NetDeviceContainer devices;
devices = pointToPoint.Install (nodes);
InternetStackHelper internet;
internet.Install (nodes);
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = ipv4.Assign (devices);
uint32_t port = 9;
AsciiTraceHelper ascii;
pointToPoint.EnableAsciiAll (ascii.CreateFileStream
("5.tr"));
Simulator::Destroy ();