NAT将私网IP转换为公网IP的过程是哪些? NAT服务器将网内私有地址转换为合法的ip地址?

nat\u6280\u672f\u628a\u79c1\u7f51ip\u8f6c\u5316\u4e3a\u516c\u7f51ip,\u5982\u679c\u516c\u7f51\u6709\u8be5ip,\u4e0d\u662f\u8981\u5f15\u8d77ip\u51b2\u7a81?

\u53ea\u662f\u501f\u516c\u7f51ip\u4e0e\u5916\u754c\u8fdb\u884c\u901a\u4fe1\uff0c\u79c1\u7f51\u5185\u6240\u6709\u4e3b\u673a\u90fd\u5171\u7528\u4e00\u4e2a\u516c\u7f51ip\uff0c\u8fd9\u4e2aip\u5c31\u662fnat\u4e3b\u673a\u7684\u5730\u5740

nat\u6709\u4e09\u79cd\u5b9e\u73b0\u65b9\u5f0f\uff1a\u9759\u6001\u3001\u52a8\u6001\u548c\u7aef\u53e3\u591a\u8def\u590d\u7528\u3002

\u9759\u6001\u8f6c\u6362\u662f\u6307\u5c06\u5185\u90e8\u7f51\u7edc\u7684\u79c1\u6709IP\u5730\u5740\u8f6c\u6362\u4e3a\u516c\u6709IP\u5730\u5740\uff0cIP\u5730\u5740\u5bf9\u662f\u4e00\u5bf9\u4e00\u7684\uff0c\u662f\u4e00\u6210\u4e0d\u53d8\u7684\uff0c\u67d0\u4e2a\u79c1\u6709IP\u5730\u5740\u53ea\u8f6c\u6362\u4e3a\u67d0\u4e2a\u516c\u6709IP\u5730\u5740\u3002\u501f\u52a9\u4e8e\u9759\u6001\u8f6c\u6362\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5916\u90e8\u7f51\u7edc\u5bf9\u5185\u90e8\u7f51\u7edc\u4e2d\u67d0\u4e9b\u7279\u5b9a\u8bbe\u5907(\u5982\u670d\u52a1\u5668)\u7684\u8bbf\u95ee\u3002
\u3000\u3000\u52a8\u6001\u8f6c\u6362\u662f\u6307\u5c06\u5185\u90e8\u7f51\u7edc\u7684\u79c1\u6709IP\u5730\u5740\u8f6c\u6362\u4e3a\u516c\u7528IP\u5730\u5740\u65f6\uff0cIP\u5730\u5740\u5bf9\u662f\u4e0d\u786e\u5b9a\u7684\uff0c\u800c\u662f\u968f\u673a\u7684\uff0c\u6240\u6709\u88ab\u6388\u6743\u8bbf\u95ee\u4e0aInternet\u7684\u79c1\u6709IP\u5730\u5740\u53ef\u968f\u673a\u8f6c\u6362\u4e3a\u4efb\u4f55\u6307\u5b9a\u7684\u5408\u6cd5IP\u5730\u5740\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u53ea\u8981\u6307\u5b9a\u54ea\u4e9b\u5185\u90e8\u5730\u5740\u53ef\u4ee5\u8fdb\u884c\u8f6c\u6362\uff0c\u4ee5\u53ca\u7528\u54ea\u4e9b\u5408\u6cd5\u5730\u5740\u4f5c\u4e3a\u5916\u90e8\u5730\u5740\u65f6\uff0c\u5c31\u53ef\u4ee5\u8fdb\u884c\u52a8\u6001\u8f6c\u6362\u3002\u52a8\u6001\u8f6c\u6362\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5408\u6cd5\u5916\u90e8\u5730\u5740\u96c6\u3002\u5f53ISP\u63d0\u4f9b\u7684\u5408\u6cd5IP\u5730\u5740\u7565\u5c11\u4e8e\u7f51\u7edc\u5185\u90e8\u7684\u8ba1\u7b97\u673a\u6570\u91cf\u65f6\u3002\u53ef\u4ee5\u91c7\u7528\u52a8\u6001\u8f6c\u6362\u7684\u65b9\u5f0f\u3002
\u3000\u3000\u7aef\u53e3\u591a\u8def\u590d\u7528(Port address Translation,PAT)\u662f\u6307\u6539\u53d8\u5916\u51fa\u6570\u636e\u5305\u7684\u6e90\u7aef\u53e3\u5e76\u8fdb\u884c\u7aef\u53e3\u8f6c\u6362\uff0c\u5373\u7aef\u53e3\u5730\u5740\u8f6c\u6362(PAT\uff0cPort Address Translation).\u91c7\u7528\u7aef\u53e3\u591a\u8def\u590d\u7528\u65b9\u5f0f\u3002\u5185\u90e8\u7f51\u7edc\u7684\u6240\u6709\u4e3b\u673a\u5747\u53ef\u5171\u4eab\u4e00\u4e2a\u5408\u6cd5\u5916\u90e8IP\u5730\u5740\u5b9e\u73b0\u5bf9Internet\u7684\u8bbf\u95ee\uff0c\u4ece\u800c\u53ef\u4ee5\u6700\u5927\u9650\u5ea6\u5730\u8282\u7ea6IP\u5730\u5740\u8d44\u6e90\u3002\u540c\u65f6\uff0c\u53c8\u53ef\u9690\u85cf\u7f51\u7edc\u5185\u90e8\u7684\u6240\u6709\u4e3b\u673a\uff0c\u6709\u6548\u907f\u514d\u6765\u81eainternet\u7684\u653b\u51fb\u3002\u56e0\u6b64\uff0c\u76ee\u524d\u7f51\u7edc\u4e2d\u5e94\u7528\u6700\u591a\u7684\u5c31\u662f\u7aef\u53e3\u591a\u8def\u590d\u7528\u65b9\u5f0f\u3002

