This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.02 Spring 2008 Lab 9: Channel Access Protocols April 2830, 2008 Goal: Using WSim, a simulator for a simple broadcast network written in Python, develop and experiment with channel access protocols. The pre-lab and lab teach the following important ideas: 1) sharing a broad- cast channel using slotted Aloha, carrier sense multiple access (CSMA), and time division multiple access (TDMA); 2) backoff strategies for contention schemes like slotted Aloha and CSMA. Instructions: 1. Complete the pre-lab activities in Section 4. 2. Complete the lab activities described in Section 5 in lab on Wednesday. 3. Prepare the requested material and think about the questions posed in the Checkoff Sheet, then find a staff member to complete your post-lab interview. 1 Python For the next three labs (including this one) well be using Python, an easy-to-learn interpreted programming language that has a nice selection of data types including support for object-oriented programming, inter- esting control structures, and a huge (and growing) set of libraries that make it simple to implement almost any processing task. If youd like to try out the 6.02 code on your own machine youll need to install: Python: http://www.python.org/download/ wxPython (ANSI version): http://www.wxpython.org/download.php There are pre-built binaries for Windows, Mac OS X and Linux. If youd like to learn or brush up on Python, start with the 6.01 Resources webpage, which has links to several quick tutorials: http://courses.csail.mit.edu/6.01/spring08/resource.html For a more comprehensive introduction, we recommend the Python Tutorial written by Pythons architect Guido von Rossum: http://docs.python.org/tut/tut.html 1 The following sections of the Python Tutorial are particularly useful for 6.02: Section 3: An Informal Introduction to Python Section 4.1: if Statements Section 4.2: for Statements Section 4.6: Defining Functions Section 5.1: More on Lists Section 5.5: Dictionaries Section 9.3: A First Look at Classes 2 Lab Setup You can either use the IDLE programming environment to modify and run the code, or you can use python directly. You can start IDLE by running setup 6.02 and then idle-602 at the Athena prompt. 1 Use File Open to open a source file for editing; hit the F5 key to execute the current editor buffer. Before you start, copy the relevant files over from the course locker to your 6.02 directory (assumed to be in your home directory): athena% setup 6.02 athena% cp -R /mit/6.02/Labs/Lab9 /6.02 lab9.py is the file you need to execute with python. 3 WSim: A Simple Broadcast Network Simulator This lab uses a simple packet-level network simulator for a broadcast network. You will be writing a small amount of code to develop various channel access protocols and measure how they perform under different conditions....
View Full Document