Make the port ids unique
Use MAX_BUFFER_LEN instead of the hard coded value