You are on page 1of 6

CS549: Performance Analysis of Computer Networks

Lab Assignment-2
- Rohan Raj Kansal (B19108)

Answer 1.
Objective:
To measure the execution time of running a while loop N times using
three methods,
a. Using the stopwatch function on cellphone
b. Using the time function
c. Using the time() + getrusage() function

We vary N from 10 to 1000000 to observe the differences in the methods:

Value of N Execution time Execution time Execution time


measured using measured using measured using
stopwatch time() function time()+getrusage()
(in ms) (in ms) function (in ms)
10 1.4 0 0
100 1.7 0 0
1000 2 0 1
10000 2.4 0 93
100000 9140 9000 8988
20000 36520 36000 36000
25000 55740 55000 55194

Execution time measured using the stopwatch is susceptible to errors


because the person performing the measurement has to manually start and
stop the stopwatch to measure the time.

Execution time measured using time() function is less precise as can be


seen from the measurements from N=10 to N=10000.
Execution time measured using the time()+getrusage() gives the most
accurate results.

Answer 2.
Objective:
To analyze the Throughput by varying various factors
Results can be found in results_Question2.txt

Answer 3.
Objective:
To create different network namespaces and establish a connection
between them using SSH.

1. Pinging Without adding queueing Delay


2. Pinging with adding fixed Delay

3. Pinging with variable Delay


Inferences:
1. We can see that the ping in the first case is almost 0.
2. In the second case we can see that the ping has a delay of 50ms
added to it as specified by the queueing delay in command.
3. In the third case we can see that the ping is 50ms +- 10ms variation.

Analyzing the packets using Wireshark:


1. Pinging from Net1(192.0.2.1) to Net2(192.0.2.2)
2. Using SSH from Net2 to connect to Net1

a. To establish a passwordless SSH we need to place the


public key of Net2 in Net1 so that Net1 allows access to
Net2 without asking for the password.
b. Use `ssh-keygen -t rsa` in Net2 and append the .pub file
generated to `~/.ssh/authorized_keys`.

Using Wireshark to analyze the flow of Packets while SSHing


1. While Connecting Using SSH:
2. While Pinging from Net1 to Net2 when SSHing from NET2 to Net1:

You might also like