In a separate Nugget, we focused on port address translation.
And in this Nugget, I'd like to pick up on the same topology
and discuss network address translation
with a one-to-one mapping between a host on the inside
or DMZ of our network and the global routable internet.
So we can use the technique of port address translation
to translate lots and lots of hosts on the inside
to a single IP address on the outside.
But what if we have a server, like one of these guys
right here, that a user on the internet,
like Bob, needs to access?
To facilitate that, it's very likely we're
going to have a static hard-coded network address
translation.
And that implies a one-to-one relationship.
So if we have a server on the inside that
has a internal address on this DMZ of 10.7.0.77--
that's it's real IP address.
What we can do is, we could hard code that
to a routable address on the internet.
So if our internet service provider gave us 23.1.1.50,
we could statically configure a translation
on this router, this NAT router, between this inside address
and this globally-reachable address.
And that way, if Bob on the internet
makes a request to this global address,
the router says, oh, I know exactly where that goes.
The router translates that address over
to 10.7.0.77, and forwards the packet to that server.
So NAT is usually a one-to-one correlation
between one inside address and one outside address,
where port address translation is usually
a many-to-one scenario.
In the case of hundreds or thousands of computers
all being overloaded to a single, global routable
address, and the router using additional layer 4 information
and ports to keep track of all those translations.
So another question might come up, well,
what would this translation table
look like on a router doing network address translation
or port address translation?
And here's an example of just that.
This is from a Cisco router.
In this column, the pro doesn't mean it's not a amateur.
It means protocol.
So these are the various protocols that currently
have translations in place.
The one here at the bottom implies a static translation
for NAT.
This simply maps the internal resource of 10.7.0.77
to the global routable address of 23.1.1.50.
The inside local implies what the clients are really using.
So based on this translation, a client
on the inside at 10.1.0.11, very likely PC1,
used the source port of 23904.
And then when the router translated that and forwarded
the packet out to the outside, it
used the IP address of 23.1.1.1.
And it chose to use the port 4501.
So from the internet's perspective,
it looks like it's a client coming from the source IP
address of 23.1.1.1, with a source port of 4501--
although, the reality on the inside is this.
So when a reply comes back from that server on the internet,
the router would then untranslate that--
both the layer 4 and the layer 3 information--
so that when the client received that response,
it's what the client is expecting to receive back
from the server.
And we also have an entry from a client at 10.2.0.22.
That could very well be Computer 2, with a source port of 51553,
which got translated out to the global address of 23.1.1.1,
appearing to the internet to use a source port of 4097.
And because the layer 3 information
from both of these hosts are being
mapped to the same exact global address, the same routable
address of 23.1.1.1, this is an example of using PAT--
Port Address Translation.
And if we take a look at the static translation being
used between 10.7.0.77 and 23.1.1.50,
that bottom entry would be an example of NAT,
as far as the configuration on the router,
with a one-to-one relationship between the inside real address
and the mapped address.
And then we can also see with this line
right here that that translation currently
is in use on this router.
The router didn't need to translate anything at layer 4.
So the TCP source port that the client chose to use
is still being used as that packet is forwarded out
to the outside with its new source address of 23.1.1.50.
In this Nugget, we've taken a big-picture look
at the concepts of NAT and PAT.
I hope this has been informative for you.
And I'd like to thank you for viewing.