BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 -...

26
BSc in Telecommunications Engineering TEL3214 Computer Communication Networks Lecture 04 Establishing a Network Training Emulator Virtual Machine Eng Diarmuid O'Briain, CEng, CISSP

Transcript of BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 -...

Page 1: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

BSc in Telecommunications Engineering

TEL3214Computer Communication Networks

Lecture 04

Establishing a

Network Training Emulator

Virtual Machine

Eng Diarmuid O'Briain, CEng, CISSP

Page 2: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-2 TEL3214 - Computer Communication Networks

Copyright © 2017 Diarmuid Ó Briain

Permission is granted to copy, distribute and/or modify this document under the termsof the GNU Free Documentation License, Version 1.3 or any later version published bythe Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and noBack-Cover Texts. A copy of the license is included in the section entitled "GNU FreeDocumentation License".

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Page 3: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-3

Table of Contents1.NETWORK SIMULATION............................................................................................................................. 5

2.VIRTUALISATION......................................................................................................................................... 5

3.VIRTUALBOX.............................................................................................................................................. 6

3.1GETTING VIRTUALBOX..........................................................................................................................................63.2GETTING NTE.....................................................................................................................................................73.3INSTALLING A NTE VM ON VIRTUALBOX.................................................................................................................73.4RUNNING THE NTE VM.....................................................................................................................................103.5RUNNING NTE..................................................................................................................................................11

4.RUNNING VM HEADLESS.......................................................................................................................... 14

4.1LIST VIRTUAL MACHINES......................................................................................................................................144.2GET THE IP ADDRESS..........................................................................................................................................144.3START VM IN HEADLESS MODE.............................................................................................................................144.1CONNECT TO THE HEADLESS VM AND RUN THE CORE-GUI........................................................................................154.2POWER OFF HEADLESS VM..................................................................................................................................15

5.BUILDING A SIMPLE NETWORK................................................................................................................. 16

6.ACCESS THE NETWORK DEVICES............................................................................................................... 18

6.1OBSERVER TOOL................................................................................................................................................196.2TWO-NODE TOOL...............................................................................................................................................206.3THE PLOT TOOL.................................................................................................................................................21

7.TRAFFIC FLOWS........................................................................................................................................ 22

8.LAB EXERCISE........................................................................................................................................... 24

9.BIBLIOGRAPHY......................................................................................................................................... 26

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Page 4: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-4 TEL3214 - Computer Communication Networks

Illustration Index

Illustration 1: Virtualisation..................................................................................................................5Illustration 2: VirtualBox......................................................................................................................5Illustration 3: Appliance to import.......................................................................................................7Illustration 4: Appliance settings........................................................................................................8Illustration 5: VirtualBox Dashboard...................................................................................................8Illustration 6: Bridged adapter............................................................................................................9Illustration 7: Running NTE...............................................................................................................10Illustration 8: core-gui running within VM........................................................................................11Illustration 9: VM IP address............................................................................................................12Illustration 10: core-gui over X.11 Forwarding................................................................................13Illustration 11: core-gui running from headless VM........................................................................15Illustration 12: Simple network.........................................................................................................16Illustration 13: Start the session.......................................................................................................17Illustration 14: Accessing devices....................................................................................................18Illustration 15: Observer tool............................................................................................................19Illustration 16: Two-node tool...........................................................................................................20Illustration 17: Plot tool......................................................................................................................21Illustration 18: Traffic flows...............................................................................................................22Illustration 19: Throughput................................................................................................................22Illustration 20: Viewing throughput...................................................................................................23

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Page 5: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-5

1. Network Simulation

It is very useful to have a mechanism to simulate the networks discussed in thisdocument. The Network Training Emulator (NTE) developed by netLabs!UG ResearchCentre is an Open Source tool ideal for the purpose.

NTE is a tool for emulating networks on one or more machines. The emulated networkscan even be connected to live networks. NTE uses the Common Open ResearchEmulator (CORE) consists of a Graphical User Interface (GUI) for drawing topologies oflightweight virtual machines, and Python modules for scripting network emulation.

