How are IP addresses assigned and used in different networks?

  • Thread starter CraigH
  • Start date
  • Tags
    Work
In summary, an IPv4 address is used by a computer, and each port on the router or modem is assigned a public IP. When you request content from a website, your browser sends a request with your IP address so the request can be directed to the right device. With IPv6, devices are assigned a unique IPv6 address, which is different than your public IP. However, your public IP still remains the same. Network Address Translation (NAT) is used to hide your network behind one public IP. Multiple computers in a house or office may share the same public IP, but they will have a different port assigned to them.
  • #1
CraigH
222
1
I know the basics, every device connected to the internet has a unique IP address, and when I request something from another device connected to the internet my IP is sent with the request so that the data packets know where to come back to.

However I have problems with this; firstly, if I google "My IP" it tells me that my IP is an 11 digit number. I'm pretty certain there are more than 10^10 devices connected to the internet, so how are there enough IP's for every device?
I've heard of IPv6 which supposed to be the current form of IP's designated to devices, and these look like this 2001:0db8:85a3:0042:1000:8a2e:0370:7334
source http://en.wikipedia.org/wiki/IPv6
However my IP doesn't look like this, what's going on?

My second question is why does it say "Your public IP address is xxx.xx.xxx.xxx" when I google my IP? what is a public IP?
If I have multiple computers connected to the same wireless hub, or they are all connected to a Ethernet port in the same house/flat, then would there be any similarities in there IP address?
How about something like a university network? how would IP's be used there? for example at my uni all accommodation is connected to the university wireless network connection so we can access the internet.

I've downloaded a network analyser to try and work some of this stuff out. there seems to be about 3 packets every 3 seconds when my browsers closed but then loads when I request a webpage, but none of them have my IP as either the source or the destination, (well the last 3 digits are the same on allot of them)
Please help I'm very curious as to what's going on. Thanks!
 
Computer science news on Phys.org
  • #2
Yours is an IPv4 address. You're quite right that there aren't enough IPv4 addresses for every device to have one.

The answer to all your other questions is Network Address Translation.

Your entire house(/workplace/university/ISP/...) hides behind one address (the "public IP"). Your computers have their own address but those addresses are not visible to the outside (and are not unique addresses).

You have a network gateway device that rewrites all of the outbound messages originating from your network and puts the public IP into the packet headers; and then when the responses are received, undoes that rewrite and sends the response back to where the request came from.
 
  • #3
CraigH said:
If I have multiple computers connected to the same wireless hub, or they are all connected to a Ethernet port in the same house/flat, then would there be any similarities in there IP address?
Typically, multiple computers in a house will use a router or modem with router function, whch uses the same public IP but a different set of "ports" for each computer connected to the router.

However many ISP (internet service providers) also offer the (added cost) option of assiging a separate public IP for every computer (or device) connected to the cable / dsl modem. It's common for a cable modem to support up to 16 public IP's, but the cable company in my area currently has a max of 3 public IP's. DSL offers an 8 IP modem, but 3 of those are overhead, so you end up with 5 public IP's. Multiple IP's with DSL used to be signficantly more expensive than cable, but now the pricing is close.

In the case of shared web hosting, a single server will use multiple public IP's, one for each shared website on the server.

I'm not sure how all this will transition from IPv4 to IPv6, other than I assume IPv4 addresses will get "grandfathered" and remain the same.
 
Last edited:
  • #4
Ahh interesting, thanks guys!
 
  • #5


I can provide a detailed explanation of how IP addresses are assigned and used in different networks. Firstly, IP addresses are unique numerical identifiers assigned to devices connected to a network. These addresses allow devices to communicate with each other and send and receive data packets.

There are two types of IP addresses: IPv4 and IPv6. IPv4 addresses are the traditional 32-bit addresses that are commonly used and look like the 11 digit number you mentioned. These addresses have a limited number of combinations, which is why there is a concern about running out of available addresses as more and more devices connect to the internet. This is where IPv6 comes in, as it uses a 128-bit address format and can provide a significantly larger number of unique combinations. However, not all devices and networks have transitioned to using IPv6 yet, which is why you may still see IPv4 addresses being used.

In terms of how IP addresses are assigned, there are two main methods: static and dynamic. Static IP addresses are manually assigned to a device and do not change, while dynamic IP addresses are automatically assigned by a network's DHCP (Dynamic Host Configuration Protocol) server and can change each time a device connects to the network.

Now, to address your questions about public and private IP addresses. A public IP address is the address that is assigned to your device by your internet service provider (ISP) and is used to communicate with other devices on the internet. This is the address that is shown when you google "My IP". A private IP address, on the other hand, is used within a local network (such as your home or university network) to allow devices to communicate with each other. These addresses are not visible to the outside internet.

In a network such as a university, there will be a range of private IP addresses assigned to different devices, but they will all have a common public IP address that is assigned to the university's network by the ISP. This allows all devices connected to the university's network to access the internet using the same public IP address.

As for the packets you saw in your network analyzer, it is normal to see a few packets being sent and received even when your browser is closed. These could be background processes or updates happening on your device. When you request a webpage, there will be a larger number of packets being sent and received as your device communicates with the server hosting the webpage. These packets may not have your IP address
 

1. How is an IP address assigned?

An IP address is assigned by an Internet Service Provider (ISP) or a network administrator. When a device connects to a network, it is assigned a unique IP address to identify it on the network.

2. What is the purpose of an IP address?

The main purpose of an IP address is to identify and locate devices on a network. It allows devices to communicate with each other and access the internet.

3. How do IP addresses work with routers?

Routers use IP addresses to route data packets between devices on different networks. They use a routing table to determine the most efficient path for the data to travel based on the IP address of the destination device.

4. Can an IP address change?

Yes, an IP address can change. Dynamic IP addresses are assigned temporarily and can change each time a device connects to the network. Static IP addresses, on the other hand, are manually assigned and do not change unless changed by the network administrator.

5. How many IP addresses are there?

There are two types of IP addresses: IPv4 and IPv6. IPv4 addresses are 32-bit numbers, allowing for a maximum of 4.3 billion unique addresses. IPv6 addresses are 128-bit numbers, allowing for a significantly larger number of unique addresses (3.4 x 10^38). This ensures that there are enough IP addresses for all devices connected to the internet.

Similar threads

  • Computing and Technology
Replies
4
Views
1K
Replies
4
Views
798
  • Computing and Technology
Replies
14
Views
1K
  • Computing and Technology
Replies
27
Views
2K
  • Computing and Technology
Replies
10
Views
2K
Replies
13
Views
1K
  • Computing and Technology
Replies
4
Views
1K
Replies
16
Views
4K
  • Programming and Computer Science
Replies
1
Views
734
  • Engineering and Comp Sci Homework Help
Replies
3
Views
3K
Back
Top