Comp3331 lab6 Solved

$ 29.99
Category:

Description

Exercise 1: Setting up NS2 simulation for measuring
TCP throughput
(submit the completed file exercise2.tcl and throughput.plot separately and answer the questions on throughput behaviour in the report)
Consider the topology shown in the following figure where bandwidth and delay for each link is shown.

You have been provided with a stub tcl file exercise2.tcl . Your task is to complete the stub file so that it runs with ns and produces two trace files tcp1.tr and tcp2.tr, and nam.out. Check the animation for the simulation using nam.out file. Next write a script named “throughput.plot” (referenced from within exercise2.tcl in procedure finish( ) ) to plot the throughput received by host n5 for two flows terminating at n5. Uncomment the line (#exec gnuplot throughput.plot &) to execute gnuplot. You have been provided with the throughput plot TCPThroughput.png produced by gnuplot for comparing your final output.
“>>” in the stub file indicates that one (or more) lines need to be added. Remove the “>>” and insert the required code.
Consider the following traffic pattern for your simulation.
FTP/TCP Source n0 -> TCP Sink n5 : start time: 0.5 sec End time: 8.5 sec
FTP/TCP Source n3 -> TCP Sink n5 : start time: 2.0 sec End time: 9.5 sec
FTP/TCP Source n7 -> TCP Sink n0 : start time: 3.0 sec End time: 9.5 sec
FTP/TCP Source n7 -> TCP Sink n3 : start time: 4.0 sec End time: 7.0 sec
You have to submit your completed tcl file (exercise2.tcl) and the script (throughput.plot) for producing the throughput plot. Comment on the throughput behaviour observed in the simulation by answering the following questions.

Question 1: Why the throughput achieved by flow tcp2 is higher than tcp1 between time span 6 sec to 8 sec?
Answer:
Because RTT and number of flows competing of link bandwidth.
TCP1 will competing with TCP4 on link n1-n2, with TCP2 on link n2-n4
TCP2 has less RTT than tcp1, so TCP2 gets high share of bandwidth on link n2-n4.Thus the final throughput will higher.
Question 2: Why the throughput for flow tcp1 is fluctuating between time span 0.5 sec to 2 sec?
Answer:
At that time, TCP1 is doing the slow-start stage.

Question 3: Why is the maximum throughput achieved by any one flow capped at around
1.5Mbps?
Answer:
At the 0.5-2.0 sec, tcp1 is the only flow but it is in the slow-start stage and not archieve the maximum bandwidth . After TCP2 enter at 2.0 sec, it will compete with TCP1 and share the bandwidth with TCP1 which lead to TCP1 cannot get higher throughput.

Exercise 2: Understanding IP Fragmentation
(Include in your report)
We will try to find out what happens when IP fragments a datagram by increasing the size of a datagram until fragmentation occurs. You are provided with a Wireshark trace file IPfrag_trace that contains trace of sending pings with specific payloads to 8.8.8.8. We have used ping with option ( – s option on Linux) to set the size of data to be carried in the ICMP echo request message. Note that the default packet size is 64 bytes in Linux (56 bytes data + 8 bytes ICMP header). Also note that Linux implementation for ping also uses 8 bytes of ICMP time stamp option leaving 48 bytes for the user data in the default mode. Once you have send a series of packets with the increasing data sizes, IP will start fragmenting packets that it cannot handle. We have used the following commands to generate this trace file.
Step 1: Ping with default packet size to the target destination as 8.8.8.8
ping -c 3 8.8.8.8
Step 2: Repeat by sending a set of ICMP requests with data of 2000.
ping -s 2000 -c 3 8.8.8.8
Step 3: Repeat again with data size set as 3500
ping -s 3500 -c 3 8.8.8.8
Question 1: Which data size has caused fragmentation and why? Which host/router has fragmented the original datagram? How many fragments have been created when data size is specified as 2000?
Answer:

2000 and 3500, Because the MTU is 1500 bytes.
192.168.1.103 fragmented the original datagram.
2 fragments have been created.

Question 2: Did the reply from the destination 8.8.8.8. for 3500-byte data size also get fragmented? Why and why not?
Answer:
Yes, Since the MTU for the last link is 1500bytes and it has to put the last link to sender.
Question 3: Give the ID, length, flag and offset values for all the fragments of the first packet sent by 192.168.1.103 with data size of 3500 bytes?

Id: 0x7a7b length: 1500 flag: 0x01 offset: 0

Id: 0x7a7b length: 1500 flag: 0x01 offset: 1480

Id: 0x7a7b length: 568 flag: 0x00 offset: 2960
Question 4: Has fragmentation of fragments occurred when data of size 3500 bytes has been used? Why and why not?
No fragmentation from 8.8.8.8 to 192.168.1.103, we have three fragments, no fragmentation of fragments. And we can not sure about the fragmentation from 192.168.1.103 to 8.8.8.8, because the reassembled only occur the destination.
Question 5: What will happen if for our example one fragment of the original datagram from 192.168.1.103 is lost?
Fragment will be incomplete and receiver will discard.
Exercise 3: Understanding the Impact of Network
Dynamics on Routing
(include in your report)
In this exercise, we will observe how routing protocols react when network conditions change (e.g., a network link fails) using a ns-2 simulation.
The provided script, tp_routing.tcl takes no arguments and generates the network topology shown in the figure below.

You can run the simulation with the following command:
$ns tp_routing.tcl
Step 1: Run the script and observe the NAM window output.
Question 1: Which nodes communicate with which other nodes? Which route do the packets follow? Does it change over time?
Answer:
node0->node5 (0->1->4->5)
node2->node5 (2->3->5) Does not change.
Note: You can also answer the above question by examining the simulation setting in the script file.
Step 2: Modify the script by uncommenting the following two lines (line No 84 and 85):
$ns rtmodel-at 1.0 down $n1 $n4
$ns rtmodel-at 1.2 up $n1 $n4
Step 3: Rerun the simulation and observe the NAM window output.
NOTE: Ignore the NAM syntax warnings on the terminal. These will not affect the simulation.
Question 2: What happens at time 1.0 and at time 1.2? Does the route between the communicating nodes change as a result of that?
Answer:

At time 1.0, link n1 -> n4 goes down. Node 0 can not reach node 5,and packet are wait at node 1 but node 2 still can go node 5.
At time 1.2, link n1->n4 goes up. Node 0 can reach node 5. Node 1 can go node4.
No influence on node 2 and node 5.
Step 4: The nodes in the simulation above use a static routing protocol (i.e., preferred routes do not change over time). We are going to change that, so that they use a Distance-Vector routing protocol. Modify the script and uncomment the following line (Line No 16) before the definition of the finish procedure.
$ns rtproto DV
Step 5: Rerun the simulation and observe the NAM window output.
Question 3: Did you observe any additional traffic as compared to Step 3 above? How does the network react to the changes that take place at time 1.0 and time 1.2 now?
Answer:
Yes, When the link n1 -> n4 goes down, Node 0 to node 5 will use a another path
0->1->2->3->5 and when n1-n4 goes up, it will 0-1-4-5

Step 6: Comment the two lines (Lines 84 and 85) that you had added to the script in Step 2 and uncomment the following line ( Line 87) instead:
$ns cost $n1 $n4 3
Step 7: Rerun the simulation and observe the NAM window output.
Question 4: How does this change affect the routing? Explain why.
Answer:
It increase the n1-n4 cost to 3 and the total cost for route 0-1-4-5 is 5
And 0-1-2-3-5 will be 4. We choose lower cost route. So for node 0 to node 5 will use route 0-1-2-3-5
Step 8: Comment line 87 and Uncomment the following lines (Lines 89 and 90):
$ns cost $n1 $n4 2 $ns cost $n3 $n5 3
and uncomment the following (Line 29), which is located right after the finish procedure definition:
Node set multiPath_ 1
Step 9: Rerun the simulation and observe the NAM window output.
Question 5: Describe what happens and deduce the effect of the line you just uncommented.
Answer:
For node 0 to node 5, route 0-1-4-5 is still the lower cost (4) route. But for node 2 to node 5,route 2-3-5 and 2-1-4-5 has the same cost 4 and it will split equally on these two routes.

Reviews

There are no reviews yet.

Be the first to review “Comp3331 lab6 Solved”

Your email address will not be published. Required fields are marked *