Skip to content

Commit c4e0af4

Browse files
committed
Merge branch 'master' of github.com:opennetworkinglab/ngsdn-tutorial
2 parents 02392f9 + b3e7728 commit c4e0af4

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

EXERCISE-1.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Exercise 1 - P4 and P4Runtime basics
22

33
This exercise provides a hands-on introduction to the P4 language and
4-
the P4Runtime API. Yu will be asked to:
4+
the P4Runtime API. You will be asked to:
55

66
1. Read and understand the implementation of a simple P4 program
77
2. Compile it for the BMv2 software switch and understand the output (the P4Info
@@ -10,45 +10,45 @@ the P4Runtime API. Yu will be asked to:
1010
4. Use the P4Runtime Shell to manually insert table entries in one of the
1111
switches to provide connectivity between hosts
1212

13-
## 1. Look at P4 program
13+
## 1. Look at the P4 program
1414

15-
To start, let's have a look a the P4 program in [p4src/main.p4](p4src/main.p4).
15+
To start, let's have a look a the P4 program: [p4src/main.p4](p4src/main.p4)
1616

1717
This program implements a simplified IPv6 router. Even if this is the first time
18-
you see P4 code, the program has been commented to provide an understanding of
18+
you have ever seen P4 code, the program has been commented to provide an understanding of
1919
the pipeline behavior to anyone with basic programming and networking
2020
background.
2121

22-
We suggest you start be giving a quick look to the whole program to understand
23-
its structure. When you're done, try answering the following questions, getting
24-
back at the P4 program to understand the different parts in more details.
22+
We suggest you start by taking a quick look at the whole program to understand
23+
its structure. When you're done, try answering the following questions, while
24+
referring to the P4 program to understand the different parts in more details.
2525

2626
**Parser**
2727

2828
* List all the protocol headers that can be extracted from a packet.
2929
* Which header is expected to be the first one when parsing a new packet?
30-
* In which case is the NDP header extracted?
30+
* Under what circumstances is the NDP header extracted?
3131

3232
**Ingress pipeline**
3333

3434
* How many match+action tables are defined in this pipeline?
3535
* For the L2 bridging case, which table is used to replicated NDP requests to
36-
all host-facing ports? Which type of match is used in that table?
36+
all host-facing ports? What type of match is used in that table?
3737
* In the ACL table, what's the difference between `send_to_cpu` and
3838
`clone_to_cpu` actions?
3939
* In the apply block, what is the first table applied to a packet? Are P4Runtime
4040
packet-out treated differently?
4141
* Look at the `routing_v6_table` and its only action. When a packet is matched
42-
by this table, where is the egress port set? Hint: look at the apply block,
42+
by this table, where is the egress port set? Hint: look at the apply block;
4343
which table comes after the routing one?
4444
* In which P4 action is the IPv6 Hop Limit/Time To Live (TTL) decremented?
4545

4646
**Egress pipeline**
4747

4848
* What is the main difference between the ingress and egress pipeline?
49-
* For a given packet that goes through the ingress pipeline, in which case the
49+
* For a given packet that goes through the ingress pipeline, when will the
5050
egress pipeline will see more than one packet?
51-
* For multicast packets, can they be replicated on the ingres port?
51+
* For multicast packets, can they be replicated to the ingress port?
5252

5353
**Deparser**
5454

@@ -203,12 +203,12 @@ Python CLI that can be used to connect to a P4Runtime server and can run
203203
P4Runtime commands. For example, it can be used to create, read, update, and
204204
delete flow table entries.
205205

206-
The shell can be started in two modes, with our without a P4 pipeline config. In
206+
The shell can be started in two modes, with or without a P4 pipeline config. In
207207
the first case, the shell will take care of pushing the given pipeline config to
208208
the switch using the P4Runtime `SetPipelineConfig` RPC. In the second case, the
209209
shell will try to retrieve the P4Info that is currently configured in the switch.
210210

211-
In both cases, the shell make use of the P4Info file to provide to:
211+
In both cases, the shell make use of the P4Info file to:
212212
* allow specifying runtime entities such as table entries using P4Info names
213213
rather then numeric IDs (much easier to remember and read);
214214
* provide autocompletion;
@@ -230,7 +230,7 @@ Docker container with the given arguments. For a list of arguments you can type
230230
`util/p4rt-sh --help`.
231231

232232
**Note:** we use `--grpc-addr localhost:50001` as the Mininet container is
233-
executes locally, and`50001` is the TCP port associated to the gRPC server
233+
executes locally, and `50001` is the TCP port associated to the gRPC server
234234
exposed by `leaf1`.
235235

236236
If the shell started successfully, you should see the following output:

EXERCISE-2.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Exercise 2 - Yang, OpenConfig, and gNMI basics
22

3-
This set of exercises is designed to give you more exposure to Yang, OpenConfig,
3+
This set of exercises is designed to give you more exposure to YANG, OpenConfig,
44
and gNMI.
55

66
## Part 1: Understanding the YANG language
@@ -305,7 +305,7 @@ notification {
305305

306306
The schema-less representation provides and `update` for each leaf containing the path to leaf and the value of the leaf. You can confirm that the interface is enabled (set to `true`).
307307

308-
Next, we will use can subscript to the ingress unicast packet counters for on `leaf1` coming from `h1a`:
308+
Next, we will use can subscribe to the ingress unicast packet counters for on `leaf1` coming from `h1a`:
309309

310310
```
311311
$ util/gnmi-cli --grpc-addr localhost:50001 \
@@ -340,7 +340,7 @@ subscribe {
340340
}
341341
}
342342
mode: SAMPLE
343-
sample_interval: 5000
343+
sample_interval: 1000
344344
}
345345
updates_only: true
346346
}
@@ -440,10 +440,10 @@ update {
440440
}
441441
```
442442

443-
In the shell running the Mininet CLI, let's take down the link:
443+
In the shell running the Mininet CLI, let's take down the interface on `leaf1` connected to `h1a`:
444444

445445
```
446-
mininet> link leaf1 h1a down
446+
mininet> sh ifconfig leaf1-eth3 down
447447
```
448448

449449
You should see a response in your gNMI CLI window showing that the interface on `leaf1` connected to `h1a` is `DOWN`:
@@ -477,9 +477,9 @@ update {
477477
}
478478
```
479479

480-
We can bring back the link using the following Mininet command:
480+
We can bring back the interface using the following Mininet command:
481481
```
482-
mininet> link leaf1 h1a up
482+
mininet> sh ifconfig leaf1-eth3 up
483483
```
484484

485485
You should see another response in your gNMI CLI window that indicates the interface is `UP`.

EXERCISE-3.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ when prompted:
132132
$ make onos-cli
133133
```
134134
135+
If you see the following error, then ONOS is still starting; wait a minute and try again.
136+
```
137+
ssh_exchange_identification: Connection closed by remote host
138+
make: *** [onos-cli] Error 255
139+
```
140+
141+
When you see the Password prompt, type the default password: `rocks`
142+
135143
Type the following command in the ONOS CLI to show the list of running apps:
136144
137145
```

0 commit comments

Comments
 (0)