Sunteți pe pagina 1din 7

EE440 Dr.

Jane
Dong
OPNET Lab Two – Switches vs. Hubs

(pre-project, Not graded)


Due May 19

Objective

This Lab serves as a pre-project. It will not be graded, but you have to work with your teammates
to get the result, and send the result to Dr. Dong by email. In this lab, again step-by-step
instructions will be provided to you. Through this lab, you shall learn:
• How to use the Rapid Configuration tool
• How to compare the results from different scenarios
• The design of a network simulation for performance evaluation.

Maybe you have heard of hub and switch in your everyday life. Both of them are devices to
connect multiple computers. Hub will forward any incoming frames to all connected
computers, while switch only forward the incoming frame to its destination. For example, as
shown in the following figure, the incoming frame will be forwarded to all three attached
computer by the hub even if its destination is computer 1. However, if switch is used, the frame
will be directly forwarded to computer 1 which is the destination.

hub Switch

1 2 3 1 2 3

Figure 1. Comparison of different forwarding behavior between Hub and Switch

Based on the above description, which do you think is better, hub or switch? Intuitively, switch
should be more efficient. In another words, switch can allow more traffic to pass. As a network
engineer, intuition is not sufficient. We need to provide quantitative measurement to compare the
performance of hub and switch. This lab shows you how to design a network simulation for
performance comparison.

The first step is to consider what criteria to measure the performance. From the user’s aspect of
view, delay is always a good measurement. A more efficient network should provide shorter
delay. Another widely used measurement is called “Throughput”, which is the data amount
transferred in the network per time unit. A more efficient network should allow more traffic to
pass that leads to larger throughput. In your future design, you may want to use these
measurements as well.

The second step is to create a practical network topology and set the applications according to the
simulated scenario. The following section shows to you that how to create a LAN using hub and
switch, and how to compare their performance based on the simulation. Please follow these steps
to complete this lab.
EE440 Dr. Jane
Dong

Step-by-Step Instruction

Step one: create a new project

Start up OPNET IT Guru Academic Edition. Create a new project using the method introduced in
Lab one. Set the Project Name to be x_Switch_vs_Hub (where x is your initial), and set the
Scenario Name to Hub.
In the Initial Topology window, select Create Empty Scenario;
In the Choose Network Scale window, select Office;
In the Specify Size window, accept the default values;
In the Select Technologies window, include the Ethernet and Ethernet_advanced model family.

Step two: create Network Topology

Here I will show you how to quickly create a LAN topology which all computers are connected
using a Hub.

Select the Topology Tab in the menu  Rapid Configuration. Set the Configuration to Star,
and click on OK. Set the Center Node Model to ethernet16_hub. Set the Periphery Node
Model to Ethernet_station. Set the Link Model to 10BasedT, and set the Number to 12. Click
OK to create the LAN.

Step three: Generate Traffic for the LAN

To generate traffic for each Ethernet station, right-click on any of the station and choose Select
Similar Nodes. Next, right click on one of the stations and choose Edit Attributes. Put a check
in the checkbox next to Apply Changes to Selected Objects. Expand the Traffic Generation
Parameters and Packet Generation Arguments attributes, set the On State Time to constant
(1000), and the OFF State Time to constant (0). Thhis will ensure that the stations are always
sending.

Set the Interarrival Time (seconds) to exponential (0.005) and the Packet Size (bytes) to
constant(1000). Click on OK to apply the changes and close the window. Each station will now
generate traffic at an average rate of one 1000-byte packet every 5 ms. Based on this setting, we
know that each station are sending with the following average data rate:
EE440 Dr. Jane
Dong
1000bytes/packet * 8 bits/byte * 1 packet/0.005sec = 1.6 Mbps

Now the hub-based LAN is complete. You should have the following:

Step Four : Configure the Simulation and view the results

Select the Simulation tab  Choose Individual Statistics…


Expand the Global Statistics item and the Ethernet item, and select the Delay
Expand the Traffic Sink item and select the Traffic Received (bits/sec) statistic. Expand the
Traffic Source item and select the Traffic Sent (bits/sec) statistic. (Note: Statistics like traffic
received and traffic sent indicates the value of Throughput)
Click on OK to close the window.
EE440 Dr. Jane
Dong

Select Simulation tab  Configure Discrete Event Simulation…


Under the Common tab, set the Duration to 2, and the unit to minute(s). Click OK to close the
window.

Now you have configured the statistics to collect during the simulation, you can go ahead and run
the simulation to view the results using the method learned in Lab one.
EE440 Dr. Jane
Dong
Step Five :Duplicate the Scenario

So far we have created a simulation scenario using Hub. Don’t forget we need to do the same
thing for switch as well. Since we are comparing their performance, we need to put them in the
same network topology. Fortunately, OPNET allows us to quickly create a similar topology
without going through the above steps again.

Let’s build another scenario using Switch as the center of the LAN.

Choose Scenarios  Duplicate Scenario, and name the new scenario Switch. Click on OK to
create the scenario.

Right-click on the hub and choose Edit Attributes. Left click on the model attribute and choose
enthernet16_switch_adv from the pull-down menu. Also, you can change the name to be
Switch. Click on OK to make the change.

Now you should get the scenario like the following:


EE440 Dr. Jane
Dong
Step Six : Run Simulation and Compare Results

Select the Scenarios tab  Manage Scenarios…


Edit the Results field in both rows and set the values to <collect> or <recollect>
Click on OK to run both scenarios. When the simulation is completed, click on Close to close the
window.

To compare the result, select the Result tab  Compare Results…

Select and expand the Global Statistics item. Under the Ethernet, select Delay. View Delay in
As Is mode. Click on Show for a more detailed graph. This statistic shows the delivery delay for
each Ethernet frame. From the comparison, we can see that the delay for the switch scenario is
small and constant, while the delay for the hub scenario is increasing. Apparently, the switch can
provide faster network service.
EE440 Dr. Jane
Dong
Expand the Traffic Sink and select the Traffic Received (bits/sec) statistics. View the statistics in
As Is mode. Click on Show for a more detailed graph. This statistics shows the total of traffic
received by all stations in the LAN. From the result, we can see that the switch can almost handle
twice traffic as much as the hub.

Using the same method, you can compare the Traffic sent (bits/sec). This should be almost the
same for both scenario, since the stations in both scenario generate same amount of traffic.

Exercise:

The above results are obtained under the assumption that each station are sending data at 1.6
Mbps. Please change the Traffic Generation parameter of each Ethernet station to compare the
performance of Switch and Hub under the following conditions:
1. Each station sends data at around 60 Kbps
2. Each station sends data at around 500 Kbps
3. Each station sends data at around 2.5 Mbps

What conclusion you can make from your above comparison?

Submission:

You need to work as a team to get the comparison results and the conclusion as described in the
exercise. Please Email Dr. Dong your result by the due date (one email per team). Your email
should contain:
• Names of your team members
• The snapshot of the Graph you get from the simulations
• Your conclusion in very brief words (one or two sentences)

I will review your result and provide comments if needed. The purpose is to make sure every of
you acquire the skills of using OPNET in network simulation.

S-ar putea să vă placă și