随着IPv6时代的到来,我也一直怀疑,是不是还有必要再去学习NAT技术——因为网络的资源不再如IPv4时代匮乏,而NAT技术正是为解决IP地址的紧缺而存在的,如此,NAT便没有存在的必要了。

但是,随着这篇文章的翻译,我的怀疑慢慢变成庆幸,渐而又变为肯定,通过翻译所学到的东西,不再仅仅是翻译第一手资料带来的成就感,更多的是通过翻译,去领悟技术前辈们的智慧与经验,也通过翻译,养成自己从第一手资料获得信息的习惯,从而将视野放得更宽,让理解更为透彻——至少,很多东西都是要经过仔细斟酌才真正转化为自己思想的一部分的。正是如此,我才坚定的要把这篇文章翻译完,也如之前所提到的,如果时间允许的话,我会用C#来写一些例子,让大家更好的理解NAT技术,掌握NAT技术(主要涉及到即时通讯、文件对等传输和语音应用三个方面)。

这篇文章主要是介绍一下“代理”机制的起因以及给P2P应用带来的不便,不需要任何基础知识:)

1. Introduction

1、简介

关键词:

middleboxe(s) —— 我翻译成“代理”,也许有更好的翻译

host —— 我翻译成“主机”,希望大家不要理解成服务器了,主机就是一台普通的终端机

Present-day Internet has seen ubiquitous deployment of "middleboxes" such as network address translators(NAT), driven primarily by the ongoing depletion of the IPv4 address space. The asymmetric addressing and connectivity regimes established by these middleboxes, however, have created unique problems for peer-to-peer (P2P) applications and protocols, such as teleconferencing and multiplayer on-line gaming. These issues are likely to persist even into the IPv6 world, where NAT is often used as an IPv4 compatibility mechanism [NAT-PT], and firewalls will still be commonplace even after NAT is no longer required.

在当今的Internet中,普遍存在使用“代理”设备来进行网络地址转换(NAT),导致这种现象的原因是 IPV4 地址空间的资源耗尽危机。虽然不对称 asymmetric 的地址分配和连通性制度已经在代理中被定义,但是却给端对端应用程序和协议制定造成了一些特殊的问题。像电话会议和多媒体网络游戏。这些问题即使在IPV6世界中还是会存在,因为NAT作为IPV4的一种兼容性机制经常被使用[NAT-PT],并且防火墙将仍然将普遍存在,即使不再需要NAT技术。

Currently deployed middleboxes are designed primarily around the client/server paradigm, in which relatively anonymous client machines actively initiate connections to well-connected servers having stable IP addresses and DNS names.

Most middleboxes implement an asymmetric communication model in which hosts on the private internal network can initiate outgoing connections to hosts on the public network, but external hosts cannot initiate connections to internal hosts except as specifically configured by the middlebox's administrator. In the common case of NAPT, a client on the internal network does not have a unique IP address on the public Internet, but instead must share a single public IP address, managed by the NAPT, with other hosts on the same private network.The anonymity and inaccessibility of the internal hosts behind a middlebox is not a problem for client software such as web browsers, which only need to initiate outgoing connections. This inaccessibility is sometimes seen as a privacy benefit.

