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

Let's take a look at the basic behavior of routing

"For terminals to communicate with IP, first check if the other person belongs to the same network (subnet), and if the network is different, communicate via the router."In this part, we will explain the communications performed between the two subnets connected by these routers, and hold down the basic operation of routing.

If you can't communicate directly, routing

 First of all, let's look at the case where the subnet mask is incorrectly set for the previous review.For example, let's consider a case where a network of class B is divided into a 256 subnet, and only a certain PC is not set a subnet mask.

 In this network, 255.255.255.0 (24 -bit length) must be set for subnet masks of all devices.However, if inadvertently made "IP address: 172.16.1.1, subnet mask: not set", the subnet mask of this PC will be 255.255.0.0 (16 -bit length).This is because RFC 1878 stipulates class B subnet masks as default values.Therefore, it is not possible to communicate with IP address devices such as 172.16.2.xxx or 172.16.204.xxx from this PC.

 The source of the data is to send a packet to the router if the telecommunications partner belongs to a different network, and request a relay for the destination network.In a medium -sized network, multiple routers may be installed in one segment.In such a case, the terminal of the sender must ask the correct router to relay packets according to the terminal of the destination (Fig. 1).In this way, the operation of determining the delivery route of the packet is called "routing".

Figure 1 Direct communication and relay by router

 In the example of Fig. 1, PC1 and PC2 exist in the same subnet, so packets can be sent directly by communication.However, if you send packets to a terminal in a different network from PC1, you need to ask a router specified as a default gateway for a relay.

 Routing is often described as a function of routers and layer 3 switches, but all terminals that communicate with IP are all routed.Equipment such as client PCs and printers is no exception.There are some models such as printers / faxes with advanced routing functions equipped with UNIX -based OS, but most are limited to minimal simple operations.Here, we will explain routing movements mainly with Windows, a client -based OS.

ルーティングの基本動作を見てみよう

Routing table

 If the telecommunications partner is in a different network, the source terminal must first determine how to send a packet to the opponent's network.The highlight of this judgment is the database called the "routing table".The result of displaying the routing table in Windows XP is like screen 1.

Screen 1 Rooting Table view

 This example uses "Routeprint", a command that displays the routing table.The same result can be obtained by attaching the "-r" option to the "Netstat" command to check the network connection status of the host and the network statistics for each interface.

 When the Route Print command is executed at the command prompt, a list of interfaces on the terminal executed as shown in screen 1 is displayed.Below it is a routing table that is registered.Let's explain each item displayed in this routing table in order from the left side.

 "Network Destination" means a destination network."Netmask" is a subnet mask, calculating the values and the IP address of the communication partner, and finds a packet destination network.The next "Gateway" is the router IP address requesting a packet.

 "Interface" is an IP address of the LAN port (network interface) that the terminal sends packets."METRIC" on the right refers to priority.As for the details, as described in the later part, if there are multiple same routes, the value used to determine which one to prioritize is prioritized.

 Next, let's look at each line of this routing table.The first line is a "default route", which means "route when there is no other option."The default route "Network Destination" and "Netmask" are both "0.0.0.0".The default route will be explained in detail later.

 The second line is a "local loop back" and means "communication route between programs in the same terminal".127.0.0.0/8 for local loop back network addresses and 127.0.0.1 for interface IP addresses.When using this route, the packet does not go out of the terminal.

 The third line is a "local route" and means "route in the same network (subnet)".The destination of the local route is a network address to which the terminal belongs, and "Gateway" matches the device IP address.

 The fourth line is "host route".The destination of the host route is expressed in "IP address/32".It is used when controlling the route for each terminal, not the network to which the terminal belongs to the telecommunications partner.In the case of Windows, only the host route for yourself is automatically registered.

 After that, the fifth and 7th and eighth lines mean "Broadcast", and the sixth line means "multicast".Broadcasting is to provide reports on all terminals in the subnet, while multicasts are reported to a specific group.