A novel path tracing scheme is described in this paper which is known as Prime number encoding scheme using Benes network. In this scheme every data packet consist a label which is default 1 and every node consist of a prime number tag, as this data packet pass through the network label will be multiplied with the tag of the node. Prime number multiplication is done with encoder. At the receiver end factorization is done which gives the information of travelled path. In this scheme optical cross connects (OXC) is replaced with the Benes network which gives the better result than OXC. System having Benes network gives less attenuation than OXC and complexity of the system also decreases.