当前使用的“代理”技术主要是为 客户端/服务端 C/S 结构设计的,为了实现那些需要连接但是又没有固定IP地址的客户端能够连接到一台配置好的拥有固定IP和DNS域名的服务器。
大多数的“代理”使用一种 asymmetric 通信模型,即 私网(局域网) 的主机能发起一个“外出”连接去连接公网上的主机。 但是公网上的主机却无法发送信息给私网上的主机(除非对“代理”进行特殊的配置),NAPT(网络地址端口转换)的普通情况是,一个私网客户端不需要一个公网的固定的IP地址,但是必须要共享一个由NAPT控制的公网的固定IP地址(当然这个NAPT是处于同一个私网内部的)。这样的话,这些匿名的并且看起来难以触及的藏在NAT之后的内网主机对于像 Web浏览器 这种软件来说就不是一个问题,因为内网的主机只需要发起向外部的连接就可以了。这样一来,无法触及也还是有他的优点的——那就是具有保密性。

In the peer-to-peer paradigm, however, Internet hosts that would normally be considered "clients" need to establish communication sessions directly with each other. The initiator and the responder might lie behind different middleboxes with neither endpoint having any permanent IP address or other form of public network presence. A common on-line gaming architecture, for example, is for the participating application hosts to contact a well-known server for initialization and administration purposes. Subsequent to this, the hosts establish direct connections with each other for fast and efficient propagation of updates during game play.

Similarly, a file sharing application might contact a well-known server for resource discovery or searching, but establish direct connections with peer hosts for data transfer. Middleboxes create problems for peer-to-peer connections because hosts behind a middlebox normally have no permanently usable public ports on the Internet to which incoming TCP or UDP connections from other peers can be directed.

RFC 3235 [NAT-APPL] briefly addresses this issue, but does not offer any general solutions.

然而,在P2P的应用中,Internet上的“客户机”之间是需要建立一个通信会话直连的。邀请者和响应者也许会处于不同的NAT之后,也许他们都没有固定IP或者即使有也不是公网的IP地址。举例来说,在一个普通的网络游戏体系结构中,都是通过客户端向一个具有公网固定IP的服务器发起申请进行初始化并通过验证的。同时,客户端之间也要建立直连,才使网络间传输的速度加快,保证数据即时更新(不然抢不到装备啊,呵呵)。

同样的,一个文件共享应用程序也必须通过到一个服务器上去查找它想要的资源,然后再到拥有这个数据的主机上去下载(BT网站,走了一个中介),“代理”造成了很多P2P直连的问题,因为藏在“代理”之后的的主机通常没有固定的端口来使其他的客户端发起的TCP或UDP连接能够最终到达。

RFC 3235[NAT-APPL] 简要的提到了这个问题,但是没有给出任何的解决方案。

In this document we address the P2P/middlebox problem in two ways. First, we summarize known methods by which P2P applications can work around the presence of middleboxes. Second, we provide a set of application design guidelines based on these practices to make P2P applications operate more robustly over currently-deployed middleboxes. Further, we provide design guidelines for future middleboxes to allow them to support P2P applications more effectively. Our focus is to enable immediate and wide deployment of P2P applications requiring to traverse middleboxes.

在这篇文章中,我们用两种方式讨论 P2P/代理 的问题。首先,概要的讲叙已有的P2P应用程序能够在现有的代理机制中的工作原理。然后,我们提供一组应用程序设计指南,基于已有的实践,在现有的配置好的代理上,来使得P2P应用程序操作更加有条理。最后,我们提供了设计指南,为以后的代理机制能够更方便支持P2P应用程序。讨论的焦点是如何 直接的、广泛的 配置那些需要经过“代理”的P2P应用程序。
Peer-to-Peer (P2P) communication across middleboxes(术语篇)

2. Terminology

2. 术语

In this section we first summarize some middlebox terms. We focus hereon the two kinds of middleboxes that commonly cause problems for P2P applications.

在这一章节中,首先概要的介绍一下“代理”技术的一些术语。然后集中讨论两种造成P2P应用问题的代理机制。

Firewall

A firewall restricts communication between a private internal network and the public Internet, typically by dropping packets that are deemed unauthorized. A firewall examines but does not modify the IP address and TCP/UDP port information in packets crossing the boundary.

防火墙

