Before a device sends, it compares the destination address with its own network (address and mask). If the destination is in the same network, it asks directly for the destination’s MAC via ARP. If it is elsewhere, it sends the packet to its default gateway, the router in its own network.
Slow motion A ping to another network goes via the default gateway
The routing table
A router decides for every packet by its routing table: for every destination network it lists the neighbour (next hop) or interface to use.
Destination
via
Source
192.168.1.0/24
eth0
directly connected
192.168.2.0/24
10.0.0.2
static
0.0.0.0/0
203.0.113.1
default route
If several entries match, the longest prefix (the most specific network) wins. On a tie the administrative distance decides: connected 0, static 1, eBGP 20, OSPF 110, RIP 120. Every router lowers the TTL by one; when it reaches zero, the router drops the packet and reports “TTL expired” (this is how tracert works).
Networks between routers: the transit network
The small network that links two routers is called a transit network in leyoNET. It contains no end devices, only the two router ports; a /30 with two usable addresses is therefore enough. The term follows RFC 2328: a transit network carries traffic that neither originates nor ends in it. Its counterpart is the stub network, a network with end devices and a single exit.
In practice and in textbooks you will meet other words for the same thing:
Term
Meaning
In leyoNET
Transit network
IP network between routers, without end devices
used throughout
Transfer network (German «Transfernetz»)
the same; common in German-speaking countries, but not found in any standard
no longer used
Transport network
at carriers, the transmission network that carries customer signals; not an IP network between two routers
not used
Leased line
the permanently connected line of a provider between two sites, i.e. layers 1 and 2; the IP network on it is a transit network
network with exactly two members (RFC 2328); every /30 between two routers is one
as an explanation
Three ways to the table
Automatic (leyoNET only, for beginners): one tick at the router and it knows all networks in the plan.
Static: enter the routes by hand. Clear, but every change must be repeated on every router (Static routing).
Dynamic: routers exchange their networks themselves and react to failures: OSPF, RIP and RIPng, between organisations BGP.
How to do it in leyoNET
The same text as in the app’s help (F1 key).
Automatic routing
To get started: tick Automatic routing on the router (or layer 3 switch), on the right in the properties or in the Routing tab. The router then knows every network in the plan without entering any routes.
For each network it takes the path through the fewest routers. Neighbours are routers whose ports are in the same network (cable or switch in between, same subnet).
If a path leads to the internet (provider or internet box), a default route towards it is added.
In the routing table these routes are marked A (automatic). In design mode the Routing tab shows a preview.
If you shut down a port, automatic routing looks for another path if there is one.
Every router needs the tick itself: a router without a matching route drops the packet, even if the others route automatically.
This is a shortcut of the simulator, not a real protocol. In real networks, static routes or protocols such as OSPF and RIP do this job.
Without the tick you choose: - Static: enter every route by hand. - Dynamic: the routers exchange their networks using OSPF, RIP or BGP; static routes apply as well.
Routes and protocols you have entered stay saved when you switch. They are only inactive while another mode is chosen.
See an example
Default gateway
Two subnets connected by a router.
PC 1 sees that the target is in another network and sends the packet to its router. The TTL drops by one.