[NDP] Begin to add multicast / NDP support

This commit is contained in:
Nico Schottelius 2019-02-26 15:30:47 +01:00
commit 72c600d8da
5 changed files with 35 additions and 2 deletions

View file

@ -9,6 +9,7 @@ typedef bit<48> mac_addr_t;
typedef bit<32> ipv4_addr_t;
typedef bit<128> ipv6_addr_t;
typedef bit<9> port_t;
typedef bit<16> mcast_t;
const bit<16> TYPE_IPV4 = 0x0800;

View file

@ -9,5 +9,6 @@
#define THE_ANSWER_TO_LIFE_THE_UNIVERSE_AND_EVERYTHING 42 /* Important constant */
#define ROUTING_TABLE_SIZE 64 /* maximum routes per protocol */
#define ADDRESS_TABLE_SIZE 64 /* maximum number of addresses per protocol */
#define NDP_TABLE_SIZE 64 /* maximum number of multicast groups */
#endif

View file

@ -21,6 +21,26 @@ control MyIngress(inout headers hdr,
clone3(CloneType.I2E, 100, meta);
}
/********************** NDP support ***********************************/
/* map port to group */
action multicast_pkg(mcast_t mcast_grp) {
standard_metadata.mcast_grp = mcast_grp;
}
table ndp {
key = {
hdr.ipv6.dst_addr: lpm;
standard_metadata.ingress_port : exact;
}
actions = {
multicast_pkg;
NoAction;
}
size = NDP_TABLE_SIZE;
default_action = NoAction;
}
/********************** ADDRESS TABLES ***********************************/
action icmp6_answer() {