Dynamic bandwidth control

I have a question about category follow by below configuration.

when CLIENT_ACCEPTED {

set mycookie [IP::remote_addr]:[TCP::remote_port]

BWC::policy attach bwc_dynamic_policy200 $mycookie

}

How did iRule know IP/port is HTTP or P2P in category?

[Category name is a string that we define.]

How did iRule know IP/port is HTTP or P2P in category?

i understand you also need to use BWC::color command to assign category.

BWC::category