r***@gmail.com
2018-12-07 06:39:47 UTC
int main(int argc, char *argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
Time::SetResolution(Time::NS);
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
NodeContainer nodes1,nodes2;
nodes1.Create(2);
nodes2.Create(2);
PointToPointHelper pointToPoint1,pointToPoint2;
pointToPoint1.SetDeviceAttribute("DataRate", StringValue("5Mbps"));
pointToPoint1.SetChannelAttribute("Delay", StringValue("2ms"));
pointToPoint2.SetDeviceAttribute("DataRate", StringValue("5Mbps"));
pointToPoint2.SetChannelAttribute("Delay", StringValue("2ms"));
NetDeviceContainer devices1,devices2;
devices1 = pointToPoint1.Install(nodes1);
devices2 = pointToPoint2.Install(nodes2);
InternetStackHelper stack1,stack2;
stack1.Install(nodes1);//
stack2.Install(nodes2);
Ipv4AddressHelper address1;
address1.SetBase("10.1.1.0", "255.255.255.0");
Ipv4AddressHelper address2;
address2.SetBase("10.5.4.0", "255.255.255.0");
Ipv4InterfaceContainer interfaces1 = address1.Assign(devices1);
Ipv4InterfaceContainer interfaces2 = address2.Assign(devices2);
{
CommandLine cmd;
cmd.Parse(argc, argv);
Time::SetResolution(Time::NS);
LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
NodeContainer nodes1,nodes2;
nodes1.Create(2);
nodes2.Create(2);
PointToPointHelper pointToPoint1,pointToPoint2;
pointToPoint1.SetDeviceAttribute("DataRate", StringValue("5Mbps"));
pointToPoint1.SetChannelAttribute("Delay", StringValue("2ms"));
pointToPoint2.SetDeviceAttribute("DataRate", StringValue("5Mbps"));
pointToPoint2.SetChannelAttribute("Delay", StringValue("2ms"));
NetDeviceContainer devices1,devices2;
devices1 = pointToPoint1.Install(nodes1);
devices2 = pointToPoint2.Install(nodes2);
InternetStackHelper stack1,stack2;
stack1.Install(nodes1);//
stack2.Install(nodes2);
Ipv4AddressHelper address1;
address1.SetBase("10.1.1.0", "255.255.255.0");
Ipv4AddressHelper address2;
address2.SetBase("10.5.4.0", "255.255.255.0");
Ipv4InterfaceContainer interfaces1 = address1.Assign(devices1);
Ipv4InterfaceContainer interfaces2 = address2.Assign(devices2);
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+***@googlegroups.com.
To post to this group, send email to ns-3-***@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+***@googlegroups.com.
To post to this group, send email to ns-3-***@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.