1. In the `mycontroller.py` file, write your ingress transit rules inside the `writeTunnelRules` function. It should be similar to the egress transit rules already implemented on the file.
2. In the `basic.p4` file, add a new constant to your code called `MAX_TUNNEL_ID`, and it's value must be `1 << 16`.
3. On ingress, add two counters (`ingressTunnelCounter`, `egressTunnelCounter`). They must receive two parameters, first the previously created constant, second `CounterType.packets_and_bytes`). Refer to the cheat sheet for more information on the syntax.
4. On ingress, implement an action called `myTunnel_ingress`, the action must receive a 16bit parameter called `dst_id`. The action must do the following:
2. In the `basic.p4` file, add a new 32-bit constant to your code called `MAX_TUNNEL_ID`, and it's value must be `1 << 16`.
3. On ingress, add two counters (`ingressTunnelCounter`, `egressTunnelCounter`). They must receive two parameters, first the previously created constant, second `CounterType.packets_and_bytes`. Refer to the cheat sheet for more information on the syntax.
4. On ingress, implement an action called `myTunnel_ingress`, the action must receive a 16-bit parameter called `dst_id`. The action must do the following:
1. Set the valid bit on the `myTunnel` packet header.
2. Set the `dst_id`,`proto_id`and `etherType`of the tunnel header.
2. Set the `dst_id` and`proto_id` of the tunnel header.
3. Increment the `ingressTunnelCounter` of the `dst_id` tunnel header index. Cast the index type to `bit<32>`.
5. On ingress, implement an action called `myTunnel_egress`, the action must receive two parameters in the following order: first a parameter called `dstAddr` with our mac address type defined on the code, second a parameter called `port` with our egress type also defined on the code. The action must do the following:
5. On ingress, implement an action called `myTunnel_egress`, the action must receive two parameters in the following order: first a parameter called `dstAddr` with our MAC address type defined on the code, second a parameter called `port` with our egress type also defined on the code. The action must do the following:
1. Set the value of `egress_spec` attribute of the `standard_metadata` to `port`.
2. Set the `dstAddr` and `etherType` of the ethernet header to `dstAddr` and the tunnel's `proto_id`, respectively.
3. Set the invalid bit on the `myTunnel` packet header.