As Paulw11 said, you do not connect to iBeacons, you just listen to their advertising message, this message is mainly composed by two parts:
- the beacon full ID (UUID+Major+Minor -thx Jerome-)
- the beacon transmitting power
Knowing the transmitting power and the the signal drop in air the receiver can calculate the distance. This means two important things, the advertising signal is public, the estimated distance doesn't take into account interferences or power loss due to other factors (walls, bodies).
You can, of course, triangulate iBeacon to get a more precise position, but it will be an estimation based on other estimations.