Question:
IP addresses and DHCP. Help me?
Adam
2013-12-19 22:52:16 UTC
I am very confused and I hope that there is someone out there who can help me. 10 points will be given. Please help. When I read articles online, the lingo and jargon can be confusing and there are many holes in the logic of the whole process which I feel are left out.

After having read many articles on the web through the internet (words which should not be used interchangeably), here is what I have come to believe to be true.

An ISP (internet service provider) provides you with an IP (internet protocol) address. You can connect to the internet without a router, but you need a modem. If you have a router, you can set up a Local Area Network so many computers and devices can connect to the internet through the modem and through your ISP. However, for the router to be able to receive responses to requests that your computers have sent out, it needs to assign each computer on your network a slightly different IP address (192.168.74.x : 192.168 is a form used to identify a private IP address). Using NAT (network address translation), your router takes your private IP address and converts it to a public IP address that other computers can see and contact (this is the address you see when you look it up online).

Q1) Is this public IP address the IP assigned to you by your ISP? It seems like your router is assigning you your private IP address.

Q2) you can configure your router's IP address to be anything. Why is this so? I thought each IP address is unique. Is it because the routers IP address is private?

There is this notion of static and dynamic IP address. Using DHCP (dynamic host configuration protocol) you computer annouces "I need an IP address!" and it is temporarily provided one (DCHP also provides information on subnet, first router to be taken, etc). This IP address can change if you leave the network and come back.

Q3) So.....is the router assigning you an IP address? are you getting your IP from your ISP? or are you getting your IP from DHCP? And if so, where the hell does DHCP get this address from?

Q4) where does your computer announce to using DHCP that it needs an IP address? Does this announcement go through the router?

Q5) Subnet tells you what exactly? Something like a range of IP addresses that are local? what is that range?

After you somehow have an IP address, you can connect to the internet. If you are in a cafe or some sort, first stop is the Access point, which will connect you to the servers of the ISP of the cafe. If you are at home, connection is through the modem and your ISP. When you open your web browser, you type in a domain, you are redirected to a DNS server (domain name server) which is like an address book of domain names and IP addresses. So from your computer at home, connection goes through the modem, to the ISP, and to a DNS server, which supplies you with an IP address to whatever website you are visiting. Then, knowing where your packages of information must be sent (your requests for whatever you want, a website, file sharing, etc), you hop from router to router (via cable lines or satellite or wifi?) until you reach the server you want. Depending on your request, you are directed to a specific port on the server depending on if you are requesting a response that needs HTTP (port 80 usual), POP3/IMAP (for email), etc. If you are requesting a webpage, the server sends back packets of info which can be reconstructed and your web browser is able to convert the HTML (hyper text markup language) into a page of graphics/texts/videos etc.

If you could respond to the questions and correct the flaws in this last paragraph that would be greatly appreciated. Please help this confused mind! Be as detailed as possible. 10 points and thanks.
Three answers:
Ben
2013-12-19 23:13:58 UTC
1) Yes, the public IP address is the one your ISP gives you. That's the only one that's visible to the greater Internet.



2) You can configure your IP address to be anything, you'll just have trouble if you try doing it. The Internet doesn't have any sort of central server keeping track of who is using what IP address. But keep in mind that IP addresses are used for routing. If you set your IP address to something that's in use by someone else, there's a chance that the responses to any messages you send will end up at their computer instead of yours. The reason 192.168.x.x is considered private is because ICANN, the organization in charge of the IP addresses, has declared that no one should ever use those for anything public-facing, so you don't need to worry about conflicting with anything.



3) DHCP is a protocol for dynamically assigning various connection settings- not just the IP address, but also the default gateway (where to send all of your data) and the DNS servers to use to resolve URLs. Unless you pay for a static IP, your router uses your ISP's DHCP server to get the public IP address, and then in turn your router serves as a DHCP server to assign the private IP addresses.



4) So, there's a special type of IP address called a broadcast address. Those are addresses that end in all 1s, and they mean that you want the message to go to everyone in that range. So the IP address 192.168.255.255 means "send this message to everyone on the 192.168.0.0/16 subnet. The IP address 255.255.255.255 means "send this message to everyone on the Internet " (most routers are configured to not pass that one on). When you first connect to the Internet, your computer sends a broadcast message saying "hey I'm here", and the DHCP server responds with the information it needs.



5) IP addresses are assigned in blocks, called subnets. For example, MIT owns the 3.0.0.0/8 block, meaning that 3.0.0.0-3.255.255.255 are all assigned to them- that is MIT's subnetwork. Your router likely uses the 192.168.1.0/24 subnet, meaning it reserves the last 8 bits for the numbers (it technically can use any part of the 192.168.0.0/16 subnet, but it doesn't need all of it).



