It represents a sparing in the various protocols for gathering the information from the sensors and broadcast it via IoT. The Comparing and Matching (CAM) algorithm outperforms the special version of RPL in power consumption, recovery, scalability, and throughput. The proposed CAM approach prevents from Sybil attacks by verifying the position of the sensors or nodes with their location ID. The match of the ID of the node is studied while data exchanging over the network. Simulation of network appraises end-to-end delay, pack delivery, and throughput of packets under the numerous positions to compute the effectiveness of packets using COOJA under a Contiki OS. It highlighted the security in data exchanging and exemplify the feature for intrusion detection "Sybil Attack" in IoT.