Difference between revisions of "COMP 3000 Lab 7 2011"

From Soma-notes
Jump to navigation Jump to search
Line 18: Line 18:
==Part B==
==Part B==
# [2] Why does <tt>tracepath</tt> return "no reply" sometimes?
# [2] Why does <tt>tracepath</tt> return "no reply" sometimes?
# [3] <tt>nc</tt> uses very few (three on Ubuntu 11.10) when actually receiving data on the network.  (The other system calls are for setup and for ending the connection.)  What are those few system calls, and what do each of them do?
# [3] <tt>nc</tt> uses very few system calls (three on Ubuntu 11.10) when actually receiving data on the network.  (The other system calls are for setup and for ending the connection.)  What are those few system calls, and what do each of them do?
# [2] What file does <tt>netstat</tt> access to find out about current TCP connections on Linux?  And, what is the difference between this file and the output of <tt>netstat</tt>, in syntax and semantics?  Be specific.
# [2] What file does <tt>netstat</tt> access to find out about current TCP connections on Linux?  And, what is the difference between this file and the output of <tt>netstat</tt>, in syntax and semantics?  Be specific.
# [2] What does <tt>lsof</tt> sometimes get a "permission denied" error when run as a regular user?  Specifically, what files is it trying to access, and why are these protected?
# [2] What does <tt>lsof</tt> sometimes get a "permission denied" error when run as a regular user?  Specifically, what files is it trying to access, and why are these protected?
# [2] Can you tell from <tt>/proc/<PID>/maps</tt> which memory segments are shared for read-only access?  What about read-write access?  Explain briefly.
# [2] Can you tell from <tt>/proc/<PID>/maps</tt> which memory segments are shared for read-only access?  What about read-write access?  Explain briefly.

Revision as of 02:15, 21 November 2011

A few guidelines:

  • Submit your solutions for both Part A and Part B via WebCT by Sunday, November 27th at 11:30 PM.
  • Please answer using a single text file (with a .txt extension). Do not submit doc, docx, pdf, or other formats. Also, please do not submit an archive (zip, tarball, rar) of multiple text files, just upload one. (Please don't just cut and paste your work into a text box on webct.) Anything other than a single text file will receive -1 points
  • Show all your work. If you find an answer by browsing code, explain your search path (e.g., I searched for X, which led me to source file Y, where I found function Z.) Also, list any websites or individuals you consult.
  • Do all of the following on a Linux system. Ubuntu Linux is guaranteed to work, but other Linux systems should work. Note that *BSD systems, including MacOS X, will produce different answers for several of the following questions.
  • Note that the tools from Lab 2 in particular may be of use here...

Part A

  1. [3] Run ifconfig. For all configured interfaces except loopback, there should be an "inet" address, a "HWaddr" (hardware) address, and perhaps even an "inet6" address. Each of these addresses identifies the computer within a certain context. In what context are each of these addresses used? Specifically, for what protocol is the address used, and what other computers can access this one using this address? (Ignore NAT issues.)
  2. [2] What does MTU refer to in the output of ifconfig? Specifically, what does the acronym mean, and what does this value determine?
  3. How could you use netcat (nc) to listen on port 9200 and write received data to the file /tmp/foo?
  4. What does tracepath slashdot.org return?
  5. How can you get netstat to return a list of all current TCP connections and open ports, listed using numeric IP addresses (rather than DNS hostnames)?
  6. How could I use lsof to find all of the processes accessing the directory /home?
  7. [2] In /proc/<PID>/maps, each entry has four permission bits: r,w,x, & p. What do each of them indicate?

Part B

  1. [2] Why does tracepath return "no reply" sometimes?
  2. [3] nc uses very few system calls (three on Ubuntu 11.10) when actually receiving data on the network. (The other system calls are for setup and for ending the connection.) What are those few system calls, and what do each of them do?
  3. [2] What file does netstat access to find out about current TCP connections on Linux? And, what is the difference between this file and the output of netstat, in syntax and semantics? Be specific.
  4. [2] What does lsof sometimes get a "permission denied" error when run as a regular user? Specifically, what files is it trying to access, and why are these protected?
  5. [2] Can you tell from /proc/<PID>/maps which memory segments are shared for read-only access? What about read-write access? Explain briefly.