Project 1: Explore Networking in the Cloud ( Steps 1 trough 4, are already completed)

profileInca
Step7_SimulatingaNetworkUsingMininetandAnalyzingPacketsUsingWireshark.pdf

1

CCA 625 Project 1: Simulating a Network Using Mininet and Analyzing Packets Using Wireshark In this lab exercise, you will perform the following steps:

1. Log in to your AWS Educate account and go to the AWS console.

2. Provision an AWS EC2 instance using provided Amazon Machine Image (AMI).

3. Make the instance available for remote desktop access and connect to it.

4. Run the Mininet simulator, ping one simulated Mininet host from another simulated host, and capture the packets using the Wireshark packet analyzer. Inspect the packets.

You will write a lab report describing the steps you've taken, include required screenshots, and provide answers to questions.

Step 1: Log In to Your AWS Educate Account 1. You should have the AWS Educate account created in CCA 610. If you don't have the

account, create one by going to AWS Educate ([email protected]) and register as a student using your university student email. Contact your instructor to be added to the CCA 625 classroom.

2. Log in to your AWS Educate account. Click on the "My Classrooms" link at the top or bottom of the main page. You have been invited to join the CCA 625 classroom. Click "Accept Invitation" and click "Continue" on the next screen. You will use this AWS Educate Classroom for all AWS labs in this course.

3. In the "My Classrooms" page, click on the "Go to classroom button" for CCA 625. Make sure that you enable pop-up windows from the classroom website. Click "Continue" on the Confirm pop-up.

4. On the "Welcome to AWS Educate Classroom Account" screen, you can see a summary of your account status, including how many credits you have remaining. If you follow the lab instructions of this class carefully, that credit amount should be sufficient. If you ever run low on credits, reach out to your instructor.

5. To begin this lab, click on the "AWS Console" button.

2

Step 2: Provision an AWS EC2 Instance Using a Preconfigured Amazon Machine Image (AMI) 1. Make sure that you are in the "US East (N. Virginia)" region (check in the top right corner).

2. In the AWS Management Console, click on "EC2" under "Compute."

3. The EC2 dashboard will open. Click on "AMIs" under "IMAGES" on the left panel.

4. Select "Public Images" in the drop-down menu called "Owned by me." In the search box next to it, type "CCA 625 Project 1 Lab Image" and hit Enter. It should find the image with the image ID of "ami-0c6174155fdf32475" and the description of "ubuntu lxde xrdp wireshark mininet". (Those attributes can be also used as search criteria). Take a screenshot of the whole screen and include it in your lab report. Select it and click the "Launch" button.

Source: Amazon Web Services.

5. In "Step 2 – Select the Instance Type," accept the preselected "T2.micro" type, which is free-tier eligible.

6. On top of the screen, click on "6. Configure Security Group." Security groups act as firewalls, defining which ports are open for which protocols on AMI instances. They also define allowed IP addresses or their ranges for machines that can communicate through these ports. On the "Step 6: Configure Security Group" screen, you will see that under "Assign a Security Group" heading, the option "Create a new security group" is preselected. Keep it.

7. Look at the list of allowed protocols and ports. It will have the one rule for the SSH protocol, which allows you to connect to instance command line interfaces. Click on the "Add Rule" button. In the Type column, scroll down to RDP and select it. Add rule with port 3389 – default port for the remote desktop connections, which we will use to access the instance.

8. By default, the rule for SSH specifies the source for connections as "Custom 0.0.0.0/0," which means that any IP address can try to connect to instances in this security group. It is recommended that in the Source column, select "My IP" in the drop-down list. It should enter

3

your public IPv4 address in the address box, in the form of the/32 CIDR. Note: This will prevent a connection to this EC2 instance from any other computer than the one you are currently using. If you plan to continue this lab from another computer in another network (for example your work computer), you need to either enter the public IP address of your other computer, or you need to keep the source as "Custom 0.0.0.0/0."

Source: Amazon Web Services.

Click on the "Review and Launch" button.

9. On "Step 7: Review Instance Launch" screen, review the instance's detail. Take a screenshot of the whole instance detail screen and include it in your lab report. Click on "Launch."

10. The "Select an existing key pair or create a new key pair" window pops up. If you have an existing key pair in your AWS account, select it in the second drop-down, but make sure you still have access to the private key pair. If this is the first time you are launching an EC2 instance, you likely don't have an existing key pair. If so, select "Create a new key pair" in the first drop-down, give it the name "CCA625P1-key," and click the "Download Key Pair" button. Save the .pem file in a convenient location—you will need it to connect to the instance. Do not lose this file.

11. Click the "Launch Instances" button. Your instance will start provisioning. Go to "Services," then "EC2," to see the EC2 dashboard and click on "Running Instances." You will see your instance being provisioned.

12. Once the instance is in the running state (green ball) and you see a green checkmark under "Status Checks," take note of its Public DNS name (in the Public DNS (IPv4) column or from the instance detail at the bottom of the screen). Then, make sure that the instance is selected and click on the Connect button on top.

Source: Amazon Web Services.

4

Take a screenshot of the running instances list screen and include it in your lab report.

Step 3: Make the Instance Available for Remote Desktop Access and Connect to It 13. Following directions in the "Connect to Your Instance" pop-up window, connect to the

