Lab Environment

We use the Jupyter interactive computing environment to conduct labs in this course.

See also

The rest of the material on the lab notebooks is partially based on the Jupyter Notebook documentation where the general usage of notebooks is described.

New Notebook

A new notebook is launched using File \longrightarrow New \longrightarrow Notebook at the menu.

_images/filenewnotebook.png

Notebook Cells

The lab notebooks are composed of cells where code can be executed using Shift+Enter. For example, an assignment such as x = 2 can be executed on a cell and then, the value of x can be retrieved by executing x on the next cell:

_images/runincell.png

All actions in the notebook can be performed with keyboard shortcuts. Example shortcuts:

  • Run cell: Shift+Enter

    Execute the current cell and proceed to the next cell below. Creates a new empty cell below the current one if there is none. If there is an existing cell below, the cursor proceeds to that existing cell.

  • Run cell and create a new empty cell below: Alt+Enter

  • Command mode: Esc

    The cell becomes inactive with no cursor indicating that keyboard shortcuts can be used to change the mode of the cell such as:

    • create a new empty cell down below by pressing b

    • create a new empty cell above by pressing a

    • delete the current cell by pressing dd

    • copy the cell into clipboard by pressing c

    • paste the cell in the clipboard below the current one by pressing v

  • Edit mode: Enter

    The cell has a blinking cursor indicating that the text in the cell can be edited. Full list of keyboard shortcuts is listed by clicking on the keyboard icon in the toolbar.

Lab Notebook

Use File \longrightarrow New \longrightarrow Notebook to open a new notebook.

The labs are conducted using the University of Houston Education python libraries. Load these libraries by executing the following code in the first cell of your lab notebook:

%load_ext uhed

You can now proceed with loading of the lab modules for this class:

%lab

Select your lab topology from the dropdown menu and then load by clicking the Build Network button.

How-to Guide to Answering Questions

On the lab notebook, there are practice questions to solve on your own. This feature loads by executing %practice in a cell.

Once the question is loaded and you have completed your answer, you can click on the Grade button under the question to instantly receive feedback from the autograder.

Here is an example walk-through for the practice questions related to MAC learning in Ethernet bridges.

Suggested workflow for completing practice questions:

  1. For a given question, examine the panels. What information is provided about the network?

  2. Read the question text, and re-examine the panels. What state is the network in? Can you infer the general behavior from observations of the given data?

  3. Determine and take a note on what protocol behavior you would expect given the network data and the scenario referred to in the question.

Attention

Once you click on the Grade button, it will display a Correct or an Incorrect message in the text box below the Grade button. You can change your answer and click on the Grade button again to evaluate your answers.

Each question is composed of a data at the top, a question title and text in the middle, and then an answer section at the bottom of the display.

_images/answer-components.png

Components

  1. The data display section may include a network topology diagram. The diagram is composed of the network nodes that are connected with links that represent the layer 1 connections between the devices. The device names are displayed in each node. The links may have labels that indicate the port numbers of Ethernet bridge devices, interface names of end hosts and routers, and other information as applicable.

    The data display includes tables such as route tables, ARP tables, or the bridge port configuration tables in addition to sometimes a table of all interface information on the network topology.

  2. The question section has a question title (indicating the overall context of the question) and the question text. The text provides the references to the network data either by name of the network node or by a piece of information for an interface such as an interface address.

  3. The answer section of the display has a number of entry mechanisms. Below, we provide details on how to enter the solution to the question in each mechanism.

Answer Tabs

If there are multiple questions at the output of a call such as %exam or %homework (equivalently, NET.submit()), you can navigate between the questions by clicking on the tabs.

Interface List

There is a subnet entry box that you can enter text (e.g, 10.0.1.0/24) for the subnet entry along with a list of rows for interfaces.

Attention

Subnet entries are in the form A.B.C.D/N where N is the prefix length and A.B.C.D is the first IP address in the subnet range. For example, some valid subnet entries are below:

10.0.1.0/24
205.53.11.128/26

Please examine the answer fields on the display:

_images/answer-interface-list.png

The interface entry mechanism is a list of rows. Click the down arrow to see the list of entry options and choose the entry to add to the row. To add another row, click on the plus button. To delete or to move, please use the buttons to the right of each entry on a row.

_images/answer-add-interfaces.png

When submitting multiple tables of lists, please use the Add Subnet button to create a new tab. In each tab, complete selection of entries and include the subnet text.

_images/answer-multi-subnets.png

Example: L2 Table

Here is an example flow of entries made to complete the answer to a question that is asking for the layer 2 table of an Ethernet bridge.

_images/answer-example-L2table.png

Action Rows

  1. The answer entry mechanism for actions list is through rows of vertex, action, and if needed, a data item. The question text will provide the context for the actions that need to be listed in the rows:

