So if I want to make sure that my packet is delivered to the right person using some IP address or other thing that uniquely identifies a person, what should I have to do?
You can't ensure that. It is not technically possible.
What you can do is ensure that a packet cannot be read if it is delivered to the wrong person or machine. This can be implemented using various strong encryption schemes. And at the application level, HTTPS will ensure this provided that:
- the client checks the certificates presented by the server thoroughly, and
- the server's private keys are not leaked.
Under normal circumstances an HTTPS server does not have any way to definitively identify the client machine. You can address this using client certificates, but that requires a lot of effort to set up. This IBM note gives an overview:
So normal practice is to use plain HTTPS, combined with some application-level scheme to authenticate the users; e.g. user names and passwords, two factor authentication, biometrics, token generators and so on, etcetera.
But I suspect the IP address that I'm getting from this method is only the public IP address and it must have more than one client using same public IP as this one ...
Yea. This is increasingly common these days, given that the IPv4 space has been exhausted. For example a NAT gateway allows clients with "private" IP addresses to talk to an external service via a NAT gateway. To the external service, the connections appear to have the NAT gateway's IP address as the client address. There's nothing the service can do to find out what the "real" IP address is, and even if there was a way, it wouldn't uniquely identify the client.