Skip to content

Commit 66bdb4d

Browse files
committed
Update activity structure
1 parent 4eed956 commit 66bdb4d

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

.devcontainer.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,14 @@
33
"image": "scc-registry.lancs.ac.uk/teaching/scc_333/ken:25.1.2",
44
"workspaceMount": "source=${localWorkspaceFolder}/,target=/workspace,type=bind,consistency=cached",
55
"workspaceFolder": "/workspace",
6-
"postCreateCommand": "sh -c /scripts/entrypoint.sh",
6+
"postCreateCommand": "bash -c /scripts/entrypoint.sh",
77
"privileged": true,
88
"containerEnv": {
9-
"DISPLAY": "${localEnv:DISPLAY}",
9+
"DISPLAY": "${localEnv:DISPLAY}"
1010
},
1111
"mounts": [
1212
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached"
1313
],
14-
"runArgs": [
15-
"-e",
16-
"DISPLAY=docker.for.mac.host.internal:0"
17-
// "-e",
18-
// "DISPLAY=docker.for.mac.host.internal:0",
19-
// "-e",
20-
// "XAUTHORITY=/tmp/.Xauthority",
21-
// "-v",
22-
// "${localEnv:HOME}/.Xauthority:/tmp/.Xauthority"
23-
],
2414
"customizations": {
2515
"vscode": {
2616
"extensions": [

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ In this lab activity, we will explore the different elements that make up a mode
66

77
## Lab Overview
88

9-
In this lab activity, we will explore the different elements that make up a modern computer network and guide you through building and configuring your very own network.
10-
119
Think about your home network: you’ve got a Wi-Fi modem or router that connects your laptop, phone, TV, and maybe even your fridge (because why not) to the Internet ([Figure 1](#home-topo)). This appears to be a very simple network scenario, but it implements several key functionalities essential in delivering connectivity in the highly distributed and complex global Internet.
1210

1311
![Typical Home Network Topology](.resources/home-topo.png "Typical Home Network Topology"){width="2in"}
@@ -47,7 +45,7 @@ During our labs we will use a combination of tools designed for recreating, visu
4745

4846
## Task 0: Opening the Dev Container
4947

50-
Working with network protocols on a host, requires a lot of configuration and tweak ing of the host operating system. We also need to run code as root, which is a major security threat and requires careful handling. To make your life easier, we use a technologies called containers, to package everything you need to run our lab activities in a pre-configured environment. You might have heard of Docker containers, which are lightweight, portable, and consistent virtual instances that can run applications and services.
48+
Working with network protocols on a host, requires a lot of configuration and tweaking of the host operating system. We also need to run code as root, which is a major security threat and requires careful handling. To make your life easier, we use a technology called containers, to package everything you need to run our lab activities in a pre-configured environment. You might have heard of Docker containers, which are lightweight, portable, and consistent virtual instances that can run applications and services.
5149

5250
In order to open the code in a devcontainer, you should select the options `Open In devcontainer` when opening the folder in VSCode. If you missed the option when openning the project, you can still setup the devcontainer. Use the key combination of Ctrl+Shift+P to open the command palette and then select **Dev Containers: Open Folder in Container...**. Both options are depicted in the screenshots below.
5351

@@ -300,6 +298,7 @@ Hosts in the same network are directly reachable in a region using either switch
300298
A router typically maintains a routing table that contains information about how to reach different networks. When a router receives a packet, it examines the destination IP address and consults its routing table to determine the best path for forwarding the packet. The router then forwards the packet to the next hop, which could be another router or the final destination host. Also, the router, similar to every network host, maintains an ARP table that maps IP addresses to MAC addresses for devices in each connected network. It is essential for the router to resolve MAC addresses for devices in each network to successfully forward packets at the data link layer. For this functionality, the router will use ARP requests to resolve MAC addresses for devices in each network. In our Mininet topology, we have opted to use an alternative approach by predefining the MAC addresses for each interface in the topology file and creating static entries in the ARP table. For this approach to work, we assume that the topology is fixed and we do not need to dynamically resolve MAC addresses using ARP requests.
301299

302300
IP addresses are 32-bit numbers that uniquely identify devices in a network. They are typically represented in dotted-decimal notation, which consists of four octets (8 bits each) separated by periods. Usually, IP addresses are split into two parts: the network and the host portion. The network identifies the network to which the IP address belongs, while the host portion identifies the specific device on that network. The length of the network portion is defined by the subnet mask, which is a 32-bit number that specifies how many left-most bits of the IP address belong to the network portion and which bits belong to the host portion. The length of the network portion can also be represented as an integer. The remaining bits are used for the host portion.
301+
303302
For example, the IP address 192.168.1.1/24 has a subnet 255.255.255.0 (i.e., the 24 left-most bits are set to 1 and the rest is zero) and its network portion is 192.168.1.0/24. It is in the same network as 192.168.1.2/24 and 192.168.1.3/24, but not in the same network as 192.168.2.1/24, which has a network portion of 192.168.2.0/24. Similarly, the subnet mask 10.0.0.0/24 has a 24 bit network prefix length and the network contains the IP addresses from 10.0.0.1-10.0.0.254 ($2^8-2$) (typically the first and last address of a network range cannot be used as addresses for individual hosts). Similarly, the subnet mask 10.1.0.0/16 defines the IP addresses from 10.1.0.1-10.1.255.154 ($2^{16} -2$) as belonging to the same network.
304303

305304
> **Your task**: One you complete your updated Mininet topology, run the modified topology using the `mn --custom` command above and answer the questions in the fifth part of the [Week1 Unassessed Quiz](https://modules.lancaster.ac.uk/mod/quiz/view.php?id=2824281).

solution/topology.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def build(self):
1919
tablet = self.addHost("tablet", ip="192.168.1.3/24")
2020
phone = self.addHost("phone", ip="192.168.1.4/24")
2121

22+
23+
2224
# Connect hosts to the switch
2325
self.addLink(homePC, s1)
2426
self.addLink(tablet, s1)

0 commit comments

Comments
 (0)