instance using a standalone SSH client. The simplest way to do it is to invoke the ssh command as per the example in the pop-up. If you are using Windows 10, you will do this in the PowerShell command window, or if you are using a Mac, you will do this in a terminal window.

You will need to replace the user name of root in the command (before the @ sign) with "ubuntu" – it is the default AWS user name on Ubuntu EC2 instances, which has sudo (superuser) privileges. On your computer, make sure that you are in a directory in which your private key (the .pem file) is saved. Select "Yes" to the host authenticity warning.

If you are using any other earlier version of Windows (pre-Windows 10), you have to use PuTTY. There are extra steps that you must take before you can use PuTTY. First, you must convert the .pem private key that you have downloaded into a format that PuTTY can understand. You will use the PuTTYgen program to convert this file to .ppk format. You then need to import the .ppk file into your PuTTY program before you can connect to the EC2 instance. Use the PuTTY connection instructions for detailed steps on using PuTTY to connect to the EC2 instance. Make sure you add "ubuntu@" in front of the host name (public DNS name that you noted from step 12 above) and import the converted private key if you are using PuTTY. Once connected, you will see a black screen with the command prompt on it.

5

Source: Ubuntu.

14. The Remote Desktop Connection app requires a username and password. The image is enabled for password authentication, but the Ubuntu user has no password defined. On the instance's command prompt, type the command "sudo passwd ubuntu" to change the password for the Ubuntu account, and enter a strong password (two times) for the Ubuntu user. Take a screenshot of the command window and include it in your lab report. Log out from the SSH session by typing "exit."

15. If you are on a Windows machine, open the Remote Desktop Connection application. If you are on a Mac, you can download and install the Remote Desktop 10 app from the Mac App Store.

16. In the Remote Desktop Connection window, enter the public DNS name of the instance that you noted from Step 12 above. Accept the warning pop-ups, and enter ubuntu as username and the password you've created in Step 14. You should see the lxde desktop of your ubuntu instance:

6

Source: Ubuntu.

17. Maximize your screen, click on the xlde icon in the lower left corner to open the list of actions as above, go to accessories, and open the Byobu terminal window.

Step 4: Run Mininet, Ping One Simulated Mininet Host From Another, and Capture and Inspect the Packets 18. In the terminal window, type "sudo mn". The mininet simulator will create an SDN network

of two hosts, h1 and h2, and a switch, s1, between them. You will see the mininet command prompt.

19. Type "h1 wireshark &" on the mininet command prompt. The Wireshark window will open on the h1 host. Next, type "h2 wireshark &" on the mininet command prompt. A second Wireshark window will open on the h2 host. Arrange your xlde desktop so that all three windows are visible.

7

Sources: Mininet, Wireshark.

20. Start capturing packets in both mininet windows by clicking on the shark fin icon in the toolbar (the first icon on the left).

21. In the terminal window, on the mininet prompt, type "h1 ping h2". In both Wireshark windows, you will see packets being captured on both h1 and h2 hosts. The ping command is a continuous command. You'll have to issue a break command to stop it. On the keyboard, press and hold down the Ctrl button (usually on the lower left of the keyboard) and while holding it down, press the C key, then release both keys. Click on the red square icon in both Wireshark windows toolbars to stop capturing.

22. Take a screenshot of your remote desktop window with both command and Wireshark windows showing and include it in your lab report.

23. Answer the following questions:

• What are the IP addresses of both hosts?

• What protocol packets are captured in this communication? What are these protocols? Research if needed.

• What values are captured in the Wireshark Info column?

24. Write the lab report, showing steps you've taken, requested screenshots and answers to questions from Step 28. Submit the lab report in Project 1 Step 7 submission box.

8

25. Close the remote desktop window. Now, even though you have closed down the PuTTY and remote desktop connection to your EC2 instance, it is still running on AWS. You will continue to incur use charges (it will be charged against the AWS credits that you received as part of the CCA 625 AWS Educate Classroom). You will need to stop and terminate your EC2 instance to avoid further charges and to preserve your credits for future projects.

26. Go back to the AWS Console window. If you already closed it, go back to AWSEducate.com, log in, click on "My Classrooms," click on "Go to classroom" for CCA 625, and click on the "AWS Console" button. Remember, you are doing this inside a temporary AWS account created for you from within the AWS Educate environment. You are not using your personal AWS account (if you have one).

27. On the AWS Console window, click on Services, and EC2. Click on "Running Instances." Select the one EC2 instance that you have there, click on the "Action" button, then "Instance State," and "Stop." Click "Yes, Stop" on the pop-up window. Wait until the "Instance State" showed "Stopped." Now, the instance is stopped. But it will still incur a small charge for the storage space it is using. To totally stop the charges, you need to also terminate the instance. Click on the "Action" button, "Instance State," and "Terminate." Click on the "Yes, Terminate" button on the pop-up window. Take a screenshot of the instance windows showing the instance is terminated and include it in your report.

28. Finally, you also need to delete the nonstandard security group that you created as part of this lab. Click on "Security Groups" on the left panel. Select the one security group with the group name that start with "launch-wizard." Click on "Action" and "Delete Security Group." Click on "Yes, Delete" on the pop-up window.

29. Log out and close the AWS Console window.