Router's IP vs. LAN IP: A Comparison

  • Thread starter Thread starter prashantgolu
  • Start date Start date
  • Tags Tags
    Comparison
AI Thread Summary
The discussion clarifies the distinction between a router's WAN IP address and a LAN IP address, emphasizing that the WAN IP is dynamic and assigned by the ISP, while the LAN IP is used for local devices. The router employs Network Address Translation (NAT) to allow multiple devices on a LAN to share a single WAN IP, enabling them to communicate with the internet. Devices on the LAN can obtain unique IP addresses through DHCP, typically using the 192.168.x.x range reserved for local traffic. The conversation also touches on the limitations of peer-to-peer connections due to NAT and the necessity of servers like STUN for establishing connections. Overall, the router's role is crucial in managing local and internet traffic while conserving limited IP resources.
prashantgolu
Messages
50
Reaction score
0
what is the difference between router's ip address and my lan ip adress...

what i understood is that we have a lan ip adress and a wan ip adrress ...now my wan ip address is found using what's my ip address address.com and it changes...hence dynamic...and my lan ip address is using ifconfig...but then everybody seeems to have same lan ip address ...and what's the work of a NAT...?
 
Technology news on Phys.org
Since Internet IP addresses are limited and expensive, your ISP gives your router one IP address so that it can appear on the Internet as a single device. Most ISPs change this address periodically for various reasons, unless you pay them extra for a static (unchanging) IP address--which you might do if you are running a server, for example, so that the name servers on the Internet (the devices that know how a domain name maps to an IP address) know your IP address.

The router is a single device on the Internet. So one of the router's jobs, then, is to make everything behind it (everything on your LAN) appear as a single device on the Internet. It does this by modifying the packets as they come in and go out. That's NAT.

So that devices on your LAN can talk among themselves (including the LAN side of the router) each of them can be given a separate IP address and you don't have to pay for those because you're using them locally. You can either program an IP address into every device, or tell a device to ask the router for a free IP address for use on the LAN. The latter is most often used. The process of asking the router for an IP address to use locally is called DHCP. The IP addresses used locally should use those that are reserved for local traffic, like those that start with 192.168.x.x. This is so they are never confused with actual Internet IP addresses, as described in the next paragraph.

When a LAN device does want to access the Internet, it simply acts as if its on the Internet (sending packets to the Internet device using that destination device's Internet IP address). The router sees those packets and translates them accordingly before sending them out to the internet.

On a side note, there's not really a standardized way for a local device to find out the WAN (Internet) IP address of its own router in case it wants to tell it to some other device on the Internet so that other device can send unsolicited packets to the first device (also, your router won't allow unsolicited incoming packets unless it see a local device first send a packet to that device. Both devices must send a packet or two to the other to get the router to allow subsequent packets--this is called hole-punching). That's why an Internet peer-to-peer connection always requires a server on the Internet to set it up--because that server can see what the WAN addresses are for the two peers, and tell each the other's address. Then each device can send a hole-punching packet to the other to get their routers to allow more packets. There are even free servers out there just for doing this, called STUN servers. That's so you can, for example, write a game that sets up peer-to-peer connections using a free STUN server.
 
Last edited:
fleem said:
Since Internet IP addresses are limited and expensive, your ISP gives your router one IP address.
The price for multiple WAN ip's is being reduced over time. Cable modems support up to 16 WAN IP's, although in the case of Cox cable, it's limited to 3 WAN ip's and each additional ip costs about $7 / month. ATT's DSL static ip block is $15 / month for 8 ip's, but 3 of those are overhead, so you end up with 5 static ip's.

Note that when you have a multiple ip setup with one ip per computer, you lose the LAN, since each computer is effectively connected to directly to the internet and not directly to each other. In the case of a cable modem, if you remove the ISP (coax) cable from the cable modem, it will then act as a LAN router, and assign local ips (192.168.x.x) to each computer. (Note you could have a mix of computers and routers, each with it's own WAN ip, connected to the ISP modem).

A router using one ip for multiple computers remaps the "port" addresses in each packet sent by the computers (it undoes the mapping on packets sent back to the computers). This can be an issue if trying to play an online game with multiple computers since the games often want to use specific port addresses. Having a multiple ip setup (one external WAN ip per computer) solves this issue (but then there's no LAN unless you disconnect the cable or dsl modem from the ISP and reboot everything).
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
20
Views
4K
Replies
11
Views
4K
Replies
14
Views
2K
Replies
27
Views
3K
Replies
4
Views
2K
Replies
9
Views
6K
Replies
2
Views
2K
Back
Top