Introduction to Computer Networks (IRC) Licenciatura in Electronics Engineering (LEE) Licenciatura in Communication Networks Engineering (LERC) Laboratory guide nº 2 1 Objectives To familiarize your- self with some of the most used tools of the networking area. Now, you are going to have your first experience as Network Operator, You don t need to know a lot about computer networks in this laboratory to have success. You just need to read the guide, prepare the work and execute the exercises carefully to start learning by yourself. After that, be curious and to it again by your own initiative. Have fun! 2 Equipment PC with Windows 7 (or any other operating system) and with a virtual machine running Linux/Ubuntu. 3 Preparation of the work In this lab work you are going to use a PC running a virtual machine. This guide assumes that the physical PC uses Windows 7 and virtual one Linux/Ubuntu. However, other combinations are possible. To familiarize yourself with the tools, use the command man. 4 Report Write a report about the exercise of section 5. The report, in pdf format, must be uploaded to the Web page of the course until the date defined by the instructor (approximately one week after the last class scheduled for the work). This report must have only one page. Do not forget to include the name and number of all group elements that have performed the work. 1
5 Exercises During these exercises you are going to learn how to use the tools most used by network administrators. Get fun and enjoy your first experience! 5.1 Basic network tools For these exercises just connect your PC to the Internet and open the Windows console (called Command Prompt). In Windows 7 you can find the Command Prompt in Start Menu All Programs Accessories. Or else, you can run cmd in the box Search programs and files of the Start Menu. In case of a Linux/MacOS PC, open a Terminal window. If it is not visible, use the finder/spotlight to find it. 5.1.1 Your PC in the net Network nodes are connected to the network through a set of interfaces. Now, you are going to learn what you need to characterize a network interface. Notes: If you are using a MAC or Linux end- system use ifconfig. There is no equivalent to ipconfig /all; ifconfig displays the hardware address but not the addresses of the DNS servers. To look for them in MAC or Linux use the command cat /etc/resolv.conf. 1. Run the ipconfig command and register the IPv4 address, the subnet mask and the default gateway address, of each active interface. 2. Run again the ipconfig command with the /all option. What is the main difference? Register the name of your PC and, for each active interface, register the hardware address and the IP addresses of the DNS servers. 5.1.2 Testing connectivity Connectivity problems arise when it is not possible to communicate with a destination. Let s learn the tools used to deal with this! The ping command is the same in all operating systems. If you are using a MAC or Linux end- system the command is: traceroute. 3. The ping command can be used to check the connectivity with Internet sites. Run ping www.ist.utl.pt to check the connectivity with the IST site. Try other two sites besides this one. Is it possible to connect with these sites? Justify your answer. 4. The tracert command can be used to characterize the route to a destination. Run the tracert command to determine the routes to the destinations selected in the previous exercise. Register the number of hops to each destination, and the IP address of the router that is two hops before the destination. 2
5.1.3 Addressing and naming: two views of the same reality Nodes and IP addresses are two different ways of identifying nodes interfaces. Have a look on different possibilities available! The nslookup command is the same in all operating systems. 5. The nslookup command can be used to determine the IP address that corresponds to a name, or the name that corresponds to an IP address. Verify these functionalities taking as example the IST site. Register the IP address of the IST site. Confirm now that the ping command can be used with the IP address instead of the name. Use this command to identify the name that corresponds to the IP address 213.13.146.140 and register it. 6. In the Internet, one name can be associated with more than one IP address and one IP address can be associated with more than one name. Run the nslookup command to identify one example of each of these cases. In the latter case (one IP address with more than one name) get help from reverse IP lookup at http://www.domaintools.com/research/reverse- ip/. 5.1.4 Measuring the performance of the network The simplest commands, like ping and tracert, have been widely used to measure the Internet performance. They are one of the most used tools by the Network Operators. You are now ready to be one of them! The whois command is the same in all operating systems. 7. Select one destination in each of the following regions: Europe, Africa, Asia, North America, South America, and Oceania. One possibility is to select sites of governments or sites of universities. To confirm that the selected destinations are indeed in the selected region you can use a visual trace route tool (see, for example, www.yougetsignal.com) or an IP address country locator (see, for example, http://www.formyip.com). Run the ping command to determine the average round trip time to each of these destinations. Register these values. 8. Run the tracert command to determine the routes to the destinations selected in the previous exercise. Register the number of hops to each destination, and the IP address of the router that is two hops before the destination. 9. Using the whois service (http://cqcounter.com/whois/), identify (if possible) the entities responsible for the routers, which are two hops before the destinations selected in previous exercise. Identify also their geographical location. 10. In the Internet, the round- trip time is not always proportional to the geographical distance. Show that this is true using carefully selected examples. For this exercise it may be useful to resort to a visual trace route tool (see, for example, www.yougetsignal.com). There are several sites in the Internet that determine the distance between two cities (see, for example, www.geobytes.com). 3
5.2 Setting up a network Now it s time to setup your first network! You are going to connect your PC (Windows) and another machine, the VM- Ubuntu virtual machine. In order to enable communications between the Windows and Linux/Ubuntu machines you have to configure the IP address and subnet mask of both machines. 5.2.1 Configuration of the VM- Ubuntu Before that, you need to configure the Linux/Ubuntu machine in the Host- only networking mode. Mac- OS version: To configure the IP address and subnet mask of the MAC side, in the main window of VirtualBox select VirtualBox Preferences Network. o Then, click on the Add Host- only- network and observe the appearance of vboxnet0 on the main window. (SO MAC- OS) o Then, double click above vboxnet0 and, in the IPv4 Address box insert 192.168.56.1 and in the IPv4 Network Mask box insert 255.255.255.0. Finally, click OK. Now you can check that the address and subnet mask were indeed assigned to the VirtualBox interface of MAC. You may use ipconfig for this purpose. To configure the Linux/Ubuntu in the Host- only networking mode, with the machine powered- off, right click in its name and select Settings Network. Here, in the Attached to box select Host- only adapter and click OK s Now, you have to configure the IP address and subnet mask of the Linux/Ubuntu machine. Power on the Linux/Ubuntu machine, go to System Settings Network, select Wired and click in Options. Here go to the separator IPv4 Settings, select the Method 56.101l and click Add. You can now insert 192.168.56.101 in the IP address and 255.255.255.0 in the Subnet mask. Use the ifconfig command in the Ubuntu terminal to check that everything went Ok. Windows 7 version To configure the Linux/Ubuntu in the Host- only networking mode, with the machine powered- off, right click in its name and select Properties Network. Here, in the Attached to box select Host- only adapter. To configure the IP address and subnet mask of the Windows 7 side, in the main window of VirtualBox (Oracle VM VirtualBox Manager) select File Preferences Network. Then, double click above VirtualBox Host- Only Ethernet Adapter and, in the IPv4 Address box insert 192.168.56.1 and in the IPv4 Network Mask box insert 255.255.255.0. Finally, click OK. Now you can check that the address and subnet mask were indeed assigned to the VirtualBox interface of Windows 7. You may use ipconfig for this purpose. An alternative is to look into the driver configuration. To do that, from the Start Menu follow the path Network Networks and Sharing Center Change adapter settings. Then, click to open the VirtualBox Host- Only Network driver. This is the interface that Windows 7 has created to communicate (internally) with the virtual machine. Here select Properties and double click Internet Protocol Version 4 (TCP/IPv4). You should see the address and subnet mask just configured. Now, you have to configure the IP address and subnet mask of the Linux/Ubuntu machine. Power on the Linux/Ubuntu machine, go to System Settings Network, select Wired and click in Options. 4
Here go to the separator IPv4 Settings and click Add. You can now insert 192.168.56.101 in the IP address and 255.255.255.0 in the Subnet mask. Use the ifconfig command in the Ubuntu terminal to check that everything went Ok. 11. The final connectivity test is to send a ping from the Windows to the Linux/Ubuntu machine and vice- versa. Did it work well in your case? Call the professor and show your result. Ask her/him to register it. 5