Added advanced Heavy Hitter Detection example (#136)

* Added advanced Heavy Hitter Detection example

* Changed directory location

* Restored skeleton version

* Added files for common run infra with the other tutorials

* Updated readme

* Autogenerate setup rules

* Commends in simple_router.p4

* Fix typos

* Removed commended out lines
This commit is contained in:
Georgios Nikolaidis
2018-04-25 00:56:09 -07:00
committed by Antonin Bas
parent 494706bd60
commit e7e6899d5c
23 changed files with 2595 additions and 0 deletions

42
Teaching/utils/Makefile Normal file
View File

@@ -0,0 +1,42 @@
BUILD_DIR = build
PCAP_DIR = pcaps
LOG_DIR = logs
TOPO = topology.json
P4C = p4c-bm2-ss
RUN_SCRIPT = ../utils/run_exercise.py
source := $(wildcard *.p4)
outfile := $(source:.p4=.json)
compiled_json := $(BUILD_DIR)/$(outfile)
# Define NO_P4 to start BMv2 without a program
ifndef NO_P4
run_args += -j $(compiled_json)
endif
# Set BMV2_SWITCH_EXE to override the BMv2 target
ifdef BMV2_SWITCH_EXE
run_args += -b $(BMV2_SWITCH_EXE)
endif
all: run
run: build
sudo python $(RUN_SCRIPT) -t $(TOPO) $(run_args)
stop:
sudo mn -c
build: dirs $(compiled_json)
$(BUILD_DIR)/%.json: %.p4
$(P4C) --p4v 16 $(P4C_ARGS) -o $@ $<
dirs:
mkdir -p $(BUILD_DIR) $(PCAP_DIR) $(LOG_DIR)
clean: stop
rm -f *.pcap
rm -rf $(BUILD_DIR) $(PCAP_DIR) $(LOG_DIR)