The full name of OSI is Open Systems Interconnect, a general communication protocol introduced by ISO (International Organization for Standardization) in response to the situation that every network company was a private network protocol, so, you can use residential proxy to buy, and that the competition was not compatible with each other.
However, the reality of OSI is cruel and was eventually defeated in the market competition by the TCP/IP four-layer protocol. By now, the entire Internet is based on the TCP/IP protocol stack.
The five-layer model is a combination of OSI and TCP/IP, designed to facilitate the introduction of computer networking principles, and the actual industrial use of the TCP/IP four-layer protocol.
Two types of proxies from PrivateProxy
Generally speaking, are directly called “proxies”, what is a proxy?
Forward proxy means that the user uses a proxy server to access the target server. The main uses of forwarding proxy are as follows.
Access to the “404” website
In this case, it is similar to the hungry “errand shopping”, we can not directly buy cigarettes online through this type of ban on online sales or not in the delivery platform on the shelves of goods (404), but we can go through the rider (proxy server), to the designated store (target server) to buy what we need (target resources), delivered to us.
The more common is the “online game gas pedal”, such as “chicken” such foreign game producer’s game server is generally deployed in foreign countries, and in our home network environment if the game is direct, “delay” “lag” will be accompanied by our entire game process.
By connecting to the proxy server provided by the game gas pedal and using the optimized or even dedicated network between the proxy server and the target game server, we can happily “eat chicken”.
The forward proxy is for the user, while the reverse proxy is for the target server, which means that the server uses the proxy server to provide services to the user.
Compared with the forward proxy, both use proxy servers, but the subject of the reverse proxy is the server, so the reverse proxy is transparent to the user, in the user’s view, the proxy server is the target server.
Similar to the hungry “Star Delivery” service, we (users) want to drink coffee when we do not need to know which square near us and which corner there is a Starbucks (target server), we just need to open the special Star Delivery (proxy server), the direct order is, it will automatically allocate the right store to provide us with coffee.
From the above example, we can imagine that the reverse proxy can be used in practice to protect and hide the Starbucks store that really provides the service, and also to provide load balancing for the user’s needs when the regional branch is bursting with orders or out of business, and automatically assign the orders to the nearby stores.
See now, you can find that opening a chart, anyway, is not much use.
Next, we analyze this network architecture to briefly understand the technical principles of the agent.
Four-layer agent (L4 Switch, four-layer switch)
This four-layer refers to the “transport layer”, our four-layer proxy server will receive data messages after the unpacking work, and only to the fourth layer of the transport layer.
In addition to the data packet unpacked in the transport layer, including the data packet required by the application layer, the port information is included in the header information, and then combined with the IP obtained from the network layer unpacking, usually based on this IP + PORT to get the actual target server information, and then modify the IP address of the message to the IP address of the target server information.
So, if the data message is a TCP connection, the client will eventually establish a connection with the real target server.
Layer 7 Proxy (L7 Switch)
A seven-layer proxy is a proxy that unpacks the application layer and then determines the target server based on the application layer data characteristics. For example, Nginx is the server software we often use to build a seven-layer proxy. When we access a URL, Nginx makes a determination based on the URL and assigns the request to the target server.
Because seven-tier proxies rely on application-layer information when users access a website, they first establish a connection with a seven-tier proxy server with three handshakes, then send a specific request message to the proxy server, which then establishes a connection with the target server with three handshakes, and then the proxy server accesses the target server.
Other layers of proxies
- Since there are four-tier and seven-tier proxies, there are of course two-tier and three-tier proxies
- Layer 2 proxies are based on the MAC address of data link layer messages (generally known as Layer 2 forwarding)
- Layer 3 proxies complete the data exchange based on the IP address of the network layer messages
The above is just a brief introduction to the principles of common proxies through the computer network architecture and layered data messages, interested parties can also continue to understand the other issues.
- A reverse proxy is the opposite of a forward proxy, in that the proxy server is like the original server to the client, and the client does not need to do any special setup. The client sends a normal request to the content in the namespace of the reverse proxy, and then the reverse proxy determines where to forward the request (the original server) and returns the obtained content to the client.
- In order to compare forward and reverse proxies more graphically, I found a very graphic image on the web.
- In a forward proxy, the proxy and the client belong to the same LAN and are transparent to the server.
- In the reverse proxy, the proxy and the server belong to the same LAN, transparent to the client.
- Or, there is a pithy jingle: Forward proxy proxies the client, reverse proxy proxies the server.