simulator_guide - EE122 Routing Simulator Guide v0.3...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
EE122 Routing Simulator Guide v0.3 (19/10/2011) Running the Simulator Here’s the info you need to get started with the simulator: File Layout The simulator is organized thusly: simulator.py - Starts up the simulator. sim/core.py - Inner workings of the simulator. Keep out. sim/api.py - Parts of the simulator that you'll need to use (such as the Entity class). See help(api). sim/basics.py - Basic simulator pieces built with the API. See help(basics). sim/topo.py - You can use this to create your own topologies/scenarios. See help(topo). scenarios/*.py - Test topologies and scenarios for you to use. See help(scenarios). Getting Started To start the simulator, run logviewer.py to view console logs, and simulator.py to interact with the simulated network: This pops up a new window, spouts some informational text, and gives you a Python interpreter in the terminal. In the new window, you’ll see DEBUG messages output by the hosts and switches in the simulated network. From the interpreter in the terminal, you can run arbitrary Python code, can inspect and manipulate the simulation, and can get help on many aspects of the simulator. As simulator.py comes, it simply creates a test scenario (mostly this just means a topology) and starts the simulator. You may wish to modify it to load a different scenario (including a custom one). In particular, you can modify the scenario on line 22, and the switches used in the network on line 15. By default, the simulator will load a ‘linear’ scenario (two hosts connected by a single hub) with a Hub switch that just forwards between the two. To change the scenario and switches imported by the simulator, find the lines that define “switch” and “scenario” and edit them, e.g, : from learning_switch import LearningSwitch as switch from rip-router import RipRouter as switch import scenarios.linear as scenario import scenarios.candy as scenario
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
You can see the source code for the Hub switch in hub.py, and the source code for the scenario in the scenarios/ directory.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

simulator_guide - EE122 Routing Simulator Guide v0.3...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online