防火墙限制了私网与公网的通信,它主要是将(防火墙)认为未经授权的的包丢弃,防火墙只是检验包的数据,并不修改数据包中的IP地址和TCP/UDP端口信息。

Network Address Translator (NAT)

A network address translator not only examines but also modifies the header information in packets flowing across the boundary, allowing many hosts behind the NAT to share the use of a smaller number of public IP addresses (often one). Network address translators in turn have two main varieties:

网络地址转换(NAT)

当有数据包通过时,网络地址转换器不仅检查包的信息,还要将包头中的IP地址和端口信息进行修改。以使得处于NAT之后的机器共享几个仅有的公网IP地址(通常是一个)。网络地址转换器主要有两种类型:

Basic NAT

A Basic NAT maps an internal host's private IP address to a public IP address without changing the TCP/UDP port numbers in packets crossing the boundary. Basic NAT is generally only useful when the NAT has a pool of public IP addresses from which to make address bindings on behalf of internal hosts.

基础NAT

基础NAT 将私网主机的私有IP地址转换成公网IP地址,但并不将TCP/UDP端口信息进行转换。基础NAT一般用在当NAT拥有很多公网IP地址的时候,它将公网IP地址与内部主机进行绑定,使得外部可以用公网IP地址访问内部主机。(译者注:实际上是只将IP转换,192.168.0.23 <-> 210.42.106.35,这与直接设置IP地址为公网IP还是有一定区别的,特别是对于企业来说,外部的信息都要经过统一防火墙才能到达内部,但是内部主机又可以使用公网IP)

Network Address/Port Translator (NAPT)

By far the most common, a Network Address/Port Translator examines and modifies both the IP address and the TCP/UDP port number fields of packets crossing the boundary, allowing multiple internal hosts to share a single public IP address simultaneously.

Refer to [NAT-TRAD] and [NAT-TERM] for more general information on NAT taxonomy and terminology. Additional terms that further classify NAPT are defined in more recent work [STUN]. When an internal host opens an outgoing TCP or UDP session through a network address/port translator, the NAPT assigns the session a public IP address and port number so that subsequent response packets from the external endpoint can be received by the NAPT, translated, and forwarded to the internal host. The effect is that the NAPT establishes a port binding between (private IP address, private port number) and (public IP address, public port number).

The port binding defines the address translation the NAPT will perform for the duration of the session. An issue of relevance to P2P applications is how the NAT behaves when an internal host initiates multiple simultaneous sessions from a single (private IP, private port) pair to multiple distinct endpoints on the external network.

网络地址和端口转换 (NAPT)

这是最普遍的情况,网络地址/端口转换器检查、修改包的IP地址和TCP/UDP端口信息,这样,更多的内部主机就可以同时使用一个公网IP地址。

请参考[NAT-TRAD]和[NAT-TERM]两个文档了解更多的NAT分类和术语信息。另外,关于NAPT的分类和术语,[STUN]在最近做了更多的定义。当一个内部网主机通过NAT打开一个“外出”的TCP或UDP会话时,NAPT分配给这个会话一个公网IP和端口,用来接收外网的响应的数据包,并经过转换通知内部网的主机。这样做的效果是,NAPT在 [私有IP:私有端口] 和[公网IP:公网端口]之间建立了一个端口绑定。

端口绑定指定了NAPT将在这个会话的生存期内进行地址转换任务。这中间存在一个这样的问题,如果P2P应用程序从内部网络的一个[私有IP地址:端口]对同时发出多条会话给不同的外网主机,那么NAT会怎样处理呢?请看以下几种方案。

Cone NAT

After establishing a port binding between a (private IP, private port) tuple and a (public IP, public port) tuple, a cone NAT will re-use this port binding for subsequent sessions the application may initiate from the same private IP address and port number, for as long as at least one session using the port binding remains active.

锥形NAT

(译者注:为什么叫做锥形呢?请看以下图形,终端和外部服务器,都通过NAT分派的这个绑定地址对来传送信息,就象一个漏斗一样,筛选并传递信息)

当建立了一个 [私有IP:端口]-[公网IP:端口] 端口绑定之后,对于来自同一个[私有IP:端口]会话,锥形NAT服务器允许发起会话的应用程序 重复使用这个端口绑定,一直到这个会话结束才解除(端口绑定)。

