Default gateway

Default gateway


In computer networking, a gateway is a node (a router) on a TCP/IP network that serves as an access point to another network. A default gateway is the node on the computer network that the network software uses when an IP address does not match any other routes in the routing table.

In home computing configurations, an ISP often provides a physical device which both connects local hardware to the Internet and serves as a gateway. Such devices include DSL modems and cable modems.

In organizational systems a gateway is a node that routes the traffic from a workstation to another network segment. The default gateway commonly connects the internal networks and the outside network (Internet). In such a situation, the gateway node could also act as a proxy server and a firewall. The gateway is also associated with both a router, which uses headers and forwarding tables to determine where packets are sent, and a switch, which provides the actual path for the packet in and out of the gateway.

In other words, a default gateway provides an entry point and an exit point in a network.

Contents

Example1

An office network consists of six hosts and a router is given as:

Hosts addresses:

  • 192.168.4.3
  • 192.168.4.4
  • 192.168.4.5
  • 192.168.4.6
  • 192.168.4.7
  • 192.168.4.8

Router (this side) address:

  • 192.168.4.1

The network has a subnet mask of:

  • 255.255.255.0 (/24 in CIDR notation)

Thus the usable network ranges from addresses 192.168.4.1 to 192.168.4.254. (TCP/IP defines the addresses 192.168.4.0 and 192.168.4.255 for special functions.)

The office's hosts will send packets addressed to IPs within this range directly, by resolving the destination IP address into a MAC address through an ARP sequence (if not already known through the host's ARP cache) and then enveloping the IP packet into a layer 2 (MAC) packet addressed to the destination host.

Packets addressed outside of this range (for this example, a packet addressed to 192.168.12.3) cannot travel directly to the destination. Instead they must be sent to the default gateway for further routing to their ultimate destination. In this example, the default gateway uses the IP address 192.168.4.1, which is resolved into a MAC address with ARP in the usual way. Note that the destination IP address remains 192.168.12.3, but the next-hop physical address is that of the gateway, rather than of the ultimate destination.

Example2

A network with three routers and three hosts, connected to the Internet through router1.

Hosts and addresses:

  • PC1 10.1.1.100, default gateway 10.1.1.1
  • PC2 172.16.1.100, default gateway 172.16.1.1
  • PC3 192.168.1.100, default gateway 192.168.1.96

Router1:

  • Interface 1 5.5.5.2 (public IP)
  • Interface 2 10.1.1.1

Router2:

  • Interface 1 10.1.1.2
  • Interface 2 172.16.1.1

Router3:

  • Interface 1 10.1.1.3
  • Interface 2 192.168.1.96

Network mask in all networks: 255.255.255.0 (/24 in CIDR notation).

If the routers do not use a Routing Information Protocol to discover which network each router is connected to, then the routing table of each router must be set up.

Router1

Network ID Network mask Gateway Interface (examples; may vary) Cost (decreases the TTL)
0.0.0.0 (default route) 0.0.0.0 Assigned by ISP (e.g. 5.5.5.1) eth0 (Ethernet 1st adapter) 10
10.1.1.0 255.255.255.0 10.1.1.1 eth1 (Ethernet 2nd adapter) 10
172.16.1.0 255.255.255.0 10.1.1.2 eth1 (Ethernet 2nd adapter) 10
192.168.1.0 255.255.255.0 10.1.1.3 eth1 (Ethernet 2nd adapter) 10


Router2

Network ID Network mask Gateway Interface (examples; may vary) Cost (decreases the TTL)
0.0.0.0 (default route) 0.0.0.0 10.1.1.1 eth0 (Ethernet 1st adapter) 10
172.16.1.0 255.255.255.0 172.16.1.1 eth1 (Ethernet 2nd adapter) 10

Router3

Network ID Network mask Gateway Interface (examples; may vary) Cost (decreases the TTL)
0.0.0.0 (default route) 0.0.0.0 10.1.1.1 eth0 (Ethernet 1st adapter) 10
192.168.1.0 255.255.255.0 192.168.1.96 eth1 (Ethernet 2nd adapter) 10

Router2 manages its attached networks and default gateway; router 3 does the same; router 1 manages all routes within the internal networks.

Accessing internal resources If PC2 (172.16.1.100) needs to access PC3 (192.168.1.100), since PC2 has no route to 192.168.1.100 it will send packets for PC3 to its default gateway (router2). Router2 also has no route to PC3, and it will forward the packets to its default gateway (router1). Router1 has a route for this network (192.168.1.0/24) so router1 will forward the packets to router3, which will deliver the packets to PC3; reply packets will follow the same route to PC2.

