Addressing among private ip-addresses in networking [closed] - networking

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 7 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
So, i was reading networking in depth. One concept i failed to understand was how different machines in LAN manage to access internet through one public IP address provided to company by ISP.
For eg. let's say the public address provided is 244.13.5.89. And all the machines when get to internet, they all are recognized as 244.13.5.89 despite their private address being 192.168.3.x, which is fine. But now when the router sends the request for each of these machines, how does it maps each response to respective machine?
If the answer is NAT, what entries does NAT has? Is there port no. or something else?

I will give you the idea about the complex case scenario :-
If all datagrams arriving at the NAT router from the WAN have the same
desti- nation IP address (specifically, that of the WAN-side interface
of the NAT router), then how does the router know the internal host to
which it should forward a given datagram?
The trick is to use a NAT translation table at the NAT router, and to
include port numbers as well as IP addresses in the table entries.
See more details about NAT Table here.
SORRY, don't know why it took me minutes to post an answer, it was not allowing me to add the answer...

NAT has following fields:
source computer address and website, so when it receives packet it will replace source computer address with its public address, and send it to the internet once response comes back it sees oh this come from the website and it was requested by the source computer. It will again replace destination address with source computer address and send it in LAN.

Related

Discovering an embedded device's IP address [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I am working on a small embedded device based upon an STM32F4xx MCU. It implements a TCP/IP server over a Wi-Fi connection. The question I have relates to exposing the IP address of the device so that it may be discovered by computers on the same network. UPnP and SSDP seem to be rather "heavy" solutions to this problem.
Are there other techniques/protocols that have a smaller footprint than UPnP and SSDP?
Thanks in advance for your input,
Sid
If you can make up any custom protocol, a simple UDP beacon periodically sent to the broadcast address (255.255.255.255 or your preferred interface's broadcast address) is simple and reliable.
Synopsis of comments:
For listing in mainstream platforms' (Windows, Linux, OS X) network views, the best option would likely be to implement the full stack required for Windows' Network Discovery.
If hostname lookup is enough, Netbios or mDNS could be enough.
The search term you are likely looking for is zero-configuration networking and should give you all the available options

NMAP? - Determine whether host is on WiFi vs Ethernet [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Is there a method to determine whether a host (on your LAN) is on WiFi vs Ethernet using nmap or any other tool? I am OK with fuzzy guesses as well.
tl;dr No, there is none
Long answer:
There is no way to find out what kind of connection other PC on your network is using(without physically accessing it ofc).
Those things are abstracted on network. You can sniff traffic on transport layer by Wireshark and see there is no data on interfaces being transported.
An option:
You can learn a physical network interface vendor by sniffing traffic.
Wireshark can guess those, because vendors have their own MAC address prefixes. And if it's some company which is making wireless interfaces only, you can hit a jackpot. It's not even close to being a bulletproof method though.
Nmap may be used to look for open ports. There might be a chance that you can deduce which software server is running by getting info on ports, but I can hardly imagine you will find anything wlan/eth specific.

How can I know if my computer is behind NAT? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I'm trying to understand NAT (Network Address Translation) .
Can someone explain how can I determine if my computer is using a NAT (behind a NAT) , or
if it using its own IP address ?
What Barmar said in the comments is the easiest way. Obtaining your IP address over HTTP is indicative that you are behind either a NAT or an HTTP Proxy server. (I suppose it's possible you could have a public IP address, but your device is configured to route HTTP over a caching proxy).
Formal NAT detection and NAT classification can be done with the STUN protocol or equivalent protocol in which a UDP or TCP service echoes back the IP address back to the client that connected to it.
Another telling sign if you are behind a NAT is that your local IP address is in a private IP address range such as the 192.168.x.y range, the 10.x.y.z range, or then 172.16.0.0-172.31.255.255 range.
And pretty much any Wi-Fi setup is going to be a NAT configuration.
The NAT detection technique is based on two observations about the IP TTL (Time To Live) field.
Host operating systems have characteristic initial TTL values. This property of individual operating system implementations of TCP/IP is well known and can be used as part of a "fingerprint" to identify the operating system that a host is running merely by examining its traffic.
NAT devices or gateways decrement the TTL on packets that they forward.
For more details visit: http://www.sflow.org/detectNAT/

Communication between private IP addresses over the Internet [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
Suppose we have messenger like GTalk, Skype etc running on two different PCs(A and B) which have private IP addresses but connected to Internet through some ISP. The two PCs could be located in different parts of the world. Now its possible to send messages and make VoIP calls between A and B.
This obviously uses server for communication establishment. For text messages it could be routed through the server to reach A and B.
But for VoIP calls, I believe initial establishment would be taking help of server and later VoIP data would flow directly between A and B. Now, A and B both have private IP addresses.
So my question is how is it possible to communicate between A and B directly over the Internet who have private IP addresses ?
Is there any specific standard for this ? I am not talking about VoIP standard like RTP etc but the mechanism to communicate over Internet using private IP addresses. In other words, I simply have a TCP client and TCP server running on A and B respectively. How can TCP client reach TCP server ?
I would like to know if messengers like GTalk, Yahoo, Skype and many of the Android applications like Viber, Kakoa talk, WhatsApp etc use any specific standard for this. And I have seen that these work almost always, calls between A and B work, located anywhere in the world.
It would be nice if somebody can share the architecture and the concepts involved.
[I did read about concepts like STUN and hole punching. But I don't see any specific way. And there is no guarantee that these would work depending on the NAT behavior]
Thank you.

Router vs Switch (Network Address Translation) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I understand that a router uses NAT to translate the public IP we get from the ISP to say 300 local IPs. Does a switch perform the same function? If not, how's it different?
No, a switch cannot perform NAT and translate public(s) IP addresses into private addresses.
A switch is a network device that filters and forwards packets between LAN segments. Switches operate at the data link layer (layer 2). So, they are not aware of IP addresses which are network layer (layer 3). A switch keeps a record of the MAC addresses of all the devices connected to it. With this information, a switch can identify which system is sitting on which port. So when a frame is received, it knows exactly which port to send it to, without significantly increasing network response times.
Routers are network devices used to interconnect two different networks (with different IP addressing schemes).

Resources