Most of the last paragraph is correct, except for the part about ports. Port numbers don't actually mean anything physically, or have anything to do with the protocol. It's just an arbitrary number included in the IP packet that's sent with your message. By convention, HTTP is on port 80 and SMTP is on port 25 but they don't have to be. On the server, programs register themselves with the network stack. So a web server will typically register to receive any data with a port number of 80 or 443 (the latter is HTTPS). But on my dev machine, when I'm working on a website, I'll typically run the web server on port 8000 or 10000 so it stays out of the way of anything actually important.
Krowten Nimda
2013-12-20 08:26:17 UTC
A1) Yes, the public IP is assigned by the ISP and your router assigns you a private IP.



A2) The ability to manually set the IP address of the route is a feature. If your ISP's DHCP server wasn't working, or the router's DHCP client was malfunctioning, you could type in the information manually (I've actually done this before when someone at the ISP misconfigured their DHCP server). Each IP does have to be globally unique, however, using Network Address Translation (NAT), you can "hide" a local network that uses a set of non-unique IP address, commonly called private IPs. These IP addresses can be used by anyone on their local network, but cannot be used on the Internet. When traffic goes from your network to the Internet, NAT (running on your router) changes your local IP to the public IP. Traffic from the Internet is changed back again.



I would like to point out you really must know what you are doing to mess that. You do have to know what addresses are valid for the ISP's network, subnet size, gateway information, etc. You can also use the router internally. Say I wanted to setup a second network at home, I would use another router. I could just plug into one of the LAN ports on the first router and get an IP from DHCP, or I could manually set the IP address.



A3) The router has a DHCP server that gives out IP addresses on your local network. Your ISP has a DHCP server that gives out addresses as well, in your case to your router's WAN interface (port). If you didn't have the router, you could plug into the modem directly and your ISP would give your computer a public address. The addresses are programmed on the DHCP server, in whats called a pool. When a device asks for an IP, the DHCP server checks to see what network its on, then grabs an IP from the appropriate pool (there can be more than one pool, for multiple networks).



A4) Your computer uses a type of communication called broadcast to announce it needs an IP. Several protocols, including DHCP, use broadcast. Broadcast communication is heard by all members of the network, which includes the router. Routers are what create the networks and connect other networks. To keep traffic down, broadcasts are not forwarded to other networks. In your case, the router (running the DHCP server) hears the DHCP request, responds back with the IP information for your network.



A5) The subnet is basically the range of valid addresses within a specific network. Subnets are variable in size.



You're last paragraph is correct. I'd like to point out that the modems aren't that important. They just take one type of signal (analog) and turn it into a different type (digital). Its the routers that connect you from whatever network you are on to where ever the destination device is.



Hope this helps.
Shawn H
2013-12-20 06:00:24 UTC
There is a range of IP addresses that are designated as public and a range designated for private use. ISP's distribute an IP address to a customer's modem from the public range.



Any connection between your modem and the ISP is public. Any connection between your computer and the modem is considered private when the modem also serves as a router. When the modem has routing capability it can translate communications from the public IP address your ISP has given out to a private IP address your modem/router has given to your computer.



All devices on a network need an IP address.



ISP hands out say 63.24.10.1 to your modem/router. Since you are only given one address, the modem/router gives you the capability to have more more address available for use, but not using 63.24.10.1. Instead, the modem/router uses a private IP address range, normally starting at 192.168.1.2.



It is this private IP address range that you can modify, not the IP address given our by your ISP.



Example:(DHCP)



63.24.10.1 (modem/router) > 192.168.1.2 (computer 1), 192.168.1.3 (computer 2), 192.168.1.x (computer X)



When the modem/router is set to automatically hand out network information, it normally uses DHCP (Dynamic Host Configuration Protocol), some also use BootP.



The request/acknowledge a computer makes to a DHCP server is at a lower level and you don't see it. If you google DHCP it will explain it in detail. Search for RFC 2131 and for extensive inform RFC 2132.



Subnetting refers to dividing your network in to sub networks. It's too complicated to describe the process here. But in general it defines what other network devices a computer can get to on a network.



For example: 10 computers are attached to a network. The addresses given are 192.168.1.2 through 192.168.1.11. The subnet mask is 255.255.255.0. Looking at the 0, this means up to 255 computers could communicate with each other. We call this a /24 subnet because there are 24 bits available for the network address. A /24 subnet allows one network branch. A /25 allows 2 branches. As you increase the number, the amount of network branches doubles. As you decrease, it halves.



Subnetting is extremely complicated because you cannot just throw in any number. You have to either use a subnet calculator or figure it out by hand.



Going back to DHCP, you can turn off the DHCP function of your modem/router so it does nto hand out addresses to your computer. You can then hard code a static address so long as the computer is on the same network as your modem/router.



So the modem/router will have an internal IP and an external IP (assigned by ISP). If you change the internal IP to say 10.10.10.1, your computer must be set you use 10.10.10.2 or greater with a gateway of 10.10.10.1. Subnet mask can be 255.255.255.0


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...