A gateway is a piece of networking hardware or software used in telecommunications networks that allows data to flow from one discrete network to another. Gateways are distinct from routers or switches in that they communicate using more than one protocol to connect multiple networks[1][2] and can operate at any of the seven layers of the open systems interconnection model (OSI).
The term gateway can also loosely refer to a computer or computer program configured to perform the tasks of a gateway, such as a default gateway or router, and in the case of HTTP, gateway is also often used as a synonym for reverse proxy.[3]
A network gateway provides a connection between networks and contains devices, such as protocol translators, impedance matchers, rate converters, fault isolators, or signal translators. A network gateway requires the establishment of mutually acceptable administrative procedures between the networks using the gateway. Network gateways, known as protocol translation gateways or mapping gateways, can perform protocol conversions to connect networks with different network protocol technologies. For example, a network gateway connects an office or home intranet to the Internet. If an office or home computer user wants to load a web page, at least two network gateways are accessed—one to get from the office or home network to the Internet and one to get from the Internet to the computer that serves the web page.
On an Internet Protocol (IP) network, IP packets with a destination outside a given subnet mask are sent to the network gateway. For example, if a private network has a base IPv4 address of 192.168.1.1 and has a subnet mask of 255.255.255.0, then any data addressed to an IP address outside of 192.168.1.0 is sent to the network gateway. IPv6 networks work in a similar way. While forwarding an IP packet to another network, the gateway may perform network address translation.
In enterprise networks, a network gateway usually also acts as a proxy server and a firewall.[4]
On Microsoft Windows, the Internet Connection Sharing feature allows a computer to act as a gateway by offering a connection between the Internet and an internal network.[5][6]
Source: https://en.wikipedia.org/wiki/Gateway_(telecommunications)