由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
EE版 - 问一个NAT地址转换的问题? (转载)
相关主题
请教一下wireless router的确实参与了internet的routing吗?How to use EXCEL to open TXT file
有没有干EE的现在被裁员的?HFSS基本问题一问
Re: Who have the data sheet of the 9-pin serial port?(上海美资)IC公司高薪招DSP Manager--待遇优厚!!--Update on Jul. 29, 2010
Re: 8250请问有人用ucos 的开发板吗?
Anybody knows how to translate these words?菜鸟问题:什么是贝叶斯方法
土问 layout的一个问题问个在threadx下开发做自动测试的事
有关Asynchronous FIFO和Dual port SRAM问一个NAT地址转换的问题?
Specman E, Unit之间的通信用Reference好还是Method Port好?问一个NAT地址转换的问题? (转载)
相关话题的讨论汇总
话题: nat话题: port话题: http话题: 80话题: internal
进入EE版参与讨论
1 (共1页)
s********k
发帖数: 6180
1
【 以下文字转载自 CS 讨论区 】
发信人: silverhawk (silverhawk), 信区: CS
标 题: 问一个NAT地址转换的问题?
发信站: BBS 未名空间站 (Thu Nov 27 21:36:38 2008)
NAT地址转换的机理是对内网(private network)的不同机子进行不同的port
forwarding吗?那假如在NAT里面有两台机子都对外面发送http(80)的邀请,在外面机
子看来,都看到NATrouter的ip(比如1.1.1.4),返回的包怎么被router正确发送到这
两个机子上的呢?
n********5
发帖数: 323
2
我的理解是 router 里面有个 table 完成转换的... 包含IP和port number.. 类似于
socket唯一确定某个application一样。。。
z*****n
发帖数: 7639
3
Actually, there are so-called NATs and PATs:
For a NAT, it has a set of public addresses,
and each internal host will be mapped one. So
it is called NAT (Address Translator).
For a PAT, it usually has one public address,
and each connection is mapped by
(publicIP:port<-->internalIP:port) couple. So
it is called PAT (port translator).
But many ppl don't distinguish these two things
and call them all NATs simply.
For your question: if two internal hosts both
send HTTP requests to an WWW server, th

【在 s********k 的大作中提到】
: 【 以下文字转载自 CS 讨论区 】
: 发信人: silverhawk (silverhawk), 信区: CS
: 标 题: 问一个NAT地址转换的问题?
: 发信站: BBS 未名空间站 (Thu Nov 27 21:36:38 2008)
: NAT地址转换的机理是对内网(private network)的不同机子进行不同的port
: forwarding吗?那假如在NAT里面有两台机子都对外面发送http(80)的邀请,在外面机
: 子看来,都看到NATrouter的ip(比如1.1.1.4),返回的包怎么被router正确发送到这
: 两个机子上的呢?

s********k
发帖数: 6180
4
谢谢,还是有点不是很明白的是。比如内网的机子发送http包的时候,port不是80?到
了NAT那里才被转换成80的?还有在例子中,如果
internalhost1IP:xxxx 和 internalhost2IP:xxxx 两个机子对同一个网站www.aaa.
com发送http(80) request, 那www.aaa.com返回的数据http response应该是指向
NAT的IP(1.1.1.4)80端口,NAT怎么区分倒是是给internalhost1IP还是
internalhost2IP呢?
z*****n
发帖数: 7639
5
No, the port number 80 is only for HTTP server.
The client, as I showed in previous example,
will always choose an ephemeral port (>2048)
to initiate the TCP connection.
Take this into consideration, the two internal
host will use port xxxx and yyyy respectively,
(xxxx and yyyy in most cases are different, of
course they can be equal, but this doesn't
do anything wrong), and send HTTP GET to
www.aaa.com's port 80.
At the NAT, the internal:external connections
are distinguished by both IPand PORT

【在 s********k 的大作中提到】
: 谢谢,还是有点不是很明白的是。比如内网的机子发送http包的时候,port不是80?到
: 了NAT那里才被转换成80的?还有在例子中,如果
: internalhost1IP:xxxx 和 internalhost2IP:xxxx 两个机子对同一个网站www.aaa.
: com发送http(80) request, 那www.aaa.com返回的数据http response应该是指向
: NAT的IP(1.1.1.4)80端口,NAT怎么区分倒是是给internalhost1IP还是
: internalhost2IP呢?

s********k
发帖数: 6180
6
谢谢zhaoyun,解释得非常清楚了。受教

【在 z*****n 的大作中提到】
: No, the port number 80 is only for HTTP server.
: The client, as I showed in previous example,
: will always choose an ephemeral port (>2048)
: to initiate the TCP connection.
: Take this into consideration, the two internal
: host will use port xxxx and yyyy respectively,
: (xxxx and yyyy in most cases are different, of
: course they can be equal, but this doesn't
: do anything wrong), and send HTTP GET to
: www.aaa.com's port 80.

1 (共1页)
进入EE版参与讨论
相关主题
问一个NAT地址转换的问题? (转载)Anybody knows how to translate these words?
一台机子里面的多个应用程序怎么竞争网络资源的?土问 layout的一个问题
mapping driver security question有关Asynchronous FIFO和Dual port SRAM
包子求篇论文Specman E, Unit之间的通信用Reference好还是Method Port好?
请教一下wireless router的确实参与了internet的routing吗?How to use EXCEL to open TXT file
有没有干EE的现在被裁员的?HFSS基本问题一问
Re: Who have the data sheet of the 9-pin serial port?(上海美资)IC公司高薪招DSP Manager--待遇优厚!!--Update on Jul. 29, 2010
Re: 8250请问有人用ucos 的开发板吗?
相关话题的讨论汇总
话题: nat话题: port话题: http话题: 80话题: internal