CORE was developed by a Network Technology research group that is part of theBoeing Research and Technology division. The Naval Research Laboratory issupporting further development of the project and netLabs!UG leaveraged thisdevelopment when creating the NTE tool.

Access to the software is at: http://www.netlabsug.org/NTE/

2. Virtualisation

Virtualisation is the creation of a virtual computer called aVirtual Machine (VM) that acts like a real computer with anOperating System (OS). Software executed on thesevirtual machines is separated from the underlyinghardware resources. The diagram above shows acomputer running GNU/Linux which is hosting a VM thatlooks like a separate computer with Microsoft Windows 7Operating System (OS). In this case virtualisation isprovided by Oracle VirtualBox and is considered Type 2virtualisation.

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 1: Virtualisation

Illustration 2: VirtualBox

Page 6: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-6 TEL3214 - Computer Communication Networks

3. VirtualBox

3.1 Getting VirtualBoxVirtualBox is a free Type-2 Hipervisor which will act as the platform for the NTEemulator.

3.1.1 GNU/Linux

Using a Debian GNU/Linux based OS review the packages available for VirtualBox.

$ aptitude search virtualboxp unity-scope-virtualbox - VirtualBox scope for Unity p virtualbox - x86 virtualization solution - base binaries p virtualbox:i386 - x86 virtualization solution - base binaries p virtualbox-dkms - x86 virtualization solution - kernel module sources for dkms p virtualbox-ext-pack - extra capabilities for VirtualBox, downloader. p virtualbox-guest-additions-iso - guest additions iso image for VirtualBox p virtualbox-guest-dkms - x86 virtualization solution - guest addition module source for dkms v virtualbox-guest-modules - v virtualbox-guest-modules:i386 - p virtualbox-guest-source - x86 virtualization solution - guest addition module source p virtualbox-guest-utils - x86 virtualization solution - non-X11 guest utilities p virtualbox-guest-utils:i386 - x86 virtualization solution - non-X11 guest utilities p virtualbox-guest-x11 - x86 virtualization solution - X11 guest utilities p virtualbox-guest-x11:i386 - x86 virtualization solution - X11 guest utilities v virtualbox-modules - p virtualbox-qt - x86 virtualization solution - Qt based user interface p virtualbox-qt:i386 - x86 virtualization solution - Qt based user interface p virtualbox-source - x86 virtualization solution - kernel module source

$ sudo aptitude install virtualbox

3.1.2 Apple OS X

Download and install the binary file below.

http://download.virtualbox.org/virtualbox/5.1.14/VirtualBox-5.1.14-112924-OSX.dmg

3.1.3 Microsoft Windows

Download and install the binary file below.

http://download.virtualbox.org/virtualbox/5.1.14/VirtualBox-5.1.14-112924-Win.exe

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Page 7: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-7

3.2 Getting NTEDownload the course NTE VM NTE_v2.0-i386.tar.gz from the course page.

Extract the NTE_v2.0-i386.ova file to the computer.

3.3 Installing a NTE VM on VirtualBoxFile > Import Appliance

Select the NTE_v2.0-i386.ova and click Next >.

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 3: Appliance to import

Page 8: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-8 TEL3214 - Computer Communication Networks

Check the tickbox for “Reinitialise the MAC address of all network cards”

Select Import.

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Illustration 5: VirtualBox Dashboard

Illustration 4: Appliance settings

Page 9: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-9

The new NTE VM is created. Before starting it configure the Network interface as aBridged Adapter. To do this Right click on the newly created VM, select Settings andNetwork, make the change from Attached to: NAT to Attached to: Bridged Adapter.Select OK.

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 6: Bridged adapter

Page 10: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-10 TEL3214 - Computer Communication Networks

3.4 Running the NTE VMSelect the NTE Network Emulator VM and click the Start (Green arrow) icon.

• Hostname: NTE-i386

• Username: nte

• Password: nte

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Illustration 7: Running NTE

Page 11: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-11

3.5 Running NTENTE can be ran in one of two ways:

1. Natively within VirtualBox

This method offers poor performance as the VM must emulate the video card.

Simply double-click on the NTE icon on the VM desktop. This runs the CORE GUIinterface within the VM directly.

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 8: core-gui running within VM