_images/answer-pick-vertex.png
  1. Pick the vertex in the first column for a given row.

  2. Each vertex type has a different set of actions that will load into the list of available entries. Pick the action at this step:

_images/answer-pick-action.png
  1. If there is a data item to be entered for a specific (vertex, action) pair, the Data column will appear with entries listed in the dropdown.

_images/answer-pick-data.png
  1. Pick the data entry from the dropdown list.

  2. Finally, after completion of a row of entries for (vertex, action, data), if there are more actions in the answer to the question, please add more rows and repeat the process starting from step 1 above.

_images/answer-enterdata-addrows.png

Practice Questions

On the lab notebook, there are practice questions to solve on your own. Once the question is loaded and you have completed your answer, you can click on the Grade button under the question to instantly receive feedback from the autograder.

Here is an example walk-through for the practice questions related to MAC learning in Ethernet bridges.

Suggested workflow for completing exercises:

  1. For a given question, examine the panels. What information is provided about the network?

  2. Read the question text, and re-examine the panels. What state is the network in? Can you infer the general behavior from observations of the given data?

  3. Determine and take a note on what protocol behavior you would expect given the network data and the scenario referred to in the question.

  4. If an action sequence is required: Start working on selecting the vertex, action, and data information based on your answer.

  5. If a particular network device state is required: Start working on selecting the entries for the device-specific table.

Attention

Once you click on the Grade button, it will display a Correct or an Incorrect message in the text box below the Grade button. You can change your answer and click on the Grade button again to evaluate your answers.

Load the %practice

Load the practice by executing the %practice command in a cell in the notebook.

_images/practicequestions.png

The dropdown menu shows all of the subjects available for practicing in the lab notebook.

_images/loadpractquestion.png

The dropdown menu to the right of the subject has the corresponding questions in the subject MAC Learning.

Components of the display

Detailed descriptions of question data

The panels in the question show network topology diagram and the network data.

_images/maclearnq1panels.png

Inside each question, please examine the panels for the data provided to you. The question provides data about the network status: topology and the state of network and end devices. For example, this question is on determination of the bridge L2 table if all hosts have sent a packet already.

_images/qforw1.png

There are two questions on packet forwarding behavior of the bridge. The first one is called Forwarding Behavior (1).

_images/qforw2.png

The second one is called Forwarding Behavior (2).

_images/lab1exanswer.png

Answer mechanism

Determine L2 table entries for the bridge in this scenario:

_images/lab1exactions.png

The forwarding behavior actions trace the packet through the network vertices. The action entries are dynamically loaded along with the data expected for each action. For example, a host vertex sending a packet on its interface eth1 will need the packet’s destination MAC address specified when entering this action. If a bridge vertex in the network graph is forwarding the outgoing ports should be specified as part of the data part of this action.

_images/lab1exadddel.png

Please use the add- and delete-row buttons in the answer area to provide the required entry rows for each answer type.

Terminal Access

Use File \longrightarrow New \longrightarrow Terminal \longrightarrow to open a new terminal on the lab server. This CLI will be used to access the devices in the lab network topology by ssh into these devices:

$ gssh <username> <device-name>

For example, a <username> can be dgurkan and the <device-name> can be a host device named host1 in your lab network. In order to ssh into this device, type:

$ gssh dgurkan host1

on the terminal commmand line and press enter.

Lab Completion Tasks

Every lab should be completed by following the instructions below on how to delete the network topology resources and the running processes on the lab service.

Delete all reserved resources for the lab by executing the %delete command in a cell.

_images/delete.png

Type exit and then press Enter at the terminal and verify that the terminal application also closes.

_images/exitterminal.png

When you are done with your work on a lab notebook, there should be no running sessions as shown in this view.

_images/norunning.png

Notetaking in the Lab Notebook

You can take notes in the lab notebook cells by markdown formatting option in the cell. Turn the cell type to markdown by:

  1. While in the cell, stop cursor by pushing the ESC key

  2. Press m in your keyboard to convert cell into markdown

  3. Type in your text with light formatting. For example, bullet points can be added using the following:

    * bullet 1
    * bullet 2
    * ...
    

    Heading can be added by:

    # Heading level 1
    ## Heading level 2
    ### Heading level 3
    

The markdown cell will render the text in the format you have specified when you execute the cell by pressing Shift and Enter at the same time.

The cell style can be changed from its default code to markdown mode using the instructions below.

_images/takingNotesMarkdown.png
  1. Press ESC key to deactivate cursor

  2. Pick Markdown option from dropdown for the cell (or press m)

  3. Type simple text instructions and task descriptions. For example, * character provides bullet items

  4. Execute cell to render the formatted text