Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How do IP addresses work?

  1. Feb 2, 2013 #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!
  2. jcsd
  3. Feb 2, 2013 #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.
  4. Feb 3, 2013 #3


    User Avatar
    Homework Helper

    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 web site 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: Feb 3, 2013
  5. Feb 4, 2013 #4
    Ahh interesting, thanks guys!
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: How do IP addresses work?
  1. IP address (Replies: 4)

  2. Ports on IP addresses (Replies: 5)