Hey folks,
Consider the following code:
filter port = x; port := y; filter port = x
The two port filters mean two different things, even though they are syntactically identical. The first is a statement about the ingress port the packet actually arrived on. The second is a statement about the egress port a packet is slated to go out on. The meaning of 'port' changed because the port field is overloaded with two responsibilities. Before any modification to the port, 'port' refers to the ingress port. It will also become the egress port if no modification is made. After the first modification and any subsequent modification to the port, 'port' refers only to the egress port and cannot any longer refer to the ingress port.
Real fields like ethDst behave this way too, but it makes sense for them because they are actually written in the packet. There is only one ethDst, and if you overwrite it, the original value is gone, which is expected; it still means ethDst. But ingress/egress ports are not written in a packet and are two distinct concepts. A packet has an ethDst, but a packet does not have a port. Neither does it make sense to say a packet is at a port. It is from one port and it is aimed toward another port.
Practical considerations: I can easily get lost in a long policy and not be able to tell whether the port has already been modified or not, so I don't know whether 'port' means 'ingress' or 'egress'. Or if I'm trying to compose sub-policies in a modular way, the meaning of one sub-policy changes depending on how/if the others are handling the port. The ingress port is a fact about a packet's history that continues to be useful, regardless of what the egress port is, and I often would like to refer to it unequivocally.
I suggest that assigning an egress port should not destroy information about the ingress port, and we should not equivocate on a packet's 'port'. Have others encountered this desire as well?
Hey folks,
Consider the following code:
filter port = x; port := y; filter port = xThe two port filters mean two different things, even though they are syntactically identical. The first is a statement about the ingress port the packet actually arrived on. The second is a statement about the egress port a packet is slated to go out on. The meaning of 'port' changed because the port field is overloaded with two responsibilities. Before any modification to the port, 'port' refers to the ingress port. It will also become the egress port if no modification is made. After the first modification and any subsequent modification to the port, 'port' refers only to the egress port and cannot any longer refer to the ingress port.
Real fields like ethDst behave this way too, but it makes sense for them because they are actually written in the packet. There is only one ethDst, and if you overwrite it, the original value is gone, which is expected; it still means ethDst. But ingress/egress ports are not written in a packet and are two distinct concepts. A packet has an ethDst, but a packet does not have a port. Neither does it make sense to say a packet is at a port. It is from one port and it is aimed toward another port.
Practical considerations: I can easily get lost in a long policy and not be able to tell whether the port has already been modified or not, so I don't know whether 'port' means 'ingress' or 'egress'. Or if I'm trying to compose sub-policies in a modular way, the meaning of one sub-policy changes depending on how/if the others are handling the port. The ingress port is a fact about a packet's history that continues to be useful, regardless of what the egress port is, and I often would like to refer to it unequivocally.
I suggest that assigning an egress port should not destroy information about the ingress port, and we should not equivocate on a packet's 'port'. Have others encountered this desire as well?