You are on page 1of 12

COMPUTER NETWORKING LABORATORY PROJECTS*

Guillermo A Francia, III


Chi Chin Chao
Jacksonville State University
Mathematics, Computing, and Information Sciences Department
700 Pelham Rd North
Jacksonville, AL 36265
{gfrancia, cchao}@jsucc.jsu.edu A

ABSTRACT
The formidable task of not only trying to balance application and theory but also to
keep up with the rapid advancement in technology is always upon Computer
Science mentors. This paper presents a series of laboratory project descriptions that
are used in a laboratory model for a curriculum that strives to meet the challenges
presented by the rapid advancement of telecommunication technology. These
laboratory projects are divided in two main categories: hands-on network
configuration and network programming.

INTRODUCTION
The formidable task of not only trying to balance application and theory but also to keep
up with the rapid advancement in technology is always upon Computer Science mentors. The
rapidly evolving telecommunications technology presents an ever increasing demand from the
industry to better prepare future scientists and technicians who are adept in the field.
This paper presents a series of laboratory project descriptions that are used in a
laboratory model for a curriculum that strives to meet the challenges presented by the rapid
advancement of telecommunication technology. These laboratory projects are divided in two
main categories: hands-on network configuration and network programming.

___________________________________________

*
Copyright © 2003 by the Consortium for Computing Sciences in Colleges. Permission to copy
without fee all or part of this material is granted provided that the copies are not made or
distributed for direct commercial advantage, the CCSC copyright notice and the title of the
publication and its date appear, and notice is given that copying is by permission of the Consortium
for Computing Sciences in Colleges. To copy otherwise, or to republish, requires a fee and/or
specific permission.

226
CCSC: Southeastern Conference

THE CURRICULAR NEED


During the past decade, telecommunications have undergone an extraordinary acceleration
due to the vast improvement in both the physical and logical structure of computer networks.
The physical aspect of this improvement is characterized by the rapid deployment of fiber optic
cables, high-frequency channels, infrared media, and ISDN lines. The improvement on the
logical side is manifested by the ten-fold improvement of the widely used Ethernet protocol into
Fast Ethernet and even by a hundred-fold increase as manifested by Gigabit Ethernet. Coupled
with this is the introduction of new protocols such as those that integrate voice, data, and video.
This phenomenon entails the augmenting of the traditional curriculum suggested by the 1991
ACM Curriculum [ACM91] withincreased emphasis on technicalskills. Fox and Reynolds best
describe this curriculum issue in their Information Technology Curriculum Vision [Reyn96],
which calls for the additional pedagogical emphasis on networks, databases, multimedia, and
intelligent systems. The increasing emphasis on networking and telecommunications needs in
the undergraduate curriculum is clearly seen in the knowledge and learning units of the IS'97
model curriculum [Davi97].

THE LABORATORY PROJECTS


The design of the computer-networking laboratory projects is based on the following
rationale:
• to provide students a hands-on experience in installing and managing an advanced
heterogeneous computer network,
• to provide students a first-hand experience in network programming using Java
network Application Program Interfaces (APIs), and
• to be able to apply and/or simulate theoretical networking concepts.
The design of the laboratory projects was influenced by published descriptions of network
laboratory projects that appeared in [Fink94, Lank98, Siva99, Smit91, and Toll95]. These
projects were directly or indirectly supported by NSF grants and were well received by
undergraduates. In addition, excellent network theory and programming materials were adapted
from those that were described in [Haro00, Reil02, Darb01, Stev98, and Stev92].

The Hands-on Laboratory Project Activities


Activity 1: Basic Wiring and Network Connectivity
This activity is divided into two main components: a network hardware configuration part
and a network monitoring part.
Initially, the students are required to cut, splice, assemble, crimp, and test an unshielded
twisted pair (UTP) cable for the hardware component of this activity. Then, with the aid of a
cable scanner tool and an Ethernet switch, the students are required to test the
hand-manufactured cable for connectivity, length, and integrity.

227
JCSC 19, 3 (January 2004)

For the network monitoring part, the students are required to use the following systems
programs: ipconfig, netstat, arp, and an open source software: ethereal. These system tools
are used to gather pertinent network configurationinformation. After performing an investigation
of various network configurations, the students need to interpret and analyze the collected data.
These data are classified into two main classes: static and operational. The static information
include, among others, hostnames, IP addresses, hardware addresses, gateway addresses,
DNS server addresses, subnet masks, and DHCP statuses. The dynamic or operational
information include a) network interface statistics on the number and size of packets sent and
received, and b) IP/TCP/UDP statistics on the number of received packets, the number of
failed connections, and the number of retransmissions.
For both components of the project, the students are required to submit a written report
on all the data gathered, the experiences gained, and detailed analyses and interpretations of the
results.

