Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The network mask has 32 bits and is written in the same way as the IP address with one difference: the network mask consists of a sequence of one ("1") bits followed by zero ("0") bits, i.e. the set of masks is preset and contains 33 values: from 0 to 32. The finite range of possible values allows to write the network mask in an abbreviated form, in which the number of single "1" bits in the mask is indicated after a slash (see the table below).

The one "1" bits in the network mask define the network identifier: the bits of the IP address corresponding to the "1" bit values of the mask must be fixed and cannot be changed. The remaining bits of the IP address, corresponding to the zero bit values of the mask, can take arbitrary values and determine the host ID.

When configuring the devices connected to the network, the IP addresses are not used without a network mask, since the routing rules imply a different approach when transferring data to a device located in a different network, compared to sending data to a device in the same network (see Switching). Note that the network mask is indicated set in the configuration of the device configuration and it is not transmitted in the service header of the IP packet.

Center
ExampleParameterDecimal formatBinary formatAbbreviated format


Example 1

IP address10.94.200.700001010.01011110.11001000.00000111-
Network mask255.255.255.011111111.11111111.11111111.00000000/24
First available IP address10.94.200.000001010.01011110.11001000.00000000-
Last available IP address10.94.200.25500001010.01011110.11001000.11111111-


Example 2

IP address192.17.0.011000000.00010001.00000000.00000000-
Network mask255.255.255.25211111111.11111111.11111111.11111100/30
First available IP address
192.17.0.011000000.00010001.00000000.00000000-
Last available IP address
192.17.0.311000000.00010001.00000000.00000011-

Table 1 - Network mask examplesExamples of network masks

Types of IP addresses

The IP address types can be divided according to several criteria:

...

Based on the application area, the IP addresses can be divided in two large groups: public and private addresses (Figure 3). Global connectivity can only be established between public addresses, i.e. private addressing is used inside the enterprise's local network and public addressing is used on the Internet. The public address is unique, while private addresses can be reused, i.e. the devices PC-2 and PC-6 may have the same address and this is not a problem, since there is no connectivity between LAN-1 and LAN-2. However, the addressing within the same local network must be unique, i.e. the addresses of PC-5 and PC-6 must be different.

In addition to the public and private ranges of addresses, several service ranges are allocated, for example , for the multicast traffic transmission, for the loopback interface, etc.

...

  • Network addresses: the address assigned to a network, out of which the available host addresses can be deduced. Often the network addresses are used in the routing tables of the device, as it is shown below. The lowest address from the allowed range is used as the network address: in example 1 - 10.94.200.0 is the network address and in example 2 - 192.17.0.0 is the network address.
  • Broadcast address: this address refers to all the devices connected to the network. A packet with a network broadcast address set as the destination will be delivered to all the devices connected to this network. The highest address from the allowed range is used as the broadcast address: in example 1 - 10.94.200.255 is the broadcast address and in example 2 - 192.17.0.3 is the broadcast address.
  • Node or host addresses: addresses that can be assigned to the network interfaces of the devices connected to the network. All allowed addresses can be used as node addresses, except for the network address and the broadcast address: in example 1 - 10.94.200.1 -till 10.94.200.254 are node or host addresses and in example 2 - 192.17.0.1-192.17.0.2 are the available node addresses.

...

  • The main function of a router is to transfer data between its connected networks.
  • The router is connected to the network by connecting one of the router's interfaces to the network and assigning an IP address from the allowed range to this interface. Both physical and virtual interfaces can be used.
  • When transmitting data, the router is guided by the routing table.
  • Within the same network, data is transmitted using the switching technology, and between different networks using routing, i.e. IP and Ethernet complement each other, as mentioned before.
  • For the user data, the router is an intermediate device and does not change the source and destination addresses. The source device of the packet sets the source and destination IP addresses and those remain unchanged along the transmission path.
  • The router analyzes only the destination address and searches for a best match for it in the routing table. The source address in the service header is set and remains unchanged in order to allow the recipient to send a response packet back to the source device (on the way back, the initial source address will become the destination address).
  • The routing table is present not only in specialized network devices such as routers, but also at the end nodes. For example, on a PC using the Windows software controlled PC, the routing table can be displayed by running the "route print" command at in the command line.
Center

Figure 4 - The place of the router in the network