For example, suppose Client A in the diagram below initiates two simultaneous outgoing sessions through a cone NAT, from the same internal endpoint (10.0.0.1:1234) to two different external servers, S1 and S2. The cone NAT assigns just one public endpoint tuple(元组), 155.99.25.11:62000, to both of these sessions, ensuring that the "identity" of the client's port is maintained across address translation. Since Basic NATs and firewalls do not modify port numbers as packets flow across the middlebox, these types of middleboxes can be viewed as a degenerate form of Cone NAT.

例如,假设 Client A(IP地址信息如上图所示)通过一个 锥形NAT 同时发起两个外出的连接,它使用同一个内部端口(10.0.0.1:1234)给公网的两台不同的服务器,S1和S2。锥形NAT 只分配一个公网IP和端口(155.99.25.11:62000)给这个两个会话,通过地址转换可以 确保 Client使用端口的“同一性”(译者注:即这个Client只使用这个端口)。而基础NATs和防火墙却不能修改经过的数据包端口号,它们可以看作是锥形NAT的精简版本。

Symmetric NAT

A symmetric NAT, in contrast, does not maintain a consistent port binding between (private IP, private port) and (public IP, public port) across all sessions.

Instead, it assigns a new public port to each new session. For example, suppose Client A initiates two outgoing sessions from the same port as above, one with S1 and one with S2. A symmetric NAT might allocate the public endpoint 155.99.25.11:62000 to session 1, and then allocate a different public endpoint 155.99.25.11:62001, when the application initiates session 2. The NAT is able to differentiate between the two sessions for translation purposes because the external endpoints involved in the sessions (those of S1 and S2) differ, even as the endpoint identity of the client application is lost across the address translation boundary.

对称NAT

对称NAT,与Cone NAT是大不相同的,并不对会话进行端口绑定,而是分配一个全新的 公网端口 给每一个新的会话。

还是上面那个例子:如果 Client A (10.0.0.1:1234)同时发起两个 "外出" 会话,分别发往S1和S2。对称Nat会分配公共地址155.99.25.11:62000给Session1,然后分配另一个不同的公共地址155.99.25.11:62001给Session2。对称Nat能够区别两个不同的会话并进行地址转换,因为在 Session1 和 Session2中的外部地址是不同的,正是因为这样,Client端的应用程序就迷失在这个地址转换边界线了,因为这个应用程序每发出一个会话都会使用一个新的端口,无法保障只使用同一个端口了。

The issue of cone versus symmetric NAT behavior applies equally to TCP and UDP traffic. Cone NAT is further classified according to how liberally the NAT accepts incoming traffic directed to an already-established (publicIP, public port) pair. This classification generally applies only to UDP traffic, since NATs and firewalls reject incoming TCP connection attempts unconditionally unless specifically configured to do otherwise.

在TCP和UDP通信中, (到底是使用同一个端口,还是分配不同的端口给同一个应用程序),锥形NAT和对称NAT各有各的理由。当然锥形NAT在根据如何公平地将NAT接受的连接直达一个已创建的地址对上有更多的分类。这个分类一般应用在Udp通信(而不是Tcp通信上),因为NATs和防火墙阻止了试图无条件传入的TCP连接,除非明确设置NAT不这样做。这些分类如下:

Full Cone NAT

After establishing a public/private port binding for a new outgoing session, a full cone NAT will subsequently accept incoming traffic to the corresponding public port from ANY external endpoint on the public network. Full cone NAT is also sometimes called "promiscuous" NAT.

全双工锥形NAT

当内部主机发出一个“外出”的连接会话,就会创建了一个 公网/私网 地址,一旦这个地址对被创建,全双工锥形NAT会接收随后任何外部端口传入这个公共端口地址的通信。因此,全双工锥形NAT有时候又被称为"混杂"NAT。

Restricted Cone NAT

A restricted cone NAT only forwards an incoming packet directed to a public port if its external (source) IP address matches the address of a node to which the internal host has previously sent one or more outgoing packets. A restricted cone NAT effectively refines the firewall principle of rejecting unsolicited incoming traffic, by restricting incoming traffic to a set of "known" external IP addresses.

受限制的锥形NAT

受限制的锥形NAT会对传入的数据包进行筛选,当内部主机发出“外出”的会话时,NAT会记录这个外部主机的IP地址信息,所以,也只有这些有记录的外部IP地址,能够将信息传入到NAT内部,受限制的锥形NAT 有效的给防火墙提炼了筛选包的原则——即限定只给那些已知的外部地址“传入”信息到NAT内部。

Port-Restricted Cone NAT

