Determining the ip-address of chatting person - networking

This question used to raise from the time i was studying my networking course. Suppose I am chatting with some other person on the g-talk and if I capture the packets then whose ip address it would be whether it would be the ip address of the person whom i am chatting with or of the relay server in between.
Is there any way i can get the ip address of the person whom i am chatting with ??

Generally - no. Since there is no way to establish direct connection between ANY two hosts (two peers both behind NAT will not be able to connect directly), all communications should occur through relay server, so any packets you capture will be from and to relay server.
But GTalk developers MAY implement a feature to connect two chatting peers directly (if possible). In that case you will be able get the other person's IP address.
Also relay server may simply report other person's IP address.

Related

How do modems connect with ISP?

AFAIK when i turn on my modem, it says: "Hi ISP, i need an IP".
Then, my ISP give it an IP.
How does my ISP identify my modem? by last IP, key, or what?
After i have an IP, i can navigate, but after some hours my modem changes its IP.
2) How is that change done?
I mean, my ISP says: "Hi user modem, there is your new IP"
It gets even funnier if when i turn on my modem, some other modem has the last IP my modem had.
There is a collision. So, my ISP would give my modem another IP, wont it?
I know im talking about technical stuff, but i would like you to explain me in your own words in order not to make it cumbersome.
If technical references arise, maybe just name the concept or leave a link. It would be enough for me.
Thanks you all!
By posting under the tag „dhcp“, you are obviously already assuming that the DHCP protocol is the answer to your questions:
The DHCP Protocol allows the DHCP Server (your ISP) to identify the DHCP client (your modem) by a multitude of information. The most important one is usually the MAC address of your modem. The last IP is also transmitted from client to server along with proprietary information such as the client identifier and others.
The server supplies the IP address along with a lease time. The client will renew the IP address with the DHCP server when the lease time is about to expire. The server decides in the renewal process triggered by the client if the same IP is ok to use further or not.
Restart is not much different from renewal. The DHCP protocol is for that purpose equipped with a broadcast feature so the collision does not really happen, because the client (modem) will ask for an IP address before it uses the old IP.
It is possible that modem and ISP do not use DHCP but the mechanism is probably similar. DHCP is specified in RFC 2131.

Multiple Mosquitto brokers to exchange data between devices

I have 3 devices each of them have Mosquitto broker running on them. Each of this device has subscriber and publisher.
I am using IP of each device to open port at 8883 and exchange messages --> subscribe/publish their messages. If the case happens to be that devices use dynamic IP., How can I publish new IP-PORT address to its clients that are already connected? How to tackle this problem. Is my approach correct? Is there any other way I can create my own private IP-PORT address to the broker?
Your broker needs to be reachable at a known location, be that fixed IP address or a DNS entry that points to it's current IP address.
Any clients connected at the time the IP address changes will be disconnected and will need to reconnect.
You've not said if these are all on the same LAN or spread across the internet, but either way you need some sort of dynamic DNS solution.
If the devices are all on the same LAN then you can use Avahi/mDNS/Bonjour to discover the current address of the device in the .local domain. Each broker will need to have a unique name.
If you are in a none lan environment then you will need to use a proper Dynamic DNS solution and have each broker have a unique fully qualified DNS name that the host machine can update when ever it's IP address changes.
Both of these solutions are more network admin solutions than programming questions so I suggest you ask on SuperUser if you have follow up questions.
There is a 3rd option, which is to have a 4th broker on a fixed IP address that acts as a central bridge for all the other brokers.

Networking Dilemma IP stack(Microcontrollers)

