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$

1 Answer 1

1
$\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

$\endgroup$
4
  • $\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
    Commented Apr 18, 2020 at 13:57
  • $\begingroup$ Its the port number the web page listens to $\endgroup$
    – Noname
    Commented Apr 18, 2020 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
    Commented Apr 20, 2020 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
    Commented Apr 21, 2020 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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