Routers connect two or more networks, each of which must have a unique network
number in order for routing to be successful. The unique network number is incorporated
into the IP address that is assigned to each device attached to that network.
Example:
A network has a unique network number - A. It has four devices attached to it. The IP addresses of the devices are A2, A3, A4, and A5. Since the interface where the router connects to a network is considered to be part of that network, the interface where the router connects to network A has an IP address of A1.

Example:
Another network, with a unique network number - B - has four devices attached to it. This
network is also attached to the same router, but at a different interface. The IP
addresses of the devices on this second network are B2, B3, B4, and B5. The IP address of
the router's second interface is B1.
Example:
You want to send data from one network to another. The source network is A; the
destination network is B; and a router is connected to networks A, B, C, and D. When data
(frames), coming from network A, reaches the router, the router performs the following
functions:
- It strips off the data
link header, carried by the frame. (The data link header contains
the MAC addresses of the source and destination.)
- It examines the network layer address to determine the
destination network.
- It consults its routing tables to determine which of its
interfaces it will use to send the data, in order for it to reach its destination network.
In the example, the router determines that it should send
the data from network A to network B, from its interface, with address
B1. Before actually
sending the data out interface B1, the router would encapsulate the data in the
appropriate data link frame.
|