This laboratory can be found in HTML rendered form here
Authors:
- Jorge Aparicio Rivera (jorapa-7@student.ltu.se)
- Marcus Lund (amuulo-4@student.ltu.se)
The objective of this lab is to:
-
Understand three different Internet traffic types. Namely, constant bit rate (CBR), Normal or Gaussian traffic distribution, and Poisson traffic distribution.
-
Implement three traffic generators based on distributions mentioned above.
We implemented a Node
subclass called Sink
that logs the timestamp of each received packet
to a file. The logged data was used to plot the distribution of the traffic and to extract traffic
statistics.
When designing the generator classes, we decided that the user should only need to specify the time that the generator should run for, along with parameters specific to each generator type.
Like Sink
each generator included functionality to log the timestamps of each sent packet to a
file.
To make comparisons between different generators meaningful we ran all simulations for 10,000 seconds.
Generator_CBR
is a subclass of the Node
class that acts as a traffic generator that produces
Constant Bit Rate (CBR) traffic. Generator_CBR
takes a parameter k
upon construction that
denotes the number of packets to send per second. The behavior of the Generator_CBR
is to send k
packets every second; these k
packets are sent at random times in an interval of 1 second.
To elaborate on the last part: for a value k
of 5 the generator will send five packets between
time t = 2s
and t = 3s
. For example, the timestamps could be 2.3111, 2.6556, 2.4052, 2.1056, 2.0255
.
Below is shown the packet frequency distribution of a CBR generator with parameter k
of 10 packets
per second and that ran for 10,000 seconds.
The above graph was produced by first computing the packet frequency at each one second time interval. We basically translated the log file which looks like this:
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
Into packet frequency data:
10 # t = 0s
10 # t = 1s
And the proceeded to generate an histogram out of that data.
Here we present the distributions observed at the receiver side (sink) for different types of links.
-
A lossless
Link
maintains the distribution observed at the sender so we have omitted the graph. -
A
LossyLink
with 50% chance of dropping packets.
On the generator side we measured a mean packet frequency of 50.0 and a standard deviation of 0.0.
On the sink side we measured a mean of 25.5110 and a standard deviation of 3.5271.
We observed a drop in the mean of about 50% and an increase in the standard deviation, which can both be explained by the loss of packets in the link.
On the generator side we observed a distribution with a single packet frequency (single bin) and on the sink side we observed a normal distribution.
LossyLink
with mean delay of 1.0 and jitter of 0.1.
On the generator side we measured a mean packet frequency of 50.0 and a standard deviation of 0.0.
On the sink side we measured a mean of 49.9947 and a standard deviation of 2.2916.
Once again we observe a normal distribution on the sink node. This time the mean remains approximately the same since there's no packet loss in the link. The jitter produces a variation in the packet frequency as it causes some packets to arrive in a different (later) time frame.
LossyLink
with 50% chance of dropping packets, mean delay of 1.0 and jitter of 0.1.
On the generator side we measured a mean packet frequency of 50.0 and a standard deviation of 0.0.
On the sink side we measured a mean of 25.5240 and a standard deviation of 3.3702.
This run is similar to the first LossyLink
simulation. We also observed a 50% decrease in the mean
value due to packet loss. The standard deviation was a bit higher than in the first simulation; the
higher deviation is probably caused by the jitter.
Generator_POISSON
is a subclass of the Node
class that acts as a traffic generator that produces
traffic that follows a Poisson distribution.
From wikipedia 1 we know that:
The Poisson distribution (..) is a discrete probability distribution that expresses the probability of a given number of events occurring in a fixed interval of time or space if these events occur with a known constant rate and independently of the time since the last event.
Generator_POISSON
takes a parameter lambda
that represents the number of expected occurrences.
We'll re-use the approach we used to implement the Generator_CBR
and have the Generator_POISSON
produce k
packets per second, but this time the value k
will change every second; the value k
will be drawn from a Poisson random number generator parameterized by the parameter lambda
.
Below is shown the packet frequency distribution of a Poisson generator with parameter lambda
of
10 packets per second and that ran for 10,000 seconds.
Here we present the distributions observed at the receiver side (sink) for different types of links.
-
A lossless
Link
maintains the distribution observed at the sender so we have omitted the graph. -
A
LossyLink
with 50% chance of dropping packets.
On the generator side we measured a mean packet frequency of 9.9546 and a standard deviation of 3.1634.
On the sink side we measured a mean of 5.0802 and a standard deviation of 2.2468.
We observed that the mode (most common) value, the lambda
parameter of the Poisson distribution,
dropped to 5 on the sink side. This can be explained by the loss of packets in the link.
LossyLink
with mean delay of 1.0 and jitter of 0.1.
On the generator side we measured a mean packet frequency of 10.0406 and a standard deviation of 3.1635.
On the sink side we measured a mean of 10.0395 and a standard deviation of 3.1785.
We didn't observe much difference between the generator and the sink. The jitter effect doesn't seem to affect much the Poisson distribution.
LossyLink
with 50% chance of dropping packets, mean delay of 1.0 and jitter of 0.1.
On the generator side we measured a mean packet frequency of 9.9507 and a standard deviation of 3.1539.
On the sink side we measured a mean of 5.0825 and a standard deviation of 2.2541.
As in the first LossyLink
simulation we observe that the most common frequency on the sink side
dropped from 10 to 5.
Generator_NORMAL
is a subclass of the Node
class that acts as a traffic generator that produces
traffic that follows a Normal (Gaussian) distribution 2.
Generator_NORMAL
takes two parameters, mu
and sigma
, upon construction. These parameters
denote the mean and standard deviation of the normal distribution used to generate traffic.
Generator_NORMAL
has a very similar implementation to Generator_POISSON
's; the main difference
is that the parameter k
will be drawn from a normal random number generator.
Below is shown the packet frequency distribution of a Normal / Gaussian generator with a mean of 10 and a standard deviation of 2 that ran for 10,000 seconds.
When measuring the actual mean and standard deviation on the data we got: 9.5124 for the mean and 2.0295 for the standard deviation. These values are pretty close to the parameters of the generator.
Here we present the distributions observed at the receiver side (sink) for different types of links.
-
A lossless
Link
maintains the distribution observed at the sender so we have omitted the graph. -
A
LossyLink
with 50% chance of dropping packets.
On the generator side we measured a mean packet frequency of 9.5124 and a standard deviation of 2.0295.
On the sink side we measured a mean of 4.6628 and a standard deviation of 1.8498.
The traffic distribution at the sink side also looks like a normal distribution but with a mean of about half the original one. This decrease in the mean can be explained by the packet loss in the link.
LossyLink
with mean delay of 1.0 and jitter of 0.1.
On the generator side we measured a mean packet frequency of 9.5212 and a standard deviation of 2.0222.
On the sink side we measured a mean of 9.5193 and a standard deviation of 2.2162.
The traffic distribution on the sink side also looks like a normal distribution but with slightly larger standard deviation.
LossyLink
with 50% chance of dropping packets, mean delay of 1.0 and jitter of 0.1.
On the generator side we measured a mean packet frequency of 9.4974 and a standard deviation of 2.0195.
On the sink side we measured a mean of 4.8567 and a standard deviation of 1.9262.
This run is similar to the first LossyLink
simulation. We also observed a 50% decrease in the mean
value due to packet loss. The standard deviation was a bit higher than in the first simulation; the
higher deviation is probably caused by the jitter.