首页 » Python代写 » Python代写|CS 352 Internet Technology Project #5: Set up your own IP network

Python代写|CS 352 Internet Technology Project #5: Set up your own IP network

这是一篇美国的计算机网络python代写

 

Instructions

Please read these instructions carefully before you begin.

  1. You must work on this project in teams of 2.
  2. You are free to discuss the project on Piazza or through other means with your peers and the instructors. You may refer to the course materials, textbook, and resources on the Internet for a deeper understanding of the topics. However, you cannot lift solutions from other students or from the web including GitHub, Stack Overflflow, or other resources. Do not post this project to question-answering services like Chegg. All written and programmed solutions must be your team’s original work. We run sophisticated software to detect plagiarism and carefully monitor student answers. If you are in doubt, please ask us.
  1. You cannot post your solutions to this project on your personal GitHub page or on other web services hosting class materials.
  1. For each question in the project report, please be clear and concise. Vague and rambling answers will receive zero credit.
  1. For the report question on collaboration, please include anyone you discussed the project with, and also any resources you consulted to learn how to solve this project, including URLs of pages visited on the Internet. Please be specifific about the aspect of the project that you got help with. You must be thorough and as complete as possible here. It is mandatory to answer this question.
  1. We encourage you to start early and get the bulk of the work for this project done the week(s) before it is due, rather than keeping it until the submission date.
  1. If you have any questions or clarififications on the project, please post them on Piazza or contact the course staff. We are here to help.

Overview

In this project, you will set up a small IP network consisting of hosts and a router. Your network will function with full end-to-end connectivity, and you will experiment with tools like ping and traceroute.

Consider the following network topology:

Here, r1 is an IP router and h1 … h4 are endpoints. In a safe experimental setting running inside a virtual machine, you will use the ip suite of commands to set up the right IP addresses for all the interfaces, and the right routing table entries for all the routers and endpoints in this network. Welcome to the AS352 network!

Step 1: Set up mininet

To create a safe virtualized environment, we will use a tool called mininet, which uses linux containers (see https://en.wikipedia.org/wiki/Linux_namespaces) to allow you to create a small network of hosts and routers that can run inside your laptop. (If you’re interested in learning more about mininet, you can read about it from the paper entitled “A network in a laptop: Rapid prototyping for software-defifined networks,” found at http://conferences.sigcomm.org/hotnets/2010/papers/a19-lantz.pdf.)

First, download the standard mininet virtual machine (note, this is a 500+ MByte fifile).

https://github.com/mininet/mininet/releases/download/2.2.2/mininet-2.

2.2-170321-ubuntu-14.04.4-server-i386.zip

Set up the VM and play around according to the instructions at the link below. We recommend that you use VirtualBox. By the end of this step, you must be able to log into the VM and run basic terminal commands like ls.

http://mininet.org/vm-setup-notes/

Step 2: Play with the topology Python fifile

Within the virtual machine, run the attached network topology fifile, AS352.py, which invokes mininet’s Python API to create a network topology with 4 endpoints (hosts) and 1 router. Note the use of sudo while running the program. Note that this program will be unsuccessful on any machine without a viable mininet installation. In particular, you cannot run AS352.py on ilab.

mininet@mininet-vm:˜/project5$ sudo python AS352.py

*** Creating network

*** Adding controller

*** Adding hosts:

h1 h2 h3 h4 r1

*** Adding switches:

 

*** Adding links:

(h1, r1) (h2, r1) (h3, r1) (h4, r1)

*** Configuring hosts

h1 h2 h3 h4 r1

*** Starting controller

c0

*** Starting 0 switches

 

*** Routing Table on Router:

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

*** Starting CLI:

mininet>

Within the mininet shell, you can do various things to control the hosts and router we just instantiated. One highly convenient aspect of mininet is that the hosts, the router, and the VM all share the same fifilesystem, so the same fifiles are visible from all hosts and the router. Also, you can run commands, dump outputs into a fifile, and access it from any host or router or a regular terminal inside the VM. Let’s walk through a few examples of playing around with the mininet topology.

Step 2.1. Run the ls command on host h1.

mininet> h1 ls

AS352.py

mininet>

Note that the command is prefifixed by h1 to indicate to mininet that the command must be run on host h1. You can replace ls by any command which can run on h1, by just typing

h1 <command>

where <command> is any command that would run on a regular Linux terminal. You can run ls on any host or router by changing the prefifix of the command:

<host or router name> ls

Step 2.2. Inspect the network topology from within mininet:

mininet> net

h1 h1-eth0:r1-eth1

h2 h2-eth0:r1-eth2

h3 h3-eth0:r1-eth3

h4 h4-eth0:r1-eth4

r1 r1-eth1:h1-eth0 r1-eth2:h2-eth0 r1-eth3:h3-eth0 r1-eth4:h4-eth0c0

mininet>

Note that net is not prefifixed by any host or router name. It is a native mininet command.

Step 2.3. You can even run commands on the router! Mininet allows you to treat both endpoints and the router as standard Linux machines, on which you get to run “regular” Linux commands.

Let’s dump the routing table on r1.

mininet> r1 ip route

mininet>

By default, there is nothing in the routing table on r1. As you may have guessed, that is one of the things that you will add in this project.

Step 2.4. Mininet can also read a list of commands from a fifile. Suppose we added the text

h1 ls

net

r1 ip route

into the fifile commands.txt. Then, you can use the source mininet command to run all the commands in sequence, one after another. For example:

mininet> source commands.txt

AS352.py commands.txt

h1 h1-eth0:r1-eth1

h2 h2-eth0:r1-eth2

h3 h3-eth0:r1-eth3

h4 h4-eth0:r1-eth4

r1 r1-eth1:h1-eth0 r1-eth2:h2-eth0 r1-eth3:h3-eth0 r1-eth4:h4-eth0c0

mininet>

You can fifind more examples of mininet commands and usage at http://mininet.org/walkthrough/#interact-with-hosts-and-switches


程序辅导定制C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


blank

本网站支持 Alipay WeChatPay PayPal等支付方式

E-mail: vipdue@outlook.com  微信号:vipnxx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank