repo_name
stringlengths
8
95
desc
stringclasses
61 values
repo_path
stringlengths
26
113
p4_version
stringclasses
2 values
p4_file_path
stringlengths
41
148
readme_path
stringlengths
39
123
⌀
license
stringclasses
6 values
inferred_from
stringclasses
3 values
raw_p4
stringlengths
293
67.3k
raw_readme
stringlengths
0
29.4k
cleaned_p4
stringlengths
729
166k
compiles
bool
1 class
annotation
stringlengths
26
159
detailed_annotation
listlengths
0
7
abhikjain360/sdn-project
null
raw-repositories/abhikjain360__sdn-project
p4_16
raw-repositories/abhikjain360__sdn-project/swtichtree.p4
raw-repositories/abhikjain360__sdn-project/README.md
mit
LICENSE_FILE
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; const bit<48> ACTIVE_FLOW_THRESHOLD = 5000000; // in microseconds const bit<48> FLOW_THRESHOLD = 120000000; // in microseconds const bit<48> MALICIOUS_TIMEOUT = 600000000; // in microseconds const bit<2> MALWARE_FL...
# Flow-Based IDS on P4 Switch ## Dependencies The code has only been tested to run on Linux. Following needs to be installed in order to run the model: - [`behaviour-model (bmv2)`](https://github.com/p4lang/behavioral-model). Refer to repository's README for installation instructions. - [`p4c compiler`](https://git...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; const bit<48> ACTIVE_FLOW_THRESHOLD = 5000000; // in microseconds const bit<48> FLOW_THRESHOLD = 120000000; // in microseconds const bit<48> MALICIOUS_TIMEOUT = 600000000; // in microseconds const bit<2> MALWARE...
true
Classify TCP flows as malicious or benign using a decision tree model and update flow statistics.
[ "Uses a bloom filter-like data structure with registers to store flow statistics.", "Implements a decision tree model with multiple levels and nodes to classify flows.", "Updates flow statistics, including flag counts, packet lengths, and timestamps.", "Checks if a flow is already classified as malicious and ...
abdulovia/2024_2025-network_programming-k3321-abdulov_i_a
null
raw-repositories/abdulovia__2024_2025-network_programming-k3321-abdulov_i_a
p4_16
raw-repositories/abdulovia__2024_2025-network_programming-k3321-abdulov_i_a/lab4/basic.p4
raw-repositories/abdulovia__2024_2025-network_programming-k3321-abdulov_i_a/README.md
apache-2.0
P4_FILE
// SPDX-License-Identifier: Apache-2.0 /* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; /************************************************************************* *********************** H E A D E R S *********************************** ***********************************...
# Сетевое программирование Описание репозитория, интересные замечания по деятельности и т.д. ...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; 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; ...
true
Forwards IPv4 packets based on destination IP address, decrementing TTL and updating Ethernet headers.
[ "Parses Ethernet and IPv4 headers, transitioning based on EtherType.", "Uses a LPM (Longest Prefix Match) table to determine forwarding actions for IPv4 packets.", "Forwards IPv4 packets by updating Ethernet source and destination addresses, egress port, and decrementing IPv4 TTL.", "Recomputes IPv4 header ch...
agh-cs-imbeciles/p4-load-balancing
null
raw-repositories/agh-cs-imbeciles__p4-load-balancing
p4_16
raw-repositories/agh-cs-imbeciles__p4-load-balancing/link_monitor/link_monitor.p4
raw-repositories/agh-cs-imbeciles__p4-load-balancing/link_monitor/README.md
apache-2.0
P4_FILE
// SPDX-License-Identifier: Apache-2.0 /* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_PROBE = 0x812; #define MAX_HOPS 10 #define MAX_PORTS 8 /************************************************************************* *********************** H E A D E ...
[comment]: # (SPDX-License-Identifier: Apache-2.0) # Implementing Link Monitoring ## Introduction The objective of this exercise is to write a P4 program that enables a host to monitor the utilization of all links in the network. This exercise builds upon the basic IPv4 forwarding exercise so be sure to complete t...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_PROBE = 0x812; #define MAX_HOPS 10 #define MAX_PORTS 8 typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<48> time_t; header ethernet_t { macAddr_t dstAddr; macAddr_...
true
Implements a network telemetry system using probe packets to track packet forwarding and collect statistics at each hop.
[ "Parses custom probe packet headers and extracts forwarding information.", "Performs IPv4 forwarding using a LPM table.", "Increments probe hop count and updates egress spec for probe packets.", "Collects byte count and timestamp statistics at each hop using registers.", "Updates probe packet headers with s...
andre-romano/p4_laboratorio
null
raw-repositories/andre-romano__p4_laboratorio
p4_16
raw-repositories/andre-romano__p4_laboratorio/p4_laboratorio.p4
raw-repositories/andre-romano__p4_laboratorio/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ typedef bit<9> egressSpec_t; ty...
# P4 Laboratorio Conjunto de scripts para construção de ambiente de emulação para a linguagem de programação de plano de dados P4, como parte de um ambiente de experimentação prático (laboratório) da disciplina de Redes de Computadores para o curso de Gradução em Ciência da Computação da UFBA (Universidade Federal da ...
#include <core.p4> #include <v1model.p4> typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } struct metadata { /* empty */ } // headers do pacote struct headers { ethernet_t ethernet; } parser MyParser(pac...
true
Ethernet switch that forwards or broadcasts packets based on destination MAC address
[ "Parses Ethernet headers from incoming packets", "Uses a match-action table to determine whether to forward, broadcast, or drop packets based on the destination MAC address", "Updates source and destination MAC addresses when forwarding packets", "Sets the egress port or multicast group accordingly", "Emits...
alighanbari2002/ECMP-and-HHD-P4-Exercises
P4 exercises on Equal-Cost Multi-Path Routing and Heavy Hitter Detection, inspired by ETH p4-learning repository.
raw-repositories/alighanbari2002__ECMP-and-HHD-P4-Exercises
p4_16
raw-repositories/alighanbari2002__ECMP-and-HHD-P4-Exercises/HHD/heavy_hitter.p4
raw-repositories/alighanbari2002__ECMP-and-HHD-P4-Exercises/HHD/README.md
mit
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /* CONSTANTS */ const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; #define BLOOM_FILTER_ENTRIES 4096 #define BLOOM_FILTER_BIT_WIDTH 32 #define PACKET_THRESHOLD 1000 /************************************************************************* *****...
# Heavy Hitter Detection <p align="center"> <img src="https://github.com/nsg-ethz/p4-learning/blob/master/exercises/06-Heavy_Hitter_Detector/images/heavy_hitter_topo.png" title="Small Topology"/> <p/> In this exercise we will play with probabilistic data structures. First we will implement very simple heavy hitter ...
#include <core.p4> #include <v1model.p4> /* CONSTANTS */ const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; #define BLOOM_FILTER_ENTRIES 4096 #define BLOOM_FILTER_BIT_WIDTH 32 #define PACKET_THRESHOLD 1000 typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; header ether...
true
Implements a network function that tracks TCP connections using a Bloom filter and drops packets when a threshold is exceeded.
[ "Uses a Bloom filter implemented with a register to track TCP connections, hashing source and destination IP addresses, ports, and protocol.", "Updates the Bloom filter counters based on the hashed values and checks if the counters exceed a predefined threshold.", "Drops packets when the threshold is exceeded, ...
alighanbari2002/ECMP-and-HHD-P4-Exercises
P4 exercises on Equal-Cost Multi-Path Routing and Heavy Hitter Detection, inspired by ETH p4-learning repository.
raw-repositories/alighanbari2002__ECMP-and-HHD-P4-Exercises
p4_16
raw-repositories/alighanbari2002__ECMP-and-HHD-P4-Exercises/ECMP/p4src/ecmp.p4
raw-repositories/alighanbari2002__ECMP-and-HHD-P4-Exercises/ECMP/README.md
mit
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> //My includes #include "include/headers.p4" #include "include/parsers.p4" /************************************************************************* ************ C H E C K S U M V E R I F I C A T I O N ************* **********************************...
# Equal-Cost Multi-Path Routing In this exercise we will implement a layer 3 forwarding switch that is able to load balance traffic towards a destination across equal cost paths. To load balance traffic across multiple ports we will implement ECMP (Equal-Cost Multi-Path) routing. When a packet with multiple candidate ...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; 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; ...
true
Implements IPv4 routing with ECMP (Equal-Cost Multi-Path) routing
[ "Performs LPM (Longest Prefix Match) lookup on IPv4 destination address to determine next hop", "Supports ECMP routing by hashing packet headers to select a next hop within an ECMP group", "Updates IPv4 header checksum after decrementing TTL", "Modifies Ethernet header by swapping source and destination MAC a...
Akira1906/CuckooGuard-SYN-Flood-Defense-P4
Memory-efficient SYN flood defense architecture for SmartNICs using P4 and eBPF. Implements a split-proxy with Cuckoo filters for high-speed, low-overhead DDoS mitigation.
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4
p4_16
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/demo-split-proxy/implementation/p4src/split-proxy-old.p4
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/README.md
gpl
P4_FILE
/* SmartCookie: Blocking Large-Scale SYN Floods with a Split-Proxy Defense on Programmable Data Planes Copyright (C) 2023 Sophia Yoo, Xiaoqi Chen, Princeton University sy6 [at] princeton.edu This program is free software: you can redistribute it and/or modify it under the terms of the GNU ...
# CuckooGuard: High-Precision SYN Flood Defense for SmartNICs CuckooGuard is a memory-efficient SYN flood defense architecture developed for SmartNICs, implemented in [P4](https://github.com/p4lang) and eBPF. It offloads TCP connection validation into the data plane and uses a split-proxy design, enabling high-speed f...
#include <core.p4> #include <v1model.p4> // Testbed parameters const bit<9> SERVER_PORT=12; const bit<32> SERVER_IP=0x0c000003; // 12.0.0.3 typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typedef bit<16> ether_type_t; const ether_type_t ETHERTYPE_IPV4 = 16w0x0800; const ether_type_t ETHERTYPE_SIPH_INTM = ...
true
Implement SYN cookie mechanism using SipHash to verify TCP connections
[ "Uses SipHash algorithm to generate and verify cookies for TCP SYN and ACK packets", "Implements Bloom filter to track valid flows", "Calculates time delta between client and server using UDP packets", "Updates IPv4 and TCP checksums for modified packets", "Routes packets based on various conditions, includ...
Akira1906/CuckooGuard-SYN-Flood-Defense-P4
Memory-efficient SYN flood defense architecture for SmartNICs using P4 and eBPF. Implements a split-proxy with Cuckoo filters for high-speed, low-overhead DDoS mitigation.
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4
p4_16
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/demo-split-proxy/implementation/p4src/split-proxy-part1.p4
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE #define FILTER_SIZE 32w4096 #endif #ifndef FILTER_SIZE_MINUS_ONE #define FILTER_SIZE_MINUS_ONE 4095 #endif #define STAGE_SIZE_MINUS_ONE FILTER_SIZE_MINUS_ONE #define BLOOM_STAGE_SIZE FILTER_SIZE typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typ...
# CuckooGuard: High-Precision SYN Flood Defense for SmartNICs CuckooGuard is a memory-efficient SYN flood defense architecture developed for SmartNICs, implemented in [P4](https://github.com/p4lang) and eBPF. It offloads TCP connection validation into the data plane and uses a split-proxy design, enabling high-speed f...
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE #define FILTER_SIZE 32w4096 #endif #ifndef FILTER_SIZE_MINUS_ONE #define FILTER_SIZE_MINUS_ONE 4095 #endif #define STAGE_SIZE_MINUS_ONE FILTER_SIZE_MINUS_ONE #define BLOOM_STAGE_SIZE FILTER_SIZE typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typ...
true
Implements a network proxy that verifies and transforms TCP packets using Bloom filters and cookie-based validation.
[ "Utilizes Bloom filters to track TCP flows and validate packet authenticity.", "Computes and verifies cookies based on packet headers and timestamps.", "Modifies TCP packet headers, including sequence numbers and flags, for proxy functionality.", "Updates IPv4 and TCP checksums accordingly.", "Handles speci...
Akira1906/CuckooGuard-SYN-Flood-Defense-P4
Memory-efficient SYN flood defense architecture for SmartNICs using P4 and eBPF. Implements a split-proxy with Cuckoo filters for high-speed, low-overhead DDoS mitigation.
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4
p4_16
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/demo-split-proxy/implementation/p4src/split-proxy-part2.p4
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE #define FILTER_SIZE 32w4096 #endif #ifndef FILTER_SIZE_MINUS_ONE #define FILTER_SIZE_MINUS_ONE 4095 #endif #define STAGE_SIZE_MINUS_ONE FILTER_SIZE_MINUS_ONE #define BLOOM_STAGE_SIZE FILTER_SIZE typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typ...
# CuckooGuard: High-Precision SYN Flood Defense for SmartNICs CuckooGuard is a memory-efficient SYN flood defense architecture developed for SmartNICs, implemented in [P4](https://github.com/p4lang) and eBPF. It offloads TCP connection validation into the data plane and uses a split-proxy design, enabling high-speed f...
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE #define FILTER_SIZE 32w4096 #endif #ifndef FILTER_SIZE_MINUS_ONE #define FILTER_SIZE_MINUS_ONE 4095 #endif #define STAGE_SIZE_MINUS_ONE FILTER_SIZE_MINUS_ONE #define BLOOM_STAGE_SIZE FILTER_SIZE typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typ...
true
Implements a network proxy that uses Bloom filters to track TCP connections and verify ACK packets.
[ "Uses two Bloom filters to track TCP connections and synchronize between them.", "Computes a cookie hash for SYN-ACK and TAG-ACK packets using CRC32.", "Verifies ACK packets by comparing the cookie hash with the timestamp.", "Modifies TCP packets by swapping IP addresses and ports, and setting flags.", "Upd...
Akira1906/CuckooGuard-SYN-Flood-Defense-P4
Memory-efficient SYN flood defense architecture for SmartNICs using P4 and eBPF. Implements a split-proxy with Cuckoo filters for high-speed, low-overhead DDoS mitigation.
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4
p4_16
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/demo-split-proxy/implementation/p4src/split-proxy-part3.p4
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE #define FILTER_SIZE 32w4096 #endif #ifndef FILTER_SIZE_MINUS_ONE #define FILTER_SIZE_MINUS_ONE 4095 #endif #define STAGE_SIZE_MINUS_ONE FILTER_SIZE_MINUS_ONE #define BLOOM_STAGE_SIZE FILTER_SIZE typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typ...
# CuckooGuard: High-Precision SYN Flood Defense for SmartNICs CuckooGuard is a memory-efficient SYN flood defense architecture developed for SmartNICs, implemented in [P4](https://github.com/p4lang) and eBPF. It offloads TCP connection validation into the data plane and uses a split-proxy design, enabling high-speed f...
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE #define FILTER_SIZE 32w4096 #endif #ifndef FILTER_SIZE_MINUS_ONE #define FILTER_SIZE_MINUS_ONE 4095 #endif #define STAGE_SIZE_MINUS_ONE FILTER_SIZE_MINUS_ONE #define BLOOM_STAGE_SIZE FILTER_SIZE typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typ...
true
Implements a network proxy that uses Bloom filters to track TCP connections and validates TCP packets using a cookie-based verification mechanism.
[ "Uses Bloom filters to track TCP connections and detect duplicate or invalid packets.", "Implements a cookie-based verification mechanism for TCP packets, using a hash of packet fields and a timestamp.", "Calculates and verifies the time delta between the server and proxy application using UDP packets with a sp...
Akira1906/CuckooGuard-SYN-Flood-Defense-P4
Memory-efficient SYN flood defense architecture for SmartNICs using P4 and eBPF. Implements a split-proxy with Cuckoo filters for high-speed, low-overhead DDoS mitigation.
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4
p4_16
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/demo-split-proxy/implementation/p4src/split-proxy-varbloom.p4
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE #define FILTER_SIZE 32w4096 #endif #ifndef FILTER_SIZE_MINUS_ONE #define FILTER_SIZE_MINUS_ONE 4095 #endif #ifndef N_BUCKETS #define N_BUCKETS 3 #endif #define N_HASH_FUNCTIONS N_BUCKETS #define STAGE_SIZE_MINUS_ONE FILTER_SIZE_MINUS_ONE #define BLOOM_STA...
# CuckooGuard: High-Precision SYN Flood Defense for SmartNICs CuckooGuard is a memory-efficient SYN flood defense architecture developed for SmartNICs, implemented in [P4](https://github.com/p4lang) and eBPF. It offloads TCP connection validation into the data plane and uses a split-proxy design, enabling high-speed f...
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE #define FILTER_SIZE 32w4096 #endif #ifndef FILTER_SIZE_MINUS_ONE #define FILTER_SIZE_MINUS_ONE 4095 #endif #ifndef N_BUCKETS #define N_BUCKETS 3 #endif #define N_HASH_FUNCTIONS N_BUCKETS #define STAGE_SIZE_MINUS_ONE FILTER_SIZE_MINUS_ONE #define BLOOM_STA...
true
Implement a Bloom filter-based packet processing system to filter and modify TCP packets between a server and clients.
[ "Utilizes Bloom filters to track and verify the legitimacy of TCP packets, specifically SYN-ACK and tagged ACK packets.", "Computes and verifies packet checksums for IPv4 and TCP headers.", "Modifies TCP packet headers, including swapping IP addresses and ports, and setting specific flags.", "Implements a tim...
Akira1906/CuckooGuard-SYN-Flood-Defense-P4
Memory-efficient SYN flood defense architecture for SmartNICs using P4 and eBPF. Implements a split-proxy with Cuckoo filters for high-speed, low-overhead DDoS mitigation.
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4
p4_16
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/demo-split-proxy-cuckoo/implementation/p4src/split-proxy-cuckoo.p4
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE //CUCKOO_N_FINGERPRINTS #define FILTER_SIZE 32w316 #endif #define CUCKOO_N_FINGERPRINTS FILTER_SIZE // #ifndef FILTER_SIZE_MINUS_ONE //N_FINGERPRINTS_MINUS_ONE // #define FILTER_SIZE_MINUS_ONE 315 // #endif // #define N_FINGERPRINTS_MINUS_ONE FILTER_SIZE_M...
# CuckooGuard: High-Precision SYN Flood Defense for SmartNICs CuckooGuard is a memory-efficient SYN flood defense architecture developed for SmartNICs, implemented in [P4](https://github.com/p4lang) and eBPF. It offloads TCP connection validation into the data plane and uses a split-proxy design, enabling high-speed f...
#include <core.p4> #include <v1model.p4> #ifndef FILTER_SIZE #define FILTER_SIZE 32w316 #endif #define CUCKOO_N_FINGERPRINTS FILTER_SIZE #ifndef FINGERPRINT_SIZE #define FINGERPRINT_SIZE 10 #endif const bit<6> fp_bit_index = 32 - FINGERPRINT_SIZE; #ifndef N_BUCKETS #define N_BUCKETS 79 #endif #ifndef N_BUCKETS...
true
Implements a Cuckoo filter for packet filtering and cookie-based verification for TCP packets.
[ "Parses Ethernet, IPv4, TCP, and UDP headers, and extracts relevant information.", "Uses a Cuckoo filter to store and verify packet fingerprints, with actions for insertion, deletion, and checking.", "Computes and verifies checksums for IPv4 and TCP headers.", "Performs cookie-based verification for TCP packe...
Akira1906/CuckooGuard-SYN-Flood-Defense-P4
Memory-efficient SYN flood defense architecture for SmartNICs using P4 and eBPF. Implements a split-proxy with Cuckoo filters for high-speed, low-overhead DDoS mitigation.
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4
p4_16
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/demo-syn-proxy/implementation/p4src/proxy.p4
raw-repositories/Akira1906__CuckooGuard-SYN-Flood-Defense-P4/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; const bit<8> TCP_PROTOCOL = 0x06; const bit<8> UDP_PROTOCOL = 0x11; // UDP parsing is not implemented #define BLOOM_FILTER_ENTRIES 4096 #define BLOOM_FILTER_BIT_WIDTH 1 #define TIM...
# CuckooGuard: High-Precision SYN Flood Defense for SmartNICs CuckooGuard is a memory-efficient SYN flood defense architecture developed for SmartNICs, implemented in [P4](https://github.com/p4lang) and eBPF. It offloads TCP connection validation into the data plane and uses a split-proxy design, enabling high-speed f...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; const bit<8> TCP_PROTOCOL = 0x06; const bit<8> UDP_PROTOCOL = 0x11; // UDP parsing is not implemented #define BLOOM_FILTER_ENTRIES 4096 #define BLOOM_FILTER_BIT_WIDTH 1 #define TIMER_COUNT 15 #define M...
true
Implements a TCP proxy using SYN cookies to establish connections with clients and servers.
[ "Parses Ethernet, IPv4, and TCP headers.", "Computes and verifies checksums for IPv4 and TCP headers.", "Uses a connection hash table to track established connections.", "Generates SYN cookies for new connections and validates them for incoming ACK packets.", "Modifies packet headers to proxy TCP connection...
alksarioglou/p4_network_programming
Projects related to configuring L2 switches and L3 routers using P4 language
raw-repositories/alksarioglou__p4_network_programming
p4_16
raw-repositories/alksarioglou__p4_network_programming/heavy_hitter.p4
raw-repositories/alksarioglou__p4_network_programming/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /* CONSTANTS */ const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; #define BLOOM_FILTER_ENTRIES 4096 #define BLOOM_FILTER_BIT_WIDTH 32 #define PACKET_THRESHOLD 1000 /************************************************************************* *****...
# Switch and Router Configuration using P4 Programming Language - Projects related to configuring L2 switches and L3 routers using **P4 programming language** used in networking devices today. - Used **P4-Utils, Mininet Environment, BMv2 Switch, Simple Switch CLI, Scapy** - Such projects include: **basic forwarding, fl...
#include <core.p4> #include <v1model.p4> /* CONSTANTS */ const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; #define BLOOM_FILTER_ENTRIES 4096 #define BLOOM_FILTER_BIT_WIDTH 32 #define PACKET_THRESHOLD 1000 typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; header ether...
true
Implements a simple IPv4 router with a counting Bloom filter to detect and drop potentially malicious TCP flows.
[ "Uses a counting Bloom filter implemented with a register to track packet counts for TCP flows identified by source and destination IP addresses, ports, and protocol.", "Employs two hash functions (CRC16 and CRC32) to map flow identifiers to indices in the Bloom filter.", "Drops packets when the counts for both...
alksarioglou/p4_network_programming
Projects related to configuring L2 switches and L3 routers using P4 language
raw-repositories/alksarioglou__p4_network_programming
p4_16
raw-repositories/alksarioglou__p4_network_programming/l2_basic_forwarding.p4
raw-repositories/alksarioglou__p4_network_programming/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ //TODO 1: Define ethernet header...
# Switch and Router Configuration using P4 Programming Language - Projects related to configuring L2 switches and L3 routers using **P4 programming language** used in networking devices today. - Used **P4-Utils, Mininet Environment, BMv2 Switch, Simple Switch CLI, Scapy** - Such projects include: **basic forwarding, fl...
#include <core.p4> #include <v1model.p4> typedef bit<48> macAddr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } struct metadata { /* empty */ } struct headers { ethernet_t ethernet; } parser MyParser(packet_in packet, out headers hdr, ...
true
Performs L2 forwarding based on Ethernet destination MAC address
[ "Parses Ethernet header from incoming packets", "Uses an exact-match table to forward packets based on destination MAC address", "Sets the egress port according to the forwarding table", "Drops packets if destination MAC is not found in the forwarding table", "Emits the Ethernet header when deparsing the pa...
alksarioglou/p4_network_programming
Projects related to configuring L2 switches and L3 routers using P4 language
raw-repositories/alksarioglou__p4_network_programming
p4_16
raw-repositories/alksarioglou__p4_network_programming/l2_flooding_all_ports.p4
raw-repositories/alksarioglou__p4_network_programming/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; /************************************************************************* *********************** H E A D E R S *********************************** ***********************************...
# Switch and Router Configuration using P4 Programming Language - Projects related to configuring L2 switches and L3 routers using **P4 programming language** used in networking devices today. - Used **P4-Utils, Mininet Environment, BMv2 Switch, Simple Switch CLI, Scapy** - Such projects include: **basic forwarding, fl...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; 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; } struct metadata { /* em...
true
Performs basic Ethernet forwarding with broadcast capability
[ "Parses Ethernet headers and extracts destination and source MAC addresses", "Uses an exact-match table to determine forwarding actions based on destination MAC address", "Supports three actions: forward to a specific egress port, broadcast to a multicast group, and drop the packet", "Sets broadcast as the de...
alksarioglou/p4_network_programming
Projects related to configuring L2 switches and L3 routers using P4 language
raw-repositories/alksarioglou__p4_network_programming
p4_16
raw-repositories/alksarioglou__p4_network_programming/l2_flooding_other_ports.p4
raw-repositories/alksarioglou__p4_network_programming/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; /************************************************************************* *********************** H E A D E R S *********************************** ***********************************...
# Switch and Router Configuration using P4 Programming Language - Projects related to configuring L2 switches and L3 routers using **P4 programming language** used in networking devices today. - Used **P4-Utils, Mininet Environment, BMv2 Switch, Simple Switch CLI, Scapy** - Such projects include: **basic forwarding, fl...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; 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; } struct metadata { /* em...
true
Implements a simple Ethernet switch with exact matching for forwarding and multicast flooding.
[ "Performs exact matching on the destination MAC address for forwarding decisions.", "Uses a secondary table to set multicast group IDs based on the ingress port.", "Applies multicast flooding when the destination MAC address is not found in the forwarding table.", "Supports dropping packets as a default or ex...
alksarioglou/p4_network_programming
Projects related to configuring L2 switches and L3 routers using P4 language
raw-repositories/alksarioglou__p4_network_programming
p4_16
raw-repositories/alksarioglou__p4_network_programming/l2_learning_digest.p4
raw-repositories/alksarioglou__p4_network_programming/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; /************************************************************************* *********************** H E A D E R S *********************************** ***********************************...
# Switch and Router Configuration using P4 Programming Language - Projects related to configuring L2 switches and L3 routers using **P4 programming language** used in networking devices today. - Used **P4-Utils, Mininet Environment, BMv2 Switch, Simple Switch CLI, Scapy** - Such projects include: **basic forwarding, fl...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; 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; } struct learn_t { ma...
true
Implement a learning switch that forwards packets based on MAC addresses and broadcasts unknown destinations
[]
alksarioglou/p4_network_programming
Projects related to configuring L2 switches and L3 routers using P4 language
raw-repositories/alksarioglou__p4_network_programming
p4_16
raw-repositories/alksarioglou__p4_network_programming/reflector.p4
raw-repositories/alksarioglou__p4_network_programming/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ typedef bit<48> macAddr_t; heade...
# Switch and Router Configuration using P4 Programming Language - Projects related to configuring L2 switches and L3 routers using **P4 programming language** used in networking devices today. - Used **P4-Utils, Mininet Environment, BMv2 Switch, Simple Switch CLI, Scapy** - Such projects include: **basic forwarding, fl...
#include <core.p4> #include <v1model.p4> typedef bit<48> macAddr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } struct metadata { /* empty */ } struct headers { ethernet_t ethernet; } parser MyParser(packet_in packet, out headers hdr, ...
true
Swap Ethernet MAC addresses and mirror packets to the same port.
[ "Extracts the Ethernet header in the parser.", "Swaps the source and destination MAC addresses in the ingress control.", "Sets the egress port to the same port as the ingress port, effectively mirroring the packet.", "Emits the modified Ethernet header in the deparser." ]
alksarioglou/p4_network_programming
Projects related to configuring L2 switches and L3 routers using P4 language
raw-repositories/alksarioglou__p4_network_programming
p4_16
raw-repositories/alksarioglou__p4_network_programming/repeater.p4
raw-repositories/alksarioglou__p4_network_programming/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ struct metadata { } struct head...
# Switch and Router Configuration using P4 Programming Language - Projects related to configuring L2 switches and L3 routers using **P4 programming language** used in networking devices today. - Used **P4-Utils, Mininet Environment, BMv2 Switch, Simple Switch CLI, Scapy** - Such projects include: **basic forwarding, fl...
#include <core.p4> #include <v1model.p4> struct metadata { } struct headers { } parser MyParser(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { state start{ transition accept; } } cont...
true
Simple layer 2 forwarding based on ingress port
[ "Uses an exact match table to forward packets based on the ingress port", "Forwards packets to a specific egress port based on the ingress port", "Drops packets by default if no match is found in the table", "Utilizes the `standard_metadata` structure to access ingress and egress ports", "Applies the forwar...
alksarioglou/p4_network_programming
Projects related to configuring L2 switches and L3 routers using P4 language
raw-repositories/alksarioglou__p4_network_programming
p4_16
raw-repositories/alksarioglou__p4_network_programming/repeater_with_table.p4
raw-repositories/alksarioglou__p4_network_programming/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ struct metadata { } struct head...
# Switch and Router Configuration using P4 Programming Language - Projects related to configuring L2 switches and L3 routers using **P4 programming language** used in networking devices today. - Used **P4-Utils, Mininet Environment, BMv2 Switch, Simple Switch CLI, Scapy** - Such projects include: **basic forwarding, fl...
#include <core.p4> #include <v1model.p4> struct metadata { } struct headers { } parser MyParser(packet_in packet, out headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { state start{ transition accept; } } cont...
true
Empty P4 program with basic structure and no packet processing logic
[ "The program uses the V1Switch architecture with the standard P4_16 core and v1model includes.", "It defines empty headers and metadata structs.", "The parser immediately accepts packets without parsing any headers.", "The ingress, egress, and checksum verification/computation controls are defined but do not ...
Anton2813/2024_2025-network_programming-k34202-subbota-a-d
null
raw-repositories/Anton2813__2024_2025-network_programming-k34202-subbota-a-d
p4_16
raw-repositories/Anton2813__2024_2025-network_programming-k34202-subbota-a-d/lab4/p4/1.p4
raw-repositories/Anton2813__2024_2025-network_programming-k34202-subbota-a-d/README.md
mit
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/...
Лабораторные работы по сетевому программированию. 4 курс. ИКТ
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; 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; b...
true
Performs IPv4 forwarding based on the destination IP address, decrementing TTL and updating the Ethernet header.
[ "Parses Ethernet and IPv4 headers based on the EtherType field.", "Uses a LPM (Longest Prefix Match) table to determine the forwarding action for IPv4 packets.", "Updates the Ethernet header by swapping the source and destination MAC addresses and decrementing the IPv4 TTL.", "Recomputes the IPv4 header check...
AntLab-Repo/sketchPro
null
raw-repositories/AntLab-Repo__sketchPro
p4_16
raw-repositories/AntLab-Repo__sketchPro/sketchPro.p4
raw-repositories/AntLab-Repo__sketchPro/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #include "includes/headers.p4" #include "includes/parsers.p4" #define SketchColumn 400 #define ArrayColumn 200 #define BUCKET_WIDTH 64 #define arrayBucket_width 54 #define Init_Sketch_Register(num) register<bit<BUCKET_WIDTH>>(SketchColumn) register_stage##num #defi...
# _sketchPro_: Identifying top-k items based on probabilistic update ## Overview _sketchPro_ is a novel sketch-based solution with a probabilistic update scheme, which can identify top-k items precisely with low memory consumption. sketchPro is a sketch-based method that does not insert the items into sketch (i.e., C...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<8> PROTO_TCP = 6; const bit<8> PROTO_UDP = 17; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ipv4Addr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } hea...
true
Implements a heavy hitter detection algorithm using a Count-Min Sketch data structure.
[ "Uses a Count-Min Sketch with multiple hash functions to estimate packet frequencies.", "Employs a chief array and multiple auxiliary arrays to track heavy hitters.", "Updates the sketch and array registers based on packet headers (IPv4, TCP, or UDP).", "Applies a table-based decision to replace existing entr...
antoninbas/p4-dpdk
Scratch space for P4 DPDK collaboration
raw-repositories/antoninbas__p4-dpdk
p4_16
raw-repositories/antoninbas__p4-dpdk/p4/l2.p4
raw-repositories/antoninbas__p4-dpdk/README.md
apache-2.0
P4_FILE
/* Copyright 2018-present Barefoot Networks, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
# p4-dpdk Scratch space for P4 DPDK collaboration
#include <core.p4> #include <v1model.p4> typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } struct metadata { /* empty */ } struct headers { ethernet_t ethernet; } parser MyParser(packet_in packet, ...
true
Performs Ethernet forwarding based on destination MAC address
[ "Parses Ethernet headers from incoming packets", "Uses an exact-match table to determine the egress port based on the destination MAC address", "Drops packets with unknown destination MAC addresses", "Sets the egress port for packets with known destination MAC addresses" ]
antoninbas/p4-dpdk
Scratch space for P4 DPDK collaboration
raw-repositories/antoninbas__p4-dpdk
p4_16
raw-repositories/antoninbas__p4-dpdk/p4/l3.p4
raw-repositories/antoninbas__p4-dpdk/README.md
apache-2.0
P4_FILE
/* Copyright 2018-present Barefoot Networks, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
# p4-dpdk Scratch space for P4 DPDK collaboration
#include <core.p4> #include <v1model.p4> typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } typedef bit<32> ipv4Addr_t; header ipv4_t { bit<4> version; bit<4> ihl; bit<8> diffserv; bit<16> totalLen; ...
true
Performs IPv4 routing using exact and LPM tables, decrementing TTL and updating checksum.
[ "Parses Ethernet and IPv4 headers, rejecting non-IPv4 packets.", "Uses two tables (l3_host and l3_lpm) for IPv4 routing with exact and LPM matching.", "Decrements IPv4 TTL and updates Ethernet addresses based on routing table results.", "Recomputes IPv4 header checksum after modifying TTL.", "Drops packets ...
ArielWu0203/P4_cuckoo
null
raw-repositories/ArielWu0203__P4_cuckoo
p4_16
raw-repositories/ArielWu0203__P4_cuckoo/cuckoo_implement/l2_learning_digest.p4
null
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; const bit<6> TCP_SYN = 0x02; const bit<6> TCP_SYNACK = 0x12; const bit<6> TCP_ACK = 0x10; const bit<6> TCP_RST = 0x04; #define REGISTER_LENGTH 301 #define CUCKOO_ROW_LENGTH 75 #define...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; const bit<6> TCP_SYN = 0x02; const bit<6> TCP_SYNACK = 0x12; const bit<6> TCP_ACK = 0x10; const bit<6> TCP_RST = 0x04; #define REGISTER_LENGTH 301 #define CUCKOO_ROW_LENGTH 75 #define T 5 typedef bit<...
true
Implements a network intrusion detection system that monitors and responds to TCP SYN and ACK packets
[ "Uses a Cuckoo hash table to track and count TCP connections", "Modifies TCP SYN packets to SYN-ACK and updates the Cuckoo hash table", "Responds to TCP ACK packets with RST if certain conditions are met", "Maintains white and black lists to filter IP addresses", "Computes and updates IP and TCP checksums" ...
ArielWu0203/P4_cuckoo
null
raw-repositories/ArielWu0203__P4_cuckoo
p4_16
raw-repositories/ArielWu0203__P4_cuckoo/l2_learning/l2_learning_digest.p4
null
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; /************************************************************************* *********************** H E A D E R S *********************************** *******************************************************...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; 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; } struct learn_t { bi...
true
Learn source MAC addresses and forward or broadcast Ethernet frames
[]
ArielWu0203/P4_cuckoo
null
raw-repositories/ArielWu0203__P4_cuckoo
p4_16
raw-repositories/ArielWu0203__P4_cuckoo/tcp_reset_implement/l2_learning_digest.p4
null
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; const bit<6> TCP_SYN = 0x02; const bit<6> TCP_SYNACK = 0x12; const bit<6> TCP_ACK = 0x10; const bit<6> TCP_RST = 0x04; /****************************************************************...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_BROADCAST = 0x1234; const bit<6> TCP_SYN = 0x02; const bit<6> TCP_SYNACK = 0x12; const bit<6> TCP_ACK = 0x10; const bit<6> TCP_RST = 0x04; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t;...
true
Implements a simple TCP stateful firewall that learns MAC addresses, filters out unwanted TCP packets, and modifies certain TCP packets.
[ "Parses Ethernet, IPv4, and TCP headers, and computes the TCP payload length.", "Learns MAC addresses by sending a digest to the controller when a new MAC address is seen.", "Maintains a whitelist of allowed IPv4 source addresses and filters out TCP packets from unknown sources.", "Modifies TCP SYN packets to...
bartoszlomiej/Mininet-P4-introduction
Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
raw-repositories/bartoszlomiej__Mininet-P4-introduction
p4_16
raw-repositories/bartoszlomiej__Mininet-P4-introduction/code/solution.p4
raw-repositories/bartoszlomiej__Mininet-P4-introduction/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_8021Q = 0x8100; /* match_kind { exact } #define PORT_4 4; #define PORT_8 8; */ //typedef bit<9> port_num_t; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<16> tpid_t; ...
# Mininet-P4-introduction Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_8021Q = 0x8100; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<16> tpid_t; header ethernet_t{ macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } header...
true
Program adds or removes VLAN tags based on packet contents and forwards packets based on MAC addresses.
[ "Parses Ethernet, VLAN, and IPv4 headers from incoming packets.", "Adds VLAN tags to IPv4 packets without VLAN tags based on source MAC address.", "Forwards packets based on source MAC address when VLAN tag is present.", "Removes VLAN tags from packets based on egress port.", "Emits Ethernet and IPv4 header...
bartoszlomiej/Mininet-P4-introduction
Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
raw-repositories/bartoszlomiej__Mininet-P4-introduction
p4_16
raw-repositories/bartoszlomiej__Mininet-P4-introduction/code/w6/my_code.p4
raw-repositories/bartoszlomiej__Mininet-P4-introduction/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; const bit<8> TYPE_UDP = 17; //const bit<8> NUM_PORTS = 64; /* match_kind { exact, ternary, lpm } #define PORT_4 4; #define PORT_8 8; */ //typedef bit<9> port_num_t; typedef bit<9> egressSpec_t; typedef...
# Mininet-P4-introduction Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; const bit<8> TYPE_UDP = 17; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<128> ip6Addr_t; typedef bit<32> packetCounter_t; typedef bit<8> port_id_t; header ethern...
true
Forwards IPv4 packets based on destination IP and filters TCP traffic using ternary matching.
[ "Parses Ethernet, IPv4, and TCP/UDP headers, with protocol-specific parsing for IPv4 and transport-layer protocols.", "Uses a ternary match table (`traffic_filter`) to filter TCP traffic based on destination IP address.", "Employs LPM (Longest Prefix Match) table (`ipv4_lpm`) for IPv4 forwarding, although it's ...
bartoszlomiej/Mininet-P4-introduction
Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
raw-repositories/bartoszlomiej__Mininet-P4-introduction
p4_16
raw-repositories/bartoszlomiej__Mininet-P4-introduction/code/w7/meters.p4
raw-repositories/bartoszlomiej__Mininet-P4-introduction/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> //#include <psa-for-bmv2.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; const bit<8> TYPE_UDP = 17; /* match_kind { exact } #define PORT_4 4; #define PORT_8 8; */ //typedef bit<9> port_num_t; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typ...
# Mininet-P4-introduction Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
#include <core.p4> #include <v1model.p4> //#include <psa-for-bmv2.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<8> TYPE_TCP = 6; const bit<8> TYPE_UDP = 17; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<128> ip6Addr_t; typedef bit<2> color_t; header ethernet_t{ ...
true
IPv4 router with LPM forwarding, packet metering, and TTL decrement
[ "Performs LPM lookup on IPv4 destination address to determine forwarding action", "Meters packets based on destination IP address and filters based on meter color", "Decrements IPv4 TTL and updates checksum", "Forwards packets to egress port based on LPM lookup result", "Drops packets based on meter color o...
bartoszlomiej/Mininet-P4-introduction
Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
raw-repositories/bartoszlomiej__Mininet-P4-introduction
p4_16
raw-repositories/bartoszlomiej__Mininet-P4-introduction/code/w7/registers.p4
raw-repositories/bartoszlomiej__Mininet-P4-introduction/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> //#include <psa-for-bmv2.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_SAVE_PKT = 0x690; const bit<16> TYPE_READ_PKT = 0x700; const bit<8> TYPE_TCP = 6; const bit<8> TYPE_UDP = 17; /* match_kind { exact } #define PORT_4 4; #define PORT_8 8; */ //typedef bit<9> ...
# Mininet-P4-introduction Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
#include <core.p4> #include <v1model.p4> //#include <psa-for-bmv2.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_SAVE_PKT = 0x690; const bit<16> TYPE_READ_PKT = 0x700; const bit<8> TYPE_TCP = 6; const bit<8> TYPE_UDP = 17; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t...
true
Implements a simple packet clipboard functionality, allowing packets to be saved and retrieved, with IPv4 forwarding and metering.
[ "Parses Ethernet, IPv4, TCP/UDP, and custom save/read packet headers.", "Uses a register to store packet data for clipboard functionality.", "Applies IPv4 forwarding based on destination IP address using LPM lookup.", "Meters packets based on destination IP address and filters based on packet color.", "Upda...
bartoszlomiej/Mininet-P4-introduction
Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
raw-repositories/bartoszlomiej__Mininet-P4-introduction
p4_16
raw-repositories/bartoszlomiej__Mininet-P4-introduction/code/w8/digest.p4
raw-repositories/bartoszlomiej__Mininet-P4-introduction/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_8021Q = 0x8100; /* match_kind { exact } #define PORT_4 4; #define PORT_8 8; */ //typedef bit<9> port_num_t; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<16> tpid_t; ...
# Mininet-P4-introduction Wykonane części projektu zostały wykonane w ramach warsztatu na zajęcia PRIN. Udostępnione repozytorium ma na celu ułatwienie zrozumienia podstaw języka P4. W raporcie znajdują się własne spostrzeżenia i opisy. Natomiast sekcja code zawiera kody źródłowe potrzebne do warsztatów z języka P4.
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_8021Q = 0x8100; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<16> tpid_t; header ethernet_t{ macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } header...
true
Learn and forward IPv4 packets based on destination IP and source MAC addresses
[ "Parses Ethernet and IPv4 headers, extracting source IP address for learning", "Uses exact matching tables to learn source MAC addresses and forward packets based on destination IP addresses", "Generates a digest for unknown source MAC addresses, containing source MAC, ingress port, and source IP address", "M...
0Shark/p4lab
null
raw-repositories/0Shark__p4lab
p4_16
raw-repositories/0Shark__p4lab/P4lab/exercises/hula/hula.p4
raw-repositories/0Shark__p4lab/P4lab/exercises/hula/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_HULA = 0x2345; #define MAX_HOPS 9 #define TOR_NUM 32 #define TOR_NUM_1 33 /************************************************************************* *********************** H E A D E R S *************...
# Implementing HULA ## Introduction The objective of this exercise is to implement a simplified version of [HULA](http://web.mit.edu/anirudh/www/hula-sosr16.pdf). In contrast to ECMP, which selects the next hop randomly, HULA load balances the flows over multiple paths to a destination ToR based on queue occupancy ...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_HULA = 0x2345; #define MAX_HOPS 9 #define TOR_NUM 32 #define TOR_NUM_1 33 typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<15> qdepth_t; typedef bit<32> digest_t; header e...
true
Implements Hula congestion control protocol, routing data packets and updating routing tables based on congestion feedback.
[ "Parses custom Hula header and source routing headers in addition to Ethernet, IPv4, and UDP headers.", "Uses registers to store and update routing information, including next hops and queue depths for best paths.", "Updates IPv4 TTL and performs checksum computation for IPv4 header.", "Implements Hula protoc...
0Shark/p4lab
null
raw-repositories/0Shark__p4lab
p4_16
raw-repositories/0Shark__p4lab/P4lab/exercises/load_balance/load_balance.p4
raw-repositories/0Shark__p4lab/P4lab/exercises/load_balance/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ header ethernet_t { bit<48> ...
# Load Balancing In this exercise, you will implement a form of load balancing based on a simple version of Equal-Cost Multipath Forwarding. The switch you will implement will use two tables to forward packets to one of two destination hosts at random. The first table will use a hash function (applied to a 5-tuple con...
#include <core.p4> #include <v1model.p4> header ethernet_t { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } header ipv4_t { bit<4> version; bit<4> ihl; bit<8> diffserv; bit<16> totalLen; bit<16> identification; bit<3> flags; bit<13> fragOffset; bit<8> ttl; ...
true
Implements ECMP routing for IPv4 packets with TCP payload
[ "Parses Ethernet, IPv4, and TCP headers", "Uses a two-level table-based approach for ECMP routing: `ecmp_group` for selecting an ECMP group and `ecmp_nhop` for choosing a next hop within that group", "Computes the ECMP select value using a CRC16 hash of the 5-tuple (source and destination IP addresses, protocol...
0Shark/p4lab
null
raw-repositories/0Shark__p4lab
p4_16
raw-repositories/0Shark__p4lab/P4lab/exercises/qos/qos.p4
raw-repositories/0Shark__p4lab/P4lab/exercises/qos/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; /* 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...
# Implementing QOS ## Introduction The objective of this tutorial is to extend basic L3 forwarding with an implementation of Quality of Service (QOS) using Differentiated Services. Diffserv is simple and scalable. It classifies and manages network traffic and provides QOS on modern IP networks. As before, we have a...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; /* 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; cons...
true
Performs IPv4 forwarding based on the destination IP address, decrementing TTL and updating the Ethernet header.
[ "Parses Ethernet and IPv4 headers, supporting IPv4 packet processing.", "Implements IPv4 forwarding using a LPM (Longest Prefix Match) table to determine the output port.", "Updates the IPv4 header's TTL field and Ethernet header's source and destination MAC addresses during forwarding.", "Computes the IPv4 h...
0Shark/p4lab
null
raw-repositories/0Shark__p4lab
p4_16
raw-repositories/0Shark__p4lab/P4lab/exercises/source_routing/source_routing.p4
raw-repositories/0Shark__p4lab/P4lab/exercises/source_routing/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_SRCROUTING = 0x1234; #define MAX_HOPS 9 /************************************************************************* *********************** H E A D E R S *********************************** **************...
# Implementing Source Routing ## Introduction The objective of this exercise is to implement source routing. With source routing, the source host guides each switch in the network to send the packet to a specific port. The host puts a stack of output ports in the packet. In this example, we just put the stack after ...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_SRCROUTING = 0x1234; #define MAX_HOPS 9 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; } hea...
true
Implements source routing with IPv4 packet processing, decrementing TTL, and forwarding based on a stack of routing entries.
[ "Parses Ethernet, source routing headers, and IPv4 headers.", "Processes source routing headers by selecting the next hop and removing the top entry from the stack.", "Updates the IPv4 TTL field by decrementing it.", "Forwards packets based on the source routing information; drops packets if no valid source r...
ana13zs/p4tutorials
null
raw-repositories/ana13zs__p4tutorials
p4_16
raw-repositories/ana13zs__p4tutorials/exercises/basic/basic.p4
raw-repositories/ana13zs__p4tutorials/exercises/basic/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/...
# Implementing Basic Forwarding ## Introduction The objective of this exercise is to write a P4 program that implements basic forwarding. To keep things simple, we will just implement forwarding for IPv4. With IPv4 forwarding, the switch must perform the following actions for every packet: (i) update the source and ...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; 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; b...
true
Performs IPv4 forwarding based on a longest prefix match table
[ "Uses a LPM table to determine the forwarding action for IPv4 packets based on the destination IP address", "Updates the IPv4 header checksum using the csum16 algorithm", "Drops packets if no matching entry is found in the LPM table", "Applies the LPM table only when the IPv4 header is valid", "The parser a...
ana13zs/p4tutorials
null
raw-repositories/ana13zs__p4tutorials
p4_16
raw-repositories/ana13zs__p4tutorials/exercises/basic_tunnel/basic_tunnel.p4
raw-repositories/ana13zs__p4tutorials/exercises/basic_tunnel/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> // NOTE: new type added here const bit<16> TYPE_MYTUNNEL = 0x1212; const bit<16> TYPE_IPV4 = 0x800; /************************************************************************* *********************** H E A D E R S *********************************** *******...
# Implementing Basic Tunneling ## Introduction In this exercise, we will add support for a basic tunneling protocol to the IP router that you completed in the previous assignment. The basic switch forwards based on the destination IP address. Your jobs is to define a new header type to encapsulate the IP packet and...
#include <core.p4> #include <v1model.p4> // NOTE: new type added here const bit<16> TYPE_MYTUNNEL = 0x1212; const bit<16> TYPE_IPV4 = 0x800; 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...
true
Forwards IPv4 packets based on destination IP address and updates IP TTL.
[ "Parses Ethernet and IPv4 headers from incoming packets.", "Applies IPv4 forwarding using a longest-prefix match (LPM) table based on the destination IP address.", "Updates the Ethernet source and destination addresses, and decrements the IP TTL during forwarding.", "Computes and updates the IPv4 header check...
ana13zs/p4tutorials
null
raw-repositories/ana13zs__p4tutorials
p4_16
raw-repositories/ana13zs__p4tutorials/exercises/ecn/ecn.p4
raw-repositories/ana13zs__p4tutorials/exercises/ecn/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<8> TCP_PROTOCOL = 0x06; const bit<16> TYPE_IPV4 = 0x800; const bit<19> ECN_THRESHOLD = 10; /************************************************************************* *********************** H E A D E R S *********************************** *****...
# Implementing ECN ## Introduction The objective of this tutorial is to extend basic L3 forwarding with an implementation of Explicit Congestion Notification (ECN). ECN allows end-to-end notification of network congestion without dropping packets. If an end-host supports ECN, it puts the value of 1 or 2 in the `ipv...
#include <core.p4> #include <v1model.p4> const bit<8> TCP_PROTOCOL = 0x06; const bit<16> TYPE_IPV4 = 0x800; const bit<19> ECN_THRESHOLD = 10; 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> etherTyp...
true
Forwards IPv4 packets based on destination IP address and updates TTL and checksum.
[ "Parses Ethernet and IPv4 headers, extracting relevant fields.", "Performs IPv4 forwarding using a longest-prefix match (LPM) table.", "Decrements IPv4 TTL and updates Ethernet source and destination addresses.", "Computes IPv4 header checksum based on relevant header fields.", "Emits Ethernet and IPv4 head...
ana13zs/p4tutorials
null
raw-repositories/ana13zs__p4tutorials
p4_16
raw-repositories/ana13zs__p4tutorials/exercises/mri/mri.p4
raw-repositories/ana13zs__p4tutorials/exercises/mri/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<8> UDP_PROTOCOL = 0x11; const bit<16> TYPE_IPV4 = 0x800; const bit<5> IPV4_OPTION_MRI = 31; #define MAX_HOPS 9 /************************************************************************* *********************** H E A D E R S *******************...
# Implementing MRI ## Introduction The objective of this tutorial is to extend basic L3 forwarding with a scaled-down version of In-Band Network Telemetry (INT), which we call Multi-Hop Route Inspection (MRI). MRI allows users to track the path and the length of queues that every packet travels through. To support ...
#include <core.p4> #include <v1model.p4> const bit<8> UDP_PROTOCOL = 0x11; const bit<16> TYPE_IPV4 = 0x800; const bit<5> IPV4_OPTION_MRI = 31; #define MAX_HOPS 9 typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<32> switchID_t; typedef bit<32> qdepth_t; header ether...
true
Implement IPv4 forwarding with MRI (Measurement, Reporting, and Instrumentation) option to track packet traversal through network switches.
[]
benedettapacilli/programmable-networking-lab-exercises
Exercises for the Programmable Networking course of the Master in "Computer Science and Engineering - Intelligent Embedded Systems" at the University of Bologna
raw-repositories/benedettapacilli__programmable-networking-lab-exercises
p4_16
raw-repositories/benedettapacilli__programmable-networking-lab-exercises/Homework4/ex5/basic.p4
raw-repositories/benedettapacilli__programmable-networking-lab-exercises/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /* The code tracks the time intervals between packets of the same flow to determine if the traffic exceeds a predefined threshold (TRESHOLD). The last_seen register maintains the last seen time or count for each flow. If the calculated difference between the...
# Programmable Networks Exercises ## Exercise 1: Network Namespace and VLAN Configuration Folder `Homework1` contains scripts to configure network namespaces, VLANs, and switches using Open vSwitch (OVS). The setup simulates two rooms, each hosting devices for two tenants. Each tenant has isolated network environment...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; typedef bit<10> PortId_t; const PortId_t NUM_PORTS = 512; #define PACKET_COUNT_WIDTH 32 #define TRESHOLD 200 #define BYTE_COUNT_WIDTH 48 #define PACKET_BYTE_COUNT_WIDTH 80 #define PACKET_COUNT_RANGE (PACKET_BYTE_COUNT_WIDTH-1):BYTE_COUNT_WID...
true
Drops IPv4 packets if the inter-packet gap for a flow is above a predefined threshold.
[ "Uses a register to track the last seen packet count for each flow, identified by hashed source and destination IP addresses.", "Computes the inter-packet gap by subtracting the last seen packet count of the opposite flow from the current flow's last seen packet count.", "Drops packets if the calculated inter-p...
benedettapacilli/programmable-networking-lab-exercises
Exercises for the Programmable Networking course of the Master in "Computer Science and Engineering - Intelligent Embedded Systems" at the University of Bologna
raw-repositories/benedettapacilli__programmable-networking-lab-exercises
p4_16
raw-repositories/benedettapacilli__programmable-networking-lab-exercises/Homework4/ex6/basic.p4
raw-repositories/benedettapacilli__programmable-networking-lab-exercises/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /* This P4 program detects asymmetric flows and resets detection if no traffic is observed for a window of time (15 seconds). The dynamic window size feature is implemented through the logic in standard_metadata.ingress_global_timestamp, and flow states are ...
# Programmable Networks Exercises ## Exercise 1: Network Namespace and VLAN Configuration Folder `Homework1` contains scripts to configure network namespaces, VLANs, and switches using Open vSwitch (OVS). The setup simulates two rooms, each hosting devices for two tenants. Each tenant has isolated network environment...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; typedef bit<10> PortId_t; const PortId_t NUM_PORTS = 512; #define PACKET_COUNT_WIDTH 32 #define TRESHOLD 200 //microseconds #define WINDOW 15000000 // 15 seconds, time window for resetting asymmetric flow detection #define BYTE_COUNT_WIDTH 4...
true
Detects asymmetric IPv4 flows and resets detection if no traffic is observed within a 15-second window.
[ "Uses hashed flow IDs to track packet counts and timestamps in registers.", "Computes the time difference between consecutive packets for a flow and resets detection if it exceeds the window.", "Employs a threshold-based mechanism to drop packets for asymmetric flows.", "Updates the IPv4 header checksum using...
ByungUkMin/p4-encryption
null
raw-repositories/ByungUkMin__p4-encryption
p4_16
raw-repositories/ByungUkMin__p4-encryption/p4-src/bridge.p4
raw-repositories/ByungUkMin__p4-encryption/README.md
gpl
P4_FILE
/***************************************************************************** * * This file is part of Purdue CS 536. * * Purdue CS 536 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, ei...
# Project: Validating and Evaluating the Paper, "Implementing AES Encryption on Programmable Switches via Scrambled Lookup" - **Start the Mininet environment**. On a new terminal, run: ```bash $ make mininet topo=linear,2,3 ``` > **INFO:** The argument `topo=linear,2,3` tells Mininet to start the virtual envi...
#include <core.p4> #include <v1model.p4> #define MCAST_ID 1 #define CPU_PORT 255 typedef bit<48> macAddr_t; /**/ /* Headers */ /**/ @controller_header("packet_in") header packet_in_header_t { bit<9> ingress_port; bit<7> _pad; } header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<1...
true
Implements a simple Ethernet bridge with multicast flooding and packet-in to controller.
[ "Uses exact matching on Ethernet destination address and ingress port to determine packet forwarding.", "Employs multicast flooding for unknown destinations.", "Prunes multicast packets from being sent back to the ingress port to prevent loops.", "Sends a copy of packets destined to the CPU port to the contro...
ByungUkMin/p4-encryption
null
raw-repositories/ByungUkMin__p4-encryption
p4_16
raw-repositories/ByungUkMin__p4-encryption/p4-src/switch-woAES.p4
raw-repositories/ByungUkMin__p4-encryption/README.md
gpl
P4_FILE
/***************************************************************************** * * This file is part of Purdue CS 536. * * Purdue CS 536 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, ei...
# Project: Validating and Evaluating the Paper, "Implementing AES Encryption on Programmable Switches via Scrambled Lookup" - **Start the Mininet environment**. On a new terminal, run: ```bash $ make mininet topo=linear,2,3 ``` > **INFO:** The argument `topo=linear,2,3` tells Mininet to start the virtual envi...
#include <core.p4> #include <v1model.p4> #define MCAST_ID 1 #define CPU_PORT 255 #define ETH_TYPE_ARP 0x0806 #define ETH_TYPE_VLAN 0x8100 typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; /**/ /* Headers */ /**/ @controller_header("packet_in") header packet_in_header_t { bit<9> ingress_port; bit<...
true
Implements a VLAN-aware Ethernet bridge that forwards packets based on destination MAC and VLAN ID, and sends ARP packets to the controller.
[ "Parses Ethernet and VLAN headers, extracting relevant information such as VLAN ID and EtherType.", "Uses a table to match on destination Ethernet address and VLAN ID to forward packets to the correct egress port.", "Floods ARP packets to all ports, and sends a copy to the controller for learning.", "Applies ...
cpt-harlock/p4-cuckoo-hash
null
raw-repositories/cpt-harlock__p4-cuckoo-hash
p4_16
raw-repositories/cpt-harlock__p4-cuckoo-hash/main.p4
raw-repositories/cpt-harlock__p4-cuckoo-hash/README.md
gpl
LICENSE_FILE
#include <v1model.p4> #include <core.p4> typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; #define CH_LENGTH 512 #define CH_LENGTH_BIT 16w512 // 106 bits per register, first 96 bits for key and others for value register<bit<106>>(CH_LENGTH) ch_first_row; register<bit<106>>(CH_LENGT...
# p4-cuckoo-hash
#include <v1model.p4> #include <core.p4> typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; #define CH_LENGTH 512 #define CH_LENGTH_BIT 16w512 // 106 bits per register, first 96 bits for key and others for value register<bit<106>>(CH_LENGTH) ch_first_row; register<bit<106>>(CH_LENGT...
true
Implements a simple count-min sketch for tracking TCP flows using two registers and CRC16 hashing.
[ "Uses CRC16 hashing to compute two indices into separate registers for storing flow keys and counts.", "Employs a count-min sketch data structure to track TCP flows, storing flow keys and associated counts in two registers.", "Updates a counter register to keep track of the number of unique flows stored.", "P...
bennyrubin/HydraCode
Repo for the hydra experiments
raw-repositories/bennyrubin__HydraCode
p4_16
raw-repositories/bennyrubin__HydraCode/exercises/basic/basic.p4
raw-repositories/bennyrubin__HydraCode/exercises/basic/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #include "hydra/color_generated.p4" const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_HYDRA = 0x5678; /************************************************************************* *********************** H E A D E R S *********************************** ***...
# Implementing Basic Forwarding ## Introduction The objective of this exercise is to write a P4 program that implements basic forwarding. To keep things simple, we will just implement forwarding for IPv4. With IPv4 forwarding, the switch must perform the following actions for every packet: (i) update the source and ...
#include <core.p4> #include <v1model.p4> #include <v1model.p4> #define ETHERTYPE_CHECKER 0x5678; header eth_type2_t { bit<16> value; } header variables_t { } header slices_preamble_t { bit<8> num_items_slices; } header slices_item_t { bit<32> value; } struct hydra_header_t { eth_type2_t eth_type; variab...
true
Implements a network switch with IPv4 forwarding and custom Hydra header processing for telemetry and packet validation.
[ "Parses custom Hydra headers with variable-length slices and validates their consistency.", "Performs IPv4 forwarding based on the destination IP address.", "Inserts and processes Hydra headers for telemetry and validation at the first and last hop.", "Updates the IPv4 header checksum.", "Drops packets with...
bennyrubin/HydraCode
Repo for the hydra experiments
raw-repositories/bennyrubin__HydraCode
p4_16
raw-repositories/bennyrubin__HydraCode/exercises/source_routing_cp/source_routing.p4
raw-repositories/bennyrubin__HydraCode/exercises/source_routing_cp/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_SRCROUTING = 0x1234; const bit<16> TYPE_HYDRA = 0x5678; #define MAX_HOPS 9 /************************************************************************* *********************** H E A D E R S **************...
# Implementing Source Routing ## Introduction The objective of this exercise is to implement source routing. With source routing, the source host guides each switch in the network to send the packet to a specific port. The host puts a stack of output ports in the packet. In this example, we just put the stack after ...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_SRCROUTING = 0x1234; const bit<16> TYPE_HYDRA = 0x5678; #define MAX_HOPS 9 typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcA...
true
Implements source routing with path validation using custom headers and metadata.
[ "Parses custom headers including source routing and Hydra headers with variable-length expected path.", "Performs source routing by popping the next hop from the srcRoutes stack and updating egress spec.", "Validates the path using Hydra headers and metadata, checking if the current switch ID matches the expect...
cslev/p4
Collection of P4 programs
raw-repositories/cslev__p4
p4_16
raw-repositories/cslev__p4/portfwd/portfwd.p4
raw-repositories/cslev__p4/portfwd/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ typedef bit<9> egressSpec_t; t...
# Simple port forwarder This simple application has only one exact match table, matching on the incoming port, and correspondingly has one action, which does nothing special just forwards the packet to the intended port. ## How to use (example) ### compile Assuming you want to compile to bmv2 software switch `$ sudo p...
#include <core.p4> #include <v1model.p4> typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } struct metadata { /* empty */ } struct headers { ethernet_t ethernet; } parser MyParser(packet_in packet, ...
true
Forwards packets based on the ingress port using an exact match table.
[ "Uses an exact match table `port_exact` to determine the egress port based on the ingress port.", "Drops packets by default if no match is found in the `port_exact` table.", "Employs a simple parser that extracts the Ethernet header from incoming packets.", "Forwards packets to the specified egress port using...
dcomp-leris/VR-AR-CG-network-telemetry
Network traffic/telemetry dataset
raw-repositories/dcomp-leris__VR-AR-CG-network-telemetry
p4_16
raw-repositories/dcomp-leris__VR-AR-CG-network-telemetry/CG setup/int.p4
raw-repositories/dcomp-leris__VR-AR-CG-network-telemetry/README.md
bsd
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x0800; const bit<8> IP_PROTO = 253; #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TYPE_EGRESS_CLONE 2 #define PKT_INSTANCE_TYPE_COALESCED 3 #define PKT_INSTANCE_TYPE_INGRESS_RE...
<div> <img src="https://github.com/dcomp-leris/VR-AR-CG-network-telemetry/assets/58492556/67a96a00-c791-46b3-afac-daf3ae212aeb" alt="Leris logo" align="left" style="width: 10%; height: 10%;" /> <img src="https://github.com/dcomp-leris/VR-AR-CG-network-telemetry/assets/58492556/b26a6be8-6b16-4542-bb3e-7eeac34644d6" ...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x0800; const bit<8> IP_PROTO = 253; #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TYPE_EGRESS_CLONE 2 #define PKT_INSTANCE_TYPE_COALESCED 3 #define PKT_INSTANCE_TYPE_INGRESS_RECIRC 4 #define MAX...
true
Implements In-Band Network Telemetry (INT) for IPv4 packets, adding switch metadata and recirculating packets for multi-hop tracing.
[ "Parses IPv4 packets with a specific protocol number (253) and extracts node count and INT headers.", "Adds INT metadata at each hop, including switch ID, port information, and timestamps.", "Recirculates packets for multi-hop tracing until a specified node count is reached.", "Modifies packet headers, includ...
DETERMINISTIC6G/det6g-blog-prog-soft-tsn-switch
A P4-based Programmable Software TSN Switch for Deterministic Networking
raw-repositories/DETERMINISTIC6G__det6g-blog-prog-soft-tsn-switch
p4_16
raw-repositories/DETERMINISTIC6G__det6g-blog-prog-soft-tsn-switch/switch.p4
raw-repositories/DETERMINISTIC6G__det6g-blog-prog-soft-tsn-switch/README.md
mit
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x0800; const bit<16> TYPE_VLAN = 0x8100; const bit<8> TYPE_UDP = 0x11; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } header ...
# Building a Programmable Software TSN Switch with P4 Time-Sensitive Networking (TSN) enhances traditional Ethernet with capabilities for reliable and predictable communication. It's widely used in systems where precise timing and low latency are critical, such as industrial automation, automotive networks, and profes...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x0800; const bit<16> TYPE_VLAN = 0x8100; const bit<8> TYPE_UDP = 0x11; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } header vlan_h { bit<3> ...
true
Implements a simple network switch with VLAN PCP adjustment based on UDP traffic classification and timestamp tracking.
[ "Parses Ethernet, VLAN, IPv4, and UDP headers.", "Performs naive routing based on ingress port.", "Dynamically adjusts VLAN PCP based on UDP destination port and timestamp differences.", "Uses a register to store the timestamp of the most recent packet belonging to traffic class 0.", "Inserts VLAN header if...
emdneto/dh-aes-p4
A P4 implementation towards Diffie-Hellman key exchange with AES encryption.
raw-repositories/emdneto__dh-aes-p4
p4_16
raw-repositories/emdneto__dh-aes-p4/p4src/no_crypto.p4
raw-repositories/emdneto__dh-aes-p4/README.md
gpl
P4_FILE
/* Copyright (C) 2021 Ramon Fontes, UFRN/Brazil Copyright (C) 2021 Emídio Neto, UFRN/Brazil Copyright (C) 2021 Fabricio Rodríguez, Unicamp/Brazil This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the ...
# Diffie-Hellman AES P4 A P4 implementation towards Diffie-Hellman key exchange with AES encryption. For the most up-to-date version, please go to https://github.com/reginalab/dh-aes-p4 # Demo [![Watch the video](https://github.com/emdneto/dh-aes-p4/blob/main/utils/demo.png)](https://www.youtube.com/watch?v=vKngdd...
// Standard headers #include <core.p4> #include <v1model.p4> // useful for DH typedef bit<256> keys_t; typedef bit<48> macAddr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } header ipv4_t { bit<4> version; bit<4> ihl; bit<8> diffserv; bit<16> ...
true
Forwards packets based on ingress port and performs a simple L2 forwarding action for packets with a specific EtherType (0x9999).
[]
epap011/P4Lang-SimpleLoadBalancer
CS436 - Software Define Networks | Assignment
raw-repositories/epap011__P4Lang-SimpleLoadBalancer
unknown
raw-repositories/epap011__P4Lang-SimpleLoadBalancer/simple_load_balancer.p4
raw-repositories/epap011__P4Lang-SimpleLoadBalancer/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /************************************************************************* *********************** CONSTANTS ************************************** *************************************************************************/ const bit<16> TYPE_IPV4 = 0x8...
### How do I get set up? ### * copy your folder files to the P4 tutorial VM * cd <your_exercise_folder> * ```make run``` * test with mininet * ```make stop``` * ```make clean``` ### Useful commands ### * Setup xterm on mininet host: xterm <host_name> # note that the SSH connection should enable X11 forwarding for th...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_ARP = 0x806; const bit<32> serviceIP = 0xa010203; const bit<48> lbMAC = 0xa0000000001; /* type definitions for ease of reference */ typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bi...
true
Implements a simple load balancer that directs client traffic to servers and rewrites packet headers accordingly.
[ "Parses Ethernet, ARP, and IPv4 packets, and extracts relevant information.", "Responds to ARP requests on behalf of the load balancer's service IP.", "Uses LPM tables to classify clients and servers, and to determine group membership.", "Rewrites packet headers for client-to-server and server-to-client traff...
ebiken/p4srv6
Proto-typing SRv6 functions with P4 lang.
raw-repositories/ebiken__p4srv6
p4_16
raw-repositories/ebiken__p4srv6/archive/p4src/switch.p4
raw-repositories/ebiken__p4srv6/README.md
apache-2.0
P4_FILE
/* * Copyright 2019 TOYOTA InfoTechnology Center Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
# p4srv6 ... proto-typing SRv6 functions with P4 lang. - [About p4srv6](#about-p4srv6) - [P4 Targets and Architectures](#p4-targets-and-architectures) - [Roadmap](#roadmap) - [List of SRv6 functions of interest and status](#list-of-srv6-functions-of-interest-and-status) - [Reference](#reference) - [Archives](#archiv...
#include <core.p4> #include <v1model.p4> #ifdef _V1_MODEL_P4_ typedef bit<9> PortId_t; #endif /* _V1_MODEL_P4_ */ #ifndef _HEADERS_ #define _HEADERS_ typedef bit<48> EthernetAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; typedef bit<16> EthernetType; const EthernetType ETH_P_IPV4 = 16w0...
true
Implements SRv6 (Segment Routing over IPv6) with mobile userplane functions for GTP-U (GPRS Tunneling Protocol User Plane) translation.
[ "Parses various protocols including Ethernet, IPv4, IPv6, TCP, UDP, GTP-U, and SRH (Segment Routing Header).", "Implements SRv6 transit and end behaviors with support for inserting and processing SRH.", "Translates GTP-U packets to SRv6 and vice versa, synthesizing IPv6 headers from GTP-U packets.", "Supports...
ElhNoah/INT
In-Band Telemetry v2.1 implementation in P4
raw-repositories/ElhNoah__INT
p4_16
raw-repositories/ElhNoah__INT/INT-MD/int_md.p4
raw-repositories/ElhNoah__INT/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #include "include/headers.p4" #include "include/parsers.p4" #include "include/checksum.p4" #include "include/sink.p4" #include "include/transit.p4" #include "include/source.p4" #include "include/forward.p4" /*************************************************...
# In-Band Telemetry implementation in P4 This repository contains the implementation of [INT-MX and INT-MD](https://p4.org/p4-spec/docs/INT_v2_1.pdf) (version 2.1) and the associated generation of [telemetry report](https://p4.org/p4-spec/docs/telemetry_report_v2_0.pdf) packets (version 2.0). The implementation was cr...
#include <core.p4> #include <v1model.p4> #define MAX_PORTS 511 #define CLONE_PKT 1 const bit<6> HW_ID = 1; const bit<16> TYPE_IPV4 = 0x0800; const bit<8> IP_PROTO_UDP = 0x11; const bit<8> IP_PROTO_TCP = 0x6; const bit<6> DSCP_INT = 0x17; const bit<6> DSCP_MASK = 0x3F; typedef bit<48> mac_t; typedef bit<32> ip_...
true
Implement INT (In-band Network Telemetry) protocol for collecting network metrics and generating telemetry reports.
[ "Parses various packet headers, including Ethernet, IPv4, UDP, TCP, and INT-specific headers.", "Adds INT headers and metadata to packets based on configuration and instruction bitmap.", "Generates telemetry reports by cloning packets and encapsulating them with new headers.", "Removes INT headers from origin...
felipejrampazzo/Projeto-IA376C
Module-LWE em P4
raw-repositories/felipejrampazzo__Projeto-IA376C
p4_16
raw-repositories/felipejrampazzo__Projeto-IA376C/calc.p4
null
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #define DIMENSION 4 register<bit<32>>(20) register_pub_matrix; register<bit<32>>(10) register_secret_vector; register<bit<32>>(10) register_noise_vector; register<bit<32>>(10) register_public_vector; register<bit<32>>(36) register_public_vector_full; regis...
#include <core.p4> #include <v1model.p4> #define DIMENSION 4 register<bit<32>>(20) register_pub_matrix; register<bit<32>>(10) register_secret_vector; register<bit<32>>(10) register_noise_vector; register<bit<32>>(10) register_public_vector; register<bit<32>>(36) register_public_vector_full; register<bit<32>>(18) reg...
true
Implement Kyber key generation, encryption, and decryption in a P4 switch
[ "Uses registers to store and manipulate matrices and vectors for key generation", "Employs hash and random functions for generating random numbers and performing modulo operations", "Performs matrix multiplication and addition for key generation", "Applies modulo operations to ensure results are within a spec...
f-555/Lemon
Network-wide DDoS Detection with Routing-Oblivious Per-flow Measurement
raw-repositories/f-555__Lemon
p4_16
raw-repositories/f-555__Lemon/lemon_bmv2/divider.p4
raw-repositories/f-555__Lemon/lemon_bmv2/README.md
mit
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #define HASH_THRESHOLD 1288490189 //threshold=0.3 for kmv hash,Replace floating with integer in the range 0 to 4294967295 (32 bits) #define BLOOM_SIZE 65536 #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TY...
# Overview This file is Bmv2 implementation of Lemon. The folder structure is as follows: ├── baselines     -- P4 sources of baselines ├── divider.p4     -- simple switch for packet sending ├── p4app.json     -- configuration file of network ├── topologies ...
#include <core.p4> #include <v1model.p4> #define HASH_THRESHOLD 1288490189 #define BLOOM_SIZE 65536 #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TYPE_EGRESS_CLONE 2 #define PKT_INSTANCE_TYPE_COALESCED 3 #define PKT_INSTANCE_TYPE_INGRESS_RECIRC 4 #define PKT_INSTANC...
true
Route IPv4 packets based on a hash of source and destination IP addresses, ports, and protocol.
[ "Parses Ethernet, VLAN, IPv4, TCP, UDP, and ICMP headers.", "Computes a CRC16 hash of the 5-tuple (source IP, destination IP, source port, destination port, protocol) for routing.", "Forwards packets to an egress port determined by the hash value, with special handling for ingress port 14.", "Updates the IPv4...
f-555/Lemon
Network-wide DDoS Detection with Routing-Oblivious Per-flow Measurement
raw-repositories/f-555__Lemon
p4_16
raw-repositories/f-555__Lemon/lemon_bmv2/measuremnet.p4
raw-repositories/f-555__Lemon/lemon_bmv2/README.md
mit
LICENSE_FILE
/*Lemon sketch for packets counting per-dstIP */ /* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TYPE_EGRESS_CLONE 2 #define PKT_INSTANCE_TYPE_COALESCED 3 #define PKT_INSTANCE_TYPE_INGRESS_RECIRC 4 #define PK...
# Overview This file is Bmv2 implementation of Lemon. The folder structure is as follows: ├── baselines     -- P4 sources of baselines ├── divider.p4     -- simple switch for packet sending ├── p4app.json     -- configuration file of network ├── topologies ...
/*Lemon sketch for packets counting per-dstIP */ #include <core.p4> #include <v1model.p4> #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TYPE_EGRESS_CLONE 2 #define PKT_INSTANCE_TYPE_COALESCED 3 #define PKT_INSTANCE_TYPE_INGRESS_RECIRC 4 #define PKT_INSTANCE_TYPE_REPL...
true
Counts packets per destination IP address using a multi-layered "Lemon" sketch data structure.
[ "Utilizes a custom hash function to map packets to different layers and slots within the Lemon sketch based on packet headers (src/dst IP, ports, protocol).", "Employs multiple registers to store the Lemon sketch layers, heavy hitter IDs, and other metadata.", "Updates the count of packets for the corresponding...
f-555/Lemon
Network-wide DDoS Detection with Routing-Oblivious Per-flow Measurement
raw-repositories/f-555__Lemon
p4_16
raw-repositories/f-555__Lemon/lemon_bmv2/baselines/couper/measurement.p4
raw-repositories/f-555__Lemon/lemon_bmv2/README.md
mit
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TYPE_EGRESS_CLONE 2 #define PKT_INSTANCE_TYPE_COALESCED 3 #define PKT_INSTANCE_TYPE_INGRESS_RECIRC 4 #define PKT_INSTANCE_TYPE_REPLICATION 5 #define PKT_INSTANC...
# Overview This file is Bmv2 implementation of Lemon. The folder structure is as follows: ├── baselines     -- P4 sources of baselines ├── divider.p4     -- simple switch for packet sending ├── p4app.json     -- configuration file of network ├── topologies ...
#include <core.p4> #include <v1model.p4> #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TYPE_EGRESS_CLONE 2 #define PKT_INSTANCE_TYPE_COALESCED 3 #define PKT_INSTANCE_TYPE_INGRESS_RECIRC 4 #define PKT_INSTANCE_TYPE_REPLICATION 5 #define PKT_INSTANCE_TYPE_RESUBMIT 6 #d...
true
Implements a network traffic monitoring system that identifies heavy hitters using bloom filters and hash-based counting.
[ "Uses bloom filters to track packets and identify potential heavy hitters.", "Employs a multi-stage hash-based counting mechanism to track heavy hitters.", "Maintains counters for packet frequency and updates them based on hash values.", "Modifies packet headers to include monitoring information for cloned pa...
diogocampos/p4-data-flow
null
raw-repositories/diogocampos__p4-data-flow
p4_16
raw-repositories/diogocampos__p4-data-flow/evaluation/noms2020/p4_16/ipv6-switch-ml-bmv2/ipv6-switch-ml-bmv2.p4
raw-repositories/diogocampos__p4-data-flow/README.md
apache-2.0
P4_FILE
/* * Copyright 2019, MNK Consulting * http://mnkcg.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
## P4 Data Flow Source code and evaluation set of p4-data-flow, a software verification tool for switch programs written using the P4 language. For further information, please refer to our paper "P4 Switch Code Data Flow Analysis: Towards Stronger Verification of Forwarding Plane Software", published in the proceeding...
#include <v1model.p4> typedef bit<48> mac_addr_t; typedef bit<128> ipv6_addr_t; typedef bit<9> port_t; const bit<16> TYPE_IPV6 = 0x86dd; const bit<9> TYPE_CPU = 9w192; const bit<8> PROTO_TCP = 6; const bit<8> PROTO_UDP = 17; const bit<8> PROTO_ICMP6 = 58; const bit<8> TCP_SEQ_LEN = 4; const bit<8> ICMP6_ECHO_REQUEST ...
true
Multicast IPv6 packet forwarding based on destination IP address
[ "Parses Ethernet and IPv6 headers, as well as ICMP6 and UDP headers if present", "Uses an exact-match table to determine multicast group and egress port based on the IPv6 destination address", "Handles multicast replication by setting the output bridge and rewriting the source MAC address", "Drops packets by ...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/arp.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header arp_t { bit<16> ptype; bit<8> plen; bit<16> oper; bit<16> htype; bit<8> hlen; } header arp_ipv4_t { bit<32> tpa; bit<48> tha; bit<32> spa; bit<48> sha; } header ethernet_t { bit<48> srcAddr; bit<16> etherType; ...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header arp_t { bit<16> ptype; bit<8> plen; bit<16> oper; bit<16> htype; bit<8> hlen; } header arp_ipv4_t { bit<32> tpa; bit<48> tha; bit<32> spa; bit<48> sha; } header ethernet_t { bit<48> srcAddr; bit<16> etherType; ...
true
Implements an IPv4 router with ARP handling and ICMP echo reply
[ "Parses Ethernet, IPv4, ARP, and ICMP headers", "Performs IPv4 routing using a LPM table", "Handles ARP requests and sends responses", "Generates ICMP echo replies", "Modifies packet headers for forwarding and response packets" ]
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/ecmp.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<8> protocol; bit<32> dstAddr; } header tcp_t { } // Assemble headers in a single struct struct my_headers_t { ethernet...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<8> protocol; bit<32> dstAddr; } header tcp_t { } // Assemble headers in a single struct struct my_headers_t { ethern...
true
Implements ECMP routing for IPv4 packets based on destination IP and next-hop IP
[ "Performs ECMP routing using ternary matching on the IPv4 destination address", "Forwards packets based on the next-hop IPv4 address", "Decrements IPv4 TTL and checks for validity before applying ECMP and forwarding", "Modifies Ethernet destination MAC address based on the next-hop IP", "Updates Ethernet so...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/flowlet-fixed.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<32> srcAddr; bit<8> protocol; bit<32> dstAddr; } header tcp_t { bit<16> srcPort; bit<16> dstPort; } // Assemble hea...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<32> srcAddr; bit<8> protocol; bit<32> dstAddr; } header tcp_t { bit<16> srcPort; bit<16> dstPort; } // Assemble h...
true
Implements ECMP routing with flowlet switching for IPv4 and TCP packets
[ "Parses Ethernet, IPv4, and TCP headers", "Uses ECMP tables to route packets based on destination IP and flowlet information", "Implements flowlet switching by tracking packet timestamps and updating flowlet IDs", "Modifies packet headers (e.g., TTL, source/destination MAC addresses) during forwarding", "Ap...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/heavy-hitter-1.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<32> srcAddr; bit<8> protocol; bit<32> dstAddr; } header tcp_t { } // Assemble headers in a single struct struct my_hea...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<32> srcAddr; bit<8> protocol; bit<32> dstAddr; } header tcp_t { } // Assemble headers in a single struct struct my_h...
true
Implements IPv4 routing with packet forwarding and simple packet filtering
[ "Parses Ethernet, IPv4, and TCP headers from incoming packets", "Performs IPv4 routing using a ternary matching table (ipv4_lpm)", "Forwards packets based on the next-hop IP address using an exact matching table (forward)", "Applies packet filtering or counting based on the source IP address using a ternary m...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/heavy-hitter-2-fixed.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<32> srcAddr; bit<8> protocol; bit<32> dstAddr; } header tcp_t { bit<16> srcPort; bit<16> dstPort; } // Assemble hea...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<32> srcAddr; bit<8> protocol; bit<32> dstAddr; } header tcp_t { bit<16> srcPort; bit<16> dstPort; } // Assemble h...
true
Identifies heavy hitters in IPv4/TCP traffic and forwards or drops packets accordingly
[ "Parses Ethernet, IPv4, and TCP headers from incoming packets", "Uses two hash functions to track packet counts for flow identification", "Applies IPv4 longest prefix matching (LPM) and exact matching for forwarding decisions", "Drops packets if both hash-based counters exceed a threshold (100)", "Modifies ...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/mc-nat-fixed.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<16> etherType; } header ipv4_t { bit<8> ttl; bit<8> protocol; bit<32> dstAddr; } header udp_t { } // Assemble headers in a single struct struct my_headers_t { ethernet_t ethernet; ipv4_t ipv4; udp_t ud...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<16> etherType; } header ipv4_t { bit<8> ttl; bit<8> protocol; bit<32> dstAddr; } header udp_t { } // Assemble headers in a single struct struct my_headers_t { ethernet_t ethernet; ipv4_t ipv4; udp_t ...
true
Performs multicast routing and NAT translation based on IPv4 destination address and egress RID.
[ "Parses Ethernet, IPv4, and UDP headers from incoming packets.", "Uses an exact-match table to set multicast group based on IPv4 destination address.", "Modifies IPv4 destination address and TTL in egress pipeline based on egress RID and original destination address.", "Applies NAT translation by modifying pa...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/ndp-router.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<16> totalLen; bit<8> protocol; bit<32> dstAddr; } header ndp_t { bit<16> flags; } // Assemble headers in a single str...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<16> totalLen; bit<8> protocol; bit<32> dstAddr; } header ndp_t { bit<16> flags; } // Assemble headers in a single s...
true
Implements a network device that routes IPv4 packets, performs NDP processing, and manages buffer priorities.
[ "Parses Ethernet, IPv4, and NDP headers from incoming packets.", "Performs IPv4 routing using a ternary match table (`ipv4_lpm`) to determine the next hop.", "Applies different actions based on NDP validity and flags, influencing packet forwarding and priority setting.", "Manages buffer priorities and perform...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/netpaxos-acceptor.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<16> etherType; } header ipv4_t { bit<8> protocol; } header paxos_t { bit<16> vproposal; bit<32> val; bit<16> proposal; bit<16> msgtype; bit<32> inst; bit<16> acpt; } header udp_t { bit<16> dstPort; ...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<16> etherType; } header ipv4_t { bit<8> protocol; } header paxos_t { bit<16> vproposal; bit<32> val; bit<16> proposal; bit<16> msgtype; bit<32> inst; bit<16> acpt; } header udp_t { bit<16> dstPort;...
true
P4 program implementing the Paxos consensus protocol, processing and forwarding packets based on message type and proposal values.
[ "Parses packets with Ethernet, IPv4, UDP, and Paxos headers, extracting relevant fields.", "Applies Paxos protocol logic based on message type, updating proposal and value registers.", "Forwards packets according to ingress port using the `fwd_tbl` table.", "Drops packets if proposal values are invalid or if ...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/resubmit.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { } // Assemble headers in a single struct struct my_headers_t { ethernet_t ethernet; } // METADATA struct mymeta_t { bit<8> f2; bit<8> f1; } struct my_metadata_t { mymeta_t mymeta; } // PARSER parser ...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { } // Assemble headers in a single struct struct my_headers_t { ethernet_t ethernet; } // METADATA struct mymeta_t { bit<8> f2; bit<8> f1; } struct my_metadata_t { mymeta_t mymeta; } // PARSER par...
true
Program performs packet processing using two exact-match tables that operate on custom metadata fields.
[ "The parser extracts an Ethernet header from the packet.", "Two tables, `t_ingress_1` and `t_ingress_2`, are applied in sequence, using exact matches on metadata fields `f1` and `f2`, respectively.", "The actions associated with these tables can modify the egress port and metadata field `f1`.", "The program u...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/simple-nat.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header cpu_header_t { bit<8> reason; bit<64> preamble; bit<8> if_index; bit<8> device; } header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<16> totalLen; bit<32> sr...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header cpu_header_t { bit<8> reason; bit<64> preamble; bit<8> if_index; bit<8> device; } header ethernet_t { bit<48> srcAddr; bit<16> etherType; bit<48> dstAddr; } header ipv4_t { bit<8> ttl; bit<16> totalLen; bit<32> s...
true
Implements a network device with IPv4 routing, NAT, and packet forwarding.
[ "Parses Ethernet, IPv4, and TCP headers from incoming packets.", "Performs NAT operations based on source and destination IP addresses and TCP ports.", "Routes packets using IPv4 longest prefix matching (LPM) and updates Ethernet and IPv4 headers accordingly.", "Forwards packets to the next hop based on the r...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/survey-p4/ts-switching-fixed.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<16> etherType; } header ipv4_t { bit<8> protocol; bit<32> dstAddr; } header rtp_t { bit<32> timestamp; } header udp_t { } // Assemble headers in a single struct struct my_headers_t { ethernet_t ethernet; ...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> // HEADERS // Define header types header ethernet_t { bit<16> etherType; } header ipv4_t { bit<8> protocol; bit<32> dstAddr; } header rtp_t { bit<32> timestamp; } header udp_t { } // Assemble headers in a single struct struct my_headers_t { ethernet_t ethernet;...
true
Route RTP packets based on IPv4 destination address and RTP timestamp
[ "Parses Ethernet, IPv4, UDP, and RTP headers from incoming packets", "Uses a ternary match table to route packets to different egress ports based on IPv4 destination address and RTP timestamp", "Modifies IPv4 destination address for certain packets", "Forwards packets to egress ports 1 or 511 based on table m...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/bf4_dups/heavy_hitter_2.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> struct custom_metadata_t { bit<32> nhop_ipv4; bit<16> hash_val1; bit<16> hash_val2; bit<16> count_val1; bit<16> count_val2; } header ethernet_t { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } header ipv4_t { bit<4> version; bi...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> struct custom_metadata_t { bit<32> nhop_ipv4; bit<16> hash_val1; bit<16> hash_val2; bit<16> count_val1; bit<16> count_val2; } header ethernet_t { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } header ipv4_t { bit<4> version; bi...
true
Identifies and drops heavy-hitter TCP flows while forwarding other IPv4 packets
[ "Uses two hash functions (CSUM16 and CRC16) to index into separate registers for counting packets in TCP flows", "Maintains packet counts for TCP flows using registers and increments counts based on hashed flow identifiers", "Drops packets from heavy-hitter flows (those with counts exceeding a threshold of 100)...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/bf4_failing/allocate.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #define V1MODEL_VERSION 20200408 #include <v1model.p4> struct ghost_t { bit<1> assign; bit<1> alloc; bit<1> deref; } header ethernet_t { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } header icmp_t { bit<16> typeCode; bit<16> hdrChecksum; } header ipv4_t...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #define V1MODEL_VERSION 20200408 #include <v1model.p4> struct ghost_t { bit<1> assign; bit<1> alloc; bit<1> deref; } header ethernet_t { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } header icmp_t { bit<16> typeCode; bit<16> hdrChecksum; } header ipv4_t...
true
Implements a pointer-based memory management system for packets based on Ethernet destination addresses
[ "Uses exact matching on Ethernet destination addresses to assign a pointer value to packets", "Employs a two-stage allocation and dereferencing process based on the assigned pointer value", "Asserts that allocation and dereferencing are correctly correlated", "Forwards packets to a default egress port if the ...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/bf4_failing/arp_no_consts_sized_ints.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> /************************************************************************* *********************** C O N S T A N T S ***************************** *************************************************************************/ /* Define the useful glo...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> /* Define the headers the program will recognize */ typedef bit<48> mac_addr_t; typedef bit<32> ipv4_addr_t; typedef bit<9> port_id_t; header ethernet_t { mac_addr_t dstAddr; mac_addr_t srcAddr; bit<16> etherType; } header ipv4_t { bit<4> ...
true
Forwards IPv4 packets, responds to ARP requests, and replies to ICMP echo requests.
[ "Parses Ethernet, ARP, IPv4, and ICMP headers, extracting relevant fields into metadata.", "Uses a `lpm` table to determine the destination MAC, source MAC, and egress port for IPv4 forwarding.", "Forwards IPv4 packets by updating Ethernet and IPv4 headers and decrementing TTL.", "Responds to ARP requests by ...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/bf4_failing/ndp_router_16.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> /* * ALLERT: all standard_metadata.egress_priority has been temporarily changed to standard_metadata.egress_spec * in order to successfully translate to P4-16 * REASON: egress_priority is not currently supported in the standard metadata */ struct meta_t { bit<16> reg...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> struct meta_t { bit<16> register_tmp; bit<16> ndpflags; } struct routing_metadata_t { bit<32> nhop_ipv4; } header ethernet_t { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } header ipv4_t { bit<4> version; bit<4> ihl; bit<8> d...
true
Implements a network device that routes IPv4 packets, prioritizes NDP packets, and tracks buffer state.
[ "Parses Ethernet, IPv4, and NDP headers from incoming packets.", "Uses a register to track buffer state for each egress port.", "Applies different priorities to NDP packets based on their flags and buffer state.", "Performs IPv4 routing using a longest-prefix match (LPM) table.", "Updates IPv4 header checks...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/bf4_failing/resubmit.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #include <v1model.p4> struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; bit<32> lf_field_list; bit<16> resubmit_flag; } struct mymeta_t { bit<8> f1; } header ethernet_t { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } struct metadata { ...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; bit<32> lf_field_list; bit<16> resubmit_flag; } struct mymeta_t { bit<8> f1; } header ethernet_t { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } struct metadata { ...
true
Forwards packets based on custom metadata and allows resubmission
[ "Uses custom metadata (`mymeta_t`) to store a single byte (`f1`) that influences packet forwarding decisions", "Employs two tables (`t_ingress_1` and `t_ingress_2`) with exact matching on `mymeta.f1` to determine whether to forward or resubmit packets", "The `_resubmit` action sets `mymeta.f1` to a specific val...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/bf4_failing/trifecta.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
#include <core.p4> #define V1MODEL_VERSION 20200408 #include <v1model.p4> struct ingress_metadata_t { } header h_t { bit<16> value; } struct metadata { ingress_metadata_t ing_metadata; } struct headers { h_t h0; h_t h1; h_t h2; h_t h3; h_t h4; } parser ParserImpl(packet_in packet, out he...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #define V1MODEL_VERSION 20200408 #include <v1model.p4> struct ingress_metadata_t { } header h_t { bit<16> value; } struct metadata { ingress_metadata_t ing_metadata; } struct headers { h_t h0; h_t h1; h_t h2; h_t h3; h_t h4; } parser ParserImpl(packet_in packet, out he...
true
Validate and compute header values based on exact matches of the initial header value.
[ "The parser extracts only the first header (`h0`) from the packet.", "The `ingress` control plane validates subsequent headers (`h1`, `h2`, `h3`) based on exact matches of `h0.value` and computes a new value for `h4` using bitwise operations on the validated headers.", "The computed `h4.value` is asserted to be...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/path/egress_spec.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #define TYPE_IPV4 16w0x800; /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ typ...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> #define TYPE_IPV4 16w0x800; 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>...
true
Performs L2 and L3 packet processing, including IPv4 TTL-based control and controller forwarding.
[ "Parses Ethernet, IPv4, and IPv6 headers based on EtherType.", "Applies L2 and L3 tables to determine packet fate, including dropping or forwarding to the controller.", "Updates IPv4 header checksum using the csum16 algorithm.", "Uses exact matching for L2 and L3 tables, with keys including source MAC, IPv4 T...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/path/ipv4_chain.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #define TYPE_IPV4 16w0x800; /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ typ...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> #define TYPE_IPV4 16w0x800; 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>...
true
Route IPv4 packets based on destination IP and layer 3 admission control
[ "Parses Ethernet and IPv4 headers, rejecting non-IPv4 packets", "Performs layer 3 admission control based on Ethernet type", "Forwards IPv4 packets using LPM lookup on destination IP and layer 3 admission status", "Computes IPv4 header checksum for valid IPv4 packets", "Drops packets based on layer 3 admiss...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/validity/exclusion.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #define TYPE_IPV4 16w0x800; /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ typ...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> #define TYPE_IPV4 16w0x800; 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>...
true
Program encapsulates IPv4 and IPv6 packets based on Ethernet type and computes IPv4 checksum.
[ "Parses Ethernet, IPv4, and IPv6 headers based on EtherType.", "Encapsulates inner IPv4 or IPv6 headers based on the Ethernet type using tables ipv4_encap and ipv6_encap.", "Computes IPv4 header checksum using HashAlgorithm.csum16.", "Asserts that inner and outer IP headers are not both valid at the same time...
cornell-netlab/capisce
Capisce: Control Interface Specifications for Dataplane Pipelines
raw-repositories/cornell-netlab__capisce
p4_16
raw-repositories/cornell-netlab__capisce/capisce/examples/validity/ipv4.p4
raw-repositories/cornell-netlab__capisce/README.md
gpl
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> #define TYPE_IPV4 16w0x800; /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ typ...
# Capisce Capisce is described in the OOPSLA paper entitled _Computing Precise Control Interface Specifications_. The Capisce library comprises two key pieces: - an OCAML library for writing down and specifying data plane programs called `GPL`. * Example programs can be seen in the `capisce/programs`. * The co...
#include <core.p4> #include <v1model.p4> #define TYPE_IPV4 16w0x800; 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>...
true
Performs IPv4 and IPv6 packet forwarding based on destination IP address and Ethernet type.
[ "Parses Ethernet, IPv4, and IPv6 headers based on Ethernet type.", "Uses a ternary matching table to determine the forwarding action for IPv4 and IPv6 packets.", "Updates the TTL/Hop Limit field and performs MAC address swapping for forwarded packets.", "Computes the IPv4 header checksum using the csum16 algo...
doraeric/p4-ja3
null
raw-repositories/doraeric__p4-ja3
p4_16
raw-repositories/doraeric__p4-ja3/p4/src/basic.p4
raw-repositories/doraeric__p4-ja3/p4/README.md
apache-2.0
P4_FILE
/* * Copyright 2017-present Open Networking Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
# P4 Program The code is extended from [onos basic pipeline](https://github.com/opennetworkinglab/onos/tree/2.7.0/pipelines/basic/src/main/resources) with [p4 tutorials](https://github.com/p4lang/tutorials/blob/master/exercises/basic/solution/basic.p4). It's generated with the commands: ```sh rsync -az --info=progre...
#include <core.p4> #include <v1model.p4> #ifndef __HEADERS__ #define __HEADERS__ #ifndef __DEFINES__ #define __DEFINES__ #define ETH_TYPE_IPV4 0x0800 #define ETH_TYPE_ARP 0x0806 #define IP_PROTO_TCP 8w6 #define IP_PROTO_UDP 8w17 #define IP_VERSION_4 4w4 #define IPV4_IHL_MIN 4w5 #define MAX_PORTS 511 #define ...
true
Process TLS Client Hello packets and generate JA3 digest for TLS fingerprinting
[ "Parses TLS Client Hello messages and extracts relevant information such as TLS version, cipher suites, and extensions", "Generates a JA3 digest based on the extracted TLS information for fingerprinting purposes", "Uses a ternary match table to classify packets based on various TLS-related fields", "Performs ...
goldthree-shit/mrc
Implementation of multiple routing configurations on software-defined networks with P4
raw-repositories/goldthree-shit__mrc
p4_16
raw-repositories/goldthree-shit__mrc/mrc.p4
null
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<8> UDP_PROTOCOL = 0x11; const bit<16> TYPE_IPV4 = 0x800; const bit<5> IPV4_OPTION_MRI = 31; const bit<8> CONFIGURATION = 2; #define MAX_HOPS 9 /************************************************************************* *********************** H...
#include <core.p4> #include <v1model.p4> const bit<8> UDP_PROTOCOL = 0x11; const bit<16> TYPE_IPV4 = 0x800; const bit<5> IPV4_OPTION_MRI = 31; const bit<8> CONFIGURATION = 2; #define MAX_HOPS 9 typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef bit<32> switchID_t; typede...
true
Implement IPv4 forwarding with custom MRI (Measurement, Reporting, and Instrumentation) option processing and tracing switch information.
[ "Parses IPv4 packets with MRI option and extracts switch trace information.", "Applies different forwarding actions based on the IPv4 diffserv field value.", "Adds switch trace information to packets with MRI option at egress processing.", "Updates IPv4 header checksum after modifying header fields.", "Modi...
greatbn/sfc-integrity
SFC Integrity with P4
raw-repositories/greatbn__sfc-integrity
p4_16
raw-repositories/greatbn__sfc-integrity/sfc.p4
null
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_SFC = 0x1212; // Define TYPE for SFC const bit<8> TYPE_TCP = 0x06; const bit<8> TYPE_UDP = 0x11; const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_NSH = 0x894F; /************************************************************************* ...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_SFC = 0x1212; // Define TYPE for SFC const bit<8> TYPE_TCP = 0x06; const bit<8> TYPE_UDP = 0x11; const bit<16> TYPE_IPV4 = 0x800; const bit<16> TYPE_NSH = 0x894F; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; typedef ...
true
Implements Service Function Chaining (SFC) with packet classification, encapsulation, and forwarding based on IPv4 and SFC headers.
[ "Parses Ethernet, IPv4, TCP/UDP, and SFC (NSH) headers, supporting multiple protocols and nested headers.", "Classifies packets into SFC using DSCP values in IPv4 headers and encapsulates them with NSH headers.", "Forwards packets based on SFC headers (SPI and SI) and performs TTL decrement and validation.", ...
GEANT-DataPlaneProgramming/int-platform-dpdk
INT implementations for dpdk using the p4 language
raw-repositories/GEANT-DataPlaneProgramming__int-platform-dpdk
p4_16
raw-repositories/GEANT-DataPlaneProgramming__int-platform-dpdk/int_t4p4s_dpdk/p4src/int_v1.0/int.p4
raw-repositories/GEANT-DataPlaneProgramming__int-platform-dpdk/int_t4p4s_dpdk/README.md
apache-2.0
P4_FILE
/* * Copyright 2020 PSNC * * Author: Mário Kuka * * Created in the GN4-3 project. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0...
P4 implementation of INT for DPDK ========= This implementation uses the [t4p4s](https://github.com/MarioKuka/t4p4s) compiler that can compile a P4 program into a DPDK application. INT P4 program -------- P4 source code is located in `./p4src/int_v1.0`. At this point, program implements very limited functionality of...
#include <core.p4> #include <v1model.p4> #ifndef _CONFIG_P4_ #define _CONFIG_P4_ #define SRC_ENABLE true #define SINK_ENABLE false #define SWITCH_ID 0 #endif #ifndef _HEADERS_P4_ #define _HEADERS_P4_ header ethernet_t { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } header ipv4_t { b...
true
Implement INT (In-band Network Telemetry) protocol for IPv4 packets, adding metadata at source, transit, and sink nodes.
[ "Parses IPv4 packets and extracts DSCP value to determine if INT headers should be added or processed.", "Adds INT shim and metadata headers at the source node based on a configurable flow table.", "At transit nodes, updates INT metadata (e.g., switch ID, port IDs, timestamps) and increments hop count.", "At ...
guimvmatos/P4_RED
Implementation of a Random Early Detection (RED) algorithm on P4
raw-repositories/guimvmatos__P4_RED
p4_16
raw-repositories/guimvmatos__P4_RED/red.p4
raw-repositories/guimvmatos__P4_RED/README.md
mit
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<8> TCP_PROTOCOL = 0x06; const bit<16> TYPE_IPV4 = 0x800; const bit<19> ECN_THRESHOLD = 10; const bit<19> Wq = 10; const bit<19> MinTh = 32; const bit<19> MaxTh = 50; #define REGISTER_LENGTH 100 /************************************************...
# Implementing ECN ## Introduction The objective of this tutorial is to extend basic L3 forwarding with an implementation of Explicit Congestion Notification (ECN). ECN allows end-to-end notification of network congestion without dropping packets. If an end-host supports ECN, it puts the value of 1 or 2 in the `ipv...
#include <core.p4> #include <v1model.p4> const bit<8> TCP_PROTOCOL = 0x06; const bit<16> TYPE_IPV4 = 0x800; const bit<19> ECN_THRESHOLD = 10; const bit<19> Wq = 10; const bit<19> MinTh = 32; const bit<19> MaxTh = 50; #define REGISTER_LENGTH 100 typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bi...
true
Implements a network switch with IPv4 forwarding and ECN-based congestion control
[ "Parses Ethernet and IPv4 headers, extracting relevant fields for processing", "Performs IPv4 forwarding using a longest-prefix match (LPM) table", "Tracks average queue depth using a register and updates it based on current queue size", "Implements ECN-based congestion control by probabilistically dropping p...
FredShi97/p4
null
raw-repositories/FredShi97__p4
p4_16
raw-repositories/FredShi97__p4/exercises/p4_upf/main.p4
raw-repositories/FredShi97__p4/README.md
apache-2.0
P4_FILE
/* * SPDX-License-Identifier: Apache-2.0 * SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> */ #include <core.p4> // Use non retro-compatible (P4_14) v1model.p4 architecture // this reduces the need for weird casting. #define V1MODEL_VERSION 20200408 #include <v1model.p4> #i...
# P4-upf test To run tests in Mini-Net nevigate to tutorials/exercises/p4_upf. Build by ''' make ''' run controller by ''' python3 mycontroller.py ''' available scripts to send/receive for uplink/downlink/termination related to billings.
#include <core.p4> #define V1MODEL_VERSION 20200408 #include <v1model.p4> #ifndef __DEFINE__ #define __DEFINE__ #define CPU_PORT 255 #define CPU_CLONE_SESSION_ID 99 // Table sizes to be tuned for hardware #define MAX_PDRS 1024 #define MAX_APP_METERS 1024 #define MAX_SESSION_METERS 1024 #define MAX_ROUTES 102...
true
Implements a 5G UPF (User Plane Function) that processes GTP-U packets, performs packet routing, and enforces QoS policies.
[ "Parses GTP-U packets and extracts relevant headers and metadata.", "Performs packet routing based on destination IP address and GTP-U tunnel endpoint ID.", "Enforces QoS policies using meters and counters to track packet flows and detect congestion.", "Supports GTP-U decapsulation and encapsulation for both ...
Hajdulord/p4-in-network-memory
null
raw-repositories/Hajdulord__p4-in-network-memory
p4_16
raw-repositories/Hajdulord__p4-in-network-memory/inmemory.p4
raw-repositories/Hajdulord__p4-in-network-memory/README.md
mit
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #define MAX_ADDR 1024 // Header struct for incoming packets header ethernetHeader { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } // the custom layer type for memory header const bit<16> MEMORY_ETYPE = 0x1234; header memoryHeader { bit<1> isWrite; /...
# P4: In-Network Memory ## Introduction The objective of this project is to implement an in-network memory management system using MININET/BMv2 environment and a Python test code as proof of concept to demonstrate that the P4 code works. ## Running the code The directory with this README also contains a Makefile, J...
#include <core.p4> #include <v1model.p4> #define MAX_ADDR 1024 // Header struct for incoming packets header ethernetHeader { bit<48> dstAddr; bit<48> srcAddr; bit<16> etherType; } // the custom layer type for memory header const bit<16> MEMORY_ETYPE = 0x1234; header memoryHeader { bit<1> isWrite;...
true
Implements a simple memory access controller, allowing read and write operations to a register array via custom-layer packets.
[]
howlbz/Softwarized-and-Virtualized-Mobile-Networks
null
raw-repositories/howlbz__Softwarized-and-Virtualized-Mobile-Networks
p4_16
raw-repositories/howlbz__Softwarized-and-Virtualized-Mobile-Networks/exercises/basic/basic.p4
raw-repositories/howlbz__Softwarized-and-Virtualized-Mobile-Networks/exercises/basic/README.md
apache-2.0
LICENSE_FILE
/* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x0800; const bit<16> TYPE_ARP = 0x0806; const bit<8> TYPE_UDP = 0x11; const bit<8> TYPE_TCP = 0x06; const bit<8> TYPE_ICMP = 0x01; /************************************************************************* *********************** H...
# Implementing Basic Forwarding ## Introduction The objective of this exercise is to write a P4 program that implements basic forwarding. To keep things simple, we will just implement forwarding for IPv4. With IPv4 forwarding, the switch must perform the following actions for every packet: (i) update the source and ...
#include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x0800; const bit<16> TYPE_ARP = 0x0806; const bit<8> TYPE_UDP = 0x11; const bit<8> TYPE_TCP = 0x06; const bit<8> TYPE_ICMP = 0x01; typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; header ethernet_t { macAddr_t...
true
Forwards IPv4 packets and responds to ARP requests
[ "Parses Ethernet, IPv4, ARP, UDP, TCP, and ICMP headers", "Performs IPv4 forwarding based on a longest-prefix match table", "Responds to ARP requests by generating ARP replies", "Updates IPv4 header checksum during forwarding", "Decrements IPv4 TTL during forwarding" ]
IETF-Hackathon/p4-ipv6-switch-ml
p4-16 IPv6 program for use by switch ml
raw-repositories/IETF-Hackathon__p4-ipv6-switch-ml
p4_16
raw-repositories/IETF-Hackathon__p4-ipv6-switch-ml/ipv6-switch-ml-bmv2.p4
raw-repositories/IETF-Hackathon__p4-ipv6-switch-ml/README.md
apache-2.0
P4_FILE
/* * Copyright 2019, MNK Consulting * http://mnkcg.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law ...
# p4-ipv6-switch-ml This paper was presented at the 2019 P4 Worship at Stanford: https://arxiv.org/pdf/1903.06701.pdf The paper implemented switch ML using IPv4 broadcast messages. I had to write a new IETF draft to extend switch ML to use IPv6: https://datatracker.ietf.org/doc/draft-hsingh-ipv6-coin-ml/ The p4-16 c...
#include <v1model.p4> typedef bit<48> mac_addr_t; typedef bit<128> ipv6_addr_t; typedef bit<9> port_t; const bit<16> TYPE_IPV6 = 0x86dd; const bit<9> TYPE_CPU = 9w192; const bit<8> PROTO_TCP = 6; const bit<8> PROTO_UDP = 17; const bit<8> PROTO_ICMP6 = 58; const bit<8> TCP_SEQ_LEN = 4; const bit<8> ICMP6_ECHO_REQUEST ...
true
Implement SwitchML algorithm for in-network aggregation of vectors
[ "Parses IPv6 packets with UDP and ICMP6 protocols and extracts a custom ML header and vector.", "Uses an `ipv6_tbl` to determine the multicast group and egress port based on the IPv6 destination address.", "Performs aggregation of the vector elements using a pool of integer aggregators, with the index specified...
hyojoonkim/IWSpring2020
null
raw-repositories/hyojoonkim__IWSpring2020
p4_16
raw-repositories/hyojoonkim__IWSpring2020/netassay_bmv2_155.p4
raw-repositories/hyojoonkim__IWSpring2020/README.md
mit
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; t...
# IWSpring2020 netassay_bmv2_60.p4 -> uses a single match action table and thus is limited to parsing domain names of up to four labels of up to 15 characters each. Thus, a max width of 60 characters is allowed for a domain netassay_bmv2_155.p4 -> uses multiple match action tables and thus can parse up to five labels...
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; ...
true
Monitor DNS responses and track traffic for known domains, updating packet and byte counts.
[ "The parser extracts DNS query labels and checks if a DNS response is present.", "The ingress control uses ternary tables to match known domain names and update corresponding counts.", "It employs three sets of registers to track DNS responses and associated IP addresses, with a timeout mechanism to remove stal...
hyojoonkim/IWSpring2020
null
raw-repositories/hyojoonkim__IWSpring2020
p4_16
raw-repositories/hyojoonkim__IWSpring2020/netassay_bmv2_60.p4
raw-repositories/hyojoonkim__IWSpring2020/README.md
mit
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; t...
# IWSpring2020 netassay_bmv2_60.p4 -> uses a single match action table and thus is limited to parsing domain names of up to four labels of up to 15 characters each. Thus, a max width of 60 characters is allowed for a domain netassay_bmv2_155.p4 -> uses multiple match action tables and thus can parse up to five labels...
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; ...
true
Monitors DNS traffic and tracks packet counts and byte counts for known domains.
[ "Parses DNS responses and matches domain names against a list of known domains using ternary matching.", "Uses multiple hash tables to track DNS queries and corresponding IP addresses with timestamps.", "Updates packet and byte counts for known domains based on subsequent IP traffic.", "Employs registers to s...
hyojoonkim/IWSpring2020
null
raw-repositories/hyojoonkim__IWSpring2020
p4_16
raw-repositories/hyojoonkim__IWSpring2020/OldVersions/calc2v2.p4
raw-repositories/hyojoonkim__IWSpring2020/README.md
mit
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; t...
# IWSpring2020 netassay_bmv2_60.p4 -> uses a single match action table and thus is limited to parsing domain names of up to four labels of up to 15 characters each. Thus, a max width of 60 characters is allowed for a domain netassay_bmv2_155.p4 -> uses multiple match action tables and thus can parse up to five labels...
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; ...
true
Monitors DNS traffic, tracks known domains, and counts packets and bytes for associated non-DNS traffic.
[ "Parses DNS packets and extracts query labels", "Uses ternary matching to identify known domains", "Maintains counters for packets and bytes associated with known domains", "Employs a timeout mechanism to manage state in three hash tables", "Updates counters for non-DNS traffic matching known domain flows" ...
hyojoonkim/IWSpring2020
null
raw-repositories/hyojoonkim__IWSpring2020
p4_16
raw-repositories/hyojoonkim__IWSpring2020/OldVersions/netassay_bmv2.p4
raw-repositories/hyojoonkim__IWSpring2020/README.md
mit
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; t...
# IWSpring2020 netassay_bmv2_60.p4 -> uses a single match action table and thus is limited to parsing domain names of up to four labels of up to 15 characters each. Thus, a max width of 60 characters is allowed for a domain netassay_bmv2_155.p4 -> uses multiple match action tables and thus can parse up to five labels...
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; ...
true
Monitor DNS traffic and track packet counts for known domains
[ "Parses DNS responses and extracts domain names", "Uses multiple register arrays to track DNS queries and packet counts", "Employs a hash-based indexing mechanism to store and retrieve flow information", "Updates packet and byte counts for known domains based on DNS responses and subsequent IP traffic" ]
hyojoonkim/IWSpring2020
null
raw-repositories/hyojoonkim__IWSpring2020
p4_16
raw-repositories/hyojoonkim__IWSpring2020/OldVersions/proto1.p4
raw-repositories/hyojoonkim__IWSpring2020/README.md
mit
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; t...
# IWSpring2020 netassay_bmv2_60.p4 -> uses a single match action table and thus is limited to parsing domain names of up to four labels of up to 15 characters each. Thus, a max width of 60 characters is allowed for a domain netassay_bmv2_155.p4 -> uses multiple match action tables and thus can parse up to five labels...
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; ...
true
Monitors network traffic and identifies known domains.
[]
hyojoonkim/IWSpring2020
null
raw-repositories/hyojoonkim__IWSpring2020
p4_16
raw-repositories/hyojoonkim__IWSpring2020/OldVersions/proto2.p4
raw-repositories/hyojoonkim__IWSpring2020/README.md
mit
LICENSE_FILE
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; t...
# IWSpring2020 netassay_bmv2_60.p4 -> uses a single match action table and thus is limited to parsing domain names of up to four labels of up to 15 characters each. Thus, a max width of 60 characters is allowed for a domain netassay_bmv2_155.p4 -> uses multiple match action tables and thus can parse up to five labels...
#include <core.p4> #include <v1model.p4> #define NUM_KNOWN_DOMAINS 1024 #define NUM_KNOWN_DOMAINS_BITS 10 #define TABLE_SIZE 1024 #define HASH_TABLE_BASE 10w0 #define HASH_TABLE_MAX 10w1023 #define TIMEOUT 600000000 // 10 minutes typedef bit<48> MacAddress; typedef bit<32> IPv4Address; typedef bit<128> IPv6Address; ...
true
Track and count DNS responses and related traffic for known domains.
[ "Parses DNS queries and responses, extracting domain names and IP addresses.", "Uses ternary matching to identify known domains in DNS queries.", "Employs multiple hash tables to track DNS responses and related traffic.", "Updates counters for packet and byte counts for traffic related to known domains.", "...
ir-masters/p4-In-network-latency-emulator
null
raw-repositories/ir-masters__p4-In-network-latency-emulator
p4_16
raw-repositories/ir-masters__p4-In-network-latency-emulator/inle.p4
raw-repositories/ir-masters__p4-In-network-latency-emulator/README.md
mit
LICENSE_FILE
/* -*- P4_16 -*- */ /* BMv2 */ #include <core.p4> #include <v1model.p4> /* Define constants for types of packets */ #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TYPE_EGRESS_CLONE 2 #define PKT_INSTANCE_TYPE_COALESCED 3 #define PKT_INSTANCE_TYPE_INGRESS_RECIRC 4 #def...
# p4-In-network-latency-emulator *for the Programmable Networks 2024 course at ELTE*\ *Benedek S. Simon, Jamil Ghazal, Kálmán Neszlényi* ## Open Questions 1. How can we ensure the precision of timestamping for accurate latency emulation? 2. What are the potential limitations of packet recirculation on real switch pe...
/* BMv2 */ #include <core.p4> #include <v1model.p4> #define PKT_INSTANCE_TYPE_NORMAL 0 #define PKT_INSTANCE_TYPE_INGRESS_CLONE 1 #define PKT_INSTANCE_TYPE_EGRESS_CLONE 2 #define PKT_INSTANCE_TYPE_COALESCED 3 #define PKT_INSTANCE_TYPE_INGRESS_RECIRC 4 #define PKT_INSTANCE_TYPE_REPLICATION 5 #define PKT_INSTANCE_TYPE_R...
true
Emulate latency by recirculating packets with custom data headers and forward IPv4 packets based on destination IP.
[]
In-Network-Machine-Learning/DINC
DINC is a framework that efficiently plans and implements P4-based service partitions on multiple network devices.
raw-repositories/In-Network-Machine-Learning__DINC
p4_16
raw-repositories/In-Network-Machine-Learning__DINC/P4/Node_0.p4
raw-repositories/In-Network-Machine-Learning__DINC/README.md
apache-2.0
LICENSE_FILE
######################################################################## # This program is a free software tool, which does ensemble in-network machine learning. # licensed under Apache-2.0 # # Copyright (c) 2020-2021 Changgang Zheng # Copyright (c) Computing Infrastructure Group, Department of Engineering Science, Uni...
# <font color=#6B8E23>D</font>istributed <font color=#6B8E23>I</font>n-<font color=#6B8E23>N</font>etwork <font color=#6B8E23>C</font>omputing (DINC) ![DINC Logo](src/images/logo.png) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![GitHub release](h...
######################################################################## # This program is a free software tool, which does ensemble in-network machine learning. # licensed under Apache-2.0 # # Copyright (c) 2020-2021 Changgang Zheng # Copyright (c) Computing Infrastructure Group, Department of Engineering Science, Uni...
true
Performs in-network machine learning ensemble by parsing custom DINC headers and making decisions based on extracted metadata.
[]
In-Network-Machine-Learning/DINC
DINC is a framework that efficiently plans and implements P4-based service partitions on multiple network devices.
raw-repositories/In-Network-Machine-Learning__DINC
p4_16
raw-repositories/In-Network-Machine-Learning__DINC/P4/Node_1.p4
raw-repositories/In-Network-Machine-Learning__DINC/README.md
apache-2.0
LICENSE_FILE
######################################################################## # This program is a free software tool, which does ensemble in-network machine learning. # licensed under Apache-2.0 # # Copyright (c) 2020-2021 Changgang Zheng # Copyright (c) Computing Infrastructure Group, Department of Engineering Science, Uni...
# <font color=#6B8E23>D</font>istributed <font color=#6B8E23>I</font>n-<font color=#6B8E23>N</font>etwork <font color=#6B8E23>C</font>omputing (DINC) ![DINC Logo](src/images/logo.png) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![GitHub release](h...
######################################################################## # This program is a free software tool, which does ensemble in-network machine learning. # licensed under Apache-2.0 # # Copyright (c) 2020-2021 Changgang Zheng # Copyright (c) Computing Infrastructure Group, Department of Engineering Science, Uni...
true
Performs in-network machine learning by parsing custom DINC headers and updating metadata based on feature lookups.
[ "Parses custom DINC headers and extracts features into metadata.", "Performs LPM (Longest Prefix Match) lookup for IPv4 forwarding.", "Conducts ternary lookups for features in `lookup_feature2` and `lookup_feature3` tables.", "Updates DINC metadata based on the results of feature lookups.", "Computes IPv4 h...
In-Network-Machine-Learning/DINC
DINC is a framework that efficiently plans and implements P4-based service partitions on multiple network devices.
raw-repositories/In-Network-Machine-Learning__DINC
p4_16
raw-repositories/In-Network-Machine-Learning__DINC/src/test/BMv2/test_environment/P4/s10.p4
raw-repositories/In-Network-Machine-Learning__DINC/README.md
apache-2.0
LICENSE_FILE
######################################################################## # This program is a free software tool, which does ensemble in-network machine learning. # licensed under Apache-2.0 # # Copyright (c) 2020-2021 Changgang Zheng # Copyright (c) Computing Infrastructure Group, Department of Engineering Science, Uni...
# <font color=#6B8E23>D</font>istributed <font color=#6B8E23>I</font>n-<font color=#6B8E23>N</font>etwork <font color=#6B8E23>C</font>omputing (DINC) ![DINC Logo](src/images/logo.png) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![GitHub release](h...
######################################################################## # This program is a free software tool, which does ensemble in-network machine learning. # licensed under Apache-2.0 # # Copyright (c) 2020-2021 Changgang Zheng # Copyright (c) Computing Infrastructure Group, Department of Engineering Science, Uni...
true
Performs IPv4 routing and decrementing TTL, with checksum verification and computation.
[ "Parses Ethernet and IPv4 headers, with selective parsing based on EtherType.", "Performs IPv4 forwarding using a longest-prefix match (LPM) table.", "Decrements the TTL field in the IPv4 header and updates the Ethernet source and destination addresses.", "Computes the IPv4 header checksum using the csum16 al...