...

  • Local network LAN-1 to connect the network devices PC-1 and PC-2:
    • The 192.168.1.0/24 private network address is used by this segment;
    • 192.168.1.10/24 is assigned to PC-1;
    • 192.168.1.20/24 is assigned to PC-2;
    • 192.168.1.1/24 is assigned to R1.
  • Local network LAN-3 to connect the network devices PC-3 and PC-4:
    • The 172.16.3.0/28 private network address is used by this segment;
    • 172.16.3.2/28 is assigned to PC-3;
    • 172.16.3.4/28 is assigned to PC-4;
    • 172.16.3.1/28 is assigned to R3.
  • Local network LAN-2 to connect routers R1, R2 and R3 to each other:
    • The 10.10.2.0/29 private network address is used by this segment;
    • 10.10.2.1/29 is assigned to R1;
    • 10.10.2.2/29 is assigned to R2;
    • 10.10.2.3/29 is assigned to R3.
  • The connection of the R2 router to the WAN global network:
    • The 45.94.77.7/25 public host address is assigned to the eth0 interface connected to the WAN.
Center

Figure 5 - Network diagram example

The routing table is a collection of network addresses. The network address in the routing table that matches best with the destination IP address has associated to it an exit interface or a gateway IP address address associated, that are used for transmitting the packet to the corresponding next hop in order to reach the destination. This logic is used by all routers along the traffic path, i.e. if there are 8 routers along the packet's path, then each of them only has information about the next router along the way, and this information is contained in the routing table.

...

  • Network address: the packet's destination IP address specified in the service header is checked to see if it belongs to the network address indicated in the table. If the destination belongs to this network, than the current table entry can be used for data transmission. The best match is used, which is not always the exact match.
  • Gateway address: the IP address of the next router (hop), to which the packet will be forwarded.
  • Output interface: the network interface for outbound packet transmission.
  • Distance: in the networks having redundant communication channels, there are several paths to the same network. These routes can be obtained from one or several sources, however, only one of these routes should be placed in the routing table. To prioritize the routes from different sources, the Administrative Distance parameter (or Distance) is used, which reflects the level of trust into this source. The route from the source with the lowest Distance value will be added to the routing table, as a lower Distance value means a higher level of trust. The general recommendations for the Distance values are followed by most manufacturers of network equipment (Table 3).
  • Metric: multiple routes to the same network can be obtained not only from different sources, as mentioned above, but also from the same source. These routes are prioritized using the Metric value, when added to the routing table. Each route source calculates the metric using different algorithms, so the metrics from different sources cannot be directly compared.
Center
Section
Column
width30%

Table 2a - R1's routing table example

Column
width30%

Table 2b - R2's routing table example

Column
width30%

Table 2c - R3's routing table example

Route sourceDistance
directly connected networks0
static route1
External BGP20
OSPF110
RIP120
ODR160

Table 3 - Distance values depending on the route source

...

  • Step 1a: Layer 3 processing: PC1 generates a packet with the destination IP address of PC3. Also, PC1 checks its routing table to find a matching network for the destination IP address. Here it finds that the best match is network 172.16.3.0/28 which is associated with the gateway (next hop IP address) 192.168.1.1/24 ( the IP address of R1's eth1 interface). Then, the packet is sent for processing to the L2 layer of the network interface.
  • Step 1b: The L2 layer of the PC1's network interface sends an ARP request to determine the MAC address corresponding to the gateway IP (the MAC of R1's eth1 interface). The MAC address of the R1's eth1 interface is set in the Ethernet header as the destination MAC address. The generated frame is sent to Switch1.
  • Step 1c: Switch1 transmits the frame to R1 according to the switching table.
  • Step 2a: Router R1 checks its own routing table: two entries match the destination address, 172.16.3.0/28 and 172.16.3.0/30. Since mask /30 is narrower than /28, R1 will redirect the packet to the 172.16.3.0/30 network. Note that if the packet's destination were PC4, a different entry in the routing table would be used, even though PC3 and PC4 belong to the same network.
  • Step 2b: Router R1 forwards the Ethernet frame towards router R3. The source and destination IP addresses remain unchanged, while the new source MAC address is the one of R1's eth2 interface and the new destination MAC address is the one of the R3's eth3 interface, determined also through the ARP process using the gateway IP address (IP of the R3's eth3 interface).
  • Step 2c: Switch 2 receives the frame and forwards it to router R3 according to its switching table.
  • Step 3a: Router R3 checks its own routing table: the destination address matches with the 172.16.3.0/28 network which is directly connected to it so it does not need a gateway IP. 
  • Step 3b: Router R3 determines through ARP the MAC address of PC3 (the destination of the packet) and sends the Ethernet frame to Switch3. The source and destination IP addresses remain unchanged, while the source MAC address is the one of the R3's eth1 interface and the destination MAC address is the MAC address of PC3.

...

  • Step 1: PC1 generates a packet with the destination IP address 82.151.200.119 (the IP address of the server where the infinetwireless.com website is available). The packet is sent to router R1.
  • Step 2: R1 checks its routing table: there are no networks in the routing table that match with the destination IP address, so the default route 0.0.0.0/0 having the gateway 10.10.2.2 will be used (see the below routing table of R1). The router sends the packet to R2, its eth2 interface is being the gateway.
  • Step 3: R2 checks its routing table: there are no entries matching with the destination IP address, so the default route is used and the packet is sent to a router outside the local network (inside the WAN network).

...

  • RIB (routing information base) - represents the routing information data obtained from all sources.
  • FIB (forwarding information base) - the data forwarding table used to handle the transiting traffic. The FIB is generated from the RIB by filtering and combining the routing information (Figure 7).

...

Center
Routing information sourcesInfiLINK 2x2InfiMAN 2x2InfiLINK XGInfiLINK XG 1000Quanta 5Quanta 70
Operating system routes

+

+++++
Directly connected networksmanagement traffic++++++
data traffic++----
Static routesmanagement traffic++++++
data traffic++----


Dynamic routing protocols

OSPF++----
ODR++----
RIP++----

Table 6 - Comparative analysis of the routing information sources for the InfiNet devices

...

Further in this article we will present the tools for displaying and analyzing the routing information. These tools depend on the family of devices and will be shown below.

...

The routing tables of the InfiLINK 2x2 and the InfiMAN 2x2 families of devices

The InfiLINK 2x2 and the InfiMAN 2x2 families of devices support routing settings for the management traffic and for the user traffic, moreover, static routes and dynamic routing protocols are supported.

...

  • Web interface: go to the "Network settings → Routing parameters" (Figure 8a). The web interface allows to view only the static routes.
  • Command line: the "nestat -r" command displays the FIB data. There are also commands available to evaluate the routing information by separate for each type of sources, which will be described in the following sections.
Center
Code Block
languagetext
themeEmacs
Unknown node#1> netstat -r
Routing tables
Destination        Gateway            Flags     Refs     Use  Interface
10.10.10.0/24      link#6             UC          0        0  svi1
10.10.10.101       00:0c:29:40:72:d0  UHL         0        1  svi1
10.10.10.254       link#6             UHL         0        0  svi1
10.10.20.0/24      link#2             UC          0        0  eth0
10.10.20.101       00:0c:29:40:72:d0  UHL         1     1307  eth0
127.0.0.1          127.0.0.1          UH          1        0  lo0
224.0.0.0/8        127.0.0.1          UGS         0        0  lo0

Figure 8a - An example of routing information output for the InfiLINK 2x2/InfiMAN 2x2 families of devices

...

The routing tables of the InfiLINK XG and InfiLINK XG 1000 families of devices

The InfiLINK XG and InfiLINK XG 1000 families of devices support routing configurations for the management traffic only. The default gateway and static routes can be set. The routing information can be displayed in two ways:

...

Center
Code Block
languagetext
themeEmacs
#1> netstat -r
Routing tables
Destination        Gateway            Flags     Refs     Use  Interface
10.10.10.0/24      link#2             UC          0        0  mgmt
10.10.10.101       00:0c:29:40:72:d0  UHL         1      512  mgmt
10.10.10.254       link#2             UHL         1        0  mgmt
10.10.20.0/24      10.10.10.254       UGS         0        0  mgmt
127.0.0.1          127.0.0.1          UH          0        0  lo0
224.0.0.0/8        127.0.0.1          UGS         0        0  lo0

Figure 8b -An example of routing information output for the InfiLINK XG/InfiLINK XG 1000 families of devices

...

The routing tables of the Quanta 5 and Quanta 70 families of devices

The Quanta 5 and Quanta 70 families of devices support only routing configurations for the management traffic, allowing to set a default gateway. The routing information can be displayed in two ways:

...