What is a gateway and its role

write picture description here

Gateway (Gateway) is also known as the Internet connector, protocol converter. The gateway is on the transport layer to realize network interconnection and is the most complex network interconnection device, and is only used for the interconnection of two networks with different high-level protocols. The structure of the gateway is also similar to that of the router, the difference is the interconnection layer. Gateways can be used for both WAN interconnection and LAN interconnection. A gateway is a computer system or device that acts as a switch. A gateway is a translator between two systems using different communication protocols, data formats or languages, or even completely different architectures. Unlike bridges that simply communicate information, gateways repackage the received information to suit the needs of the destination system. At the same time, the gateway can also provide filtering and security functions. Most gateways operate on the top layer of the OSI 7 layer protocol – the application layer.

  Everyone knows that when you go from one room to another, you must pass through a door. Similarly, sending information from one network to another must also pass through a "gateway", which is the gateway. As the name suggests, a gateway is a "gateway" that connects one network to another.

  In OSI, there are two kinds of gateways: one is connection-oriented gateway and the other is connectionless gateway. When there is a certain distance between two subnets, a gateway is often divided into two halves, and the middle is connected by a link, which is called a half gateway.

  According to different classification standards, there are many kinds of gateways. The gateway in the TCP/IP protocol is the most commonly used. The "gateway" we talk about here refers to the gateway under the TCP/IP protocol.

  So what exactly is a gateway? A gateway is essentially an IP address from one network to other networks. For example, there are network A and network B, the IP address range of network A is "192.168.1.1~192.168.1.254", the subnet mask is 255.255.255.0; the IP address range of network B is "192.168.2.1~192.168. 2.254” and the subnet mask is 255.255.255.0. In the absence of a router, TCP/IP communication cannot be performed between the two networks. Even if the two networks are connected to the same switch (or hub), the TCP/IP protocol will be based on the subnet mask (255.255). .255.0) determines that the hosts in the two networks are in different networks. To realize the communication between these two networks, it must go through the gateway. If the host in network A finds that the destination host of the data packet is not in the local network, it forwards the data packet to its own gateway, and then the gateway forwards it to the gateway of network B, and the gateway of network B forwards it to a certain network B. host (as shown in the attached image). The process of forwarding data packets from network B to network A.

  Therefore, only by setting the IP address of the gateway, the TCP/IP protocol can realize the mutual communication between different networks. So which machine's IP address is this IP address? The IP address of the gateway is the IP address of the device with routing function. The device with routing function includes router, server with routing protocol enabled (essentially equivalent to a router), and proxy server (also equivalent to a router).

  In the context of interoperating with Novell NetWare networks, the gateway acts as a bridge between the Server Message Block (SMB) protocol used in Windows networks and the NetWare Core Protocol (NCP) used by NetWare networks. Gateways are also known as IP routers. 
[edit this paragraph] What is the default gateway

  If you know what a gateway is, the default gateway will be easy to understand. Just as a room can have multiple doors, a host can have multiple gateways. The default gateway means that if a host cannot find an available gateway, it will send the data packet to the default designated gateway, and this gateway will process the data packet. The gateway used by the host now generally refers to the default gateway. 
[Edit this paragraph] The role of the gateway and the popular explanation of the workflow

  Suppose your name is Xiaobudian, you live in a large yard, your neighbors have many friends, and there is an uncle Li who guards the gate in the reception room at the entrance. Uncle Li is your gateway. When you want to play with a friend in the yard, as long as you shout his name in the yard, he will respond to you and run out to play with you.

  But you are not allowed to go out of the gate. Everything you want to contact with the outside world must be contacted by Uncle Li (gateway) at the gate. If you want to chat with your classmate Xiao Ming, Xiao Ming's family lives in another yard far away, and there is also a gatekeeper Wang Uncle (Xiao Ming's gateway) in his yard. But you don't know the phone number of Xiaoming's house, but your head teacher has a list of all the students in your class and a phone number comparison table, and your teacher is your DNS server. So you called Uncle Li's number at the door at home, and had the following conversation:

  Little Dot: Uncle Li, can I find Xiao Ming's phone number with the head teacher?

  Uncle Li: Okay, you wait. (Then Uncle Li hung up your head teacher and asked Xiao Ming's phone number) I asked, his number is 211.99.99.99

  Tiny: Great! Uncle Li, I want to find Xiao Ming, please help me contact Xiao Ming again.

  Uncle Li: No problem. (Then Uncle Li sent a request to the telephone bureau to connect the phone of Xiaoming's house. Of course, the last level was transferred to Uncle Wang in the courtyard of Xiaoming's house, and then Uncle Wang transferred the call to Xiaoming's house.)

  That's how you got in touch with Xiaoming

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325164732&siteId=291194637