hello everyone,
I want to use P4 to implement a simple grouping function: hash the packet's 5-tuple and modulo 2 to the hash result. If the final result equals 0, we send it to the corresponding port; if the final result equals 1, we send the eth-address of the packet to cpu.
this is my lines in the table(in command.txt):
this is my hash function and the length of hash_result is 4 bits:
I use the hash_result%2 as the value of user_metadata.my_hash_result and transmitted to the control pipe:
I use the user_metadata.my_hash_result as the key of forward table:
however, when I make the P4 program in the director P4_PROJECT_DIR, I meet the problem:
I had set the length of key in the command.txt with 4 bits and the length of hash_result is also 4 bits, but Why the Table TopPipe.forward key pre-padded with 8 bits? Please help me, thanks!
hello everyone, I want to use P4 to implement a simple grouping function: hash the packet's 5-tuple and modulo 2 to the hash result. If the final result equals 0, we send it to the corresponding port; if the final result equals 1, we send the eth-address of the packet to cpu.
this is my lines in the table(in command.txt):
this is my hash function and the length of hash_result is 4 bits:
I use the hash_result%2 as the value of user_metadata.my_hash_result and transmitted to the control pipe:
I use the user_metadata.my_hash_result as the key of forward table:
however, when I make the P4 program in the director P4_PROJECT_DIR, I meet the problem:
I had set the length of key in the command.txt with 4 bits and the length of hash_result is also 4 bits, but Why the Table TopPipe.forward key pre-padded with 8 bits? Please help me, thanks!