A port-restricted cone NAT, in turn, only forwards an incoming packet if its external IP address AND port number match those of an external endpoint to which the internal host has previously sent outgoing packets. A port-restricted cone NAT provides internal nodes the same level of protection against unsolicited incoming traffic that a symmetric NAT does, while maintaining a private port's identity across translation.

端口受限制的Cone NAT

端口受限制的锥形NAT,与受限制的锥形NAT不同的是:它同时记录了外部主机的IP地址和端口信息,端口受限制的锥形NAT给内部节点提供了同一级别的保护,在维持端口“同一性”过程中,将会丢弃对称NAT传回的信息。

Finally, in this document we define new terms for classifying the P2P-relevant behavior of middleboxes:

最后,在这篇文档里我们将定义一组新的术语 ,以便更好的对P2P代理相关的行为进行分类。

P2P应用程序

P2P应用程序是指,在已有的一个公共服务器的基础上,并分别利用自己的私有地址或者公有地址(或者两者兼备)来建立一个端到端的会话通信。

P2P-Application

P2P-application as used in this document is an application in which each P2P participant registers with a public registration server, and subsequently uses either its private endpoint, or public endpoint, or both, to establish peering sessions.

P2P-Middlebox

A P2P-Middlebox is middlebox that permits the traversal of P2P applications.

P2P代理

P2P代理是一个允许 P2P应用程序进行通信的代理机制

P2P-firewall

A P2P-firewall is a P2P-Middlebox that provides firewall functionality but performs no address translation.

P2P防火墙

P2P防火墙是一个提供了防火墙的功能的P2P代理,但是不进行地址转换.

P2P-NAT

A P2P-NAT is a P2P-Middlebox that provides NAT functionality, and may also provide firewall functionality. At minimum, a P2P-Middlebox must implement Cone NAT behavior for UDP traffic, allowing applications to establish robust P2P connectivity using the UDP hole punching technique.

P2P-NAT

P2P-NAT 是一个 P2P代理,提供了NAT的功能,也提供了防火墙的功能,一个最简的P2P代理必须具有 锥形NAT对Udp通信支持的功能,并允许应用程序利用Udp打洞技术建立强健的P2P连接。

Loopback translation

When a host in the private domain of a NAT device attempts to connect with another host behind the same NAT device using the public address of the host, the NAT device performs the equivalent of a "Twice-nat" translation on the packet as follows. The originating host's private endpoint is translated into its assigned public endpoint, and the target host's public endpoint is translated into its private endpoint, before the packet is forwarded to the target host. We refer the above translation performed by a NAT device as "Loopback translation".

回环转换

当NAT的私网内部机器想通过公共地址来访问同一台局域网内的机器的时,NAT设备等价于做了两次NAT的事情,在包到达目标机器之前,先将私有地址转换为公网地址,然后再将公网地址转换回私有地址。我们把具有上叙转换功能的NAT设备叫做“回环转换”设备。

