diff --git a/exercises/basic/Makefile b/exercises/basic/Makefile index da31be2f..fa1b0bc8 100644 --- a/exercises/basic/Makefile +++ b/exercises/basic/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 BMV2_SWITCH_EXE = simple_switch_grpc -TOPO = pod-topo/topology.json +# TOPO = triangle-topo/topology.json include ../../utils/Makefile diff --git a/exercises/basic/analysis/fct_cdf.png b/exercises/basic/analysis/fct_cdf.png new file mode 100644 index 00000000..81256c78 Binary files /dev/null and b/exercises/basic/analysis/fct_cdf.png differ diff --git a/exercises/basic/analysis/flow_completion.statistics b/exercises/basic/analysis/flow_completion.statistics new file mode 100644 index 00000000..659c49b3 --- /dev/null +++ b/exercises/basic/analysis/flow_completion.statistics @@ -0,0 +1,89 @@ +all_99.9th_fct_ms=14578.498400000004 +all_99.9th_fct_ns=14578498400.000004 +all_99th_fct_ms=13664.98400000001 +all_99th_fct_ns=13664984000.00001 +all_flows_completed_fraction=1.0 +all_mean_fct_ms=2532.5430555555554 +all_mean_fct_ns=2532543055.5555553 +all_median_fct_ms=692.7 +all_median_fct_ns=692700000.0 +all_num_finished_flows=72 +all_num_flows=72 +all_num_unfinished_flows=0 +general_flow_size_bytes_mean=1573375.0 +general_flow_size_bytes_std=3608652.9321029196 +general_num_flows=72 +general_num_unique_sources=72 +general_num_unique_targets=72 +geq_100KB_99.9th_fct_ms=14619.956800000007 +geq_100KB_99.9th_fct_ns=14619956800.000008 +geq_100KB_99th_fct_ms=14079.567999999997 +geq_100KB_99th_fct_ns=14079567999.999998 +geq_100KB_flows_completed_fraction=1.0 +geq_100KB_mean_fct_ms=4162.816279069768 +geq_100KB_mean_fct_ns=4162816279.0697675 +geq_100KB_median_fct_ms=2875.9 +geq_100KB_median_fct_ns=2875900000.0 +geq_100KB_num_finished_flows=43 +geq_100KB_num_flows=43 +geq_100KB_num_unfinished_flows=0 +geq_10MB_99.9th_fct_ms=14678.5704 +geq_10MB_99.9th_fct_ns=14678570400.0 +geq_10MB_99th_fct_ms=14665.704 +geq_10MB_99th_fct_ns=14665704000.0 +geq_10MB_flows_completed_fraction=1.0 +geq_10MB_mean_fct_ms=13965.2 +geq_10MB_mean_fct_ns=13965200000.0 +geq_10MB_median_fct_ms=13965.2 +geq_10MB_median_fct_ns=13965200000.0 +geq_10MB_num_finished_flows=2 +geq_10MB_num_flows=2 +geq_10MB_num_unfinished_flows=0 +geq_1MB_99.9th_fct_ms=14651.408000000005 +geq_1MB_99.9th_fct_ns=14651408000.000006 +geq_1MB_99th_fct_ms=14394.080000000002 +geq_1MB_99th_fct_ns=14394080000.000002 +geq_1MB_flows_completed_fraction=1.0 +geq_1MB_mean_fct_ms=7226.92380952381 +geq_1MB_mean_fct_ns=7226923809.523809 +geq_1MB_median_fct_ms=6346.5 +geq_1MB_median_fct_ns=6346500000.0 +geq_1MB_num_finished_flows=21 +geq_1MB_num_flows=21 +geq_1MB_num_unfinished_flows=0 +geq_2.4349MB_99.9th_fct_ms=14661.415200000001 +geq_2.4349MB_99.9th_fct_ns=14661415200.000002 +geq_2.4349MB_99th_fct_ms=14494.151999999998 +geq_2.4349MB_99th_fct_ns=14494151999.999998 +geq_2.4349MB_flows_completed_fraction=1.0 +geq_2.4349MB_mean_fct_ms=9018.371428571429 +geq_2.4349MB_mean_fct_ns=9018371428.571428 +geq_2.4349MB_median_fct_ms=9785.05 +geq_2.4349MB_median_fct_ns=9785050000.0 +geq_2.4349MB_num_finished_flows=14 +geq_2.4349MB_num_flows=14 +geq_2.4349MB_num_unfinished_flows=0 +less_100KB_99.9th_fct_ms=460.2460000000001 +less_100KB_99.9th_fct_ns=460246000.0000001 +less_100KB_99th_fct_ms=439.95999999999987 +less_100KB_99th_fct_ns=439959999.9999999 +less_100KB_flows_completed_fraction=1.0 +less_100KB_mean_fct_ms=115.24137931034483 +less_100KB_mean_fct_ns=115241379.31034483 +less_100KB_median_fct_ms=14.8 +less_100KB_median_fct_ns=14800000.0 +less_100KB_num_finished_flows=29 +less_100KB_num_flows=29 +less_100KB_num_unfinished_flows=0 +less_2.4349MB_99.9th_fct_ms=4257.393900000002 +less_2.4349MB_99.9th_fct_ns=4257393900.000002 +less_2.4349MB_99th_fct_ms=4063.839 +less_2.4349MB_99th_fct_ns=4063839000.0 +less_2.4349MB_flows_completed_fraction=1.0 +less_2.4349MB_mean_fct_ms=966.998275862069 +less_2.4349MB_mean_fct_ns=966998275.862069 +less_2.4349MB_median_fct_ms=422.25 +less_2.4349MB_median_fct_ns=422250000.0 +less_2.4349MB_num_finished_flows=58 +less_2.4349MB_num_flows=58 +less_2.4349MB_num_unfinished_flows=0 diff --git a/exercises/basic/analysis/flow_completion_ct.statistics b/exercises/basic/analysis/flow_completion_ct.statistics new file mode 100644 index 00000000..63953db3 --- /dev/null +++ b/exercises/basic/analysis/flow_completion_ct.statistics @@ -0,0 +1,89 @@ +all_99.9th_fct_ms=14276.2466 +all_99.9th_fct_ns=14276246600.0 +all_99th_fct_ms=14036.366000000002 +all_99th_fct_ns=14036366000.000002 +all_flows_completed_fraction=1.0 +all_mean_fct_ms=2498.5416666666665 +all_mean_fct_ns=2498541666.6666665 +all_median_fct_ms=625.15 +all_median_fct_ns=625150000.0 +all_num_finished_flows=72 +all_num_flows=72 +all_num_unfinished_flows=0 +general_flow_size_bytes_mean=1573375.0 +general_flow_size_bytes_std=3608652.9321029196 +general_num_flows=72 +general_num_unique_sources=72 +general_num_unique_targets=72 +geq_100KB_99.9th_fct_ms=14287.133200000002 +geq_100KB_99.9th_fct_ns=14287133200.000002 +geq_100KB_99th_fct_ms=14145.232 +geq_100KB_99th_fct_ns=14145232000.0 +geq_100KB_flows_completed_fraction=1.0 +geq_100KB_mean_fct_ms=4109.076744186046 +geq_100KB_mean_fct_ns=4109076744.1860466 +geq_100KB_median_fct_ms=2603.9 +geq_100KB_median_fct_ns=2603900000.0 +geq_100KB_num_finished_flows=43 +geq_100KB_num_flows=43 +geq_100KB_num_unfinished_flows=0 +geq_10MB_99.9th_fct_ms=14302.5246 +geq_10MB_99.9th_fct_ns=14302524600.0 +geq_10MB_99th_fct_ms=14299.146 +geq_10MB_99th_fct_ns=14299146000.0 +geq_10MB_flows_completed_fraction=1.0 +geq_10MB_mean_fct_ms=14115.2 +geq_10MB_mean_fct_ns=14115200000.0 +geq_10MB_median_fct_ms=14115.2 +geq_10MB_median_fct_ns=14115200000.0 +geq_10MB_num_finished_flows=2 +geq_10MB_num_flows=2 +geq_10MB_num_unfinished_flows=0 +geq_1MB_99.9th_fct_ms=14295.392000000002 +geq_1MB_99.9th_fct_ns=14295392000.000002 +geq_1MB_99th_fct_ms=14227.82 +geq_1MB_99th_fct_ns=14227820000.0 +geq_1MB_flows_completed_fraction=1.0 +geq_1MB_mean_fct_ms=7281.7 +geq_1MB_mean_fct_ns=7281700000.0 +geq_1MB_median_fct_ms=6908.6 +geq_1MB_median_fct_ns=6908600000.0 +geq_1MB_num_finished_flows=21 +geq_1MB_num_flows=21 +geq_1MB_num_unfinished_flows=0 +geq_2.4349MB_99.9th_fct_ms=14298.0198 +geq_2.4349MB_99.9th_fct_ns=14298019800.0 +geq_2.4349MB_99th_fct_ms=14254.098 +geq_2.4349MB_99th_fct_ns=14254098000.0 +geq_2.4349MB_flows_completed_fraction=1.0 +geq_2.4349MB_mean_fct_ms=9170.507142857143 +geq_2.4349MB_mean_fct_ns=9170507142.857143 +geq_2.4349MB_median_fct_ms=9693.1 +geq_2.4349MB_median_fct_ns=9693100000.0 +geq_2.4349MB_num_finished_flows=14 +geq_2.4349MB_num_flows=14 +geq_2.4349MB_num_unfinished_flows=0 +less_100KB_99.9th_fct_ms=349.8824000000001 +less_100KB_99.9th_fct_ns=349882400.00000006 +less_100KB_99th_fct_ms=342.52399999999994 +less_100KB_99th_fct_ns=342523999.99999994 +less_100KB_flows_completed_fraction=1.0 +less_100KB_mean_fct_ms=110.50689655172414 +less_100KB_mean_fct_ns=110506896.55172414 +less_100KB_median_fct_ms=28.8 +less_100KB_median_fct_ns=28800000.0 +less_100KB_num_finished_flows=29 +less_100KB_num_flows=29 +less_100KB_num_unfinished_flows=0 +less_2.4349MB_99.9th_fct_ms=4804.555900000004 +less_2.4349MB_99.9th_fct_ns=4804555900.000004 +less_2.4349MB_99th_fct_ms=4388.359 +less_2.4349MB_99th_fct_ns=4388359000.0 +less_2.4349MB_flows_completed_fraction=1.0 +less_2.4349MB_mean_fct_ms=888.0672413793104 +less_2.4349MB_mean_fct_ns=888067241.3793104 +less_2.4349MB_median_fct_ms=355.9 +less_2.4349MB_median_fct_ns=355900000.0 +less_2.4349MB_num_finished_flows=58 +less_2.4349MB_num_flows=58 +less_2.4349MB_num_unfinished_flows=0 diff --git a/exercises/basic/analysis/throughput.statistics b/exercises/basic/analysis/throughput.statistics new file mode 100644 index 00000000..b573cf0b --- /dev/null +++ b/exercises/basic/analysis/throughput.statistics @@ -0,0 +1,60 @@ +all_num_flows=72 +all_throughput_0.1th_Mbps=1.53414 +all_throughput_1th_Mbps=1.7514 +all_throughput_99.9th_Mbps=36.16870000000002 +all_throughput_99th_Mbps=29.587000000000064 +all_throughput_mean_Mbps=8.248888888888887 +all_throughput_median_Mbps=6.0600000000000005 +all_throughput_std_Mbps=6.908011965897834 +general_flow_size_bytes_mean=1574295.608888889 +general_num_flows=72 +general_num_unique_sources=72 +general_num_unique_targets=72 +general_throughput_mbps_mean=8.248888888888887 +geq_100KB_num_flows=43 +geq_100KB_throughput_0.1th_Mbps=2.15588 +geq_100KB_throughput_1th_Mbps=2.2088 +geq_100KB_throughput_99.9th_Mbps=26.553800000000006 +geq_100KB_throughput_99th_Mbps=26.137999999999998 +geq_100KB_throughput_mean_Mbps=7.761860465116279 +geq_100KB_throughput_median_Mbps=5.83 +geq_100KB_throughput_std_Mbps=5.875536692285266 +geq_10MB_num_flows=2 +geq_10MB_throughput_1th_Mbps=25.511 +geq_10MB_throughput_99.9th_Mbps=26.5989 +geq_10MB_throughput_99th_Mbps=26.589000000000002 +geq_10MB_throughput_mean_Mbps=26.05 +geq_10MB_throughput_median_Mbps=26.05 +geq_10MB_throughput_std_Mbps=0.5500000000000007 +geq_1MB_num_flows=21 +geq_1MB_throughput_0.1th_Mbps=4.469 +geq_1MB_throughput_1th_Mbps=4.55 +geq_1MB_throughput_99.9th_Mbps=26.578000000000007 +geq_1MB_throughput_99th_Mbps=26.380000000000003 +geq_1MB_throughput_mean_Mbps=11.404285714285717 +geq_1MB_throughput_median_Mbps=8.86 +geq_1MB_throughput_std_Mbps=6.559180096430877 +geq_2.4349MB_num_flows=14 +geq_2.4349MB_throughput_0.1th_Mbps=4.48249 +geq_2.4349MB_throughput_1th_Mbps=4.6849 +geq_2.4349MB_throughput_99.9th_Mbps=26.585700000000003 +geq_2.4349MB_throughput_99th_Mbps=26.457 +geq_2.4349MB_throughput_mean_Mbps=13.345714285714289 +geq_2.4349MB_throughput_median_Mbps=12.25 +geq_2.4349MB_throughput_std_Mbps=7.180166844744442 +less_100KB_num_flows=29 +less_100KB_throughput_0.1th_Mbps=1.51952 +less_100KB_throughput_1th_Mbps=1.6052 +less_100KB_throughput_99.9th_Mbps=36.564000000000014 +less_100KB_throughput_99th_Mbps=33.539999999999985 +less_100KB_throughput_mean_Mbps=8.971034482758622 +less_100KB_throughput_median_Mbps=6.3 +less_100KB_throughput_std_Mbps=8.149718567100884 +less_2.4349MB_num_flows=58 +less_2.4349MB_throughput_0.1th_Mbps=1.52938 +less_2.4349MB_throughput_1th_Mbps=1.7038 +less_2.4349MB_throughput_99.9th_Mbps=36.21600000000006 +less_2.4349MB_throughput_99th_Mbps=30.059999999999995 +less_2.4349MB_throughput_mean_Mbps=7.018620689655173 +less_2.4349MB_throughput_median_Mbps=5.205 +less_2.4349MB_throughput_std_Mbps=6.245888150388073 diff --git a/exercises/basic/analysis/throughput_boxplot.png b/exercises/basic/analysis/throughput_boxplot.png new file mode 100644 index 00000000..366528d6 Binary files /dev/null and b/exercises/basic/analysis/throughput_boxplot.png differ diff --git a/exercises/basic/analysis/throughput_cdf.png b/exercises/basic/analysis/throughput_cdf.png new file mode 100644 index 00000000..1c1c893b Binary files /dev/null and b/exercises/basic/analysis/throughput_cdf.png differ diff --git a/exercises/basic/analysis/throughput_vs_flowsize.png b/exercises/basic/analysis/throughput_vs_flowsize.png new file mode 100644 index 00000000..6b3fdeb4 Binary files /dev/null and b/exercises/basic/analysis/throughput_vs_flowsize.png differ diff --git a/exercises/basic/analyze_fct.py b/exercises/basic/analyze_fct.py new file mode 100644 index 00000000..834a03db --- /dev/null +++ b/exercises/basic/analyze_fct.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python3 +import numpy as np +import csv +import sys +import os +import pandas as pd +import matplotlib.pyplot as plt + +################################## +# Setup +# + +print("Flow Completion Time Analysis Tool v0.01") + +# Create analysis folder if it doesn't exist +analysis_folder_path = 'analysis' +if not os.path.exists(analysis_folder_path): + os.makedirs(analysis_folder_path) + +################################## +# Analyze flow completion +# +def analyze_flow_completion(csv_file_path): + print(f"Analyzing flow completion times from: {csv_file_path}") + + # Read the CSV file using pandas + df = pd.read_csv(csv_file_path) + + # Extract relevant columns + flow_ids = df['flow_id'].values + source_ids = df['sender'].values + target_ids = df['receiver'].values + flow_sizes = df['flow_size'].values + durations = df['duration'].values # These are already in seconds + progress = df['progress'].values + + # Determine completion status (considering flows with ≥99.9% progress as completed) + completed = progress >= 99.9 + + print("Calculating statistics...") + + statistics = { + 'general_num_flows': len(flow_ids), + 'general_num_unique_sources': len(set(source_ids)), + 'general_num_unique_targets': len(set(target_ids)), + 'general_flow_size_bytes_mean': np.mean(flow_sizes), + 'general_flow_size_bytes_std': np.std(flow_sizes) + } + + # Define flow size ranges + range_low = [-1, -1, -1, 100000, 2434900, 1000000, 10000000] + range_high = [-1, 100000, 2434900, -1, -1, -1, -1] + range_name = ["all", "less_100KB", "less_2.4349MB", "geq_100KB", "geq_2.4349MB", "geq_1MB", "geq_10MB"] + range_completed_duration = [[], [], [], [], [], [], []] + range_num_finished_flows = [0, 0, 0, 0, 0, 0, 0] + range_num_unfinished_flows = [0, 0, 0, 0, 0, 0, 0] + range_low_eq = [0, 0, 0, 1, 1, 1, 1] + range_high_eq = [0, 0, 0, 1, 1, 1, 1] + + # Go over all flows + for i in range(0, len(flow_ids)): + # Range-specific + for j in range(0, len(range_name)): + if ( + (range_low[j] == -1 or (range_low_eq[j] == 0 and flow_sizes[i] > range_low[j]) or (range_low_eq[j] == 1 and flow_sizes[i] >= range_low[j])) and + (range_high[j] == -1 or (range_high_eq[j] == 0 and flow_sizes[i] < range_high[j]) or (range_high_eq[j] == 1 and flow_sizes[i] <= range_high[j])) + ): + if completed[i]: + range_num_finished_flows[j] += 1 + range_completed_duration[j].append(durations[i] * 1000000000) # Convert seconds to nanoseconds + else: + range_num_unfinished_flows[j] += 1 + + # Ranges statistics + for j in range(0, len(range_name)): + # Number of finished flows + statistics[range_name[j] + '_num_flows'] = range_num_finished_flows[j] + range_num_unfinished_flows[j] + print(range_name[j] + '_num_flows', range_num_finished_flows[j] + range_num_unfinished_flows[j]) + + statistics[range_name[j] + '_num_finished_flows'] = range_num_finished_flows[j] + print(range_name[j] + '_num_finished_flows', range_num_finished_flows[j]) + + statistics[range_name[j] + '_num_unfinished_flows'] = range_num_unfinished_flows[j] + print(range_name[j] + '_num_unfinished_flows', range_num_unfinished_flows[j]) + + total = (range_num_finished_flows[j] + range_num_unfinished_flows[j]) + if range_num_finished_flows[j] != 0: + statistics[range_name[j] + '_flows_completed_fraction'] = float(range_num_finished_flows[j]) / float(total) + + # Duration is stored in nanoseconds in the statistics + statistics[range_name[j] + '_mean_fct_ns'] = np.mean(range_completed_duration[j]) + print(range_name[j] + '_mean_fct_ns', np.mean(range_completed_duration[j])) + + statistics[range_name[j] + '_median_fct_ns'] = np.median(range_completed_duration[j]) + statistics[range_name[j] + '_99th_fct_ns'] = np.percentile(range_completed_duration[j], 99) + statistics[range_name[j] + '_99.9th_fct_ns'] = np.percentile(range_completed_duration[j], 99.9) + + # Convert to milliseconds for display purposes + statistics[range_name[j] + '_mean_fct_ms'] = statistics[range_name[j] + '_mean_fct_ns'] / 1000000 + statistics[range_name[j] + '_median_fct_ms'] = statistics[range_name[j] + '_median_fct_ns'] / 1000000 + statistics[range_name[j] + '_99th_fct_ms'] = statistics[range_name[j] + '_99th_fct_ns'] / 1000000 + statistics[range_name[j] + '_99.9th_fct_ms'] = statistics[range_name[j] + '_99.9th_fct_ns'] / 1000000 + else: + statistics[range_name[j] + '_flows_completed_fraction'] = 0 + + # Add the original duration values for comparing with other analysis + print("\nOriginal duration values (seconds) for comparison:") + print(f"All flows - Mean duration: {np.mean(durations):.4f} seconds") + print(f"Small flows (<100KB) - Mean duration: {np.mean(durations[flow_sizes <= 100000]):.4f} seconds") + print(f"Medium flows (>100KB, <2.4MB) - Mean duration: {np.mean(durations[(flow_sizes > 100000) & (flow_sizes < 2434900)]):.4f} seconds") + print(f"Large flows (>1MB) - Mean duration: {np.mean(durations[flow_sizes > 1000000]):.4f} seconds") + + # Create CDF plot for flow completion times + plt.figure(figsize=(10, 6)) + for j in range(len(range_name)): + if range_num_finished_flows[j] > 0: + sorted_fct = np.sort(range_completed_duration[j]) / 1000000 # Convert ns to ms for readability + cdf = np.arange(1, len(sorted_fct)+1) / len(sorted_fct) + plt.plot(sorted_fct, cdf, label=range_name[j]) + + plt.xlabel('Flow Completion Time (ms)') + plt.ylabel('CDF') + plt.title('CDF of Flow Completion Times by Flow Size Category') + plt.grid(True, linestyle='--', linewidth=0.5) + plt.legend() + plt.savefig(f'{analysis_folder_path}/fct_cdf.png') + + # Print raw results + print('Writing to result file flow_completion.statistics...') + with open(analysis_folder_path + '/flow_completion.statistics', 'w+') as outfile: + for key, value in sorted(statistics.items()): + outfile.write(str(key) + "=" + str(value) + "\n") + + # Print summary statistics for comparison + print("\nSummary of Flow Completion Times:") + print("Flow Size Category | Mean (sec) | Median (sec) | 99th (sec)") + print("------------------------|-------------|--------------|------------") + for j in range(len(range_name)): + if range_num_finished_flows[j] > 0: + mean_sec = statistics[range_name[j] + '_mean_fct_ns'] / 1e9 + median_sec = statistics[range_name[j] + '_median_fct_ns'] / 1e9 + p99_sec = statistics[range_name[j] + '_99th_fct_ns'] / 1e9 + print(f"{range_name[j].ljust(24)} | {mean_sec:11.4f} | {median_sec:12.4f} | {p99_sec:10.4f}") + +if __name__ == "__main__": + # Path to the CSV file + csv_file_path = "flow_analysis.csv" + + # Analyze flow completion + analyze_flow_completion(csv_file_path) \ No newline at end of file diff --git a/exercises/basic/analyze_flow_completion_time.py b/exercises/basic/analyze_flow_completion_time.py new file mode 100644 index 00000000..42ab3a3b --- /dev/null +++ b/exercises/basic/analyze_flow_completion_time.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python3 +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt +from collections import defaultdict + +def analyze_flow_completion_time(csv_file): + """ + Analyze flow completion times from the CSV file with flow data. + + Args: + csv_file (str): Path to the CSV file containing flow analysis data + + Returns: + None (displays statistics and plots) + """ + # Read the CSV file + df = pd.read_csv(csv_file) + + # Display basic statistics + print(f"Total number of flows: {len(df)}") + print(f"Average FCT: {df['duration'].mean():.4f} seconds") + print(f"Median FCT: {df['duration'].median():.4f} seconds") + print(f"Min FCT: {df['duration'].min():.4f} seconds") + print(f"Max FCT: {df['duration'].max():.4f} seconds") + + # Group flows by size categories + small_flows = df[df['flow_size'] <= 100000] # <= 100KB + medium_flows = df[(df['flow_size'] > 100000) & (df['flow_size'] <= 1000000)] # 100KB-1MB + large_flows = df[df['flow_size'] > 1000000] # > 1MB + + print("\nFlow Completion Time by Flow Size Category:") + print(f"Small flows (<= 100KB): {len(small_flows)} flows, Avg FCT: {small_flows['duration'].mean():.4f} seconds") + print(f"Medium flows (100KB-1MB): {len(medium_flows)} flows, Avg FCT: {medium_flows['duration'].mean():.4f} seconds") + print(f"Large flows (> 1MB): {len(large_flows)} flows, Avg FCT: {large_flows['duration'].mean():.4f} seconds") + + # Calculate throughput (flow_size / duration) in Mbps + df['throughput_mbps'] = (df['flow_size'] * 8 / 1000000) / df['duration'] + print(f"\nAverage throughput: {df['throughput_mbps'].mean():.2f} Mbps") + + # Create size categories for plotting + size_categories = [] + for size in df['flow_size']: + if size <= 100000: + size_categories.append('Small (<= 100KB)') + elif size <= 1000000: + size_categories.append('Medium (100KB-1MB)') + else: + size_categories.append('Large (> 1MB)') + + df['size_category'] = size_categories + + # Calculate statistics by category + category_stats = df.groupby('size_category')['duration'].agg(['mean', 'median', 'min', 'max']) + print("\nFlow Completion Time Statistics by Category:") + print(category_stats) + + # Plot FCT by flow size (scatter plot) + plt.figure(figsize=(10, 6)) + plt.scatter(df['flow_size']/1000, df['duration'], alpha=0.7) + plt.xscale('log') + plt.xlabel('Flow Size (KB)') + plt.ylabel('Flow Completion Time (seconds)') + plt.title('Flow Completion Time vs Flow Size') + plt.grid(True, which='both', linestyle='--', linewidth=0.5) + plt.tight_layout() + plt.savefig('fct_vs_size.png') + + # Plot FCT CDF + plt.figure(figsize=(10, 6)) + for category, group in df.groupby('size_category'): + sorted_fct = np.sort(group['duration']) + cdf = np.arange(1, len(sorted_fct)+1) / len(sorted_fct) + plt.plot(sorted_fct, cdf, label=category) + + plt.xlabel('Flow Completion Time (seconds)') + plt.ylabel('CDF') + plt.title('CDF of Flow Completion Time by Flow Size Category') + plt.grid(True, linestyle='--', linewidth=0.5) + plt.legend() + plt.tight_layout() + plt.savefig('fct_cdf.png') + + # Plot throughput by flow size + plt.figure(figsize=(10, 6)) + plt.scatter(df['flow_size']/1000, df['throughput_mbps'], alpha=0.7) + plt.xscale('log') + plt.xlabel('Flow Size (KB)') + plt.ylabel('Throughput (Mbps)') + plt.title('Throughput vs Flow Size') + plt.grid(True, which='both', linestyle='--', linewidth=0.5) + plt.tight_layout() + plt.savefig('throughput_vs_size.png') + + # Calculate FCT slowdown (actual FCT / ideal FCT) + # Assuming link capacity is 10 Mbps (can adjust based on your setup) + link_capacity_mbps = 10 + df['ideal_fct'] = (df['flow_size'] * 8) / (link_capacity_mbps * 1000000) + df['slowdown'] = df['duration'] / df['ideal_fct'] + + print(f"\nAverage FCT slowdown: {df['slowdown'].mean():.2f}x") + print(f"Median FCT slowdown: {df['slowdown'].median():.2f}x") + + # Plot slowdown CDF + plt.figure(figsize=(10, 6)) + for category, group in df.groupby('size_category'): + sorted_slowdown = np.sort(group['slowdown']) + cdf = np.arange(1, len(sorted_slowdown)+1) / len(sorted_slowdown) + plt.plot(sorted_slowdown, cdf, label=category) + + plt.xscale('log') + plt.xlabel('FCT Slowdown') + plt.ylabel('CDF') + plt.title('CDF of FCT Slowdown by Flow Size Category') + plt.grid(True, linestyle='--', linewidth=0.5) + plt.legend() + plt.tight_layout() + plt.savefig('slowdown_cdf.png') + + print("\nPlots saved as: fct_vs_size.png, fct_cdf.png, throughput_vs_size.png, slowdown_cdf.png") + +if __name__ == "__main__": + # Path to the CSV file + csv_file = "flow_analysis.csv" + + # Analyze flow completion times + analyze_flow_completion_time(csv_file) \ No newline at end of file diff --git a/exercises/basic/analyze_flow_stats.py b/exercises/basic/analyze_flow_stats.py new file mode 100755 index 00000000..7ad9ee6d --- /dev/null +++ b/exercises/basic/analyze_flow_stats.py @@ -0,0 +1,414 @@ +#!/usr/bin/env python3 +import os +import re +import csv +import glob +import json +import datetime +from collections import defaultdict + +def parse_iperf_output(file_path, is_sender=True): + """ + Parse iperf output files to extract flow information. + Returns a dictionary with flow details. + """ + flow_data = {} + + # Determine if this is a sender or receiver file + flow_role = "sender" if is_sender else "receiver" + + # Extract host information from filename + filename = os.path.basename(file_path) + host_match = re.search(r'(sender|receiver)_([a-zA-Z0-9]+)\.(?:txt|json)', filename) + if host_match: + flow_data['host'] = host_match.group(2) + else: + flow_data['host'] = "unknown" + + flow_data['role'] = flow_role + + # Default values + flow_data['start_time'] = None + flow_data['end_time'] = None + flow_data['duration'] = None + flow_data['transferred'] = None + flow_data['bandwidth'] = None + flow_data['peer_address'] = None + flow_data['peer_port'] = None + flow_data['local_address'] = None + flow_data['local_port'] = None + + try: + with open(file_path, 'r') as f: + content = f.read() + + # Extract connection info using a more flexible regex + if is_sender: + # For sender files + server_match = re.search(r'Client connecting to ([0-9.]+), TCP port (\d+)', content) + if server_match: + flow_data['peer_address'] = server_match.group(1) + flow_data['peer_port'] = server_match.group(2) + + # Also try to extract local connection info + local_match = re.search(r'local ([0-9.]+) port (\d+) connected with ([0-9.]+) port (\d+)', content) + if local_match: + flow_data['local_address'] = local_match.group(1) + flow_data['local_port'] = local_match.group(2) + # Double-check peer address + if not flow_data['peer_address']: + flow_data['peer_address'] = local_match.group(3) + if not flow_data['peer_port']: + flow_data['peer_port'] = local_match.group(4) + else: + # For receiver files + conn_match = re.search(r'local ([0-9.]+) port (\d+) connected with ([0-9.]+) port (\d+)', content) + if conn_match: + flow_data['local_address'] = conn_match.group(1) + flow_data['local_port'] = conn_match.group(2) + flow_data['peer_address'] = conn_match.group(3) + flow_data['peer_port'] = conn_match.group(4) + else: + # Try alternative receiver format + server_match = re.search(r'Server listening on .* port (\d+)', content) + client_match = re.search(r'Client connecting from ([0-9.]+), port (\d+)', content) + if server_match: + flow_data['local_port'] = server_match.group(1) + if client_match: + flow_data['peer_address'] = client_match.group(1) + flow_data['peer_port'] = client_match.group(2) + + # Extract transfer and bandwidth from the last line with data + lines = content.strip().split('\n') + for line in reversed(lines): + # Skip empty lines + if not line.strip(): + continue + + # Look for lines with transfer data + # Format example: [ 1] 0.0000-1.1695 sec 3.18 MBytes 22.8 Mbits/sec + if 'sec' in line and ('bits/sec' in line or 'Bytes' in line): + parts = line.split() + + # Try to extract interval + interval_match = re.search(r'(\d+\.\d+)-(\d+\.\d+) sec', line) + if interval_match: + start_sec = float(interval_match.group(1)) + end_sec = float(interval_match.group(2)) + flow_data['duration'] = end_sec - start_sec + + # Extract transfer - look for value followed by [KMG]Bytes + transfer_idx = -1 + for i, part in enumerate(parts): + if 'Bytes' in part and i > 0: + transfer_idx = i - 1 + break + + if transfer_idx >= 0: + amount = float(parts[transfer_idx]) + unit = 'M' if 'MBytes' in parts[transfer_idx + 1] else \ + 'K' if 'KBytes' in parts[transfer_idx + 1] else \ + 'G' if 'GBytes' in parts[transfer_idx + 1] else '' + + # Convert to bytes + if unit == 'K': + amount *= 1024 + elif unit == 'M': + amount *= 1024*1024 + elif unit == 'G': + amount *= 1024*1024*1024 + + flow_data['transferred'] = amount + + # Extract bandwidth - look for value followed by [KMG]bits/sec + bw_idx = -1 + for i, part in enumerate(parts): + if 'bits/sec' in part and i > 0: + bw_idx = i - 1 + break + + if bw_idx >= 0: + bw = float(parts[bw_idx]) + unit = 'M' if 'Mbits/sec' in parts[bw_idx + 1] else \ + 'K' if 'Kbits/sec' in parts[bw_idx + 1] else \ + 'G' if 'Gbits/sec' in parts[bw_idx + 1] else '' + + # Convert to bits/sec + if unit == 'K': + bw *= 1000 + elif unit == 'M': + bw *= 1000*1000 + elif unit == 'G': + bw *= 1000*1000*1000 + + flow_data['bandwidth'] = bw + + break # Found what we need + + except Exception as e: + print(f"Error parsing {file_path}: {e}") + + return flow_data + +def load_flow_mapping_info(file_path): + """ + Load flow mapping information from the JSON file. + Returns a dictionary with flow_id as key and flow details as value. + """ + flow_map = {} + try: + with open(file_path, 'r') as f: + flow_data = json.load(f) + + # Check if the data is in array format (new format) + if isinstance(flow_data, list): + for flow in flow_data: + flow_id = flow.get('flow_id') + if flow_id: + flow_map[flow_id] = { + 'source': flow.get('source'), + 'destination': flow.get('destination'), + 'flow_size': flow.get('flow_size'), + 'source_ip': flow.get('source_ip', ''), + 'destination_ip': flow.get('destination_ip', '') + } + # Check if it's in object format with keys like "h1->h3" (old format) + elif isinstance(flow_data, dict): + for key, flow_info in flow_data.items(): + # Extract flow_id from the value + flow_id = flow_info.get('flow_id') + if flow_id: + # Try to parse source and destination from key (e.g., "h1->h3") + parts = key.split('->') + source = parts[0] if len(parts) > 0 else '' + destination = parts[1] if len(parts) > 1 else '' + + flow_map[flow_id] = { + 'source': source, + 'destination': destination, + 'flow_size': flow_info.get('flow_size_bytes', 0), + 'source_ip': '', + 'destination_ip': '' + } + + print(f"Loaded {len(flow_map)} flows from {file_path}") + except Exception as e: + print(f"Error loading flow mapping data from {file_path}: {e}") + + return flow_map + +def match_sender_receiver_files(sender_files, receiver_files, flow_mapping): + """ + Match sender and receiver files based on flow mapping information. + Returns a list of matched flows with their file paths. + """ + matched_flows = [] + + # Create dictionaries to quickly look up files by host name + sender_dict = {} + for file_path in sender_files: + host_name = extract_host_from_filename(file_path) + if host_name: + sender_dict[host_name] = file_path + + receiver_dict = {} + for file_path in receiver_files: + host_name = extract_host_from_filename(file_path) + if host_name: + receiver_dict[host_name] = file_path + + # Match files based on flow mapping + for flow_id, flow_info in flow_mapping.items(): + source = flow_info.get('source') + destination = flow_info.get('destination') + + if source in sender_dict and destination in receiver_dict: + matched_flows.append({ + 'flow_id': flow_id, + 'source': source, + 'destination': destination, + 'flow_size': flow_info.get('flow_size', 0), + 'sender_file': sender_dict[source], + 'receiver_file': receiver_dict[destination], + 'source_ip': flow_info.get('source_ip', ''), + 'destination_ip': flow_info.get('destination_ip', '') + }) + + return matched_flows + +def extract_host_from_filename(file_path): + """ + Extract host name from file path like 'sender_h1.txt' or 'receiver_h3.txt'. + """ + filename = os.path.basename(file_path) + match = re.search(r'(sender|receiver)_([a-zA-Z0-9]+)\.(?:txt|json)', filename) + if match: + return match.group(2) + return None + +def analyze_flow(matched_flow): + """ + Analyze a matched flow by parsing sender and receiver files. + Returns a dictionary with analysis results. + """ + result = { + 'flow_id': matched_flow['flow_id'], + 'sender': matched_flow['source'], + 'receiver': matched_flow['destination'], + 'flow_size': matched_flow['flow_size'], + 'source_ip': matched_flow['source_ip'], + 'destination_ip': matched_flow['destination_ip'], + 'total_sent': 0, + 'total_received': 0, + 'duration': 0, # FCT in seconds + 'progress': 0, # Percentage of flow completed + } + + # Parse sender file + sender_data = parse_iperf_output(matched_flow['sender_file'], is_sender=True) + if sender_data and 'transferred' in sender_data: + result['total_sent'] = sender_data['transferred'] + # We'll use sender duration only as a fallback + + # Parse receiver file + receiver_data = parse_iperf_output(matched_flow['receiver_file'], is_sender=False) + if receiver_data and 'transferred' in receiver_data: + result['total_received'] = receiver_data['transferred'] + # Prioritize the receiver's duration as the flow completion time + if 'duration' in receiver_data and receiver_data['duration']: + result['duration'] = receiver_data['duration'] + # Only fall back to sender's duration if receiver's is not available + elif not result['duration'] and sender_data and 'duration' in sender_data: + result['duration'] = sender_data['duration'] + print(f"Warning: Using sender duration for flow {matched_flow['flow_id']} as receiver duration not available") + + # Calculate progress (percentage of flow completed) + if result['flow_size'] > 0 and result['total_sent'] > 0: + result['progress'] = (result['total_sent'] / result['flow_size']) * 100 + + return result + +def write_csv(flow_results, output_file): + """ + Write flow analysis results to a CSV file. + """ + fieldnames = [ + 'flow_id', 'sender', 'receiver', 'flow_size', + 'total_sent', 'total_received', 'duration', 'progress', + 'source_ip', 'destination_ip' # Added these fields + ] + + try: + with open(output_file, 'w', newline='') as csvfile: + writer = csv.DictWriter(csvfile, fieldnames=fieldnames) + writer.writeheader() + + for flow in flow_results: + writer.writerow(flow) + + print(f"CSV file created successfully: {output_file}") + except Exception as e: + print(f"Error writing CSV file: {e}") + # Try writing to current directory as fallback + try: + alt_output = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'flow_analysis.csv') + with open(alt_output, 'w', newline='') as csvfile: + writer = csv.DictWriter(csvfile, fieldnames=fieldnames) + writer.writeheader() + + for flow in flow_results: + writer.writerow(flow) + print(f"CSV file created at alternative location: {alt_output}") + except Exception as alt_e: + print(f"Failed to write to alternative location: {alt_e}") + +def find_iperf_files(output_dir): + """ + Find iperf output files in the specified directory. + If .txt files are not found, will try .json files. + """ + sender_files = glob.glob(os.path.join(output_dir, 'sender_*.txt')) + receiver_files = glob.glob(os.path.join(output_dir, 'receiver_*.txt')) + + # If no .txt files found, try .json files + if not sender_files: + json_sender_files = glob.glob(os.path.join(output_dir, 'sender_*.json')) + if json_sender_files: + print("Found .json sender files instead of .txt files") + sender_files = json_sender_files + + if not receiver_files: + json_receiver_files = glob.glob(os.path.join(output_dir, 'receiver_*.json')) + if json_receiver_files: + print("Found .json receiver files instead of .txt files") + receiver_files = json_receiver_files + + return sender_files, receiver_files + +def main(): + # Define the directory where iperf output files are stored + base_dir = os.path.dirname(os.path.abspath(__file__)) + output_dir = os.path.join(base_dir, 'outputs') + + # Check if outputs directory exists + if not os.path.exists(output_dir): + print(f"Warning: Outputs directory {output_dir} does not exist.") + # Try looking in current directory + alt_output_dir = os.path.join(base_dir) + print(f"Looking for iperf files in {alt_output_dir}") + sender_files, receiver_files = find_iperf_files(alt_output_dir) + else: + # Find all iperf output files + sender_files, receiver_files = find_iperf_files(output_dir) + + print(f"Found {len(sender_files)} sender files and {len(receiver_files)} receiver files") + + if not sender_files or not receiver_files: + print("Warning: No iperf files found. Please check file paths.") + return + + # Print found files for debugging + print("Sender files:") + for f in sender_files: + print(f" {f}") + print("Receiver files:") + for f in receiver_files: + print(f" {f}") + + # Load flow mapping information + flow_mapping_path = os.path.join(base_dir, 'flow_mapping_info.json') + flow_mapping = load_flow_mapping_info(flow_mapping_path) + + if not flow_mapping: + print("Error: Could not load flow mapping information.") + return + + # Match sender and receiver files based on flow mapping + matched_flows = match_sender_receiver_files(sender_files, receiver_files, flow_mapping) + + if not matched_flows: + print("Warning: No flows could be matched. Check flow mapping and file names.") + return + + print(f"Successfully matched {len(matched_flows)} flows.") + + # Analyze each matched flow + flow_results = [] + for matched_flow in matched_flows: + result = analyze_flow(matched_flow) + flow_results.append(result) + + # Print summary for this flow + print(f"\nFlow {result['flow_id']}: {result['sender']} → {result['receiver']}") + print(f" Flow Size: {result['flow_size']} bytes") + print(f" Sent: {result['total_sent']} bytes") + print(f" Received: {result['total_received']} bytes") + print(f" Duration (FCT): {result['duration']:.4f} seconds") + print(f" Progress: {result['progress']:.2f}%") + + # Write results to CSV + csv_path = os.path.join(output_dir, 'flow_analysis.csv') + write_csv(flow_results, csv_path) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/exercises/basic/analyze_iperf_json_results.py b/exercises/basic/analyze_iperf_json_results.py new file mode 100755 index 00000000..c322cef4 --- /dev/null +++ b/exercises/basic/analyze_iperf_json_results.py @@ -0,0 +1,214 @@ +#!/usr/bin/env python3 +import os +import json +import argparse +import pandas as pd +import matplotlib.pyplot as plt +from pathlib import Path + +def analyze_iperf_logs(log_files, output_image): + """ + Parses multiple iperf3 server JSON logs, calculates relative start/end times, + and plots throughput vs. relative time for each flow. + """ + all_data = [] + flow_info = {} + min_start_time_abs = float('inf') + + print(f"Processing log files: {log_files}") + + # First pass: Read start times and find the minimum + for log_file in log_files: + try: + with open(log_file, 'r') as f: + content = f.read() + log_data = json.loads(content) + start_time_abs = log_data.get('start', {}).get('timestamp', {}).get('timesecs') + if start_time_abs is not None: + min_start_time_abs = min(min_start_time_abs, start_time_abs) + flow_info[log_file] = {'start_time_abs': start_time_abs} + else: + print(f"Warning: Could not find absolute start time in {log_file}") + flow_info[log_file] = {'start_time_abs': None} # Mark as unknown + except FileNotFoundError: + print(f"Error: Log file not found at {log_file}") + flow_info[log_file] = {'start_time_abs': None} # Mark as not found + except json.JSONDecodeError: + print(f"Error: Could not decode JSON from {log_file}") + flow_info[log_file] = {'start_time_abs': None} + except Exception as e: + print(f"Error reading or processing {log_file} for start time: {e}") + flow_info[log_file] = {'start_time_abs': None} + + if min_start_time_abs == float('inf'): + print("Error: Could not determine a valid start time from any log file. Using 0 as reference.") + min_start_time_abs = 0 # Fallback if no start times found + + print(f"Earliest absolute start time found: {min_start_time_abs}") + + # Second pass: Extract interval data and calculate relative times + for log_file in log_files: + if flow_info[log_file]['start_time_abs'] is None and min_start_time_abs == 0: + print(f"Skipping {log_file} due to previous errors and no reference time.") + continue # Skip files that had errors if we couldn't find any valid start time + + try: + with open(log_file, 'r') as f: + content = f.read() + log_data = json.loads(content) + + intervals = log_data.get('intervals', []) + if not intervals: + print(f"Warning: No intervals found in {log_file}") + continue + + # Use filename stem as default label + flow_label = Path(log_file).stem.replace('_server', '') # e.g., h7 + flow_start_rel = float('inf') + flow_end_rel = float('-inf') + + for interval in intervals: + sum_data = interval.get('sum') + if sum_data: + # Absolute end time of the interval + end_time_abs = sum_data.get('end') + bits_per_second = sum_data.get('bits_per_second') + + if end_time_abs is not None and bits_per_second is not None: + # Calculate relative time based on the earliest start time + time_rel = float(end_time_abs) # Use interval end time + if flow_info[log_file]['start_time_abs'] is not None: + # If we have an absolute start for *this* file, use it for relative calc + # Relative time = (absolute_interval_end_time - absolute_global_min_start_time) + # absolute_interval_end_time = absolute_file_start_time + interval_end_time_relative_to_file_start + time_rel = flow_info[log_file]['start_time_abs'] + float(end_time_abs) - min_start_time_abs + elif min_start_time_abs != 0: + # If no absolute start for this file, but we have a global min, estimate + # This assumes the interval 'end' times are relative to the file's own start + # This might be inaccurate if iperf JSON format changes + print(f"Warning: Estimating relative time for {log_file} using global min start.") + # Estimate absolute interval end time by adding interval end to global min start + # Then subtract global min start to get relative time + # This simplifies to just the interval end time, assuming it starts near global min + time_rel = float(end_time_abs) # Simplified: interval end relative to global min + else: + # Fallback: use interval end time directly if no absolute times found + time_rel = float(end_time_abs) + + + throughput_mbps = float(bits_per_second) / 1_000_000 # Convert to Mbps + + all_data.append({ + 'time_rel': time_rel, + 'throughput_mbps': throughput_mbps, + 'flow': flow_label + }) + # Estimate interval start time relative to global min + interval_start_rel = time_rel - sum_data.get('seconds', 1) + flow_start_rel = min(flow_start_rel, interval_start_rel) + flow_end_rel = max(flow_end_rel, time_rel) + + if flow_start_rel != float('inf'): + flow_info[log_file]['start_rel'] = flow_start_rel + flow_info[log_file]['end_rel'] = flow_end_rel + flow_info[log_file]['label'] = flow_label + else: + print(f"Warning: No valid intervals processed for {log_file}") + + + except FileNotFoundError: + # Already handled in first pass, but prevents crash + pass + except json.JSONDecodeError: + # Already handled in first pass + pass + except Exception as e: + print(f"Error processing intervals in {log_file}: {e}") + + + if not all_data: + print("No valid interval data found across all log files.") + return + + df = pd.DataFrame(all_data) + df['flow'] = df['flow'].astype('category') + + # --- Print Flow Start/End Times --- + print("\n--- Flow Start and End Times (Relative to Earliest Start) ---") + sorted_flows = sorted(flow_info.items(), key=lambda item: item[1].get('start_rel', float('inf'))) + for log_file, info in sorted_flows: + if 'start_rel' in info: + print(f"Flow {info['label']} ({Path(log_file).name}):") # Use Path().name for cleaner output + print(f" Relative Start Time: {info['start_rel']:.6f} seconds") + print(f" Relative End Time: {info['end_rel']:.6f} seconds") + else: + print(f"Flow ({Path(log_file).name}): Could not determine start/end times.") + print("------------------------------------------------------------\n") + + + # --- Plotting --- + plt.figure(figsize=(12, 6)) + + flow_labels_plotted = sorted(df['flow'].unique()) + print(f"Plotting data for flows: {flow_labels_plotted}") + + for flow_label in flow_labels_plotted: + flow_data = df[df['flow'] == flow_label].sort_values('time_rel') + if not flow_data.empty: + # Use step plot for better visualization of throughput over intervals + plt.step(flow_data['time_rel'], flow_data['throughput_mbps'], where='post', label=f'Flow {flow_label}') + else: + print(f"No data points found for flow: {flow_label}") + + + plt.xlabel("Time (seconds relative to earliest start)") + plt.ylabel("Throughput (Mbps)") + plt.title("Throughput vs. Time for Each Flow (Server-Side)") + if len(flow_labels_plotted) > 0: + plt.legend(title="Flow", bbox_to_anchor=(1.05, 1), loc='upper left') + plt.grid(True) + plt.ylim(bottom=0) # Ensure y-axis starts at 0 + plt.xlim(left=0, right=25) # Ensure x-axis starts at 0 + plt.tight_layout(rect=[0, 0, 0.85, 1]) # Adjust layout for legend + # plt.show() + # Save the plot using the provided absolute path + try: + # plt.show() # Show the plot interactively + plt.savefig(output_image) + print(f"Plot saved to {output_image}") + except Exception as e: + print(f"Error saving plot: {e}") + +def main(): + parser = argparse.ArgumentParser(description='Analyze multiple iperf3 server JSON logs and plot throughput vs. relative time.') + # Keep output_image argument, but it has a default absolute path + parser.add_argument('--output_image', type=str, default='/home/nwlab/p4/throughput_vs_time_combined.png', + help='Path to save the combined output plot image.') + + args = parser.parse_args() + + # Define the fixed list of log files to analyze + fixed_log_files = [ + '/home/nwlab/p4/tutorials/exercises/basic/outputs/h5_server.json', + '/home/nwlab/p4/tutorials/exercises/basic/outputs/h6_server.json', + '/home/nwlab/p4/tutorials/exercises/basic/outputs/h7_server.json', + '/home/nwlab/p4/tutorials/exercises/basic/outputs/h8_server.json' + ] + + # Check if files exist before passing them + existing_log_files = [f for f in fixed_log_files if os.path.exists(f)] + missing_files = [f for f in fixed_log_files if not os.path.exists(f)] + + if missing_files: + print(f"Warning: The following log files were not found and will be skipped:") + for f in missing_files: + print(f" - {f}") + + if not existing_log_files: + print("Error: None of the expected log files were found. Exiting.") + return + + analyze_iperf_logs(existing_log_files, args.output_image) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/exercises/basic/analyze_throughput.py b/exercises/basic/analyze_throughput.py new file mode 100755 index 00000000..0a97b23f --- /dev/null +++ b/exercises/basic/analyze_throughput.py @@ -0,0 +1,163 @@ +#!/usr/bin/env python3 + +import numpy as np +import csv +import sys +import os +import pandas as pd +import matplotlib.pyplot as plt + +################################## +# Setup +# + +print("Throughput Analysis Tool v0.01") + +# Create analysis folder if it doesn't exist +analysis_folder_path = 'analysis' +if not os.path.exists(analysis_folder_path): + os.makedirs(analysis_folder_path) + +################################## +# Analyze throughput +# +def analyze_throughput(csv_file_path): + print(f"Analyzing throughput from: {csv_file_path}") + + # Read the CSV file using pandas + df = pd.read_csv(csv_file_path) + + print("Calculating statistics...") + + # Basic statistics + statistics = { + 'general_num_flows': len(df), + 'general_num_unique_sources': len(df['source_id'].unique()), + 'general_num_unique_targets': len(df['dest_id'].unique()), + 'general_throughput_mbps_mean': np.mean(df['throughput_mbps']), + 'general_flow_size_bytes_mean': np.mean(df['flow_size_bytes']) + } + + # Define flow size ranges + range_low = [-1, -1, -1, 100000, 2434900, 1000000, 10000000] + range_high = [-1, 100000, 2434900, -1, -1, -1, -1] + range_name = ["all", "less_100KB", "less_2.4349MB", "geq_100KB", "geq_2.4349MB", "geq_1MB", "geq_10MB"] + range_throughput = [[], [], [], [], [], [], []] + range_num_flows = [0, 0, 0, 0, 0, 0, 0] + range_low_eq = [0, 0, 0, 1, 1, 1, 1] + range_high_eq = [0, 0, 0, 1, 1, 1, 1] + + # Group flows by size range and calculate throughput statistics + for _, row in df.iterrows(): + flow_size = row['flow_size_bytes'] + throughput = row['throughput_mbps'] + + # Skip rows with missing or invalid data + if pd.isna(flow_size) or pd.isna(throughput) or flow_size <= 0 or throughput <= 0: + continue + + # Categorize by flow size range + for j in range(len(range_name)): + if ((range_low[j] == -1 or + (range_low_eq[j] == 0 and flow_size > range_low[j]) or + (range_low_eq[j] == 1 and flow_size >= range_low[j])) and + (range_high[j] == -1 or + (range_high_eq[j] == 0 and flow_size < range_high[j]) or + (range_high_eq[j] == 1 and flow_size <= range_high[j]))): + + range_throughput[j].append(throughput) + range_num_flows[j] += 1 + + # Calculate statistics for each flow size range + for j in range(len(range_name)): + if range_num_flows[j] > 0: + statistics[f'{range_name[j]}_num_flows'] = range_num_flows[j] + statistics[f'{range_name[j]}_throughput_mean_Mbps'] = np.mean(range_throughput[j]) + statistics[f'{range_name[j]}_throughput_median_Mbps'] = np.median(range_throughput[j]) + statistics[f'{range_name[j]}_throughput_std_Mbps'] = np.std(range_throughput[j]) + statistics[f'{range_name[j]}_throughput_99th_Mbps'] = np.percentile(range_throughput[j], 99) + statistics[f'{range_name[j]}_throughput_99.9th_Mbps'] = np.percentile(range_throughput[j], 99.9) + statistics[f'{range_name[j]}_throughput_1th_Mbps'] = np.percentile(range_throughput[j], 1) + if len(range_throughput[j]) > 10: # Only calculate if enough data points + try: + statistics[f'{range_name[j]}_throughput_0.1th_Mbps'] = np.percentile(range_throughput[j], 0.1) + except: + statistics[f'{range_name[j]}_throughput_0.1th_Mbps'] = statistics[f'{range_name[j]}_throughput_1th_Mbps'] + + # Create a scatter plot of throughput vs flow size + plt.figure(figsize=(10, 6)) + plt.scatter(df['flow_size_bytes'], df['throughput_mbps'], alpha=0.6) + plt.xscale('log') + plt.xlabel('Flow Size (bytes)') + plt.ylabel('Throughput (Mbps)') + plt.title('Throughput vs Flow Size') + plt.grid(True, which="both", ls="--", linewidth=0.5) + plt.tight_layout() + plt.savefig(f'{analysis_folder_path}/throughput_vs_flowsize.png') + + # Create a CDF plot of throughput for each flow size category + plt.figure(figsize=(10, 6)) + for j in range(len(range_name)): + if range_num_flows[j] > 0: + sorted_throughput = np.sort(range_throughput[j]) + cdf = np.arange(1, len(sorted_throughput) + 1) / len(sorted_throughput) + plt.plot(sorted_throughput, cdf, label=range_name[j]) + + plt.xlabel('Throughput (Mbps)') + plt.ylabel('CDF') + plt.title('CDF of Throughput by Flow Size Category') + plt.grid(True, linestyle='--', linewidth=0.5) + plt.legend() + plt.tight_layout() + plt.savefig(f'{analysis_folder_path}/throughput_cdf.png') + + # Create a box plot of throughput for each flow size category + plt.figure(figsize=(12, 6)) + + # Prepare data for boxplot + box_data = [] + box_labels = [] + + for j in range(len(range_name)): + if range_num_flows[j] > 0 and range_name[j] != "all": + box_data.append(range_throughput[j]) + box_labels.append(range_name[j]) + + plt.boxplot(box_data, labels=box_labels, showfliers=False) + plt.ylabel('Throughput (Mbps)') + plt.title('Throughput Distribution by Flow Size Category') + plt.grid(True, linestyle='--', alpha=0.7) + plt.xticks(rotation=45) + plt.tight_layout() + plt.savefig(f'{analysis_folder_path}/throughput_boxplot.png') + + # Write statistics to file + print('Writing to result file throughput.statistics...') + with open(f'{analysis_folder_path}/throughput.statistics', 'w+') as outfile: + for key, value in sorted(statistics.items()): + outfile.write(str(key) + "=" + str(value) + "\n") + + # Print summary statistics + print("\nSummary of Throughput Statistics by Flow Size Category:") + print("Flow Size Category | Mean (Mbps) | Median (Mbps) | 99th %ile (Mbps)") + print("------------------------|--------------|---------------|------------------") + for j in range(len(range_name)): + if range_num_flows[j] > 0: + mean_mbps = statistics.get(f"{range_name[j]}_throughput_mean_Mbps", 0) + median_mbps = statistics.get(f"{range_name[j]}_throughput_median_Mbps", 0) + p99_mbps = statistics.get(f"{range_name[j]}_throughput_99th_Mbps", 0) + print(f"{range_name[j].ljust(24)} | {mean_mbps:12.2f} | {median_mbps:13.2f} | {p99_mbps:16.2f}") + +def main(): + # Path to the CSV file with parsed throughput data + csv_file_path = "throughput_data.csv" + + # Check if a custom file path was provided + if len(sys.argv) > 1: + csv_file_path = sys.argv[1] + + # Analyze throughput + analyze_throughput(csv_file_path) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/exercises/basic/basic.p4 b/exercises/basic/basic.p4 index 53cf3451..586ee0b7 100644 --- a/exercises/basic/basic.p4 +++ b/exercises/basic/basic.p4 @@ -1,4 +1,3 @@ -// SPDX-License-Identifier: Apache-2.0 /* -*- P4_16 -*- */ #include #include @@ -22,7 +21,7 @@ header ethernet_t { header ipv4_t { bit<4> version; bit<4> ihl; - bit<8> diffserv; + bit<8> tos; bit<16> totalLen; bit<16> identification; bit<3> flags; @@ -34,13 +33,40 @@ header ipv4_t { ip4Addr_t dstAddr; } +header tcp_t { + bit<16> srcPort; + bit<16> dstPort; + bit<32> seqNo; + bit<32> ackNo; + bit<4> dataOffset; + bit<3> res; + bit<3> ecn; + bit<6> ctrl; + bit<16> window; + bit<16> checksum; + bit<16> urgentPtr; +} + struct metadata { - /* empty */ + bit<32> rank; + // bit<32> queue_index; + // bit<32> tree_node_lower; + // bit<32> tree_node_upper; + // bit<32> left_child_lower; + // bit<32> left_child_upper; + // bit<32> right_child_lower; + // bit<32> right_child_upper; + bit<32> l1_t; + bit<32> l2_t; + bit<32> l3_t; + bit<32> t; + bit<32> cm; } struct headers { ethernet_t ethernet; ipv4_t ipv4; + tcp_t tcp; } /************************************************************************* @@ -53,46 +79,72 @@ parser MyParser(packet_in packet, inout standard_metadata_t standard_metadata) { state start { - /* TODO: add parser logic */ - transition accept; + transition parse_ethernet; } -} + state parse_ethernet { + packet.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + TYPE_IPV4: parse_ipv4; + default: accept; + } + } -/************************************************************************* -************ C H E C K S U M V E R I F I C A T I O N ************* -*************************************************************************/ + state parse_ipv4 { + packet.extract(hdr.ipv4); + transition select(hdr.ipv4.protocol) { + 0x06: parse_tcp; + default: accept; + } + } -control MyVerifyChecksum(inout headers hdr, inout metadata meta) { - apply { } + state parse_tcp { + packet.extract(hdr.tcp); + transition accept; + } } - /************************************************************************* ************** I N G R E S S P R O C E S S I N G ******************* *************************************************************************/ +register>(7) cml_registers; // 7 entries for cml +register>(7) cmr_registers; // 7 entries for cmr + control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { + + bit<48> in_flow_id = 0; + bit<32> in_flow_size = 0; + action drop() { mark_to_drop(standard_metadata); } action ipv4_forward(macAddr_t dstAddr, egressSpec_t port) { - /* - Action function for forwarding IPv4 packets. + standard_metadata.egress_spec = port; + hdr.ethernet.srcAddr = hdr.ethernet.dstAddr; + hdr.ethernet.dstAddr = dstAddr; + hdr.ipv4.ttl = hdr.ipv4.ttl - 1; + } - This function is responsible for forwarding IPv4 packets to the specified - destination MAC address and egress port. + // beta + action congruity_metric(bit<32> left_bound, bit<32> right_bound) { + meta.cm = left_bound; + // meta.cm = (left_bound >> 1) + (left_bound >> 3) + (right_bound >> 2) + (right_bound >> 3); + // meta.cm = (left_bound >> 1) + (left_bound >> 3) + (right_bound >> 2) + (right_bound >> 3); + } - Parameters: - - dstAddr: Destination MAC address of the packet. - - port: Egress port where the packet should be forwarded. + // alpha + action threshold(bit<32> left_bound, bit<32> right_bound) { + meta.t = right_bound; + // meta.t = (left_bound >> 2) + (left_bound >> 3) + (right_bound >> 1) + (right_bound >> 3); + } - TODO: Implement the logic for forwarding the IPv4 packet based on the - destination MAC address and egress port. - */ + action assign_flow_id(bit<48> flow_id, bit<32> flow_size) { + in_flow_id = flow_id; + in_flow_size = flow_size; // Store flow size in metadata } table ipv4_lpm { @@ -108,11 +160,132 @@ control MyIngress(inout headers hdr, default_action = NoAction(); } + table lookup_flow_id { + key = { + hdr.ipv4.srcAddr: lpm; + } + actions = { + assign_flow_id; + NoAction; + } + size = 1024; + default_action = NoAction(); + } + apply { - /* TODO: fix ingress control logic - * - ipv4_lpm should be applied only when IPv4 header is valid - */ - ipv4_lpm.apply(); + + lookup_flow_id.apply(); + if (hdr.ipv4.isValid()) { + // meta.rank = (bit<32>)hdr.ipv4.tos << 4; + // log_msg("Rank of the packet is: {}", {meta.rank}); + + bit<32> cml_val; + bit<32> cmr_val; + + + + if (hdr.tcp.isValid()) { + if (in_flow_size > 0) { + if (in_flow_size - (bit<32>)hdr.tcp.seqNo > 0) { + meta.rank = in_flow_size - (bit<32>)hdr.tcp.seqNo; + } else { + meta.rank = 0; + } + }else { + meta.rank = 0; + } + } + else { + meta.rank = 0; + } + + // log_msg("Rank of the packet is: {}", {meta.rank}); + + cml_registers.read(cml_val, 0); + cmr_registers.read(cmr_val, 0); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cml_registers.read(cml_val, 2); + cmr_registers.read(cmr_val, 2); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cml_registers.read(cml_val, 6); + cmr_registers.read(cmr_val, 6); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cmr_registers.write(6, meta.rank); + standard_metadata.priority = 0; + } else { + cml_registers.write(6, meta.rank); + standard_metadata.priority = 1; + } + cml_registers.read(cml_val, 6); + cmr_registers.read(cmr_val, 6); + congruity_metric(cml_val, cmr_val); + cmr_registers.write(2, meta.cm); + } else { + cml_registers.read(cml_val, 5); + cmr_registers.read(cmr_val, 5); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cmr_registers.write(5, meta.rank); + standard_metadata.priority = 2; + } else { + cml_registers.write(5, meta.rank); + standard_metadata.priority = 3; + } + cml_registers.read(cml_val, 5); + cmr_registers.read(cmr_val, 5); + congruity_metric(cml_val, cmr_val); + cml_registers.write(2, meta.cm); + } + cml_registers.read(cml_val, 2); + cmr_registers.read(cmr_val, 2); + congruity_metric(cml_val, cmr_val); + cml_registers.write(0, meta.cm); + } else { + cml_registers.read(cml_val, 1); + cmr_registers.read(cmr_val, 1); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cml_registers.read(cml_val, 4); + cmr_registers.read(cmr_val, 4); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cmr_registers.write(4, meta.rank); + standard_metadata.priority = 4; + } else { + cml_registers.write(4, meta.rank); + standard_metadata.priority = 5; + } + cml_registers.read(cml_val, 4); + cmr_registers.read(cmr_val, 4); + congruity_metric(cml_val, cmr_val); + cmr_registers.write(1, meta.cm); + } else { + cml_registers.read(cml_val, 3); + cmr_registers.read(cmr_val, 3); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cmr_registers.write(3, meta.rank); + standard_metadata.priority = 6; + } else { + cml_registers.write(3, meta.rank); + standard_metadata.priority = 7; + } + cml_registers.read(cml_val, 3); + cmr_registers.read(cmr_val, 3); + congruity_metric(cml_val, cmr_val); + cml_registers.write(1, meta.cm); + } + cml_registers.read(cml_val, 1); + cmr_registers.read(cmr_val, 1); + congruity_metric(cml_val, cmr_val); + cml_registers.write(0, meta.cm); + } + + ipv4_lpm.apply(); + } } } @@ -123,20 +296,24 @@ control MyIngress(inout headers hdr, control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { - apply { } + apply { } } /************************************************************************* ************* C H E C K S U M C O M P U T A T I O N ************** *************************************************************************/ +control MyVerifyChecksum(inout headers hdr, inout metadata meta) { + apply { } +} + control MyComputeChecksum(inout headers hdr, inout metadata meta) { apply { update_checksum( hdr.ipv4.isValid(), { hdr.ipv4.version, hdr.ipv4.ihl, - hdr.ipv4.diffserv, + hdr.ipv4.tos, hdr.ipv4.totalLen, hdr.ipv4.identification, hdr.ipv4.flags, @@ -150,26 +327,15 @@ control MyComputeChecksum(inout headers hdr, inout metadata meta) { } } - /************************************************************************* *********************** D E P A R S E R ******************************* *************************************************************************/ control MyDeparser(packet_out packet, in headers hdr) { apply { - /* - Control function for deparser. - - This function is responsible for constructing the output packet by appending - headers to it based on the input headers. - - Parameters: - - packet: Output packet to be constructed. - - hdr: Input headers to be added to the output packet. - - TODO: Implement the logic for constructing the output packet by appending - headers based on the input headers. - */ + packet.emit(hdr.ethernet); + packet.emit(hdr.ipv4); + packet.emit(hdr.tcp); } } @@ -184,4 +350,4 @@ MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser() -) main; +) main; \ No newline at end of file diff --git a/exercises/basic/calculate_data_transfer.py b/exercises/basic/calculate_data_transfer.py new file mode 100755 index 00000000..27af872d --- /dev/null +++ b/exercises/basic/calculate_data_transfer.py @@ -0,0 +1,266 @@ +#!/usr/bin/env python3 +import os +import re +import json +import pandas as pd +import matplotlib.pyplot as plt +import numpy as np + +def read_flow_mapping(): + mapping_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'flow_mapping_info.json') + with open(mapping_file, 'r') as f: + mapping_data = json.load(f) + return mapping_data + +def parse_sender_log(host_id): + sender_log = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'outputs', f'sender_{host_id}.txt') + if not os.path.exists(sender_log): + return 0, 0, None + + try: + with open(sender_log, 'r') as f: + content = f.read() + packet_counts = re.findall(r'This host has sent\s+(\d+) packets until now : (\d+\.\d+)', content) + if packet_counts: + max_packets = max(int(count) for count, _ in packet_counts) + timestamps = [float(timestamp) for _, timestamp in packet_counts] + start_time = min(timestamps) if timestamps else None + data_sent = max_packets * 1000 + return max_packets, data_sent, start_time + except Exception as e: + print(f"Error reading sender log for {host_id}: {e}") + return 0, 0, None + +def parse_receiver_log(host_id): + receiver_log = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'outputs', f'receiver_{host_id}.txt') + if not os.path.exists(receiver_log): + return 0, 0, None + + try: + with open(receiver_log, 'r') as f: + content = f.read() + received_timestamps = re.findall(r'packet is received at time : (\d+\.\d+)', content) + packets_received = len(received_timestamps) + end_time = max(float(t) for t in received_timestamps) if received_timestamps else None + data_received = packets_received * 1000 + return packets_received, data_received, end_time + except Exception as e: + print(f"Error reading receiver log for {host_id}: {e}") + return 0, 0, None + +def calculate_data_transfer(): + flow_mappings = read_flow_mapping() + results = [] + + for flow in flow_mappings: + source_host = flow['source'] + dest_host = flow['destination'] + flow_id = flow['flow_id'] + flow_size = flow['flow_size'] + + packets_sent, data_sent, start_time = parse_sender_log(source_host) + packets_received, data_received, end_time = parse_receiver_log(dest_host) + + completion_percentage = round((data_received / flow_size) * 100, 2) if flow_size > 0 else 0 + + results.append({ + 'flow_id': flow_id, + 'source': source_host, + 'destination': dest_host, + 'flow_size': flow_size, + 'packets_sent': packets_sent, + 'data_sent_bytes': data_sent, + 'packets_received': packets_received, + 'data_received_bytes': data_received, + 'data_transfer_ratio': round(data_received / data_sent, 2) if data_sent > 0 else 0, + 'completion_percentage': completion_percentage, + 'start_time': start_time, + 'end_time': end_time + }) + + return results + +def save_plots(results, output_dir): + # Create output directory if it doesn't exist + if not os.path.exists(output_dir): + os.makedirs(output_dir) + + # Create dataframe from results + df = pd.DataFrame(results) + + # Save completion percentage plot (original) + plt.figure(figsize=(14, 8)) + plt.bar(df['flow_id'], df['completion_percentage'], alpha=0.8, color='green') + plt.axhline(y=100, color='r', linestyle='--', alpha=0.5) + plt.xlabel('Flow ID', fontsize=12) + plt.ylabel('Completion Percentage (%)', fontsize=12) + plt.title('Flow Completion Percentage', fontsize=14) + plt.xticks(df['flow_id'], rotation=90) + plt.tight_layout() + plt.savefig(os.path.join(output_dir, 'flow_completion_percentage.png')) + plt.close() + + # Create flow size vs completion time scatter plot + # Filter out flows with no completion time data + completed_flows = df.dropna(subset=['start_time', 'end_time']).copy() + + if not completed_flows.empty: + # Calculate duration in milliseconds + completed_flows['duration_ms'] = completed_flows.apply( + lambda row: int((row['end_time'] - row['start_time']) * 1000), + axis=1 + ) + + # Create scatter plot + plt.figure(figsize=(14, 8)) + + # Use color to represent completion percentage + scatter = plt.scatter( + completed_flows['flow_size'], + completed_flows['duration_ms'], + c=completed_flows['completion_percentage'], + cmap='viridis', + alpha=0.7, + s=100 + ) + + # Add colorbar + cbar = plt.colorbar(scatter) + cbar.set_label('Completion Percentage (%)', fontsize=12) + + # Set log scale for x-axis if data spans multiple orders of magnitude + # if completed_flows['flow_size'].max() / completed_flows['flow_size'].min() > 100: + # plt.xscale('log') + # plt.xlabel('Flow Size (bytes) - Log Scale', fontsize=12) + # else: + # plt.xlabel('Flow Size (bytes)', fontsize=12) + + plt.xscale('log') + plt.xlabel('Flow Size (bytes) - Log Scale', fontsize=12) + + plt.ylabel('Flow Completion Time (ns)', fontsize=12) + plt.title('Flow Size vs Completion Time', fontsize=14) + plt.grid(True, alpha=0.3) + + # Add trend line + if len(completed_flows) > 1: + x = completed_flows['flow_size'] + y = completed_flows['duration_ms'] + + # If x-axis is log scale, fit against log of flow size + if plt.gca().get_xscale() == 'log': + z = np.polyfit(np.log10(x), y, 1) + p = np.poly1d(z) + x_trend = np.logspace(np.log10(x.min()), np.log10(x.max()), 100) + y_trend = p(np.log10(x_trend)) + plt.plot(x_trend, y_trend, 'r--', alpha=0.7, + label=f'Trend: y = {z[0]:.2f}*log10(x) + {z[1]:.2f}') + else: + z = np.polyfit(x, y, 1) + p = np.poly1d(z) + x_trend = np.linspace(x.min(), x.max(), 100) + y_trend = p(x_trend) + plt.plot(x_trend, y_trend, 'r--', alpha=0.7, + label=f'Trend: y = {z[0]:.2f}x + {z[1]:.2f}') + + plt.legend(fontsize=10) + + plt.tight_layout() + plt.savefig(os.path.join(output_dir, 'flow_size_vs_completion_time.png')) + plt.close() + +def main(): + print("Calculating data transfer for each flow...") + + # Ask for model name + model_name = input("Enter the model name for storing results (p->pifo, pf->pFabric, pe->pieo, etc.): ") + + # Ask for run number or identifier + run_id = input("Enter run identifier or number (e.g., run1, test2, etc.): ") + + # Create model directory + model_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'results', model_name) + if not os.path.exists(model_dir): + os.makedirs(model_dir) + print(f"Created model directory: {model_dir}") + + # Create run-specific directory within the model directory + run_dir = os.path.join(model_dir, run_id) + if not os.path.exists(run_dir): + os.makedirs(run_dir) + print(f"Created run directory: {run_dir}") + + # Calculate data transfer + results = calculate_data_transfer() + + if results: + # Sort by flow ID + results.sort(key=lambda x: x['flow_id']) + + # Print summary + print("\nFlow Transfer Summary:") + print("---------------------") + print(f"{'FlowId':<8} {'Src':<6} {'Dst':<6} {'Sent (byte)':<13} {'Received (byte)':<15} {'Total (byte)':<13} {'Duration (ms)':<15} {'Progress':<10}") + print("-" * 90) + + for result in results: + # Calculate duration + if result['start_time'] is not None and result['end_time'] is not None: + duration_ms = int((result['end_time'] - result['start_time']) * 1000) + else: + duration_ms = "N/A" + + # Format for display + duration_str = f"{duration_ms}" if duration_ms != "N/A" else "N/A" + + # Calculate progress as received data compared to sent data (not total flow size) + if result['data_sent_bytes'] > 0: + progress_percentage = round((result['data_received_bytes'] / result['data_sent_bytes']) * 100, 2) + else: + progress_percentage = 0 + + progress_str = f"{progress_percentage}%" if progress_percentage > 0 else "0%" + + print(f"{result['flow_id']:<8} {result['source']:<6} {result['destination']:<6} " + f"{result['data_sent_bytes']:<13} {result['data_received_bytes']:<15} {result['flow_size']:<13} " + f"{duration_str:<15} {progress_str:<10}") + + # Save results to CSV with run identifier in filename + df_results = [] + for result in results: + result_copy = dict(result) + if result['start_time'] is not None and result['end_time'] is not None: + result_copy['duration_ms'] = int((result['end_time'] - result['start_time']) * 1000) + else: + result_copy['duration_ms'] = None + + # Add progress percentage data + if result['data_sent_bytes'] > 0: + result_copy['progress_percentage'] = round((result['data_received_bytes'] / result['data_sent_bytes']) * 100, 2) + else: + result_copy['progress_percentage'] = 0 + + df_results.append(result_copy) + + df = pd.DataFrame(df_results) + + # Save in both the model directory and the run-specific directory + output_file_run = os.path.join(run_dir, 'flow_data_transfer.csv') + df.to_csv(output_file_run, index=False) + + # Also save with run identifier in the model directory for easy comparison + output_file_model = os.path.join(model_dir, f'flow_data_transfer_{run_id}.csv') + df.to_csv(output_file_model, index=False) + + print(f"\nDetailed results saved to:") + print(f" 1. {output_file_run}") + print(f" 2. {output_file_model}") + + # Generate plots with run identifier in filenames + save_plots(results, run_dir) + print(f"Plots generated in {run_dir}") + else: + print("No results were calculated.") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/exercises/basic/cleanup_p4.py b/exercises/basic/cleanup_p4.py new file mode 100755 index 00000000..c109daef --- /dev/null +++ b/exercises/basic/cleanup_p4.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +import os +import subprocess +import re +import signal +import time + +def find_process_using_port(port): + """Find process ID using a specific port""" + try: + # Run netstat command to find processes using ports + cmd = f"sudo netstat -tuln | grep :{port}" + result = subprocess.run(cmd, shell=True, capture_output=True, text=True) + + if result.stdout: + print(f"Port {port} is in use.") + + # Find the process ID using lsof + cmd = f"sudo lsof -i :{port} -t" + result = subprocess.run(cmd, shell=True, capture_output=True, text=True) + + if result.stdout: + pid = result.stdout.strip() + return pid + except Exception as e: + print(f"Error finding process: {e}") + + return None + +def kill_process(pid): + """Kill a process by its process ID""" + try: + # Get process name for better logging + cmd = f"ps -p {pid} -o comm=" + result = subprocess.run(cmd, shell=True, capture_output=True, text=True) + process_name = result.stdout.strip() if result.stdout else "Unknown" + + print(f"Attempting to terminate process {pid} ({process_name})...") + + # Try to terminate gracefully first + os.kill(int(pid), signal.SIGTERM) + time.sleep(1) # Give it a moment to shut down + + # Check if it's still running + try: + os.kill(int(pid), 0) # Signal 0 is used to check if process exists + print(f"Process {pid} did not terminate gracefully, using SIGKILL...") + os.kill(int(pid), signal.SIGKILL) + except OSError: + print(f"Process {pid} terminated successfully.") + return True + + except Exception as e: + print(f"Error killing process: {e}") + + return False + +def cleanup_p4_ports(): + """Clean up commonly used P4 ports""" + # List of common P4 ports that might remain bound + p4_ports = [50051, 50052, 50053, 50054, 50055, 50056, 50057, 50058, 50059, 50060, + 50061, 50062, 50063, + 9090, 9091, 9092, 9093, 9094, 9095, 9096, 9097, 9098, 9099,] + + killed_processes = [] + + for port in p4_ports: + pid = find_process_using_port(port) + if pid: + if kill_process(pid): + killed_processes.append((pid, port)) + + return killed_processes + +def clean_mininet(): + """Run Mininet cleanup command""" + print("Cleaning up Mininet...") + try: + subprocess.run("sudo mn -c", shell=True, check=True) + print("Mininet cleanup completed successfully.") + except subprocess.CalledProcessError as e: + print(f"Mininet cleanup failed: {e}") + +def main(): + print("Starting P4 program cleanup...") + + # Kill processes using P4 ports + killed_processes = cleanup_p4_ports() + + if killed_processes: + print(f"\nKilled {len(killed_processes)} processes that were holding ports:") + for pid, port in killed_processes: + print(f" - PID {pid} (Port {port})") + else: + print("No processes found holding P4 ports.") + + # Clean Mininet + clean_mininet() + + print("\nCleanup completed. You should now be able to run your P4 program.") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/exercises/basic/flow_analysis.csv b/exercises/basic/flow_analysis.csv new file mode 100644 index 00000000..2ab8e09c --- /dev/null +++ b/exercises/basic/flow_analysis.csv @@ -0,0 +1,73 @@ +flow_id,sender,receiver,flow_size,total_sent,total_received,duration,progress,source_ip,destination_ip +1,h416,h74,667000,666624.0,666624.0,2.8759,99.94362818590704,10.0.4.31,10.0.7.7 +2,h116,h810,667000,666624.0,666624.0,2.4849,99.94362818590704,10.0.1.31,10.0.8.19 +3,h111,h814,6000,6000.64,6000.64,0.0074,100.01066666666667,10.0.1.21,10.0.8.27 +4,h24,h911,6000,6000.64,6000.64,0.0055,100.01066666666667,10.0.2.7,10.0.9.21 +5,h21,h615,6000,6000.64,6000.64,0.0046,100.01066666666667,10.0.2.1,10.0.6.29 +6,h314,h59,133000,133120.0,133120.0,0.7598,100.09022556390978,10.0.3.27,10.0.5.17 +7,h13,h816,6000,6000.64,6000.64,0.004,100.01066666666667,10.0.1.5,10.0.8.31 +8,h47,h78,53000,53043.2,53043.2,0.2945,100.08150943396225,10.0.4.13,10.0.7.15 +9,h414,h76,3333000,3334471.68,3334471.68,6.3465,100.04415481548155,10.0.4.27,10.0.7.11 +10,h41,h610,19000,19046.4,19046.4,0.1063,100.2442105263158,10.0.4.1,10.0.6.19 +11,h18,h913,13000,13004.8,13004.8,0.0095,100.03692307692307,10.0.1.15,10.0.9.25 +12,h32,h711,3333000,3334471.68,3334471.68,8.6431,100.04415481548155,10.0.3.3,10.0.7.21 +13,h115,h811,13000,13004.8,13004.8,0.0101,100.03692307692307,10.0.1.29,10.0.8.21 +14,h52,h64,6000,6000.64,6000.64,0.0036,100.01066666666667,10.0.5.3,10.0.6.7 +15,h211,h86,53000,53043.2,53043.2,0.2503,100.08150943396225,10.0.2.21,10.0.8.11 +16,h45,h79,19000,19046.4,19046.4,0.1046,100.2442105263158,10.0.4.9,10.0.7.17 +17,h43,h69,667000,666624.0,666624.0,1.7445,99.94362818590704,10.0.4.5,10.0.6.17 +18,h214,h713,133000,133120.0,133120.0,0.666,100.09022556390978,10.0.2.27,10.0.7.25 +19,h35,h97,53000,53043.2,53043.2,0.382,100.08150943396225,10.0.3.9,10.0.9.13 +20,h215,h85,19000,19046.4,19046.4,0.1159,100.2442105263158,10.0.2.29,10.0.8.9 +21,h33,h511,20000000,20027801.6,20027801.6,13.2504,100.13900800000002,10.0.3.5,10.0.5.21 +22,h34,h98,667000,666624.0,666624.0,1.8328,99.94362818590704,10.0.3.7,10.0.9.15 +23,h213,h910,13000,13004.8,13004.8,0.0148,100.03692307692307,10.0.2.25,10.0.9.19 +24,h23,h89,6000,6000.64,6000.64,0.0045,100.01066666666667,10.0.2.5,10.0.8.17 +25,h37,h510,133000,133120.0,133120.0,0.707,100.09022556390978,10.0.3.13,10.0.5.19 +26,h311,h95,19000,19046.4,19046.4,0.1716,100.2442105263158,10.0.3.21,10.0.9.9 +27,h114,h812,133000,133120.0,133120.0,0.6784,100.09022556390978,10.0.1.27,10.0.8.23 +28,h412,h91,19000,19046.4,19046.4,0.1306,100.2442105263158,10.0.4.23,10.0.9.1 +29,h25,h715,6667000,6668943.36,6668943.36,10.1505,100.02914894255288,10.0.2.9,10.0.7.29 +30,h51,h65,1333000,1331691.52,1331691.52,3.035,99.90183945986497,10.0.5.1,10.0.6.9 +31,h36,h96,667000,666624.0,666624.0,2.247,99.94362818590704,10.0.3.11,10.0.9.11 +32,h410,h92,53000,53043.2,53043.2,0.3223,100.08150943396225,10.0.4.19,10.0.9.3 +33,h415,h75,133000,133120.0,133120.0,0.6679,100.09022556390978,10.0.4.29,10.0.7.9 +34,h17,h914,133000,133120.0,133120.0,1.0207,100.09022556390978,10.0.1.13,10.0.9.27 +35,h212,h512,6000,6000.64,6000.64,0.0057,100.01066666666667,10.0.2.23,10.0.5.23 +36,h27,h513,1333000,1331691.52,1331691.52,3.8186,99.90183945986497,10.0.2.13,10.0.5.25 +37,h316,h611,1333000,1331691.52,1331691.52,3.769,99.90183945986497,10.0.3.31,10.0.6.21 +38,h411,h67,13000,13004.8,13004.8,0.0032,100.03692307692307,10.0.4.21,10.0.6.13 +39,h14,h616,133000,133120.0,133120.0,0.8354,100.09022556390978,10.0.1.7,10.0.6.31 +40,h38,h84,6667000,6668943.36,6668943.36,6.1046,100.02914894255288,10.0.3.15,10.0.8.7 +41,h57,h72,133000,133120.0,133120.0,0.809,100.09022556390978,10.0.5.13,10.0.7.3 +42,h313,h612,53000,53043.2,53043.2,0.4625,100.08150943396225,10.0.3.25,10.0.6.23 +43,h310,h710,133000,133120.0,133120.0,0.9129,100.09022556390978,10.0.3.19,10.0.7.19 +44,h42,h94,6000,6000.64,6000.64,0.0109,100.01066666666667,10.0.4.3,10.0.9.7 +45,h28,h714,133000,133120.0,133120.0,0.852,100.09022556390978,10.0.2.15,10.0.7.27 +46,h210,h614,1333000,1331691.52,1331691.52,3.061,99.90183945986497,10.0.2.19,10.0.6.27 +47,h56,h61,3333000,3334471.68,3334471.68,4.9551,100.04415481548155,10.0.5.11,10.0.6.1 +48,h53,h73,6000,6000.64,6000.64,0.0021,100.01066666666667,10.0.5.5,10.0.7.5 +49,h216,h712,20000000,20027801.6,20027801.6,14.68,100.13900800000002,10.0.2.31,10.0.7.23 +50,h58,h71,3333000,3334471.68,3334471.68,9.7648,100.04415481548155,10.0.5.15,10.0.7.1 +51,h113,h813,1333000,1331691.52,1331691.52,3.6441,99.90183945986497,10.0.1.25,10.0.8.25 +52,h29,h87,6000,6000.64,6000.64,0.0062,100.01066666666667,10.0.2.17,10.0.8.13 +53,h55,h62,1333000,1331691.52,1331691.52,4.2789,99.90183945986497,10.0.5.9,10.0.6.3 +54,h26,h88,133000,133120.0,133120.0,0.3391,100.09022556390978,10.0.2.11,10.0.8.15 +55,h312,h83,53000,53043.2,53043.2,0.3324,100.08150943396225,10.0.3.23,10.0.8.5 +56,h22,h514,6000,6000.64,6000.64,0.0049,100.01066666666667,10.0.2.3,10.0.5.27 +57,h44,h81,1333000,1331691.52,1331691.52,3.9016,99.90183945986497,10.0.4.7,10.0.8.1 +58,h49,h68,133000,133120.0,133120.0,0.4723,100.09022556390978,10.0.4.17,10.0.6.15 +59,h39,h613,19000,19046.4,19046.4,0.1384,100.2442105263158,10.0.3.17,10.0.6.25 +60,h46,h93,3333000,3334471.68,3334471.68,4.0581,100.04415481548155,10.0.4.11,10.0.9.5 +61,h413,h66,133000,133120.0,133120.0,0.669,100.09022556390978,10.0.4.25,10.0.6.11 +62,h112,h912,667000,666624.0,666624.0,2.5277,99.94362818590704,10.0.1.23,10.0.9.23 +63,h19,h716,3333000,3334471.68,3334471.68,10.5516,100.04415481548155,10.0.1.17,10.0.7.31 +64,h54,h63,53000,53043.2,53043.2,0.2668,100.08150943396225,10.0.5.7,10.0.6.5 +65,h12,h516,133000,133120.0,133120.0,0.5118,100.09022556390978,10.0.1.3,10.0.5.31 +66,h11,h916,6667000,6668943.36,6668943.36,9.9458,100.02914894255288,10.0.1.1,10.0.9.31 +67,h315,h82,19000,19046.4,19046.4,0.1668,100.2442105263158,10.0.3.29,10.0.8.3 +68,h110,h815,6667000,6668943.36,6668943.36,9.8053,100.02914894255288,10.0.1.19,10.0.8.29 +69,h31,h99,133000,133120.0,133120.0,0.9257,100.09022556390978,10.0.3.1,10.0.9.17 +70,h15,h915,3333000,3334471.68,3334471.68,6.8928,100.04415481548155,10.0.1.9,10.0.9.29 +71,h16,h515,6667000,6668943.36,6668943.36,11.1086,100.02914894255288,10.0.1.11,10.0.5.29 +72,h48,h77,667000,666624.0,666624.0,2.6959,99.94362818590704,10.0.4.15,10.0.7.13 diff --git a/exercises/basic/flow_mapping_info.csv b/exercises/basic/flow_mapping_info.csv new file mode 100644 index 00000000..1d2e5608 --- /dev/null +++ b/exercises/basic/flow_mapping_info.csv @@ -0,0 +1,73 @@ +source,source_ip,destination,destination_ip,flow_id,flow_size +h416,10.0.4.31,h74,10.0.7.7,1,667000 +h116,10.0.1.31,h810,10.0.8.19,2,667000 +h111,10.0.1.21,h814,10.0.8.27,3,6000 +h24,10.0.2.7,h911,10.0.9.21,4,6000 +h21,10.0.2.1,h615,10.0.6.29,5,6000 +h314,10.0.3.27,h59,10.0.5.17,6,133000 +h13,10.0.1.5,h816,10.0.8.31,7,6000 +h47,10.0.4.13,h78,10.0.7.15,8,53000 +h414,10.0.4.27,h76,10.0.7.11,9,3333000 +h41,10.0.4.1,h610,10.0.6.19,10,19000 +h18,10.0.1.15,h913,10.0.9.25,11,13000 +h32,10.0.3.3,h711,10.0.7.21,12,3333000 +h115,10.0.1.29,h811,10.0.8.21,13,13000 +h52,10.0.5.3,h64,10.0.6.7,14,6000 +h211,10.0.2.21,h86,10.0.8.11,15,53000 +h45,10.0.4.9,h79,10.0.7.17,16,19000 +h43,10.0.4.5,h69,10.0.6.17,17,667000 +h214,10.0.2.27,h713,10.0.7.25,18,133000 +h35,10.0.3.9,h97,10.0.9.13,19,53000 +h215,10.0.2.29,h85,10.0.8.9,20,19000 +h33,10.0.3.5,h511,10.0.5.21,21,20000000 +h34,10.0.3.7,h98,10.0.9.15,22,667000 +h213,10.0.2.25,h910,10.0.9.19,23,13000 +h23,10.0.2.5,h89,10.0.8.17,24,6000 +h37,10.0.3.13,h510,10.0.5.19,25,133000 +h311,10.0.3.21,h95,10.0.9.9,26,19000 +h114,10.0.1.27,h812,10.0.8.23,27,133000 +h412,10.0.4.23,h91,10.0.9.1,28,19000 +h25,10.0.2.9,h715,10.0.7.29,29,6667000 +h51,10.0.5.1,h65,10.0.6.9,30,1333000 +h36,10.0.3.11,h96,10.0.9.11,31,667000 +h410,10.0.4.19,h92,10.0.9.3,32,53000 +h415,10.0.4.29,h75,10.0.7.9,33,133000 +h17,10.0.1.13,h914,10.0.9.27,34,133000 +h212,10.0.2.23,h512,10.0.5.23,35,6000 +h27,10.0.2.13,h513,10.0.5.25,36,1333000 +h316,10.0.3.31,h611,10.0.6.21,37,1333000 +h411,10.0.4.21,h67,10.0.6.13,38,13000 +h14,10.0.1.7,h616,10.0.6.31,39,133000 +h38,10.0.3.15,h84,10.0.8.7,40,6667000 +h57,10.0.5.13,h72,10.0.7.3,41,133000 +h313,10.0.3.25,h612,10.0.6.23,42,53000 +h310,10.0.3.19,h710,10.0.7.19,43,133000 +h42,10.0.4.3,h94,10.0.9.7,44,6000 +h28,10.0.2.15,h714,10.0.7.27,45,133000 +h210,10.0.2.19,h614,10.0.6.27,46,1333000 +h56,10.0.5.11,h61,10.0.6.1,47,3333000 +h53,10.0.5.5,h73,10.0.7.5,48,6000 +h216,10.0.2.31,h712,10.0.7.23,49,20000000 +h58,10.0.5.15,h71,10.0.7.1,50,3333000 +h113,10.0.1.25,h813,10.0.8.25,51,1333000 +h29,10.0.2.17,h87,10.0.8.13,52,6000 +h55,10.0.5.9,h62,10.0.6.3,53,1333000 +h26,10.0.2.11,h88,10.0.8.15,54,133000 +h312,10.0.3.23,h83,10.0.8.5,55,53000 +h22,10.0.2.3,h514,10.0.5.27,56,6000 +h44,10.0.4.7,h81,10.0.8.1,57,1333000 +h49,10.0.4.17,h68,10.0.6.15,58,133000 +h39,10.0.3.17,h613,10.0.6.25,59,19000 +h46,10.0.4.11,h93,10.0.9.5,60,3333000 +h413,10.0.4.25,h66,10.0.6.11,61,133000 +h112,10.0.1.23,h912,10.0.9.23,62,667000 +h19,10.0.1.17,h716,10.0.7.31,63,3333000 +h54,10.0.5.7,h63,10.0.6.5,64,53000 +h12,10.0.1.3,h516,10.0.5.31,65,133000 +h11,10.0.1.1,h916,10.0.9.31,66,6667000 +h315,10.0.3.29,h82,10.0.8.3,67,19000 +h110,10.0.1.19,h815,10.0.8.29,68,6667000 +h31,10.0.3.1,h99,10.0.9.17,69,133000 +h15,10.0.1.9,h915,10.0.9.29,70,3333000 +h16,10.0.1.11,h515,10.0.5.29,71,6667000 +h48,10.0.4.15,h77,10.0.7.13,72,667000 diff --git a/exercises/basic/json_to_csv.py b/exercises/basic/json_to_csv.py new file mode 100644 index 00000000..6c0c0f1b --- /dev/null +++ b/exercises/basic/json_to_csv.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 + +import json +import csv +import os + +def convert_json_to_csv(json_file, csv_file): + """Convert the flow mapping JSON file to CSV format.""" + try: + # Read the JSON file + with open(json_file, 'r') as f: + data = json.load(f) + + # Write to CSV + with open(csv_file, 'w', newline='') as csvfile: + fieldnames = ['source', 'source_ip', 'destination', 'destination_ip', 'flow_id', 'flow_size'] + writer = csv.DictWriter(csvfile, fieldnames=fieldnames) + writer.writeheader() + writer.writerows(data) + + print(f"Successfully converted {json_file} to {csv_file}") + return True + except Exception as e: + print(f"Error converting JSON to CSV: {e}") + return False + +if __name__ == "__main__": + json_file = 'flow_mapping_info.json' + csv_file = 'flow_mapping_info.csv' + convert_json_to_csv(json_file, csv_file) \ No newline at end of file diff --git a/exercises/basic/parse_throughput.py b/exercises/basic/parse_throughput.py new file mode 100755 index 00000000..efe00d25 --- /dev/null +++ b/exercises/basic/parse_throughput.py @@ -0,0 +1,301 @@ +#!/usr/bin/env python3 + +import os +import re +import csv +import sys +import pandas as pd + +def extract_ip_from_string(text): + """Extract IP addresses from a string.""" + ip_pattern = r'\b(?:\d{1,3}\.){3}\d{1,3}\b' + ips = re.findall(ip_pattern, text) + return ips + +def load_flow_mapping(mapping_path): + """Load the flow mapping information from CSV file.""" + if not os.path.exists(mapping_path): + print(f"Warning: Flow mapping file {mapping_path} not found!") + return {} + + # Dictionary for IP to host mapping + ip_to_host = {} + # Dictionary for IP to flow_id mapping + ip_to_flow_id = {} + # Dictionary for mapping source_ip to destination_ip + source_to_dest = {} + # Dictionary for storing flow sizes + flow_id_to_size = {} + + try: + # Read the flow mapping CSV file + mapping_df = pd.read_csv(mapping_path) + + # Create mappings + for _, row in mapping_df.iterrows(): + # Map source_ip to source (host ID) + if 'source_ip' in mapping_df.columns and 'source' in mapping_df.columns: + src_ip = row['source_ip'] + src_host = row['source'] + ip_to_host[src_ip] = src_host.replace('h', '') # Remove 'h' prefix if present + + # Map destination_ip to destination (host ID) + if 'destination_ip' in mapping_df.columns and 'destination' in mapping_df.columns: + dst_ip = row['destination_ip'] + dst_host = row['destination'] + ip_to_host[dst_ip] = dst_host.replace('h', '') # Remove 'h' prefix if present + + # Map IPs to flow_id + if 'source_ip' in mapping_df.columns and 'destination_ip' in mapping_df.columns and 'flow_id' in mapping_df.columns: + src_ip = row['source_ip'] + dst_ip = row['destination_ip'] + flow_id = row['flow_id'] + source_to_dest[src_ip] = dst_ip + ip_to_flow_id[(src_ip, dst_ip)] = flow_id + + # Map flow_id to flow_size + if 'flow_id' in mapping_df.columns and 'flow_size' in mapping_df.columns: + flow_id = row['flow_id'] + flow_size = row['flow_size'] + flow_id_to_size[flow_id] = flow_size + + print(f"Loaded mappings for {len(ip_to_host)} hosts and {len(ip_to_flow_id)} flows") + except Exception as e: + print(f"Error loading flow mapping file: {e}") + + return ip_to_host, ip_to_flow_id, source_to_dest, flow_id_to_size + +def verify_connection(source_ip, dest_ip, source_to_dest): + """Verify if the connection between source and destination IP is valid based on mapping.""" + if source_ip in source_to_dest: + expected_dest = source_to_dest[source_ip] + if expected_dest == dest_ip: + return True + else: + print(f"Warning: Unexpected destination IP for {source_ip}. Expected {expected_dest}, got {dest_ip}") + return False + return False # No mapping available to verify + +def parse_receiver_files(directory_path, ip_to_host=None, ip_to_flow_id=None, source_to_dest=None, flow_id_to_size=None): + """Parse all receiver files and extract throughput information.""" + throughput_data = [] + + # List all files in the directory + files = [f for f in os.listdir(directory_path) if f.startswith('receiver_') and f.endswith('.txt')] + + print(f"Found {len(files)} receiver files to process.") + + for filename in files: + file_path = os.path.join(directory_path, filename) + + # Extract the host ID from the filename (e.g., h616 from receiver_h616.txt) + host_match = re.search(r'receiver_h(\d+)\.txt', filename) + if host_match: + dest_id = host_match.group(1) + else: + dest_id = "unknown" + + try: + with open(file_path, 'r') as file: + content = file.read() + + # Extract the local and remote IPs + connection_line = None + for line in content.split('\n'): + if "local" in line and "connected with" in line: + connection_line = line + break + + if not connection_line: + print(f"Couldn't find connection line in {filename}") + continue + + ips = extract_ip_from_string(connection_line) + if len(ips) < 2: + print(f"Couldn't extract IPs from connection line in {filename}") + continue + + local_ip = ips[0] # Receiver IP + remote_ip = ips[1] # Sender IP + + # Get source ID from mapping file if available + if ip_to_host and remote_ip in ip_to_host: + source_id = ip_to_host[remote_ip] + else: + # Fallback: Extract from hostname or IP + ip_parts = remote_ip.split('.') + if len(ip_parts) == 4: + source_id = ip_parts[2] # Using the third octet as host identifier + print(f"Warning: Using fallback ID extraction for {remote_ip} -> {source_id}") + else: + source_id = "unknown" + print(f"Warning: Could not determine source ID for {remote_ip}") + + # Verify the connection + connection_verified = verify_connection(remote_ip, local_ip, source_to_dest) + if not connection_verified: + print(f"Note: Connection from {remote_ip} to {local_ip} not found in mapping file") + + # Get flow_id from mapping + flow_id = None + if ip_to_flow_id and (remote_ip, local_ip) in ip_to_flow_id: + flow_id = ip_to_flow_id[(remote_ip, local_ip)] + + # Extract bandwidth information + bandwidth_line = None + for line in content.split('\n'): + if "sec" in line and "Bytes" in line and "bits/sec" in line: + bandwidth_line = line + break + + if not bandwidth_line: + print(f"Couldn't find bandwidth line in {filename}") + continue + + # Parse the bandwidth line which looks like: + # [ 1] 0.0000-0.5362 sec 130 KBytes 1.98 Mbits/sec + parts = bandwidth_line.strip().split() + + # Find the interval + interval_str = None + for i, part in enumerate(parts): + if "sec" in part and "-" in parts[i-1]: + interval_str = parts[i-1] + break + + if not interval_str: + print(f"Couldn't parse interval in {filename}") + continue + + try: + # Extract start and end times + start_time, end_time = map(float, interval_str.split('-')) + duration = end_time - start_time + + # Find transfer amount + transfer_value = None + transfer_unit = None + for i, part in enumerate(parts): + if part in ["Bytes", "KBytes", "MBytes", "GBytes"] and i > 0: + transfer_value = float(parts[i-1]) + transfer_unit = part + break + + if not transfer_value: + print(f"Couldn't parse transfer amount in {filename}") + continue + + # Convert transfer to bytes + flow_size = transfer_value + if transfer_unit == "KBytes": + flow_size = transfer_value * 1024 + elif transfer_unit == "MBytes": + flow_size = transfer_value * 1024 * 1024 + elif transfer_unit == "GBytes": + flow_size = transfer_value * 1024 * 1024 * 1024 + + # Find bandwidth + bandwidth_value = None + bandwidth_unit = None + for i, part in enumerate(parts): + if "bits/sec" in part and i > 0: + bandwidth_value = float(parts[i-1]) + bandwidth_unit = part + break + + if not bandwidth_value: + print(f"Couldn't parse bandwidth in {filename}") + continue + + # Convert bandwidth to Mbits/sec + if "Kbits/sec" in bandwidth_unit: + bandwidth_value /= 1000.0 + elif "Gbits/sec" in bandwidth_unit: + bandwidth_value *= 1000.0 + + # Get expected flow size from mapping if available + expected_flow_size = None + if flow_id and flow_id in flow_id_to_size: + expected_flow_size = flow_id_to_size[flow_id] + + # Add to the throughput data + throughput_data.append({ + 'flow_id': flow_id if flow_id else "unknown", + 'source_id': source_id, + 'dest_id': dest_id, + 'source_ip': remote_ip, + 'dest_ip': local_ip, + 'throughput_mbps': bandwidth_value, + 'flow_size_bytes': flow_size, + 'expected_flow_size': expected_flow_size, + 'duration': duration + }) + print(f"Successfully parsed {filename}: Flow ID {flow_id}, {source_id} -> {dest_id}, {bandwidth_value} Mbps") + except Exception as e: + print(f"Error parsing values from {filename}: {e}") + except Exception as e: + print(f"Error reading file {filename}: {e}") + + return throughput_data + +def save_to_csv(data, output_path): + """Save the extracted data to a CSV file.""" + if not data: + print("No throughput data to save!") + return + + fieldnames = ['flow_id', 'source_id', 'dest_id', 'source_ip', 'dest_ip', + 'throughput_mbps', 'flow_size_bytes', 'expected_flow_size', 'duration'] + + with open(output_path, 'w', newline='') as csvfile: + writer = csv.DictWriter(csvfile, fieldnames=fieldnames) + writer.writeheader() + writer.writerows(data) + + print(f"CSV file saved to {output_path} with {len(data)} records") + +def main(): + # Directory containing the receiver files + directory_path = '/home/nwlab/p4/tutorials/exercises/basic/outputs' + + # Path to flow mapping file (try several potential locations) + mapping_paths = [ + '/home/nwlab/p4/tutorials/exercises/basic/flow_mapping_info.csv', + '/home/nwlab/p4/tutorials/exercises/basic/flow_mapping.csv', + '/home/nwlab/p4/tutorials/exercises/basic/host_mapping.csv', + '/home/nwlab/p4/tutorials/exercises/basic/outputs/flow_mapping.csv' + ] + + # Try to find the mapping file + ip_to_host = {} + ip_to_flow_id = {} + source_to_dest = {} + flow_id_to_size = {} + + for mapping_path in mapping_paths: + if os.path.exists(mapping_path): + print(f"Found mapping file at: {mapping_path}") + ip_to_host, ip_to_flow_id, source_to_dest, flow_id_to_size = load_flow_mapping(mapping_path) + if ip_to_host or ip_to_flow_id: + break + + # Allow providing a different directory via command line + if len(sys.argv) > 1: + directory_path = sys.argv[1] + + # Allow specifying a custom mapping file + if len(sys.argv) > 2: + mapping_path = sys.argv[2] + ip_to_host, ip_to_flow_id, source_to_dest, flow_id_to_size = load_flow_mapping(mapping_path) + + # Output CSV file path + output_csv_path = '/home/nwlab/p4/tutorials/exercises/basic/throughput_data.csv' + + print(f"Parsing receiver files from: {directory_path}") + throughput_data = parse_receiver_files(directory_path, ip_to_host, ip_to_flow_id, source_to_dest, flow_id_to_size) + print(f"Extracted throughput data for {len(throughput_data)} connections") + + save_to_csv(throughput_data, output_csv_path) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/exercises/basic/plot_per_flow_throughput.py b/exercises/basic/plot_per_flow_throughput.py new file mode 100644 index 00000000..4d6d09f7 --- /dev/null +++ b/exercises/basic/plot_per_flow_throughput.py @@ -0,0 +1,134 @@ +\ +import json +import matplotlib.pyplot as plt +from collections import defaultdict +import os + +INPUT_JSON = "./outputs/iperf_server_log.json" +OUTPUT_PLOT = "./outputs/per_flow_throughput.png" +OUTPUT_DIR = "./outputs" + +def analyze_and_plot(json_path, plot_path): + """ + Parses iperf JSON output and plots throughput per flow over time. + + Args: + json_path (str): Path to the iperf JSON log file. + plot_path (str): Path to save the output plot image. + """ + try: + with open(json_path, 'r') as f: + try: + data = json.load(f) + except json.JSONDecodeError as e: + print(f"Error decoding JSON from {json_path}: {e}") + # Attempt to read line by line if full load fails + print("Attempting line-by-line parsing (might be incomplete)...") + f.seek(0) + intervals = [] + for line in f: + line = line.strip() + if not line: continue + try: + # This is a basic attempt, iperf JSON isn't usually line-delimited + # Might need more robust handling if the file is truly malformed + # but structured like the example. + # Focus on extracting 'intervals' if possible. + if '"intervals":' in line and line.endswith('['): + # Simplistic start, assumes intervals array follows + pass # Need more context to parse this robustly + elif line.startswith('{') and '"streams":' in line and '"sum":' in line: + intervals.append(json.loads(line)) + + except json.JSONDecodeError: + print(f"Skipping invalid JSON line: {line[:100]}...") + if not intervals: + print("Could not extract interval data line-by-line.") + return + data = {'intervals': intervals} # Reconstruct structure partially + + except FileNotFoundError: + print(f"Error: Input file not found at {json_path}") + return + except Exception as e: + print(f"Error reading file {json_path}: {e}") + return + + if 'intervals' not in data or not data['intervals']: + print(f"No 'intervals' data found in {json_path}") + return + + flow_data = defaultdict(lambda: {'times': [], 'throughputs_mbps': []}) + + print(f"Processing {len(data['intervals'])} intervals...") + + for interval in data['intervals']: + if not isinstance(interval, dict) or 'streams' not in interval or 'sum' not in interval: + # print("Skipping interval with missing 'streams' or 'sum'") + continue # Skip intervals that don't have the expected structure + + interval_end_time = interval['sum'].get('end') + if interval_end_time is None: + # print("Skipping interval with missing 'end' time in 'sum'") + continue # Skip if we can't get a time point + + for stream in interval.get('streams', []): + # Check if stream is a dict and has the required keys + if not isinstance(stream, dict): + # print(f"Skipping non-dict stream entry in interval ending at {interval_end_time}") + continue + + socket_id = stream.get('socket') + bits_per_second = stream.get('bits_per_second') + + # Ensure we have valid data to plot + if socket_id is not None and bits_per_second is not None: + flow_data[socket_id]['times'].append(interval_end_time) + # Convert bits/sec to Mbps + flow_data[socket_id]['throughputs_mbps'].append(bits_per_second / 1_000_000) + # else: + # print(f"Skipping stream in interval ending at {interval_end_time} due to missing socket or bps: {stream}") + + + if not flow_data: + print("No valid stream data found to plot.") + return + + print(f"Found data for flows (socket IDs): {list(flow_data.keys())}") + + # Plotting + plt.figure(figsize=(12, 6)) + + for socket_id, values in flow_data.items(): + if values['times'] and values['throughputs_mbps']: # Ensure there's data to plot for the flow + # Sort by time just in case intervals weren't perfectly ordered + sorted_data = sorted(zip(values['times'], values['throughputs_mbps'])) + times_sorted, throughputs_sorted = zip(*sorted_data) + plt.plot(times_sorted, throughputs_sorted, marker='o', linestyle='-', label=f'Flow {socket_id}') + # else: + # print(f"Skipping plot for flow {socket_id} due to insufficient data points.") + + + plt.title('Per-Flow Throughput vs. Time') + plt.xlabel('Time (seconds)') + plt.ylabel('Throughput (Mbps)') + plt.legend() + plt.grid(True) + plt.tight_layout() + + # Ensure output directory exists + os.makedirs(os.path.dirname(plot_path), exist_ok=True) + + try: + plt.savefig(plot_path) + print(f"Plot saved to {plot_path}") + except Exception as e: + print(f"Error saving plot to {plot_path}: {e}") + +if __name__ == "__main__": + # Get script's directory to build absolute paths + script_dir = os.path.dirname(os.path.abspath(__file__)) + abs_json_path = os.path.join(script_dir, INPUT_JSON) + abs_plot_path = os.path.join(script_dir, OUTPUT_PLOT) + analyze_and_plot(abs_json_path, abs_plot_path) + diff --git a/exercises/basic/pod-topo/s1-runtime.json b/exercises/basic/pod-topo/s1-runtime.json index be07b9aa..9e89425d 100644 --- a/exercises/basic/pod-topo/s1-runtime.json +++ b/exercises/basic/pod-topo/s1-runtime.json @@ -30,28 +30,6 @@ "dstAddr": "08:00:00:00:02:22", "port": 2 } - }, - { - "table": "MyIngress.ipv4_lpm", - "match": { - "hdr.ipv4.dstAddr": ["10.0.3.3", 32] - }, - "action_name": "MyIngress.ipv4_forward", - "action_params": { - "dstAddr": "08:00:00:00:03:00", - "port": 3 - } - }, - { - "table": "MyIngress.ipv4_lpm", - "match": { - "hdr.ipv4.dstAddr": ["10.0.4.4", 32] - }, - "action_name": "MyIngress.ipv4_forward", - "action_params": { - "dstAddr": "08:00:00:00:04:00", - "port": 4 - } } ] } diff --git a/exercises/basic/pod-topo/topology.json b/exercises/basic/pod-topo/topology.json index 588d9f02..429e8185 100644 --- a/exercises/basic/pod-topo/topology.json +++ b/exercises/basic/pod-topo/topology.json @@ -15,36 +15,11 @@ "route add default gw 10.0.2.20 dev eth0", "arp -i eth0 -s 10.0.2.20 08:00:00:00:02:00" ] - }, - "h3": { - "ip": "10.0.3.3/24", - "mac": "08:00:00:00:03:33", - "commands": [ - "route add default gw 10.0.3.30 dev eth0", - "arp -i eth0 -s 10.0.3.30 08:00:00:00:03:00" - ] - }, - "h4": { - "ip": "10.0.4.4/24", - "mac": "08:00:00:00:04:44", - "commands": [ - "route add default gw 10.0.4.40 dev eth0", - "arp -i eth0 -s 10.0.4.40 08:00:00:00:04:00" - ] } }, "switches": { "s1": { "runtime_json": "pod-topo/s1-runtime.json" - }, - "s2": { - "runtime_json": "pod-topo/s2-runtime.json" - }, - "s3": { - "runtime_json": "pod-topo/s3-runtime.json" - }, - "s4": { - "runtime_json": "pod-topo/s4-runtime.json" } }, "links": [ @@ -55,30 +30,6 @@ [ "h2", "s1-p2" - ], - [ - "s1-p3", - "s3-p1" - ], - [ - "s1-p4", - "s4-p2" - ], - [ - "h3", - "s2-p1" - ], - [ - "h4", - "s2-p2" - ], - [ - "s2-p3", - "s4-p1" - ], - [ - "s2-p4", - "s3-p2" ] ] } \ No newline at end of file diff --git a/exercises/basic/receive.py b/exercises/basic/receive.py index 91b95766..7a374859 100755 --- a/exercises/basic/receive.py +++ b/exercises/basic/receive.py @@ -1,61 +1,24 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only # Reason-GPL: import-scapy -import os + import sys -from scapy.all import ( - TCP, - FieldLenField, - FieldListField, - IntField, - IPOption, - ShortField, - get_if_list, - sniff -) -from scapy.layers.inet import _IPOption_HDR - - -def get_if(): - ifs=get_if_list() - iface=None - for i in get_if_list(): - if "eth0" in i: - iface=i - break; - if not iface: - print("Cannot find eth0 interface") - exit(1) - return iface - -class IPOption_MRI(IPOption): - name = "MRI" - option = 31 - fields_desc = [ _IPOption_HDR, - FieldLenField("length", None, fmt="B", - length_of="swids", - adjust=lambda pkt,l:l+4), - ShortField("count", 0), - FieldListField("swids", - [], - IntField("", 0), - length_from=lambda pkt:pkt.count*4) ] +from scapy.all import sniff + + def handle_pkt(pkt): - if TCP in pkt and pkt[TCP].dport == 1234: - print("got a packet") - pkt.show2() - # hexdump(pkt) - sys.stdout.flush() + print("got a packet") + pkt.show2() + sys.stdout.flush() def main(): - ifaces = [i for i in os.listdir('/sys/class/net/') if 'eth' in i] - iface = ifaces[0] + iface = 'eth0' print("sniffing on %s" % iface) sys.stdout.flush() - sniff(iface = iface, - prn = lambda x: handle_pkt(x)) + sniff(iface=iface, prn=lambda x: handle_pkt(x)) + if __name__ == '__main__': main() diff --git a/exercises/basic/s1-runtime.json b/exercises/basic/s1-runtime.json new file mode 100644 index 00000000..a4ef3f82 --- /dev/null +++ b/exercises/basic/s1-runtime.json @@ -0,0 +1,1062 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:01", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:02", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:03", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:04", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:05", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:06", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:07", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:08", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:09", + "port": 9 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:10", + "port": 10 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:11", + "port": 11 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:12", + "port": 12 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:13", + "port": 13 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:14", + "port": 14 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:15", + "port": 15 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:16", + "port": 16 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 20 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 20 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/s2-runtime.json b/exercises/basic/s2-runtime.json new file mode 100644 index 00000000..c6b380ba --- /dev/null +++ b/exercises/basic/s2-runtime.json @@ -0,0 +1,1062 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:01", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:02", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:03", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:04", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:05", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:06", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:07", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:08", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:09", + "port": 9 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:10", + "port": 10 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:11", + "port": 11 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:12", + "port": 12 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:13", + "port": 13 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:14", + "port": 14 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:15", + "port": 15 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:16", + "port": 16 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 20 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 20 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/s3-runtime.json b/exercises/basic/s3-runtime.json new file mode 100644 index 00000000..e2dde642 --- /dev/null +++ b/exercises/basic/s3-runtime.json @@ -0,0 +1,1062 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:01", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:02", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:03", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:04", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:05", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:06", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:07", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:08", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:09", + "port": 9 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:10", + "port": 10 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:11", + "port": 11 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:12", + "port": 12 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:13", + "port": 13 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:14", + "port": 14 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:15", + "port": 15 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:16", + "port": 16 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 20 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 20 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/s4-runtime.json b/exercises/basic/s4-runtime.json new file mode 100644 index 00000000..e9114ce2 --- /dev/null +++ b/exercises/basic/s4-runtime.json @@ -0,0 +1,1062 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:01", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:02", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:03", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:04", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:05", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:06", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:07", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:08", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:09", + "port": 9 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:10", + "port": 10 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:11", + "port": 11 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:12", + "port": 12 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:13", + "port": 13 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:14", + "port": 14 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:15", + "port": 15 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:16", + "port": 16 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 20 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 20 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/s5-runtime.json b/exercises/basic/s5-runtime.json new file mode 100644 index 00000000..dad6a234 --- /dev/null +++ b/exercises/basic/s5-runtime.json @@ -0,0 +1,1062 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:01", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:02", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:03", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:04", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:05", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:06", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:07", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:08", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.17", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:09", + "port": 9 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.19", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:10", + "port": 10 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.21", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:11", + "port": 11 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.23", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:12", + "port": 12 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.25", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:13", + "port": 13 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.27", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:14", + "port": 14 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.29", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:15", + "port": 15 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.31", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:16", + "port": 16 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 20 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 20 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/s6-runtime.json b/exercises/basic/s6-runtime.json new file mode 100644 index 00000000..b3d4eed2 --- /dev/null +++ b/exercises/basic/s6-runtime.json @@ -0,0 +1,1062 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.1", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:01", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.3", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:02", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.5", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:03", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.7", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:04", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.9", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:05", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.11", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:06", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.13", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:07", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.15", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:08", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.17", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:09", + "port": 9 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.19", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:10", + "port": 10 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.21", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:11", + "port": 11 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.23", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:12", + "port": 12 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.25", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:13", + "port": 13 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.27", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:14", + "port": 14 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.29", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:15", + "port": 15 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.31", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:16", + "port": 16 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 20 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 20 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/s7-runtime.json b/exercises/basic/s7-runtime.json new file mode 100644 index 00000000..c3fc65c9 --- /dev/null +++ b/exercises/basic/s7-runtime.json @@ -0,0 +1,1062 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.1", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:01", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.3", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:02", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.5", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:03", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.7", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:04", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.9", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:05", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.11", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:06", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.13", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:07", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.15", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:08", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.17", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:09", + "port": 9 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.19", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:10", + "port": 10 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.21", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:11", + "port": 11 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.23", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:12", + "port": 12 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.25", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:13", + "port": 13 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.27", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:14", + "port": 14 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.29", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:15", + "port": 15 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.31", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:16", + "port": 16 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 20 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 20 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/s8-runtime.json b/exercises/basic/s8-runtime.json new file mode 100644 index 00000000..103cc24b --- /dev/null +++ b/exercises/basic/s8-runtime.json @@ -0,0 +1,1062 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.1", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:01", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.3", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:02", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.5", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:03", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.7", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:04", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.9", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:05", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.11", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:06", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.13", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:07", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.15", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:08", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.17", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:09", + "port": 9 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.19", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:10", + "port": 10 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.21", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:11", + "port": 11 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.23", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:12", + "port": 12 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.25", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:13", + "port": 13 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.27", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:14", + "port": 14 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.29", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:15", + "port": 15 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.31", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:16", + "port": 16 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 20 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 20 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/s9-runtime.json b/exercises/basic/s9-runtime.json new file mode 100644 index 00000000..2ae3464a --- /dev/null +++ b/exercises/basic/s9-runtime.json @@ -0,0 +1,1062 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.1", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:01", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.3", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:02", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.5", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:03", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.7", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:04", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.9", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:05", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.11", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:06", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.13", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:07", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.15", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:08", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.17", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:09", + "port": 9 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.19", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:10", + "port": 10 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.21", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:11", + "port": 11 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.23", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:12", + "port": 12 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.25", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:13", + "port": 13 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.27", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:14", + "port": 14 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.29", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:15", + "port": 15 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.31", 32] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:16", + "port": 16 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 17 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 18 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 19 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 20 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 20 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} \ No newline at end of file diff --git a/exercises/basic/send.py b/exercises/basic/send.py index 926562c0..dd7d65fc 100755 --- a/exercises/basic/send.py +++ b/exercises/basic/send.py @@ -1,39 +1,180 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only # Reason-GPL: import-scapy -import random + +import argparse import socket -import sys +from time import sleep +import random +import time # Added for time.time() if needed, though not directly used in the final UDP logic -from scapy.all import IP, TCP, Ether, get_if_hwaddr, get_if_list, sendp +from scapy.all import IP, TCP, UDP, Ether, Raw, get_if_hwaddr, get_if_list, sendp def get_if(): - ifs=get_if_list() - iface=None # "h1-eth0" + iface = None for i in get_if_list(): if "eth0" in i: - iface=i - break; + iface = i + break if not iface: print("Cannot find eth0 interface") exit(1) return iface + def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--p", help="Protocol name To send TCP/UDP etc packets", type=str, required=True) + parser.add_argument("--des", help="IP address of the destination", type=str, required=True) + parser.add_argument("--tos", help="Type of Service value for IP header (integer)", type=int, required=True) + parser.add_argument("--dur", help="Duration in seconds to send packets", type=str, required=True) # Kept as string for try-except int conversion + args = parser.parse_args() - if len(sys.argv)<3: - print('pass 2 arguments: ""') - exit(1) + duration_seconds = 0 + try: + duration_seconds = int(args.dur) + if duration_seconds <= 0: + print("Error: Duration must be a positive integer.") + return + except ValueError: + print("Error: Duration must be a valid integer.") + return - addr = socket.gethostbyname(sys.argv[1]) + addr = socket.gethostbyname(args.des) iface = get_if() - print("sending on interface %s to %s" % (iface, str(addr))) - pkt = Ether(src=get_if_hwaddr(iface), dst='ff:ff:ff:ff:ff:ff') - pkt = pkt /IP(dst=addr) / TCP(dport=1234, sport=random.randint(49152,65535)) / sys.argv[2] - pkt.show2() - sendp(pkt, iface=iface, verbose=False) + if args.p == 'UDP': + TARGET_TOTAL_PACKET_SIZE_BYTES = 128 # Define fixed total packet size + DEFAULT_PAYLOAD_CONTENT = "DefaultPayload" # Define a default payload + + print(f"Configuring for fixed UDP packet size: {TARGET_TOTAL_PACKET_SIZE_BYTES} bytes with ToS: {args.tos}.") + print(f"Using default payload content: '{DEFAULT_PAYLOAD_CONTENT}'") + + fixed_sport = random.randint(49152, 65535) + pkt_header = Ether(src=get_if_hwaddr(iface), dst="ff:ff:ff:ff:ff:ff") / \ + IP(dst=addr, tos=args.tos) / \ + UDP(dport=4321, sport=fixed_sport) + + header_actual_size = len(pkt_header) + desired_payload_size = TARGET_TOTAL_PACKET_SIZE_BYTES - header_actual_size + + if desired_payload_size < 0: + print(f"Error: Target packet size {TARGET_TOTAL_PACKET_SIZE_BYTES} bytes is too small " + f"for headers ({header_actual_size} bytes) and ToS field. Minimum target size: {header_actual_size + 1}.") + return + + default_payload_bytes = DEFAULT_PAYLOAD_CONTENT.encode('utf-8') + current_payload_len = len(default_payload_bytes) + + if current_payload_len < desired_payload_size: + padding = b'\x00' * (desired_payload_size - current_payload_len) + final_payload_bytes = default_payload_bytes + padding + print(f" Default payload (UTF-8 encoded: {current_payload_len} bytes) padded to {desired_payload_size} bytes.") + elif current_payload_len > desired_payload_size: + final_payload_bytes = default_payload_bytes[:desired_payload_size] + print(f" Default payload (UTF-8 encoded: {current_payload_len} bytes) truncated to {desired_payload_size} bytes.") + else: + final_payload_bytes = default_payload_bytes + print(f" Default payload (UTF-8 encoded: {current_payload_len} bytes) fits desired payload size {desired_payload_size} bytes exactly.") + + pkt_template = pkt_header / Raw(final_payload_bytes) + + packet_size_bytes = len(pkt_template) + + if packet_size_bytes != TARGET_TOTAL_PACKET_SIZE_BYTES: + print(f"Warning: Actual packet size {packet_size_bytes} does not match target {TARGET_TOTAL_PACKET_SIZE_BYTES}. Check logic.") + + packet_size_bits = packet_size_bytes * 8 + + target_rate_gbps = 0.1 # MODIFIED: Reduced target data rate + target_rate_bps = target_rate_gbps * 1e9 + + if packet_size_bits == 0: + print("Error: Packet size in bits is zero, cannot calculate packets per second.") + return + num_packets_per_second_ideal = target_rate_bps / packet_size_bits + interval_between_packets = 1.0 / num_packets_per_second_ideal + + estimated_total_packets = int(round(num_packets_per_second_ideal * duration_seconds)) + + if estimated_total_packets <= 0 and duration_seconds > 0: + print(f"Warning: With the current settings (rate: {target_rate_gbps} Gbps, packet size: {packet_size_bytes} bytes), " + f"the estimated number of packets for {duration_seconds}s is {estimated_total_packets}. " + f"This might result in very few or no packets being sent if the interval is too large.") + + print(f"Preparing to send UDP packets to {args.des} ({addr}) via {iface}:") + print(f" IP ToS value: {args.tos}.") + print(f" Targeting data rate: ~{target_rate_gbps} Gbps.") + print(f" Effective payload size (after padding/truncation of default content): {desired_payload_size} bytes.") + print(f" Total fixed packet size (on wire): {packet_size_bytes} bytes ({packet_size_bits} bits).") + print(f" Calculated ideal packets per second: {num_packets_per_second_ideal:.2f} PPS.") + print(f" Targeting inter-packet interval: {interval_between_packets:.9f} seconds.") + print(f" Estimated packets to send over {duration_seconds} seconds: {estimated_total_packets}.") + print(f" Packet structure summary:") + pkt_template.show2() + + print(f"\nStarting UDP transmission for {duration_seconds} seconds...") + + start_time = time.time() + end_time = start_time + duration_seconds + packets_sent_count = 0 + next_send_time = start_time + + try: + while time.time() < end_time: + current_loop_entry_time = time.time() + + wait_time = next_send_time - current_loop_entry_time + if wait_time > 0: + time.sleep(wait_time) + + if time.time() >= end_time: + break + + sendp(pkt_template, iface=iface, verbose=False) + packets_sent_count += 1 + + next_send_time += interval_between_packets + + except KeyboardInterrupt: + print("\nUDP transmission interrupted by user.") + except Exception as e: + print(f"An error occurred during UDP transmission: {e}") + finally: + actual_run_duration = time.time() - start_time + print(f"Finished UDP transmission.") + print(f" Target duration: {duration_seconds:.2f} seconds.") + print(f" Actual run duration: {actual_run_duration:.2f} seconds.") + print(f" Packets sent: {packets_sent_count}.") + if actual_run_duration > 0 and packets_sent_count > 0: + achieved_bps = (packets_sent_count * packet_size_bits) / actual_run_duration + achieved_gbps = achieved_bps / 1e9 + print(f" Achieved data rate: {achieved_gbps:.3f} Gbps ({achieved_bps / 1e6:.2f} Mbps).") + elif packets_sent_count == 0: + print(" No packets were sent.") + + elif args.p == 'TCP': + DEFAULT_TCP_PAYLOAD = "DefaultTCPPayload" + print(f"Configuring TCP packet with ToS: {args.tos} and default payload: '{DEFAULT_TCP_PAYLOAD}'.") + + pkt = Ether(src=get_if_hwaddr(iface), dst="ff:ff:ff:ff:ff:ff") / \ + IP(dst=addr, tos=args.tos) / \ + TCP() / \ + DEFAULT_TCP_PAYLOAD + pkt.show2() + try: + print(f"Starting TCP transmission for {duration_seconds} seconds (1 packet per second)...") + for i in range(duration_seconds): + sendp(pkt, iface=iface, verbose=False) + sleep(1) + print(f"Finished sending {duration_seconds} TCP packets.") + except KeyboardInterrupt: + print("\nTCP transmission interrupted by user.") + except Exception as e: + print(f"An error occurred during TCP transmission: {e}") + else: + print(f"Error: Protocol '{args.p}' not supported. Please use 'UDP' or 'TCP'.") if __name__ == '__main__': diff --git a/exercises/basic/solution/CT-tos.p4 b/exercises/basic/solution/CT-tos.p4 new file mode 100644 index 00000000..cba77e0c --- /dev/null +++ b/exercises/basic/solution/CT-tos.p4 @@ -0,0 +1,298 @@ +/* -*- P4_16 -*- */ +#include +#include + +const bit<16> TYPE_IPV4 = 0x800; + +/************************************************************************* +*********************** H E A D E R S *********************************** +*************************************************************************/ + +typedef bit<9> egressSpec_t; +typedef bit<48> macAddr_t; +typedef bit<32> ip4Addr_t; + +header ethernet_t { + macAddr_t dstAddr; + macAddr_t srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<8> tos; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + ip4Addr_t srcAddr; + ip4Addr_t dstAddr; +} + +// header tcp_t { +// bit<16> srcPort; +// bit<16> dstPort; +// bit<32> seqNo; +// bit<32> ackNo; +// bit<4> dataOffset; +// bit<3> res; +// bit<3> ecn; +// bit<6> ctrl; +// bit<16> window; +// bit<16> checksum; +// bit<16> urgentPtr; +// } + +struct metadata { + bit<32> rank; + // bit<32> queue_index; + // bit<32> tree_node_lower; + // bit<32> tree_node_upper; + // bit<32> left_child_lower; + // bit<32> left_child_upper; + // bit<32> right_child_lower; + // bit<32> right_child_upper; + bit<32> l1_t; + bit<32> l2_t; + bit<32> l3_t; + bit<32> t; + bit<32> cm; +} + +struct headers { + ethernet_t ethernet; + ipv4_t ipv4; +} + +/************************************************************************* +*********************** P A R S E R *********************************** +*************************************************************************/ + +parser MyParser(packet_in packet, + out headers hdr, + inout metadata meta, + inout standard_metadata_t standard_metadata) { + + state start { + transition parse_ethernet; + } + + state parse_ethernet { + packet.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + TYPE_IPV4: parse_ipv4; + default: accept; + } + } + + state parse_ipv4 { + packet.extract(hdr.ipv4); + transition accept; + } +} + +/************************************************************************* +************** I N G R E S S P R O C E S S I N G ******************* +*************************************************************************/ + +register>(7) cml_registers; // 7 entries for cml +register>(7) cmr_registers; // 7 entries for cmr + +control MyIngress(inout headers hdr, + inout metadata meta, + inout standard_metadata_t standard_metadata) { + + action drop() { + mark_to_drop(standard_metadata); + } + + action ipv4_forward(macAddr_t dstAddr, egressSpec_t port) { + standard_metadata.egress_spec = port; + hdr.ethernet.srcAddr = hdr.ethernet.dstAddr; + hdr.ethernet.dstAddr = dstAddr; + hdr.ipv4.ttl = hdr.ipv4.ttl - 1; + } + + action congruity_metric(bit<32> left_bound, bit<32> right_bound) { + meta.cm = (left_bound >> 1) + (left_bound >> 3) + (right_bound >> 2) + (right_bound >> 3); + } + + action threshold(bit<32> left_bound, bit<32> right_bound) { + meta.t = (left_bound >> 2) + (left_bound >> 3) + (right_bound >> 1) + (right_bound >> 3); + } + + table ipv4_lpm { + key = { + hdr.ipv4.dstAddr: lpm; + } + actions = { + ipv4_forward; + drop; + NoAction; + } + size = 1024; + default_action = NoAction(); + } + + apply { + if (hdr.ipv4.isValid()) { + meta.rank = (bit<32>)hdr.ipv4.tos << 4; + log_msg("Rank of the packet is: {}", {meta.rank}); + + bit<32> cml_val; + bit<32> cmr_val; + + cml_registers.read(cml_val, 0); + cmr_registers.read(cmr_val, 0); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cml_registers.read(cml_val, 2); + cmr_registers.read(cmr_val, 2); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cml_registers.read(cml_val, 6); + cmr_registers.read(cmr_val, 6); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cmr_registers.write(6, meta.rank); + standard_metadata.priority = 0; + } else { + cml_registers.write(6, meta.rank); + standard_metadata.priority = 1; + } + cml_registers.read(cml_val, 6); + cmr_registers.read(cmr_val, 6); + congruity_metric(cml_val, cmr_val); + cmr_registers.write(2, meta.cm); + } else { + cml_registers.read(cml_val, 5); + cmr_registers.read(cmr_val, 5); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cmr_registers.write(5, meta.rank); + standard_metadata.priority = 2; + } else { + cml_registers.write(5, meta.rank); + standard_metadata.priority = 3; + } + cml_registers.read(cml_val, 5); + cmr_registers.read(cmr_val, 5); + congruity_metric(cml_val, cmr_val); + cml_registers.write(2, meta.cm); + } + cml_registers.read(cml_val, 2); + cmr_registers.read(cmr_val, 2); + congruity_metric(cml_val, cmr_val); + cml_registers.write(0, meta.cm); + } else { + cml_registers.read(cml_val, 1); + cmr_registers.read(cmr_val, 1); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cml_registers.read(cml_val, 4); + cmr_registers.read(cmr_val, 4); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cmr_registers.write(4, meta.rank); + standard_metadata.priority = 4; + } else { + cml_registers.write(4, meta.rank); + standard_metadata.priority = 5; + } + cml_registers.read(cml_val, 4); + cmr_registers.read(cmr_val, 4); + congruity_metric(cml_val, cmr_val); + cmr_registers.write(1, meta.cm); + } else { + cml_registers.read(cml_val, 3); + cmr_registers.read(cmr_val, 3); + threshold(cml_val, cmr_val); + if (meta.rank > meta.t) { + cmr_registers.write(3, meta.rank); + standard_metadata.priority = 6; + } else { + cml_registers.write(3, meta.rank); + standard_metadata.priority = 7; + } + cml_registers.read(cml_val, 3); + cmr_registers.read(cmr_val, 3); + congruity_metric(cml_val, cmr_val); + cml_registers.write(1, meta.cm); + } + cml_registers.read(cml_val, 1); + cmr_registers.read(cmr_val, 1); + congruity_metric(cml_val, cmr_val); + cml_registers.write(0, meta.cm); + } + + ipv4_lpm.apply(); + } + } +} + +/************************************************************************* +**************** E G R E S S P R O C E S S I N G ******************* +*************************************************************************/ + +control MyEgress(inout headers hdr, + inout metadata meta, + inout standard_metadata_t standard_metadata) { + apply { } +} + +/************************************************************************* +************* C H E C K S U M C O M P U T A T I O N ************** +*************************************************************************/ + +control MyVerifyChecksum(inout headers hdr, inout metadata meta) { + apply { } +} + +control MyComputeChecksum(inout headers hdr, inout metadata meta) { + apply { + update_checksum( + hdr.ipv4.isValid(), + { hdr.ipv4.version, + hdr.ipv4.ihl, + hdr.ipv4.tos, + hdr.ipv4.totalLen, + hdr.ipv4.identification, + hdr.ipv4.flags, + hdr.ipv4.fragOffset, + hdr.ipv4.ttl, + hdr.ipv4.protocol, + hdr.ipv4.srcAddr, + hdr.ipv4.dstAddr }, + hdr.ipv4.hdrChecksum, + HashAlgorithm.csum16); + } +} + +/************************************************************************* +*********************** D E P A R S E R ******************************* +*************************************************************************/ + +control MyDeparser(packet_out packet, in headers hdr) { + apply { + packet.emit(hdr.ethernet); + packet.emit(hdr.ipv4); + // packet.emit(hdr.tcp); + } +} + +/************************************************************************* +*********************** S W I T C H ******************************* +*************************************************************************/ + +V1Switch( +MyParser(), +MyVerifyChecksum(), +MyIngress(), +MyEgress(), +MyComputeChecksum(), +MyDeparser() +) main; \ No newline at end of file diff --git a/exercises/basic/solution/SP_tos.p4 b/exercises/basic/solution/SP_tos.p4 new file mode 100644 index 00000000..01e78c26 --- /dev/null +++ b/exercises/basic/solution/SP_tos.p4 @@ -0,0 +1,283 @@ +/* -*- P4_16 -*- */ +#include +#include + +const bit<16> TYPE_IPV4 = 0x800; + +/************************************************************************* +*********************** H E A D E R S *********************************** +*************************************************************************/ + +typedef bit<9> egressSpec_t; +typedef bit<48> macAddr_t; +typedef bit<32> ip4Addr_t; + +header ethernet_t { + macAddr_t dstAddr; + macAddr_t srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<8> tos; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + ip4Addr_t srcAddr; + ip4Addr_t dstAddr; +} + +header tcp_t { + bit<16> srcPort; + bit<16> dstPort; + bit<32> seqNo; + bit<32> ackNo; + bit<4> dataOffset; + bit<3> res; + bit<3> ecn; + bit<6> ctrl; + bit<16> window; + bit<16> checksum; + bit<16> urgentPtr; +} + + +struct metadata { + bit<32> current_queue_bound; + bit<32> rank; + // bit<32> flow_id; // Added to store flow ID + // bit<32> flow_size; // Added to store flow size +} + +struct headers { + ethernet_t ethernet; + ipv4_t ipv4; + tcp_t tcp; +} + +/************************************************************************* +*********************** P A R S E R *********************************** +*************************************************************************/ + +parser MyParser(packet_in packet, + out headers hdr, + inout metadata meta, + inout standard_metadata_t standard_metadata) { + + state start { + transition parse_ethernet; + } + + state parse_ethernet { + packet.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + TYPE_IPV4: parse_ipv4; + default: accept; + } + } + + state parse_ipv4 { + packet.extract(hdr.ipv4); + transition select(hdr.ipv4.protocol) { + 0x06: parse_tcp; + default: accept; + } + } + + state parse_tcp { + packet.extract(hdr.tcp); + transition accept; + } + +} + +/************************************************************************* +************ C H E C K S U M V E R I F I C A T I O N ************* +*************************************************************************/ + +control MyVerifyChecksum(inout headers hdr, inout metadata meta) { + apply { } +} + + +/************************************************************************* +************** I N G R E S S P R O C E S S I N G ******************* +*************************************************************************/ + +control MyIngress(inout headers hdr, + inout metadata meta, + inout standard_metadata_t standard_metadata) { + + /*Queue with index 0 is the bottom one, with lowest priority*/ + register>(8) queue_bound; + bit<48> in_flow_id = 0; + bit<32> in_flow_size = 0; + + action drop() { + mark_to_drop(standard_metadata); + } + + action ipv4_forward(macAddr_t dstAddr, egressSpec_t port) { + standard_metadata.egress_spec = port; + hdr.ethernet.srcAddr = hdr.ethernet.dstAddr; + hdr.ethernet.dstAddr = dstAddr; + hdr.ipv4.ttl = hdr.ipv4.ttl - 1; + } + + table ipv4_lpm { + key = { + hdr.ipv4.dstAddr: lpm; + } + actions = { + ipv4_forward; + drop; + NoAction; + } + size = 1024; + default_action = NoAction(); + } + + apply { + + if (hdr.ipv4.isValid()) { + + meta.rank = (bit<32>)hdr.ipv4.tos; + + queue_bound.read(meta.current_queue_bound, 0); + if ((meta.current_queue_bound <= meta.rank)) { + standard_metadata.priority = (bit<3>)0; + queue_bound.write(0, meta.rank); + } else { + queue_bound.read(meta.current_queue_bound, 1); + if ((meta.current_queue_bound <= meta.rank)) { + standard_metadata.priority = (bit<3>)1; + queue_bound.write(1, meta.rank); + } else { + queue_bound.read(meta.current_queue_bound, 2); + if ((meta.current_queue_bound <= meta.rank)) { + standard_metadata.priority = (bit<3>)2; + queue_bound.write(2, meta.rank); + } else { + queue_bound.read(meta.current_queue_bound, 3); + if ((meta.current_queue_bound <= meta.rank)) { + standard_metadata.priority = (bit<3>)3; + queue_bound.write(3, meta.rank); + } else { + queue_bound.read(meta.current_queue_bound, 4); + if ((meta.current_queue_bound <= meta.rank)) { + standard_metadata.priority = (bit<3>)4; + queue_bound.write(4, meta.rank); + } else { + queue_bound.read(meta.current_queue_bound, 5); + if ((meta.current_queue_bound <= meta.rank)) { + standard_metadata.priority = (bit<3>)5; + queue_bound.write(5, meta.rank); + } else { + queue_bound.read(meta.current_queue_bound, 6); + if ((meta.current_queue_bound <= meta.rank)) { + standard_metadata.priority = (bit<3>)6; + queue_bound.write(6, meta.rank); + } else { + standard_metadata.priority = (bit<3>)7; + queue_bound.read(meta.current_queue_bound, 7); + + /*Blocking reaction*/ + if(meta.current_queue_bound > meta.rank) { + bit<32> cost = meta.current_queue_bound - meta.rank; + + /*Decrease the bound of all the following queues a factor equal to the cost of the blocking*/ + queue_bound.read(meta.current_queue_bound, 0); + queue_bound.write(0, (bit<32>)(meta.current_queue_bound-cost)); + queue_bound.read(meta.current_queue_bound, 1); + queue_bound.write(1, (bit<32>)(meta.current_queue_bound-cost)); + queue_bound.read(meta.current_queue_bound, 2); + queue_bound.write(2, (bit<32>)(meta.current_queue_bound-cost)); + queue_bound.read(meta.current_queue_bound, 3); + queue_bound.write(3, (bit<32>)(meta.current_queue_bound-cost)); + queue_bound.read(meta.current_queue_bound, 4); + queue_bound.write(4, (bit<32>)(meta.current_queue_bound-cost)); + queue_bound.read(meta.current_queue_bound, 5); + queue_bound.write(5, (bit<32>)(meta.current_queue_bound-cost)); + queue_bound.read(meta.current_queue_bound, 6); + queue_bound.write(6, (bit<32>)(meta.current_queue_bound-cost)); + queue_bound.write(7, meta.rank); + } else { + queue_bound.write(7, meta.rank); + } + } + } + } + } + } + } + } + ipv4_lpm.apply(); + } + } +} + +/************************************************************************* +**************** E G R E S S P R O C E S S I N G ******************* +*************************************************************************/ + +control MyEgress(inout headers hdr, + inout metadata meta, + inout standard_metadata_t standard_metadata) { + apply { + } +} + +/************************************************************************* +************* C H E C K S U M C O M P U T A T I O N ************** +*************************************************************************/ + +control MyComputeChecksum(inout headers hdr, inout metadata meta) { + apply { + update_checksum( + hdr.ipv4.isValid(), + { hdr.ipv4.version, + hdr.ipv4.ihl, + hdr.ipv4.tos, + hdr.ipv4.totalLen, + hdr.ipv4.identification, + hdr.ipv4.flags, + hdr.ipv4.fragOffset, + hdr.ipv4.ttl, + hdr.ipv4.protocol, + hdr.ipv4.srcAddr, + hdr.ipv4.dstAddr }, + hdr.ipv4.hdrChecksum, + HashAlgorithm.csum16); + } +} + +/************************************************************************* +*********************** D E P A R S E R ******************************* +*************************************************************************/ + +control MyDeparser(packet_out packet, in headers hdr) { + apply { + packet.emit(hdr.ethernet); + packet.emit(hdr.ipv4); + packet.emit(hdr.tcp); + } +} + +/************************************************************************* +*********************** S W I T C H ******************************* +*************************************************************************/ + +V1Switch( +MyParser(), +MyVerifyChecksum(), +MyIngress(), +MyEgress(), +MyComputeChecksum(), +MyDeparser() +) main; \ No newline at end of file diff --git a/exercises/basic/solution/basic.p4 b/exercises/basic/solution/basic.p4 index 9640dcfd..7c852f67 100644 --- a/exercises/basic/solution/basic.p4 +++ b/exercises/basic/solution/basic.p4 @@ -1,4 +1,3 @@ -// SPDX-License-Identifier: Apache-2.0 /* -*- P4_16 -*- */ #include #include @@ -22,7 +21,7 @@ header ethernet_t { header ipv4_t { bit<4> version; bit<4> ihl; - bit<8> diffserv; + bit<8> tos; bit<16> totalLen; bit<16> identification; bit<3> flags; @@ -34,13 +33,41 @@ header ipv4_t { ip4Addr_t dstAddr; } +header tcp_t { + bit<16> srcPort; + bit<16> dstPort; + bit<32> seqNo; + bit<32> ackNo; + bit<4> dataOffset; + bit<3> res; + bit<3> ecn; + bit<6> ctrl; + bit<16> window; + bit<16> checksum; + bit<16> urgentPtr; +} + struct metadata { - /* empty */ + bit<32> rank; + bit<32> queue_index; + bit<32> tree_node_lower; + bit<32> tree_node_upper; + bit<32> left_child_lower; + bit<32> left_child_upper; + bit<32> right_child_lower; + bit<32> right_child_upper; + bit<32> avg_bound; + bit<32> level1_avg; + bit<32> level2_avg; + bit<32> level3_avg; + bit<32> avg_left; + bit<32> avg_right; } struct headers { ethernet_t ethernet; ipv4_t ipv4; + tcp_t tcp; } /************************************************************************* @@ -66,20 +93,18 @@ parser MyParser(packet_in packet, state parse_ipv4 { packet.extract(hdr.ipv4); - transition accept; + transition select(hdr.ipv4.protocol) { + 0x06: parse_tcp; + default: accept; + } } + state parse_tcp { + packet.extract(hdr.tcp); + transition accept; + } } -/************************************************************************* -************ C H E C K S U M V E R I F I C A T I O N ************* -*************************************************************************/ - -control MyVerifyChecksum(inout headers hdr, inout metadata meta) { - apply { } -} - - /************************************************************************* ************** I N G R E S S P R O C E S S I N G ******************* *************************************************************************/ @@ -87,10 +112,12 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) { control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { + + action drop() { mark_to_drop(standard_metadata); } - + action ipv4_forward(macAddr_t dstAddr, egressSpec_t port) { standard_metadata.egress_spec = port; hdr.ethernet.srcAddr = hdr.ethernet.dstAddr; @@ -108,11 +135,29 @@ control MyIngress(inout headers hdr, NoAction; } size = 1024; - default_action = drop(); + default_action = NoAction(); } - + apply { + + // meta.rank = (bit<32>) hdr.ipv4.tos; + if (hdr.ipv4.isValid()) { + // if (meta.rank == 8) { + // standard_metadata.priority = (bit<3>)0; + // } + // else if (meta.rank == 4) { + // standard_metadata.priority = (bit<3>)0; + // } + // else if (meta.rank == 2) { + // standard_metadata.priority = (bit<3>)0; + // } + // else if (meta.rank == 0) { + // standard_metadata.priority = (bit<3>)0; + // } + + // // standard_metadata.priority = (bit<3>)0; + ipv4_lpm.apply(); } } @@ -125,20 +170,24 @@ control MyIngress(inout headers hdr, control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { - apply { } + apply { } } /************************************************************************* ************* C H E C K S U M C O M P U T A T I O N ************** *************************************************************************/ -control MyComputeChecksum(inout headers hdr, inout metadata meta) { +control MyVerifyChecksum(inout headers hdr, inout metadata meta) { + apply { } +} + +control MyComputeChecksum(inout headers hdr, inout metadata meta) { apply { update_checksum( - hdr.ipv4.isValid(), + hdr.ipv4.isValid(), { hdr.ipv4.version, hdr.ipv4.ihl, - hdr.ipv4.diffserv, + hdr.ipv4.tos, hdr.ipv4.totalLen, hdr.ipv4.identification, hdr.ipv4.flags, @@ -160,6 +209,7 @@ control MyDeparser(packet_out packet, in headers hdr) { apply { packet.emit(hdr.ethernet); packet.emit(hdr.ipv4); + packet.emit(hdr.tcp); } } @@ -174,4 +224,4 @@ MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser() -) main; +) main; \ No newline at end of file diff --git a/exercises/basic/ss1-runtime.json b/exercises/basic/ss1-runtime.json new file mode 100644 index 00000000..1097c4fb --- /dev/null +++ b/exercises/basic/ss1-runtime.json @@ -0,0 +1,897 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 9 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/ss2-runtime.json b/exercises/basic/ss2-runtime.json new file mode 100644 index 00000000..1097c4fb --- /dev/null +++ b/exercises/basic/ss2-runtime.json @@ -0,0 +1,897 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 9 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/ss3-runtime.json b/exercises/basic/ss3-runtime.json new file mode 100644 index 00000000..1097c4fb --- /dev/null +++ b/exercises/basic/ss3-runtime.json @@ -0,0 +1,897 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 9 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/ss4-runtime.json b/exercises/basic/ss4-runtime.json new file mode 100644 index 00000000..1097c4fb --- /dev/null +++ b/exercises/basic/ss4-runtime.json @@ -0,0 +1,897 @@ +{ "target": "bmv2", + "p4info": "build/basic.p4.p4info.txtpb", + "bmv2_json": "build/basic.json", + "table_entries": [ + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.1.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.2.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.3.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:00", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.4.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:04:00", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.5.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:00", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.6.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:00", + "port": 6 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.7.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:00", + "port": 7 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.8.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:00", + "port": 8 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": ["10.0.9.0", 24] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:09:00", + "port": 9 + } + }, + { + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 1, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 2, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 3, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 4, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 5, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 6, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 7, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 8, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 9, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 10, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 11, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 12, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 13, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 14, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 15, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 16, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 17, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 18, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 19, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 20, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 21, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 22, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 23, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 24, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 25, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 26, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.27", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 27, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 28, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 29, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 30, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 31, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 32, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 33, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 34, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 35, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 36, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 37, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.21", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 38, + "flow_size": 13000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 39, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 40, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.13", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 41, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 42, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 43, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 44, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 45, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 46, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 47, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.5", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 48, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.31", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 49, + "flow_size": 20000000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 50, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 51, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 52, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 53, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 54, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 55, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.2.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 56, + "flow_size": 6000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 57, + "flow_size": 1333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 58, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 59, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 60, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.25", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 61, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.23", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 62, + "flow_size": 667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.17", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 63, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.5.7", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 64, + "flow_size": 53000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.3", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 65, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 66, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.29", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 67, + "flow_size": 19000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.19", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 68, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.3.1", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 69, + "flow_size": 133000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.9", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 70, + "flow_size": 3333000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.1.11", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 71, + "flow_size": 6667000 + } + } + ,{ + "table": "MyIngress.lookup_flow_id", + "match": { + "hdr.ipv4.srcAddr": ["10.0.4.15", 32] + }, + "action_name": "MyIngress.assign_flow_id", + "action_params": { + "flow_id": 72, + "flow_size": 667000 + } + } + ] +} diff --git a/exercises/basic/throughput_data.csv b/exercises/basic/throughput_data.csv new file mode 100644 index 00000000..eb9f0df2 --- /dev/null +++ b/exercises/basic/throughput_data.csv @@ -0,0 +1,73 @@ +flow_id,source_id,dest_id,source_ip,dest_ip,throughput_mbps,flow_size_bytes,expected_flow_size,duration +39,14,616,10.0.1.7,10.0.6.31,2.4,133120.0,133000,0.4436 +32,410,92,10.0.4.19,10.0.9.3,3.0,53043.2,53000,0.1415 +8,47,78,10.0.4.13,10.0.7.15,3.78,53043.2,53000,0.1122 +67,315,82,10.0.3.29,10.0.8.3,4.21,19046.4,19000,0.0361 +5,21,615,10.0.2.1,10.0.6.29,6.3,6000.64,6000,0.0076 +30,51,65,10.0.5.1,10.0.6.9,7.12,1331691.52,1333000,1.4982 +48,53,73,10.0.5.5,10.0.7.5,24.9,6000.64,6000,0.0019 +56,22,514,10.0.2.3,10.0.5.27,9.01,6000.64,6000,0.0053 +52,29,87,10.0.2.17,10.0.8.13,10.9,6000.64,6000,0.0044 +42,313,612,10.0.3.25,10.0.6.23,3.45,53043.2,53000,0.1229 +50,58,71,10.0.5.15,10.0.7.1,4.46,3334471.68,3333000,5.9757 +11,18,913,10.0.1.15,10.0.9.25,7.52,13004.8,13000,0.0138 +53,55,62,10.0.5.9,10.0.6.3,8.86,1331691.52,1333000,1.2041 +36,27,513,10.0.2.13,10.0.5.25,5.44,1331691.52,1333000,1.9595 +54,26,88,10.0.2.11,10.0.8.15,4.81,133120.0,133000,0.221 +61,413,66,10.0.4.25,10.0.6.11,5.16,133120.0,133000,0.2063 +6,314,59,10.0.3.27,10.0.5.17,3.9,133120.0,133000,0.2732 +38,411,67,10.0.4.21,10.0.6.13,12.9,13004.8,13000,0.0081 +41,57,72,10.0.5.13,10.0.7.3,2.29,133120.0,133000,0.4637 +47,56,61,10.0.5.11,10.0.6.1,13.8,3334471.68,3333000,1.9282 +58,49,68,10.0.4.17,10.0.6.15,5.38,133120.0,133000,0.1977 +62,112,912,10.0.1.23,10.0.9.23,6.35,666624.0,667000,0.8398 +25,37,510,10.0.3.13,10.0.5.19,4.43,133120.0,133000,0.2404 +14,52,64,10.0.5.3,10.0.6.7,11.1,6000.64,6000,0.0043 +16,45,79,10.0.4.9,10.0.7.17,3.21,19046.4,19000,0.0474 +13,115,811,10.0.1.29,10.0.8.21,24.9,13004.8,13000,0.0042 +26,311,95,10.0.3.21,10.0.9.9,1.51,19046.4,19000,0.1006 +3,111,814,10.0.1.21,10.0.8.27,36.9,6000.64,6000,0.0013 +70,15,915,10.0.1.9,10.0.9.29,6.26,3334471.68,3333000,4.258 +20,215,85,10.0.2.29,10.0.8.9,2.3,19046.4,19000,0.0662 +27,114,812,10.0.1.27,10.0.8.23,2.15,133120.0,133000,0.4956 +44,42,94,10.0.4.3,10.0.9.7,18.1,6000.64,6000,0.0027 +46,210,614,10.0.2.19,10.0.6.27,10.7,1331691.52,1333000,0.999 +64,54,63,10.0.5.7,10.0.6.5,2.45,53043.2,53000,0.1734 +4,24,911,10.0.2.7,10.0.9.21,6.28,6000.64,6000,0.0076 +57,44,81,10.0.4.7,10.0.8.1,7.94,1331691.52,1333000,1.3423 +43,310,710,10.0.3.19,10.0.7.19,3.49,133120.0,133000,0.305 +34,17,914,10.0.1.13,10.0.9.27,3.66,133120.0,133000,0.2906 +65,12,516,10.0.1.3,10.0.5.31,2.91,133120.0,133000,0.3652 +63,19,716,10.0.1.17,10.0.7.31,6.23,3334471.68,3333000,4.2813 +2,116,810,10.0.1.31,10.0.8.19,3.91,666624.0,667000,1.3645 +1,416,74,10.0.4.31,10.0.7.7,5.83,666624.0,667000,0.9159 +49,216,712,10.0.2.31,10.0.7.23,25.5,20027801.6,20000000,6.2654 +31,36,96,10.0.3.11,10.0.9.11,3.82,666624.0,667000,1.3979 +18,214,713,10.0.2.27,10.0.7.25,4.33,133120.0,133000,0.2455 +22,34,98,10.0.3.7,10.0.9.15,5.25,666624.0,667000,1.0161 +68,110,815,10.0.1.19,10.0.8.29,16.4,6668943.36,6667000,3.2469 +23,213,910,10.0.2.25,10.0.9.19,15.8,13004.8,13000,0.0066 +17,43,69,10.0.4.5,10.0.6.17,6.85,666624.0,667000,0.7795 +40,38,84,10.0.3.15,10.0.8.7,23.5,6668943.36,6667000,2.266 +10,41,610,10.0.4.1,10.0.6.19,6.91,19046.4,19000,0.022 +24,23,89,10.0.2.5,10.0.8.17,6.45,6000.64,6000,0.0074 +28,412,91,10.0.4.23,10.0.9.1,2.69,19046.4,19000,0.0565 +60,46,93,10.0.4.11,10.0.9.5,16.1,3334471.68,3333000,1.6587 +66,11,916,10.0.1.1,10.0.9.31,12.2,6668943.36,6667000,4.3764 +69,31,99,10.0.3.1,10.0.9.17,3.32,133120.0,133000,0.3205 +7,13,816,10.0.1.5,10.0.8.31,10.9,6000.64,6000,0.0044 +9,414,76,10.0.4.27,10.0.7.11,6.19,3334471.68,3333000,4.306 +12,32,711,10.0.3.3,10.0.7.21,8.09,3334471.68,3333000,3.2944 +37,316,611,10.0.3.31,10.0.6.21,7.68,1331691.52,1333000,1.3881 +51,113,813,10.0.1.25,10.0.8.25,4.91,1331691.52,1333000,2.1732 +72,48,77,10.0.4.15,10.0.7.13,5.93,666624.0,667000,0.9002 +71,16,515,10.0.1.11,10.0.5.29,9.21,6668943.36,6667000,5.7891 +21,33,511,10.0.3.5,10.0.5.21,26.6,20027801.6,20000000,6.0223 +15,211,86,10.0.2.21,10.0.8.11,3.26,53043.2,53000,0.1301 +33,415,75,10.0.4.29,10.0.7.9,3.45,133120.0,133000,0.3087 +45,28,714,10.0.2.15,10.0.7.27,4.65,133120.0,133000,0.2288 +59,39,613,10.0.3.17,10.0.6.25,3.8,19046.4,19000,0.04 +55,312,83,10.0.3.23,10.0.8.5,5.58,53043.2,53000,0.076 +35,212,512,10.0.2.23,10.0.5.23,10.2,6000.64,6000,0.0047 +19,35,97,10.0.3.9,10.0.9.13,1.85,53043.2,53000,0.2297 +29,25,715,10.0.2.9,10.0.7.29,12.3,6668943.36,6667000,4.3429 diff --git a/exercises/basic/throughput_vs_time.png b/exercises/basic/throughput_vs_time.png new file mode 100644 index 00000000..5bd321be Binary files /dev/null and b/exercises/basic/throughput_vs_time.png differ diff --git a/exercises/basic/topology.json b/exercises/basic/topology.json new file mode 100644 index 00000000..67aba821 --- /dev/null +++ b/exercises/basic/topology.json @@ -0,0 +1,462 @@ +{ + "hosts":{ + "h11": {"ip": "10.0.1.1/31", "mac": "08:00:00:00:01:01", + "commands":["route add default gw 10.0.1.0 dev eth0", + "arp -i eth0 -s 10.0.1.0 08:00:00:00:01:FE"]}, + "h12": {"ip": "10.0.1.3/31", "mac": "08:00:00:00:01:02", + "commands":["route add default gw 10.0.1.2 dev eth0", + "arp -i eth0 -s 10.0.1.2 08:00:00:00:01:FE"]}, + "h13": {"ip": "10.0.1.5/31", "mac": "08:00:00:00:01:03", + "commands":["route add default gw 10.0.1.4 dev eth0", + "arp -i eth0 -s 10.0.1.4 08:00:00:00:01:FE"]}, + "h14": {"ip": "10.0.1.7/31", "mac": "08:00:00:00:01:04", + "commands":["route add default gw 10.0.1.6 dev eth0", + "arp -i eth0 -s 10.0.1.6 08:00:00:00:01:FE"]}, + "h15": {"ip": "10.0.1.9/31", "mac": "08:00:00:00:01:05", + "commands":["route add default gw 10.0.1.8 dev eth0", + "arp -i eth0 -s 10.0.1.8 08:00:00:00:01:FE"]}, + "h16": {"ip": "10.0.1.11/31", "mac": "08:00:00:00:01:06", + "commands":["route add default gw 10.0.1.10 dev eth0", + "arp -i eth0 -s 10.0.1.10 08:00:00:00:01:FE"]}, + "h17": {"ip": "10.0.1.13/31", "mac": "08:00:00:00:01:07", + "commands":["route add default gw 10.0.1.12 dev eth0", + "arp -i eth0 -s 10.0.1.12 08:00:00:00:01:FE"]}, + "h18": {"ip": "10.0.1.15/31", "mac": "08:00:00:00:01:08", + "commands":["route add default gw 10.0.1.14 dev eth0", + "arp -i eth0 -s 10.0.1.14 08:00:00:00:01:FE"]}, + "h19": {"ip": "10.0.1.17/31", "mac": "08:00:00:00:01:09", + "commands":["route add default gw 10.0.1.16 dev eth0", + "arp -i eth0 -s 10.0.1.16 08:00:00:00:01:FE"]}, + "h110": {"ip": "10.0.1.19/31", "mac": "08:00:00:00:01:10", + "commands":["route add default gw 10.0.1.18 dev eth0", + "arp -i eth0 -s 10.0.1.18 08:00:00:00:01:FE"]}, + "h111": {"ip": "10.0.1.21/31", "mac": "08:00:00:00:01:11", + "commands":["route add default gw 10.0.1.20 dev eth0", + "arp -i eth0 -s 10.0.1.20 08:00:00:00:01:FE"]}, + "h112": {"ip": "10.0.1.23/31", "mac": "08:00:00:00:01:12", + "commands":["route add default gw 10.0.1.22 dev eth0", + "arp -i eth0 -s 10.0.1.22 08:00:00:00:01:FE"]}, + "h113": {"ip": "10.0.1.25/31", "mac": "08:00:00:00:01:13", + "commands":["route add default gw 10.0.1.24 dev eth0", + "arp -i eth0 -s 10.0.1.24 08:00:00:00:01:FE"]}, + "h114": {"ip": "10.0.1.27/31", "mac": "08:00:00:00:01:14", + "commands":["route add default gw 10.0.1.26 dev eth0", + "arp -i eth0 -s 10.0.1.26 08:00:00:00:01:FE"]}, + "h115": {"ip": "10.0.1.29/31", "mac": "08:00:00:00:01:15", + "commands":["route add default gw 10.0.1.28 dev eth0", + "arp -i eth0 -s 10.0.1.28 08:00:00:00:01:FE"]}, + "h116": {"ip": "10.0.1.31/31", "mac": "08:00:00:00:01:16", + "commands":["route add default gw 10.0.1.30 dev eth0", + "arp -i eth0 -s 10.0.1.30 08:00:00:00:01:FE"]}, + "h21": {"ip": "10.0.2.1/31", "mac": "08:00:00:00:02:01", + "commands":["route add default gw 10.0.2.0 dev eth0", + "arp -i eth0 -s 10.0.2.0 08:00:00:00:02:FE"]}, + "h22": {"ip": "10.0.2.3/31", "mac": "08:00:00:00:02:02", + "commands":["route add default gw 10.0.2.2 dev eth0", + "arp -i eth0 -s 10.0.2.2 08:00:00:00:02:FE"]}, + "h23": {"ip": "10.0.2.5/31", "mac": "08:00:00:00:02:03", + "commands":["route add default gw 10.0.2.4 dev eth0", + "arp -i eth0 -s 10.0.2.4 08:00:00:00:02:FE"]}, + "h24": {"ip": "10.0.2.7/31", "mac": "08:00:00:00:02:04", + "commands":["route add default gw 10.0.2.6 dev eth0", + "arp -i eth0 -s 10.0.2.6 08:00:00:00:02:FE"]}, + "h25": {"ip": "10.0.2.9/31", "mac": "08:00:00:00:02:05", + "commands":["route add default gw 10.0.2.8 dev eth0", + "arp -i eth0 -s 10.0.2.8 08:00:00:00:02:FE"]}, + "h26": {"ip": "10.0.2.11/31", "mac": "08:00:00:00:02:06", + "commands":["route add default gw 10.0.2.10 dev eth0", + "arp -i eth0 -s 10.0.2.10 08:00:00:00:02:FE"]}, + "h27": {"ip": "10.0.2.13/31", "mac": "08:00:00:00:02:07", + "commands":["route add default gw 10.0.2.12 dev eth0", + "arp -i eth0 -s 10.0.2.12 08:00:00:00:02:FE"]}, + "h28": {"ip": "10.0.2.15/31", "mac": "08:00:00:00:02:08", + "commands":["route add default gw 10.0.2.14 dev eth0", + "arp -i eth0 -s 10.0.2.14 08:00:00:00:02:FE"]}, + "h29": {"ip": "10.0.2.17/31", "mac": "08:00:00:00:02:09", + "commands":["route add default gw 10.0.2.16 dev eth0", + "arp -i eth0 -s 10.0.2.16 08:00:00:00:02:FE"]}, + "h210": {"ip": "10.0.2.19/31", "mac": "08:00:00:00:02:10", + "commands":["route add default gw 10.0.2.18 dev eth0", + "arp -i eth0 -s 10.0.2.18 08:00:00:00:02:FE"]}, + "h211": {"ip": "10.0.2.21/31", "mac": "08:00:00:00:02:11", + "commands":["route add default gw 10.0.2.20 dev eth0", + "arp -i eth0 -s 10.0.2.20 08:00:00:00:02:FE"]}, + "h212": {"ip": "10.0.2.23/31", "mac": "08:00:00:00:02:12", + "commands":["route add default gw 10.0.2.22 dev eth0", + "arp -i eth0 -s 10.0.2.22 08:00:00:00:02:FE"]}, + "h213": {"ip": "10.0.2.25/31", "mac": "08:00:00:00:02:13", + "commands":["route add default gw 10.0.2.24 dev eth0", + "arp -i eth0 -s 10.0.2.24 08:00:00:00:02:FE"]}, + "h214": {"ip": "10.0.2.27/31", "mac": "08:00:00:00:02:14", + "commands":["route add default gw 10.0.2.26 dev eth0", + "arp -i eth0 -s 10.0.2.26 08:00:00:00:02:FE"]}, + "h215": {"ip": "10.0.2.29/31", "mac": "08:00:00:00:02:15", + "commands":["route add default gw 10.0.2.28 dev eth0", + "arp -i eth0 -s 10.0.2.28 08:00:00:00:02:FE"]}, + "h216": {"ip": "10.0.2.31/31", "mac": "08:00:00:00:02:16", + "commands":["route add default gw 10.0.2.30 dev eth0", + "arp -i eth0 -s 10.0.2.30 08:00:00:00:02:FE"]}, + "h31": {"ip": "10.0.3.1/31", "mac": "08:00:00:00:03:01", + "commands":["route add default gw 10.0.3.0 dev eth0", + "arp -i eth0 -s 10.0.3.0 08:00:00:00:03:FE"]}, + "h32": {"ip": "10.0.3.3/31", "mac": "08:00:00:00:03:02", + "commands":["route add default gw 10.0.3.2 dev eth0", + "arp -i eth0 -s 10.0.3.2 08:00:00:00:03:FE"]}, + "h33": {"ip": "10.0.3.5/31", "mac": "08:00:00:00:03:03", + "commands":["route add default gw 10.0.3.4 dev eth0", + "arp -i eth0 -s 10.0.3.4 08:00:00:00:03:FE"]}, + "h34": {"ip": "10.0.3.7/31", "mac": "08:00:00:00:03:04", + "commands":["route add default gw 10.0.3.6 dev eth0", + "arp -i eth0 -s 10.0.3.6 08:00:00:00:03:FE"]}, + "h35": {"ip": "10.0.3.9/31", "mac": "08:00:00:00:03:05", + "commands":["route add default gw 10.0.3.8 dev eth0", + "arp -i eth0 -s 10.0.3.8 08:00:00:00:03:FE"]}, + "h36": {"ip": "10.0.3.11/31", "mac": "08:00:00:00:03:06", + "commands":["route add default gw 10.0.3.10 dev eth0", + "arp -i eth0 -s 10.0.3.10 08:00:00:00:03:FE"]}, + "h37": {"ip": "10.0.3.13/31", "mac": "08:00:00:00:03:07", + "commands":["route add default gw 10.0.3.12 dev eth0", + "arp -i eth0 -s 10.0.3.12 08:00:00:00:03:FE"]}, + "h38": {"ip": "10.0.3.15/31", "mac": "08:00:00:00:03:08", + "commands":["route add default gw 10.0.3.14 dev eth0", + "arp -i eth0 -s 10.0.3.14 08:00:00:00:03:FE"]}, + "h39": {"ip": "10.0.3.17/31", "mac": "08:00:00:00:03:09", + "commands":["route add default gw 10.0.3.16 dev eth0", + "arp -i eth0 -s 10.0.3.16 08:00:00:00:03:FE"]}, + "h310": {"ip": "10.0.3.19/31", "mac": "08:00:00:00:03:10", + "commands":["route add default gw 10.0.3.18 dev eth0", + "arp -i eth0 -s 10.0.3.18 08:00:00:00:03:FE"]}, + "h311": {"ip": "10.0.3.21/31", "mac": "08:00:00:00:03:11", + "commands":["route add default gw 10.0.3.20 dev eth0", + "arp -i eth0 -s 10.0.3.20 08:00:00:00:03:FE"]}, + "h312": {"ip": "10.0.3.23/31", "mac": "08:00:00:00:03:12", + "commands":["route add default gw 10.0.3.22 dev eth0", + "arp -i eth0 -s 10.0.3.22 08:00:00:00:03:FE"]}, + "h313": {"ip": "10.0.3.25/31", "mac": "08:00:00:00:03:13", + "commands":["route add default gw 10.0.3.24 dev eth0", + "arp -i eth0 -s 10.0.3.24 08:00:00:00:03:FE"]}, + "h314": {"ip": "10.0.3.27/31", "mac": "08:00:00:00:03:14", + "commands":["route add default gw 10.0.3.26 dev eth0", + "arp -i eth0 -s 10.0.3.26 08:00:00:00:03:FE"]}, + "h315": {"ip": "10.0.3.29/31", "mac": "08:00:00:00:03:15", + "commands":["route add default gw 10.0.3.28 dev eth0", + "arp -i eth0 -s 10.0.3.28 08:00:00:00:03:FE"]}, + "h316": {"ip": "10.0.3.31/31", "mac": "08:00:00:00:03:16", + "commands":["route add default gw 10.0.3.30 dev eth0", + "arp -i eth0 -s 10.0.3.30 08:00:00:00:03:FE"]}, + "h41": {"ip": "10.0.4.1/31", "mac": "08:00:00:00:04:01", + "commands":["route add default gw 10.0.4.0 dev eth0", + "arp -i eth0 -s 10.0.4.0 08:00:00:00:04:FE"]}, + "h42": {"ip": "10.0.4.3/31", "mac": "08:00:00:00:04:02", + "commands":["route add default gw 10.0.4.2 dev eth0", + "arp -i eth0 -s 10.0.4.2 08:00:00:00:04:FE"]}, + "h43": {"ip": "10.0.4.5/31", "mac": "08:00:00:00:04:03", + "commands":["route add default gw 10.0.4.4 dev eth0", + "arp -i eth0 -s 10.0.4.4 08:00:00:00:04:FE"]}, + "h44": {"ip": "10.0.4.7/31", "mac": "08:00:00:00:04:04", + "commands":["route add default gw 10.0.4.6 dev eth0", + "arp -i eth0 -s 10.0.4.6 08:00:00:00:04:FE"]}, + "h45": {"ip": "10.0.4.9/31", "mac": "08:00:00:00:04:05", + "commands":["route add default gw 10.0.4.8 dev eth0", + "arp -i eth0 -s 10.0.4.8 08:00:00:00:04:FE"]}, + "h46": {"ip": "10.0.4.11/31", "mac": "08:00:00:00:04:06", + "commands":["route add default gw 10.0.4.10 dev eth0", + "arp -i eth0 -s 10.0.4.10 08:00:00:00:04:FE"]}, + "h47": {"ip": "10.0.4.13/31", "mac": "08:00:00:00:04:07", + "commands":["route add default gw 10.0.4.12 dev eth0", + "arp -i eth0 -s 10.0.4.12 08:00:00:00:04:FE"]}, + "h48": {"ip": "10.0.4.15/31", "mac": "08:00:00:00:04:08", + "commands":["route add default gw 10.0.4.14 dev eth0", + "arp -i eth0 -s 10.0.4.14 08:00:00:00:04:FE"]}, + "h49": {"ip": "10.0.4.17/31", "mac": "08:00:00:00:04:09", + "commands":["route add default gw 10.0.4.16 dev eth0", + "arp -i eth0 -s 10.0.4.16 08:00:00:00:04:FE"]}, + "h410": {"ip": "10.0.4.19/31", "mac": "08:00:00:00:04:10", + "commands":["route add default gw 10.0.4.18 dev eth0", + "arp -i eth0 -s 10.0.4.18 08:00:00:00:04:FE"]}, + "h411": {"ip": "10.0.4.21/31", "mac": "08:00:00:00:04:11", + "commands":["route add default gw 10.0.4.20 dev eth0", + "arp -i eth0 -s 10.0.4.20 08:00:00:00:04:FE"]}, + "h412": {"ip": "10.0.4.23/31", "mac": "08:00:00:00:04:12", + "commands":["route add default gw 10.0.4.22 dev eth0", + "arp -i eth0 -s 10.0.4.22 08:00:00:00:04:FE"]}, + "h413": {"ip": "10.0.4.25/31", "mac": "08:00:00:00:04:13", + "commands":["route add default gw 10.0.4.24 dev eth0", + "arp -i eth0 -s 10.0.4.24 08:00:00:00:04:FE"]}, + "h414": {"ip": "10.0.4.27/31", "mac": "08:00:00:00:04:14", + "commands":["route add default gw 10.0.4.26 dev eth0", + "arp -i eth0 -s 10.0.4.26 08:00:00:00:04:FE"]}, + "h415": {"ip": "10.0.4.29/31", "mac": "08:00:00:00:04:15", + "commands":["route add default gw 10.0.4.28 dev eth0", + "arp -i eth0 -s 10.0.4.28 08:00:00:00:04:FE"]}, + "h416": {"ip": "10.0.4.31/31", "mac": "08:00:00:00:04:16", + "commands":["route add default gw 10.0.4.30 dev eth0", + "arp -i eth0 -s 10.0.4.30 08:00:00:00:04:FE"]}, + "h51": {"ip": "10.0.5.1/31", "mac": "08:00:00:00:05:01", + "commands":["route add default gw 10.0.5.0 dev eth0", + "arp -i eth0 -s 10.0.5.0 08:00:00:00:05:FE"]}, + "h52": {"ip": "10.0.5.3/31", "mac": "08:00:00:00:05:02", + "commands":["route add default gw 10.0.5.2 dev eth0", + "arp -i eth0 -s 10.0.5.2 08:00:00:00:05:FE"]}, + "h53": {"ip": "10.0.5.5/31", "mac": "08:00:00:00:05:03", + "commands":["route add default gw 10.0.5.4 dev eth0", + "arp -i eth0 -s 10.0.5.4 08:00:00:00:05:FE"]}, + "h54": {"ip": "10.0.5.7/31", "mac": "08:00:00:00:05:04", + "commands":["route add default gw 10.0.5.6 dev eth0", + "arp -i eth0 -s 10.0.5.6 08:00:00:00:05:FE"]}, + "h55": {"ip": "10.0.5.9/31", "mac": "08:00:00:00:05:05", + "commands":["route add default gw 10.0.5.8 dev eth0", + "arp -i eth0 -s 10.0.5.8 08:00:00:00:05:FE"]}, + "h56": {"ip": "10.0.5.11/31", "mac": "08:00:00:00:05:06", + "commands":["route add default gw 10.0.5.10 dev eth0", + "arp -i eth0 -s 10.0.5.10 08:00:00:00:05:FE"]}, + "h57": {"ip": "10.0.5.13/31", "mac": "08:00:00:00:05:07", + "commands":["route add default gw 10.0.5.12 dev eth0", + "arp -i eth0 -s 10.0.5.12 08:00:00:00:05:FE"]}, + "h58": {"ip": "10.0.5.15/31", "mac": "08:00:00:00:05:08", + "commands":["route add default gw 10.0.5.14 dev eth0", + "arp -i eth0 -s 10.0.5.14 08:00:00:00:05:FE"]}, + "h59": {"ip": "10.0.5.17/31", "mac": "08:00:00:00:05:09", + "commands":["route add default gw 10.0.5.16 dev eth0", + "arp -i eth0 -s 10.0.5.16 08:00:00:00:05:FE"]}, + "h510": {"ip": "10.0.5.19/31", "mac": "08:00:00:00:05:10", + "commands":["route add default gw 10.0.5.18 dev eth0", + "arp -i eth0 -s 10.0.5.18 08:00:00:00:05:FE"]}, + "h511": {"ip": "10.0.5.21/31", "mac": "08:00:00:00:05:11", + "commands":["route add default gw 10.0.5.20 dev eth0", + "arp -i eth0 -s 10.0.5.20 08:00:00:00:05:FE"]}, + "h512": {"ip": "10.0.5.23/31", "mac": "08:00:00:00:05:12", + "commands":["route add default gw 10.0.5.22 dev eth0", + "arp -i eth0 -s 10.0.5.22 08:00:00:00:05:FE"]}, + "h513": {"ip": "10.0.5.25/31", "mac": "08:00:00:00:05:13", + "commands":["route add default gw 10.0.5.24 dev eth0", + "arp -i eth0 -s 10.0.5.24 08:00:00:00:05:FE"]}, + "h514": {"ip": "10.0.5.27/31", "mac": "08:00:00:00:05:14", + "commands":["route add default gw 10.0.5.26 dev eth0", + "arp -i eth0 -s 10.0.5.26 08:00:00:00:05:FE"]}, + "h515": {"ip": "10.0.5.29/31", "mac": "08:00:00:00:05:15", + "commands":["route add default gw 10.0.5.28 dev eth0", + "arp -i eth0 -s 10.0.5.28 08:00:00:00:05:FE"]}, + "h516": {"ip": "10.0.5.31/31", "mac": "08:00:00:00:05:16", + "commands":["route add default gw 10.0.5.30 dev eth0", + "arp -i eth0 -s 10.0.5.30 08:00:00:00:05:FE"]}, + "h61": {"ip": "10.0.6.1/31", "mac": "08:00:00:00:06:01", + "commands":["route add default gw 10.0.6.0 dev eth0", + "arp -i eth0 -s 10.0.6.0 08:00:00:00:06:FE"]}, + "h62": {"ip": "10.0.6.3/31", "mac": "08:00:00:00:06:02", + "commands":["route add default gw 10.0.6.2 dev eth0", + "arp -i eth0 -s 10.0.6.2 08:00:00:00:06:FE"]}, + "h63": {"ip": "10.0.6.5/31", "mac": "08:00:00:00:06:03", + "commands":["route add default gw 10.0.6.4 dev eth0", + "arp -i eth0 -s 10.0.6.4 08:00:00:00:06:FE"]}, + "h64": {"ip": "10.0.6.7/31", "mac": "08:00:00:00:06:04", + "commands":["route add default gw 10.0.6.6 dev eth0", + "arp -i eth0 -s 10.0.6.6 08:00:00:00:06:FE"]}, + "h65": {"ip": "10.0.6.9/31", "mac": "08:00:00:00:06:05", + "commands":["route add default gw 10.0.6.8 dev eth0", + "arp -i eth0 -s 10.0.6.8 08:00:00:00:06:FE"]}, + "h66": {"ip": "10.0.6.11/31", "mac": "08:00:00:00:06:06", + "commands":["route add default gw 10.0.6.10 dev eth0", + "arp -i eth0 -s 10.0.6.10 08:00:00:00:06:FE"]}, + "h67": {"ip": "10.0.6.13/31", "mac": "08:00:00:00:06:07", + "commands":["route add default gw 10.0.6.12 dev eth0", + "arp -i eth0 -s 10.0.6.12 08:00:00:00:06:FE"]}, + "h68": {"ip": "10.0.6.15/31", "mac": "08:00:00:00:06:08", + "commands":["route add default gw 10.0.6.14 dev eth0", + "arp -i eth0 -s 10.0.6.14 08:00:00:00:06:FE"]}, + "h69": {"ip": "10.0.6.17/31", "mac": "08:00:00:00:06:09", + "commands":["route add default gw 10.0.6.16 dev eth0", + "arp -i eth0 -s 10.0.6.16 08:00:00:00:06:FE"]}, + "h610": {"ip": "10.0.6.19/31", "mac": "08:00:00:00:06:10", + "commands":["route add default gw 10.0.6.18 dev eth0", + "arp -i eth0 -s 10.0.6.18 08:00:00:00:06:FE"]}, + "h611": {"ip": "10.0.6.21/31", "mac": "08:00:00:00:06:11", + "commands":["route add default gw 10.0.6.20 dev eth0", + "arp -i eth0 -s 10.0.6.20 08:00:00:00:06:FE"]}, + "h612": {"ip": "10.0.6.23/31", "mac": "08:00:00:00:06:12", + "commands":["route add default gw 10.0.6.22 dev eth0", + "arp -i eth0 -s 10.0.6.22 08:00:00:00:06:FE"]}, + "h613": {"ip": "10.0.6.25/31", "mac": "08:00:00:00:06:13", + "commands":["route add default gw 10.0.6.24 dev eth0", + "arp -i eth0 -s 10.0.6.24 08:00:00:00:06:FE"]}, + "h614": {"ip": "10.0.6.27/31", "mac": "08:00:00:00:06:14", + "commands":["route add default gw 10.0.6.26 dev eth0", + "arp -i eth0 -s 10.0.6.26 08:00:00:00:06:FE"]}, + "h615": {"ip": "10.0.6.29/31", "mac": "08:00:00:00:06:15", + "commands":["route add default gw 10.0.6.28 dev eth0", + "arp -i eth0 -s 10.0.6.28 08:00:00:00:06:FE"]}, + "h616": {"ip": "10.0.6.31/31", "mac": "08:00:00:00:06:16", + "commands":["route add default gw 10.0.6.30 dev eth0", + "arp -i eth0 -s 10.0.6.30 08:00:00:00:06:FE"]}, + "h71": {"ip": "10.0.7.1/31", "mac": "08:00:00:00:07:01", + "commands":["route add default gw 10.0.7.0 dev eth0", + "arp -i eth0 -s 10.0.7.0 08:00:00:00:07:FE"]}, + "h72": {"ip": "10.0.7.3/31", "mac": "08:00:00:00:07:02", + "commands":["route add default gw 10.0.7.2 dev eth0", + "arp -i eth0 -s 10.0.7.2 08:00:00:00:07:FE"]}, + "h73": {"ip": "10.0.7.5/31", "mac": "08:00:00:00:07:03", + "commands":["route add default gw 10.0.7.4 dev eth0", + "arp -i eth0 -s 10.0.7.4 08:00:00:00:07:FE"]}, + "h74": {"ip": "10.0.7.7/31", "mac": "08:00:00:00:07:04", + "commands":["route add default gw 10.0.7.6 dev eth0", + "arp -i eth0 -s 10.0.7.6 08:00:00:00:07:FE"]}, + "h75": {"ip": "10.0.7.9/31", "mac": "08:00:00:00:07:05", + "commands":["route add default gw 10.0.7.8 dev eth0", + "arp -i eth0 -s 10.0.7.8 08:00:00:00:07:FE"]}, + "h76": {"ip": "10.0.7.11/31", "mac": "08:00:00:00:07:06", + "commands":["route add default gw 10.0.7.10 dev eth0", + "arp -i eth0 -s 10.0.7.10 08:00:00:00:07:FE"]}, + "h77": {"ip": "10.0.7.13/31", "mac": "08:00:00:00:07:07", + "commands":["route add default gw 10.0.7.12 dev eth0", + "arp -i eth0 -s 10.0.7.12 08:00:00:00:07:FE"]}, + "h78": {"ip": "10.0.7.15/31", "mac": "08:00:00:00:07:08", + "commands":["route add default gw 10.0.7.14 dev eth0", + "arp -i eth0 -s 10.0.7.14 08:00:00:00:07:FE"]}, + "h79": {"ip": "10.0.7.17/31", "mac": "08:00:00:00:07:09", + "commands":["route add default gw 10.0.7.16 dev eth0", + "arp -i eth0 -s 10.0.7.16 08:00:00:00:07:FE"]}, + "h710": {"ip": "10.0.7.19/31", "mac": "08:00:00:00:07:10", + "commands":["route add default gw 10.0.7.18 dev eth0", + "arp -i eth0 -s 10.0.7.18 08:00:00:00:07:FE"]}, + "h711": {"ip": "10.0.7.21/31", "mac": "08:00:00:00:07:11", + "commands":["route add default gw 10.0.7.20 dev eth0", + "arp -i eth0 -s 10.0.7.20 08:00:00:00:07:FE"]}, + "h712": {"ip": "10.0.7.23/31", "mac": "08:00:00:00:07:12", + "commands":["route add default gw 10.0.7.22 dev eth0", + "arp -i eth0 -s 10.0.7.22 08:00:00:00:07:FE"]}, + "h713": {"ip": "10.0.7.25/31", "mac": "08:00:00:00:07:13", + "commands":["route add default gw 10.0.7.24 dev eth0", + "arp -i eth0 -s 10.0.7.24 08:00:00:00:07:FE"]}, + "h714": {"ip": "10.0.7.27/31", "mac": "08:00:00:00:07:14", + "commands":["route add default gw 10.0.7.26 dev eth0", + "arp -i eth0 -s 10.0.7.26 08:00:00:00:07:FE"]}, + "h715": {"ip": "10.0.7.29/31", "mac": "08:00:00:00:07:15", + "commands":["route add default gw 10.0.7.28 dev eth0", + "arp -i eth0 -s 10.0.7.28 08:00:00:00:07:FE"]}, + "h716": {"ip": "10.0.7.31/31", "mac": "08:00:00:00:07:16", + "commands":["route add default gw 10.0.7.30 dev eth0", + "arp -i eth0 -s 10.0.7.30 08:00:00:00:07:FE"]}, + "h81": {"ip": "10.0.8.1/31", "mac": "08:00:00:00:08:01", + "commands":["route add default gw 10.0.8.0 dev eth0", + "arp -i eth0 -s 10.0.8.0 08:00:00:00:08:FE"]}, + "h82": {"ip": "10.0.8.3/31", "mac": "08:00:00:00:08:02", + "commands":["route add default gw 10.0.8.2 dev eth0", + "arp -i eth0 -s 10.0.8.2 08:00:00:00:08:FE"]}, + "h83": {"ip": "10.0.8.5/31", "mac": "08:00:00:00:08:03", + "commands":["route add default gw 10.0.8.4 dev eth0", + "arp -i eth0 -s 10.0.8.4 08:00:00:00:08:FE"]}, + "h84": {"ip": "10.0.8.7/31", "mac": "08:00:00:00:08:04", + "commands":["route add default gw 10.0.8.6 dev eth0", + "arp -i eth0 -s 10.0.8.6 08:00:00:00:08:FE"]}, + "h85": {"ip": "10.0.8.9/31", "mac": "08:00:00:00:08:05", + "commands":["route add default gw 10.0.8.8 dev eth0", + "arp -i eth0 -s 10.0.8.8 08:00:00:00:08:FE"]}, + "h86": {"ip": "10.0.8.11/31", "mac": "08:00:00:00:08:06", + "commands":["route add default gw 10.0.8.10 dev eth0", + "arp -i eth0 -s 10.0.8.10 08:00:00:00:08:FE"]}, + "h87": {"ip": "10.0.8.13/31", "mac": "08:00:00:00:08:07", + "commands":["route add default gw 10.0.8.12 dev eth0", + "arp -i eth0 -s 10.0.8.12 08:00:00:00:08:FE"]}, + "h88": {"ip": "10.0.8.15/31", "mac": "08:00:00:00:08:08", + "commands":["route add default gw 10.0.8.14 dev eth0", + "arp -i eth0 -s 10.0.8.14 08:00:00:00:08:FE"]}, + "h89": {"ip": "10.0.8.17/31", "mac": "08:00:00:00:08:09", + "commands":["route add default gw 10.0.8.16 dev eth0", + "arp -i eth0 -s 10.0.8.16 08:00:00:00:08:FE"]}, + "h810": {"ip": "10.0.8.19/31", "mac": "08:00:00:00:08:10", + "commands":["route add default gw 10.0.8.18 dev eth0", + "arp -i eth0 -s 10.0.8.18 08:00:00:00:08:FE"]}, + "h811": {"ip": "10.0.8.21/31", "mac": "08:00:00:00:08:11", + "commands":["route add default gw 10.0.8.20 dev eth0", + "arp -i eth0 -s 10.0.8.20 08:00:00:00:08:FE"]}, + "h812": {"ip": "10.0.8.23/31", "mac": "08:00:00:00:08:12", + "commands":["route add default gw 10.0.8.22 dev eth0", + "arp -i eth0 -s 10.0.8.22 08:00:00:00:08:FE"]}, + "h813": {"ip": "10.0.8.25/31", "mac": "08:00:00:00:08:13", + "commands":["route add default gw 10.0.8.24 dev eth0", + "arp -i eth0 -s 10.0.8.24 08:00:00:00:08:FE"]}, + "h814": {"ip": "10.0.8.27/31", "mac": "08:00:00:00:08:14", + "commands":["route add default gw 10.0.8.26 dev eth0", + "arp -i eth0 -s 10.0.8.26 08:00:00:00:08:FE"]}, + "h815": {"ip": "10.0.8.29/31", "mac": "08:00:00:00:08:15", + "commands":["route add default gw 10.0.8.28 dev eth0", + "arp -i eth0 -s 10.0.8.28 08:00:00:00:08:FE"]}, + "h816": {"ip": "10.0.8.31/31", "mac": "08:00:00:00:08:16", + "commands":["route add default gw 10.0.8.30 dev eth0", + "arp -i eth0 -s 10.0.8.30 08:00:00:00:08:FE"]}, + "h91": {"ip": "10.0.9.1/31", "mac": "08:00:00:00:09:01", + "commands":["route add default gw 10.0.9.0 dev eth0", + "arp -i eth0 -s 10.0.9.0 08:00:00:00:09:FE"]}, + "h92": {"ip": "10.0.9.3/31", "mac": "08:00:00:00:09:02", + "commands":["route add default gw 10.0.9.2 dev eth0", + "arp -i eth0 -s 10.0.9.2 08:00:00:00:09:FE"]}, + "h93": {"ip": "10.0.9.5/31", "mac": "08:00:00:00:09:03", + "commands":["route add default gw 10.0.9.4 dev eth0", + "arp -i eth0 -s 10.0.9.4 08:00:00:00:09:FE"]}, + "h94": {"ip": "10.0.9.7/31", "mac": "08:00:00:00:09:04", + "commands":["route add default gw 10.0.9.6 dev eth0", + "arp -i eth0 -s 10.0.9.6 08:00:00:00:09:FE"]}, + "h95": {"ip": "10.0.9.9/31", "mac": "08:00:00:00:09:05", + "commands":["route add default gw 10.0.9.8 dev eth0", + "arp -i eth0 -s 10.0.9.8 08:00:00:00:09:FE"]}, + "h96": {"ip": "10.0.9.11/31", "mac": "08:00:00:00:09:06", + "commands":["route add default gw 10.0.9.10 dev eth0", + "arp -i eth0 -s 10.0.9.10 08:00:00:00:09:FE"]}, + "h97": {"ip": "10.0.9.13/31", "mac": "08:00:00:00:09:07", + "commands":["route add default gw 10.0.9.12 dev eth0", + "arp -i eth0 -s 10.0.9.12 08:00:00:00:09:FE"]}, + "h98": {"ip": "10.0.9.15/31", "mac": "08:00:00:00:09:08", + "commands":["route add default gw 10.0.9.14 dev eth0", + "arp -i eth0 -s 10.0.9.14 08:00:00:00:09:FE"]}, + "h99": {"ip": "10.0.9.17/31", "mac": "08:00:00:00:09:09", + "commands":["route add default gw 10.0.9.16 dev eth0", + "arp -i eth0 -s 10.0.9.16 08:00:00:00:09:FE"]}, + "h910": {"ip": "10.0.9.19/31", "mac": "08:00:00:00:09:10", + "commands":["route add default gw 10.0.9.18 dev eth0", + "arp -i eth0 -s 10.0.9.18 08:00:00:00:09:FE"]}, + "h911": {"ip": "10.0.9.21/31", "mac": "08:00:00:00:09:11", + "commands":["route add default gw 10.0.9.20 dev eth0", + "arp -i eth0 -s 10.0.9.20 08:00:00:00:09:FE"]}, + "h912": {"ip": "10.0.9.23/31", "mac": "08:00:00:00:09:12", + "commands":["route add default gw 10.0.9.22 dev eth0", + "arp -i eth0 -s 10.0.9.22 08:00:00:00:09:FE"]}, + "h913": {"ip": "10.0.9.25/31", "mac": "08:00:00:00:09:13", + "commands":["route add default gw 10.0.9.24 dev eth0", + "arp -i eth0 -s 10.0.9.24 08:00:00:00:09:FE"]}, + "h914": {"ip": "10.0.9.27/31", "mac": "08:00:00:00:09:14", + "commands":["route add default gw 10.0.9.26 dev eth0", + "arp -i eth0 -s 10.0.9.26 08:00:00:00:09:FE"]}, + "h915": {"ip": "10.0.9.29/31", "mac": "08:00:00:00:09:15", + "commands":["route add default gw 10.0.9.28 dev eth0", + "arp -i eth0 -s 10.0.9.28 08:00:00:00:09:FE"]}, + "h916": {"ip": "10.0.9.31/31", "mac": "08:00:00:00:09:16", + "commands":["route add default gw 10.0.9.30 dev eth0", + "arp -i eth0 -s 10.0.9.30 08:00:00:00:09:FE"]} + }, + "switches":{ + "s1": { "runtime_json" : "s1-runtime.json" }, + "s2": { "runtime_json" : "s2-runtime.json" }, + "s3": { "runtime_json" : "s3-runtime.json" }, + "s4": { "runtime_json" : "s4-runtime.json" }, + "s5": { "runtime_json" : "s5-runtime.json" }, + "s6": { "runtime_json" : "s6-runtime.json" }, + "s7": { "runtime_json" : "s7-runtime.json" }, + "s8": { "runtime_json" : "s8-runtime.json" }, + "s9": { "runtime_json" : "s9-runtime.json" }, + "ss1": { "runtime_json" : "ss1-runtime.json" }, + "ss2": { "runtime_json" : "ss2-runtime.json" }, + "ss3": { "runtime_json" : "ss3-runtime.json" }, + "ss4": { "runtime_json" : "ss4-runtime.json" } + }, + "links": [ + ["h11", "s1-p1", "0ms", 100], ["h12", "s1-p2", "0ms", 100], ["h13", "s1-p3", "0ms", 100], ["h14", "s1-p4", "0ms", 100], ["h15", "s1-p5", "0ms", 100], ["h16", "s1-p6", "0ms", 100], ["h17", "s1-p7", "0ms", 100], ["h18", "s1-p8", "0ms", 100], ["h19", "s1-p9", "0ms", 100], ["h110", "s1-p10", "0ms", 100], ["h111", "s1-p11", "0ms", 100], ["h112", "s1-p12", "0ms", 100], ["h113", "s1-p13", "0ms", 100], ["h114", "s1-p14", "0ms", 100], ["h115", "s1-p15", "0ms", 100], ["h116", "s1-p16", "0ms", 100], ["ss1-p1", "s1-p17", "0ms", 100], ["ss2-p1", "s1-p18", "0ms", 100], ["ss3-p1", "s1-p19", "0ms", 100], ["ss4-p1", "s1-p20", "0ms", 100], + ["h21", "s2-p1", "0ms", 100], ["h22", "s2-p2", "0ms", 100], ["h23", "s2-p3", "0ms", 100], ["h24", "s2-p4", "0ms", 100], ["h25", "s2-p5", "0ms", 100], ["h26", "s2-p6", "0ms", 100], ["h27", "s2-p7", "0ms", 100], ["h28", "s2-p8", "0ms", 100], ["h29", "s2-p9", "0ms", 100], ["h210", "s2-p10", "0ms", 100], ["h211", "s2-p11", "0ms", 100], ["h212", "s2-p12", "0ms", 100], ["h213", "s2-p13", "0ms", 100], ["h214", "s2-p14", "0ms", 100], ["h215", "s2-p15", "0ms", 100], ["h216", "s2-p16", "0ms", 100], ["ss1-p2", "s2-p17", "0ms", 100], ["ss2-p2", "s2-p18", "0ms", 100], ["ss3-p2", "s2-p19", "0ms", 100], ["ss4-p2", "s2-p20", "0ms", 100], + ["h31", "s3-p1", "0ms", 100], ["h32", "s3-p2", "0ms", 100], ["h33", "s3-p3", "0ms", 100], ["h34", "s3-p4", "0ms", 100], ["h35", "s3-p5", "0ms", 100], ["h36", "s3-p6", "0ms", 100], ["h37", "s3-p7", "0ms", 100], ["h38", "s3-p8", "0ms", 100], ["h39", "s3-p9", "0ms", 100], ["h310", "s3-p10", "0ms", 100], ["h311", "s3-p11", "0ms", 100], ["h312", "s3-p12", "0ms", 100], ["h313", "s3-p13", "0ms", 100], ["h314", "s3-p14", "0ms", 100], ["h315", "s3-p15", "0ms", 100], ["h316", "s3-p16", "0ms", 100], ["ss1-p3", "s3-p17", "0ms", 100], ["ss2-p3", "s3-p18", "0ms", 100], ["ss3-p3", "s3-p19", "0ms", 100], ["ss4-p3", "s3-p20", "0ms", 100], + ["h41", "s4-p1", "0ms", 100], ["h42", "s4-p2", "0ms", 100], ["h43", "s4-p3", "0ms", 100], ["h44", "s4-p4", "0ms", 100], ["h45", "s4-p5", "0ms", 100], ["h46", "s4-p6", "0ms", 100], ["h47", "s4-p7", "0ms", 100], ["h48", "s4-p8", "0ms", 100], ["h49", "s4-p9", "0ms", 100], ["h410", "s4-p10", "0ms", 100], ["h411", "s4-p11", "0ms", 100], ["h412", "s4-p12", "0ms", 100], ["h413", "s4-p13", "0ms", 100], ["h414", "s4-p14", "0ms", 100], ["h415", "s4-p15", "0ms", 100], ["h416", "s4-p16", "0ms", 100], ["ss1-p4", "s4-p17", "0ms", 100], ["ss2-p4", "s4-p18", "0ms", 100], ["ss3-p4", "s4-p19", "0ms", 100], ["ss4-p4", "s4-p20", "0ms", 100], + ["h51", "s5-p1", "0ms", 100], ["h52", "s5-p2", "0ms", 100], ["h53", "s5-p3", "0ms", 100], ["h54", "s5-p4", "0ms", 100], ["h55", "s5-p5", "0ms", 100], ["h56", "s5-p6", "0ms", 100], ["h57", "s5-p7", "0ms", 100], ["h58", "s5-p8", "0ms", 100], ["h59", "s5-p9", "0ms", 100], ["h510", "s5-p10", "0ms", 100], ["h511", "s5-p11", "0ms", 100], ["h512", "s5-p12", "0ms", 100], ["h513", "s5-p13", "0ms", 100], ["h514", "s5-p14", "0ms", 100], ["h515", "s5-p15", "0ms", 100], ["h516", "s5-p16", "0ms", 100], ["ss1-p5", "s5-p17", "0ms", 100], ["ss2-p5", "s5-p18", "0ms", 100], ["ss3-p5", "s5-p19", "0ms", 100], ["ss4-p5", "s5-p20", "0ms", 100], + ["h61", "s6-p1", "0ms", 100], ["h62", "s6-p2", "0ms", 100], ["h63", "s6-p3", "0ms", 100], ["h64", "s6-p4", "0ms", 100], ["h65", "s6-p5", "0ms", 100], ["h66", "s6-p6", "0ms", 100], ["h67", "s6-p7", "0ms", 100], ["h68", "s6-p8", "0ms", 100], ["h69", "s6-p9", "0ms", 100], ["h610", "s6-p10", "0ms", 100], ["h611", "s6-p11", "0ms", 100], ["h612", "s6-p12", "0ms", 100], ["h613", "s6-p13", "0ms", 100], ["h614", "s6-p14", "0ms", 100], ["h615", "s6-p15", "0ms", 100], ["h616", "s6-p16", "0ms", 100], ["ss1-p6", "s6-p17", "0ms", 100], ["ss2-p6", "s6-p18", "0ms", 100], ["ss3-p6", "s6-p19", "0ms", 100], ["ss4-p6", "s6-p20", "0ms", 100], + ["h71", "s7-p1", "0ms", 100], ["h72", "s7-p2", "0ms", 100], ["h73", "s7-p3", "0ms", 100], ["h74", "s7-p4", "0ms", 100], ["h75", "s7-p5", "0ms", 100], ["h76", "s7-p6", "0ms", 100], ["h77", "s7-p7", "0ms", 100], ["h78", "s7-p8", "0ms", 100], ["h79", "s7-p9", "0ms", 100], ["h710", "s7-p10", "0ms", 100], ["h711", "s7-p11", "0ms", 100], ["h712", "s7-p12", "0ms", 100], ["h713", "s7-p13", "0ms", 100], ["h714", "s7-p14", "0ms", 100], ["h715", "s7-p15", "0ms", 100], ["h716", "s7-p16", "0ms", 100], ["ss1-p7", "s7-p17", "0ms", 100], ["ss2-p7", "s7-p18", "0ms", 100], ["ss3-p7", "s7-p19", "0ms", 100], ["ss4-p7", "s7-p20", "0ms", 100], + ["h81", "s8-p1", "0ms", 100], ["h82", "s8-p2", "0ms", 100], ["h83", "s8-p3", "0ms", 100], ["h84", "s8-p4", "0ms", 100], ["h85", "s8-p5", "0ms", 100], ["h86", "s8-p6", "0ms", 100], ["h87", "s8-p7", "0ms", 100], ["h88", "s8-p8", "0ms", 100], ["h89", "s8-p9", "0ms", 100], ["h810", "s8-p10", "0ms", 100], ["h811", "s8-p11", "0ms", 100], ["h812", "s8-p12", "0ms", 100], ["h813", "s8-p13", "0ms", 100], ["h814", "s8-p14", "0ms", 100], ["h815", "s8-p15", "0ms", 100], ["h816", "s8-p16", "0ms", 100], ["ss1-p8", "s8-p17", "0ms", 100], ["ss2-p8", "s8-p18", "0ms", 100], ["ss3-p8", "s8-p19", "0ms", 100], ["ss4-p8", "s8-p20", "0ms", 100], + ["h91", "s9-p1", "0ms", 100], ["h92", "s9-p2", "0ms", 100], ["h93", "s9-p3", "0ms", 100], ["h94", "s9-p4", "0ms", 100], ["h95", "s9-p5", "0ms", 100], ["h96", "s9-p6", "0ms", 100], ["h97", "s9-p7", "0ms", 100], ["h98", "s9-p8", "0ms", 100], ["h99", "s9-p9", "0ms", 100], ["h910", "s9-p10", "0ms", 100], ["h911", "s9-p11", "0ms", 100], ["h912", "s9-p12", "0ms", 100], ["h913", "s9-p13", "0ms", 100], ["h914", "s9-p14", "0ms", 100], ["h915", "s9-p15", "0ms", 100], ["h916", "s9-p16", "0ms", 100], ["ss1-p9", "s9-p17", "0ms", 100], ["ss2-p9", "s9-p18", "0ms", 100], ["ss3-p9", "s9-p19", "0ms", 100], ["ss4-p9", "s9-p20", "0ms", 100] + ] +} \ No newline at end of file diff --git a/exercises/basic/triangle-topo/s1-runtime.json b/exercises/basic/triangle-topo/s1-runtime.json index 9ef8d3aa..a5a8f125 100644 --- a/exercises/basic/triangle-topo/s1-runtime.json +++ b/exercises/basic/triangle-topo/s1-runtime.json @@ -33,7 +33,7 @@ }, "action_name": "MyIngress.ipv4_forward", "action_params": { - "dstAddr": "08:00:00:00:02:00", + "dstAddr": "08:00:00:00:02:22", "port": 2 } }, @@ -44,11 +44,81 @@ "10.0.3.3", 32 ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:03:33", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.4.4", + 32 + ] }, "action_name": "MyIngress.ipv4_forward", "action_params": { - "dstAddr": "08:00:00:00:03:00", - "port": 3 + "dstAddr": "08:00:00:00:04:44", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.5.5", + 32 + ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.6.6", + 32 + ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.7.7", + 32 + ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 5 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.8.8", + 32 + ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:02:00", + "port": 5 } } ] diff --git a/exercises/basic/triangle-topo/s2-runtime.json b/exercises/basic/triangle-topo/s2-runtime.json index e977059b..4f1bdf99 100644 --- a/exercises/basic/triangle-topo/s2-runtime.json +++ b/exercises/basic/triangle-topo/s2-runtime.json @@ -9,6 +9,62 @@ "action_name": "MyIngress.drop", "action_params": {} }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.5.5", + 32 + ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:05:55", + "port": 2 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.6.6", + 32 + ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:06:66", + "port": 3 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.7.7", + 32 + ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:07:77", + "port": 4 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.8.8", + 32 + ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:08:88", + "port": 5 + } + }, { "table": "MyIngress.ipv4_lpm", "match": { @@ -20,7 +76,7 @@ "action_name": "MyIngress.ipv4_forward", "action_params": { "dstAddr": "08:00:00:00:01:00", - "port": 2 + "port": 1 } }, { @@ -33,7 +89,7 @@ }, "action_name": "MyIngress.ipv4_forward", "action_params": { - "dstAddr": "08:00:00:00:02:22", + "dstAddr": "08:00:00:00:01:00", "port": 1 } }, @@ -44,11 +100,25 @@ "10.0.3.3", 32 ] + }, + "action_name": "MyIngress.ipv4_forward", + "action_params": { + "dstAddr": "08:00:00:00:01:00", + "port": 1 + } + }, + { + "table": "MyIngress.ipv4_lpm", + "match": { + "hdr.ipv4.dstAddr": [ + "10.0.4.4", + 32 + ] }, "action_name": "MyIngress.ipv4_forward", "action_params": { - "dstAddr": "08:00:00:00:03:00", - "port": 3 + "dstAddr": "08:00:00:00:01:00", + "port": 1 } } ] diff --git a/exercises/basic/triangle-topo/topology.json b/exercises/basic/triangle-topo/topology.json index a3d93dce..d45bb879 100644 --- a/exercises/basic/triangle-topo/topology.json +++ b/exercises/basic/triangle-topo/topology.json @@ -23,6 +23,46 @@ "route add default gw 10.0.3.30 dev eth0", "arp -i eth0 -s 10.0.3.30 08:00:00:00:03:00" ] + }, + "h4": { + "ip": "10.0.4.4/24", + "mac": "08:00:00:00:04:44", + "commands": [ + "route add default gw 10.0.4.40 dev eth0", + "arp -i eth0 -s 10.0.4.40 08:00:00:00:04:00" + ] + }, + "h5": { + "ip": "10.0.5.5/24", + "mac": "08:00:00:00:05:55", + "commands": [ + "route add default gw 10.0.5.50 dev eth0", + "arp -i eth0 -s 10.0.5.50 08:00:00:00:05:00" + ] + }, + "h6": { + "ip": "10.0.6.6/24", + "mac": "08:00:00:00:06:66", + "commands": [ + "route add default gw 10.0.6.60 dev eth0", + "arp -i eth0 -s 10.0.6.60 08:00:00:00:06:00" + ] + }, + "h7": { + "ip": "10.0.7.7/24", + "mac": "08:00:00:00:07:77", + "commands": [ + "route add default gw 10.0.7.70 dev eth0", + "arp -i eth0 -s 10.0.7.70 08:00:00:00:07:00" + ] + }, + "h8": { + "ip": "10.0.8.8/24", + "mac": "08:00:00:00:08:88", + "commands": [ + "route add default gw 10.0.8.80 dev eth0", + "arp -i eth0 -s 10.0.8.80 08:00:00:00:08:00" + ] } }, "switches": { @@ -31,35 +71,46 @@ }, "s2": { "runtime_json": "triangle-topo/s2-runtime.json" - }, - "s3": { - "runtime_json": "triangle-topo/s3-runtime.json" } }, "links": [ [ "h1", - "s1-p1" + "s1-p1", "0ms", 100 ], + [ - "s1-p2", - "s2-p2" + "h2", + "s1-p2", "0ms", 100 ], [ - "s1-p3", - "s3-p2" + "h3", + "s1-p3", "0ms", 100 ], [ - "s3-p3", - "s2-p3" + "h4", + "s1-p4", "0ms", 100 ], [ - "h2", - "s2-p1" + "s1-p5", + "s2-p1", "0ms", 10 ], [ - "h3", - "s3-p1" + "h5", + "s2-p2", "0ms", 100 + ], + [ + "h6", + "s2-p3", "0ms", 100 + ], + [ + "h7", + "s2-p4", "0ms", 100 + ], + [ + "h8", + "s2-p5", "0ms", 100 ] + ] } \ No newline at end of file diff --git a/exercises/qos/qos.p4 b/exercises/qos/qos.p4 index 3349c2d9..608a2ede 100644 --- a/exercises/qos/qos.p4 +++ b/exercises/qos/qos.p4 @@ -1,25 +1,14 @@ -// SPDX-License-Identifier: Apache-2.0 /* -*- P4_16 -*- */ #include #include -const bit<16> TYPE_IPV4 = 0x800; +extern pifo_scheduler { + pifo_scheduler(bit<1> verbose); +void my_scheduler(in T1 in_flow_id, in T1 idle_time, in T2 in_enq, in T1 in_pkt_ptr, in T2 reset_time); +void pass_rank_values ( in T1 rank_value, in T1 level_id); +} -/* IP protocols */ -const bit<8> IP_PROTOCOLS_ICMP = 1; -const bit<8> IP_PROTOCOLS_IGMP = 2; -const bit<8> IP_PROTOCOLS_IPV4 = 4; -const bit<8> IP_PROTOCOLS_TCP = 6; -const bit<8> IP_PROTOCOLS_UDP = 17; -const bit<8> IP_PROTOCOLS_IPV6 = 41; -const bit<8> IP_PROTOCOLS_GRE = 47; -const bit<8> IP_PROTOCOLS_IPSEC_ESP = 50; -const bit<8> IP_PROTOCOLS_IPSEC_AH = 51; -const bit<8> IP_PROTOCOLS_ICMPV6 = 58; -const bit<8> IP_PROTOCOLS_EIGRP = 88; -const bit<8> IP_PROTOCOLS_OSPF = 89; -const bit<8> IP_PROTOCOLS_PIM = 103; -const bit<8> IP_PROTOCOLS_VRRP = 112; +const bit<16> TYPE_IPV4 = 0x800; /************************************************************************* @@ -36,13 +25,11 @@ header ethernet_t { bit<16> etherType; } -/* - * TODO: split tos to two fields 6 bit diffserv and 2 bit ecn - */ header ipv4_t { bit<4> version; bit<4> ihl; - bit<8> tos; + bit<6> diffserv; + bit<2> ecn; bit<16> totalLen; bit<16> identification; bit<3> flags; @@ -52,8 +39,15 @@ header ipv4_t { bit<16> hdrChecksum; ip4Addr_t srcAddr; ip4Addr_t dstAddr; + bit<32> options; } +header ipv4_option_t { + bit<1> copyFlag; + bit<2> optClass; + bit<5> option; + bit<8> optionLength; +} struct metadata { } @@ -118,8 +112,6 @@ control MyIngress(inout headers hdr, hdr.ipv4.ttl = hdr.ipv4.ttl - 1; } -/* TODO: Implement actions for different traffic classes */ - table ipv4_lpm { key = { @@ -134,10 +126,62 @@ control MyIngress(inout headers hdr, default_action = NoAction(); } -/* TODO: set hdr.ipv4.diffserv on the basis of protocol */ + + @userextern @name("my_pifo") + pifo_scheduler,bit<1>>(1) my_pifo; + + bit <48> rank; + bit <48> in_idle_time = 15000; + bit <48> in_pkt_ptr; + bit <1> in_enq = 1; + bit <1> reset_time = 0; + bit <48> in_flow_id = 0; + + register>(1) register_last_ptr; + + action assign_flow_id(bit <48> flow_id) { + in_flow_id = flow_id; + } + + + table lookup_flow_id { + key = { + hdr.ipv4.srcAddr: lpm; + } + actions = { + assign_flow_id; + NoAction; + } + size = 1024; + default_action = NoAction(); + } + + apply { - if (hdr.ipv4.isValid()) { - ipv4_lpm.apply(); + + lookup_flow_id.apply(); + + register_last_ptr.read(in_pkt_ptr,0); + in_pkt_ptr = in_pkt_ptr + (bit<48>)(1); + register_last_ptr.write(0,in_pkt_ptr); + + rank = (bit<48>)(hdr.ipv4.options); + + reset_time = 0; + + my_pifo.pass_rank_values(rank,0); + + if(hdr.ipv4.dstAddr == 0) + { + drop(); + } + else + { + my_pifo.my_scheduler(in_flow_id, in_idle_time, in_enq, in_pkt_ptr, reset_time); + } + + if (hdr.ipv4.isValid()) { + ipv4_lpm.apply(); } } } @@ -152,19 +196,18 @@ control MyEgress(inout headers hdr, apply { } } - /************************************************************************* ************* C H E C K S U M C O M P U T A T I O N ************** *************************************************************************/ control MyComputeChecksum(inout headers hdr, inout metadata meta) { - apply { - /* TODO: replace tos with diffserv and ecn */ - update_checksum( - hdr.ipv4.isValid(), + apply { + update_checksum( + hdr.ipv4.isValid(), { hdr.ipv4.version, - hdr.ipv4.ihl, - hdr.ipv4.tos, + hdr.ipv4.ihl, + hdr.ipv4.diffserv, + hdr.ipv4.ecn, hdr.ipv4.totalLen, hdr.ipv4.identification, hdr.ipv4.flags, diff --git a/exercises/qos/switch_queue_debug.log b/exercises/qos/switch_queue_debug.log new file mode 100644 index 00000000..bfdbc719 --- /dev/null +++ b/exercises/qos/switch_queue_debug.log @@ -0,0 +1,1231 @@ +=== SimpleSwitch started at 1745612616881008 with 1 queue per port === +1745612617048503 - DROP: Packet 0 at end of ingress (egress_spec == drop_port) +1745612617200468 - DROP: Packet 1 at end of ingress (egress_spec == drop_port) +1745612617264350 - DROP: Packet 2 at end of ingress (egress_spec == drop_port) +1745612617329420 - DROP: Packet 3 at end of ingress (egress_spec == drop_port) +=== SimpleSwitch started at 1745612617445426 with 1 queue per port === +1745612617456188 - DROP: Packet 4 at end of ingress (egress_spec == drop_port) +1745612617584171 - DROP: Packet 5 at end of ingress (egress_spec == drop_port) +1745612617584222 - DROP: Packet 6 at end of ingress (egress_spec == drop_port) +1745612617584415 - DROP: Packet 0 at end of ingress (egress_spec == drop_port) +1745612617648447 - DROP: Packet 1 at end of ingress (egress_spec == drop_port) +1745612617648576 - DROP: Packet 2 at end of ingress (egress_spec == drop_port) +1745612617648700 - DROP: Packet 3 at end of ingress (egress_spec == drop_port) +1745612617649158 - DROP: Packet 7 at end of ingress (egress_spec == drop_port) +1745612617651112 - DROP: Packet 4 at end of ingress (egress_spec == drop_port) +1745612617651241 - DROP: Packet 5 at end of ingress (egress_spec == drop_port) +1745612617652449 - DROP: Packet 6 at end of ingress (egress_spec == drop_port) +1745612617713240 - DROP: Packet 7 at end of ingress (egress_spec == drop_port) +1745612617713324 - DROP: Packet 8 at end of ingress (egress_spec == drop_port) +1745612617715590 - DROP: Packet 9 at end of ingress (egress_spec == drop_port) +1745612617715678 - DROP: Packet 10 at end of ingress (egress_spec == drop_port) +1745612617747551 - DROP: Packet 8 at end of ingress (egress_spec == drop_port) +1745612617748747 - DROP: Packet 9 at end of ingress (egress_spec == drop_port) +1745612617773298 - DROP: Packet 11 at end of ingress (egress_spec == drop_port) +1745612617776323 - DROP: Packet 12 at end of ingress (egress_spec == drop_port) +1745612617780596 - DROP: Packet 13 at end of ingress (egress_spec == drop_port) +1745612617781695 - DROP: Packet 14 at end of ingress (egress_spec == drop_port) +1745612617814515 - DROP: Packet 15 at end of ingress (egress_spec == drop_port) +1745612617816417 - DROP: Packet 10 at end of ingress (egress_spec == drop_port) +1745612617876945 - DROP: Packet 16 at end of ingress (egress_spec == drop_port) +1745612617894276 - DROP: Packet 11 at end of ingress (egress_spec == drop_port) +1745612617897582 - DROP: Packet 12 at end of ingress (egress_spec == drop_port) +1745612617958672 - DROP: Packet 17 at end of ingress (egress_spec == drop_port) +=== SimpleSwitch started at 1745612617991588 with 1 queue per port === +1745612617993298 - DROP: Packet 13 at end of ingress (egress_spec == drop_port) +1745612618022488 - DROP: Packet 18 at end of ingress (egress_spec == drop_port) +1745612618032300 - DROP: Packet 14 at end of ingress (egress_spec == drop_port) +1745612618032434 - DROP: Packet 15 at end of ingress (egress_spec == drop_port) +1745612618035351 - DROP: Packet 16 at end of ingress (egress_spec == drop_port) +1745612618095284 - DROP: Packet 19 at end of ingress (egress_spec == drop_port) +1745612618096308 - DROP: Packet 17 at end of ingress (egress_spec == drop_port) +1745612618098550 - DROP: Packet 18 at end of ingress (egress_spec == drop_port) +1745612618101197 - DROP: Packet 19 at end of ingress (egress_spec == drop_port) +1745612618101685 - DROP: Packet 20 at end of ingress (egress_spec == drop_port) +1745612618103838 - DROP: Packet 21 at end of ingress (egress_spec == drop_port) +1745612618132511 - DROP: Packet 20 at end of ingress (egress_spec == drop_port) +1745612618132739 - DROP: Packet 0 at end of ingress (egress_spec == drop_port) +1745612618137180 - DROP: Packet 22 at end of ingress (egress_spec == drop_port) +1745612618144541 - DROP: Packet 21 at end of ingress (egress_spec == drop_port) +1745612618145641 - DROP: Packet 22 at end of ingress (egress_spec == drop_port) +1745612618145663 - DROP: Packet 1 at end of ingress (egress_spec == drop_port) +1745612618160157 - DROP: Packet 23 at end of ingress (egress_spec == drop_port) +1745612618161194 - DROP: Packet 2 at end of ingress (egress_spec == drop_port) +1745612618162307 - DROP: Packet 24 at end of ingress (egress_spec == drop_port) +1745612618165513 - DROP: Packet 25 at end of ingress (egress_spec == drop_port) +1745612618165554 - DROP: Packet 26 at end of ingress (egress_spec == drop_port) +1745612618196458 - DROP: Packet 23 at end of ingress (egress_spec == drop_port) +1745612618196461 - DROP: Packet 27 at end of ingress (egress_spec == drop_port) +1745612618209533 - DROP: Packet 24 at end of ingress (egress_spec == drop_port) +1745612618209742 - DROP: Packet 3 at end of ingress (egress_spec == drop_port) +1745612618225362 - DROP: Packet 25 at end of ingress (egress_spec == drop_port) +1745612618227538 - DROP: Packet 26 at end of ingress (egress_spec == drop_port) +1745612618227587 - DROP: Packet 27 at end of ingress (egress_spec == drop_port) +1745612618261025 - DROP: Packet 28 at end of ingress (egress_spec == drop_port) +1745612618273000 - DROP: Packet 28 at end of ingress (egress_spec == drop_port) +1745612618274216 - DROP: Packet 4 at end of ingress (egress_spec == drop_port) +1745612618278349 - DROP: Packet 29 at end of ingress (egress_spec == drop_port) +1745612618278392 - DROP: Packet 5 at end of ingress (egress_spec == drop_port) +1745612618282363 - DROP: Packet 6 at end of ingress (egress_spec == drop_port) +1745612618282368 - DROP: Packet 30 at end of ingress (egress_spec == drop_port) +1745612618325097 - DROP: Packet 29 at end of ingress (egress_spec == drop_port) +1745612618328294 - DROP: Packet 7 at end of ingress (egress_spec == drop_port) +1745612618328297 - DROP: Packet 31 at end of ingress (egress_spec == drop_port) +1745612618342279 - DROP: Packet 30 at end of ingress (egress_spec == drop_port) +1745612618343268 - DROP: Packet 32 at end of ingress (egress_spec == drop_port) +1745612618396318 - DROP: Packet 33 at end of ingress (egress_spec == drop_port) +1745612618396344 - DROP: Packet 8 at end of ingress (egress_spec == drop_port) +1745612618396449 - DROP: Packet 34 at end of ingress (egress_spec == drop_port) +1745612618407558 - DROP: Packet 35 at end of ingress (egress_spec == drop_port) +1745612618416308 - DROP: Packet 9 at end of ingress (egress_spec == drop_port) +1745612618418397 - DROP: Packet 36 at end of ingress (egress_spec == drop_port) +1745612618460160 - DROP: Packet 10 at end of ingress (egress_spec == drop_port) +1745612618461209 - DROP: Packet 31 at end of ingress (egress_spec == drop_port) +1745612618470214 - DROP: Packet 32 at end of ingress (egress_spec == drop_port) +1745612618522955 - DROP: Packet 11 at end of ingress (egress_spec == drop_port) +1745612618524145 - DROP: Packet 33 at end of ingress (egress_spec == drop_port) +1745612618529171 - DROP: Packet 12 at end of ingress (egress_spec == drop_port) +1745612618529226 - DROP: Packet 37 at end of ingress (egress_spec == drop_port) +1745612618544226 - DROP: Packet 13 at end of ingress (egress_spec == drop_port) +1745612618544363 - DROP: Packet 34 at end of ingress (egress_spec == drop_port) +1745612618592858 - DROP: Packet 35 at end of ingress (egress_spec == drop_port) +1745612618593813 - DROP: Packet 38 at end of ingress (egress_spec == drop_port) +1745612618595892 - DROP: Packet 39 at end of ingress (egress_spec == drop_port) +1745612618596093 - DROP: Packet 14 at end of ingress (egress_spec == drop_port) +1745612618597118 - DROP: Packet 40 at end of ingress (egress_spec == drop_port) +1745612618608335 - DROP: Packet 15 at end of ingress (egress_spec == drop_port) +1745612618608453 - DROP: Packet 16 at end of ingress (egress_spec == drop_port) +1745612618609267 - DROP: Packet 41 at end of ingress (egress_spec == drop_port) +1745612618609380 - DROP: Packet 36 at end of ingress (egress_spec == drop_port) +1745612618611137 - DROP: Packet 17 at end of ingress (egress_spec == drop_port) +1745612618611420 - DROP: Packet 42 at end of ingress (egress_spec == drop_port) +1745612618611614 - DROP: Packet 37 at end of ingress (egress_spec == drop_port) +1745612618611734 - DROP: Packet 38 at end of ingress (egress_spec == drop_port) +1745612618611850 - DROP: Packet 39 at end of ingress (egress_spec == drop_port) +1745612618611969 - DROP: Packet 40 at end of ingress (egress_spec == drop_port) +1745612618612090 - DROP: Packet 41 at end of ingress (egress_spec == drop_port) +1745612618614618 - DROP: Packet 43 at end of ingress (egress_spec == drop_port) +1745612618656928 - DROP: Packet 44 at end of ingress (egress_spec == drop_port) +1745612618660138 - DROP: Packet 42 at end of ingress (egress_spec == drop_port) +1745612618660193 - DROP: Packet 18 at end of ingress (egress_spec == drop_port) +1745612618704389 - DROP: Packet 43 at end of ingress (egress_spec == drop_port) +1745612618708545 - DROP: Packet 45 at end of ingress (egress_spec == drop_port) +1745612618708699 - DROP: Packet 44 at end of ingress (egress_spec == drop_port) +1745612618708827 - DROP: Packet 45 at end of ingress (egress_spec == drop_port) +1745612618709664 - DROP: Packet 19 at end of ingress (egress_spec == drop_port) +1745612618721089 - DROP: Packet 46 at end of ingress (egress_spec == drop_port) +1745612618723016 - DROP: Packet 20 at end of ingress (egress_spec == drop_port) +1745612618724047 - DROP: Packet 47 at end of ingress (egress_spec == drop_port) +1745612618736303 - DROP: Packet 21 at end of ingress (egress_spec == drop_port) +1745612618738317 - DROP: Packet 48 at end of ingress (egress_spec == drop_port) +1745612618738447 - DROP: Packet 49 at end of ingress (egress_spec == drop_port) +1745612618748218 - DROP: Packet 46 at end of ingress (egress_spec == drop_port) +1745612618749461 - DROP: Packet 22 at end of ingress (egress_spec == drop_port) +1745612618750368 - DROP: Packet 47 at end of ingress (egress_spec == drop_port) +1745612618779636 - DROP: Packet 48 at end of ingress (egress_spec == drop_port) +1745612618779861 - DROP: Packet 23 at end of ingress (egress_spec == drop_port) +1745612618814412 - DROP: Packet 50 at end of ingress (egress_spec == drop_port) +1745612618814523 - DROP: Packet 24 at end of ingress (egress_spec == drop_port) +1745612618843528 - DROP: Packet 49 at end of ingress (egress_spec == drop_port) +1745612618843598 - DROP: Packet 51 at end of ingress (egress_spec == drop_port) +1745612618853880 - DROP: Packet 52 at end of ingress (egress_spec == drop_port) +1745612618855114 - DROP: Packet 53 at end of ingress (egress_spec == drop_port) +1745612618855117 - DROP: Packet 25 at end of ingress (egress_spec == drop_port) +1745612618855916 - DROP: Packet 50 at end of ingress (egress_spec == drop_port) +1745612618865330 - DROP: Packet 51 at end of ingress (egress_spec == drop_port) +1745612618907375 - DROP: Packet 52 at end of ingress (egress_spec == drop_port) +1745612618927219 - DROP: Packet 53 at end of ingress (egress_spec == drop_port) +1745612618973413 - DROP: Packet 54 at end of ingress (egress_spec == drop_port) +1745612618978410 - DROP: Packet 26 at end of ingress (egress_spec == drop_port) +1745612618979372 - DROP: Packet 54 at end of ingress (egress_spec == drop_port) +1745612618993259 - DROP: Packet 55 at end of ingress (egress_spec == drop_port) +1745612618994249 - DROP: Packet 55 at end of ingress (egress_spec == drop_port) +1745612618994381 - DROP: Packet 56 at end of ingress (egress_spec == drop_port) +1745612618995516 - DROP: Packet 56 at end of ingress (egress_spec == drop_port) +1745612619043799 - DROP: Packet 57 at end of ingress (egress_spec == drop_port) +1745612619043813 - DROP: Packet 57 at end of ingress (egress_spec == drop_port) +1745612619105536 - DROP: Packet 58 at end of ingress (egress_spec == drop_port) +1745612619105556 - DROP: Packet 58 at end of ingress (egress_spec == drop_port) +1745612619105592 - DROP: Packet 27 at end of ingress (egress_spec == drop_port) +1745612619105691 - DROP: Packet 59 at end of ingress (egress_spec == drop_port) +1745612619108676 - DROP: Packet 59 at end of ingress (egress_spec == drop_port) +1745612619120220 - DROP: Packet 60 at end of ingress (egress_spec == drop_port) +1745612619120252 - DROP: Packet 60 at end of ingress (egress_spec == drop_port) +1745612619132799 - DROP: Packet 61 at end of ingress (egress_spec == drop_port) +1745612619132961 - DROP: Packet 28 at end of ingress (egress_spec == drop_port) +1745612619171138 - DROP: Packet 61 at end of ingress (egress_spec == drop_port) +1745612619198358 - DROP: Packet 62 at end of ingress (egress_spec == drop_port) +1745612619198359 - DROP: Packet 62 at end of ingress (egress_spec == drop_port) +1745612619263029 - DROP: Packet 63 at end of ingress (egress_spec == drop_port) +1745612619325240 - DROP: Packet 63 at end of ingress (egress_spec == drop_port) +1745612619355263 - DROP: Packet 29 at end of ingress (egress_spec == drop_port) +1745612619355327 - DROP: Packet 64 at end of ingress (egress_spec == drop_port) +1745612619355327 - DROP: Packet 64 at end of ingress (egress_spec == drop_port) +1745612619355391 - DROP: Packet 30 at end of ingress (egress_spec == drop_port) +1745612619358665 - DROP: Packet 65 at end of ingress (egress_spec == drop_port) +1745612619358789 - DROP: Packet 66 at end of ingress (egress_spec == drop_port) +1745612619505338 - DROP: Packet 67 at end of ingress (egress_spec == drop_port) +1745612619505371 - DROP: Packet 31 at end of ingress (egress_spec == drop_port) +1745612619555804 - DROP: Packet 32 at end of ingress (egress_spec == drop_port) +1745612619555825 - DROP: Packet 68 at end of ingress (egress_spec == drop_port) +1745612619556882 - DROP: Packet 65 at end of ingress (egress_spec == drop_port) +1745612619559127 - DROP: Packet 69 at end of ingress (egress_spec == drop_port) +1745612619632375 - DROP: Packet 70 at end of ingress (egress_spec == drop_port) +1745612619632379 - DROP: Packet 66 at end of ingress (egress_spec == drop_port) +1745612619632381 - DROP: Packet 33 at end of ingress (egress_spec == drop_port) +1745612619632500 - DROP: Packet 71 at end of ingress (egress_spec == drop_port) +1745612619708466 - DROP: Packet 67 at end of ingress (egress_spec == drop_port) +1745612619709417 - DROP: Packet 34 at end of ingress (egress_spec == drop_port) +1745612619709437 - DROP: Packet 72 at end of ingress (egress_spec == drop_port) +1745612619709558 - DROP: Packet 73 at end of ingress (egress_spec == drop_port) +1745612619791692 - DROP: Packet 68 at end of ingress (egress_spec == drop_port) +1745612619792806 - DROP: Packet 35 at end of ingress (egress_spec == drop_port) +1745612619794123 - DROP: Packet 69 at end of ingress (egress_spec == drop_port) +1745612619855365 - DROP: Packet 36 at end of ingress (egress_spec == drop_port) +1745612619855370 - DROP: Packet 74 at end of ingress (egress_spec == drop_port) +1745612619919595 - DROP: Packet 75 at end of ingress (egress_spec == drop_port) +1745612619919667 - DROP: Packet 37 at end of ingress (egress_spec == drop_port) +1745612620175066 - DROP: Packet 70 at end of ingress (egress_spec == drop_port) +1745612620175130 - DROP: Packet 38 at end of ingress (egress_spec == drop_port) +1745612620239186 - DROP: Packet 76 at end of ingress (egress_spec == drop_port) +1745612620240223 - DROP: Packet 71 at end of ingress (egress_spec == drop_port) +1745612620305611 - DROP: Packet 72 at end of ingress (egress_spec == drop_port) +1745612620366746 - DROP: Packet 77 at end of ingress (egress_spec == drop_port) +1745612620749644 - DROP: Packet 78 at end of ingress (egress_spec == drop_port) +1745612620750625 - DROP: Packet 73 at end of ingress (egress_spec == drop_port) +1745612620750663 - DROP: Packet 39 at end of ingress (egress_spec == drop_port) +1745612620751984 - DROP: Packet 79 at end of ingress (egress_spec == drop_port) +1745612620752875 - DROP: Packet 74 at end of ingress (egress_spec == drop_port) +1745612620752904 - DROP: Packet 40 at end of ingress (egress_spec == drop_port) +1745612620753010 - DROP: Packet 75 at end of ingress (egress_spec == drop_port) +1745612620815230 - DROP: Packet 80 at end of ingress (egress_spec == drop_port) +1745612620815232 - DROP: Packet 41 at end of ingress (egress_spec == drop_port) +1745612620877535 - DROP: Packet 81 at end of ingress (egress_spec == drop_port) +1745612620878648 - DROP: Packet 42 at end of ingress (egress_spec == drop_port) +1745612621133429 - DROP: Packet 43 at end of ingress (egress_spec == drop_port) +1745612621133432 - DROP: Packet 76 at end of ingress (egress_spec == drop_port) +1745612621198861 - DROP: Packet 77 at end of ingress (egress_spec == drop_port) +1745612621198889 - DROP: Packet 82 at end of ingress (egress_spec == drop_port) +1745612621262599 - DROP: Packet 78 at end of ingress (egress_spec == drop_port) +1745612621325872 - DROP: Packet 83 at end of ingress (egress_spec == drop_port) +1745612621616362 - DROP: Packet 44 at end of ingress (egress_spec == drop_port) +1745612621616551 - DROP: Packet 79 at end of ingress (egress_spec == drop_port) +1745612621681342 - DROP: Packet 84 at end of ingress (egress_spec == drop_port) +1745612621709604 - DROP: Packet 80 at end of ingress (egress_spec == drop_port) +1745612621709680 - DROP: Packet 45 at end of ingress (egress_spec == drop_port) +1745612621709680 - DROP: Packet 85 at end of ingress (egress_spec == drop_port) +1745612621711924 - DROP: Packet 86 at end of ingress (egress_spec == drop_port) +1745612621744352 - DROP: Packet 46 at end of ingress (egress_spec == drop_port) +1745612621745329 - DROP: Packet 81 at end of ingress (egress_spec == drop_port) +1745612621872282 - DROP: Packet 87 at end of ingress (egress_spec == drop_port) +1745612621872282 - DROP: Packet 82 at end of ingress (egress_spec == drop_port) +1745612621985266 - DROP: Packet 83 at end of ingress (egress_spec == drop_port) +1745612621986396 - DROP: Packet 84 at end of ingress (egress_spec == drop_port) +1745612621987468 - DROP: Packet 47 at end of ingress (egress_spec == drop_port) +1745612622000369 - DROP: Packet 85 at end of ingress (egress_spec == drop_port) +1745612622001325 - DROP: Packet 48 at end of ingress (egress_spec == drop_port) +1745612622050610 - DROP: Packet 88 at end of ingress (egress_spec == drop_port) +1745612622050617 - DROP: Packet 49 at end of ingress (egress_spec == drop_port) +1745612622114310 - DROP: Packet 89 at end of ingress (egress_spec == drop_port) +1745612622115362 - DROP: Packet 50 at end of ingress (egress_spec == drop_port) +1745612622128267 - DROP: Packet 86 at end of ingress (egress_spec == drop_port) +1745612622256304 - DROP: Packet 90 at end of ingress (egress_spec == drop_port) +1745612622256330 - DROP: Packet 87 at end of ingress (egress_spec == drop_port) +1745612622370548 - DROP: Packet 88 at end of ingress (egress_spec == drop_port) +1745612622370550 - DROP: Packet 51 at end of ingress (egress_spec == drop_port) +1745612622384382 - DROP: Packet 91 at end of ingress (egress_spec == drop_port) +1745612622384385 - DROP: Packet 52 at end of ingress (egress_spec == drop_port) +1745612622433660 - DROP: Packet 89 at end of ingress (egress_spec == drop_port) +1745612622434731 - DROP: Packet 92 at end of ingress (egress_spec == drop_port) +1745612622499075 - DROP: Packet 90 at end of ingress (egress_spec == drop_port) +1745612622512371 - DROP: Packet 53 at end of ingress (egress_spec == drop_port) +1745612622512435 - DROP: Packet 93 at end of ingress (egress_spec == drop_port) +1745612622512532 - DROP: Packet 94 at end of ingress (egress_spec == drop_port) +1745612622562203 - DROP: Packet 95 at end of ingress (egress_spec == drop_port) +1745612622945834 - DROP: Packet 54 at end of ingress (egress_spec == drop_port) +1745612622946062 - DROP: Packet 91 at end of ingress (egress_spec == drop_port) +1745612622948017 - DROP: Packet 96 at end of ingress (egress_spec == drop_port) +1745612622950250 - DROP: Packet 97 at end of ingress (egress_spec == drop_port) +1745612624750971 - DROP: Packet 55 at end of ingress (egress_spec == drop_port) +1745612624750992 - DROP: Packet 92 at end of ingress (egress_spec == drop_port) +1745612624752185 - DROP: Packet 93 at end of ingress (egress_spec == drop_port) +1745612624815237 - DROP: Packet 56 at end of ingress (egress_spec == drop_port) +1745612624816387 - DROP: Packet 98 at end of ingress (egress_spec == drop_port) +1745612624877572 - DROP: Packet 99 at end of ingress (egress_spec == drop_port) +1745612624878470 - DROP: Packet 57 at end of ingress (egress_spec == drop_port) +1745612625133205 - DROP: Packet 58 at end of ingress (egress_spec == drop_port) +1745612625133324 - DROP: Packet 94 at end of ingress (egress_spec == drop_port) +1745612625199563 - DROP: Packet 95 at end of ingress (egress_spec == drop_port) +1745612625199625 - DROP: Packet 100 at end of ingress (egress_spec == drop_port) +1745612625263237 - DROP: Packet 96 at end of ingress (egress_spec == drop_port) +1745612625326457 - DROP: Packet 101 at end of ingress (egress_spec == drop_port) +1745612625710085 - DROP: Packet 59 at end of ingress (egress_spec == drop_port) +1745612625710271 - DROP: Packet 97 at end of ingress (egress_spec == drop_port) +1745612625712262 - DROP: Packet 102 at end of ingress (egress_spec == drop_port) +1745612625713393 - DROP: Packet 103 at end of ingress (egress_spec == drop_port) +1745612625832583 - ENQUEUE: Packet 104 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612629168263 - DROP: Packet 105 at end of ingress (egress_spec == drop_port) +1745612629168345 - DROP: Packet 98 at end of ingress (egress_spec == drop_port) +1745612629168466 - DROP: Packet 99 at end of ingress (egress_spec == drop_port) +1745612629168941 - DROP: Packet 60 at end of ingress (egress_spec == drop_port) +1745612629680288 - DROP: Packet 61 at end of ingress (egress_spec == drop_port) +1745612629680291 - DROP: Packet 106 at end of ingress (egress_spec == drop_port) +1745612629680367 - DROP: Packet 100 at end of ingress (egress_spec == drop_port) +1745612629682480 - DROP: Packet 62 at end of ingress (egress_spec == drop_port) +1745612629682523 - DROP: Packet 107 at end of ingress (egress_spec == drop_port) +1745612630192255 - DROP: Packet 108 at end of ingress (egress_spec == drop_port) +1745612630192422 - DROP: Packet 101 at end of ingress (egress_spec == drop_port) +1745612630194709 - DROP: Packet 102 at end of ingress (egress_spec == drop_port) +1745612630705164 - DROP: Packet 63 at end of ingress (egress_spec == drop_port) +1745612631216218 - DROP: Packet 109 at end of ingress (egress_spec == drop_port) +1745612631216291 - DROP: Packet 103 at end of ingress (egress_spec == drop_port) +1745612631728175 - DROP: Packet 110 at end of ingress (egress_spec == drop_port) +1745612631729344 - DROP: Packet 64 at end of ingress (egress_spec == drop_port) +1745612632755214 - DROP: Packet 104 at end of ingress (egress_spec == drop_port) +1745612632755340 - DROP: Packet 105 at end of ingress (egress_spec == drop_port) +1745612632756315 - DROP: Packet 65 at end of ingress (egress_spec == drop_port) +1745612632816376 - DROP: Packet 111 at end of ingress (egress_spec == drop_port) +1745612632817622 - DROP: Packet 66 at end of ingress (egress_spec == drop_port) +1745612632877752 - DROP: Packet 67 at end of ingress (egress_spec == drop_port) +1745612632878638 - DROP: Packet 112 at end of ingress (egress_spec == drop_port) +1745612633133595 - DROP: Packet 106 at end of ingress (egress_spec == drop_port) +1745612633134596 - DROP: Packet 68 at end of ingress (egress_spec == drop_port) +1745612633199873 - DROP: Packet 113 at end of ingress (egress_spec == drop_port) +1745612633200094 - DROP: Packet 107 at end of ingress (egress_spec == drop_port) +1745612633263737 - DROP: Packet 108 at end of ingress (egress_spec == drop_port) +1745612633326805 - DROP: Packet 114 at end of ingress (egress_spec == drop_port) +1745612633710882 - DROP: Packet 115 at end of ingress (egress_spec == drop_port) +1745612633711099 - DROP: Packet 69 at end of ingress (egress_spec == drop_port) +1745612633712214 - DROP: Packet 109 at end of ingress (egress_spec == drop_port) +1745612633713028 - DROP: Packet 116 at end of ingress (egress_spec == drop_port) +1745612635833960 - ENQUEUE: Packet 117 to port 4 with priority 0 (queue 0), queue depth before: 0 +1745612642992239 - DROP: Packet 70 at end of ingress (egress_spec == drop_port) +1745612642992415 - DROP: Packet 110 at end of ingress (egress_spec == drop_port) +1745612643504207 - DROP: Packet 118 at end of ingress (egress_spec == drop_port) +1745612643504297 - DROP: Packet 111 at end of ingress (egress_spec == drop_port) +1745612644015226 - DROP: Packet 71 at end of ingress (egress_spec == drop_port) +1745612644016275 - DROP: Packet 119 at end of ingress (egress_spec == drop_port) +1745612645040119 - DROP: Packet 72 at end of ingress (egress_spec == drop_port) +1745612645040177 - DROP: Packet 112 at end of ingress (egress_spec == drop_port) +1745612645552198 - DROP: Packet 113 at end of ingress (egress_spec == drop_port) +1745612645552232 - DROP: Packet 120 at end of ingress (egress_spec == drop_port) +1745612646064300 - DROP: Packet 114 at end of ingress (egress_spec == drop_port) +1745612646065229 - DROP: Packet 121 at end of ingress (egress_spec == drop_port) +1745612648133311 - DROP: Packet 73 at end of ingress (egress_spec == drop_port) +1745612648629524 - DROP: Packet 122 at end of ingress (egress_spec == drop_port) +1745612648756088 - DROP: Packet 74 at end of ingress (egress_spec == drop_port) +1745612648758243 - DROP: Packet 115 at end of ingress (egress_spec == drop_port) +1745612648761532 - DROP: Packet 116 at end of ingress (egress_spec == drop_port) +1745612648816505 - DROP: Packet 123 at end of ingress (egress_spec == drop_port) +1745612648816624 - DROP: Packet 75 at end of ingress (egress_spec == drop_port) +1745612648879881 - DROP: Packet 124 at end of ingress (egress_spec == drop_port) +1745612648880110 - DROP: Packet 76 at end of ingress (egress_spec == drop_port) +1745612649133976 - DROP: Packet 77 at end of ingress (egress_spec == drop_port) +1745612649133982 - DROP: Packet 117 at end of ingress (egress_spec == drop_port) +1745612649200318 - DROP: Packet 125 at end of ingress (egress_spec == drop_port) +1745612649201428 - DROP: Packet 118 at end of ingress (egress_spec == drop_port) +1745612649264047 - DROP: Packet 119 at end of ingress (egress_spec == drop_port) +1745612649327379 - DROP: Packet 126 at end of ingress (egress_spec == drop_port) +1745612649711308 - DROP: Packet 127 at end of ingress (egress_spec == drop_port) +1745612649711407 - DROP: Packet 78 at end of ingress (egress_spec == drop_port) +1745612649711412 - DROP: Packet 120 at end of ingress (egress_spec == drop_port) +1745612649713498 - DROP: Packet 128 at end of ingress (egress_spec == drop_port) +1745612650160437 - DROP: Packet 121 at end of ingress (egress_spec == drop_port) +1745612651184197 - DROP: Packet 129 at end of ingress (egress_spec == drop_port) +1745612651184291 - DROP: Packet 79 at end of ingress (egress_spec == drop_port) +1745612670128401 - DROP: Packet 80 at end of ingress (egress_spec == drop_port) +1745612670128417 - DROP: Packet 122 at end of ingress (egress_spec == drop_port) +1745612671664211 - DROP: Packet 130 at end of ingress (egress_spec == drop_port) +1745612671664309 - DROP: Packet 123 at end of ingress (egress_spec == drop_port) +1745612671664383 - DROP: Packet 81 at end of ingress (egress_spec == drop_port) +1745612671666366 - DROP: Packet 131 at end of ingress (egress_spec == drop_port) +1745612675760417 - DROP: Packet 82 at end of ingress (egress_spec == drop_port) +1745612675761506 - DROP: Packet 124 at end of ingress (egress_spec == drop_port) +1745612676784171 - DROP: Packet 132 at end of ingress (egress_spec == drop_port) +1745612676784292 - DROP: Packet 125 at end of ingress (egress_spec == drop_port) +1745612677808419 - DROP: Packet 126 at end of ingress (egress_spec == drop_port) +1745612680756643 - DROP: Packet 127 at end of ingress (egress_spec == drop_port) +1745612680756777 - DROP: Packet 128 at end of ingress (egress_spec == drop_port) +1745612680757829 - DROP: Packet 83 at end of ingress (egress_spec == drop_port) +1745612680816873 - DROP: Packet 133 at end of ingress (egress_spec == drop_port) +1745612680817059 - DROP: Packet 84 at end of ingress (egress_spec == drop_port) +1745612680880208 - DROP: Packet 134 at end of ingress (egress_spec == drop_port) +1745612680880412 - DROP: Packet 85 at end of ingress (egress_spec == drop_port) +1745612680881306 - DROP: Packet 135 at end of ingress (egress_spec == drop_port) +1745612681134323 - DROP: Packet 86 at end of ingress (egress_spec == drop_port) +1745612681134325 - DROP: Packet 129 at end of ingress (egress_spec == drop_port) +1745612681200347 - DROP: Packet 136 at end of ingress (egress_spec == drop_port) +1745612681200481 - DROP: Packet 130 at end of ingress (egress_spec == drop_port) +1745612681264116 - DROP: Packet 131 at end of ingress (egress_spec == drop_port) +1745612681327091 - DROP: Packet 137 at end of ingress (egress_spec == drop_port) +1745612681711881 - DROP: Packet 138 at end of ingress (egress_spec == drop_port) +1745612681712142 - DROP: Packet 87 at end of ingress (egress_spec == drop_port) +1745612681712980 - DROP: Packet 132 at end of ingress (egress_spec == drop_port) +1745612681714019 - DROP: Packet 139 at end of ingress (egress_spec == drop_port) +1745612684976243 - DROP: Packet 140 at end of ingress (egress_spec == drop_port) +1745612684977250 - DROP: Packet 88 at end of ingress (egress_spec == drop_port) +1745612689072220 - DROP: Packet 89 at end of ingress (egress_spec == drop_port) +1745612689072221 - DROP: Packet 141 at end of ingress (egress_spec == drop_port) +1745612689073256 - DROP: Packet 133 at end of ingress (egress_spec == drop_port) +1745612725936277 - DROP: Packet 142 at end of ingress (egress_spec == drop_port) +1745612725937227 - DROP: Packet 134 at end of ingress (egress_spec == drop_port) +1745612725937300 - DROP: Packet 90 at end of ingress (egress_spec == drop_port) +1745612725939451 - DROP: Packet 91 at end of ingress (egress_spec == drop_port) +1745612730032263 - DROP: Packet 135 at end of ingress (egress_spec == drop_port) +1745612730032267 - DROP: Packet 143 at end of ingress (egress_spec == drop_port) +1745612734049679 - ENQUEUE: Packet 144 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612735088294 - ENQUEUE: Packet 145 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612736112407 - ENQUEUE: Packet 146 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612737156188 - ENQUEUE: Packet 147 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612738160385 - ENQUEUE: Packet 148 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612738224206 - DROP: Packet 136 at end of ingress (egress_spec == drop_port) +1745612738224233 - DROP: Packet 149 at end of ingress (egress_spec == drop_port) +1745612738225310 - DROP: Packet 92 at end of ingress (egress_spec == drop_port) +1745612738227387 - DROP: Packet 137 at end of ingress (egress_spec == drop_port) +1745612739184300 - ENQUEUE: Packet 150 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612741232368 - ENQUEUE: Packet 151 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612744757174 - DROP: Packet 93 at end of ingress (egress_spec == drop_port) +1745612744757195 - DROP: Packet 138 at end of ingress (egress_spec == drop_port) +1745612744759416 - DROP: Packet 139 at end of ingress (egress_spec == drop_port) +1745612744817491 - DROP: Packet 152 at end of ingress (egress_spec == drop_port) +1745612744817547 - DROP: Packet 94 at end of ingress (egress_spec == drop_port) +1745612744880772 - DROP: Packet 153 at end of ingress (egress_spec == drop_port) +1745612744880950 - DROP: Packet 95 at end of ingress (egress_spec == drop_port) +1745612745134609 - DROP: Packet 96 at end of ingress (egress_spec == drop_port) +1745612745134739 - DROP: Packet 140 at end of ingress (egress_spec == drop_port) +1745612745200740 - DROP: Packet 154 at end of ingress (egress_spec == drop_port) +1745612745200927 - DROP: Packet 141 at end of ingress (egress_spec == drop_port) +1745612745264119 - DROP: Packet 142 at end of ingress (egress_spec == drop_port) +1745612745264260 - ENQUEUE: Packet 155 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612745327306 - DROP: Packet 156 at end of ingress (egress_spec == drop_port) +1745612745712211 - DROP: Packet 157 at end of ingress (egress_spec == drop_port) +1745612745712264 - DROP: Packet 158 at end of ingress (egress_spec == drop_port) +1745612745712363 - DROP: Packet 97 at end of ingress (egress_spec == drop_port) +1745612745712419 - DROP: Packet 143 at end of ingress (egress_spec == drop_port) +1745612746415397 - DROP: Packet 144 at end of ingress (egress_spec == drop_port) +1745612750513285 - DROP: Packet 159 at end of ingress (egress_spec == drop_port) +1745612753584353 - ENQUEUE: Packet 160 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745612754608397 - DROP: Packet 161 at end of ingress (egress_spec == drop_port) +1745612758705368 - DROP: Packet 98 at end of ingress (egress_spec == drop_port) +1745612762800455 - DROP: Packet 145 at end of ingress (egress_spec == drop_port) +1745612766896227 - DROP: Packet 162 at end of ingress (egress_spec == drop_port) +1745612766897422 - DROP: Packet 99 at end of ingress (egress_spec == drop_port) +1745612832432276 - DROP: Packet 163 at end of ingress (egress_spec == drop_port) +1745612832432400 - DROP: Packet 100 at end of ingress (egress_spec == drop_port) +1745612840623381 - DROP: Packet 146 at end of ingress (egress_spec == drop_port) +1745612840624416 - DROP: Packet 101 at end of ingress (egress_spec == drop_port) +1745612844720202 - DROP: Packet 164 at end of ingress (egress_spec == drop_port) +1745612844720424 - DROP: Packet 147 at end of ingress (egress_spec == drop_port) +1745612852912480 - DROP: Packet 148 at end of ingress (egress_spec == drop_port) +1745612852913512 - DROP: Packet 102 at end of ingress (egress_spec == drop_port) +1745612861104184 - DROP: Packet 165 at end of ingress (egress_spec == drop_port) +1745612861104408 - DROP: Packet 149 at end of ingress (egress_spec == drop_port) +1745612872757777 - DROP: Packet 150 at end of ingress (egress_spec == drop_port) +1745612872758904 - DROP: Packet 103 at end of ingress (egress_spec == drop_port) +1745612872760223 - DROP: Packet 151 at end of ingress (egress_spec == drop_port) +1745612872817836 - DROP: Packet 166 at end of ingress (egress_spec == drop_port) +1745612872818063 - DROP: Packet 104 at end of ingress (egress_spec == drop_port) +1745612872881149 - DROP: Packet 167 at end of ingress (egress_spec == drop_port) +1745612872881243 - DROP: Packet 105 at end of ingress (egress_spec == drop_port) +1745612873135122 - DROP: Packet 106 at end of ingress (egress_spec == drop_port) +1745612873136267 - DROP: Packet 152 at end of ingress (egress_spec == drop_port) +1745612873201079 - DROP: Packet 168 at end of ingress (egress_spec == drop_port) +1745612873201221 - DROP: Packet 153 at end of ingress (egress_spec == drop_port) +1745612873264533 - DROP: Packet 154 at end of ingress (egress_spec == drop_port) +1745612873327537 - DROP: Packet 169 at end of ingress (egress_spec == drop_port) +1745612873713201 - DROP: Packet 170 at end of ingress (egress_spec == drop_port) +1745612873713331 - DROP: Packet 155 at end of ingress (egress_spec == drop_port) +1745612873713354 - DROP: Packet 107 at end of ingress (egress_spec == drop_port) +1745612873715353 - DROP: Packet 171 at end of ingress (egress_spec == drop_port) +1745612877489470 - DROP: Packet 156 at end of ingress (egress_spec == drop_port) +1745612889776352 - DROP: Packet 172 at end of ingress (egress_spec == drop_port) +1745612893872263 - DROP: Packet 173 at end of ingress (egress_spec == drop_port) +1745612897969400 - DROP: Packet 108 at end of ingress (egress_spec == drop_port) +1745612902064489 - DROP: Packet 157 at end of ingress (egress_spec == drop_port) +1745612922544282 - DROP: Packet 174 at end of ingress (egress_spec == drop_port) +1745612922544416 - DROP: Packet 109 at end of ingress (egress_spec == drop_port) +1745613037232228 - DROP: Packet 175 at end of ingress (egress_spec == drop_port) +1745613037232300 - DROP: Packet 110 at end of ingress (egress_spec == drop_port) +1745613070000398 - DROP: Packet 111 at end of ingress (egress_spec == drop_port) +1745613070000435 - DROP: Packet 158 at end of ingress (egress_spec == drop_port) +1745613074096349 - DROP: Packet 176 at end of ingress (egress_spec == drop_port) +1745613074096390 - DROP: Packet 159 at end of ingress (egress_spec == drop_port) +1745613082288483 - DROP: Packet 112 at end of ingress (egress_spec == drop_port) +1745613082288482 - DROP: Packet 160 at end of ingress (egress_spec == drop_port) +1745613094576236 - DROP: Packet 177 at end of ingress (egress_spec == drop_port) +1745613094576404 - DROP: Packet 161 at end of ingress (egress_spec == drop_port) +1745613128759717 - DROP: Packet 162 at end of ingress (egress_spec == drop_port) +1745613128759723 - DROP: Packet 113 at end of ingress (egress_spec == drop_port) +1745613128761018 - DROP: Packet 163 at end of ingress (egress_spec == drop_port) +1745613128818827 - DROP: Packet 114 at end of ingress (egress_spec == drop_port) +1745613128818840 - DROP: Packet 178 at end of ingress (egress_spec == drop_port) +1745613128881979 - DROP: Packet 179 at end of ingress (egress_spec == drop_port) +1745613128882139 - DROP: Packet 115 at end of ingress (egress_spec == drop_port) +1745613129134848 - DROP: Packet 116 at end of ingress (egress_spec == drop_port) +1745613129136009 - DROP: Packet 164 at end of ingress (egress_spec == drop_port) +1745613129201880 - DROP: Packet 180 at end of ingress (egress_spec == drop_port) +1745613129202111 - DROP: Packet 165 at end of ingress (egress_spec == drop_port) +1745613129266507 - DROP: Packet 166 at end of ingress (egress_spec == drop_port) +1745613129328519 - DROP: Packet 181 at end of ingress (egress_spec == drop_port) +1745613129714290 - DROP: Packet 182 at end of ingress (egress_spec == drop_port) +1745613129714361 - DROP: Packet 117 at end of ingress (egress_spec == drop_port) +1745613129714366 - DROP: Packet 167 at end of ingress (egress_spec == drop_port) +1745613129716468 - DROP: Packet 183 at end of ingress (egress_spec == drop_port) +1745613160113580 - DROP: Packet 168 at end of ingress (egress_spec == drop_port) +1745613192880332 - DROP: Packet 184 at end of ingress (egress_spec == drop_port) +1745613192881312 - DROP: Packet 169 at end of ingress (egress_spec == drop_port) +1745613192881381 - DROP: Packet 118 at end of ingress (egress_spec == drop_port) +1745613192882513 - DROP: Packet 185 at end of ingress (egress_spec == drop_port) +1745613258416228 - DROP: Packet 186 at end of ingress (egress_spec == drop_port) +1745613258416441 - DROP: Packet 119 at end of ingress (egress_spec == drop_port) +1745613455024284 - DROP: Packet 187 at end of ingress (egress_spec == drop_port) +1745613455024432 - DROP: Packet 120 at end of ingress (egress_spec == drop_port) +1745613520560312 - DROP: Packet 170 at end of ingress (egress_spec == drop_port) +1745613520560321 - DROP: Packet 121 at end of ingress (egress_spec == drop_port) +1745613553328194 - DROP: Packet 188 at end of ingress (egress_spec == drop_port) +1745613553328389 - DROP: Packet 171 at end of ingress (egress_spec == drop_port) +1745613553328449 - DROP: Packet 122 at end of ingress (egress_spec == drop_port) +1745613553328516 - DROP: Packet 172 at end of ingress (egress_spec == drop_port) +1745613553329745 - DROP: Packet 173 at end of ingress (egress_spec == drop_port) +1745613553330351 - DROP: Packet 189 at end of ingress (egress_spec == drop_port) +1745613640762135 - DROP: Packet 123 at end of ingress (egress_spec == drop_port) +1745613640762170 - DROP: Packet 174 at end of ingress (egress_spec == drop_port) +1745613640764451 - DROP: Packet 175 at end of ingress (egress_spec == drop_port) +1745613640819342 - DROP: Packet 190 at end of ingress (egress_spec == drop_port) +1745613640819404 - DROP: Packet 124 at end of ingress (egress_spec == drop_port) +1745613640882677 - DROP: Packet 191 at end of ingress (egress_spec == drop_port) +1745613640882920 - DROP: Packet 125 at end of ingress (egress_spec == drop_port) +1745613641136918 - DROP: Packet 126 at end of ingress (egress_spec == drop_port) +1745613641136918 - DROP: Packet 176 at end of ingress (egress_spec == drop_port) +1745613641202924 - DROP: Packet 192 at end of ingress (egress_spec == drop_port) +1745613641203192 - DROP: Packet 177 at end of ingress (egress_spec == drop_port) +1745613641265397 - DROP: Packet 178 at end of ingress (egress_spec == drop_port) +1745613641328667 - DROP: Packet 193 at end of ingress (egress_spec == drop_port) +1745613641714531 - DROP: Packet 194 at end of ingress (egress_spec == drop_port) +1745613641714593 - DROP: Packet 127 at end of ingress (egress_spec == drop_port) +1745613641714640 - DROP: Packet 179 at end of ingress (egress_spec == drop_port) +1745613641716770 - DROP: Packet 195 at end of ingress (egress_spec == drop_port) +1745613684401483 - DROP: Packet 180 at end of ingress (egress_spec == drop_port) +1745613749936383 - DROP: Packet 196 at end of ingress (egress_spec == drop_port) +1745613749937318 - DROP: Packet 181 at end of ingress (egress_spec == drop_port) +1745613749937353 - DROP: Packet 128 at end of ingress (egress_spec == drop_port) +1745613749938627 - DROP: Packet 197 at end of ingress (egress_spec == drop_port) +1745613913776423 - DROP: Packet 129 at end of ingress (egress_spec == drop_port) +1745613913776430 - DROP: Packet 198 at end of ingress (egress_spec == drop_port) +=== SimpleSwitch started at 1745614182746844 with 1 queue per port === +1745614182880619 - DROP: Packet 0 at end of ingress (egress_spec == drop_port) +1745614182959341 - DROP: Packet 1 at end of ingress (egress_spec == drop_port) +1745614182999081 - DROP: Packet 2 at end of ingress (egress_spec == drop_port) +1745614183088218 - DROP: Packet 3 at end of ingress (egress_spec == drop_port) +1745614183089321 - DROP: Packet 4 at end of ingress (egress_spec == drop_port) +1745614183151107 - DROP: Packet 5 at end of ingress (egress_spec == drop_port) +1745614183215086 - DROP: Packet 6 at end of ingress (egress_spec == drop_port) +1745614183280165 - DROP: Packet 7 at end of ingress (egress_spec == drop_port) +=== SimpleSwitch started at 1745614183301005 with 1 queue per port === +1745614183345154 - DROP: Packet 8 at end of ingress (egress_spec == drop_port) +1745614183407414 - DROP: Packet 0 at end of ingress (egress_spec == drop_port) +1745614183471260 - DROP: Packet 1 at end of ingress (egress_spec == drop_port) +1745614183472134 - DROP: Packet 9 at end of ingress (egress_spec == drop_port) +1745614183473253 - DROP: Packet 2 at end of ingress (egress_spec == drop_port) +1745614183473253 - DROP: Packet 10 at end of ingress (egress_spec == drop_port) +1745614183793324 - DROP: Packet 3 at end of ingress (egress_spec == drop_port) +1745614183794534 - DROP: Packet 4 at end of ingress (egress_spec == drop_port) +1745614183797303 - DROP: Packet 5 at end of ingress (egress_spec == drop_port) +=== SimpleSwitch started at 1745614183846134 with 1 queue per port === +1745614183892708 - DROP: Packet 6 at end of ingress (egress_spec == drop_port) +1745614183893964 - DROP: Packet 0 at end of ingress (egress_spec == drop_port) +1745614183920356 - DROP: Packet 11 at end of ingress (egress_spec == drop_port) +1745614183921555 - DROP: Packet 12 at end of ingress (egress_spec == drop_port) +1745614183922157 - DROP: Packet 13 at end of ingress (egress_spec == drop_port) +1745614183943504 - DROP: Packet 1 at end of ingress (egress_spec == drop_port) +1745614183944528 - DROP: Packet 7 at end of ingress (egress_spec == drop_port) +1745614183983355 - DROP: Packet 8 at end of ingress (egress_spec == drop_port) +1745614183984418 - DROP: Packet 14 at end of ingress (egress_spec == drop_port) +1745614183984572 - DROP: Packet 9 at end of ingress (egress_spec == drop_port) +1745614183986649 - DROP: Packet 15 at end of ingress (egress_spec == drop_port) +1745614183987144 - DROP: Packet 10 at end of ingress (egress_spec == drop_port) +1745614183987170 - DROP: Packet 16 at end of ingress (egress_spec == drop_port) +1745614184019434 - DROP: Packet 17 at end of ingress (egress_spec == drop_port) +1745614184047085 - DROP: Packet 18 at end of ingress (egress_spec == drop_port) +1745614184047273 - DROP: Packet 11 at end of ingress (egress_spec == drop_port) +1745614184048194 - DROP: Packet 19 at end of ingress (egress_spec == drop_port) +1745614184049641 - DROP: Packet 12 at end of ingress (egress_spec == drop_port) +1745614184049772 - DROP: Packet 13 at end of ingress (egress_spec == drop_port) +1745614184049898 - DROP: Packet 14 at end of ingress (egress_spec == drop_port) +1745614184050311 - DROP: Packet 20 at end of ingress (egress_spec == drop_port) +1745614184050478 - DROP: Packet 15 at end of ingress (egress_spec == drop_port) +1745614184052344 - DROP: Packet 16 at end of ingress (egress_spec == drop_port) +1745614184055220 - DROP: Packet 17 at end of ingress (egress_spec == drop_port) +1745614184071241 - DROP: Packet 21 at end of ingress (egress_spec == drop_port) +1745614184083281 - DROP: Packet 22 at end of ingress (egress_spec == drop_port) +1745614184084520 - DROP: Packet 18 at end of ingress (egress_spec == drop_port) +1745614184111067 - DROP: Packet 23 at end of ingress (egress_spec == drop_port) +1745614184112154 - DROP: Packet 2 at end of ingress (egress_spec == drop_port) +1745614184112172 - DROP: Packet 24 at end of ingress (egress_spec == drop_port) +1745614184113258 - DROP: Packet 3 at end of ingress (egress_spec == drop_port) +1745614184114049 - DROP: Packet 4 at end of ingress (egress_spec == drop_port) +1745614184114058 - DROP: Packet 25 at end of ingress (egress_spec == drop_port) +1745614184135335 - DROP: Packet 26 at end of ingress (egress_spec == drop_port) +1745614184135542 - DROP: Packet 19 at end of ingress (egress_spec == drop_port) +1745614184150960 - DROP: Packet 20 at end of ingress (egress_spec == drop_port) +1745614184168306 - DROP: Packet 21 at end of ingress (egress_spec == drop_port) +1745614184175277 - DROP: Packet 22 at end of ingress (egress_spec == drop_port) +1745614184176330 - DROP: Packet 5 at end of ingress (egress_spec == drop_port) +1745614184176497 - DROP: Packet 23 at end of ingress (egress_spec == drop_port) +1745614184178619 - DROP: Packet 6 at end of ingress (egress_spec == drop_port) +1745614184179246 - DROP: Packet 24 at end of ingress (egress_spec == drop_port) +1745614184180408 - DROP: Packet 7 at end of ingress (egress_spec == drop_port) +1745614184194493 - DROP: Packet 8 at end of ingress (egress_spec == drop_port) +1745614184195549 - DROP: Packet 25 at end of ingress (egress_spec == drop_port) +1745614184199485 - DROP: Packet 27 at end of ingress (egress_spec == drop_port) +1745614184199712 - DROP: Packet 26 at end of ingress (egress_spec == drop_port) +1745614184200617 - DROP: Packet 28 at end of ingress (egress_spec == drop_port) +1745614184201007 - DROP: Packet 27 at end of ingress (egress_spec == drop_port) +1745614184203262 - DROP: Packet 28 at end of ingress (egress_spec == drop_port) +1745614184211583 - DROP: Packet 29 at end of ingress (egress_spec == drop_port) +1745614184212879 - DROP: Packet 9 at end of ingress (egress_spec == drop_port) +1745614184215056 - DROP: Packet 30 at end of ingress (egress_spec == drop_port) +1745614184231321 - DROP: Packet 29 at end of ingress (egress_spec == drop_port) +1745614184232241 - DROP: Packet 31 at end of ingress (egress_spec == drop_port) +1745614184240252 - DROP: Packet 30 at end of ingress (egress_spec == drop_port) +1745614184240254 - DROP: Packet 10 at end of ingress (egress_spec == drop_port) +1745614184262038 - DROP: Packet 11 at end of ingress (egress_spec == drop_port) +1745614184262930 - DROP: Packet 32 at end of ingress (egress_spec == drop_port) +1745614184276123 - DROP: Packet 12 at end of ingress (egress_spec == drop_port) +1745614184277357 - DROP: Packet 31 at end of ingress (egress_spec == drop_port) +1745614184320544 - DROP: Packet 33 at end of ingress (egress_spec == drop_port) +1745614184325635 - DROP: Packet 13 at end of ingress (egress_spec == drop_port) +1745614184325797 - DROP: Packet 32 at end of ingress (egress_spec == drop_port) +1745614184335045 - DROP: Packet 14 at end of ingress (egress_spec == drop_port) +1745614184336267 - DROP: Packet 34 at end of ingress (egress_spec == drop_port) +1745614184367207 - DROP: Packet 35 at end of ingress (egress_spec == drop_port) +1745614184368202 - DROP: Packet 15 at end of ingress (egress_spec == drop_port) +1745614184368329 - DROP: Packet 36 at end of ingress (egress_spec == drop_port) +1745614184370187 - DROP: Packet 37 at end of ingress (egress_spec == drop_port) +1745614184370360 - DROP: Packet 16 at end of ingress (egress_spec == drop_port) +1745614184371463 - DROP: Packet 17 at end of ingress (egress_spec == drop_port) +1745614184383101 - DROP: Packet 38 at end of ingress (egress_spec == drop_port) +1745614184384775 - DROP: Packet 33 at end of ingress (egress_spec == drop_port) +1745614184385672 - DROP: Packet 39 at end of ingress (egress_spec == drop_port) +1745614184431159 - DROP: Packet 34 at end of ingress (egress_spec == drop_port) +1745614184432266 - DROP: Packet 35 at end of ingress (egress_spec == drop_port) +1745614184435050 - DROP: Packet 36 at end of ingress (egress_spec == drop_port) +1745614184444291 - DROP: Packet 37 at end of ingress (egress_spec == drop_port) +1745614184445360 - DROP: Packet 18 at end of ingress (egress_spec == drop_port) +1745614184448361 - DROP: Packet 40 at end of ingress (egress_spec == drop_port) +1745614184449422 - DROP: Packet 38 at end of ingress (egress_spec == drop_port) +1745614184450523 - DROP: Packet 39 at end of ingress (egress_spec == drop_port) +1745614184457868 - DROP: Packet 41 at end of ingress (egress_spec == drop_port) +1745614184457898 - DROP: Packet 40 at end of ingress (egress_spec == drop_port) +1745614184467648 - DROP: Packet 42 at end of ingress (egress_spec == drop_port) +1745614184467650 - DROP: Packet 19 at end of ingress (egress_spec == drop_port) +1745614184496313 - DROP: Packet 43 at end of ingress (egress_spec == drop_port) +1745614184496313 - DROP: Packet 20 at end of ingress (egress_spec == drop_port) +1745614184497450 - DROP: Packet 44 at end of ingress (egress_spec == drop_port) +1745614184497450 - DROP: Packet 21 at end of ingress (egress_spec == drop_port) +1745614184498087 - DROP: Packet 22 at end of ingress (egress_spec == drop_port) +1745614184499274 - DROP: Packet 45 at end of ingress (egress_spec == drop_port) +1745614184513334 - DROP: Packet 23 at end of ingress (egress_spec == drop_port) +1745614184514532 - DROP: Packet 46 at end of ingress (egress_spec == drop_port) +1745614184519527 - DROP: Packet 24 at end of ingress (egress_spec == drop_port) +1745614184519691 - DROP: Packet 47 at end of ingress (egress_spec == drop_port) +1745614184528156 - DROP: Packet 41 at end of ingress (egress_spec == drop_port) +1745614184528274 - DROP: Packet 48 at end of ingress (egress_spec == drop_port) +1745614184532048 - DROP: Packet 42 at end of ingress (egress_spec == drop_port) +1745614184559252 - DROP: Packet 43 at end of ingress (egress_spec == drop_port) +1745614184560251 - DROP: Packet 25 at end of ingress (egress_spec == drop_port) +1745614184572762 - DROP: Packet 49 at end of ingress (egress_spec == drop_port) +1745614184576851 - DROP: Packet 26 at end of ingress (egress_spec == drop_port) +1745614184577923 - DROP: Packet 44 at end of ingress (egress_spec == drop_port) +1745614184582038 - DROP: Packet 45 at end of ingress (egress_spec == drop_port) +1745614184596305 - DROP: Packet 50 at end of ingress (egress_spec == drop_port) +1745614184597332 - DROP: Packet 27 at end of ingress (egress_spec == drop_port) +1745614184624170 - DROP: Packet 28 at end of ingress (egress_spec == drop_port) +1745614184624190 - DROP: Packet 46 at end of ingress (egress_spec == drop_port) +1745614184634780 - DROP: Packet 47 at end of ingress (egress_spec == drop_port) +1745614184634887 - DROP: Packet 51 at end of ingress (egress_spec == drop_port) +1745614184643989 - DROP: Packet 48 at end of ingress (egress_spec == drop_port) +1745614184644104 - DROP: Packet 29 at end of ingress (egress_spec == drop_port) +1745614184646197 - DROP: Packet 52 at end of ingress (egress_spec == drop_port) +1745614184647276 - DROP: Packet 30 at end of ingress (egress_spec == drop_port) +1745614184648483 - DROP: Packet 31 at end of ingress (egress_spec == drop_port) +1745614184687249 - DROP: Packet 32 at end of ingress (egress_spec == drop_port) +1745614184688296 - DROP: Packet 53 at end of ingress (egress_spec == drop_port) +1745614184700051 - DROP: Packet 49 at end of ingress (egress_spec == drop_port) +1745614184700179 - DROP: Packet 54 at end of ingress (egress_spec == drop_port) +1745614184701155 - DROP: Packet 50 at end of ingress (egress_spec == drop_port) +1745614184751257 - DROP: Packet 51 at end of ingress (egress_spec == drop_port) +1745614184751257 - DROP: Packet 33 at end of ingress (egress_spec == drop_port) +1745614184763943 - DROP: Packet 34 at end of ingress (egress_spec == drop_port) +1745614184764998 - DROP: Packet 55 at end of ingress (egress_spec == drop_port) +1745614184769100 - DROP: Packet 56 at end of ingress (egress_spec == drop_port) +1745614184770135 - DROP: Packet 35 at end of ingress (egress_spec == drop_port) +1745614184772234 - DROP: Packet 57 at end of ingress (egress_spec == drop_port) +1745614184828432 - DROP: Packet 52 at end of ingress (egress_spec == drop_port) +1745614184828432 - DROP: Packet 36 at end of ingress (egress_spec == drop_port) +1745614184831461 - DROP: Packet 53 at end of ingress (egress_spec == drop_port) +1745614184834600 - DROP: Packet 54 at end of ingress (egress_spec == drop_port) +1745614184834628 - DROP: Packet 58 at end of ingress (egress_spec == drop_port) +1745614184879240 - DROP: Packet 37 at end of ingress (egress_spec == drop_port) +1745614184880229 - DROP: Packet 59 at end of ingress (egress_spec == drop_port) +1745614184881501 - DROP: Packet 38 at end of ingress (egress_spec == drop_port) +1745614184894327 - DROP: Packet 55 at end of ingress (egress_spec == drop_port) +1745614184894336 - DROP: Packet 39 at end of ingress (egress_spec == drop_port) +1745614184896381 - DROP: Packet 40 at end of ingress (egress_spec == drop_port) +1745614184897398 - DROP: Packet 60 at end of ingress (egress_spec == drop_port) +1745614184898496 - DROP: Packet 56 at end of ingress (egress_spec == drop_port) +1745614184898538 - DROP: Packet 61 at end of ingress (egress_spec == drop_port) +1745614184900699 - DROP: Packet 57 at end of ingress (egress_spec == drop_port) +1745614184943322 - DROP: Packet 62 at end of ingress (egress_spec == drop_port) +1745614184964260 - DROP: Packet 41 at end of ingress (egress_spec == drop_port) +1745614184965172 - DROP: Packet 63 at end of ingress (egress_spec == drop_port) +1745614185008176 - DROP: Packet 58 at end of ingress (egress_spec == drop_port) +1745614185019882 - DROP: Packet 64 at end of ingress (egress_spec == drop_port) +1745614185019961 - DROP: Packet 42 at end of ingress (egress_spec == drop_port) +1745614185020995 - DROP: Packet 65 at end of ingress (egress_spec == drop_port) +1745614185027105 - DROP: Packet 59 at end of ingress (egress_spec == drop_port) +1745614185027128 - DROP: Packet 43 at end of ingress (egress_spec == drop_port) +1745614185082477 - DROP: Packet 60 at end of ingress (egress_spec == drop_port) +1745614185083545 - DROP: Packet 61 at end of ingress (egress_spec == drop_port) +1745614185083635 - DROP: Packet 66 at end of ingress (egress_spec == drop_port) +1745614185148251 - DROP: Packet 67 at end of ingress (egress_spec == drop_port) +1745614185148324 - DROP: Packet 44 at end of ingress (egress_spec == drop_port) +1745614185149217 - DROP: Packet 62 at end of ingress (egress_spec == drop_port) +1745614185199091 - DROP: Packet 63 at end of ingress (egress_spec == drop_port) +1745614185212776 - DROP: Packet 68 at end of ingress (egress_spec == drop_port) +1745614185212804 - DROP: Packet 45 at end of ingress (egress_spec == drop_port) +1745614185219936 - DROP: Packet 69 at end of ingress (egress_spec == drop_port) +1745614185219957 - DROP: Packet 46 at end of ingress (egress_spec == drop_port) +1745614185263194 - DROP: Packet 70 at end of ingress (egress_spec == drop_port) +1745614185277344 - DROP: Packet 64 at end of ingress (egress_spec == drop_port) +1745614185278567 - DROP: Packet 47 at end of ingress (egress_spec == drop_port) +1745614185282454 - DROP: Packet 65 at end of ingress (egress_spec == drop_port) +1745614185327238 - DROP: Packet 48 at end of ingress (egress_spec == drop_port) +1745614185328216 - DROP: Packet 71 at end of ingress (egress_spec == drop_port) +1745614185348029 - DROP: Packet 72 at end of ingress (egress_spec == drop_port) +1745614185348179 - DROP: Packet 49 at end of ingress (egress_spec == drop_port) +1745614185469136 - DROP: Packet 73 at end of ingress (egress_spec == drop_port) +1745614185469174 - DROP: Packet 50 at end of ingress (egress_spec == drop_port) +1745614185532465 - DROP: Packet 66 at end of ingress (egress_spec == drop_port) +1745614185597987 - DROP: Packet 74 at end of ingress (egress_spec == drop_port) +1745614185598043 - DROP: Packet 51 at end of ingress (egress_spec == drop_port) +1745614185744449 - DROP: Packet 67 at end of ingress (egress_spec == drop_port) +1745614185745641 - DROP: Packet 52 at end of ingress (egress_spec == drop_port) +1745614185871133 - DROP: Packet 75 at end of ingress (egress_spec == drop_port) +1745614185934410 - DROP: Packet 68 at end of ingress (egress_spec == drop_port) +1745614185935614 - DROP: Packet 76 at end of ingress (egress_spec == drop_port) +1745614185998831 - DROP: Packet 77 at end of ingress (egress_spec == drop_port) +1745614185999722 - DROP: Packet 69 at end of ingress (egress_spec == drop_port) +1745614186001911 - DROP: Packet 70 at end of ingress (egress_spec == drop_port) +1745614186064206 - DROP: Packet 53 at end of ingress (egress_spec == drop_port) +1745614186065225 - DROP: Packet 78 at end of ingress (egress_spec == drop_port) +1745614186127349 - DROP: Packet 71 at end of ingress (egress_spec == drop_port) +1745614186127430 - DROP: Packet 54 at end of ingress (egress_spec == drop_port) +1745614186319854 - DROP: Packet 55 at end of ingress (egress_spec == drop_port) +1745614186320893 - DROP: Packet 79 at end of ingress (egress_spec == drop_port) +1745614186383052 - DROP: Packet 72 at end of ingress (egress_spec == drop_port) +1745614186448405 - DROP: Packet 80 at end of ingress (egress_spec == drop_port) +1745614186448405 - DROP: Packet 56 at end of ingress (egress_spec == drop_port) +1745614186894624 - DROP: Packet 73 at end of ingress (egress_spec == drop_port) +1745614186894624 - DROP: Packet 57 at end of ingress (egress_spec == drop_port) +1745614187021525 - DROP: Packet 81 at end of ingress (egress_spec == drop_port) +1745614187084962 - DROP: Packet 82 at end of ingress (egress_spec == drop_port) +1745614187084963 - DROP: Packet 74 at end of ingress (egress_spec == drop_port) +1745614187149347 - DROP: Packet 75 at end of ingress (egress_spec == drop_port) +1745614187212839 - DROP: Packet 83 at end of ingress (egress_spec == drop_port) +1745614187212880 - DROP: Packet 58 at end of ingress (egress_spec == drop_port) +1745614187277037 - DROP: Packet 76 at end of ingress (egress_spec == drop_port) +1745614187278216 - DROP: Packet 59 at end of ingress (egress_spec == drop_port) +1745614187469065 - DROP: Packet 60 at end of ingress (egress_spec == drop_port) +1745614187470240 - DROP: Packet 84 at end of ingress (egress_spec == drop_port) +1745614187533316 - DROP: Packet 77 at end of ingress (egress_spec == drop_port) +1745614187597604 - DROP: Packet 85 at end of ingress (egress_spec == drop_port) +1745614187598657 - DROP: Packet 61 at end of ingress (egress_spec == drop_port) +1745614187695310 - DROP: Packet 78 at end of ingress (egress_spec == drop_port) +1745614187696344 - DROP: Packet 62 at end of ingress (egress_spec == drop_port) +1745614187823343 - DROP: Packet 86 at end of ingress (egress_spec == drop_port) +1745614187824358 - DROP: Packet 79 at end of ingress (egress_spec == drop_port) +1745614187844246 - DROP: Packet 63 at end of ingress (egress_spec == drop_port) +1745614187845355 - DROP: Packet 80 at end of ingress (egress_spec == drop_port) +1745614187971846 - DROP: Packet 87 at end of ingress (egress_spec == drop_port) +1745614188015548 - DROP: Packet 88 at end of ingress (egress_spec == drop_port) +1745614188034814 - DROP: Packet 89 at end of ingress (egress_spec == drop_port) +1745614188034957 - DROP: Packet 81 at end of ingress (egress_spec == drop_port) +1745614188099191 - DROP: Packet 82 at end of ingress (egress_spec == drop_port) +1745614188100042 - DROP: Packet 90 at end of ingress (egress_spec == drop_port) +1745614188100321 - DROP: Packet 83 at end of ingress (egress_spec == drop_port) +1745614188164433 - DROP: Packet 91 at end of ingress (egress_spec == drop_port) +1745614188164471 - DROP: Packet 64 at end of ingress (egress_spec == drop_port) +1745614188207238 - DROP: Packet 92 at end of ingress (egress_spec == drop_port) +1745614188207321 - DROP: Packet 84 at end of ingress (egress_spec == drop_port) +1745614188208130 - DROP: Packet 65 at end of ingress (egress_spec == drop_port) +1745614188208550 - DROP: Packet 85 at end of ingress (egress_spec == drop_port) +1745614188209230 - DROP: Packet 66 at end of ingress (egress_spec == drop_port) +1745614188209483 - DROP: Packet 93 at end of ingress (egress_spec == drop_port) +1745614188211740 - DROP: Packet 94 at end of ingress (egress_spec == drop_port) +1745614188227667 - DROP: Packet 67 at end of ingress (egress_spec == drop_port) +1745614188227822 - DROP: Packet 86 at end of ingress (egress_spec == drop_port) +1745614188337290 - DROP: Packet 87 at end of ingress (egress_spec == drop_port) +1745614188420227 - DROP: Packet 68 at end of ingress (egress_spec == drop_port) +1745614188421316 - DROP: Packet 95 at end of ingress (egress_spec == drop_port) +1745614188484707 - DROP: Packet 88 at end of ingress (egress_spec == drop_port) +1745614188547834 - DROP: Packet 69 at end of ingress (egress_spec == drop_port) +1745614188547888 - DROP: Packet 96 at end of ingress (egress_spec == drop_port) +1745614188720323 - DROP: Packet 70 at end of ingress (egress_spec == drop_port) +1745614188720339 - DROP: Packet 89 at end of ingress (egress_spec == drop_port) +1745614188721240 - DROP: Packet 97 at end of ingress (egress_spec == drop_port) +1745614188721521 - DROP: Packet 71 at end of ingress (egress_spec == drop_port) +1745614190895626 - DROP: Packet 90 at end of ingress (egress_spec == drop_port) +1745614190896697 - DROP: Packet 72 at end of ingress (egress_spec == drop_port) +1745614191021682 - DROP: Packet 98 at end of ingress (egress_spec == drop_port) +1745614191086411 - DROP: Packet 99 at end of ingress (egress_spec == drop_port) +1745614191087365 - DROP: Packet 91 at end of ingress (egress_spec == drop_port) +1745614191149899 - DROP: Packet 92 at end of ingress (egress_spec == drop_port) +1745614191213635 - DROP: Packet 100 at end of ingress (egress_spec == drop_port) +1745614191214672 - DROP: Packet 73 at end of ingress (egress_spec == drop_port) +1745614191278027 - DROP: Packet 93 at end of ingress (egress_spec == drop_port) +1745614191279140 - DROP: Packet 74 at end of ingress (egress_spec == drop_port) +1745614191470502 - DROP: Packet 75 at end of ingress (egress_spec == drop_port) +1745614191470645 - DROP: Packet 101 at end of ingress (egress_spec == drop_port) +1745614191535381 - DROP: Packet 94 at end of ingress (egress_spec == drop_port) +1745614191598699 - DROP: Packet 76 at end of ingress (egress_spec == drop_port) +1745614191598883 - DROP: Packet 102 at end of ingress (egress_spec == drop_port) +1745614192486668 - ENQUEUE: Packet 103 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745614195887194 - DROP: Packet 77 at end of ingress (egress_spec == drop_port) +1745614195887351 - DROP: Packet 95 at end of ingress (egress_spec == drop_port) +1745614195888288 - DROP: Packet 104 at end of ingress (egress_spec == drop_port) +1745614195889353 - DROP: Packet 78 at end of ingress (egress_spec == drop_port) +1745614195889637 - DROP: Packet 96 at end of ingress (egress_spec == drop_port) +1745614195890565 - DROP: Packet 105 at end of ingress (egress_spec == drop_port) +1745614195892808 - DROP: Packet 106 at end of ingress (egress_spec == drop_port) +1745614196399124 - DROP: Packet 79 at end of ingress (egress_spec == drop_port) +1745614196400388 - DROP: Packet 107 at end of ingress (egress_spec == drop_port) +1745614196400389 - DROP: Packet 97 at end of ingress (egress_spec == drop_port) +1745614196401630 - DROP: Packet 98 at end of ingress (egress_spec == drop_port) +1745614196402748 - DROP: Packet 108 at end of ingress (egress_spec == drop_port) +1745614196402899 - DROP: Packet 99 at end of ingress (egress_spec == drop_port) +1745614196912235 - DROP: Packet 80 at end of ingress (egress_spec == drop_port) +1745614197936122 - DROP: Packet 81 at end of ingress (egress_spec == drop_port) +1745614197937296 - DROP: Packet 109 at end of ingress (egress_spec == drop_port) +1745614197937385 - DROP: Packet 100 at end of ingress (egress_spec == drop_port) +1745614198895743 - DROP: Packet 101 at end of ingress (egress_spec == drop_port) +1745614198896773 - DROP: Packet 82 at end of ingress (egress_spec == drop_port) +1745614199023438 - DROP: Packet 110 at end of ingress (egress_spec == drop_port) +1745614199086776 - DROP: Packet 102 at end of ingress (egress_spec == drop_port) +1745614199087825 - DROP: Packet 111 at end of ingress (egress_spec == drop_port) +1745614199150381 - DROP: Packet 103 at end of ingress (egress_spec == drop_port) +1745614199213786 - DROP: Packet 112 at end of ingress (egress_spec == drop_port) +1745614199214759 - DROP: Packet 83 at end of ingress (egress_spec == drop_port) +1745614199278025 - DROP: Packet 84 at end of ingress (egress_spec == drop_port) +1745614199278105 - DROP: Packet 104 at end of ingress (egress_spec == drop_port) +1745614199470823 - DROP: Packet 85 at end of ingress (egress_spec == drop_port) +1745614199471990 - DROP: Packet 113 at end of ingress (egress_spec == drop_port) +1745614199535340 - DROP: Packet 105 at end of ingress (egress_spec == drop_port) +1745614199599559 - DROP: Packet 114 at end of ingress (egress_spec == drop_port) +1745614199599559 - DROP: Packet 86 at end of ingress (egress_spec == drop_port) +1745614202490054 - ENQUEUE: Packet 115 to port 4 with priority 0 (queue 0), queue depth before: 0 +1745614210736164 - DROP: Packet 87 at end of ingress (egress_spec == drop_port) +1745614210736369 - DROP: Packet 116 at end of ingress (egress_spec == drop_port) +1745614210738660 - DROP: Packet 117 at end of ingress (egress_spec == drop_port) +1745614211248411 - DROP: Packet 106 at end of ingress (egress_spec == drop_port) +1745614211248462 - DROP: Packet 118 at end of ingress (egress_spec == drop_port) +1745614212271132 - DROP: Packet 88 at end of ingress (egress_spec == drop_port) +1745614212271284 - DROP: Packet 107 at end of ingress (egress_spec == drop_port) +1745614212272391 - DROP: Packet 119 at end of ingress (egress_spec == drop_port) +1745614212272516 - DROP: Packet 108 at end of ingress (egress_spec == drop_port) +1745614212272653 - DROP: Packet 109 at end of ingress (egress_spec == drop_port) +1745614212273292 - DROP: Packet 89 at end of ingress (egress_spec == drop_port) +1745614212491270 - ENQUEUE: Packet 120 to port 1 with priority 0 (queue 0), queue depth before: 0 +1745614213296348 - DROP: Packet 110 at end of ingress (egress_spec == drop_port) +1745614213296354 - DROP: Packet 121 at end of ingress (egress_spec == drop_port) +1745614213808171 - DROP: Packet 90 at end of ingress (egress_spec == drop_port) +1745614214896515 - DROP: Packet 111 at end of ingress (egress_spec == drop_port) +1745614214897377 - DROP: Packet 91 at end of ingress (egress_spec == drop_port) +1745614215024033 - DROP: Packet 122 at end of ingress (egress_spec == drop_port) +1745614215088251 - DROP: Packet 112 at end of ingress (egress_spec == drop_port) +1745614215088259 - DROP: Packet 123 at end of ingress (egress_spec == drop_port) +1745614215150393 - DROP: Packet 113 at end of ingress (egress_spec == drop_port) +1745614215215012 - DROP: Packet 92 at end of ingress (egress_spec == drop_port) +1745614215219000 - DROP: Packet 124 at end of ingress (egress_spec == drop_port) +1745614215279030 - DROP: Packet 114 at end of ingress (egress_spec == drop_port) +1745614215279188 - DROP: Packet 93 at end of ingress (egress_spec == drop_port) +1745614215471714 - DROP: Packet 94 at end of ingress (egress_spec == drop_port) +1745614215472639 - DROP: Packet 125 at end of ingress (egress_spec == drop_port) +1745614215535814 - DROP: Packet 115 at end of ingress (egress_spec == drop_port) +1745614215599078 - DROP: Packet 95 at end of ingress (egress_spec == drop_port) +1745614215600017 - DROP: Packet 126 at end of ingress (egress_spec == drop_port) +1745614215857122 - DROP: Packet 127 at end of ingress (egress_spec == drop_port) +1745614215857206 - DROP: Packet 96 at end of ingress (egress_spec == drop_port) +1745614216368157 - DROP: Packet 116 at end of ingress (egress_spec == drop_port) +1745614222492484 - ENQUEUE: Packet 128 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745614232494251 - ENQUEUE: Packet 117 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745614240432333 - DROP: Packet 97 at end of ingress (egress_spec == drop_port) +1745614240433432 - DROP: Packet 129 at end of ingress (egress_spec == drop_port) +1745614240944150 - DROP: Packet 130 at end of ingress (egress_spec == drop_port) +1745614242479415 - DROP: Packet 118 at end of ingress (egress_spec == drop_port) +1745614242480228 - DROP: Packet 131 at end of ingress (egress_spec == drop_port) +1745614242495482 - ENQUEUE: Packet 119 to port 4 with priority 0 (queue 0), queue depth before: 0 +1745614242992268 - DROP: Packet 120 at end of ingress (egress_spec == drop_port) +1745614242992328 - DROP: Packet 98 at end of ingress (egress_spec == drop_port) +1745614242992969 - DROP: Packet 132 at end of ingress (egress_spec == drop_port) +1745614242995498 - DROP: Packet 121 at end of ingress (egress_spec == drop_port) +1745614243503193 - DROP: Packet 99 at end of ingress (egress_spec == drop_port) +1745614243504151 - DROP: Packet 122 at end of ingress (egress_spec == drop_port) +1745614245552157 - DROP: Packet 123 at end of ingress (egress_spec == drop_port) +1745614245552230 - DROP: Packet 133 at end of ingress (egress_spec == drop_port) +1745614246898226 - DROP: Packet 100 at end of ingress (egress_spec == drop_port) +1745614246898265 - DROP: Packet 124 at end of ingress (egress_spec == drop_port) +1745614247024863 - DROP: Packet 134 at end of ingress (egress_spec == drop_port) +1745614247089217 - DROP: Packet 125 at end of ingress (egress_spec == drop_port) +1745614247091224 - DROP: Packet 135 at end of ingress (egress_spec == drop_port) +1745614247175755 - DROP: Packet 126 at end of ingress (egress_spec == drop_port) +1745614247216170 - DROP: Packet 101 at end of ingress (egress_spec == drop_port) +1745614247216259 - DROP: Packet 136 at end of ingress (egress_spec == drop_port) +1745614247279515 - DROP: Packet 102 at end of ingress (egress_spec == drop_port) +1745614247279533 - DROP: Packet 127 at end of ingress (egress_spec == drop_port) +1745614247473983 - DROP: Packet 137 at end of ingress (egress_spec == drop_port) +1745614247474658 - DROP: Packet 103 at end of ingress (egress_spec == drop_port) +1745614247537158 - DROP: Packet 128 at end of ingress (egress_spec == drop_port) +1745614247601566 - DROP: Packet 138 at end of ingress (egress_spec == drop_port) +1745614247601619 - DROP: Packet 104 at end of ingress (egress_spec == drop_port) +1745614249648438 - DROP: Packet 105 at end of ingress (egress_spec == drop_port) +1745614252495595 - ENQUEUE: Packet 129 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745614253744254 - DROP: Packet 130 at end of ingress (egress_spec == drop_port) +1745614253744348 - DROP: Packet 139 at end of ingress (egress_spec == drop_port) +1745614253744424 - DROP: Packet 106 at end of ingress (egress_spec == drop_port) +1745614262497683 - ENQUEUE: Packet 131 to port 1 with priority 0 (queue 0), queue depth before: 0 +1745614272499352 - ENQUEUE: Packet 107 to port 2 with priority 0 (queue 0), queue depth before: 0 +1745614282500723 - ENQUEUE: Packet 108 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745614292502070 - ENQUEUE: Packet 109 to port 2 with priority 0 (queue 0), queue depth before: 0 +1745614298800193 - DROP: Packet 140 at end of ingress (egress_spec == drop_port) +1745614298800235 - DROP: Packet 110 at end of ingress (egress_spec == drop_port) +1745614302503714 - ENQUEUE: Packet 111 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745614302896484 - DROP: Packet 141 at end of ingress (egress_spec == drop_port) +1745614302898664 - DROP: Packet 142 at end of ingress (egress_spec == drop_port) +1745614306992239 - DROP: Packet 143 at end of ingress (egress_spec == drop_port) +1745614306992324 - DROP: Packet 112 at end of ingress (egress_spec == drop_port) +1745614306992363 - DROP: Packet 132 at end of ingress (egress_spec == drop_port) +1745614306995520 - DROP: Packet 133 at end of ingress (egress_spec == drop_port) +1745614306995567 - DROP: Packet 134 at end of ingress (egress_spec == drop_port) +1745614310898940 - DROP: Packet 113 at end of ingress (egress_spec == drop_port) +1745614310898940 - DROP: Packet 135 at end of ingress (egress_spec == drop_port) +1745614311025044 - DROP: Packet 144 at end of ingress (egress_spec == drop_port) +1745614311088206 - DROP: Packet 136 at end of ingress (egress_spec == drop_port) +1745614311088252 - DROP: Packet 145 at end of ingress (egress_spec == drop_port) +1745614311088252 - DROP: Packet 114 at end of ingress (egress_spec == drop_port) +1745614311090369 - DROP: Packet 146 at end of ingress (egress_spec == drop_port) +1745614311090391 - DROP: Packet 137 at end of ingress (egress_spec == drop_port) +1745614311092556 - DROP: Packet 138 at end of ingress (egress_spec == drop_port) +1745614311152704 - DROP: Packet 139 at end of ingress (egress_spec == drop_port) +1745614311215909 - DROP: Packet 147 at end of ingress (egress_spec == drop_port) +1745614311215910 - DROP: Packet 115 at end of ingress (egress_spec == drop_port) +1745614311279334 - DROP: Packet 140 at end of ingress (egress_spec == drop_port) +1745614311279343 - DROP: Packet 116 at end of ingress (egress_spec == drop_port) +1745614311474340 - DROP: Packet 117 at end of ingress (egress_spec == drop_port) +1745614311474342 - DROP: Packet 148 at end of ingress (egress_spec == drop_port) +1745614311537627 - DROP: Packet 141 at end of ingress (egress_spec == drop_port) +1745614311602088 - DROP: Packet 118 at end of ingress (egress_spec == drop_port) +1745614311602091 - DROP: Packet 149 at end of ingress (egress_spec == drop_port) +1745614312505015 - ENQUEUE: Packet 150 to port 2 with priority 0 (queue 0), queue depth before: 0 +1745614315184171 - DROP: Packet 119 at end of ingress (egress_spec == drop_port) +1745614327472166 - DROP: Packet 142 at end of ingress (egress_spec == drop_port) +1745614327472189 - DROP: Packet 120 at end of ingress (egress_spec == drop_port) +1745614327472189 - DROP: Packet 151 at end of ingress (egress_spec == drop_port) +=== SimpleSwitch started at 1745614564734174 with 1 queue per port === +1745614564976367 - DROP: Packet 0 at end of ingress (egress_spec == drop_port) +1745614565040237 - DROP: Packet 1 at end of ingress (egress_spec == drop_port) +1745614565231253 - DROP: Packet 2 at end of ingress (egress_spec == drop_port) +=== SimpleSwitch started at 1745614565275536 with 1 queue per port === +1745614565296306 - DROP: Packet 3 at end of ingress (egress_spec == drop_port) +1745614565360276 - DROP: Packet 4 at end of ingress (egress_spec == drop_port) +1745614565360412 - DROP: Packet 5 at end of ingress (egress_spec == drop_port) +1745614565360464 - DROP: Packet 0 at end of ingress (egress_spec == drop_port) +1745614565362719 - DROP: Packet 1 at end of ingress (egress_spec == drop_port) +1745614565424418 - DROP: Packet 2 at end of ingress (egress_spec == drop_port) +1745614565426717 - DROP: Packet 3 at end of ingress (egress_spec == drop_port) +1745614565427247 - DROP: Packet 4 at end of ingress (egress_spec == drop_port) +1745614565487305 - DROP: Packet 6 at end of ingress (egress_spec == drop_port) +1745614565488527 - DROP: Packet 7 at end of ingress (egress_spec == drop_port) +1745614565490827 - DROP: Packet 8 at end of ingress (egress_spec == drop_port) +1745614565490953 - DROP: Packet 9 at end of ingress (egress_spec == drop_port) +1745614565524814 - DROP: Packet 5 at end of ingress (egress_spec == drop_port) +1745614565551368 - DROP: Packet 10 at end of ingress (egress_spec == drop_port) +1745614565551369 - DROP: Packet 6 at end of ingress (egress_spec == drop_port) +1745614565552573 - DROP: Packet 11 at end of ingress (egress_spec == drop_port) +1745614565552578 - DROP: Packet 7 at end of ingress (egress_spec == drop_port) +1745614565555380 - DROP: Packet 12 at end of ingress (egress_spec == drop_port) +1745614565555417 - DROP: Packet 8 at end of ingress (egress_spec == drop_port) +1745614565589651 - DROP: Packet 13 at end of ingress (egress_spec == drop_port) +1745614565652029 - DROP: Packet 14 at end of ingress (egress_spec == drop_port) +1745614565652030 - DROP: Packet 9 at end of ingress (egress_spec == drop_port) +1745614565679332 - DROP: Packet 10 at end of ingress (egress_spec == drop_port) +1745614565719670 - DROP: Packet 11 at end of ingress (egress_spec == drop_port) +1745614565782475 - DROP: Packet 15 at end of ingress (egress_spec == drop_port) +1745614565807299 - DROP: Packet 16 at end of ingress (egress_spec == drop_port) +1745614565808388 - DROP: Packet 12 at end of ingress (egress_spec == drop_port) +1745614565809546 - DROP: Packet 17 at end of ingress (egress_spec == drop_port) +1745614565809614 - DROP: Packet 13 at end of ingress (egress_spec == drop_port) +1745614565810404 - DROP: Packet 14 at end of ingress (egress_spec == drop_port) +1745614565811419 - DROP: Packet 18 at end of ingress (egress_spec == drop_port) +=== SimpleSwitch started at 1745614565823642 with 1 queue per port === +1745614565848031 - DROP: Packet 19 at end of ingress (egress_spec == drop_port) +1745614565848045 - DROP: Packet 15 at end of ingress (egress_spec == drop_port) +1745614565871441 - DROP: Packet 0 at end of ingress (egress_spec == drop_port) +1745614565872386 - DROP: Packet 16 at end of ingress (egress_spec == drop_port) +1745614565872529 - DROP: Packet 17 at end of ingress (egress_spec == drop_port) +1745614565872646 - DROP: Packet 1 at end of ingress (egress_spec == drop_port) +1745614565874162 - DROP: Packet 2 at end of ingress (egress_spec == drop_port) +1745614565875309 - DROP: Packet 18 at end of ingress (egress_spec == drop_port) +1745614565907699 - DROP: Packet 20 at end of ingress (egress_spec == drop_port) +1745614565907718 - DROP: Packet 19 at end of ingress (egress_spec == drop_port) +1745614565920303 - DROP: Packet 3 at end of ingress (egress_spec == drop_port) +1745614565952205 - DROP: Packet 21 at end of ingress (egress_spec == drop_port) +1745614565971302 - DROP: Packet 20 at end of ingress (egress_spec == drop_port) +1745614565972308 - DROP: Packet 21 at end of ingress (egress_spec == drop_port) +1745614565973391 - DROP: Packet 4 at end of ingress (egress_spec == drop_port) +1745614566000265 - DROP: Packet 5 at end of ingress (egress_spec == drop_port) +1745614566001259 - DROP: Packet 22 at end of ingress (egress_spec == drop_port) +1745614566002433 - DROP: Packet 6 at end of ingress (egress_spec == drop_port) +1745614566003512 - DROP: Packet 23 at end of ingress (egress_spec == drop_port) +1745614566003647 - DROP: Packet 24 at end of ingress (egress_spec == drop_port) +1745614566004250 - DROP: Packet 7 at end of ingress (egress_spec == drop_port) +1745614566033624 - DROP: Packet 25 at end of ingress (egress_spec == drop_port) +1745614566034581 - DROP: Packet 8 at end of ingress (egress_spec == drop_port) +1745614566068366 - DROP: Packet 26 at end of ingress (egress_spec == drop_port) +1745614566069587 - DROP: Packet 27 at end of ingress (egress_spec == drop_port) +1745614566071231 - DROP: Packet 22 at end of ingress (egress_spec == drop_port) +1745614566071322 - DROP: Packet 28 at end of ingress (egress_spec == drop_port) +1745614566071458 - DROP: Packet 29 at end of ingress (egress_spec == drop_port) +1745614566096372 - DROP: Packet 9 at end of ingress (egress_spec == drop_port) +1745614566096441 - DROP: Packet 23 at end of ingress (egress_spec == drop_port) +1745614566097572 - DROP: Packet 30 at end of ingress (egress_spec == drop_port) +1745614566097586 - DROP: Packet 24 at end of ingress (egress_spec == drop_port) +1745614566100713 - DROP: Packet 10 at end of ingress (egress_spec == drop_port) +1745614566101849 - DROP: Packet 31 at end of ingress (egress_spec == drop_port) +1745614566102816 - DROP: Packet 32 at end of ingress (egress_spec == drop_port) +1745614566104000 - DROP: Packet 25 at end of ingress (egress_spec == drop_port) +1745614566127245 - DROP: Packet 33 at end of ingress (egress_spec == drop_port) +1745614566130300 - DROP: Packet 26 at end of ingress (egress_spec == drop_port) +1745614566130356 - DROP: Packet 27 at end of ingress (egress_spec == drop_port) +1745614566131455 - DROP: Packet 28 at end of ingress (egress_spec == drop_port) +1745614566133608 - DROP: Packet 29 at end of ingress (egress_spec == drop_port) +1745614566135761 - DROP: Packet 30 at end of ingress (egress_spec == drop_port) +1745614566166614 - DROP: Packet 31 at end of ingress (egress_spec == drop_port) +1745614566166765 - DROP: Packet 11 at end of ingress (egress_spec == drop_port) +1745614566167953 - DROP: Packet 34 at end of ingress (egress_spec == drop_port) +1745614566220710 - DROP: Packet 32 at end of ingress (egress_spec == drop_port) +1745614566228037 - DROP: Packet 33 at end of ingress (egress_spec == drop_port) +1745614566256238 - DROP: Packet 34 at end of ingress (egress_spec == drop_port) +1745614566284215 - DROP: Packet 35 at end of ingress (egress_spec == drop_port) +1745614566286428 - DROP: Packet 12 at end of ingress (egress_spec == drop_port) +1745614566295233 - DROP: Packet 13 at end of ingress (egress_spec == drop_port) +1745614566295239 - DROP: Packet 36 at end of ingress (egress_spec == drop_port) +1745614566296526 - DROP: Packet 14 at end of ingress (egress_spec == drop_port) +1745614566296584 - DROP: Packet 37 at end of ingress (egress_spec == drop_port) +1745614566320391 - DROP: Packet 38 at end of ingress (egress_spec == drop_port) +1745614566348485 - DROP: Packet 35 at end of ingress (egress_spec == drop_port) +1745614566349732 - DROP: Packet 39 at end of ingress (egress_spec == drop_port) +1745614566351818 - DROP: Packet 40 at end of ingress (egress_spec == drop_port) +1745614566352910 - DROP: Packet 15 at end of ingress (egress_spec == drop_port) +1745614566354716 - DROP: Packet 36 at end of ingress (egress_spec == drop_port) +1745614566354932 - DROP: Packet 41 at end of ingress (egress_spec == drop_port) +1745614566363032 - DROP: Packet 42 at end of ingress (egress_spec == drop_port) +1745614566383248 - DROP: Packet 37 at end of ingress (egress_spec == drop_port) +1745614566383317 - DROP: Packet 43 at end of ingress (egress_spec == drop_port) +1745614566384307 - DROP: Packet 44 at end of ingress (egress_spec == drop_port) +1745614566384356 - DROP: Packet 38 at end of ingress (egress_spec == drop_port) +1745614566384456 - DROP: Packet 16 at end of ingress (egress_spec == drop_port) +1745614566385467 - DROP: Packet 39 at end of ingress (egress_spec == drop_port) +1745614566385509 - DROP: Packet 45 at end of ingress (egress_spec == drop_port) +1745614566386709 - DROP: Packet 17 at end of ingress (egress_spec == drop_port) +1745614566388207 - DROP: Packet 46 at end of ingress (egress_spec == drop_port) +1745614566388953 - DROP: Packet 18 at end of ingress (egress_spec == drop_port) +1745614566389038 - DROP: Packet 19 at end of ingress (egress_spec == drop_port) +1745614566389090 - DROP: Packet 20 at end of ingress (egress_spec == drop_port) +1745614566389138 - DROP: Packet 21 at end of ingress (egress_spec == drop_port) +1745614566389675 - DROP: Packet 40 at end of ingress (egress_spec == drop_port) +1745614566416662 - DROP: Packet 41 at end of ingress (egress_spec == drop_port) +1745614566417794 - DROP: Packet 22 at end of ingress (egress_spec == drop_port) +1745614566420794 - DROP: Packet 42 at end of ingress (egress_spec == drop_port) +1745614566422888 - DROP: Packet 43 at end of ingress (egress_spec == drop_port) +1745614566439376 - DROP: Packet 44 at end of ingress (egress_spec == drop_port) +1745614566440476 - DROP: Packet 23 at end of ingress (egress_spec == drop_port) +1745614566484667 - DROP: Packet 45 at end of ingress (egress_spec == drop_port) +1745614566484667 - DROP: Packet 47 at end of ingress (egress_spec == drop_port) +1745614566484667 - DROP: Packet 24 at end of ingress (egress_spec == drop_port) +1745614566485918 - DROP: Packet 48 at end of ingress (egress_spec == drop_port) +1745614566485939 - DROP: Packet 25 at end of ingress (egress_spec == drop_port) +1745614566487186 - DROP: Packet 26 at end of ingress (egress_spec == drop_port) +1745614566511262 - DROP: Packet 46 at end of ingress (egress_spec == drop_port) +1745614566511265 - DROP: Packet 27 at end of ingress (egress_spec == drop_port) +1745614566512317 - DROP: Packet 49 at end of ingress (egress_spec == drop_port) +1745614566526770 - DROP: Packet 47 at end of ingress (egress_spec == drop_port) +1745614566546759 - DROP: Packet 28 at end of ingress (egress_spec == drop_port) +1745614566546767 - DROP: Packet 50 at end of ingress (egress_spec == drop_port) +1745614566547952 - DROP: Packet 51 at end of ingress (egress_spec == drop_port) +1745614566549055 - DROP: Packet 48 at end of ingress (egress_spec == drop_port) +1745614566589070 - DROP: Packet 52 at end of ingress (egress_spec == drop_port) +1745614566589115 - DROP: Packet 29 at end of ingress (egress_spec == drop_port) +1745614566604231 - DROP: Packet 53 at end of ingress (egress_spec == drop_port) +1745614566605293 - DROP: Packet 49 at end of ingress (egress_spec == drop_port) +1745614566614429 - DROP: Packet 54 at end of ingress (egress_spec == drop_port) +1745614566639200 - DROP: Packet 55 at end of ingress (egress_spec == drop_port) +1745614566642129 - DROP: Packet 56 at end of ingress (egress_spec == drop_port) +1745614566653049 - DROP: Packet 57 at end of ingress (egress_spec == drop_port) +1745614566653203 - DROP: Packet 50 at end of ingress (egress_spec == drop_port) +1745614566667377 - DROP: Packet 30 at end of ingress (egress_spec == drop_port) +1745614566667433 - DROP: Packet 51 at end of ingress (egress_spec == drop_port) +1745614566673605 - DROP: Packet 52 at end of ingress (egress_spec == drop_port) +1745614566679806 - DROP: Packet 31 at end of ingress (egress_spec == drop_port) +1745614566679870 - DROP: Packet 53 at end of ingress (egress_spec == drop_port) +1745614566679948 - DROP: Packet 32 at end of ingress (egress_spec == drop_port) +1745614566680805 - DROP: Packet 58 at end of ingress (egress_spec == drop_port) +1745614566703249 - DROP: Packet 54 at end of ingress (egress_spec == drop_port) +1745614566704265 - DROP: Packet 33 at end of ingress (egress_spec == drop_port) +1745614566743368 - DROP: Packet 55 at end of ingress (egress_spec == drop_port) +1745614566744412 - DROP: Packet 34 at end of ingress (egress_spec == drop_port) +1745614566798000 - DROP: Packet 35 at end of ingress (egress_spec == drop_port) +1745614566798042 - DROP: Packet 59 at end of ingress (egress_spec == drop_port) +1745614566804213 - DROP: Packet 56 at end of ingress (egress_spec == drop_port) +1745614566805228 - DROP: Packet 60 at end of ingress (egress_spec == drop_port) +1745614566864386 - DROP: Packet 61 at end of ingress (egress_spec == drop_port) +1745614566867457 - DROP: Packet 36 at end of ingress (egress_spec == drop_port) +1745614566867528 - DROP: Packet 57 at end of ingress (egress_spec == drop_port) +1745614566909335 - DROP: Packet 62 at end of ingress (egress_spec == drop_port) +1745614566910304 - DROP: Packet 58 at end of ingress (egress_spec == drop_port) +1745614566924552 - DROP: Packet 59 at end of ingress (egress_spec == drop_port) +1745614566929642 - DROP: Packet 37 at end of ingress (egress_spec == drop_port) +1745614566930687 - DROP: Packet 60 at end of ingress (egress_spec == drop_port) +1745614566930696 - DROP: Packet 38 at end of ingress (egress_spec == drop_port) +1745614566931824 - DROP: Packet 63 at end of ingress (egress_spec == drop_port) +1745614566972962 - DROP: Packet 61 at end of ingress (egress_spec == drop_port) +1745614566973067 - DROP: Packet 39 at end of ingress (egress_spec == drop_port) +1745614566998255 - DROP: Packet 40 at end of ingress (egress_spec == drop_port) +1745614566998285 - DROP: Packet 64 at end of ingress (egress_spec == drop_port) +1745614567064099 - DROP: Packet 65 at end of ingress (egress_spec == drop_port) +1745614567087248 - DROP: Packet 66 at end of ingress (egress_spec == drop_port) +1745614567088302 - DROP: Packet 62 at end of ingress (egress_spec == drop_port) +1745614567088394 - DROP: Packet 41 at end of ingress (egress_spec == drop_port) +1745614567088439 - DROP: Packet 63 at end of ingress (egress_spec == drop_port) +1745614567101495 - DROP: Packet 42 at end of ingress (egress_spec == drop_port) +1745614567102570 - DROP: Packet 67 at end of ingress (egress_spec == drop_port) +1745614567123618 - DROP: Packet 64 at end of ingress (egress_spec == drop_port) +1745614567170149 - DROP: Packet 68 at end of ingress (egress_spec == drop_port) +1745614567180206 - DROP: Packet 43 at end of ingress (egress_spec == drop_port) +1745614567181209 - DROP: Packet 65 at end of ingress (egress_spec == drop_port) +1745614567182374 - DROP: Packet 69 at end of ingress (egress_spec == drop_port) +1745614567182380 - DROP: Packet 44 at end of ingress (egress_spec == drop_port) +1745614567230915 - DROP: Packet 66 at end of ingress (egress_spec == drop_port) +1745614567279243 - DROP: Packet 45 at end of ingress (egress_spec == drop_port) +1745614567279244 - DROP: Packet 70 at end of ingress (egress_spec == drop_port) +1745614567380498 - DROP: Packet 46 at end of ingress (egress_spec == drop_port) +1745614567380528 - DROP: Packet 67 at end of ingress (egress_spec == drop_port) +1745614567382717 - DROP: Packet 47 at end of ingress (egress_spec == drop_port) +1745614567382725 - DROP: Packet 71 at end of ingress (egress_spec == drop_port) +1745614567484320 - DROP: Packet 68 at end of ingress (egress_spec == drop_port) +1745614567485321 - DROP: Packet 48 at end of ingress (egress_spec == drop_port) +1745614567485419 - DROP: Packet 72 at end of ingress (egress_spec == drop_port) +1745614567486530 - DROP: Packet 49 at end of ingress (egress_spec == drop_port) +1745614567666488 - DROP: Packet 69 at end of ingress (egress_spec == drop_port) +1745614567730691 - DROP: Packet 73 at end of ingress (egress_spec == drop_port) +1745614567730829 - DROP: Packet 50 at end of ingress (egress_spec == drop_port) +1745614567792848 - DROP: Packet 70 at end of ingress (egress_spec == drop_port) +1745614567793956 - DROP: Packet 74 at end of ingress (egress_spec == drop_port) +1745614568048409 - DROP: Packet 75 at end of ingress (egress_spec == drop_port) +1745614568048450 - DROP: Packet 71 at end of ingress (egress_spec == drop_port) +1745614568111731 - DROP: Packet 51 at end of ingress (egress_spec == drop_port) +1745614568112793 - DROP: Packet 72 at end of ingress (egress_spec == drop_port) +1745614568242495 - DROP: Packet 52 at end of ingress (egress_spec == drop_port) +1745614568242500 - DROP: Packet 76 at end of ingress (egress_spec == drop_port) +1745614568309063 - DROP: Packet 77 at end of ingress (egress_spec == drop_port) +1745614568369208 - DROP: Packet 73 at end of ingress (egress_spec == drop_port) +1745614568525949 - DROP: Packet 74 at end of ingress (egress_spec == drop_port) +1745614568590480 - DROP: Packet 78 at end of ingress (egress_spec == drop_port) +1745614568590555 - DROP: Packet 53 at end of ingress (egress_spec == drop_port) +1745614568624793 - DROP: Packet 75 at end of ingress (egress_spec == drop_port) +1745614568625966 - DROP: Packet 79 at end of ingress (egress_spec == drop_port) +1745614568625970 - DROP: Packet 54 at end of ingress (egress_spec == drop_port) +1745614568626112 - DROP: Packet 55 at end of ingress (egress_spec == drop_port) +1745614568653241 - DROP: Packet 76 at end of ingress (egress_spec == drop_port) +1745614568654294 - DROP: Packet 80 at end of ingress (egress_spec == drop_port) +1745614568909863 - DROP: Packet 81 at end of ingress (egress_spec == drop_port) +1745614568910987 - DROP: Packet 77 at end of ingress (egress_spec == drop_port) +1745614568974208 - DROP: Packet 78 at end of ingress (egress_spec == drop_port) +1745614568974217 - DROP: Packet 56 at end of ingress (egress_spec == drop_port) +1745614569103262 - DROP: Packet 57 at end of ingress (egress_spec == drop_port) +1745614569104390 - DROP: Packet 82 at end of ingress (egress_spec == drop_port) +1745614569169070 - DROP: Packet 83 at end of ingress (egress_spec == drop_port) +1745614569230413 - DROP: Packet 79 at end of ingress (egress_spec == drop_port) +1745614569486025 - DROP: Packet 58 at end of ingress (egress_spec == drop_port) +1745614569486045 - DROP: Packet 80 at end of ingress (egress_spec == drop_port) +1745614569487131 - DROP: Packet 84 at end of ingress (egress_spec == drop_port) +1745614569487240 - DROP: Packet 59 at end of ingress (egress_spec == drop_port) +1745614569519183 - DROP: Packet 85 at end of ingress (egress_spec == drop_port) +1745614569520320 - DROP: Packet 81 at end of ingress (egress_spec == drop_port) +1745614569648311 - DROP: Packet 82 at end of ingress (egress_spec == drop_port) +1745614569776319 - DROP: Packet 83 at end of ingress (egress_spec == drop_port) +1745614569910456 - DROP: Packet 84 at end of ingress (egress_spec == drop_port) +1745614569973554 - DROP: Packet 86 at end of ingress (egress_spec == drop_port) +1745614569974795 - DROP: Packet 60 at end of ingress (egress_spec == drop_port) +1745614570037875 - DROP: Packet 85 at end of ingress (egress_spec == drop_port) +1745614570038758 - DROP: Packet 87 at end of ingress (egress_spec == drop_port) +1745614570159216 - DROP: Packet 61 at end of ingress (egress_spec == drop_port) +1745614570159253 - DROP: Packet 86 at end of ingress (egress_spec == drop_port) +1745614570160139 - DROP: Packet 62 at end of ingress (egress_spec == drop_port) +1745614570160148 - DROP: Packet 88 at end of ingress (egress_spec == drop_port) +1745614570160473 - DROP: Packet 87 at end of ingress (egress_spec == drop_port) +1745614570161253 - DROP: Packet 89 at end of ingress (egress_spec == drop_port) +1745614570223068 - DROP: Packet 90 at end of ingress (egress_spec == drop_port) +1745614570223195 - DROP: Packet 63 at end of ingress (egress_spec == drop_port) +1745614570293102 - DROP: Packet 91 at end of ingress (egress_spec == drop_port) +1745614570294322 - DROP: Packet 88 at end of ingress (egress_spec == drop_port) +1745614570356456 - DROP: Packet 64 at end of ingress (egress_spec == drop_port) +1745614570357526 - DROP: Packet 89 at end of ingress (egress_spec == drop_port) +1745614570415189 - DROP: Packet 65 at end of ingress (egress_spec == drop_port) +1745614570415192 - DROP: Packet 90 at end of ingress (egress_spec == drop_port) +1745614570486756 - DROP: Packet 92 at end of ingress (egress_spec == drop_port) +1745614570487888 - DROP: Packet 66 at end of ingress (egress_spec == drop_port) +1745614570553002 - DROP: Packet 93 at end of ingress (egress_spec == drop_port) +1745614570613317 - DROP: Packet 91 at end of ingress (egress_spec == drop_port) +1745614570671158 - DROP: Packet 67 at end of ingress (egress_spec == drop_port) +1745614570672122 - DROP: Packet 94 at end of ingress (egress_spec == drop_port) +1745614570674294 - DROP: Packet 95 at end of ingress (egress_spec == drop_port) +1745614570870646 - DROP: Packet 68 at end of ingress (egress_spec == drop_port) +1745614570870750 - DROP: Packet 92 at end of ingress (egress_spec == drop_port) +1745614570871645 - DROP: Packet 96 at end of ingress (egress_spec == drop_port) +1745614570872912 - DROP: Packet 69 at end of ingress (egress_spec == drop_port) +1745614572526293 - DROP: Packet 93 at end of ingress (egress_spec == drop_port) +1745614572590644 - DROP: Packet 97 at end of ingress (egress_spec == drop_port) +1745614572590806 - DROP: Packet 70 at end of ingress (egress_spec == drop_port) +1745614572653488 - DROP: Packet 94 at end of ingress (egress_spec == drop_port) +1745614572654443 - DROP: Packet 98 at end of ingress (egress_spec == drop_port) +1745614572910137 - DROP: Packet 95 at end of ingress (egress_spec == drop_port) +1745614572911048 - DROP: Packet 99 at end of ingress (egress_spec == drop_port) +1745614572973392 - DROP: Packet 71 at end of ingress (egress_spec == drop_port) +1745614572973406 - DROP: Packet 96 at end of ingress (egress_spec == drop_port) +1745614573103547 - DROP: Packet 72 at end of ingress (egress_spec == drop_port) +1745614573104596 - DROP: Packet 100 at end of ingress (egress_spec == drop_port) +1745614573170185 - DROP: Packet 101 at end of ingress (egress_spec == drop_port) +1745614573231778 - DROP: Packet 97 at end of ingress (egress_spec == drop_port) +1745614573324289 - ENQUEUE: Packet 102 to port 3 with priority 0 (queue 0), queue depth before: 0 +1745614573485632 - DROP: Packet 73 at end of ingress (egress_spec == drop_port) +1745614573485720 - DROP: Packet 98 at end of ingress (egress_spec == drop_port) +1745614573487895 - DROP: Packet 74 at end of ingress (egress_spec == drop_port) +1745614573488117 - DROP: Packet 103 at end of ingress (egress_spec == drop_port) +1745614577327794 - DROP: Packet 99 at end of ingress (egress_spec == drop_port) +1745614577328242 - DROP: Packet 104 at end of ingress (egress_spec == drop_port) +1745614577328917 - DROP: Packet 100 at end of ingress (egress_spec == drop_port) +1745614577840172 - DROP: Packet 75 at end of ingress (egress_spec == drop_port) +1745614577840258 - DROP: Packet 105 at end of ingress (egress_spec == drop_port) +1745614578351204 - DROP: Packet 76 at end of ingress (egress_spec == drop_port) +1745614578351214 - DROP: Packet 101 at end of ingress (egress_spec == drop_port) +1745614578352313 - DROP: Packet 77 at end of ingress (egress_spec == drop_port) +1745614578353359 - DROP: Packet 106 at end of ingress (egress_spec == drop_port) +1745614578353414 - DROP: Packet 102 at end of ingress (egress_spec == drop_port) +1745614578355607 - DROP: Packet 103 at end of ingress (egress_spec == drop_port) +1745614578357799 - DROP: Packet 104 at end of ingress (egress_spec == drop_port) +1745614578864169 - DROP: Packet 107 at end of ingress (egress_spec == drop_port) +1745614578865241 - DROP: Packet 78 at end of ingress (egress_spec == drop_port) +1745614579376181 - DROP: Packet 79 at end of ingress (egress_spec == drop_port) +1745614579377138 - DROP: Packet 108 at end of ingress (egress_spec == drop_port) +1745614579889144 - DROP: Packet 109 at end of ingress (egress_spec == drop_port) diff --git a/utils/Makefile b/utils/Makefile index 44fe8ea9..d8f5830a 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -41,7 +41,7 @@ stop: build: dirs $(compiled_json) %.json: %.p4 - $(P4C) --p4v 16 $(P4C_ARGS) -o $(BUILD_DIR)/$@ $< + $(P4C) --p4v 16 $(P4C_ARGS) -o $(BUILD_DIR)/$@ $< --emit-externs dirs: mkdir -p $(BUILD_DIR) $(PCAP_DIR) $(LOG_DIR) diff --git a/utils/p4runtime_lib/bmv2.py b/utils/p4runtime_lib/bmv2.py index 67254f65..be2dd6cc 100644 --- a/utils/p4runtime_lib/bmv2.py +++ b/utils/p4runtime_lib/bmv2.py @@ -13,14 +13,25 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from p4.tmp import p4config_pb2 +# Instead of using the protocol buffer class, we'll use a simple class that provides the same interface +class SimpleP4DeviceConfig(object): + def __init__(self): + self.reassign = False + self.device_data = b'' + + def SerializeToString(self): + """ + Emulates the Protocol Buffer's SerializeToString method. + Just returns the device_data as binary string. + """ + return self.device_data from .switch import SwitchConnection def buildDeviceConfig(bmv2_json_file_path=None): "Builds the device config for BMv2" - device_config = p4config_pb2.P4DeviceConfig() + device_config = SimpleP4DeviceConfig() device_config.reassign = True with open(bmv2_json_file_path) as f: device_config.device_data = f.read().encode('utf-8') diff --git a/utils/p4runtime_lib/custom_pb/__init__.py b/utils/p4runtime_lib/custom_pb/__init__.py new file mode 100644 index 00000000..fbe20234 --- /dev/null +++ b/utils/p4runtime_lib/custom_pb/__init__.py @@ -0,0 +1 @@ +# Empty __init__.py file to make this directory a proper Python package \ No newline at end of file diff --git a/utils/p4runtime_lib/custom_pb/p4config_pb2.py b/utils/p4runtime_lib/custom_pb/p4config_pb2.py new file mode 100644 index 00000000..e6819a2d --- /dev/null +++ b/utils/p4runtime_lib/custom_pb/p4config_pb2.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Custom implementation to provide missing P4DeviceConfig class + +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +_sym_db = _symbol_database.Default() + +class P4DeviceConfig(_message.Message): + """Custom implementation of P4DeviceConfig message""" + + DESCRIPTOR = _descriptor.Descriptor( + name='P4DeviceConfig', + full_name='p4.tmp.P4DeviceConfig', + filename=None, + containing_type=None, + fields=[], + extensions=[], + nested_types=[], + enum_types=[], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[], + serialized_start=31, + serialized_end=48, + ) + + def __init__(self, **kwargs): + super(P4DeviceConfig, self).__init__(**kwargs) + self.reassign = False + self.device_data = b'' \ No newline at end of file diff --git a/utils/p4runtime_switch.py b/utils/p4runtime_switch.py index 18ec0ecb..52754677 100644 --- a/utils/p4runtime_switch.py +++ b/utils/p4runtime_switch.py @@ -129,8 +129,16 @@ def start(self, controllers): args.append("-- --grpc-server-addr 0.0.0.0:" + str(self.grpc_port)) if self.cpu_port: args.append("--cpu-port " + str(self.cpu_port)) + + # env_vars = "LD_PRELOAD=/home/nwlab/p4/tutorials/utils/user_externs_pifo/pifo.so " + # env_vars = "LD_PRELOAD=/home/pralhad/tutorials/utils/user_externs_pifo1/pifo.so " + # env_vars = "LD_PRELOAD=/home/pralhad/tutorials/utils/user_externs_sp_pifo/sp_pifo.so " + # env_vars = "LD_PRELOAD=/home/pralhad/tutorials/utils/user_externs_pieo/pieo.so " + # env_vars = "LD_PRELOAD=/home/pralhad/tutorials/utils/user_externs_pFabric/pFabric.so " cmd = ' '.join(args) + # print("Command to start the switch: \n", cmd) info(cmd + "\n") + # info(cmd + "\n") print(cmd + "\n") diff --git a/utils/run_exercise.py b/utils/run_exercise.py index a2169fe9..7342f38e 100755 --- a/utils/run_exercise.py +++ b/utils/run_exercise.py @@ -33,6 +33,8 @@ from mininet.topo import Topo from p4_mininet import P4Host, P4Switch from p4runtime_switch import P4RuntimeSwitch +from run_sim import sending_function +# from run_sim_ex import sending_function def configureP4Switch(**switch_args): @@ -363,6 +365,10 @@ def do_net_cli(self): print(' for example run: cat %s/s1-p4runtime-requests.txt' % self.log_dir) print('') + # calling the function to generate the iperf traffic. + sending_function(self) + + CLI(self.net) diff --git a/utils/run_sim.py b/utils/run_sim.py new file mode 100644 index 00000000..18a07aa9 --- /dev/null +++ b/utils/run_sim.py @@ -0,0 +1,248 @@ +from time import sleep +import os + +def sending_function(self): + # First, ensure the outputs directory exists + os.makedirs('./outputs', exist_ok=True) + + # Get all hosts + h11,h12,h13,h14,h15,h16,h17,h18,h19,h110,h111,h112,h113,h114,h115,h116,h21,h22,h23,h24,h25,h26,h27,h28,h29,h210,h211,h212,h213,h214,h215,h216,h31,h32,h33,h34,h35,h36,h37,h38,h39,h310,h311,h312,h313,h314,h315,h316,h41,h42,h43,h44,h45,h46,h47,h48,h49,h410,h411,h412,h413,h414,h415,h416,h51,h52,h53,h54,h55,h56,h57,h58,h59,h510,h511,h512,h513,h514,h515,h516,h61,h62,h63,h64,h65,h66,h67,h68,h69,h610,h611,h612,h613,h614,h615,h616,h71,h72,h73,h74,h75,h76,h77,h78,h79,h710,h711,h712,h713,h714,h715,h716,h81,h82,h83,h84,h85,h86,h87,h88,h89,h810,h811,h812,h813,h814,h815,h816,h91,h92,h93,h94,h95,h96,h97,h98,h99,h910,h911,h912,h913,h914,h915,h916, = self.net.get('h11','h12','h13','h14','h15','h16','h17','h18','h19','h110','h111','h112','h113','h114','h115','h116','h21','h22','h23','h24','h25','h26','h27','h28','h29','h210','h211','h212','h213','h214','h215','h216','h31','h32','h33','h34','h35','h36','h37','h38','h39','h310','h311','h312','h313','h314','h315','h316','h41','h42','h43','h44','h45','h46','h47','h48','h49','h410','h411','h412','h413','h414','h415','h416','h51','h52','h53','h54','h55','h56','h57','h58','h59','h510','h511','h512','h513','h514','h515','h516','h61','h62','h63','h64','h65','h66','h67','h68','h69','h610','h611','h612','h613','h614','h615','h616','h71','h72','h73','h74','h75','h76','h77','h78','h79','h710','h711','h712','h713','h714','h715','h716','h81','h82','h83','h84','h85','h86','h87','h88','h89','h810','h811','h812','h813','h814','h815','h816','h91','h92','h93','h94','h95','h96','h97','h98','h99','h910','h911','h912','h913','h914','h915','h916',) + + # Create outputs directory in each host + for host in [h59, h510, h511, h512, h513, h514, h515, h516, + h61, h62, h63, h64, h65, h66, h67, h68, h69, h610, h611, h612, h613, h614, h615, h616, + h71, h72, h73, h74, h75, h76, h77, h78, h79, h710, h711, h712, h713, h714, h715, h716, + h81, h82, h83, h84, h85, h86, h87, h88, h89, h810, h811, h812, h813, h814, h815, h816, + h91, h92, h93, h94, h95, h96, h97, h98, h99, h910, h911, h912, h913, h914, h915, h916]: + host.cmd('mkdir -p ./outputs') + + # Start receivers + h59.cmd('iperf -s > ./outputs/receiver_h59.txt &') + h510.cmd('iperf -s > ./outputs/receiver_h510.txt &') + h511.cmd('iperf -s > ./outputs/receiver_h511.txt &') + h512.cmd('iperf -s > ./outputs/receiver_h512.txt &') + h513.cmd('iperf -s > ./outputs/receiver_h513.txt &') + h514.cmd('iperf -s > ./outputs/receiver_h514.txt &') + h515.cmd('iperf -s > ./outputs/receiver_h515.txt &') + h516.cmd('iperf -s > ./outputs/receiver_h516.txt &') + h61.cmd('iperf -s > ./outputs/receiver_h61.txt &') + h62.cmd('iperf -s > ./outputs/receiver_h62.txt &') + h63.cmd('iperf -s > ./outputs/receiver_h63.txt &') + h64.cmd('iperf -s > ./outputs/receiver_h64.txt &') + h65.cmd('iperf -s > ./outputs/receiver_h65.txt &') + h66.cmd('iperf -s > ./outputs/receiver_h66.txt &') + h67.cmd('iperf -s > ./outputs/receiver_h67.txt &') + h68.cmd('iperf -s > ./outputs/receiver_h68.txt &') + h69.cmd('iperf -s > ./outputs/receiver_h69.txt &') + h610.cmd('iperf -s > ./outputs/receiver_h610.txt &') + h611.cmd('iperf -s > ./outputs/receiver_h611.txt &') + h612.cmd('iperf -s > ./outputs/receiver_h612.txt &') + h613.cmd('iperf -s > ./outputs/receiver_h613.txt &') + h614.cmd('iperf -s > ./outputs/receiver_h614.txt &') + h615.cmd('iperf -s > ./outputs/receiver_h615.txt &') + h616.cmd('iperf -s > ./outputs/receiver_h616.txt &') + h71.cmd('iperf -s > ./outputs/receiver_h71.txt &') + h72.cmd('iperf -s > ./outputs/receiver_h72.txt &') + h73.cmd('iperf -s > ./outputs/receiver_h73.txt &') + h74.cmd('iperf -s > ./outputs/receiver_h74.txt &') + h75.cmd('iperf -s > ./outputs/receiver_h75.txt &') + h76.cmd('iperf -s > ./outputs/receiver_h76.txt &') + h77.cmd('iperf -s > ./outputs/receiver_h77.txt &') + h78.cmd('iperf -s > ./outputs/receiver_h78.txt &') + h79.cmd('iperf -s > ./outputs/receiver_h79.txt &') + h710.cmd('iperf -s > ./outputs/receiver_h710.txt &') + h711.cmd('iperf -s > ./outputs/receiver_h711.txt &') + h712.cmd('iperf -s > ./outputs/receiver_h712.txt &') + h713.cmd('iperf -s > ./outputs/receiver_h713.txt &') + h714.cmd('iperf -s > ./outputs/receiver_h714.txt &') + h715.cmd('iperf -s > ./outputs/receiver_h715.txt &') + h716.cmd('iperf -s > ./outputs/receiver_h716.txt &') + h81.cmd('iperf -s > ./outputs/receiver_h81.txt &') + h82.cmd('iperf -s > ./outputs/receiver_h82.txt &') + h83.cmd('iperf -s > ./outputs/receiver_h83.txt &') + h84.cmd('iperf -s > ./outputs/receiver_h84.txt &') + h85.cmd('iperf -s > ./outputs/receiver_h85.txt &') + h86.cmd('iperf -s > ./outputs/receiver_h86.txt &') + h87.cmd('iperf -s > ./outputs/receiver_h87.txt &') + h88.cmd('iperf -s > ./outputs/receiver_h88.txt &') + h89.cmd('iperf -s > ./outputs/receiver_h89.txt &') + h810.cmd('iperf -s > ./outputs/receiver_h810.txt &') + h811.cmd('iperf -s > ./outputs/receiver_h811.txt &') + h812.cmd('iperf -s > ./outputs/receiver_h812.txt &') + h813.cmd('iperf -s > ./outputs/receiver_h813.txt &') + h814.cmd('iperf -s > ./outputs/receiver_h814.txt &') + h815.cmd('iperf -s > ./outputs/receiver_h815.txt &') + h816.cmd('iperf -s > ./outputs/receiver_h816.txt &') + h91.cmd('iperf -s > ./outputs/receiver_h91.txt &') + h92.cmd('iperf -s > ./outputs/receiver_h92.txt &') + h93.cmd('iperf -s > ./outputs/receiver_h93.txt &') + h94.cmd('iperf -s > ./outputs/receiver_h94.txt &') + h95.cmd('iperf -s > ./outputs/receiver_h95.txt &') + h96.cmd('iperf -s > ./outputs/receiver_h96.txt &') + h97.cmd('iperf -s > ./outputs/receiver_h97.txt &') + h98.cmd('iperf -s > ./outputs/receiver_h98.txt &') + h99.cmd('iperf -s > ./outputs/receiver_h99.txt &') + h910.cmd('iperf -s > ./outputs/receiver_h910.txt &') + h911.cmd('iperf -s > ./outputs/receiver_h911.txt &') + h912.cmd('iperf -s > ./outputs/receiver_h912.txt &') + h913.cmd('iperf -s > ./outputs/receiver_h913.txt &') + h914.cmd('iperf -s > ./outputs/receiver_h914.txt &') + h915.cmd('iperf -s > ./outputs/receiver_h915.txt &') + h916.cmd('iperf -s > ./outputs/receiver_h916.txt &') + + # print("all the hosts are ready to receive packets") + # print("Starting sending packets...\n") + + sleep(2) + h11.cmd('iperf -c 10.0.9.31 -n 6667000 -M 1500 > ./outputs/sender_h11.txt &') + sleep(0.001) + h12.cmd('iperf -c 10.0.5.31 -n 133000 -M 1500 > ./outputs/sender_h12.txt &') + sleep(0.001) + h13.cmd('iperf -c 10.0.8.31 -n 6000 -M 1500 > ./outputs/sender_h13.txt &') + sleep(0.001) + h14.cmd('iperf -c 10.0.6.31 -n 133000 -M 1500 > ./outputs/sender_h14.txt &') + sleep(0.001) + h15.cmd('iperf -c 10.0.9.29 -n 3333000 -M 1500 > ./outputs/sender_h15.txt &') + sleep(0.001) + h16.cmd('iperf -c 10.0.5.29 -n 6667000 -M 1500 > ./outputs/sender_h16.txt &') + sleep(0.001) + h17.cmd('iperf -c 10.0.9.27 -n 133000 -M 1500 > ./outputs/sender_h17.txt &') + sleep(0.001) + h18.cmd('iperf -c 10.0.9.25 -n 13000 -M 1500 > ./outputs/sender_h18.txt &') + sleep(0.001) + h19.cmd('iperf -c 10.0.7.31 -n 3333000 -M 1500 > ./outputs/sender_h19.txt &') + sleep(0.001) + h110.cmd('iperf -c 10.0.8.29 -n 6667000 -M 1500 > ./outputs/sender_h110.txt &') + sleep(0.001) + h111.cmd('iperf -c 10.0.8.27 -n 6000 -M 1500 > ./outputs/sender_h111.txt &') + sleep(0.001) + h112.cmd('iperf -c 10.0.9.23 -n 667000 -M 1500 > ./outputs/sender_h112.txt &') + sleep(0.001) + h113.cmd('iperf -c 10.0.8.25 -n 1333000 -M 1500 > ./outputs/sender_h113.txt &') + sleep(0.001) + h114.cmd('iperf -c 10.0.8.23 -n 133000 -M 1500 > ./outputs/sender_h114.txt &') + sleep(0.001) + h115.cmd('iperf -c 10.0.8.21 -n 13000 -M 1500 > ./outputs/sender_h115.txt &') + sleep(0.001) + h116.cmd('iperf -c 10.0.8.19 -n 667000 -M 1500 > ./outputs/sender_h116.txt &') + sleep(0.001) + h21.cmd('iperf -c 10.0.6.29 -n 6000 -M 1500 > ./outputs/sender_h21.txt &') + sleep(0.001) + h22.cmd('iperf -c 10.0.5.27 -n 6000 -M 1500 > ./outputs/sender_h22.txt &') + sleep(0.001) + h23.cmd('iperf -c 10.0.8.17 -n 6000 -M 1500 > ./outputs/sender_h23.txt &') + sleep(0.001) + h24.cmd('iperf -c 10.0.9.21 -n 6000 -M 1500 > ./outputs/sender_h24.txt &') + sleep(0.001) + h25.cmd('iperf -c 10.0.7.29 -n 6667000 -M 1500 > ./outputs/sender_h25.txt &') + sleep(0.001) + h26.cmd('iperf -c 10.0.8.15 -n 133000 -M 1500 > ./outputs/sender_h26.txt &') + sleep(0.001) + h27.cmd('iperf -c 10.0.5.25 -n 1333000 -M 1500 > ./outputs/sender_h27.txt &') + sleep(0.001) + h28.cmd('iperf -c 10.0.7.27 -n 133000 -M 1500 > ./outputs/sender_h28.txt &') + sleep(0.001) + h29.cmd('iperf -c 10.0.8.13 -n 6000 -M 1500 > ./outputs/sender_h29.txt &') + sleep(0.001) + h210.cmd('iperf -c 10.0.6.27 -n 1333000 -M 1500 > ./outputs/sender_h210.txt &') + sleep(0.001) + h211.cmd('iperf -c 10.0.8.11 -n 53000 -M 1500 > ./outputs/sender_h211.txt &') + sleep(0.001) + h212.cmd('iperf -c 10.0.5.23 -n 6000 -M 1500 > ./outputs/sender_h212.txt &') + sleep(0.001) + h213.cmd('iperf -c 10.0.9.19 -n 13000 -M 1500 > ./outputs/sender_h213.txt &') + sleep(0.001) + h214.cmd('iperf -c 10.0.7.25 -n 133000 -M 1500 > ./outputs/sender_h214.txt &') + sleep(0.001) + h215.cmd('iperf -c 10.0.8.9 -n 19000 -M 1500 > ./outputs/sender_h215.txt &') + sleep(0.001) + h216.cmd('iperf -c 10.0.7.23 -n 20000000 -M 1500 > ./outputs/sender_h216.txt &') + sleep(0.001) + h31.cmd('iperf -c 10.0.9.17 -n 133000 -M 1500 > ./outputs/sender_h31.txt &') + sleep(0.001) + h32.cmd('iperf -c 10.0.7.21 -n 3333000 -M 1500 > ./outputs/sender_h32.txt &') + sleep(0.001) + h33.cmd('iperf -c 10.0.5.21 -n 20000000 -M 1500 > ./outputs/sender_h33.txt &') + sleep(0.001) + h34.cmd('iperf -c 10.0.9.15 -n 667000 -M 1500 > ./outputs/sender_h34.txt &') + sleep(0.001) + h35.cmd('iperf -c 10.0.9.13 -n 53000 -M 1500 > ./outputs/sender_h35.txt &') + sleep(0.001) + h36.cmd('iperf -c 10.0.9.11 -n 667000 -M 1500 > ./outputs/sender_h36.txt &') + sleep(0.001) + h37.cmd('iperf -c 10.0.5.19 -n 133000 -M 1500 > ./outputs/sender_h37.txt &') + sleep(0.001) + h38.cmd('iperf -c 10.0.8.7 -n 6667000 -M 1500 > ./outputs/sender_h38.txt &') + sleep(0.001) + h39.cmd('iperf -c 10.0.6.25 -n 19000 -M 1500 > ./outputs/sender_h39.txt &') + sleep(0.001) + h310.cmd('iperf -c 10.0.7.19 -n 133000 -M 1500 > ./outputs/sender_h310.txt &') + sleep(0.001) + h311.cmd('iperf -c 10.0.9.9 -n 19000 -M 1500 > ./outputs/sender_h311.txt &') + sleep(0.001) + h312.cmd('iperf -c 10.0.8.5 -n 53000 -M 1500 > ./outputs/sender_h312.txt &') + sleep(0.001) + h313.cmd('iperf -c 10.0.6.23 -n 53000 -M 1500 > ./outputs/sender_h313.txt &') + sleep(0.001) + h314.cmd('iperf -c 10.0.5.17 -n 133000 -M 1500 > ./outputs/sender_h314.txt &') + sleep(0.001) + h315.cmd('iperf -c 10.0.8.3 -n 19000 -M 1500 > ./outputs/sender_h315.txt &') + sleep(0.001) + h316.cmd('iperf -c 10.0.6.21 -n 1333000 -M 1500 > ./outputs/sender_h316.txt &') + sleep(0.001) + h41.cmd('iperf -c 10.0.6.19 -n 19000 -M 1500 > ./outputs/sender_h41.txt &') + sleep(0.001) + h42.cmd('iperf -c 10.0.9.7 -n 6000 -M 1500 > ./outputs/sender_h42.txt &') + sleep(0.001) + h43.cmd('iperf -c 10.0.6.17 -n 667000 -M 1500 > ./outputs/sender_h43.txt &') + sleep(0.001) + h44.cmd('iperf -c 10.0.8.1 -n 1333000 -M 1500 > ./outputs/sender_h44.txt &') + sleep(0.001) + h45.cmd('iperf -c 10.0.7.17 -n 19000 -M 1500 > ./outputs/sender_h45.txt &') + sleep(0.001) + h46.cmd('iperf -c 10.0.9.5 -n 3333000 -M 1500 > ./outputs/sender_h46.txt &') + sleep(0.001) + h47.cmd('iperf -c 10.0.7.15 -n 53000 -M 1500 > ./outputs/sender_h47.txt &') + sleep(0.001) + h48.cmd('iperf -c 10.0.7.13 -n 667000 -M 1500 > ./outputs/sender_h48.txt &') + sleep(0.001) + h49.cmd('iperf -c 10.0.6.15 -n 133000 -M 1500 > ./outputs/sender_h49.txt &') + sleep(0.001) + h410.cmd('iperf -c 10.0.9.3 -n 53000 -M 1500 > ./outputs/sender_h410.txt &') + sleep(0.001) + h411.cmd('iperf -c 10.0.6.13 -n 13000 -M 1500 > ./outputs/sender_h411.txt &') + sleep(0.001) + h412.cmd('iperf -c 10.0.9.1 -n 19000 -M 1500 > ./outputs/sender_h412.txt &') + sleep(0.001) + h413.cmd('iperf -c 10.0.6.11 -n 133000 -M 1500 > ./outputs/sender_h413.txt &') + sleep(0.001) + h414.cmd('iperf -c 10.0.7.11 -n 3333000 -M 1500 > ./outputs/sender_h414.txt &') + sleep(0.001) + h415.cmd('iperf -c 10.0.7.9 -n 133000 -M 1500 > ./outputs/sender_h415.txt &') + sleep(0.001) + h416.cmd('iperf -c 10.0.7.7 -n 667000 -M 1500 > ./outputs/sender_h416.txt &') + sleep(0.001) + h51.cmd('iperf -c 10.0.6.9 -n 1333000 -M 1500 > ./outputs/sender_h51.txt &') + sleep(0.001) + h52.cmd('iperf -c 10.0.6.7 -n 6000 -M 1500 > ./outputs/sender_h52.txt &') + sleep(0.001) + h53.cmd('iperf -c 10.0.7.5 -n 6000 -M 1500 > ./outputs/sender_h53.txt &') + sleep(0.001) + h54.cmd('iperf -c 10.0.6.5 -n 53000 -M 1500 > ./outputs/sender_h54.txt &') + sleep(0.001) + h55.cmd('iperf -c 10.0.6.3 -n 1333000 -M 1500 > ./outputs/sender_h55.txt &') + sleep(0.001) + h56.cmd('iperf -c 10.0.6.1 -n 3333000 -M 1500 > ./outputs/sender_h56.txt &') + sleep(0.001) + h57.cmd('iperf -c 10.0.7.3 -n 133000 -M 1500 > ./outputs/sender_h57.txt &') + sleep(0.001) + h58.cmd('iperf -c 10.0.7.1 -n 3333000 -M 1500 > ./outputs/sender_h58.txt &') + sleep(0.001) + +# def run_sim(net): +# """ +# Wrapper function to make it easier to call from run_exercise.py +# """ +# sim = type('', (), {})() # Create a simple object +# sim.net = net +# return sending_function(sim) diff --git a/utils/run_sim_ex.py b/utils/run_sim_ex.py new file mode 100644 index 00000000..1ea6f0ae --- /dev/null +++ b/utils/run_sim_ex.py @@ -0,0 +1,90 @@ +from time import sleep +import os + +def sending_function(self): + # First, ensure the outputs directory exists + output_dir = './outputs' + os.makedirs(output_dir, exist_ok=True) + print(f"Ensured output directory exists: {output_dir}") + + # Get hosts + h1,h2,h3,h4,h5,h6,h7,h8 = self.net.get('h1','h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'h8') + hosts = [h1, h2, h3, h4, h5, h6, h7, h8] + print(f"Got hosts: {[h.name for h in hosts]}") + + # Define server-client pairs and parameters + flows = [ + {'sender': h1, 'receiver': h5, 'duration': 25, 'priority': 8, 'delay': 0}, + {'sender': h2, 'receiver': h6, 'duration': 20, 'priority': 4, 'delay': 5}, + {'sender': h3, 'receiver': h7, 'duration': 15, 'priority': 2, 'delay': 5}, + {'sender': h4, 'receiver': h8, 'duration': 5, 'priority': 0, 'delay': 5}, + ] + + # Define log file paths + server_logs = {} + client_logs = {} + for flow in flows: + rec_name = flow['receiver'].name + send_name = flow['sender'].name + server_logs[rec_name] = os.path.join(output_dir, f"{rec_name}_server.json") + client_logs[send_name] = os.path.join(output_dir, f"{send_name}_client.json") + + # Start receivers (servers) + print("\nStarting iperf3 servers...") + for flow in flows: + receiver = flow['receiver'] + log_path = server_logs[receiver.name] + cmd = f'iperf3 -s --json -i 1 > {log_path} &' + print(f" {receiver.name}: {cmd}") + receiver.cmd(cmd) + + print("Servers starting in background. Waiting 5s...") + sleep(5) + + # Start senders (clients) with delays + print("\nStarting iperf3 clients sequentially...") + current_wait = 0 + total_elapsed_time = 0 + flow_start_times = {} + + for i, flow in enumerate(flows): + sender = flow['sender'] + receiver = flow['receiver'] + duration = flow['duration'] + priority = flow['priority'] + delay = flow['delay'] + client_log_path = client_logs[sender.name] + + if i > 0: + print(f"Waiting {delay}s before starting next flow...") + sleep(delay) + total_elapsed_time += delay + + flow_start_times[sender.name] = total_elapsed_time + print(f"Starting flow {i+1} ({sender.name}->{receiver.name}) at T={total_elapsed_time}s") + cmd = (f'iperf3 -c {receiver.IP()} -u -b 10M -t {duration} ' + f'-S {priority} --json > {client_log_path} &') + print(f" {sender.name}: {cmd}") + sender.cmd(cmd) + + max_end_time = 0 + for flow in flows: + start_time = flow_start_times[flow['sender'].name] + end_time = start_time + flow['duration'] + max_end_time = max(max_end_time, end_time) + print(f" Flow {flow['sender'].name}->{flow['receiver'].name}: Starts {start_time}s, Duration {flow['duration']}s, Ends {end_time}s") + + remaining_wait = max(0, max_end_time - total_elapsed_time) + 15 + + print(f"\nAll flows started. Max end time is {max_end_time}s.") + print(f"Current elapsed time: {total_elapsed_time}s.") + print(f"Waiting an additional {remaining_wait}s for all flows to complete...") + sleep(remaining_wait) + + print("\niperf tests should be complete.") + + print("Cleaning up iperf3 server processes...") + # for flow in flows: + # flow['receiver'].cmd('killall -q iperf3') + + print("\nScript finished.") diff --git a/utils/user_externs_pifo/Makefile b/utils/user_externs_pifo/Makefile new file mode 100644 index 00000000..a0428e0b --- /dev/null +++ b/utils/user_externs_pifo/Makefile @@ -0,0 +1,14 @@ +CXX=g++ +CXXSTD=-std=c++11 +CXXFLAGS=$(CXXSTD) -Wall -Wextra -pedantic -g -fPIC +LDFLAGS=-shared + +all: pifo.so + +pifo.so: + $(CXX) $(CXXFLAGS) $(LDFLAGS) pifo.cpp -o $@ + +clean: + rm -rf pifo.so + rm -rf pifo.o + rm -rf pifo.lo diff --git a/utils/user_externs_pifo/pifo.cpp b/utils/user_externs_pifo/pifo.cpp new file mode 100644 index 00000000..bbdd97b6 --- /dev/null +++ b/utils/user_externs_pifo/pifo.cpp @@ -0,0 +1,46 @@ +#include "pifo.h" +#include +#include + +namespace bm { + +std::vector> pifo_scheduler::FS = { NULL}; + +std::vector> pifo_scheduler::FB = { NULL}; + +unsigned int pifo_scheduler::time_now = 0; +unsigned int pifo_scheduler::number_levels = 1; + +std::vector pifo_scheduler::number_of_queues_per_level = {1}; +std::vector pifo_scheduler::number_of_pkts_per_queue_each_level = {1000}; + +unsigned int sum_all_queues = pifo_scheduler::number_of_queues_per_level[0]; + +unsigned int number_of_update_ranks_all_level = (pifo_scheduler::number_of_pkts_per_queue_each_level[0]*pifo_scheduler::number_of_queues_per_level[0] * pifo_scheduler::number_levels); + +std::vector pifo_scheduler::new_ranks_each_level(number_of_update_ranks_all_level); + +unsigned int pifo_scheduler::pkt_ptr = 0; +unsigned int pifo_scheduler::shaping = 0; +unsigned int pifo_scheduler::number_of_enqueue_packets = 0; +std::vector pifo_scheduler::pkt_levels_ranks = {0}; +unsigned int pifo_scheduler::switch_is_ready = 1; +unsigned int pifo_scheduler::number_of_read_packets = 0; +unsigned int pifo_scheduler::number_of_dequeue_packets = 0; +std::queue pifo_scheduler::pkt_ptr_queue; + +int pifo_scheduler::start_time = 0; +int pifo_scheduler::last_time = 0; + +BM_REGISTER_EXTERN(pifo_scheduler) +BM_REGISTER_EXTERN_METHOD(pifo_scheduler, my_scheduler, const Data&, const Data&, const Data&, const Data&, const Data&, const Data&, const Data&, const Data&, const Data&); + +BM_REGISTER_EXTERN_METHOD(pifo_scheduler, pass_rank_values, const Data&, const Data&); + +BM_REGISTER_EXTERN_METHOD(pifo_scheduler, pass_updated_rank_values, const Data&, const Data&, const Data&); + +} // namespace bm + +int import_pifo(){ + return 0; +} diff --git a/utils/user_externs_pifo/pifo.h b/utils/user_externs_pifo/pifo.h new file mode 100644 index 00000000..84bd4bd6 --- /dev/null +++ b/utils/user_externs_pifo/pifo.h @@ -0,0 +1,787 @@ +//////////////////////////////////////////////////// todo list +//////////////////////////////////////////////////// 1) force dequeue and error correction are not unsigned short introduced properly yet. +//////////////////////////////////////////////////// 2) add the arrival time in each packet (I am using the pkt_ptr instead in the enqueue_FS now) + +#ifndef SIMPLE_SWITCH_PSA_DIV_H_ +#define SIMPLE_SWITCH_PSA_DIV_H_ +#include +#include +#define _STDC_WANT_LIB_EXT1_ 1 +#define _CRT_SECURE_NO_WARNINGS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std::chrono; +#pragma once + +namespace bm { + +// if the rank = 0, that means this level is not used (pkts will be handled in a FIFO order in this level), the lowest rank in any level is "1". + +// this is the main class of the pifo scheduler that will be used later in any usage of the scheduler. +class pifo_scheduler : public bm::ExternType { + public: + BM_EXTERN_ATTRIBUTES { + BM_EXTERN_ATTRIBUTE_ADD(verbose); + } + + +void init() override { // Attributes + static constexpr std::uint32_t QUIET = 0u; + // Init variables + verbose_ = verbose.get() != QUIET;}; + +// the packet struct that presents any packet inside the scheduler. + struct packet { + unsigned int level3_flow_id; + unsigned int flow_id; + unsigned int rank; + unsigned int pred; + unsigned int pkt_ptr; + std::vector levels_ranks; + unsigned int arrival_time; + }; +// The flow scheduler struct : which is a queue that sorts 1 head packet from each flow. + struct flow_scheduler { + std::shared_ptr object; + std::shared_ptr next; + }; +// The Fifo bank struct : which consists of multiple FIFO queues, each one is dedicated to one flow, and stores all packets from this flow except the head packet. + struct fifo_bank { + unsigned int flow_id; + std::shared_ptr object; + std::shared_ptr bottom; + std::shared_ptr left; + }; + + static unsigned int time_now; // the current time, increment by 1 each time we call the scheduler for a dequeue (which is continous) + +// level 3 of the hierarchy variables + static std::vector number_of_queues_per_level; + static std::vector number_of_pkts_per_queue_each_level; + + + static std::vector> FS; + + static std::vector> FB; // the fifo bank queues, each flow scheduler has its own FIFO bank which stores the rest of packets of the flow handled in this flow scheduler. + + static std::vector new_ranks_each_level; +// level 2 of the hierarchy variables + +// level 1 of the hierarchy variables (root) + + // Added debug logging flag + static bool debug_logging; + + std::shared_ptr deq_packet_ptr = NULL; // the pointer to the dequeued packet + static unsigned int number_of_enqueue_packets; // the total number of enqueued packets until now. + + static unsigned int number_of_read_packets; // the total number of captured packets by the TM_buffer.h until now. + + static unsigned int number_of_dequeue_packets; // the total number of dequeued packets until now. + + static unsigned int switch_is_ready; + + static unsigned int number_levels; + +// these variables will contain the inputs that will be inserted by the user, to be used later. + unsigned int flow_id; + //std::vector pkt_levels_ranks = std::vector(number_levels); + static std::vector pkt_levels_ranks; + + std::vector enq_flow_id_each_level = std::vector(number_levels); + + unsigned int pred; + unsigned int arrival_time; + static unsigned int shaping; //new static + unsigned int enq; + static unsigned int pkt_ptr; //new static + unsigned int deq; + static std::queue pkt_ptr_queue; + + static int start_time; + static int last_time; + + // Add new helper methods to fix synchronization issues + static void update_read_packets(); + static void ensure_packet_dequeue(); + + void pass_rank_values(const Data& rank_value, const Data& level_id) + { + pkt_levels_ranks.erase(pkt_levels_ranks.begin() + level_id.get()); + pkt_levels_ranks.insert(pkt_levels_ranks.begin() + level_id.get(), rank_value.get()); + } + void pass_updated_rank_values(const Data& rank_value, const Data& flow_id, const Data& level_id) + { + new_ranks_each_level.erase(new_ranks_each_level.begin() + flow_id.get() + (number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0]*level_id.get())); + new_ranks_each_level.insert(new_ranks_each_level.begin() + flow_id.get() + (number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0]*level_id.get()), rank_value.get()); + } + + void my_scheduler(const Data& in_flow_id, const Data& number_of_levels_used, const Data& in_pred, const Data& in_arrival_time, const Data& in_shaping, const Data& in_enq, const Data& in_pkt_ptr, const Data& in_deq, const Data& reset_time) + { + +// copy the inputs values :: Todo : they should be removed later and just use the inputs directly. + + if(reset_time.get() == 1) + { + time_now = 0; + } + flow_id = in_flow_id.get(); + + // pkt_levels_ranks contains the ranks of this packet at each level, levels_ranks[number_levels] for the root, and levels_ranks[0] for the leaves + for (int i = number_of_levels_used.get(); i < int(number_levels); i++) + { + pkt_levels_ranks.erase(pkt_levels_ranks.begin() + i); + pkt_levels_ranks.insert(pkt_levels_ranks.begin() + i, pkt_levels_ranks[number_of_levels_used.get()-1]); + } + + pred = in_pred.get(); + arrival_time = in_arrival_time.get(); + shaping = in_shaping.get(); + enq = in_enq.get(); + pkt_ptr = in_pkt_ptr.get(); + pkt_ptr_queue.push(pkt_ptr); + deq = in_deq.get(); + +// the core code of the pifo scheduler, that enqueue, dequeue or force dequeue packets. + run_core(); + } + +// the function for enqueue/dequeue to/from the third level of the hierarchy. + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void level_controller(std::shared_ptr& level_packet_ptr, unsigned int level_enq, unsigned int level_deq, unsigned int level_id) + { + std::cout << "level_controller called: level_id = " << level_id << ", level_enq = " << level_enq << ", level_deq = " << level_deq << std::endl; + std::shared_ptr head_FS = NULL; + std::shared_ptr out_deq_pkt_ptr; + std::shared_ptr head_FB = NULL; + unsigned int queue_id = 0; + unsigned int next_flow_id_empty = 0; + unsigned int sum_number_all_queues = 0; + unsigned int sum_all_update_rank_flows = 0; + + for(int i = 0; i < int(level_id); i++) + { + if(i ==0) + { + sum_all_update_rank_flows = (number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0]); + } + else + { + sum_all_update_rank_flows = sum_all_update_rank_flows + number_of_queues_per_level[i-1]; + } + sum_number_all_queues = sum_number_all_queues + number_of_queues_per_level[i]; + + } + if (level_enq == 1) + { + std::cout << "Enqueueing at level: " << level_id << std::endl; + if(level_id < (number_levels - 1)) + { + queue_id = int(level_packet_ptr->flow_id / number_of_pkts_per_queue_each_level[level_id]); + std::cout << "queue_id = " << queue_id << std::endl; + } + + if(level_id == 0) + { + head_FB = FB[queue_id]; + } + + head_FS = FS[queue_id + sum_number_all_queues]; + + if(level_id !=0) + { + sum_all_update_rank_flows = sum_all_update_rank_flows + (number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0]) * (number_levels-1); + } + + pifo(level_packet_ptr, shaping, level_enq, level_deq, \ + head_FS, head_FB, \ + time_now, out_deq_pkt_ptr,next_flow_id_empty); + + FS[queue_id + sum_number_all_queues] = head_FS; + if(level_id == 0) + { + FB[queue_id] = head_FB; + } + } + else if (level_deq == 1) + { + std::cout << "Dequeueing at level: " << level_id << std::endl; + if(level_id < (number_levels - 1)) + { + queue_id = level_packet_ptr->flow_id; + std::cout << "queue_id = " << queue_id << std::endl; + } + if(level_id == 0) + { + head_FB = FB[queue_id]; + } + + if(level_id !=0) + { + sum_all_update_rank_flows = sum_all_update_rank_flows + (number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0]) * (number_levels-1); + } + + pifo(level_packet_ptr, shaping, level_enq, level_deq, \ + FS[queue_id + sum_number_all_queues], head_FB, \ + time_now, out_deq_pkt_ptr,next_flow_id_empty); + + level_packet_ptr = out_deq_pkt_ptr; + } + } + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// determine the queues IDs for each packet corresponding to the first and the second level of the hierarchy. + void levels_queues_id(unsigned int flow_id) + { + unsigned int flow_id_at_this_level = int(flow_id/number_of_pkts_per_queue_each_level[0]); + enq_flow_id_each_level.erase(enq_flow_id_each_level.begin() + 0); + enq_flow_id_each_level.insert(enq_flow_id_each_level.begin() + 0, flow_id_at_this_level); + for(int i = 1; i < int(number_levels); i++) + { + enq_flow_id_each_level.erase(enq_flow_id_each_level.begin() + i); + enq_flow_id_each_level.insert(enq_flow_id_each_level.begin() + i, flow_id_at_this_level); + flow_id_at_this_level = int(flow_id/((number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0])/number_of_queues_per_level[i])); + } + } + +// I used check_levels for dequeue and for "Force dequeue" + void check_levels(std::vector& flow_id_found) + { + flow_id_found.erase(flow_id_found.begin() + 0); + flow_id_found.insert(flow_id_found.begin() + 0, 0); + std::shared_ptr cur_ptr_FS; + unsigned int sum_number_all_queues = 0; + for (int j = 1; j < int(number_levels); j++) + { + flow_id_found.erase(flow_id_found.begin() + j); + flow_id_found.insert(flow_id_found.begin() + j, 0); + sum_number_all_queues = sum_number_all_queues + number_of_queues_per_level[j-1]; + for (int i = 0; i < int(number_of_queues_per_level[j]);i++) + { + cur_ptr_FS = FS[i + sum_number_all_queues]; + while (cur_ptr_FS != NULL) + { + if (cur_ptr_FS->object->flow_id == enq_flow_id_each_level[j]) + { + flow_id_found.erase(flow_id_found.begin() + j); + flow_id_found.insert(flow_id_found.begin() + j, 1); + break; + } + cur_ptr_FS = cur_ptr_FS->next; + } + if(flow_id_found[j] == 1) + { + break; + } + } + } + } + + void update_ranks_level_all_levels() + { + unsigned int sum_number_all_queues = 0; + unsigned int sum_all_update_rank_flows = (number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0])*(number_levels); + unsigned int offset_of_new_ranks_each_level = (number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0]); + + for(int i = 0; i < int(number_of_queues_per_level[0]); i++) + { + if (FS[i] != NULL) + { + new_ranks_each_level.erase(new_ranks_each_level.begin() + i + sum_all_update_rank_flows); + + if ((new_ranks_each_level[FS[i]->object->flow_id + offset_of_new_ranks_each_level]!=0)) + { + new_ranks_each_level.insert(new_ranks_each_level.begin() + i + sum_all_update_rank_flows, new_ranks_each_level[FS[i]->object->flow_id + offset_of_new_ranks_each_level]); + } + else + { + new_ranks_each_level.insert(new_ranks_each_level.begin() + i + sum_all_update_rank_flows, FS[i]->object->rank); + } + } + } + + for(int j = 2; j < int(number_levels); j++) + { + sum_number_all_queues = sum_number_all_queues + number_of_queues_per_level[j-2]; + sum_all_update_rank_flows = sum_all_update_rank_flows + number_of_queues_per_level[j-2]; + unsigned int offset_of_new_ranks_each_level = (number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0])*(j-1); + for(int i = 0; i < int(number_of_queues_per_level[j-1]); i++) + { + if (FS[i + sum_number_all_queues] != NULL) + { + new_ranks_each_level.erase(new_ranks_each_level.begin() + i + sum_all_update_rank_flows); + + if ((new_ranks_each_level[FS[i + sum_number_all_queues]->object->level3_flow_id + offset_of_new_ranks_each_level]!=0)) + { + new_ranks_each_level.insert(new_ranks_each_level.begin() + i + sum_all_update_rank_flows, new_ranks_each_level[FS[i + sum_number_all_queues]->object->level3_flow_id + offset_of_new_ranks_each_level]); + } + else + { + new_ranks_each_level.insert(new_ranks_each_level.begin() + i + sum_all_update_rank_flows, FS[i + sum_number_all_queues]->object->rank); + } + } + } + } + } + +// the core function of the pifo scheduler, applies enqueue and dequeue operations, to & from each level of the hirarchy, +//and each level is responsible of enqueue and dequeue in each queue inside this level + void run_core() + { + deq_packet_ptr = NULL; + + if (enq == 1) + { + if(start_time == 0) + { + start_time = std::time(0); + } + + // before enqueueing the packets he is incrementing the number of packets in the queue + number_of_enqueue_packets = number_of_enqueue_packets + 1; + + // Make sure we update the sync variables for proper dequeuing + update_read_packets(); + + std::shared_ptr enq_packet_ptr; + enq_packet_ptr = std::make_shared(); + enq_packet_ptr->level3_flow_id = flow_id; + enq_packet_ptr->flow_id = flow_id; + enq_packet_ptr->rank = pkt_levels_ranks[0]; + enq_packet_ptr->pred = pred; + enq_packet_ptr->pkt_ptr = pkt_ptr; + enq_packet_ptr->levels_ranks = pkt_levels_ranks; + enq_packet_ptr->arrival_time = arrival_time; + + if (debug_logging) { + Logger::get()->info("PIFO: Enqueueing packet with flow_id={}, pkt_ptr={}, rank={}", + flow_id, pkt_ptr, pkt_levels_ranks[0]); + } + + levels_queues_id(flow_id); + std::vector flow_id_found_all_levels = std::vector(number_levels); + check_levels(flow_id_found_all_levels); + // levels_ranks should be the updated flows ranks + + unsigned int enq_level_id = 0; + for(int i = number_levels - 1; i > 0; i--) + { + if (flow_id_found_all_levels[i] == 0) + { + enq_packet_ptr->rank = pkt_levels_ranks[i]; + enq_packet_ptr->flow_id = enq_flow_id_each_level[i]; + enq_level_id = i; + break; + } + } + + level_controller(enq_packet_ptr, enq, 0, enq_level_id); + } + + if ((deq == 1)&&(switch_is_ready == 1)) + { + last_time = std::time(0); + + if(last_time > start_time) + { + time_now = last_time - start_time; + } + else + { + time_now = 0; + } + + if(number_levels > 1) + { + update_ranks_level_all_levels(); + } + + // Ensure we can properly dequeue packets by fixing synchronization + ensure_packet_dequeue(); + + if (debug_logging) { + Logger::get()->info("PIFO: Attempting to dequeue a packet, sync state: read={}, enqueued={}", + number_of_read_packets, number_of_enqueue_packets); + } + + // Reduced sleep time to improve performance + std::this_thread::sleep_for(std::chrono::microseconds(10)); // Was 810 microseconds + + deq_packet_ptr = std::shared_ptr(std::make_shared()); + + level_controller(deq_packet_ptr, 0, deq, number_levels - 1); + std::shared_ptr intermediate_pkt_ptr = std::shared_ptr(std::make_shared()); + if(deq_packet_ptr != NULL) + { + if (debug_logging) { + Logger::get()->info("PIFO: Successfully dequeued packet at top level, flow_id={}", + deq_packet_ptr->flow_id); + } + + unsigned int prev_level_dequeued_flow_id = deq_packet_ptr->flow_id; + for(int i = number_levels - 2; i >= 0; i--) + { + intermediate_pkt_ptr->flow_id = prev_level_dequeued_flow_id; + level_controller(intermediate_pkt_ptr, 0, deq, i); + if ((intermediate_pkt_ptr == NULL)&&(shaping)) + { + // Try again without shaping if we failed with shaping + unsigned int original_shaping_value = shaping; + shaping = 0; + intermediate_pkt_ptr = std::shared_ptr(std::make_shared()); + intermediate_pkt_ptr->flow_id = prev_level_dequeued_flow_id; + level_controller(intermediate_pkt_ptr, 0, deq, i); + shaping = original_shaping_value; + } + if(intermediate_pkt_ptr != NULL) + { + unsigned int last_dequeued_pkt_flow_id = intermediate_pkt_ptr->flow_id; + intermediate_pkt_ptr->flow_id = prev_level_dequeued_flow_id; + prev_level_dequeued_flow_id = last_dequeued_pkt_flow_id; + unsigned int offset_of_new_ranks_each_level = (number_of_pkts_per_queue_each_level[0]*number_of_queues_per_level[0])*(i); + if ((new_ranks_each_level[intermediate_pkt_ptr->level3_flow_id + offset_of_new_ranks_each_level]!=0)) + { + intermediate_pkt_ptr->rank = new_ranks_each_level[intermediate_pkt_ptr->level3_flow_id + offset_of_new_ranks_each_level]; + } + else + { + intermediate_pkt_ptr->rank = intermediate_pkt_ptr->levels_ranks[i+1]; + } + level_controller(intermediate_pkt_ptr, 1, 0, i+1); + } + else + { + if (debug_logging) { + Logger::get()->warn("PIFO: Failed to process intermediate packet at level {}", i); + } + break; + } + } + } else { + if (debug_logging) { + Logger::get()->warn("PIFO: Failed to dequeue any packet from top level"); + } + } + } + } + + +// This is the pifo queue function which handles 1 flow_scheduler and 1 FIFO at a time, this function is used by each level function + void pifo(std::shared_ptr pkt_ptr, unsigned int in_shaping, unsigned int in_enq, unsigned int in_deq, std::shared_ptr& in_head_FS, std::shared_ptr& in_head_FB, \ + unsigned int in_time_now, std::shared_ptr& out_deq_pkt_ptr, unsigned int& next_flow_id_empty) + { + std::shared_ptr deq_packet_ptr = NULL; + std::shared_ptr cur_ptr_FS; + next_flow_id_empty = 0; + +// in case of enqueue (enq ==1), a packet will be enqueued to flow scheduler first enqueue_FS (if its flow already existed there), it will be enqueued in the FIFO bank instead. +// in case of dequeue (deq ==1), a packet will be dequeued from the flow scheduler dequeue_FS, then the next packet from the same flow will be dequeued from the FIFO bank dequeue_FB, +// then enqueue this next packet to the flow scheduler enqueue_FS. + if (in_enq == 1) + { + std::shared_ptr enq_packet_ptr; + enq_packet_ptr = std::shared_ptr(std::make_shared(*pkt_ptr)); + + cur_ptr_FS = in_head_FS; + + enqueue_FB(enq_packet_ptr, in_head_FB); + + enqueue_FS(enq_packet_ptr, in_head_FS); + } + if (in_deq == 1) + { + dequeue_FS(deq_packet_ptr, in_shaping, in_head_FS, in_time_now); + + if (deq_packet_ptr != NULL) + { + std::shared_ptr FB_FS_enq_packet_ptr; + FB_FS_enq_packet_ptr = std::shared_ptr(std::make_shared()); + dequeue_FB(FB_FS_enq_packet_ptr, deq_packet_ptr->flow_id, in_head_FB); + deq_packet_ptr = NULL; + deq_packet_ptr = FB_FS_enq_packet_ptr; + } + + } + + if (in_deq == 1) + out_deq_pkt_ptr = deq_packet_ptr; + else + out_deq_pkt_ptr = NULL; + } + +// used by pifo function to enqueue inside a certain flow scheduler + void enqueue_FS(std::shared_ptr new_packet_ptr, std::shared_ptr& head_FS) + { + std::shared_ptr cur_ptr_FS; + cur_ptr_FS = std::shared_ptr(std::make_shared()); + std::shared_ptr prev_ptr_FS; + prev_ptr_FS = std::shared_ptr(std::make_shared()); + if (head_FS == NULL) + { + head_FS = std::shared_ptr(std::make_shared()); + head_FS->object = new_packet_ptr; + head_FS->next = NULL; + cur_ptr_FS = head_FS; + } + else + { + cur_ptr_FS = head_FS; + prev_ptr_FS = NULL; + std::shared_ptr temp_ptr; + temp_ptr = std::shared_ptr(std::make_shared()); + temp_ptr->object = new_packet_ptr; + while ((cur_ptr_FS != NULL)) + { + if((cur_ptr_FS->object->rank < new_packet_ptr->rank)||((cur_ptr_FS->object->rank == new_packet_ptr->rank)&&(cur_ptr_FS->object->arrival_time < new_packet_ptr->arrival_time))) + { + prev_ptr_FS = cur_ptr_FS; + cur_ptr_FS = cur_ptr_FS->next; + } + else + { + break; + } + } + temp_ptr->next = cur_ptr_FS; + if (prev_ptr_FS == NULL) + { + head_FS = temp_ptr; + } + else + { + prev_ptr_FS->next = temp_ptr; + } + } + } + +// used by pifo function to enqueue inside a certain FIFO bank + void enqueue_FB(std::shared_ptr new_packet_ptr, std::shared_ptr& head_FB) + { + std::shared_ptr cur_ptr_FB; + cur_ptr_FB = std::shared_ptr(std::make_shared()); + std::shared_ptr prev_ptr_FB; + prev_ptr_FB = std::shared_ptr(std::make_shared()); + std::shared_ptr temp_ptr; + temp_ptr = std::shared_ptr(std::make_shared()); + temp_ptr->object = new_packet_ptr; + temp_ptr->left = NULL; + temp_ptr->bottom = NULL; + if (head_FB == NULL) + { + head_FB = std::shared_ptr(std::make_shared()); + head_FB->flow_id = new_packet_ptr->flow_id; + head_FB->bottom = NULL; + head_FB->left = temp_ptr; + cur_ptr_FB = head_FB; + } + else + { + cur_ptr_FB = head_FB; + prev_ptr_FB = NULL; + unsigned int flow_id_FB_found = 0; + while (cur_ptr_FB != NULL) + { + if (cur_ptr_FB->flow_id == new_packet_ptr->flow_id) + { + flow_id_FB_found = 1; + while (cur_ptr_FB->left != NULL) + { + cur_ptr_FB = cur_ptr_FB->left; + } + cur_ptr_FB->left = temp_ptr; + break; + } + prev_ptr_FB = cur_ptr_FB; + cur_ptr_FB = cur_ptr_FB->bottom; + } + if (flow_id_FB_found == 0) + { + std::shared_ptr temp_ptr2; + temp_ptr2 = std::shared_ptr(std::make_shared()); + temp_ptr2->flow_id = new_packet_ptr->flow_id; + temp_ptr2->left = temp_ptr; + temp_ptr2->bottom = NULL; + prev_ptr_FB->bottom = temp_ptr2; + } + } + + } + + void dequeue_FS(std::shared_ptr& deq_packet_ptr, unsigned int in_shaping, std::shared_ptr& head_FS, unsigned int time_now) + { + // Ensure proper synchronization before attempting to dequeue + ensure_packet_dequeue(); + + std::shared_ptr cur_ptr_FS; + cur_ptr_FS = std::shared_ptr(std::make_shared()); + std::shared_ptr prev_ptr_FS; + prev_ptr_FS = std::shared_ptr(std::make_shared()); + deq_packet_ptr = NULL; + if ((in_shaping == 1) && (head_FS != NULL)) + { + cur_ptr_FS = head_FS; + prev_ptr_FS = NULL; + // Modified: Removed the check for pkt_ptr <= number_of_read_packets + // This synchronization is now handled by the ensure_packet_dequeue() method + if (cur_ptr_FS->object->pred <= time_now) + { + deq_packet_ptr = head_FS->object; + head_FS = head_FS->next; + } + else + { + while (cur_ptr_FS != NULL) + { + // Modified: Removed the check for pkt_ptr <= number_of_read_packets + if (cur_ptr_FS->object->pred <= time_now) + { + deq_packet_ptr = cur_ptr_FS->object; + prev_ptr_FS->next = cur_ptr_FS->next; + break; + } + prev_ptr_FS = cur_ptr_FS; + cur_ptr_FS = cur_ptr_FS->next; + } + } + } + else + { + // Modified: Removed the check for pkt_ptr <= number_of_read_packets + if (head_FS != NULL) + { + deq_packet_ptr = head_FS->object; + head_FS = head_FS->next; + } + } + + // Log dequeue results for debugging + if (debug_logging) { + if (deq_packet_ptr != NULL) { + Logger::get()->info("PIFO: Successfully dequeued packet with ptr={}", + deq_packet_ptr->pkt_ptr); + } else { + Logger::get()->info("PIFO: Failed to dequeue packet, no eligible packet found"); + } + } + } + +// used by pifo function to dequeue from a certain FIFO bank + void dequeue_FB(std::shared_ptr& deq_packet_ptr, unsigned int flow_id, std::shared_ptr& head_FB) + { + std::shared_ptr cur_ptr_FB; + cur_ptr_FB = std::shared_ptr(std::make_shared()); + deq_packet_ptr = NULL; + cur_ptr_FB = head_FB; + while (cur_ptr_FB != NULL) + { + if ((cur_ptr_FB->flow_id == flow_id) && (cur_ptr_FB->left != NULL)) + { + deq_packet_ptr = cur_ptr_FB->left->object; + if (deq_packet_ptr != NULL) { + cur_ptr_FB->left = cur_ptr_FB->left->left; + } + + break; + } + cur_ptr_FB = cur_ptr_FB->bottom; + } + } + +// return the last enqueued packet pointer to be used in the buffer inside the "Simple_switch" target + unsigned int get_last_pkt_ptr() + { + if(!pkt_ptr_queue.empty()) + { + unsigned int current_pkt_ptr = pkt_ptr_queue.front(); + pkt_ptr_queue.pop(); + number_of_read_packets = number_of_read_packets + 1; + return current_pkt_ptr; + } + else + { + return 0; + } + } + +// Apply dequeue operation in the scheduler, will be used inside the "Simple_Switch" target + unsigned int dequeue_my_scheduler() + { + flow_id = 0; + pred = 0; + enq = 0; + unsigned int null_ptr = 0; + deq = 1; + + + run_core(); + + if(deq_packet_ptr != NULL) + { + number_of_dequeue_packets = number_of_dequeue_packets + 1; + + switch_is_ready = 0; + + if(pkt_ptr !=0) + pkt_ptr = 0; + return deq_packet_ptr->pkt_ptr; + } + else + { + return null_ptr; + } + } + +// return the number of enqueued packets until now to the "Simple_Switch". + unsigned int number_of_enq_pkts() + { + return number_of_enqueue_packets; + } + + + unsigned int number_of_deq_pkts() + { + return number_of_dequeue_packets; + } + +// return the number of captured packets until now by the TM_buffer.h. + unsigned int num_of_read_pkts() + { + return number_of_read_packets; + } + +// A flag from the target switch, indicating that the switch is ready to receive a new dequeued pkt from the TM + void start_dequeue(unsigned int start) + { + switch_is_ready = start; + } + +// reset the number of enqueued packets to zero by the "Simple_Switch" + void reset_number_of_enq_pkts() + { + number_of_enqueue_packets = 0; + } + + + private: + // Attribute + Data verbose{}; + + // Data members + bool verbose_{false}; +}; + +} // namespace bm +#endif diff --git a/utils/user_externs_pifo/pifo.so b/utils/user_externs_pifo/pifo.so new file mode 100755 index 00000000..df5e6e2a Binary files /dev/null and b/utils/user_externs_pifo/pifo.so differ