Project review report - Prof Bill Buchanan's Home...

12
Honours Project (CO42019) Project Review Report Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 1 Project Review Report CO42019 Honours Project Honours Project. Year 2001/2002 Supervisor: Dr. Bill Buchanan Matriculation No: 00198226 Second Marker: Dr. Peter Ross

Transcript of Project review report - Prof Bill Buchanan's Home...

Page 1: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 1

Project Review Report

CO42019

Honours Project

Honours Project. Year 2001/2002 Supervisor: Dr. Bill Buchanan Matriculation No: 00198226 Second Marker: Dr. Peter Ross

Page 2: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 2

Table of Contents

1.) Student details ............................................................................................................... 3

2.) Project details ................................................................................................................ 3 2.1) Scope and aim of the study: ........................................................................................ 3

3.) Progress to date:............................................................................................................ 4 3.1) Objectives:................................................................................................................... 4 3.2) Deliverables: ............................................................................................................... 4 3.)a) Research undertaken. ................................................................................................. 4 3.)a)1) I.O.S. language ....................................................................................................... 4 3) a)2.) Programming language: Java ................................................................................. 5 3.)a)3) Actual products ....................................................................................................... 5 3.)a)4.) Further implementations ........................................................................................ 5 3)b) Practical work undertaken .......................................................................................... 6 3)b)1) Java Applet development and problems encountered ............................................. 6 3)b)2) Development environment and design .................................................................... 7 3)b)3) Implementation of the Java code. ............................................................................ 8

4) References:................................................................................................................... 10

5.) Self Assessment of progress........................................................................................ 10

6.) Gantt chart................................................................................................................... 11

Page 3: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 3

1.) Student details Name: Sébastien Kotzine Matriculation no: 00198226 Programme: Bsc. Network Computing Preferred e-mail address:[email protected] Dissertation title: Router Configuration Emulation Date: 2001 / 2002

2.) Project details Title: Router Configuration Emulation

2.1) Scope and aim of the study: The aim of this project is to develop a router emulator including configuration. Those three words need to be defined in this context in order to gain a better understanding of what the final piece of software will be able to perform. A router is a networking component which fit at a layer 3 of the O.S.I. model. Routers allow data to be passed from one network to another based on the destination network address of a data packet. In order to forward data traffic a router checks the data address, compares with its tables of IP addresses and forwards the packets to the intended networking device. Routers are complex devices which required commands to program the operation of the router, the configuration need to be implemented within the emulator. An emulator is as accurate as possible, a representation of the reality. Unfortunately, a consequent and expensive hardware is required in order to set-up router configuration. An emulator is then, a representation of the real router environment which can interpret commands and interpret these. Routers include a main I.O.S. (Internetwork Operating System) to interpret these commands. The software will be able to interpret most of the I.O.S. commands. Theses commands are used to perform some actions such as setting IP addresses and subnet mask for the ports, setting routing protocols. The final system will be able to perform command such as ping / telnet to other networking devices within the network environment. The system is intended to have an educational purpose, a user which wants to gain knowledge of routers programming without the use of a consequent and expensive hardware.

Page 4: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 4

3.) Progress to date:

3.1) Objectives:

Create an emulator of a router as close to the reality which implements major I.O.S. (Internetwork operating system) commands, be able to access to other routers on the same network and affect the IP addresses and subnet masks. A further implementation might include more specific I.O.S. commands. Another edge of the emulator can include a graphical representation of the commands typed, be able to save the router configuration and finally be able to connect to a real router in order to load the configuration via a distant machine.

3.2) Deliverables:

A fully implemented package programmed mainly in Java language used to enhance the learning of router programming. Most of the I.O.S. commands will be able to be interpreted and emulated.

The reason that Java has been selected among other programming languages is that java provides a lot of G.U.I. (Graphical User Interfaces) is really powerful and provides a good support for networking connections and is platform independent, which is a great advantage for educational purpose as the emulator will be able to run over a wide range of platforms.

3.)a) Research undertaken.

3.)a)1) I.O.S. language

One of the researches undertaken is focused on the I.O.S. (Internetwork Operating System). Different prompts modes have been viewed; router language is divided into different parts which contains different commands for different prompts.

Theses prompts and their relative commands have been understudied. The different aspect of the router programming such as setting up a hostname, IP addresses and subnet masks for each of the router ports have been viewed. In addition the ways of setting an executive password for restricting unwanted user or mistake to take place on the router configuration have been investigated. The login and telnet passwords have been viewed for the same reasons quoted before. In the introduction part it has been viewed that routers are complex networking devices that forward data traffic by checking the data address of the packets sent, the router compares with its tables of IP addresses and forward the packets to the intended networking device. The router is not able to connect to other router unless it runs a routing protocol which is the same as the other router, this allows the best path to a remote service, and in this case its routing table are defined The other part of the I.O.S. implementation investigated is the hostnames tables, it is difficult to remember the IP addresses of each of the ports, and thus a router can be setup with its own host table. Finally, some basic commands used to view the programmed configuration of the routers have been investigated, such as the show protocols and show running config.

