数据包如何通过代理服务器到达Destination? [英] How packets reaches Destination through proxy servers?

查看:198
本文介绍了数据包如何通过代理服务器到达Destination?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对来自我的机器的数据包如何通过代理服务器到达目的地感到困惑。我的机器有一个内部网的私人IP,我们有一个公共IP代理服务器与世界通信。

I am confused about how packets from my machine reaches their destination through proxy servers. my machine has a private ip for intranet and we have a proxy server with public ip to talk to world.

所以我们这里有三个地址。

so we have three addresses here.

1) my private ip address
2) proxy server address
3) destination address (google.com)

现在在我发送的tcp数据包中我有源和目标端口来区分各种程序(比如mozilla,chrome,ie)在我的机器和目的地上。

now in the tcp packet that I send I have source and destination port to distinguish the various programs (like mozilla , chrome , ie) on my machine and destinations.

在ip网络层我有源和目的地地址。

in the ip network layer I have source and destination address.

我不知道http是否也有地址。

I don't know whether http also has addresses.

因此,当我的数据包离开我的机器时,它将包含哪个地址。这样它就可以通过其间的网关到达我的代理服务器。 ?

so when my packet leaves my machine, what address would it be containing. so that it reaches my proxy server through gateways in between. ?

一旦到达代理服务器,就可以使用NAT将其发送到目的地。
但我对它如何到达代理服务器感到困惑。

once it reaches proxy server, NAT can be used to send it to destination. but I am confused about how it reaches proxy server.

编辑:
我的数据包是否包含我的代理服务器的地址(本地私有)到达它?
我可以通过配置浏览器来更改我的代理服务器。一旦它离开我的机器我的数据包怎么知道它会去哪个代理服务器?

should my packet contain address of my proxy server (local private one) to reach it? I can change my proxy server by configuring my browser. how does my packet once it leaves my machine knows which proxy server it would go?

推荐答案

数据包根本没有达到目标。其中的数据作为代理和服务器之间新连接的一部分到达目标,在全新的数据包中,其大小和数量可能与下游连接中的数据不同。从服务器TCP的角度来看,它连接到代理,而不是下游客户端。

The packet doesn't reach the target at all. The data inside it reaches the target as part of a new connection between the proxy and the server, in completely new packets, whose size and number may be different from those in the downstream connection. From the server TCP's point of view it is connected to the proxy, not the downstream client.

这篇关于数据包如何通过代理服务器到达Destination?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