要详细说的话会很长而且比较难理解的,而且我是手打的比较累哦,简单说吧,
地址转换分两种
1,NAT
2,PAT
我们平时共享上网其实是应用了PAT((端口地址转换)
就是在支持NAT,PAT的路由器或者NAT机上添加对应地址的地址转换表(就是内网IP和公网IP加上端口号的对照表),当有数据从外网或者从内网互相进出的时候,路由就对照一下地址表,找到对应地址的话就把数据包里的目的IP地址从原来的公网地址变成对应的内网地址和端口,这样就可以成功的传到目的主机上了,而当几台电脑同时用同一个公网IP地址发送数据的时候,就根据不同的端口来判断是哪个连接,如果源端口相同就自动更改源端口

c

  • NAT灏嗙缃慖P杞崲涓哄叕缃慖P鐨勮繃绋嬫槸鍝簺?
    绛旓細鎴戜滑鐭ラ亾,NAT鐨勫姛鑳芥槸灏嗙缃慖P鍦板潃杞崲鎴愬叕缃慖P鍦板潃,浣NAT灏嗙缃慖P杞崲涓哄叕缃慖P鐨勮繃绋嬫槸鍝簺?鎴戣璇︾粏鐨勭瓟妗..鏈夎皝鑳借窡鎴戠殑璇磋鍚?閲嶅... 鎴戜滑鐭ラ亾,NAT鐨勫姛鑳芥槸灏嗙缃慖P鍦板潃杞崲鎴愬叕缃慖P鍦板潃,浣哊AT灏嗙缃慖P杞崲涓哄叕缃慖P鐨勮繃绋嬫槸鍝簺?鎴戣璇︾粏鐨勭瓟妗..鏈夎皝鑳借窡鎴戠殑璇磋鍚?閲嶅 灞曞紑  鎴戞潵绛 3涓...
  • 婧nat鍜岀洰鐨刵at鐨勫尯鍒
    绛旓細鐩殑NAT锛堝钩鏃跺彨鐨勭鍙f槧灏勶級锛氬簲鐢ㄤ簬灞鍩熺綉鏋惰瀵瑰鏈嶅姟锛坵eb鏈嶅姟锛夊満鏅紝涓涓鍏綉ip鍙互鎻愪緵N涓紙绔彛鍙凤級鏈嶅姟銆2銆杞崲璺緞涓嶅悓 婧怤AT锛绉佺綉鍒板叕缃戠殑杞崲锛堢缃戣闂叕缃戯紝鐩殑ip娌″彉锛屽彧杞崲浜嗘簮ip锛夈傜洰鐨凬AT锛氬叕缃戝埌绉佺綉鐨勮浆鎹紙鍏綉璁块棶绉佺綉锛屾簮鍦板潃娌″彉锛屽彧杞崲浜嗙洰鐨刬p锛夛紝涔熷彨绔彛鏄犲皠銆3...
  • 婧nat鍜岀洰鐨刵at鏈変粈涔堜笉鍚?
    绛旓細涓銆佹寚浠d笉鍚 1銆佹簮nat锛绉佺綉鍒板叕缃戠殑杞崲锛堢缃戣闂叕缃戯紝鐩殑ip娌″彉锛屽彧杞崲浜嗘簮ip锛2銆佺洰鐨刵at锛氬叕缃戝埌绉佺綉鐨勮浆鎹紙鍏綉璁块棶绉佺綉锛屾簮鍦板潃娌″彉锛屽彧杞崲浜嗙洰鐨刬p锛夛紝涔熷彨绔彛鏄犲皠銆備簩銆佸簲鐢ㄤ笉鍚 1銆佹簮nat锛氬簲鐢ㄤ簬灞鍩熺綉涓婄綉浣跨敤锛屾湁澶氫釜鍏綉ip鐨鎯呭喌涓嬨2銆佺洰鐨刵at锛氬簲鐢ㄤ簬灞鍩熺綉鏋惰瀵瑰鏈嶅姟锛...
  • 灏嗗唴閮ㄤ笓鐢IP鍦板潃杞崲涓澶栭儴鍏敤IP鍦板潃鐨勬妧鏈槸
    绛旓細姝g‘绛旀鏄疊銆NAT NAT鍙互鐢ㄥ皯鏁板嚑涓敋鑷充竴涓閮ㄥ叕鐢鐨処P鍦板潃鏄犲皠澶氫釜鍐呴儴涓绘満鍦板潃銆
  • NAT鏄綉缁滃湴鍧杞崲鍗忚,鏄妸鍐呴儴缃戠粶鍦板潃杞崲鎴愪负涓涓鍏綉鍦板潃,璁╁唴閮...
    绛旓細缃戠粶鍦板潃杞崲(NAT,Network Address Translation)灞炴帴鍏骞垮煙缃(WAN)鎶鏈,鏄竴绉灏嗙鏈(淇濈暀)鍦板潃杞寲涓鍚堟硶IP鍦板潃鐨勮浆鎹㈡妧鏈,瀹冭骞挎硾搴旂敤浜庡悇绉嶇被鍨婭nternet 鎺ュ叆鏂瑰紡鍜屽悇绉嶇被鍨嬬殑缃戠粶涓傚師鍥犲緢绠鍗曪紝NAT涓嶄粎瀹岀編鍦拌В鍐充簡lP鍦板潃涓嶈冻鐨勯棶棰橈紝鑰屼笖杩樿兘澶熸湁鏁堝湴閬垮厤鏉ヨ嚜缃戠粶澶栭儴鐨勬敾鍑伙紝闅愯棌骞朵繚鎶ょ綉缁滃唴閮ㄧ殑...
  • 浠涔堟槸NAT,甯歌鍒嗕负閭e嚑绉,DNAT涓嶴NAT鏈変粈涔堜笉鍚,搴旂敤浜嬩緥鏈夐偅浜...
    绛旓細涓昏鐢ㄤ簬鍐呴儴鍏变韩IP璁块棶澶栭儴銆3銆佸綋鍐呴儴闇瑕佹彁渚涘澶栨湇鍔℃椂锛堝瀵瑰鍙戝竷web缃戠珯锛夛紝澶栭儴鍦板潃鍙戣捣涓诲姩杩炴帴锛岀敱璺敱鍣ㄦ垨鑰呴槻鐏涓婄殑缃戝叧鎺ユ敹杩欎釜杩炴帴锛岀劧鍚庡皢杩炴帴杞崲鍒板唴閮紝姝よ繃绋嬫槸鐢卞甫鏈鍏綉IP鐨缃戝叧鏇夸唬鍐呴儴鏈嶅姟鏉ユ帴鏀跺閮ㄧ殑杩炴帴锛岀劧鍚庡湪鍐呴儴鍋氬湴鍧杞崲锛屾杞崲绉颁负DNAT锛屼富瑕佺敤浜庡唴閮ㄦ湇鍔″澶栧彂甯冦
  • 璺敱鍣NAT浠涔堟剰鎬?
    绛旓細鐧惧害鐧剧涓殑瑙i噴鏄NAT锛圢etwork Address Translation锛岀綉缁滃湴鍧杞崲锛夋槸1994骞存彁鍑虹殑銆傚綋鍦ㄤ笓鐢ㄧ綉鍐呴儴鐨勪竴浜涗富鏈烘湰鏉ュ凡缁忓垎閰嶅埌浜嗘湰鍦癐P鍦板潃锛堝嵆浠呭湪鏈笓鐢ㄧ綉鍐呬娇鐢ㄧ殑涓撶敤鍦板潃锛夛紝浣嗙幇鍦ㄥ張鎯冲拰鍥犵壒缃戜笂鐨勪富鏈洪氫俊锛堝苟涓嶉渶瑕佸姞瀵嗭級鏃讹紝鍙娇鐢∟AT鏂规硶銆傗濈畝鍗曟潵璇村氨鏄妸浣犵數鑴戠殑绉佺綉IP鍦板潃杞崲鎴愬叕缃慖P...
  • 璺敱鍣NAT妯″紡鍜岃矾鐢辨ā寮忕殑鍖哄埆
    绛旓細璺敱妯″紡锛氭墍鏈夋暟鎹笉杩涜NAT杞彂锛岀洿鎺ュ皢鍐呯綉IP涓嶅仛浼鐨勪紶閫佸埌澶栫綉銆傝矾鐢卞櫒鍚勪釜鎺ュ彛閰嶇疆涓嶅悓缃戞鐨処P鍦板潃浠嶅彲浠ョ洿鎺ョ浉浜掕闂紝涓旀簮IP涓嶄細琚杞崲銆傜被浼间簬涓夊眰浜ゆ崲鏈虹殑搴旂敤锛屽彲浠ュ簲鐢ㄥ湪灞鍩熺綉瀹炵幇鍒掑垎涓嶅悓缃戞銆2銆佷粠鍔熻兘涓 NAT妯″紡涓嶄粎鑳借В鍐充簡IP鍦板潃涓嶈冻鐨勯棶棰橈紝鑰屼笖杩樿兘澶熸湁鏁堝湴閬垮厤鏉ヨ嚜缃戠粶澶栭儴鐨勬敾鍑...
  • 鍏綉IP鍜屽唴缃慖P鏈変粈涔堝尯鍒
    绛旓細NAT璁惧浼灏嗙缃慖P鍦板潃杞崲涓哄叕缃慖P鍦板潃锛屼粠鑰屽疄鐜颁笌鍏叡浜掕仈缃戠殑閫氫俊銆傛讳箣锛屽叕缃慖P鍦板潃鏄叏鐞冨敮涓鐨勶紝鐢ㄤ簬鍦ㄥ叏鐞冭寖鍥村唴杩涜閫氫俊锛岃岀缃慖P鍦板潃鍒欐槸鍦ㄥ眬鍩熺綉鍐呴儴浣跨敤鐨勶紝鍙敤浜庡眬鍩熺綉涓殑璁惧涔嬮棿杩涜閫氫俊銆傝繖涓ょIP鍦板潃鐨勪綔鐢ㄦ槸涓嶅悓鐨勶紝瀹冧滑鐨勪娇鐢ㄨ寖鍥翠篃涓嶅悓銆---FunNet瓒呮湁瓒e缃戠粶 ...
  • 本站交流只代表网友个人观点,与本站立场无关
    欢迎反馈与建议,请联系电邮
    2024© 车视网