Pre-lab 1: Linux, Python Primer and Intro to Networks Total points: 100 Deliverables: Create a PDF file in which each of your answers to the questions is preceded by the
problem number and statement. The PDF will be submitted directly into Gradescope, except the Python script is submitted directly on Canvas. Naming convention: name the Python script as [YourCruzID].py Your CruzID is the part of your UCSC email before the '@' Screenshots: Follow instructions given in the problems and remember to include a screenshot whenever requested.. All screenshots must have a timestamp. One way to do this is to run "date" cmd before starting your experiments or open another terminal and run "date" command and screenshot these terminals together in one shot. Credit cannot be given for problems with a missing screenshot. Be aware of Late Policy (see Syllabus) Resources for this lab: Linux: ● http://linux-training.be/index.php?nav=fundamentals (Links to an external site.) Python: https://python.land/python-tutorial Traceroute, IP Addresses and basic networks: Computer Networking: A Top-down Approach Chapter 1: introduction Chapter 1.4.3: End-to-End Delay - Traceroute • Computer Networking: A Top-down Approach: IP Addresses Section 4.3.3 IPv4 Addressing (Figures 4.18) How to Access a Unix Shell: Access to Campus Unix Servers Through SSH In this lab, you will test your commands, run shell scripts and your Python program on a Linux machine. Here are instructions on using the Unix Timeshare: Access a campus Unix server through SSH: https://its.ucsc.edu/unix-timeshare/tutorials/how-to-connect.html For students who use Windows on their own computers, you can download the Bitvise SSH Client and configure the settings given in the link above, under "access to Campus Unix Servers Through SSH". Download the Bitvise client here: https://www.bitvise.com/ssh-client-download. Connect to the server using your CruzID and blue password. Questions: [25 points] Unix Practice 1. [5 pts] Directories and files a. What command can be used to list all the files and directories, including the hidden files, in the present working directory? b. What command can be used to list all the files and directories in the present working directory in chronological order based on the last modified date? c. What command is used to display the current directory? d. What command is used to create a directory named "dir1" in the current directory? e. What command would you use to move to the root directory? What command would you use to move to the subdirectory "dir1" from the current directory? 2. [5 pts] Updating & viewing files: Two files - file1.txt and file2.txt are to be used for questions (a), (b) and (c). Include the results of running the commands on the files. a. What is the complete command to display the contents of these two files? b. What complete command would allow you to see the line by line differences between these two files? c. What complete command would you use to concatenate these two files and store the output to a new file named file3.txt? d. What complete command would you use to move file3.txt from your current directory to a directory having relative path “../dir2”? e. What complete command would you use to delete a file named file1.txt? Can the file be recovered once this command is issued? 3. [5 pts] Networking commands: a. What is the complete command a user with username "slugsammy" could use to log in to a remote server with hostname "unix.server.com"? b. What is the complete command to copy all .txt files from a directory with absolute path "/network_log" on the campus Unix server named "unix.server.com" into your local machine's current working directory? 4. [5 pts] Process commands: a. What is the complete command to find the pid of a process named "network_process"? b. What is the complete command to kill a process which has the pid "sdn_network"? c. What is/are the commands to use to get details on all the processes running on the system? d. What does it mean to run a process "in the background"? e. What is the command to run a process called "proc1" in the background? 5. [5pts] Bits and Bobs a. What command would you use to access the user manual of any command? b. What is the difference between running a command using "sudo [command]" and using "sudo -i"? c. What command would you use to search for the string "Linux” in the file named "file3.txt"? [5 points] Interfaces 6. Network interfaces a. In your own words, define Network Interface. b. Look at your system settings and find your Ethernet interface. List the interface name, MAC address, and IP Address. Attach a screenshot with the information highlighted or circled. [40 points] Traceroute When screenshots are required, each screenshot must show the date and time of day by preceding your commands with "date." If a screenshot is missing or the date is not displayed, credit cannot be given. Note: If Traceroute is hanging and doesn't complete, talk to your TA. Multiple lines with and no completion is not what we are looking for in this exercise and will not receive credit. Overall the majority of lines must display a normal response from the router. *** 7. [10 pts] Basic Traceroute a) Research the “traceroute” tool and write a very short description about what it does (in your own words - no copy/paste/Google will receive credit). Run Traceroute between your computer and www.ucsc.edu Include a screenshot of the output and answer the following questions: b) What does each of the numbered lines in the output represent? c) Looking at Row #1, circle the 3 time measurements and explain what they represent. d) What is the difference between row #1 and row #2? e) How many hops are there between your computer and the final destination? What does this hop count mean? 8. [10 pts] North America: a) Run Traceroute between your computer and a destination on this continent at three different times during the day (and night if you're awake late!). Record your results in the table below for each run of Traceroute, capturing the time to reach the final destination. A tool such as IP Location Finder can be used to determine the approximate geographic location of the destination host. Hostname: Location of host: Run # Time of Day 1 2 3 Overall average: Overall std dev: Execution Final RTT Time 1 Final RTT 2 Final RTT 3 Average #routers RTT b) Include a screenshot of Run #1 and circle all data used to calculate the average RTT to the destination host. c) How did you determine that the host is located in North America? d) Did the number of routers in the path change during your 3 different runs? If so, why would it change? 9. [10 pts] Different Continent: Repeat the above exercise to a destination on a different continent. a) Include your results in the same table format above in #8. b) Include a screenshot of Run #1 and circle the line in which the final destination is reached. c) Try to identify an overseas link with increased delay and mark/label it in your screenshot. 10. [5 pts] General questions about your experiment: a. Compare the average intra-continent and inter-continent results. Are your results what you would expect? Explain. b. For a given source and destination, find a row in your table for which the reported RTT values are different. What could account for the difference in delay?