I basically have used the ethernet connection successfully with Microcontrollers to control real world aspects,The dilemma is of IP address I mean how can 192.168.0.155 be accessed from around the world without any specific MAC ID attached to it, I wanted to implement the same networking usage with a GSM module eliinating wires but that doesn't have MAC addressing so TCP connection from it towards a IP client won't reach?
I am not sure how you did your 'real world control' with Ethernet before, but the MAC address does not 'live' past the next recipient (which means after the next switch) so do not use it for anything.
Your 192.168.x.x address is private, so it will never appear beyond your internet gateway (i.e. your GSM modem if you used GPRS), and it cannot be used directly for anything on the internet. It is not easy to briefly explain here how the internet routing works, but you should either use port forwarding towards your private IP address given to you by hour DHCP server (in which you have to initiate request from the client so that other side would not the IP address and the port), or you have to either have fixed public IP address or you could use some dynamic DNS service (like http://www.noip.com/), or you can update data from the client on some server over which you have control (like if you updated data manually from your PC).
All summed up, it is not very clear what you are trying to achieve, but I would say you need to check out some things about internet routing before you proceed.

IP Comparison between 2 Locations

can one location have more than 1 IP address? I have 2 IP addresses and need to know if they originate from the same source. Thanks
You're missing clear definitions of "location" and "source" in your question but lets go with the assumption that you mean "physical machine" for both (as it's obvious that multiple machines will have different addresses and that a single machine can change its IP address over time).
In that case, the answer is yes. The operating system may bind as many IP addresses to a physical network port (and a single MAC -- the physical addressing used by Ethernet) as it wishes.
Binding multiple IP addresses was the standard way of doing "virtual web hosting" before HTTP/1.1 arrived with the "Host" header. The provider would use DNS to map different host names to different IPs on the same network (usually the same subnet as well) and then assign all of them to the same interface. The webserver would get address information from an incoming connection and based on the local IP address would know which virtual host was being accessed.
This led to a higher-than-typical use of public IP addresses but the practice is now gone with the proliferation of HTTP/1.1.
I'm not sure how Windows presents it, but Linux will present a physical interface with multiple IP addresses as multiple logical interfaces such as "eth0", "eth0:1", "eth0:2", etc. Each logical interface has a unique IP address even though they share the same physical interface.
This is hard to tell. Especially it is hard to tell if these IP addresses are from different times. Today I may have a different IP address than tomorrow.
Even they are from the same time, a load balancer im my internal equipment might send my packets over the fail-over line if the 1st one is overloaded or broken down.
One network adapter normally has only one IP address at once and a typical end user only has one network connection active, but even then the IP address can change. The user could switch from wireless to wired and back or a power outage might reset the ISP's DHCP server (assigning everyone a new IP address).
If you want to identify the user even if his IP address changes, you need to identify the user by his session id, stored in cookies. As two users can have the same IP address (a whole company could be behind a NAT), you should never rely on IP addresses for identification.

How do VoIP apps connect users with no real IP addresses together?

I want to know how two computers with VoIP software can be connected to each other and exchange voice data without having an external IP address.
You would need an static IP address only if you were trying to connect the two to each other directly. The VOIP server acts as a go-between.
Example:
Person 1 and Person 2 are trying to get into a VOIP call
They both register with the VOIP server with their IDs.
When one ID places a call to another, the there is a connection between the two, with the server in between, but not directly with each other.
SIP (Session Initiation Protocol) is usually the Protocol used for VOIP. There is a SIP registrar, which is the server. You can establish your own SIP server using Asterisk's free solution. SIP actually makes it possible to directly connect peers. However, this isnt possible over the internet where people dont have static IPS
Software like skype use a similar workflow. The skype client tries to connect the peers. When it cant, it uses something like UDP Hole Punching.
Every computer in the internet has an external IP.
The internet works that way.
There are numerous pages on the internet, where you can see your 'external IP'.
Regarding the voice exchange: They connect to a server and that server either does the relaying himself, or exchanges the IP information between the clients, who are then left to create a connection among themselves.
The actual data of a VoIP call is carried over RTP, which really only takes 24-64Kbps (depending upon codec) and requires UDP addresses going each way. Occasional RTCP packets are sent to report status, metrics, etc, but are not really needed.
SIP is used for call setup and teardown.
There is always a network address between two VoIP endpoints, comprised of the IP address and the VoIP socket.
And yes, you could proxy RTP over some other transport protocol, or tunnel (through http?), etc.

Resources