Page 5: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 5

3)a)2.) Programming language: Java The router emulator is entirely programmed in Java, mainly as its ability provides a range of Graphical User Interfaces. This language is really powerful and provides a good support for networking connections, a lot of documentation and is platform independent. The two main aspects which have been researched is the Java swing components which give a great look and feel to the application by providing new set of graphical user interface. Strength and limitation of the Java Swing components have been investigated in order to see if the project is realistic to implements using such components. The other aspect investigated is the way of displaying information on the screen, set the position of the caret (or cursor) at the right place, remove one line while the enter key is pressed. Research of the hash map has been made (it will be developed on the second part of this report section (Practical work undertaken). Basically, a hash map is used to match objects with entities which is really useful, to have a table of the interpreted commands related to a key number. This key number is then used to access to the “Case” statement and display the feedback to the user of the command entered. Forte for java is a powerful tool entirely written in Java beans, which has been learned in order to program the router configuration. The advantages of forte are based on its powerful integrated components to be added and its multiple options and parameters which make a professional tool to be used when developing java applications. Furthermore the code generated is not over crowded with useless information such as JBuilder 3, the code is easy to compile and launched using a simple java virtual machine and notepad for editing.

3.)a)3) Actual products Some products are already been developed on the market, such as Cisco with E-Sim, the problem with this emulator is that is does not feel like a real router, a lot of I.O.S. commands are not interpreted and a narrow freedom for the router configuration is given. Another product “Boson Router Emulator” which suffers from the same problems as the Cisco emulator is fairly limited as only five routers can be configured within a network.

3.)a)4.) Further implementations Ideas for further implementation of the product have been thought of. Implementation of more I.O.S. commands appears to be essential for the software developed. Load and save configuration could be a really useful integration to the software, as it would be possible to save the actual configuration and load it later for more implementations. Furthermore, a graphical representation of the commands entered by the users appears to be a very useful extension as the emulator is intended for educational purpose, its could provide a faster understanding of the different commands by relying on a graphical view of the configuration. Finally, as java provide a wide set for communication within network, an extension of the project might appears to provide a connection to a real router and be able to load the configuration done with the emulator and download it into the real router via a remote machine.

Page 6: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 6

3)b) Practical work undertaken

3)b)1) Java Applet development and problems encountered After the research part, the project implementation is presented in this section, the first part of the implementation has been to develop a Java applet in order to be able to run the emulator via a web site and avoid different problems, such as the installation of the product on each machine, and platform independence…

Snapshot of the first solution developed using an applet.

Unfortunately, this solution has been abandoned due to the major problem encountered. The first problem is that not all the browsers supported the key listener and key event, which is the first command which is entered when a router need to be programmed.

Furthermore, the snapshot above shows the applet running under windows XP. After the decision of Microsoft, does not include JVM with Windows XP, java was not supported by internet explorer. Even after upgrading the JVM from Microsoft and sun, the browser supported java, but the key event was not working. The second problem is that, applets are not supporting Java Swing components which give a better look and feel rather than the standard G.U.I.

After agreement with my supervisor Dr. Bill Buchanan, a java application has been created instead of an applet, which avoid too many compatibility browser problems and it enables the uses of Java Swing components.

Page 7: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 7

3)b)2) Development environment and design

The environment learned in order to implement this project is: Forte for Java which provide a powerful development environment and improves the look and feel for the new version of the router emulator.

Forte for java Version 3

The presentation of the new router configuration emulation interface is presented below. The main frame is where the user need to enter the I.O.S. commands discussed before in order to program the router configuration. The smaller JText Area is used for the debug mode which is really useful when new command are tested and the values of some variables can be displayed, for debugging the application.

Router Configuration Emulation interface using Java Swing components

Page 8: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 8

3)b)3) Implementation of the Java code.

The next section presents the different aspect encountered during the development of the program. This part highlights the different steps and how the command are interpreted and emulated. The enter key is monitored in order to check for the user command, the following is a part of java code which is detecting the enter key. int code = evt.getKeyCode(); // Check if the key pressed is mapping with the virtual keyboard // used for keyboard compatibility, is "Enter" if (code = = evt.VK_ENTER) { Java code associated with the enter key

