Lab Report 1-4
Lab Report 1-4
Lab Report 1
COSC2174 – Data Communication and
Net-Centric Computing
Learning Outcomes:
1. The art of experimentation
2. Experimental and analytical skills
3. Conceptual learning
4. Understanding the basis of Networking
5. Analyze properties of signals
6. Developing collaborative learning skills
Section 2
Falstad Circuit Simulator: .................................................................................................... 17
1. Objectives .......................................................................................................................... 17
2. Introduction on Falstad circuit simulator ............................................................................. 17
3. Exercises ............................................................................................................................ 17
4. References ......................................................................................................................... 18
Page 2
This lab report comprises primarily of two sections: one pertains to the Wireshark analysis
(referred to as Lab 1), and the other is centered around the Electronic Circuit Simulator.
Page 3
Lab 1: Network Interface and Wireshark
1. Objectives
The objective of the lab 1 is to:
▪
Learn the basics of networking in terms of network interfaces and traffic capturing,
▪
Run basic examples using Wireshark for understanding how information travel in a network,
▪
Understand what a packet and the fields inside it is.
Networking Layers: The Open Systems Interconnection model (OSI model) is a conceptual model that
characterizes and standardizes the communication functions of a telecommunication or computing system
without regard to their underlying internal structure and technology. Its goal is the interoperability of
diverse communication systems with standard protocols. The model partitions a communication system
into abstraction layers. The original version of the model defined seven layers as shown in Table 1.
Page 4
Network Packets: A network packet is a formatted unit of data carried by a packet-switched network.
When data is formatted into packets, packet switching is possible, and the bandwidth of the communication
medium can be better shared among users. A packet consists of control information and user data, which is
also known as the payload. Control information provides data for delivering the payload, for example:
source and destination network addresses, error detection codes, and sequencing information. Typically,
control information is found in packet headers and trailers.
Network Interface: The Network Interface connects a computer to the network media over which
transmissions are sent and received. A Network Interface is the combination of the physical components of
a network adapter and the logical component of the Local Area Connection associated with that adapter. It
is the entity to which the connectivity and security settings apply.
• Physical Network Interface: A physical network interface is the network adapter. A network
adapter is a piece of hardware dedicated to capturing and pre-processing data packets arriving at a
host computer. The network adapter is for wired or wireless interfaces.
• Local Area Connection: The network configuration interface settings of your computer (or
network device) determine the way in which it communicates with other computers and devices on
the network, it may be wired or wireless.
Hypertext Transfer Protocol (HTTP): The Hypertext Transfer Protocol (HTTP) is an application
protocol for distributed, collaborative, and hypermedia information systems. HTTP is the foundation of
data communication for the World Wide Web. Hypertext is structured text that uses logical links
(hyperlinks) between nodes containing text. HTTP is the protocol to exchange or transfer hypertext.
Network tool Wireshark: Wireshark is the world’s foremost and widely used network protocol analyzer.
It lets you see what’s happening on your network at a microscopic level. Wireshark is a free and open-
source packet analyzer. It is used for network troubleshooting, analysis, software and communications
protocol development, and education. Wireshark is a data capturing program that "understands" the
structure (encapsulation) of different networking protocols. It can parse and display the fields, along with
their meanings as specified by different networking protocols. Wireshark uses pcap to capture packets, so
it can only capture packets on the types of networks that pcap supports.
• Data can be captured "from the wire" from a live network connection or read from a file of already-
captured packets.
• Live data can be read from different types of networks, including Ethernet, IEEE 802.11, PPP, and
loopback.
• Captured network data can be browsed via a GUI, or via the terminal (command line) version of
the utility, Wireshark.
• Captured files can be programmatically edited or converted via command-line switches to the
“editcap” program.
• Data display can be refined using a display filter.
Page 5
• Plug-ins can be created for dissecting new protocols.
• Wireless connections can also be filtered as long as they traverse the monitored Ethernet.
• Various settings, timers, and filters can be set that ensure only triggered traffic appear.
3. Methodology
In order to understand networks and network protocols the methodology used will be by “seeing networks
and protocols in action” and by “playing around with networks and protocols”. This can be done in
simulated scenarios or in a “real” network environment. In the Network Interface and Wireshark lab you
will be running various network applications in different scenarios using your own computer. You will
observe the network and network protocols in your computer “in action,” interacting and exchanging
messages with protocol entities executing elsewhere on the Internet. Thus, you and your computer will be
an integral part of these “live labs”. You will observe, and you will learn, by doing.
In this first section, you will get familiar with the wired network interface of your computer and collect
information that you will be using in this and the coming labs. In order to get the wired network interface
details, follow the steps bellow:
• STEP 1: Open the Control Panel in your computer, by clicking on the option
Page 6
Complete the following table using the information provided on the Details option.
Property Value
Physical Address
DHCP Enabled
IPv4 Address
IPv4 Subnet Mask
IPv4 DNS Servers
Keep this data available for the future; you will be able to understand all these data when all the topics will
be covered on the lectures. At this point in the next section, you will be capturing the data sent/received on
this network interface.
For the MacBook users, type “network” in the search bar. Then select “Network- System Settings”.
3.2. Wireshark
In this section, you’ll get acquainted with Wireshark, and make some simple packet captures and
observations.
The basic tool for observing the messages exchanged between executing protocol entities is called a packet
sniffer. As the name suggests a packet sniffer captures (“sniffs”) messages being sent/received from/by
your computer, it will also typically store and/or display the contents of the various protocol fields in these
captured messages. A packet sniffer itself is passive. It observes messages being sent and received by
applications and protocols running on your computer, but never sends packets itself. Similarly, received
packets are never explicitly addressed to the packet sniffer. Instead, a packet sniffer receives a copy of
packets that are sent/received from/by application and protocols executing on your machine.
Page 7
packet sniffer
operating
packet
Figure 2 shows the structure of a packet sniffer. At the right of Figure 2 are the protocols (in this case,
Internet protocols) and applications (such as a web browser or ftp client) that normally run on your
computer. The packet sniffer, shown within the dashed rectangle in Figure 2 is an addition to the usual
software in your computer, and consists of two parts. The packet capture library receives a copy of every
link-layer frame that is sent from or received by your computer. The messages exchanged by higher layer
protocols such as HTTP, FTP, TCP, UDP, DNS, or IP all are eventually encapsulated in link-layer frames
that are transmitted over physical media such as an Ethernet cable. In Figure 2, the assumed physical media
is an Ethernet, and so all upper-layer protocols are eventually encapsulated within an Ethernet frame.
Capturing all link-layer frames thus gives you all messages sent/received from/by all protocols and
applications executing in your computer.
The second component of a packet sniffer is the packet analyzer, which displays the contents of all fields
within a protocol message. In order to do so, the packet analyzer must “understand” the structure of all
messages exchanged by protocols. For example, suppose we are interested in displaying the various fields
in messages exchanged by the HTTP protocol in Figure 2. The packet analyzer understands the format of
Ethernet frames, and so can identify the IP datagram within an Ethernet frame. It also understands the IP
datagram format, so that it can extract the TCP segment within the IP datagram. Finally, it understands the
TCP segment structure, so it can extract the HTTP message contained in the TCP segment. Finally, it
understands the HTTP protocol and so, for example, it knows that the first bytes of an HTTP message will
contain the string “GET,” “POST,” or “HEAD”.
We will be using the Wireshark packet sniffer [http://www.wireshark.org/] for these labs, allowing us to
display the contents of messages being sent/received from/by protocols at different levels of the protocol
stack. (Technically speaking, Wireshark is a packet analyzer that uses a packet capture library in your
computer). Wireshark is a free network protocol analyzer that runs on Windows, Mac, and Linux/Unix
computer. It’s an ideal packet analyzer for our labs – it is stable, has a large user base and well-documented
support that includes a user-guide (http://www.wireshark.org/docs/wsug_html_chunked/),
man pages (http://www.wireshark.org/docs/man-pages/), and a detailed FAQ
(http://www.wireshark.org/faq.html), rich functionality that includes the capability to analyze hundreds of
protocols, and a well-designed user interface. It operates in computers using Ethernet, serial (PPP and
SLIP), 802.11 wireless LANs, and many other link-layer technologies (if the OS on which it’s running
allows Wireshark to do so).
Page 8
3.2.1. Getting Wireshark
You have already learnt the way to install Wireshark on your computer during tutorial. You can use the
link given below to download Wireshark and watch a video if you need so guidance.
In order to run Wireshark, you will need to have access to a computer that supports both Wireshark and the
libpcap or WinPCap packet capture library. The libpcap software will be installed for you, if it is not
installed within your operating system, when you install. See http://www.wireshark.org/download.html for
a list of supported operating systems and download sites.
In order to run Wireshark, type or check for Wireshark on the Windows option.
When you run the Wireshark program, you’ll get a startup screen that looks something like the screen
below in Figure 3. Different versions of Wireshark will have different startup screens.
Page 9
Figure 3: Initial Wireshark Screen
There is not much interesting on this screen, it will show the interfaces running on the computer.
At this window you will visualize all the interfaces available on the computer. For example: Local Area
Connection Network (LAN), all packets to/from this computer will pass through the LAN interface, so it is
here where we want to capture packets. Double click on this interface (e.g., mostly likely Ethernet
interface).
Page 10
When Wireshark start packet capture (i.e., for Wireshark to begin capturing all packets being sent to/from
that interface), a screen like the one below will be displayed, showing information about the packets being
captured. Once you start packet capture, you can stop it by using the Capture pull down menu and selecting
Stop.
command
menus
display filter
specification
listing of
captured
packets
details of
selected
packet
header
packet content in
hexadecimal and ASCII
Figure 4: Wireshark Graphical User Interface, during packet capture and analysis
The Wireshark interface has five major components as explained in Figure 4:
• The command menus are standard pulldown menus located at the top of the window. Of interest
to us now are the File and Capture menus. The File menu allows you to save captured packet data
or open a file containing previously captured packet data, and exit the Wireshark application. The
Capture menu allows you to begin packet capture.
• The packet-listing window displays a one-line summary for each packet captured, including the
packet number (assigned by Wireshark; this is not a packet number contained in any protocol’s
header), the time at which the packet was captured, the packet’s source and destination addresses,
the protocol type, and protocol-specific information contained in the packet. The packet listing can
be sorted according to any of these categories by clicking on a column name. The protocol type
field lists the highest-level protocol that sent or received this packet, i.e., the protocol that is the
source or ultimate sink for this packet (see Figure 4).
• The packet-header details window provides details about the packet selected (highlighted) in the
packet-listing window. (To select a packet in the packet-listing window, place the cursor over the
packet’s one-line summary in the packet-listing window and click with the left mouse button.).
These details include information about the Ethernet frame (assuming the packet was sent/received
over an Ethernet interface) and IP datagram that contains this packet. The amount of Ethernet and
IP-layer detail displayed can be expanded or minimized by clicking on the plus
Page 11
minus boxes to the left of the Ethernet frame or IP datagram line in the packet details window. If the
packet has been carried over TCP or UDP, TCP or UDP details will also be displayed, which can
similarly be expanded or minimized. Finally, details about the highest-level protocol that sent or
received this packet are also provided (see Figure 4).
• The packet-contents window displays the entire contents of the captured frame, in both ASCII and
hexadecimal format (see Figure 4).
• Towards the top of the Wireshark graphical user interface, is the packet display filter field, into
which a protocol name or other information can be entered in order to filter the information displayed
in the packet-listing window (and hence the packet-header and packet-contents windows). In the
example below, we use the packet-display filter field to have Wireshark hide (not display) packets
except those that correspond to HTTP messages (see Figure 4).
At this point, you are getting familiar with Wireshark and be ready for performing some exercises detailed
in the next section. Make sure to stop the capturing before starting the next section. In the next few
paragraphs we illustrate some of the ways to filter packets in Wireshark.
The Wireshark uses the following notations to represent the comparison and logical operators.
Comparison Operator Logical Operator
Operator Meaning Operator Meaning
== Equal to && Both conditions must be true.
Either one of the conditions
!= Not equal to ||
must be true.
Neither one of the conditions
> Greater than !
is true.
>= Greater than or equal to
< Less than
<= Less than or equal to
The Wireshark provides the filtering commands as follows to show only packets from a specific IP address.
Filter Meaning
ip.addr Show only the packets from this IP address.
ip.src Show only the packet sent from this source IP address.
ip.dst Show only the packet sent to this destination IP address.
For example, you type this command in the Filter window to see a list of packets sent to our computer from
the IP address 118.69.204.210 (i.e., www.rmit.edu.vn) and press “Apply”.
ip.src== 118.69.204.210
You can combine many conditions together by using the logical operators. For example, to display only the
packets sent from the IP addresses 118.69.204.210 or the packets your computer send to the IP address
35.197.141.103 (i.e., www.rmit.edu.au), you type the following command in the Filter window and press
Apply. The ip address used here does not match with the actual ip address. This is just used as an example.
ip.src==203.131.212.198 || ip.dst==35.197.141.103
The Wireshark provides the filtering commands as follows to show only specific protocol packets.
Filter Meaning
arp Show only the ARP packets.
icmp Show only the ICMP packet.
tcp Show only the TCP packet.
udp Show only the UDP packet.
Page 12
For example, you type this command in the Filter window to see a list of TCP packets and press Apply.
tcp
You can display only the packets with specific frame lengths by using the following filter command:
frame.len < 1000
Meaning: to show only packets whose frame length is less than 1000 bytes.
4. Exercises
3. Type the following command “ipconfig /?” [“man ipconfig” for MacBook users]
a. What other information you can obtain from ipconfig command
1. Start up your favorite web browser, which will display your selected homepage (For this exercise is
better if you close all the other browses).
2. To begin packet capture, select the Capture pull down menu and select Interfaces. You will see a list
of the interfaces on your computer. Click on Start for the interface on which you want to begin packet
capture. Packet capture will now begin - Wireshark is now capturing all packets being sent/received
from/by your computer.
3. Once you begin packet capture, a window similar to that shown in Figure 4 will appear. This window
shows the packets being captured. But don’t stop packet capture yet. Let us capture some interesting
packets. To do so, we will need to generate some network traffic.
4. While Wireshark is running, enter the URL:
http://gaia.cs.umass.edu/wireshark-labs/INTRO-wireshark-file1.html
and have that page displayed in your browser. In order to display this page, your browser will contact
the HTTP server at gaia.cs.umass.edu and exchange HTTP messages with the server in order to
download this page. The Ethernet frames containing these HTTP messages (as well as all other frames
passing through your Ethernet adapter) will be captured by Wireshark.
5. After your browser has displayed the “Congratulations! You've downloaded the first Wireshark lab
file!” page, stop Wireshark packet capture by selecting stop in the Wireshark capture window. The
main Wireshark window should now look similar to Figure 5. You now have live packet data that
contains all protocol messages exchanged between your computer and other network entities. The
HTTP message exchanges with the gaia.cs.umass.edu web server should appear somewhere in the
listing of packets captured. But there will be many other types of packets displayed as well (see, e.g.,
the many different protocol types shown in the Protocol column in Figure 5). Even though the only
action you took was to download a web page, there were evidently many other protocols running on
Page 13
your computer that are unseen by the user. We will learn much more about these protocols as we
progress through the text. For now, you should just be aware that there is often much more going on
than “meets the eye”.
6. Type in “http” (without the quotes, and in lower case – all protocol names are in lower case in
Wireshark) into the display filter specification window at the top of the main Wireshark window.
Then select Apply (to the right of where you entered “http”). This will cause only HTTP message to
be displayed in the packet-listing window.
7. Find the HTTP GET message that was sent from your computer to the gaia.cs.umass.edu HTTP
server. (Look for an HTTP GET message in the “listing of captured packets” portion of the Wireshark
window (see Figure 5) that shows “GET” followed by the gaia.cs.umass.edu URL that you entered.
When you select the HTTP GET message, the Ethernet frame, IP datagram, TCP segment, and HTTP
message header information will be displayed in the packet-header window. By clicking on ‘+’ and
‘-‘ right-pointing and down-pointing arrowheads to the left side of the packet details window,
minimize the amount of Frame, Ethernet, Internet Protocol, and Transmission Control Protocol
information displayed. Maximize the amount information displayed about the HTTP protocol. Your
Wireshark display should now look roughly as shown in Figure 5.
Page 14
c. How many bytes are on the data?
At this point you are able to capture and analyze protocols using Wireshark.
6. By clicking on ‘+’ and ‘-‘ right-pointing and down-pointing arrowheads to the left side of the packet
details window, start to inspect the packet?
a. Can the header and the data of the packet have been visualized?
c. What is the most common information that you can visualize in the header of the packet?
7. Exit Wireshark
Congratulations! You have now completed the first section of the report. Now you need to
answer the following questions and before proceeding to the Circuit Simulator section.
Page 15
5. Questions
The goal of this first lab was primarily to introduce the Network Interfaces and Wireshark. The following
questions will demonstrate that you have been able to get Wireshark up and running and have explored
some of its capabilities. Answer the following questions, based on your Network interface and Wireshark
experimentation:
1. List 3 different protocols that appear in the protocol column in the unfiltered packet-listing
window in Wireshark and explain the role of those protocols.
2. How long did it take from when the HTTP GET message was sent until the HTTP OK reply was
received? (By default, the value of the Time column in the packet-listing window is the amount of
time, in seconds since Wireshark tracing began. To display the Time field in time-of-day format,
select the Wireshark View pull down menu, then select Time Display Format, then select Time-of-
day.)
3. What is the Internet address of the gaia.cs.umass.edu (also known as www-net.cs.umass.edu)?
What is the Internet address of your computer?
4. Print the two HTTP messages (GET and OK) referred to in question 3 above. To do so, select Print
from the Wireshark File command menu, and select the “Selected Packet Only” and “Print as
displayed” radial buttons, and then click OK.
5. Include the saved file together with your report submission.
Page 16
Falstad Circuit Simulator
1. Objectives
The objective of the exercise is to:
• Understand the changes in the frequency domain as the pitch of the time domain signal is varied.
• Understand the properties of frequency and time domain signals.
• Observe the relation of resistance and current flowing in the circuit.
• Proper interpretation of the simulation results observed.
To turn a switch on or off, just click on it. If you move the mouse over any component of the circuit, you will
see a short description of that component and its current state in the lower right corner of the window. To
modify a component, move the mouse over it, click the right mouse button (or control-click if you have a
Mac) and select “Edit”.
3. Exercises
To procced with this section, you need to use the URL below to navigate to the signal lab website (Circuit
Simulator Applet). http://www.falstad.com/circuit/index.html. You should see a page that looks like Figure
The yellow dots and the traces at the bottom will be moving. That’s fine. You can stop them by clicking
on the “RUN/stop” button on the upper right. The lab work area and menus allow you to build circuits
and apply signals to them. You can also look at the signals at any point in the circuit in time domain or
frequency domain.
Page 17
First stop the simulation by clicking on the “RUN/stop” button if you have not already done so (you do not
have to do this, it’s just less distracting this way). Click on File in the menu bar at the top and select “Open
file”. This will open a navigation window on your computer. Navigate to where you stored the File01.txt file,
select it and click “Open”. The file will load and is ready for use.
Tasks to complete:
1. Set the frequency at 120 Hz.
2. Wait for the Frequency Display to settle and capture the position of the peak on the frequency display.
The numerical value of frequency should be presented. This can be done by hovering the mouse over
the frequency display. Type the value manually in the report if the value is lost during the screen
capture.
3. Calculate the period of the signal generated.
4. Change the resistance to have a value of 5K.
5. Capture the voltage versus current graph and interpret the graph. This can be achieved by setting the
X-Y Plots to “Show V vs I” in the scope properties. Explain the behaviour of the V-I graph when the
resistance is set to 2K from 5K.
6. Set the frequency at 60 Hz.
7. Capture the position of the peak on the frequency display as above. Explain the relation of the change
in frequency with waveform.
Congratulations! You have now completed all the requirements of first lab report!
4. References
[1] Supplement to Computer Networking: A Top-Down Approach, 7th ed., J.F. Kurose and
K.W. Ross, 2005-2016, All Rights Reserved
[2] William Stallings. 1996. Data and Computer Communications (5th Ed.). Prentice-Hall, Inc.,
Upper Saddle River, NJ, USA.
[3] Andrew Tanenbaum. 2002. Computer Networks (4th ed.). Prentice Hall Professional
Technical Reference.
Page 18