Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a topology with two nodes that are connected by a link and consider the listed ns-3 code (page 4): (a) Create two nodes

Define a topology with two nodes that are connected by a link and consider the listed ns-3 code (page 4): (a) 1#include

Define a topology with two nodes that are connected by a link and consider the listed ns-3 code (page 4): (a) Create two nodes and connect these two nodes with a link having bandwidth of 5 Megabits per second as the data rate and a delay of 5 milliseconds. Insert your code in lines 20, 23, and 24. (b) Under the UdpEcho ClientHelper subject, create a traffic source. The packet size is set to 1,024 bytes and the packet will be sent every 1 second. The maximum number of packets that a client is allowed to send during the simulation is set to 5. Insert your code in lines 44-46. (c) Schedule the events client application to start at 2 seconds and end at 15 seconds. Insert your code in lines 49-50. (d) Describe the difference between the methods used in lines 40-41 and lines 49-50. (e) List the command to run ns-3 scripts. List and describe two functions used to collect and to read simulation results. 1#include "as3/core-module.h #include "as3/network-module.h #include "ns3/internet-module.h" 4 #include "as3/point-to-point-module.h #include "as3/applications-module.h 7 using namespace ns3; 8NSLOG COMPONENT DEFINE (midterm.exam 2018"); 9 int 10 main (int arge, char sargy []) 11( 12 CommandLine cmd; 13 14 15 Time::Set Resolution (Time:: NS); 16 17 18 19 20 21 22 23 24 25 26 27 28 29 InternetStackHelper stack; stack.Install (nodes); 30 31 32 33 34 35 36 emd.Parse (arge, argv); 42 43 44 45 46 47 48 49 Log Component Enable ("UdpEchoClient Application". LOG LEVEL.INFO); Log Component Enable ("UdpEchoServer Application", LOG.LEVEL.INFO): NodeContainer nodes; Point ToPoint Helper pointToPoint; Net Device Container devices; devices pointToPoint Install (nodes); Ipv4AddressHelper address; address.Set Base ("10.1.1.0", "255.255.255.0"); Ipv 4Interface Container interfaces= address. Assign (devices); 37 UdpEchoServerHelper echoServer (9): 38 39 Application Container server Apps echoServer.Install odes.Get (1)); 40 serverApps.Start (Seconds (1.0)); serverApps.Stop (Seconds (20.0)); #fill in here for part (a) #fill in here for part (a) fill in here for part (a) UdpEchoClientHelper echoClient (interfaces.GetAddress (1), 9); #fill in here for part (b) #fill in here for part (b) #fill in here for part (b) 50 51 52 53 return 0; 54} Application Container client Apps = echoClient. Install (nodes.Get (0)); #fill in here for part (e) #fill in here for part (e) Simulator:: Run ():

Step by Step Solution

There are 3 Steps involved in it

Step: 1

a Create two nodes Ptr node1 CreateObject Ptr node2 CreateObject Create a pointtopoint link between the two nodes with specified properties PointToPointHelper pointToPoint pointToPointSetDeviceAttribu... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Smith and Roberson Business Law

Authors: Richard A. Mann, Barry S. Roberts

15th Edition

1285141903, 1285141903, 9781285141909, 978-0538473637

More Books

Students also viewed these Computer Network questions

Question

Appendix E: Practice Set Assignments

Answered: 1 week ago