Page 12: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-12 TEL3214 - Computer Communication Networks

2. SSH with X11 forwarding

This is a better means of access as it offers better performance.

With this method an ssh connection from the host computer to the VM with X11forwarding to an X Server running on the host means that the host actually processesthe graphics and not the VM. If GNU/Linux is the host then an X Server will alreadyexist but for a Microsoft Windows host then an X-Server like Xming or Exceed will berequired (See TEL3214 – Appendix_01 – Build NTE VM).

Open a terminal in the VM and get the IP address with the ip addr command, note inthis case the IP Address is 192.168.10.6. This address the VM received directly fromthe DHCP Server on the network as the network adapter was bridged.

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Illustration 9: VM IP address

Page 13: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-13

From a terminal on the host connect as follows and once connected run the commandcore-gui:

$ ssh -X [email protected] core-guiThe authenticity of host '192.168.10.6 (192.168.10.6)' can't be established.ECDSA key fingerprint is dd:bd:74:25:ed:4b:ea:9f:05:e4:ae:ac:3f:46:21:a4.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.10.6' (ECDSA) to the list of known [email protected]'s password: nte

The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are describedin the individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.Last login: Fri Feb 19 15:56:56 2016 from 192.168.10.2

Connecting to "core-daemon" (127.0.0.1:4038)...connected.

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 10: core-gui over X.11 Forwarding

Page 14: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-14 TEL3214 - Computer Communication Networks

4. Running VM headless

VirtualBox allows for the running of the VM in headless mode meaning that there is noemulation of graphics. The VM runs as a server and can be accessed via SSH.

4.1 List virtual machinesFrom the command prompt of the host (and without the VirtualBox grapical dashboardrunning), list the available VirtualBox VMs.

ob@e550:~$ vboxmanage list vms"NTE_v1.0" {dc2471a1-0a44-40df-afd7-0dd38774baea}

4.2 Get the IP AddressRun a trace for BOOTP messages on the Host when the VM in headless mode isbooting it will request and receive an IP address from the network DHCP Server.

ob@e550:~$ sudo tshark -i wlan0 -O bootp | grep "Your (client) IP address:"

Capturing on 'wlan0'

116 Your (client) IP address: 0.0.0.0

119 Your (client) IP address: 0.0.0.0

Your (client) IP address: 192.168.88.12

4.3 Start VM in headless modeStart the VM to run in headless mode in the background.

ob@e550:~$ vboxmanage startvm NTE_v1.0 --type headlessWaiting for VM "NTE_v1.0" to power on...VM "NTE_v1.0" has been successfully started.

ob@e550:~$ vboxmanage showvminfo NTE_v1.0 | grep StateState: running (since 2016-02-19T15:46:35.817000000)

The trace ran in the previous command will show the IP address assigned to theheadless VM in this case.

Your (client) IP address: 192.168.10.4

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Page 15: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-15

4.1 Connect to the headless VM and run the core-guiConnect to the VM and run the core-gui command. The -X in the SSH command givesX11 redirection.

ob@e550:~$ ssh -X [email protected]@192.168.10.4's password: nte

The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are describedin the individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extentpermitted by applicable law.Last login: Fri Feb 19 15:36:17 2016 from 192.168.10.2nte@CORE-i386:~$ core-gui

4.2 Power off headless VMTo power down a headless VM. Identify the VM from the running VMs.

ob@e550:~$ vboxmanage list runningvms"NTE_v1.0" {dc2471a1-0a44-40df-afd7-0dd38774baea}

Power off the VM.

ob@e550:~$ vboxmanage controlvm NTE_v1.0 poweroff0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 11: core-gui running from headless VM

Page 16: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-16 TEL3214 - Computer Communication Networks

5. Building a simple network

Using the tools on the left side a network can be built. IP address will be assigned bydefault but these can be changed afterwards. The Tools > IP addresses will give theoption to remove addresses and add custom ones.

Click on the green start the session icon. Icons will go green for a shorttime to indicate they have indeed instantiated.

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Illustration 12: Simple network

Page 17: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-17

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 13: Start the session

Page 18: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-18 TEL3214 - Computer Communication Networks

6. Access the network devices