Accessing external resources If any of the computers try to access a webpage on the Internet, like http://en.wikipedia.org/, the destination will first be resolved to an IP address by using DNS-resolving. The IP-address could be 91.198.174.2. In this example, none of the internal routers know the route to that host, so they will forward the packet through router1's gateway or default route. Every router on the packet's way to the destination will check whether the packet's destination IP-address matches any known network routes. If a router finds a match, it will forward the packet through that route; if not, it will send the packet to its own default gateway. Each router encountered on the way will store the packet ID and where it came from so that it can pass the request back to previous sender. The packet contains source and destination, not all router hops. At last the packet will arrive back to router1, which will check for matching packet ID and route it accordingly through router2 or router3 or directly to PC1 (which was connected in the same network segment as router1).

The packet doesn't return If router1 does not have any route to 192.168.1.0/24, and PC3 tries to access a resource outside its own network, then all routing will work until the reply is fed back to router1. Since the route is unknown to router1, it will go to router1's default gateway, and never reach router3. In the logs of the resource they will trace the request, but the requestor will never get any information. The packet will die because the TTL-value decrease to less than 1 when it is travelling through the routers or the router will see that it has a private IP and discard it. This could be discovered by using Microsoft Windows utility Pathping, since you only can ping until that router which has no route or wrong route. (Note that some routers will not reply to pinging.)

See also

  • route (command): generic command for displaying/configuring TCP/IP routing tables (including gateways) on both Windows and Unix-clone systems.

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • default gateway — numatytasis tinklų sietuvas statusas T sritis informatika apibrėžtis Tiesiogiai pasiekiamas ↑maršruto parinktuvas. Jo ↑skaitinis adresas įrašomas į ↑TCP/IP protokolo nuostatas. Parenkant numatytąjį ↑tinklų sietuvą kartu sukuriamas ir numatytojo… …   Enciklopedinis kompiuterijos žodynas

  • Gateway (informática) — Saltar a navegación, búsqueda Un gateway (puerta de enlace) es un dispositivo, con frecuencia un ordenador, que permite interconectar redes con protocolos y arquitecturas diferentes a todos los niveles de comunicación. Su propósito es traducir la …   Wikipedia Español

  • Gateway (Informatik) — Ein Gateway [ˈgeɪtweɪ] (englisch gateway, deutsch auch Protokollumsetzer) erlaubt es Netzwerken, die auf völlig unterschiedlichen Protokollen basieren, miteinander zu kommunizieren. Als Beispiel könnte ein Gateway das Protokoll IP nach IPX… …   Deutsch Wikipedia

  • Default route — A default route, also known as the gateway of last resort, is the network route used by a router when no other known route exists for a given IP packet s destination address. All the packets for destinations not known by the router s routing… …   Wikipedia

  • Gateway (telecommunications) — In telecommunications, the term gateway has the following meaning: *In a communications network, a network node equipped for interfacing with another network that uses different protocols. **A gateway may contain devices such as protocol… …   Wikipedia

  • Gateway 2000 — Gateway Handbook 486 Gateway (NASDAQ, Fortune 500) ist eine US amerikanische PC Handelskette nach dem Vorbild von Dell. Sie wurde 1985 in Iowa als Garagenfirma von Ted Waitt gegründet und hat sich seitdem rasant entwickelt. Zunächst firmierte sie …   Deutsch Wikipedia

  • Gateway Computer — Gateway Handbook 486 Gateway (NASDAQ, Fortune 500) ist eine US amerikanische PC Handelskette nach dem Vorbild von Dell. Sie wurde 1985 in Iowa als Garagenfirma von Ted Waitt gegründet und hat sich seitdem rasant entwickelt. Zunächst firmierte sie …   Deutsch Wikipedia

  • Gateway Load Balancing Protocol — (GLBP) is a Cisco proprietary protocol that attempts to overcome the limitations of existing redundant router protocols by adding basic load balancing functionality.In addition to being able to set priorities on different gateway routers, GLBP… …   Wikipedia

  • Gateway School District — Infobox School District name = Gateway School District = type = Public budget = $61,068,000 established = region = grades = K 12 superintendent = Dr. Cleveland Steward, Jr. contact number = 412 372 5300 teachers = 307 staff = 539 students =… …   Wikipedia

  • Gateway High School (Pennsylvania) — Infobox School name =Gateway High School motto = established =1969 type = affiliation = district =Gateway School District grades =9 12 principal =Billiamus Short faculty = staff = students = enrollment =9,000+ athletics = conference =Western… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”