Activity 2: LAN Setup and Configuration


The purpose of this activity is to give students a hands-on experience with configuring a
heterogeneous Local Area Network (LAN) using a Linksys EtherFast DSL Router, a Windows
2000 system, an iMac system, an SGI-Irix system, and three (3) Linux systems.
The students start by configuring the LinkSys EtherFast device as a router. They are
provided with the specific IP numbers, DNS server address, and a gateway address to use.
After the router configuration, the host machines are configured individually with some
pre-defined network parameters. Upon completion of the test for local connectivity, each
machine is tested for Internet connectivity. The students are asked to configure the web browser
on each machine for Internet browsing capability. Thus, each machine had to be configured with
the proper proxy settings. The final segment of the activity calls for the configuration of the
router for some specific functionalities such as enabling IP and MAC address filtering, the
blocking of Wide Area Network (WAN) requests, enabling multicasting, establishing VPN
sessions by enabling Point to Point Protocol (PPTP) Pass-through, enabling remote
management, specifying the Maximum Transmission Unit (MTU), and enabling Quality of
Service (QOS) for various ports. The LAN setup is depicted in Figure 1.
Finally, the students are required to submit a report that documents detailed descriptions
of their work and experiences in the laboratory. In that report, a special emphasis is made on
all the difficulties and challenges that they have encountered during the project execution.

228
CCSC: Southeastern Conference

Figure 1. The LAN Setup

The Network Programming Projects


Programming Project 1: User Datagram Protocol (UDP) Implementation
In this project, the students are required to implement the Trivial File Transfer Protocol
as described in Request For Comments (RFC) 1350 [Sol92] using the Java UDP APIs. In
addition, the students are required to familiarize themselves with RFC 768 [Post80] before
attempting the implementation.
The application program consists of two parts: a client and a server. These are to be
constructed using the UDPSender and the UDPReceiver classes that are discussed in a class
lecture. For the client side, the application uses the Graphical User Interface (GUI) that is
shown in figure 2. The server side does not need any user interface and should be designed as
a process running on the background. The students are provided with the source code of the
GUI implementation and are informed on the functionality of each GUI component. The project
description that can be downloaded from the course web site provides further details of the
implementation requirements.
To test for proper file transfers, the students need to run the program simultaneously on
two computers and to perform both file upload and download actions.

229
JCSC 19, 3 (January 2004)

Figure 2. The Client Graphical User Interface

Programming Project 2: Multicast Implementation


In this project, the students are required to complete a GUI based peer-to-peer chat room
implementation using the Java multicast and UDP APIs. As a background preparation for the
assignment, the students are encouraged to perused RFC 1112 [Deer89], the RFC for
multicasting. The user interface for the chat room is depicted in Figure 3.
The source code, which is mostly that for the GUI implementation, is given to the students
in order to jump start their implementation. It is divided into two main classes: the GUI
component and the thread component. This setup facilitates the concealment of the GUI
implementation details from the student and promotes the independence of the class
implementations. The students are instructed that the implementation of the GUI component is
complete and their efforts should be concentrated on enhancing the thread class. A code snippet
of this class is shown in Figure 4.
The students are advised to test their chat room by running it on at least three (3)
computers. Each user of the application starts by joining the chat room which is accomplished
by specifying the chat group IP address (224.0.0.1) and the port number (4001). The messages
are then sent to and from each user to simulate a real-time network instant messaging scheme.

230
CCSC: Southeastern Conference

Figure 3. The Multicast Chatroom Client Graphical User Interface

public void run ( ){


// This method is called by the start( ) invocation in the
// constructor method,
// MulticastThread(String ipNum, int portNum, int TTL).
// It should run indefinitely while the system is in the
// Chatroom, thus the code
while (isActive) {
// Receive the datagram and post it on the
//TextArea window.
// Hint: to be able to manipulate the TextArea
// window, you need to use the
// accessor method, getJTxtArea( ) and the
// mutator method, setJTxtArea( ). Both of
// these are
// methods of the MulticastChatGui class.
}//end of while

}//end of run

