You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today.

Understanding routing comes from the relationship between networks and IP addresses

Knowledge of routing is essential to understand TCP / IP for packet communication. In this series, after explaining the mechanism of the IP address that is the basis of routing, we will explain routing using an actual router while looking at the device setting screen and packet capture screen.

IP address configuration and its role

The role of networks that use TCP / IP, such as the Internet, is roughly to communicate between devices on the network. However, since the network is complicated, it is important to have a mechanism to correctly deliver packets from the destination to the destination.

In the real world, mail is just as required to reach the address written on the destination. However, when using mail, I am not aware of the process by which my letter arrives. Therefore, I would like to pay attention to how packets are carried in communication on a complicated network.

If you compare a packet to a mail piece, you need something equivalent to the destination address or name. That is the "IP address". As the word address indicates, an IP address represents a destination or source for delivering an IP packet. Therefore, first of all, I will explain the IP address required to identify the communication from "who" to "who" in the communication on the network.

In IP (Internet Protocol), a communication terminal (host) such as a PC or router is identified by an IP address. In IP version 4 (IPv4), which is the mainstream in current networks, IP addresses are 32-bit (4 bytes) integers. Basically, it is written in binary with 32 digits, but it is often written in decimal for each byte so that it is easy for humans to understand, and it is often written by separating them with dots (Fig. 1). It may also be expressed as an 8-digit hexadecimal number.

Figure 1 IP address notation

To properly deliver IP packets, every terminal (strictly an interface) on the Internet must be assigned a different IP address. Therefore, IP addresses are managed by a hierarchical organization with ICANN (Internet Corporation for Assigned Names and Numbers) at the top.

Based on this ICANN policy, a network management organization (registry) in each region assigns IP addresses to organizations such as companies. The registry in Japan is JPNIC (Japan Network Information Center). In this way, duplicate IP addresses are prevented worldwide.

What the IP address indicates

Even if it is said that "IP addresses are assigned by network management organizations", it is virtually impossible for network management organizations to assign addresses to terminals of organizations such as universities, companies, and government offices one by one. Therefore, the network management organization assigns each organization a "consecutive group of IP addresses (address blocks)". Then, each organization assigns an IP address (host address) to a terminal in the organization from the assigned address block.

ルーティングの理解はネットワークとIPアドレスの関係から

In other words, the IP address consists of two parts: a part that indicates the network to which a certain terminal belongs, and a part that identifies the terminal (host) in the network. This format is easy to understand if you imagine an apartment house such as an apartment or an apartment.

In order to deliver mail to each room of an apartment house, it is necessary to know the part that represents the location of the building (country, administrative area, town name, street address, etc.) and the part that represents the room number in the building. Here, the location of the building corresponds to the network section, and the room number in the building corresponds to the host section (Fig. 2).

Figure 2 IP address format and address comparison

Here, an IP address in which all the bits of the host part are set to "0" is called a "network address". When noting the network address, add "/ (slash)" and the length (bit length) of the network part after it. For example, if there is a terminal with an IP address (host address) of 192.168.124.113 and the network part is 24-bit, write the network address of this terminal as 192.168.124.0/24. If the hosts are connected to the same network, the network addresses will always match.

IP address classification

Organizations connected to the Internet vary in size and each has a different number of terminals. That is, the number of required IP addresses differs depending on the size of the organization. However, the length of the IP address is fixed at 32 bits. Therefore, by changing the combination of the length (number of bits) of the network part and the host part, the number of host addresses that can be used in the organization is divided into three classes (Table 1, Fig. 3).

Table 1 Class and number of terminals
classAddress rangeNetwork partHost partNumber of connectable terminals inside the networkNumber of assigned organizations across the Internet
Class A 0.0.0.0 to 127.255.255.255 8 bits 24-bit 16,777,214 units 128 organizations
Class B 128.0.0.0-191.255.255.255 16 bit 16 bit 65,534 units 16,384 organizations
Class C 192.0.0.0 ~ 223.255.255.255 24-bit 8 bits 254 units 20,971,524 organizations

Figure 3 Address class

Each class is determined by the value of the upper 4 bits of the IP address. In class A, the most significant 1 bit of the IP address is "0", in class B, the most significant 2 bits are "10", and in class C, the most significant 3 bits are "110".

In addition, there are special address classes such as class D (224.0.0.0 to 239.255.255.255) in which the most significant 4 bits of the IP address are "1110" and class E (240.0.0.0 to 255.255.255.255) in which the IP address is "1111". .. Class D is for multicast, which sends packets to multiple terminals at the same time. It is mainly used for distribution of multimedia applications and the like. Also, since it has been decided that class E will be used for experiments, it is not possible to assign class D and class E IP addresses to general terminals.

However, the division of the network part and the host part by class is not used now (except for classes D and E). I'll talk about splitting without classes next time.

Private address that can be used freely at home

IP addresses are also divided into "global addresses (global IP addresses)" and "private addresses (private IP addresses)". As I introduced last time, the global address is a unique address that is not duplicated in the world and was officially distributed by network management organizations such as ICANN. Terminals that connect directly to the Internet must be given this global address. Conversely, if you are not connected to the Internet, you do not need to use global addresses. The private address can be freely used within the organization without the need to apply for or register with the network management organization (Table 1). ..

Table 1 Private address types
classrange
Class A 10.0.0.0 to 10.255.255.255
Class B 172.16.0.0 ~ 172.31.255.255
Class C 192.168.0.0 to 192.168.255.255

Except for some educational institutions and companies that have a large number of global addresses, it is common to use private addresses for networks within an organization. In addition, the IP address assigned to a terminal by a broadband router widely used in the home is often "192.168.XX", which is also a private address.

Table 1 Private address types
classrange
Class A 10.0.0.0 to 10.255.255.255
Class B 172.16.0.0 ~ 172.31.255.255
Class C 192.168.0.0 to 192.168.255.255

On the Internet, packets with a private address as a destination or source are discarded without being delivered. Therefore, there is no problem even if another organization or home that is connected only via the Internet uses the same private address.

This article is a re-edited version of Feature 1 "Trial and Understanding Routing" in the November 2008 issue of Network Magazine. As a general rule, the content is as of the time of publication and may differ from the current one.