Default gateways serve an important role in TCP/IP networking. They provide a default route for TCP/IP hosts to use when communicating with other hosts on remote networks.
Gateways, also called protocol converters, can operate at any network layer. The activities of a gateway are more complex than that of the router or switch as it communicates using more than one protocol.
The following illustration shows the role played by two default gateways (IP routers) for two networks: Network 1 and Network 2.
In order for Host A on Network 1 to communicate with Host B on Network 2, Host A first checks its routing table to see if a specific route to Host B exists. If there is no specific route to Host B, Host A forwards its TCP/IP traffic for Host B to its own default gateway, IP Router 1.
The same principle applies if Host B is sending to Host A. Without a specific route to Host A, Host B forwards any TCP/IP traffic destined for Host A to its own default gateway, IP Router 2.