Reference no: EM133085899
Objectives
• Capture and investigate Transport layer protocols
• Investigate the Linux file system and basic Linux commands
Part 1 - Investigate simple HTTP Discussion:
Simple network interactions can be analysed using Wireshark. Two Wireshark HTTP interactions are available on Moodle.
• Capture 1 : browser request for a simple HTML page
• Capture 2 : a request including two images in the html page
Upon completion of part 1, you may like to capture each HTTP interaction live.
Task 1
Download captured file from Moodle and open it in Wireshark. Observe Wireshark display. File name is Phoebe-HelloITECH1102.pcapng. This capture contains 10 packets of a simple HTTP GET from a server named phoebe.
• The first 3 packets are from 3-way handshaking mechanism setting up the connection between client web browser (Firefox) and web server (phoebe). Note the SYN, SYN/ACK, and ACK flags.
• Packet 4 is a HTTP request from web browser asking for a specific html page.
• Packet 5 is an acknowledgement from server to the requesting client. This packet acknowledges that the server successfully received 389 bytes from web client.
• Packet 6 is the requested html page sent by the server to the client.
• Packets 7 & 8 are for server closing the connection with client.
• Packets 9 & 10 are for client closing its connection with server.
Task 2
If you look at the first packet, you will see in the packet list pane that the sequence number is zero (seq = 0). Further down in the Wireshark display, you will see larger sequence and acknowledgement numbers (390, 374 etc.). These are Relative sequence and acknowledgement numbers. They are relative to the initial sequence numbers setup during the TCP connection (3-way handshake). To view the actual values, we are going to change the associated preference in Wireshark.
• From the Edit Menu, Preferences -> Protocols > TCP -> Uncheck Relative Sequence Numbers
You are now seeing actual sequence and acknowledgement numbers as opposed to relative ones. You should now be able to see that the initial sequence number (ISN) from the Client to the Server is 1043872907 and that the initial sequence number (ISN) from the Server to the Client is 3447850100. Here, you have noticed that the ISNs for a connection between client and server are totally different from the opposite connection (server to client). This is less obvious when using the relative sequence numbers.
Port numbers used by clients and servers can be seen in the packet list pane or the packet decode pane of Wireshark.
• What port number is used by client?
• What port number is used by server?
• Are these port numbers consistent?
• What are the associated sockets of client and server?
Task 3
The HTTP protocol is a very simple text-based protocol developed by Tim Berners-Lee when he was creating what is now called the World Wide Web. Do an Internet search to understand more about the HTTP protocol. You should spend 5 to 10 minutes researching HTTP so that you are a little more familiar with how the protocol works.
Task 4
Packet decode pane shows all aspects of the TCP header. Flags indicate main functions of each TCP segment as shown below.
You may have noticed that the flags are either On (1) or Off (0) and only take one bit. Choose a few packets from capture. Note the statuses of flags and how they relate to the display in the packet list pane.
Task 5
In this screenshot, we can see the following.
• Initial relative sequence number is zero.
• After it is acknowledged, it became 1.
• After sending 389 bytes, it increased to 390.
Try doing a similar analysis of the traffic coming from last 5 packets, i.e., traffic from server to client.
Task 6
Download the second capture from Moodle and analyse it. Try to discover what is happening in this Wireshark capture. You may need to refer to the Internet if you are unsure about traffic. This capture is like the previous one, however, two images are downloaded as a part of the web page.
Part 1 Task (to earn marks)
To gain one mark in this lab, demonstrate that you have understood various aspects of the two Wireshark captures. Include screenshots and short descriptions in your Lab Report 2 accordingly.
Part 2: Commands in Linux, i.e., Copy (cp), Move (mv), and Remove (rm)
When we run a terminal from taskbar, a program called Linux shell (equivalent to command line in Windows) executes.
Default shell in Linux Lite is bash shell. This shell allows Linux users to administer a Linux system by entering Linux commands and creating and running scripts. The bash shell interprets the commands entered by us and displays results on screen. Most commands require arguments that often include paths to files or directories. To specify a directory, it is a good practice to use a forward slash in the end of the directory reference to indicate it is a directory, e.g., /home/user2/MyGames/. To specify a file, you use a directory reference followed by the filename, e.g., /home/user2/MyGames/ game1.exe.
In last week's lab, we used dot (.) and double dots (..) to represent the current and level-up directories, respectively. We also saw how tilde character (~) can be used to represent current user's home directory. In this week's lab, we will practice other commands, e.g., shell commands, and include wildcards, i.e., "?" and "*". Wildcards are used in a file reference to specify multiple files. A question mark in a file reference indicates any single character in place of the question mark, e.g., file? would specify any of the following filenames, e.g.., file1, file2, file4, fileC, etc. An asterisk in a file reference can represent any number of characters (zero or more), e.g., file* would specify any of the following filenames, e.g., file, file123, fileAbc, etc. Wildcards are particularly useful when looking for multiple files in the ls (list) command or copying multiple files from one place in the Linux file system to another.
There are two categories of file system references in Linux, i.e., absolute and relative. The absolute file references specify every directory from root of the file system to the file (or files) in question. The absolute
• /home/user1/file1
• /home/user1/
• /home/user1/*
• /home/user1/file2??.conf
Relative file references are file references that are relative to the current working directory as displayed in the pwd command. Relative file references never start with a forward slash. Few examples are as follows
• file1
• ../dir2/file
• .
• ..
• ~/vault/
For practice, we need to create a directory containing multiple files. To do this, complete the following set of commands.
• cd /
• sudo mkdir fileStore
• cd fileStore
• sudo mkdir oldSongs
• cd oldSongs
• sudo touch song11
• sudo touch song12
• sudo touch song13
• sudo touch song45
• sudo touch song55
• sudo touch song65
You should have a directory /fileStore/oldSongs/ that contains six files. Now create a directory under / home/user1 named songBackup using the mkdir command.
The format of copy command is cp source destination, where source and destination are file references. Use bash shell commands to complete the following tasks.
Use absolute addresses for both source and destination and copy song11 to songBackup/.
• Use absolute addresses for both source and destination and copy song11 to songBackup/.
• Use absolute addresses for both source and destination and copy song11, song12, and song13 to songBackup.
• Use absolute addresses for both source and destination and copy any song that ends in 5 to songBackup.
• Delete all files from songBackup directory with the rm commands and the wildcard *.
• Repeat first three tasks using relative addresses for both the source and destination.
To test your skills, try the following tasks.
• Use the ls command to list multiple files within Linux directories.
• Change directory to /bin.
• List all files that start with letter c.
• Determine how many files start with ch.
You can further test your skills by copying single file or multiple files from any location in the Linux file system to your home directory.
Part 2 Task
To gain one mark, demonstrate that you can successfully use Linux cp and mv commands and you understand how to use wildcards (? an *) and relative file references (. and ..) in Linux commands. Include relevant screenshots in your Lab Report 2 submission.