public void sendMsg(String msg, String ipNum, int portNum){

231
JCSC 19, 3 (January 2004)

// This method is called by the event of the mouse click


// on the send message button in the GUI.
// Its function is to package the message using a Datagram
// packet and send it to the multicast socket.
}//end of sendMsg

Figure 4. The Multicast Thread Source Code Snippet

Programming Project 3: TCP/IP Implementation


The last project involves a TCP/IP implementation of a network game. The students are
required to complete a GUI based implementation of a TicTacToe game over the network using
the Java TCP socket APIs. The students are encouraged to be familiar with RFC 793 [Post81]

Figure 5. The Game Interface Window


before starting this project. The graphical user interfaces are depicted in Figures 5 and 6.

The GUI displays the TicTacToe board and provides manual entry for data that is
required by TCP communication. Before the start of the game, a player selects a game piece

Figure 6. The Message Dialog Notification Window

232
CCSC: Southeastern Conference

(an O or an X) and enters the remote IP address and port number needed for communication.
The game is started by clicking on the Start Game button. Figure 6 depicts a message dialog
window that pops out as soon as a game winner is determined.
A source code for this project is provided to help the students get a quick start on their
implementations. This assignment, which is comparable to the previous project, has two (2)
main class implementations. However, this project requires a more elaborate implementation
and the completion of both classes. The first class, TicTacToeGUI, is a semi-complete
implementation of a GUI based TicTacToe game using the Java Swing APIs. The methods that
need to be completed on this class are: the checkWinner( ) and the showMove( ) methods.
The code snippet for both is shown in Figure 7.

public static int checkWinner(){


// Parameter: none
// Return: 0 if O wins, 1 if X wins, 2 if no winner
// CS450 Students:
// You need to complete this method. Here is the
// general description of its functionality:
// This method checks the rows, columns, and diagonals
// of a matrix,called table[][] to determine whether a
// player has won the game.
// Note that each cell in table[][] is initialized to
// 2 (unoccupied)and either to a 0 or a 1 depending on
// whether O or X is placed in there. This method is
// invoked by the showMove() method.
}//end of checkWinner

public static void showMove(int cellIndex, boolean myMove){


// Function: This method sets the an icon (either an
// X or an O) on the board.
// Input: cellIndex - the index number of the cell
// that is affected on the board. Note that the
// cells are numbered according to the ffg:
// 0 1 2
// 3 4 5
// 6 7 8
// myMove - a boolean value which indicates
// whether the move was made by the
// local player (true) or the
// the remote player (false).
// Return: none
// The algorithmic steps are as follows:
// 1. Calculate the row and column values of the
// table using the cellIndex. Note that the
// matrix, table[][], needs to be set to 0 or 1
// depending on whether an O or an X is placed
// in its corresponding board cell. Here are some
// sample scenarios: if an X is placed in
// cellIndex 0, table[0][0] must be set to 1.
// If an O is placed in cellIndex 7, then
// table[2][1] must be set to 0.

233
JCSC 19, 3 (January 2004)

//
// 2. Check who made the move. Thus,
// if (myMove) { //it is a local move
//
// ............ omitted code snippet in here. Check the
// source supplied for the omissions!
}//end of showMove

Figure 7. The Code Snippet for the TicTacToeGui Class

The second class implementation, TCPThread, extends a Thread class. This class has
been stripped of some important code implementation of a client-server TCP communication.
The students need to complete the methods, run( ) and sendMsg( ), in order to make it
functional. The specifications for these methods are shown in the code snippet in Figure 8.

public void run (){


// This is the method that is called when a thread
// initiates a start
while (isActive) {
try {
//Listen for a connection....on the server
//socket and connect to a buffered reader
// Parse the received buffered steam into chunks
// of integers and save it into a string of
// characters called msg.
//trim the message out of unprintable
//characters:

//invoke the static method of the TicTacToe


//class called showMove() to display the selected
//move of the remote player. Note that this
//method requires 2 parameters: the msg converted
//to an integer value which will correspond to
//the cellIndex and the boolean
//value, false,to indicate that this is a remote
//player's move.

//close the socket.

}//end of try
catch (SocketException se){
System.out.println("Socket Exception : " + se);
}
catch (IOException e) {
System.out.println("Exception : " + e);
}//end of catch
}//end of while
}//end of run

