Skip to main content
. 2022 Feb 8;8:e809. doi: 10.7717/peerj-cs.809

Algorithm 2. WildMinnie main procedure and finding common patterns function.

1: procedure wildminnie(R, Ts)            #R: set of rules
                         #Ts: rule table of switch s
2:  W := find_common_patterns(R)         #Step 1, finding patterns
3:  Bs := build_pattern_tree(W)           #Step 2, processing patterns
4:  copy_to_switch_table(Bs, Ts)           #Step 3, Writing prioritized rules to the switch table
5: end procedure
6: function find_common_patterns(R)
7:  W : {}                   #wildcard pattern set
8:  Gp := group_rules_by_outport(R)
9:  for each GpiGp do
10:      L:=j=0|Gpi|(Gpi,j,pi,{Gpi,j})         #L(A,p,M): a set of tuples
11:    for REPEAT_COUNT do
12:      for j := 0 to |L| − 2 do
13:        A := L[j].A (L[j].AL[j+1].A)
14:        M := L[j].ML[j+1].M
15:         L={(A,L[j].p,M)}
16:      end for
17:      shuffle_set(L)
18:    end for
19:     W=L
20:  end for
21:  return W
22: end function