CSE-2041A
Net-Centric Computing

York University
Fall 2012
Lab #1: Networks
  A. Net Tools

There are many tools available for probing the network, addresses, and connections. We want to get familiar with them.

  1. The tool ping is to see whether a network connection can be established. Ping www.baidu.cn. (Control-C out of it.) What information is it telling you?

  2. Use the ipconfig command (ifconfig in Linux) to determine the physical (MAC) address and the IP address of your computer.

  3. Use nslookup and traceroute (tracert in Windows) to determine the IP address and number of hops between your machine and www.baidu.cn.

    A newer lookup tool on *nix machines is dig.

  4. What is the IP address of skyline.cse.yorku.ca?

  5. whois is a way to find who a domain is registered to.

    • One can use it to find the registration service for a TLD, a top-level domain.

      whois -h whois.iana.org cn
    • Then one can use the appropriate registration service to see who owns a domain.

      whois -h whois.cnnic.cn biadu.cn
    • What is the registrant name for yorku.ca?

 
  B. HTTP

Now let us look at the http service and protocol.

  1. Launch the Firefox browser. Activate firebug and make sure its NET tab is active.

    1. Visit the URL http://www.cse.yorku.ca/~godfrey/2041/cgi/minimal1.cgi.

    2. Sniff traffic using the Net tab.

    3. List all the request headers and note, in particular, the value of the host header, as it is the only required one. (The rest are optional.)

    4. Examine also the response headers, and note in particular the value of the content-type header, a required response header which indicates the MIME of the payload that came from the server.

    5. View the payload itself in the Response tab.

  2. Repeat the above but for minimal2.cgi instead, and note the difference.

  3. Visit the same URLs again, but without using a browser! Instead, ssh to your Red account — so, Linux — and issue the telnet command:

    telnet www.cse.yorku.ca 80

    This allows you to issue raw http commands, and to see the response directly. Type in the request

    GET /course/2041/cgi/minimal1.cgi http/1.1
    Host: www.cse.yorku.ca

    Once you follow these two lines with an empty line, the request will be sent. Then you should see the returned response from the server. (Afterwards, the connection will shortly time out.)

  4. Use telnet to connect to the URL http://www.cse.yorku.ca/~godfrey/2041/cgi/tcpinfo.cgi. Interpret the returned response and argue that it is correct. Use netstat to determine the local port of your connection.

  5. Revisit tcpinfo.cgi, but supply a custom request header:

    Course: cse2041

    How does the response change?

 
  C. SMTP

Let us look at another service and protocol: smtp. It has a standard port assignment of 25.

This is used by e-mail services to deliver e-mail. But just as with http, nothing stops us from using it directly. There is an smtp service running on bronze.cse.yorku.ca. Let's use it.

Look at the protocol reference for smtp to get familiar with the protocol.

  1. Compose a message to yourself and send it.

    1. Set up a session.

      telnet bronze 25
    2. “Authenticate.”

      MAIL FROM: csexxxxx
    3. Set the recipient.

      RCPT TO: e-mail address of you
    4. Fill in your message.

      DATA
      ...
      .

      Compose the e-mail header information however you wish! E.g.,

      • From: "Donald Duck" <dduck@mickey.com>
      • To: "Dumb Dumb" <really_dumb@me.com>
      • Date: Tue, 13 Sep 2011 07:21:27 -0400
      •  
      • message content
    5. Close the session. This also sends the composed message.

      QUIT
  2. Spoof your neighbour, using smtp as above. Send him or her an e-mail seemingly from some famous person.

 
  Lab Report

Use SMTP at bronze.cse.yorku.ca, as you did above, to send an email to godfrey@acm.org.

  • Spoof the To header to say "A Dry Geek Prof" <geeky@acm.org>.

  • For the From header, spoof a crazy name crazy@cse.yorku.ca.

  • For the Subject header, say Lab Report #1.

  • In the body of the message,

    • put the IP address of the machine you are on,
    • your name, and
    • your cse account number (e.g., cse00000).