Fix links in markdown files
This commit is contained in:
parent
6b546481a5
commit
30ecf6fc07
@ -2,8 +2,8 @@
|
|||||||
P4 language tutorials
|
P4 language tutorials
|
||||||
|
|
||||||
**Make sure that you edit [env.sh](env.sh) to point to your local copy of
|
**Make sure that you edit [env.sh](env.sh) to point to your local copy of
|
||||||
[bmv2] (https://github.com/p4lang/behavioral-model) and [p4c-bm]
|
[bmv2](https://github.com/p4lang/behavioral-model) and
|
||||||
(https://github.com/p4lang/p4c-bm). You may want to follow the instructions
|
[p4c-bm](https://github.com/p4lang/p4c-bm). You may want to follow the
|
||||||
[here]
|
instructions
|
||||||
(https://github.com/p4lang/tutorials/tree/master/SIGCOMM_2015#obtaining-required-software)
|
[here](https://github.com/p4lang/tutorials/tree/master/SIGCOMM_2015#obtaining-required-software)
|
||||||
to make sure that your environment is setup correctly.**
|
to make sure that your environment is setup correctly.**
|
||||||
|
@ -30,8 +30,8 @@ This repository include 2 exercises we presented at SIGCOMM: *Source Routing*
|
|||||||
and *Flowlet Switching*. Both exercises assume that you possess basic networking
|
and *Flowlet Switching*. Both exercises assume that you possess basic networking
|
||||||
knowledge and some familiarity with the P4 language. Please take a look at the
|
knowledge and some familiarity with the P4 language. Please take a look at the
|
||||||
[P4 language spec](http://p4.org/spec/) and at the example `simple_router`
|
[P4 language spec](http://p4.org/spec/) and at the example `simple_router`
|
||||||
target [on p4lang]
|
target [on
|
||||||
(https://github.com/p4lang/p4factory/tree/master/targets/simple_router/p4src).
|
p4lang](https://github.com/p4lang/p4factory/tree/master/targets/simple_router/p4src).
|
||||||
*Source Routing* asks you to write a P4 program from scratch to implement a
|
*Source Routing* asks you to write a P4 program from scratch to implement a
|
||||||
custom source routing protocol. *Flowlet Switching* is more difficult: you will
|
custom source routing protocol. *Flowlet Switching* is more difficult: you will
|
||||||
start from a simple P4 routing program (with ECMP) and implement a version of
|
start from a simple P4 routing program (with ECMP) and implement a version of
|
||||||
@ -95,9 +95,8 @@ P4. We will call this protocol EasyRoute. You will be designing the P4 program
|
|||||||
from scratch, although you are of course welcome to reuse code from other
|
from scratch, although you are of course welcome to reuse code from other
|
||||||
targets in p4lang. To test your implementation, you will create a Mininet
|
targets in p4lang. To test your implementation, you will create a Mininet
|
||||||
network and send messages between hosts. We provide a skeleton program:
|
network and send messages between hosts. We provide a skeleton program:
|
||||||
[source_routing/p4src/source_routing.p4]
|
[source_routing/p4src/source_routing.p4](source_routing/p4src/source_routing.p4),
|
||||||
(source_routing/p4src/source_routing.p4), you need to implement the parser and
|
you need to implement the parser and the ingress control flow.
|
||||||
the ingress control flow.
|
|
||||||
|
|
||||||
### Description of the EasyRoute protocol
|
### Description of the EasyRoute protocol
|
||||||
|
|
||||||
@ -187,8 +186,7 @@ is used to add an entry to a table
|
|||||||
You can look at example commands in the `flowlet_switching` directory:
|
You can look at example commands in the `flowlet_switching` directory:
|
||||||
[flowlet_switching/commands.txt](flowlet_switching/commands.txt) and match them
|
[flowlet_switching/commands.txt](flowlet_switching/commands.txt) and match them
|
||||||
with the corresponding P4 tables
|
with the corresponding P4 tables
|
||||||
[flowlet_switching/p4src/simple_router.p4]
|
[flowlet_switching/p4src/simple_router.p4](flowlet_switching/p4src/simple_router.p4).
|
||||||
(flowlet_switching/p4src/simple_router.p4).
|
|
||||||
|
|
||||||
### Testing your code
|
### Testing your code
|
||||||
|
|
||||||
@ -304,11 +302,11 @@ destination of our test packet.
|
|||||||
|
|
||||||
### What you need to do
|
### What you need to do
|
||||||
|
|
||||||
1. Update the provided [P4 program] (flowlet_switching/p4src/simple_router.p4)
|
1. Update the provided [P4 program](flowlet_switching/p4src/simple_router.p4) to
|
||||||
to perform TCP flowlet switching. In our case, it requires adding 2 tables to
|
perform TCP flowlet switching. In our case, it requires adding 2 tables to the
|
||||||
the ingress pipeline. Remember that you can omit the 'reads' attribute for a
|
ingress pipeline. Remember that you can omit the 'reads' attribute for a table.
|
||||||
table. In this case, providing you configure the default action of the table
|
In this case, providing you configure the default action of the table correctly,
|
||||||
correctly, the default action will always be performed.
|
the default action will always be performed.
|
||||||
|
|
||||||
2. Update [commands.txt](flowlet_switching/commands.txt) to configure your new
|
2. Update [commands.txt](flowlet_switching/commands.txt) to configure your new
|
||||||
tables.
|
tables.
|
||||||
|
@ -70,12 +70,12 @@ entries.
|
|||||||
We provide a small demo to let you test the program. It consists of the
|
We provide a small demo to let you test the program. It consists of the
|
||||||
following scripts:
|
following scripts:
|
||||||
- [run_demo.sh](run_demo.sh): compiles the P4 program, starts the switch,
|
- [run_demo.sh](run_demo.sh): compiles the P4 program, starts the switch,
|
||||||
configures the data plane by running the CLI [commands]
|
configures the data plane by running the CLI [commands](commands.txt), and
|
||||||
(commands.txt), and starts the mininet console.
|
starts the mininet console.
|
||||||
- [receive.py] (receive.py): listens for Axon formatted packets. This
|
- [receive.py](receive.py): listens for Axon formatted packets. This command is
|
||||||
command is intended to be run by a mininet host.
|
intended to be run by a mininet host.
|
||||||
- [send.py] (send.py): sends Axon formatted packets from one host to
|
- [send.py](send.py): sends Axon formatted packets from one host to another.
|
||||||
another. This command is intended to be run by a mininet host.
|
This command is intended to be run by a mininet host.
|
||||||
|
|
||||||
To run the demo:
|
To run the demo:
|
||||||
./run_demo.sh will compile your code and create the Mininet network described
|
./run_demo.sh will compile your code and create the Mininet network described
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
## Description
|
## Description
|
||||||
|
|
||||||
This program illustrates as simply as possible how to use meters in P4 with
|
This program illustrates as simply as possible how to use meters in P4 with
|
||||||
bmv2. bmv2 uses two-rate three-color meters as described [here]
|
bmv2. bmv2 uses two-rate three-color meters as described
|
||||||
(https://tools.ietf.org/html/rfc2698).
|
[here](https://tools.ietf.org/html/rfc2698).
|
||||||
|
|
||||||
For each incoming packet the `m_table` table is applied and the appropriate
|
For each incoming packet the `m_table` table is applied and the appropriate
|
||||||
meter (based on the packet's source MAC address) is executed. Based on the
|
meter (based on the packet's source MAC address) is executed. Based on the
|
||||||
@ -22,11 +22,10 @@ this example, you will see that we configure the table to drop all the packets
|
|||||||
for which the color is not *GREEN* (i.e. all packets for which `meta.meter_tag`
|
for which the color is not *GREEN* (i.e. all packets for which `meta.meter_tag`
|
||||||
is not `0`).
|
is not `0`).
|
||||||
|
|
||||||
The [commands.txt] (commands.txt) file also gives you the meter
|
The [commands.txt](commands.txt) file also gives you the meter configuration. In
|
||||||
configuration. In this case, the first rate is 0.5 packets per second, with a
|
this case, the first rate is 0.5 packets per second, with a burst size of 1, and
|
||||||
burst size of 1, and the second rate is 10 packets per second, with a burst size
|
the second rate is 10 packets per second, with a burst size of 1 also. Feel free
|
||||||
of 1 also. Feel free to play with the numbers, but these play nicely with the
|
to play with the numbers, but these play nicely with the demonstration below.
|
||||||
demonstration below.
|
|
||||||
|
|
||||||
Note that we use an `indirect` meter array, because `direct` ones are not
|
Note that we use an `indirect` meter array, because `direct` ones are not
|
||||||
supported yet by bmv2.
|
supported yet by bmv2.
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
## Description
|
## Description
|
||||||
|
|
||||||
This program implements a very basic full-cone NAT for TCP traffic (over
|
This program implements a very basic full-cone NAT for TCP traffic (over
|
||||||
IPv4). According to [Wikipedia]
|
IPv4). According to
|
||||||
(https://en.wikipedia.org/wiki/Network_address_translation#Methods_of_translation),
|
[Wikipedia](https://en.wikipedia.org/wiki/Network_address_translation#Methods_of_translation),
|
||||||
a full-cone NAT is defined as follows:
|
a full-cone NAT is defined as follows:
|
||||||
|
|
||||||
Once an internal address (iAddr:iPort) is mapped to an external address
|
Once an internal address (iAddr:iPort) is mapped to an external address
|
||||||
|
@ -33,9 +33,9 @@ packets.
|
|||||||
veth pairs required for the demo.*
|
veth pairs required for the demo.*
|
||||||
|
|
||||||
To compile and run the starter code, simply use `./run_demo.sh`. The
|
To compile and run the starter code, simply use `./run_demo.sh`. The
|
||||||
[run_demo.sh] (run_demo.sh) script will run the P4 compiler (for bmv2), start
|
[run_demo.sh](run_demo.sh) script will run the P4 compiler (for bmv2), start the
|
||||||
the switch and populate the tables using the CLI commands from [commands.txt]
|
switch and populate the tables using the CLI commands from
|
||||||
(commands.txt).
|
[commands.txt](commands.txt).
|
||||||
|
|
||||||
When the switch is running, you can send test packets with `sudo
|
When the switch is running, you can send test packets with `sudo
|
||||||
./run_test.py`. Note that this script will take a few seconds to complete. The
|
./run_test.py`. Note that this script will take a few seconds to complete. The
|
||||||
@ -46,16 +46,17 @@ working yet.
|
|||||||
|
|
||||||
## What you need to do
|
## What you need to do
|
||||||
|
|
||||||
1. In this exercise, you need to update the provided [P4 program]
|
1. In this exercise, you need to update the provided [P4
|
||||||
(p4src/simple_router.p4) to perform ECMP. When you are done, each incoming TCP
|
program](p4src/simple_router.p4) to perform ECMP. When you are done, each
|
||||||
test packet should be forwarded to either port 1 or port 2, based on the result
|
incoming TCP test packet should be forwarded to either port 1 or port 2, based
|
||||||
of a crc16 hash computation performed on the TCP 5-tuple (`ipv4.srcAddr`,
|
on the result of a crc16 hash computation performed on the TCP 5-tuple
|
||||||
`ipv4.dstAddr`, `ipv4.protocol`, `tcp.srcPort`, `tcp.dstPort`). You will need to
|
(`ipv4.srcAddr`, `ipv4.dstAddr`, `ipv4.protocol`, `tcp.srcPort`,
|
||||||
refer to the [P4 spec] (http://p4.org/wp-content/uploads/2015/04/p4-latest.pdf)
|
`tcp.dstPort`). You will need to refer to the [P4
|
||||||
to familiarize yourself with the P4 constructs you will need.
|
spec](http://p4.org/wp-content/uploads/2015/04/p4-latest.pdf) to familiarize
|
||||||
|
yourself with the P4 constructs you will need.
|
||||||
|
|
||||||
2. Once you are done with the P4 code, you will need to update [commands.txt]
|
2. Once you are done with the P4 code, you will need to update
|
||||||
(commands.txt) to configure your new tables.
|
[commands.txt](commands.txt) to configure your new tables.
|
||||||
|
|
||||||
3. After that you can run the above test again. Once again, you will observe
|
3. After that you can run the above test again. Once again, you will observe
|
||||||
that all packets go to the same egress port. Don't panic :)! This is because all
|
that all packets go to the same egress port. Don't panic :)! This is because all
|
||||||
@ -74,8 +75,8 @@ simple_router.p4>`.
|
|||||||
first one requires 2 tables and the use of the
|
first one requires 2 tables and the use of the
|
||||||
`modify_field_with_hash_based_offset` primitive. The second one uses a single
|
`modify_field_with_hash_based_offset` primitive. The second one uses a single
|
||||||
table with an action profile. You can read about
|
table with an action profile. You can read about
|
||||||
`modify_field_with_hash_based_offset` and action profiles in the [P4 spec]
|
`modify_field_with_hash_based_offset` and action profiles in the [P4
|
||||||
(http://p4.org/wp-content/uploads/2015/04/p4-latest.pdf).
|
spec](http://p4.org/wp-content/uploads/2015/04/p4-latest.pdf).
|
||||||
|
|
||||||
3. If you choose to use the first way (with 2 tables), your first table will
|
3. If you choose to use the first way (with 2 tables), your first table will
|
||||||
match on the destination IP address and be in charge of computing an index
|
match on the destination IP address and be in charge of computing an index
|
||||||
|
Loading…
x
Reference in New Issue
Block a user