Once the network is running it is possible to access the shell of each device by simplydouble clicking on each. Here are terminals for n2 and n4. In the shell for n2 you cansee a succcessful ping to n1 the server. In the shell for n4 the iproute2 command iproute list shows the route table for the router. Alternatively it can be viewed fromQuagga. Connect to quagga using the vtysh command and a show ip routecommand gives the table in quagga format.

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Illustration 14: Accessing devices

Page 19: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-19

6.1 Observer toolThe Observer tool provides a method for seeing information about any node simply byhovering your mouse pointer over that node in the canvas once the item to be observedhas been selected. In the example shown the OSPF neighbours are shown. This is theequivalent of running the command below in the shell of the router.

$ vtysh -c {show ip ospf neighbor}

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 15: Observer tool

Page 20: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-20 TEL3214 - Computer Communication Networks

6.2 Two-node tool

The Two-node tool is useful to run either a ping or traceroute between two nodes andobserve the path of the traffic. This is the equivalent of running either

$ traceroute -n -t 0 192.77.203.2$ ping -R -n 192.77.203.2

Note: the -R in the ping command; this is the RECORD_ROUTE option in theECHO_REQUEST packet and displays the route buffer on returned packets. Manyhosts ignore or discard this option so you may find that you need to remove the -Roption before executing to get a response.

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Illustration 16: Two-node tool

Page 21: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-21

6.3 The Plot toolIf the Plot tool is selected then clicking on any link will activate the Throughput Widgetas a small graphic, scrolling throughput plot in real time. Right-click on a plot to removeit.

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 17: Plot tool

Page 22: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-22 TEL3214 - Computer Communication Networks

7. Traffic flows

Traffic flows can be generated and visualised using the Tools -> Traffic... option.Create a flow as shown. Additionally by checking Show -> Link labels the throughput oneach link can be observed. By adjusting the setting in Widgets -> ConfigureThroughput... it is possible to have highlighting when links exceed a threshold.

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Illustration 19: Throughput

Illustration 18: Traffic flows

Page 23: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-23

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Illustration 20: Viewing throughput

Page 24: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-24 TEL3214 - Computer Communication Networks

8. Lab Exercise

1. Setup an NTE Virtual Machine on VirtualBox.

2. Build the following network.

Node Type Interface IP Address

n1 Router eth0 10.0.0.1/30

eth1 10.0.1.1/30

eth2 10.0.2.1/30

n2 Router eth0 10.0.0.2/30

eth1 192.99.209.1/24

n3 Router eth0 10.0.1.2/30

eth1 192.88.208.1/24

n4 Router eth0 10.0.2.2/30

eth1 192.77.203.1/24

n5 PC eth0 192.77.203.2/24

n6 PC eth0 192.88.208.2/24

n7 PC eth0 192.99.209.2/24

3. Test connectivity between PC and Server.

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017

Page 25: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

TEL3214 - Computer Communication Networks 4-25

4. Login in to each node and copy the route table. Here is n1 for example.

5. Login to each router node and grab the OSPF Link State Database. Again here is n1 as an example.

6. Review each set of tables to gain an understanding of how the routing tablesare generated.

15 Mar 2017 Building a NTE Virtual Machine TEL3214

Page 26: BSc in Telecommunications Engineering TEL3214 Computer … · 2017. 3. 15. · 4-6 TEL3214 - Computer Communication Networks 3. VirtualBox 3.1 Getting VirtualBox VirtualBox is a free

4-26 TEL3214 - Computer Communication Networks

9. BibliographyOracle VM VirtualBox . (2013). Oracle VM VirtualBox . [ONLINE] Available at: https://www.virtualbox.org/. [Accessed 06 December 2013]. Oracle Corporation.

Ahrenholz, J. (2010). Comparison of CORE Network Emulation Platforms, Proceedings of IEEE MILCOM Conference, 2010, pp.864-869

Ahrenholz, J. (2015). CORE Documentation v4.8. Available at: http://downloads.pf.itd.nrl.navy.mil/docs/core/core_manual.pdf [Accessed: 28 |Dec 2015]

TEL3214 Establishing a NTE Virtual Machine 15 Mar 2017