Subject: [Idr] Use of 'not' & 'm' bits in BGP flowspec components of type [op, bitmask] (RFC 5575)

From: PVLR Pavana Murthy <[email-masked]>
Date: Thu, 15 Feb 2018 20:05:08 +0530

Hello,
   The following is given in the RFC.

  0   1   2   3   4   5   6   7
+---+---+---+---+---+---+---+---+
| e | a |   len | 0 | 0 |not| m |
+---+---+---+---+---+---+---+---+

not - NOT bit. If set, logical negation of operation.

m - Match bit. If set, this is a bitwise match operation
defined as "(data & value) == value"; if unset, (data &
value) evaluates to TRUE if any of the bits in the value
mask are set in the data.

I will try to use all the combinations of 'not' and 'm' bits. Please let me
know if the following my understanding is correct.

I will try to use the mask with SYN, ACK bits of TCP header for this.
[CWR ECE URG ACK PSH RST SYN FIN]
mask = 0x12

   1. not-0, m-0  (data & mask) != 0 i.e. either SYN or ACK bits should
   have been set in TCP header.
   2. not-0, m-1  (data & mask)  == mask i.e. SYN and ACK bits both should
   be set in TCP header.
   3. not-1,m-0   (data & mask) == 0    i.e. both SYN and  ACK bits should
   not  be set in TCP header.
   4. not-1, m-1  (data & mask) != mask i.e. at least one of  SYN or ACK
   bits should not be set in TCP header.

Thanks,
Pavana.