0
$\begingroup$

I'm having some difficulty understanding ip addresses. Let's say:

Question Info:

private subnet 192.168.0.0/24

IP addresses 212.201.49.1-5

Now, a host 192.168.0.2:1234 retrieves a web page from the web server at 42.35.12.33.

Then, host 192.168.0.5:1234 retrieves a web page from the web server at 100.12.45.11

Answer Part:

Now, I have this information for first the request part:

internal

192.168.0.2:1234 (src)

42.35.12.33:80 (dest)

external:

212.201.49.1:1234 (src)

43.35.12.33:80 (dest)

Where does 80 come from at the end of dest?

Now, for the second request, the src address of external is 212.201.49.2:1234.

Why is it 2.1234? In the 3rd one, it was 1 again.

$\endgroup$
2
$\begingroup$

Usually writing an ip address and a number after the : ,it means the number after the : is the port

In the internal part: 192.168.0.2 is the private ip address of the host its his ip address inside the network,notice that we have 2 types of ip addresses: private ip address-which is the ip address inisde out network and public ip address which is our ip address in the "internet" so 192.168.0.2 its the private ip address of the host and the 1234 its the port of the client-the host

now the 42.35.12.33 is the ip address of the web page and the page listens to the port 80

In the external part: we can see the ip address of the host has changed,why has it changed?because what i said before about private and public ip addresses this-this ip is the external ip which the host was provided(i suggest reading about NAT if you want to understand this part deeper) the port of the host stays 1234

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ I have read and understood how NAT generally works. But my question was that where does the value 80 originate from in the answer? Is it like a standard value? Because no such value was given in the qs $\endgroup$ – x89 Apr 18 at 13:57
  • $\begingroup$ Its the port number the web page listens to $\endgroup$ – Noname Apr 18 at 16:36
  • $\begingroup$ For the first external req, the src is ``` 212.201.49.1:1234``` . This makes sense. Now the second external req, src is 212.201.49.2:1234 and the third is ``` 212.201.49.1:1234``` again. So why is this and changing? $\endgroup$ – x89 Apr 20 at 21:55
  • $\begingroup$ Read here about dynamic nat i think it will make things more clear for you:speedcheck.org/wiki/nat/#dynamic-nat $\endgroup$ – Noname Apr 21 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.