LambdaLabTM
Computer Networks · Class 12 · Network Devices
networksdevices⏱️ 5 min read

Gateway

A school has a boundary wall and a main gate. Everyone coming in or going out uses that gate, and a guard there decides who may enter. A network has a gate too.

1What a gateway is

Gateway
A gateway is a network device that acts as the entry and exit point of a network. All data coming into the network or going out of it passes through the gateway. It connects networks that work by different rules (protocols), converting data from one to the other.

2What “different protocols” means

Two devices can only talk if they agree on how to talk: how a message is packed, how it is addressed, and how to say “got it”. That agreed set of rules is called a protocol. Protocols have a chapter of their own later; for now, think of a protocol as a network’s language.

The same message, two different rules

Write the date 04/09/2026. In India, the rule is day/month/year, so it means 4 September. In the USA, the rule is month/day/year, so the very same digits mean 9 April. Nothing is wrong with the message — the two sides just follow different rules. Something in between has to rewrite it as 09/04/2026 before it crosses over. For networks, that something is the gateway.

Networks that follow different protocols cannot understand each other’s data directly, however well they are cabled together. Three real examples:

💡 Smart bulbs

Many smart bulbs talk to each other by Zigbee, a low-power radio protocol. Your phone uses Wi-Fi and the Internet’s protocols. A small hub plugged into the home router is the gateway: it turns “switch on” from the app into a Zigbee message the bulb understands.

📞 Internet call to a landline

An internet calling app sends your voice as VoIP data over the Internet. An old landline follows the telephone network’s rules. A VoIP gateway converts one into the other, so the call can ring an ordinary telephone.

📱 SMS to email

An SMS travels by the mobile network’s rules. Email travels by email protocols. An SMS-to-email gateway rewrites the text message as an email, so it can land in an inbox.

Same protocol? Then no converting is needed
Your school network and the Internet both follow the same Internet protocols. Data can pass between them without being rewritten, so a router is enough. A gateway’s converting job is needed only when the two sides follow different protocols, as in the three examples above.

In the lab below, the school network and the network outside are imagined to follow different rules. Violet cubes are data packed the school’s way; cyan balls are data packed the outside network’s way. Watch the gateway convert one into the other.

The way in and out

Pick a case and press Play. Drag sideways to look round the gateway.

A message leaves the school. It must pass through the gateway, which converts it from the school network's protocol to the protocol of the network outside.

3What a gateway does

  • Is the one way in and out. Every message between this network and any other network passes through it.
  • Joins different kinds of networks. It converts data from one network’s protocol to the other’s.
  • Routes data outward. It sends data on towards other networks, much as a router does.
  • Usually has a firewall. Because everything passes through it, the gateway is the natural place for a firewall, which stops data the network does not allow.
Hardware, software, or both
A gateway is a job more than a particular box. It can be a device, a program running on a computer, or both. In most schools and homes, the router at the edge of the network is the entry and exit point — people call it the “default gateway” — which is why the lab shows a router in the doorway. When the two sides also follow different protocols, the gateway converts between them as well.

4Gateway vs router

The two are often confused, and exam papers ask for the difference.

RouterGateway
Main jobSends data between networks along the best routeIs the entry and exit point of a network
Networks it joinsDifferent networks that use the same protocolNetworks that use different protocols
Converts protocols?NoYes
ExampleSchool network ↔ Internet (both use Internet protocols)Zigbee smart bulbs ↔ Wi-Fi phone app
Where it isAnywhere networks meetAt the edge of a network

5Check yourself

Quick Check

Which device connects two networks that use different protocols?

Quick Check

Smart bulbs talk Zigbee; a phone app talks Wi-Fi. Which device lets the app switch the bulbs on?

Quick Check

Why is a firewall usually placed at the gateway?