In order to be platform independent and access to internationalisation, each key correspond to a constant established within the key event class. For eg: VK_Enter (enter key), VK stands for virtual keyboard and is used for keyboard compatibility, (UK keyboard ? “Enter” is the word associated with the enter key while for the French keyboard the related code should be “Entrée” key. That is why the virtual keyboard is used to preserve compatibility. (See below)

The enter key is detected and used to have access to the router, when the key is pressed the user has access to the “user” prompt ( Router>). The software is able to select all the text, perform string manipulation and extract the command entered by the user. public void InterpretCommand(){ String AllText = DisplayRouter.getText(); int StringLength = AllText.length();/* Calculate the Length of the string */ int BeginOfCommand = AllText.lastIndexOf(">"); / * Calculate the beginning of the command typed */ int BeginOfCommand2 = BeginOfCommand +1; DisplayRouter.select(BeginOfCommand2,StringLength); /* Take the selection of the text and save it as a string */ String Command = DisplayRouter.getSelectedText(); Java code associated with the interpretation of the command and the extraction of the command typed by the user.

Page 9: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 9

When the command typed is extracted, a hash map is implemented in order to match the extracted command with a key. Hash map is a great tool in java as it allows matching the entered command with a key. This key will be an integer number which is really useful as the “Case” statements only accept integer number. The case will determine the actions to take according to the keys related to the commands typed and provide the appropriate feedback to the user. HashMap UserCommand = new HashMap(); String RelationUserHashMap; UserCommand.put("enable", "0"); UserCommand.put("en", "0"); UserCommand.put("logout", "1"); UserCommand.put(null,"2"); /* if the user has only pressed the enter key without including any commands */ RelationUserHashMap = (String)UserCommand.get(Command); Java code related with the hash map As we seen previously different prompts are used to enable different levels of configuration and different commands for each prompt are interpreted.

In this application, a command has been implemented in order to gain access to the privileged mode (enable) and perform actions such as setting IP addresses, routing protocols… The command disable is also interpreted in the privileged mode in order to come back to the user mode. The command logout is interpreted in order to exit the system, the prompt “Router con0 is now available Press return to get started”. If the enter key is pressed, the program jumps a line and displays the prompt again ; the last part implemented is that if the command does not match with the Hash map an error message is then displayed.

Screen shot of the application

Example of commands implemented which are emulated: enable, disable, no command typed, an error message.

Page 10: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 10

4) References:

As cited in 3)a) the research undertaken has been performed using references which are quoted here: I.O.S.: CCNA: Cisco Certified Network Associate. Todd Lammle. Edition Sybex I.S.B.N. : 0-7821-2647 Cisco Networking Academy program : Lab companion volume II Jim Lorentz. Serie Editor Vito Amato. Lecture note Advanced Distributed Systems: Working sheet 1 and 2. Cisco lab programming Java: Java for students 2nd edition. Douglas Bell and Mike Parr I.S.B.N.: 0-13-010922-3 Java Swing O’reilly. Robert Eckstein. Marc loy & Dave Wood. I.S.B.N.: 1-56592-455-x Actual products on the market: Boson router emulator http://www.boson.com/ Cisco http://www.cisco.com (Search for E-Sim)

5.) Self Assessment of progress. The first part of the progress of the project has been the researches undertaken in order to implement an emulator as close as possible to the reality. Specific java package have been viewed in order to implement this emulator. The first design has been made and it was using Java Applet, the implementation of the java applet needed to be abandoned due to the many problems encountered with browser compatibilities. Furthermore, the look and feel of the applet developed was not great due to the unsupported Java Swing components by applets. A new powerful professional package: Forte for Java Version 3 has been learned in order to develop a better router interface using Java swing components and advanced features provided by this software. The router interface has been completely remodelled, using Java swing components which give a more professional aspect to the router emulator interface. Java code has been implemented; the emulator is then able to extract the typed command using string manipulation. Once the command is extracted, the program checks if the command typed matches with the hash map. Once the key is returned from the hash map, a “Case” interprets the command and performs the action according to the typed command. Some commands have been implemented and are working, these are: enable which enables the privileged mode and display a new prompt; logout which exits the system and asks the user to press the enter key in order to enter into the emulator; disable command is

Page 11: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 11

implemented, this is used to return to the user mode, the user prompt mode is then displayed once more. At this time, the tools for extracting the typed command and interpret them are known; much more I.O.S. commands will be implemented over the next few weeks in order to match with the planning and the requirements. Some extensions of the project are under study, such as extending to more I.O.S. commands, provide a load and save router configuration files. Graphical representation of the command typed can be an extension and finally a connection to a real router and be able to download the configuration tested, using the router configuration emulator, onto a real router.

6.) Gantt chart

A Gantt chart is shown on the next page in order to show the actual against estimated progress to date, and planned activities to hand in.

Page 12: Project review report - Prof Bill Buchanan's Home Pagebillatnapier.com/PROJECTS/seb_project_review.pdf · 2015-09-19 · Honours Project (CO42019) Project Review Report Sébastien

Honours Project (CO42019) Project Review Report

Sébastien Kotzine Bsc. Network Computing Hons. Napier University Year 2001/2002 Page: 12