Hi,
The designated port id, is used as the last step in the 4 step spanning-tree path secection criteria, basically, if all previous steps are tied, then it will use the port with the lowest port id, where all ports have a default value of 128, and also have the port number in the value, ie port 3 is 128.3, port 6 is 128.6, a switch will prefer the lowest port id, so if a switch has two paths to choose from and one is 128.10 and the other 128.15, it will use the 128.10 path,
You can change the value on the port itself per vlan, however note that this must be configured on the remote side switch port, as the port id of of the neighbour port is used to select best path.
You would only use this if you had switch A connected to switch B via two physical ports.
Switha---switchb port 6
switcha---switchb port 10
If we configu switchb as the root switch, then switcha will recieve same root bridge bpdu from two ports, 6 & 10, since they both match we must use path select step 2 path cost, since both ports are fast ethernet they have the same path cost, 19, so we now must use path select step2, sender bridge id, since the sender is switchb on both ports, then this is also the same, so we use step4, port id, since port 6 has value of 128.6, and port 10 has 128.10, we choost port 6 as best path to root, and block port 10.
If you were to config port 10 on switchb with spann tree port-prioirty vlan x 64, then switcha will see this as 64.10 and it is now better than 128.6 and select this port as root port.
HTH,
LR