Getting the host ID and network ID from an IP address - networking

I'm learning about IP addressing, and I'm still a bit confused. I know that an IP address consists of a network and host ID. To test this in the real world, I googled "what is my IP address" on my tablet and smartphone, both connected to my home wireless network and I got the same IP address. Shouldn't they be different since they are two different hosts? I suspect this has to do with public and private IP addresses, but then, my bigger question is how does data really get to my individual device?

To the outside "internet", your IP address is just the IP of your router, provided by your ISP. Within your home network, you have a set of private addresses assigned by your router. The way that programs know to communicate with the correct device is usually through a custom reply-to port that the router re-assigns to packets from each device. This is called NAT.
For example, if you are browsing on port 80 from your tablet and your laptop at the same time, your reply-to port may be set to 3245 for the tablet and 3246 for the laptop. When the router receives a packet going from port 80 to port 3245, it changes 3245 to 80 and sends it to your tablet. If the port is 3246, it sends it to your laptop instead. The key point here is that the website you are communicating only knows the IP of your home router. As far as those sites are concerned, there are no other devices.

To test this in the real world, I googled "what is my IP address" on my tablet and smartphone, both connected to my home wireless network and I got the same IP address. Shouldn't they be different since they are two different hosts?
No, because of NAT.
I suspect this has to do with public and private IP addresses, but then, my bigger question is how does data really get to my individual device?
Thanks to NAT.

Related

Public IP address vs Private IP address

Good day to all,
I am trying to study networking basics. Watched a ton of videos, researched abit and understood better. However I can't find answers to what I am curious about. Forgive me, I am just a beginner in this IT thing.
A computer has a Public IP address (which is sensitive), and obtains a Private IP address after it is connected to a router.
A router has a Public IP address and also a Private IP address (192.168.1.1 for linksys). It will then assign all the devices connnected to it which its own Private IP address, for example 192.168.1.102.
So here is something I don't quite understand (even after researching online);
Mobile phones uses its own public ip address to connect to the internet via Mobile Data, is that right?
Desktop does not uses its public address at all since it is always connected to a router which assigns it a private ip address?
When a computer outside the network wants to connect to a computer inside a network, does the connection happen directly between computer to computer or does it have to connect through the router where the router will then pass the connection to the computer inside the network?
I can't seem to find any explanation how computer IP public address are utilised since it is always connected to a router where it has its own private IP address.
Forgive me, I am just a beginner. Thank you in advance.
1.) Yes(Mobile Phones are connected via radio masts which are provided by your provider.)
2.) Yes, Desktop Computers same as Mobile Phones which are connected to the router via wifi use the routers IP Adress.
3.) If a computer outside the networks needs data from a computer inside your network it sends a request to your router which forwards it to your computer (which request are forwarded determines the firewall of your router). Also if you request data from a computer outside your network you send a request to your router and the router sends a request to the network of the other computer.

How can I ping my home computer from outside?

I'm trying to wrap my head around networking and the internet. This is a very big subject, and it is not my goal to understand all of it. However, I want to know how to use it for... stuff... which right now means I want to find a specific computer. I'm going for my home computer. I know the IP adress is alpha and omega when it comes to finding something online, so I have looked it up, by typing "my ip" into google. So far, so good.
However, I did the same on my phone, which is connected to the same wireless router, and lo and behold, it has the same IP address, according to google. So, if I am on a different computer, on a different network, and I try to ping that IP address, my best bet is that I'll reach that wireless router and that's that (I've checked in the router settings that that is indeed my router's IP address as well). How can I send a ping (as in, using the sommand ping, either on linux or windows) from somewhere else that goes out on the internet, and specifically finds my computer, instead of just the router controlling my home network?
Your home router has a single IP address. The router's job is to use a network address translation (NAT) to figure out which computer or device on your home network sent which requests so that all the devices on your router can use the same external IP address.
The router also has port forwarding settings that you can look up so you can, for example, set up a game server or web server that directs all outside network traffic trying to use that port to that one specific computer. You can also DMZ a specific computer but that leaves that device open to attacks.
To keep it simple: the devices in your home network do have an IP address, but it is a private IP address. In order to be able to reach your phone from the internet, it should have a public IP.
Unless you try to mess with the router, you can't reach any device from outside your network.
Your PC lives underneath the router on a smaller network called your LAN. The internet cannot see it, it can only see your router, which in this case is serving as a gateway.
Pinging is difficult behind a router depending on whether your router uses PAT or NAT. In order to forward traffic to a specific port you can change a setting in your router to forward incoming traffic on that port to the local machine.

Difference in Ethernet and Wireless IP addresses?

This is probably a pretty basic question with a fairly simple answer, but I was just wondering if anyone could clarify why there is a different IP address for my Ethernet connection and my Wireless LAN connection, rather than just one IP address for the actual machine?
It's because they are different connections. Each interface, hard wired or wired, will have its own IP address. The IP itself is assigned by your router. If you are concerned with what pool your IP is assigned from, you need to go into your setup utility and see what is allocated for wireless, and what is wired.
This same thing would happen if you had 2 ethernet cards in your machine. Each one would have it's own IP.
In other words, the IP is a unique identifier as per device, not each machine. You will have as many IPs as you have devices.

Different IP address error?

I had connect my laptop and phone under a same router/modem.
But the IP addresses that shown on my laptop and phone are different, why???
I'm quite newbie for it, please help me
IP addresses are different inside your network. When you send data outside the network your router uses NAT (Network Address Translation) to assign your Internal(LAN) address your External(WAN) address for the duration of that communication. If they had the same Internal IP address then you would have an error like this http://compnetworking.about.com/od/workingwithipaddresses/f/ip_conflict.htm

Can I configure network broadcast address on Cisco ASA device

Working on Cisco ASA 5510 device I tried to use the broadcast IP address of a Public Network for NAT Static configuration and IOS allowed me to do it, but from outside it didn't work. After a while I changed the broadcast IP to an usable IP and it started to work.
I understand that on a physical interface we can't configured a broadcast IP address, but for NAT we have to do it, otherwise we loose many Public IP addresses from networks with /29 prefix.
I understand you need to squeeze one more IP address for you to use, however most routers don't support forwarding broadcast traffic, for a simple fact, if that is allowed, anyone can send a ping to someone's broadcast address and every host in that subnet has to reply, that is not acceptable.
Other Internet routers may not tell that IP address is broadcast or not, but think about your ISP router for your access circuit, it has to know that IP address is a broadcast, it has to know your ip range in order to set it up. And when someone send you a ping, the router will say: hey, that is a broadcast address on my client's interface, first thing I know as a router, I must not forward a broadcast, thus drop it.
Hope it helps.

Resources