#LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass report \begin_preamble \input{preamble} \end_preamble \language english \inputencoding auto \fontscheme times \graphics default \paperfontsize 11 \spacing double \papersize letterpaper \paperpackage a4 \use_geometry 1 \use_amsmath 1 \use_natbib 1 \use_numerical_citations 1 \paperorientation portrait \leftmargin 1.5in \topmargin 0.9in \rightmargin 1in \bottommargin 1in \headsep 0.17in \footskip 0in \secnumdepth 4 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle fancy \layout Chapter Techniques for Vitrual Machines \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash thispagestyle{empty} \end_inset \begin_inset ERT status Collapsed \layout Standard \backslash renewcommand \backslash figurename{Fig.} \end_inset User Mode Linux \begin_inset LatexCommand \citep{Dike} \end_inset , abbreviated UML, is a part of the sourceforge repository and is a patch to the Linux source which allows a Linux kernel to run at the application level. This thesis project revolves around the use of UML (User Mode Linux) by taking advantage the Linux kernel running at the application level. User Mode Linux also allowed multiple sessions to run on the application layer with both graphical interfaces and networking capabilities. \layout Standard This section and Appendix \begin_inset LatexCommand \ref{cha:Comments-on-User} \end_inset give a general overview of UML (User Mode Linux) then progresses to the more technical issues of how UML runs, networks together, and builds an executable from the the Linux kernel. The next section will talk about what is the application layer. \layout Standard \begin_inset Float figure placement h wide false collapsed true \layout Standard \align center \begin_inset Graphics filename Figures/01osLayers.eps display none \end_inset \layout Caption \begin_inset LatexCommand \label{fig: OS_layers} \end_inset Computer system layers \end_inset \layout Standard A computer system consists of three major levels, as shown in Fig.\SpecialChar ~ \begin_inset LatexCommand \ref{fig: OS_layers} \end_inset , are: hardware, system programs, and application programs (or application level) \begin_inset LatexCommand \citep{Tanenbaum2001} \end_inset . \layout Standard The significance of running the Linux kernel at the application level is two fold: allows debugging and lowers the risk of damage to the host machine's operating system. Debugging capabilities is a big plus over printk statements (same as printf in C/C++ but at the kernel level). This thesis project goes into the network packets storage structure, called the sk_buff. With debugging, an attached GDB session (or other debugging session) can watch the sk_buff for changes and make observations to packets as they are received. One of the main goals of this thesis is to create multipath router. Using a debugger is helpful in achieving this goal. \layout Standard Degugging the Linux Kernel is difficult without the infrastructure of an operating system separate from the one currently being debugged. In the current literature, there are only two debuggers mentioned. This includes User Mode Linux and another debugging tool called kgdb. They both use two different methods of debugging. \layout Section Kgdb overview \layout Standard Kgdb \begin_inset LatexCommand \citep{Grothe2001} \end_inset is not the subject of this thesis but deserve some mention. It is a modified version of the popular debugging tool from the free software foundation, gdb. Kgdb involves using two computers through a PPP serial port connection. Kgdb uses the observing operating system as the infrastructure to run Kgdb. The other machine serves as the debugging kernel relays debug information through the PPP serial port connection as shown in Fig.\SpecialChar ~ \begin_inset LatexCommand \ref{Fig: KGDB} \end_inset . \layout Standard \begin_inset Float figure placement h wide false collapsed false \layout Standard \align center \begin_inset Graphics filename Figures/02kgdb.eps display none \end_inset \layout Caption \begin_inset LatexCommand \label{Fig: KGDB} \end_inset KGdb \end_inset \layout Standard While this sounds easier than the User Mode Linux setup, there are set backs like: the use of two machines and how long the debugging machine takes to recover from a kernel crash. Initially looking at the two different options, the needed resources and recovery time is what placed User Mode Linux as the likely development candidate. Also, User Mode Linux makes it possible to create a cluster of User Mode Linux clusters for network testing on one machine. \layout Section User Mode Linux Overview \layout Standard UML (acronyms used for User Mode Linux) is ran at the application level. So it can be debugged and does not take the host kernel down if the kernel modifications cause the virtual system to crash. UML is setup in two parts and can have multiple sessions running and has a virtual networking environment to transfer packs between other UML sessions or the host machine. For researchers with a limited amount of machinery the low overhead is extremely helpful. To compile the kernel for a UML takes about a fourth of the time to build compared to a regular kernel. \layout Standard All of the Linux distributions (Redhat, Slackware, Mandrake and others) include extra kernel options, so a distribution works for all types of machines(Dell's, Hp's, i386's, SUN's, Itaniums, and etc). All the different options are not needed by the kernel nor operating system but is included in kernel by default. Even if the researcher compiled the Linux kernel with no modules and turned on the options needed and created a fast and optimized kernel, the UML kernel still compiles faster. The UML kernel does not have a hardware architecture, everything is done in emulated hardware. For example, the UML kernel relies the host kernel's routing table through a software interface driver (e.g., Tuntap) and does not need an Ethernet driver for networking. UML uses a virtual hard drive. UML does not use hardware (e.g., CD Rom or any other hardware perpetuals). The lack of hardware drivers cuts the compile time down and creates a secilized kernel for only one set of device drivers. \layout Subsection Background \layout Standard There are two major pieces to the UML architecture as shown in Fig.\SpecialChar ~ \begin_inset LatexCommand \ref{fig:UML-architecture-with} \end_inset the figure below. This next section will start by explaining the two different components and then describe their significance. \layout Standard \begin_inset Float figure placement h wide false collapsed false \layout Standard \align center \begin_inset Graphics filename Figures/03UMLArchitecture.eps display none \end_inset \layout Caption \begin_inset LatexCommand \label{fig:UML-architecture-with} \end_inset UML architecture with tuntap driver attached to host \end_inset \layout Subsection The Root File System: root_fs \layout Standard First there is the root_fs, which stands for the "root file system". The root_fs is a hard drive image containing the operating system and the other system files. It consists of all the libraries, shells, and applications. At a practical level, the root_fs is a single file of an entire hard drive image with the exception of the Linux kernel (files in the /boot) \begin_inset Foot collapsed true \layout Standard The root_fs is very similar to an "ISO image" which makes CD's. A number of software manufactures (Redhat, Sun, and Microsoft) allow developers and system administrators to download these "iso images". An "iso image" is an image byte for byte of a CD Rom disk; all the information is placed into a single file following the iso9660 file format (the file format of CD Roms). \end_inset . Since a root_fs are entire file systems within a file, it is possible to mount to these images using the Unix "mount" command. There is a special option called -o loop which is needed, and can mounted like a device under a Linux platform. The command to mount a root_fs is in Fig.\SpecialChar ~ \begin_inset LatexCommand \ref{fig:Command-to-mount} \end_inset \layout Standard \begin_inset Float figure placement h wide false collapsed false \layout Standard \align center \begin_inset Tabular \begin_inset Text \layout Standard mount -t /mnt/floppy -o loop \end_inset \end_inset \layout Caption \begin_inset LatexCommand \label{fig:Command-to-mount} \end_inset Command to mount a file system \end_inset \layout Standard Creating an root_fs is a tedious process and requires the CD's from a preferred Linux distribution. Bigger, more feature intensive root_fs take longer to load. Using a simple root_fs has great merit. For experiments, an older version of Slackware was used; Slackware with an UML kernel takes about one minute to load and has exactly the requirements needed. \layout Subsection UML Kernel Executable \layout Standard This root_fs interfaces with the second part of the UML, the Linux executable. What the UML project has done is clever. They have kept kernel development at the front of their design and created the Linux kernel as a stand alone executable which interfaces with the root_fs to create a Linux operating system at the application level. This Linux kernel executable is compiled from a patched Linux source code. \layout Standard What needs to be understood, the Linux kernel executable interfaces with the root file system. Command line parameters tell the Linux kernel executable how to network interface with the host, how to toggle the debugger on or off (if the skas patch is not installed), how the xwindows on the virtual machines forwards the display and any other hardware or software parameter relating to the host machine. \layout Standard This Linux kernel is not difficult to compile. The compile time is also a fifth of the normal default compile time. There are a host of advantages for having the UML session partitioned in two sections (Linux executable and root_fs). The UML Linux kernel executable is on average 8 Megabytes. The vmlinuz (virtual machine Linux on the actual Linux host machine) is about 1.4 megs, generally smaller than a disk. The Linux UML executable is bigger, because the UML code is compiled with debug symbols and has all of the virtual device drivers built into the UML kernel. \layout Subsection How UML Could Be Used \layout Standard User Mode Linux could be used in education for Kernel development and for showing network security concepts. UML is currently used in Dr. Edward Chow's CS 522, Networking Communication, to do routing problems and demonstrates networking concepts without much overhead and security risks. In more advanced classes, the Linux kernel and provide an in depth look at an operating system. \layout Standard The goal of this section and Appendix \begin_inset LatexCommand \ref{cha:Comments-on-User} \end_inset and \begin_inset LatexCommand \ref{cha:Instruction-manual} \end_inset is for easier research involving kernel development. Breaking through the complex set up for UML, could be a priceless tool saving both resources and time. \the_end