public void sendMsg(int cellIndex){


try {

234
CCSC: Southeastern Conference

//connect to an InputStreamReader and a


//BufferedReader
// create a socket and connect
// create the message string using the value of the
// cellIndex

// set the sendBufferSize to the message length

// create a bufferedOutputStream and send the message


// to the bufferedOutputStream character by character

//close the bufferedOutputStream

//close the socket


}//end of try
catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
}//end of catch
}//end of sendMsg

Figure 8. The Code Snippet for the TCPThread Class

The students are advised to test their implementations by running the application on two
(2) computers and play a game of TicTacToe!

CONCLUSION and FUTURE WORK


Finding the appropriate balance between theory, practical experience and research is
difficult in all computing courses. [ACM91, Davi97, and Lank98] This is especially true in the
areas of networking and computing systems. This paper outlined the laboratory projects that
are currently being utilized to support courses in these areas. The activities and projects are
designed and structured to provide practical experiences while illustrating theory and possible
research areas.
The challenge for the authors will be in the continual development of these activities and
the introduction of novel activities and projects that will leverage the availability of
state-of-the-art networking facilities. Future work will include:
• wireless protocol implementations,
• network security design activities,
• an implementation of a functionalweb server using the HyperText Transfer Protocol
(HTTP),
• an implementation of an electronic mail facility using the Simple Mail Transfer
Protocol (SMTP),
• wired and wireless benchmarking projects, and
• data encryption implementations.

235
JCSC 19, 3 (January 2004)

ACKNOWLEDGEMENTS
This paper is based upon a project partly supported by the National Science Foundation
under grants DUE-9950946 and DUE-0125635. Opinions expressed are those of the authors
and not necessarily of the Foundation.

REFERENCES
[ACM91] Computing Curriculum 1991. Report of the ACM/IEEE-CS Joint Curriculum
Task Force. ACM Press. 1991.
[Darb01] Darby, C., et. al. Beginning Java Networking. WROX Press Ltd. Birmingham,
UK. 2001.
[Davi97] Davis, G., et al., IS'97 Model Curriculum and Guidelines for Undergraduate
Degree Programs in Information Systems. 1997.
[Deer89] Deering, S. "Host Extensions for IP Multicasting," RFC 1112. Website:
http://www.rfc-editor.org. 1989
[Fink94] Finkel, D. and Chandra, S. NetCP-A Project Environment for an Undergraduate
Computer Networks Course. SIGSE Bulletin, Vol 26 No. 1, 1994.
[Haro00] Harold, Elliotte R. Java Network Programming. O'Reilly & Associates, Inc.
Sebastopol, CA. 2000
[Lank98] Lankewicz, L., Resources for Teaching Computer Networks. The Proceedings of
the Twenty-ninth SIGCSE Technical Symposium on Computer Science
Education. Atlanta, GA, 1998.
[Post80] Postel, J.B. "User Datagram Protocol," RFC 768. Website:
http://www.rfc-editor.org. 1980.
[Post81] Postel, J.B. "Transmission Control Protocol," RFC 793. Website:
http://www.rfc-editor.org. 1981.
[Reil02] Reilly, D and Reilly, M. Java Network Programming and Distributed
Computing. Addison-Wesley. Boston, MA,. 2002.
[Reyn96] Reynolds, Charles and Fox, Christopher. Requirement for a Computer Science
Curriculum Emphasizing Information Technology Subject Area: Curriculum Issues.
SIGSE Bulletin, Vol 28, No.1. March 1996.
[Siva99] Sivalingam, K., Rajaravivarma, V., Education of Wireless and ATM Networking
Concepts Using Hands-On Laboratory Experience. The Proceedings of the
Thirtieth SIGCSE Technical Symposium on Computer Science Education.
New Orleans, LA, 1999.

236
CCSC: Southeastern Conference

[Smit91] Smith, W.D. The Design of an Inexpensive Undergraduate Data Communications


Laboratory. SIGSE Bulletin, Vol 23, No.1, 1991.
[Sol92] Sollins, K. R. "The TFTP Protocol (Revision 2)," RFC 1350. Website:
http://www.rfc-editor.org. 1992
[Stev98] Stevens, W. Richard. TCP/IP Illustrated Volume 1. Addison-Wesley. Boston,
MA. 1998.
[Stev92] Stevens, W.R. Advanced Programming in the Unix Environment.
Addison-Wesley. Reading, MA. 1992.
[Toll95] Toll, William. Socket Programming in the Data Communications Laboratory.
SIGSE Conference Proceedings, Nashville, TN, 1995.

237