Skip navigation
The Australian National University

Laboratory 2 - Networks

Aim

The aim of this lab is to discuss the material covered in the lectures on the Application Layer Protocols HTTP, SMTP, MIME and VOIP, and those on Application Architectures and Networks, and to get some hands on experience with some linux networking commands and subversion, which is required for submitting your assignments.


Discussion

Preparation

Please go through the slides for the lectures on Application Layer Protocols, Application Architectures and Networks. As well, go through chapters 11 (HTTP-424:426, Email-416:419, VOIP-416:419, VOIP-421:423 and Cloud Computing-427:435), and the required reading for the first lecture of Roger Clarke. Note down any questions that you may have and bring it up at the end of the discussion session.

You should be able to answer the following questions, if you have gone through the slides and the relevant reading material:

  1. What approaches are taken by browsers to decide whether or not to use a cached page?
  2. How is mail transmitted from a sender to a receiver? What protocols are used? Discuss how an SMTP session works.
  3. What is MIME and why is it useful?
  4. What are the roles of SIP and RTP in VOIP?
  5. Discuss the advantages and disadvantages of using forward, open and reverse proxies.
  6. Are there any privacy/security issues with using a proxy?
  7. What are some categories of NIS (Networked Information Systems) that used client-server and P2P architectures?

The following questions are for discussion:

  1. What are some of the risks of using cloud based services?
  2. Why is caching useful? Can all pages be cached? What are some of the limitations?
  3. Why are cookies useful? What are some of the security implications? What can you do to protect yourself?
  4. Discuss some of the advantages and disadvantages of P2P.


Linux Networking Commands

Using telnet to send mail

In this part, you will use telnet to send mail to either yourself or to your fellow student sitting next to you in the lab.

Run the following commands:

telnet mail.anu.edu.au 25
Telnet will respond with:
Trying 130.56.66.57...
Connected to mail.anu.edu.au.
Escape character is '^]'.
220 mailin1.anu.edu.au ESMTP Postfix
You then send a HELO
HELO (followed by your machine name or some greeting)
The response is:
250 mailin1.anu.edu.au
Send the sender and recipient email addresses, one after the other.
MAIL FROM:<your email address>
The response is:
250 2.1.0 Ok
You send:
RCPT TO:<your email address or your friends email address>
The response is:
250 2.1.5 Ok
You send:
DATA
The response is:
354 End data with <CR><LF>.<CR><LF>
Type in your message header, followed by a blank line, then your message body, followed by a '.' in a line by itself. For example:
From: "Your name" <your email address>
To: "Your friends name" <friends email address>
Subject: <subject title>

Message content, as appropriate
.
The server responds with:
250 2.0.0 Ok: queued as <some number>
This indicates that the message has been queued for delivery. You then type:
quit
to end the telnet session. Ask you friend to check their mail, to see if the mail that you sent has arrived.

The route command

Run the following command:

route -n
How many interfaces are there? Do you understand the different parts of the output? Use the man page to figure out the output.


Version Control

As subversion is going to be used to submit your assignments, you will need to become familiar with this tool. Do the following exercises. Do not worry if you don't complete all of them in the lab. You can try them later at home or in the next lab. You only really need to know how to checkout a repository, add your files and do a commit. You may find it easier to use a GUI based subversion client than by typing in the commands in a terminal. The following exercises give you a good grounding in using subversion (perhaps more than what is required).

Preparation

Version control (or revision control) refers to the management of changes to information stored as computer files. Various types of information can be put under version control such as computer programs, documents and configuration files. It is really useful to use a version control tool for all your work, be it work done by yourself or in a group. It allows you to track changes and revert to earlier versions, when required. It is essential for collaborative projects. Please go through the wikipedia page on version control.

In this exercise we will use the Subversion version control system to demonstrate the advantages of using version control in your daily work. Read the Red Bean Book for a very good introduction to Subversion. In particular, read the first two chapters.

Getting help

Subversion is already installed on the student system. Log on to the system using your uni ID and password. Open a terminal window. We will use command line to type subversion commands. The Subversion command line client is called svn. Type:

    svn help
and see what you get. This gives you access to the client's documentation. Now type:
    svn help import
This gives you the details of the import command.

Creating a repository

Svn stores its files in repositories. We will first create a directory called svn under which we will store all our repositories. To do this, make sure that you are in your home directory and then type:

    mkdir svn
This will create a directory called svn in your home directory. Do not touch this directory or its contents. We will now create a repository for comp2410 in this directory as follows (replace uxxxxxxx with your student number):
    svnadmin create svn/comp2410

Creating a working copy and doing some work

We now need to create a working copy of this directory, which is where we will do all our comp2410 related work. We do this as follows:
    svn checkout file:///students/uxxxxxxx/svn/comp2410
This will create a directory called comp2410 under our home folder. Make this our current directory by:
    cd comp2410
Make a directory called labs and a directory underneath this called lab1 as follows:
    mkdir -p labs/lab1
Schedule this directory to be added to the repository:
    svn add labs
Note that this adds labs as well as everything underneath it to the repository. Commit the changes:
    svn commit labs
This will open up an editor and ask you for a message to go with the commit. Enter an appropriate message and complete the commit. Change directory to lab1:
    cd labs/lab1
Create two files called test1 and test2 using your favourite editor, with some content. Schedule these for addition to the repository. Examine your changes:
    svn status
Commit the files. Note the revision numbers. Make some changes to one of the files and use svn status to examine the status of the files.

Making changes and recovery

Change one of the files. Use the svn diff command to see your changes. Commit this file.

Change the other file. Now, use the svn revert command to go back to the last committed version of the file.

Delete one of the files. Now, use the svn update command to get back the deleted file. Note that this can work at the directory level as well.

Use the svn log command to get a log of the changes committed to the repository. You can use svn log test1 to look at the changes for test1. The version numbers are also listed in the log. Use svn update -r to revert to a particular revision of a file. Run svn help update to get the documentation for the update command.

Try some other commands listed in Chapter 2 of the Red Bean Book. Place some of your own files under version control. You can use the svn import command to bring existing directories under version control. Chapter 2 of the book has an example.

Using a GUI based svn client

You can use a GUI based client for this purpose, instead of entering commands using a terminal. Some of the popular GUI clients for different operating systems are detailed in the Assignments page. The one that you can use in your lab is rapidSVN. Look under "Applications/Programming" to find this application. Use it to do some of the above tasks.


Windows commands and their Linux equivalents

For those who are a little rusty on Windows or Linux, the following table lists Windows commands and their Linux equivalent.

WindowsLinux
cdcd
copycp
delrm
dir/wls -a
typecat

Updated:  Tue Mar 11 01:02:19 EST 2014 / Responsible Officer:   JavaScript must be enabled to display this email address. / Page Contact:   JavaScript must be enabled to display this email address.