Or gateway, is a network node with several IP interfaces (containing its own MAC address and IP address) connected to different IP networks, which, based on solving the routing problem, redirects datagrams from one network to another for delivery from the sender to the recipient.

They are either specialized computers or computers with several IP interfaces, the operation of which is controlled by special software.

Routing in IP networks

Routing is used to receive a packet from one device and forward it across the network to another device via other networks. If there are no routers on the network, then routing is not supported. Routers route (forward) traffic to all networks that make up the internetwork.

To route a packet, the router must have the following information:

  • Destination address
  • A nearby router from which it can learn about remote networks
  • Available paths to all remote networks
  • The best path to each remote network
  • Methods for maintaining and checking routing information

The router learns about remote networks from neighboring routers or from network administrator. The router then builds a routing table that describes how to find remote networks.

If the network is connected directly to the router, it already knows how to route the packet to that network. If the network is not directly connected, the router must find out (learn) access paths to the remote network using static routing (the administrator manually enters the location of all networks into the routing table) or using dynamic routing.

Dynamic routing is a routing protocol process that determines how a device communicates with neighboring routers. The router will update information about each network it learns. If a change occurs in the network, the dynamic routing protocol automatically informs all routers of the change. If static routing is used, the system administrator will have to update the routing tables on all devices.

IP routing is a simple process that is the same on networks of any size. For example, the figure shows the process of step-by-step interaction between host A and host B on another network. In the example, the user of host A requests the IP address of host B by ping. Further operations are not so simple, so let’s look at them in more detail:

  • IN command line the user enters ping 172.16.20.2. On host A, a packet is generated using network layer protocols and ICMP.

  • IP calls ARP to find out the destination network for the packet by looking at the IP address and subnet mask of host A. This is a request to the remote host, i.e. the package is not intended for the host local network, so the packet must be forwarded to the router to forward to the desired remote network.
  • In order for host A to send a packet to the router, the host must know the hardware address of the router interface connected to the local network. The network layer passes the packet and hardware destination address to the data link layer to be framed and forwarded to the local host. To obtain a hardware address, the host looks up the location of the destination in its own memory, called the ARP cache.
  • If the IP address has not yet been reached and is not present in the ARP cache, the host sends an ARP broadcast to look up the hardware address at IP address 172.16.10.1. This is why the first Ping request will usually time out, but the other four requests will succeed. Once an address is cached, there is usually no timeout.
  • The router responds and reports the hardware address of the Ethernet interface connected to the local network. Now the host has all the information to forward the packet to the router over the local network. The network layer passes the packet down to generate an ICMP echo request (Ping) at the data link layer, appending the packet with the hardware address to which the host should send the packet. The packet has source and destination IP addresses along with an indication of the packet type (ICMP) in the network layer protocol field.
  • The data link layer forms a frame that encapsulates the packet along with the control information necessary for forwarding over the local network. This information includes the source and destination hardware addresses, as well as the value in the type field set by the network layer protocol (this will be the type field since IP uses Ethernet_II frames by default). Figure 3 shows a frame generated at the link layer and forwarded over the local media. Figure 3 shows all the information needed to communicate with the router: source and destination hardware addresses, source and destination IP addresses, data, and checksum Frame CRC, located in the FCS (Frame Check Sequence) field.
  • The link layer of host A forwards the frame to the physical layer. There, zeros and ones are encoded into a digital signal and then transmitted over a local physical network.

  • The signal reaches Ethernet interface 0 of the router, which is synchronized by the preamble digital signal to extract the frame. After constructing the frame, the router interface checks the CRC, and at the end of receiving the frame, compares the received value with the contents of the FCS field. In addition, it checks the transfer process for media fragmentation and conflicts.
  • The destination hardware address is checked. Since it matches the router address, the frame type field is analyzed to determine further actions with this data package. The type field specifies the IP protocol, so the router passes the packet to the IP protocol process running on the router. The frame is deleted. The original packet (generated by host A) is placed in the router's buffer.
  • The IP protocol looks at the destination IP address in the packet to determine whether the packet is destined for the router itself. Since the destination IP address is 172.16.20.2, the router determines from its routing table that network 172.16.20.0 is directly connected to Ethernet interface 1.
  • The router forwards the packet from the buffer to Ethernet interface 1. The router needs to frame it to forward the packet to the destination host. The router first checks its ARP cache to determine whether the hardware address has already been resolved during previous interactions with the given network. If the address is not in the ARP cache, the router sends an ARP broadcast request to Ethernet interface 1 to look up the hardware address for IP address 172.16.20.2.
  • Host B responds with the hardware address of its network adapter to an ARP request. The router's Ethernet 1 interface now has everything it needs to forward the packet to its final destination. The figure shows a frame generated by the router and transmitted over the local physical network.

The frame generated by the router's Ethernet 1 interface has a source hardware address from Ethernet interface 1 and a destination hardware address for the host B network adapter. It is important to note that, despite changes in the source and destination hardware addresses, on each router interface that sent the packet, the IP addresses source and destination never change. The package is not modified in any way, but the frames are changed.

  • Host B receives the frame and checks the CRC. If the check is successful, the frame is discarded and the packet is transferred to the IP protocol. It analyzes the destination IP address. Since the destination IP address is the same as the address set in Host B, the IP protocol examines the protocol field to determine the destination of the packet.
  • Our packet contains an ICMP echo request, so Host B generates a new ICMP echo reply with a source IP address equal to Host B and a destination IP address equal to Host A. The process starts again, but in the opposite direction. However, the hardware addresses of all devices along the packet's path are already known, so all devices will be able to obtain the hardware addresses of the interfaces from their own ARP caches.

In large networks, the process is similar, but the packet will have to travel more hops on the way to the destination host.

Routing tables

In the TCP/IP stack, routers and end nodes make decisions about who to pass a packet to in order to successfully deliver it to the destination node, based on so-called routing tables.

The table is a typical example of a route table using network IP addresses for the network shown in the figure.

Routing table for Router 2

The table shows a multi-route routing table, since it contains two routes to network 116.0.0.0. In the case of constructing a single-route routing table, it is necessary to specify only one path to network 116.0.0.0 based on the lowest metric value.

As you can easily see, several routes with different parameters are defined in the table. You need to read each such entry in the routing table as follows:

To deliver a packet to a network with an address from the field Network address and a mask from the Network Mask field, you need to send a packet from the interface with the IP address from the Interface field to the IP address from the Gateway Address field, and the “cost” of such delivery will be equal to the number from the Metrics field.

In this table, the "Destination Network Address" column indicates the addresses of all networks to which this router can transmit packets. The TCP/IP stack adopts the so-called one-hop approach to optimizing the packet forwarding route (next-hop routing) - each router and end node takes part in choosing only one packet transmission step. Therefore, each line of the routing table does not indicate the entire route as a sequence of IP addresses of the routers through which the packet must pass, but only one IP address - the address of the next router to which the packet must be transmitted. Along with the packet, responsibility for choosing is transferred to the next router next step routing The one-hop approach to routing means a distributed solution to the route selection problem. This removes the limitation on the maximum number of transit routers along the packet's path.

To send a packet to the next router, knowledge of its local address is required, but in the TCP/IP stack, it is customary to use only IP addresses in routing tables to preserve their universal format, independent of the type of networks on the internet. To find a local address from a known IP address, you must use the ARP protocol.

One-hop routing has another advantage - it allows you to reduce the size of routing tables in end nodes and routers by using the so-called default route (0.0.0.0) as the destination network number, which usually occupies the last line in the routing table. If there is such an entry in the routing table, then all packets with network numbers that are not in the routing table are sent to the router specified in the default line. Therefore, routers often store limited information about Internet networks in their tables, forwarding packets for other networks to the default port and router. The default router is assumed to forward the packet to the backbone, and routers connected to the backbone have full information about the composition of the Internet.

In addition to the default route, there may be two types of special entries in the routing table - an entry about a host-specific route and an entry about the addresses of networks directly connected to the router ports.

A host-specific route contains a full IP address instead of a network number, that is, an address that has non-zero information not only in the network number field, but also in the host number field. It is assumed that for such an end node the route should be chosen differently from all other nodes in the network to which it belongs. In the case when the table contains different records about the progress of packets for the entire network N and its individual node, which has address N,D, upon arrival of a packet addressed to node N,D, the router will give preference to the entry for N,D.

Entries in the routing table related to networks directly connected to the router contain zeros (“connected”) in the “Metrics” field.

Routing Algorithms

Basic requirements for routing algorithms:

  • accuracy;
  • simplicity;
  • reliability;
  • stability;
  • justice;
  • optimality.

There are various algorithms for constructing tables for one-hop routing. They can be divided into three classes:

  • simple routing algorithms;
  • fixed routing algorithms;
  • adaptive routing algorithms.

Regardless of the algorithm used to build the routing table, the result of their work has a single format. Due to this, in the same network, different nodes can build routing tables according to their own algorithms, and then exchange missing data with each other, since the formats of these tables are fixed. Therefore, a router using an adaptive routing algorithm can provide an end node using a fixed routing algorithm with path information to a network that the end node knows nothing about.

Easy routing

This is a routing method that does not change when the topology and state of the data transmission network (DTN) changes.

Simple routing is provided various algorithms, typical of which are the following:

  • Random routing is the transmission of a message from a node in any randomly selected direction, with the exception of the directions in which the message was received by the node.
  • Flooding routing is the transmission of a message from a node in all directions except the direction in which the message arrived at the node. This routing guarantees short packet delivery time, due to the deterioration bandwidth.
  • Routing based on previous experience - each packet has a counter for the number of nodes passed, in each communication node the counter is analyzed and the route that corresponds to the minimum value of the counter is remembered. This algorithm allows you to adapt to changes in network topology, but the adaptation process is slow and ineffective.

In general, simple routing does not provide directional packet transmission and has low efficiency. Its main advantage is to ensure stable operation of the network in the event of failure of various parts of the network.

Fixed routing

This algorithm is used in networks with a simple connection topology and is based on the manual compilation of a routing table by the network administrator. The algorithm often works effectively also for the backbones of large networks, since the backbone itself can have a simple structure with obvious best paths for packets to follow to the subnets attached to the backbone; the following algorithms are distinguished:

  • Single-path fixed routing is when a single path is established between two subscribers. A network with such routing is unstable to failures and overloads.
  • Multi-path fixed routing - several possible paths can be established and a path selection rule is introduced. The efficiency of such routing decreases as the load increases. If any communication line fails, it is necessary to change the routing table; for this purpose, several tables are stored in each communication node.

Adaptive Routing

This is the main type of routing algorithms used by routers in modern networks with complex topologies. Adaptive routing is based on the fact that routers periodically exchange special topological information about the networks available on the Internet, as well as about the connections between routers. Usually, not only the topology of links is taken into account, but also their capacity and condition.

Adaptive protocols allow all routers to collect information about the topology of connections in the network, quickly processing all changes in the connection configuration. These protocols are distributed in nature, which is expressed in the fact that there are no dedicated routers in the network that would collect and summarize topological information: this work is distributed among all routers, the following algorithms are distinguished:

  • Local adaptive routing - each node contains information about the link state, queue length and routing table.
  • Global adaptive routing is based on the use of information received from neighboring nodes. To do this, each node contains a routing table, which indicates the transit time of messages. Based on information received from neighboring nodes, the table value is recalculated taking into account the queue length in the node itself.
  • Centralized adaptive routing - there is some central node that collects information about the state of the network. This center generates control packets containing routing tables and sends them to communication nodes.
  • Hybrid adaptive routing is based on the use of a table periodically sent by the center and on analyzing the queue length from the node itself.

Algorithm indicators (metrics)

Routing tables contain information that switching programs use to select the best route. What characterizes the construction of routing tables? What is the nature of the information they contain? This section on algorithm metrics attempts to answer the question of how an algorithm determines whether one route is preferable to another.

Routing algorithms use many different metrics. Complex routing algorithms can rely on multiple metrics when selecting a route, combining them in such a way that the result is one hybrid metric. The following are the metrics used in routing algorithms:

  • Route length.
  • Reliability.
  • Delay.
  • Bandwidth.

Route length.

Route length is the most common routing metric. Some routing protocols allow network administrators to assign arbitrary prices to each network link. In this case, the path length is the sum of the costs associated with each channel that was traversed. Other routing protocols define a "hop count," a metric that describes the number of trips a packet must make on its way from its source to its destination through network aggregation elements (such as routers).

Reliability.

Reliability, in the context of routing algorithms, refers to the reliability of each link in the network (usually described in terms of bit-to-error ratio). Some network links may fail more often than others. Failures of some network links can be resolved more easily or quickly than failures of other links. When assigning reliability ratings, any reliability factors can be taken into account. Reliability ratings are typically assigned to network channels by administrators. As a rule, these are arbitrary digital values.

Delay.

Routing latency typically refers to the length of time it takes for a packet to travel from its source to its destination across an internetwork. Latency depends on many factors, including the bandwidth of the intermediate links on the network, the queues at the port of each router along the packet's path, network congestion on all intermediate links in the network, and the physical distance over which the packet must travel. Because there is a conglomeration of several important variables, latency is the most common and useful metric.

Bandwidth.

Bandwidth refers to the available traffic capacity of any link. All other things being equal, a 10 Mbps Ethernet channel is preferable to any leased line with a 64 KB/s bandwidth. Although bandwidth is an estimate of the maximum achievable capacity of a link, routes passing through higher-bandwidth links are not necessarily better than routes passing through slower links.

Routing is the procedure of determining the path a packet will take from one network to another. This delivery mechanism is made possible by the implementation of the Internet Protocol (IP) in all network nodes. Any message that is sent over the network must be divided into fragments when sent. Each of the fragments must be provided with the addresses of the sender and recipient, as well as the number of this packet in the sequence of packets that make up the entire message.

Such a system allows each gateway to select a route based on current information about the state of the network, which increases the reliability of the system as a whole. In this case, each packet can pass from the sender to the recipient along its own route. The order in which the recipient receives the packets does not matter. However, there is a special type of equipment called routers, which are used in networks with complex configurations to connect sections of it with different network protocols, as well as to more effectively separate traffic and use alternative paths between network nodes. The main purpose of using routers is to connect heterogeneous networks and serve alternative paths.

Routers do more than just communicate different types networks and provide access to global network, but can also manage traffic based on the network layer protocol (the third in the OSI model), that is, at a higher level compared to switches. The need for such management arises when the network topology becomes more complex and the number of its nodes grows, if redundant paths appear in the network, when it is necessary to solve the problem as efficiently and effectively as possible. fast delivery sent package to its destination. In this case, there are two main algorithms

Wide Area Network - verb. A network with a wide access area that determines the most advantageous path and method of data delivery: RIP and OSPF. When using the RIP routing protocol, the main criterion for choosing the most efficient path is the minimum number of “hops”, i.e. network devices between nodes. This protocol minimally loads the router's processor and extremely simplifies the configuration process, but it does not efficiently manage traffic.



When using OSPF, the best path is selected not only from the point of view of minimizing the number of hops, but also taking into account other criteria: network performance, packet transmission delay, etc. Large networks, sensitive to traffic congestion and based on complex routing equipment, require the use of the OSPF protocol. Implementation of this protocol is only possible on routers with sufficient powerful processor, because its implementation requires significant processing costs.

Routing in networks is usually carried out using five popular network protocols- TCP/IP, Novell IPX, AppleTalk II, DECnet Phase IV and Hegox XNS.

The main widely used data transfer protocols.

Transmission Control Protocol (TCP) is the basic transport protocol that gives its name to the entire TCP/IP protocol family.

User Datagram Protocol (UDP) is the second transport protocol of the TCP/IP family.

Address Resolution Protocol (ARP) - the protocol is used to determine the correspondence between IP addresses and Ethernet addresses.

Serial Line Internet Protocol (SLIP) is a protocol for transmitting data over telephone lines.

Point to Point Protocol (PPP) is a point-to-point data exchange protocol.

File Transfer Protocol (FTP) is a file exchange protocol.

TELNET is a virtual terminal emulation protocol.

Remote Process Control (RPC) is a protocol for controlling remote processes.

Domain Name System (DNS) - domain name system.

Routing Information Protocol (RIP) - routing protocol.

Network File System(NFS) - distributed file system.

Industrial protocols and communication standards

Classification of remote attacks (RA) on distributed computing systems (DCS).

By the nature of the impact: ∙ passive; ∙ active.

By purpose of influence

· violation of confidentiality of information or system resources;

· violation of information integrity;

· disruption of system performance (availability).

According to the condition for the beginning of the impact.

· Attack upon request from the attacked object.

· Attack upon the occurrence of an expected event on the attacked object.

· Unconditional attack

According to availability feedback with the attacked object

· with feedback;

· without feedback (unidirectional attack).

By location of the subject of the attack relative to the attacked object

· intrasegmental;

· intersegmental.

By ISO/OSI reference model level

Routing is the process of determining the path of information in communication networks. Routing is used to receive a packet from one device and transmit it to another device through other networks. A router or gateway is a network node with several interfaces, each of which has its own MAC address and IP address.

Another important concept is the routing table. A routing table is a database stored on a router that describes the mapping between destination addresses and the interfaces through which a data packet should be sent to the next hop. The routing table contains: the address of the destination node, the destination network mask, the gateway address (indicating the address of the router on the network to which the packet must be sent to the specified destination address), interface (the physical port through which the packet is transmitted), metric (a numerical indicator that specifies the priority route).

Entries in the routing table can be placed in three ways: in various ways. The first method involves using a direct connection in which the router itself determines the connected subnet. A direct route is a route that is local to the router. If one of the router's interfaces is connected directly to a network, then when it receives a packet addressed to such a subnet, the router immediately sends the packet to the interface to which it is connected. Direct connection is the most reliable routing method.

The second method involves entering routes manually. In this case, static routing takes place. A static route specifies the IP address of the next neighbor router or local egress interface that is used to route traffic to a specific destination subnet. Static routes must be specified at both ends of the communication channel between routers, otherwise remote router will not know the route along which to send response packets and only one-way communication will be organized.

And the third method involves automatic placement of records using routing protocols. This method is called dynamic routing. Dynamic routing protocols can automatically track changes in network topology. The successful operation of dynamic routing depends on the router performing two main functions:

  1. Keeping your routing tables up to date
  2. Timely dissemination of information about networks and routes known to them among other routers

The parameters for calculating metrics can be:

  1. Bandwidth
  2. Latency (time for a packet to travel from source to destination)
  3. Loading (channel load per unit of time)
  4. Reliability (relative number of errors in the channel)
  5. Number of hops (transitions between routers)

If the router knows more than one route to the destination network, then it compares the metrics of these routes and transmits the route with the lowest metric (cost) to the routing table.

There are quite a lot of routing protocols - they are all divided according to the following criteria:

  1. According to the algorithm used (distance vector protocols, communication channel state protocols)
  2. By area of ​​application (for intra-domain routing, for inter-domain routing)

The channel state protocol is based on Dijkstra’s algorithm, I’ve already talked about it. I’ll tell you briefly about the distance vector algorithm.

So, in distance vector protocols, routers:

  • Determine the direction (vector) and distance to the desired network node
  • Periodically forward routing tables to each other
  • In regular updates, routers learn about changes in network topology

Without going into too much detail, the link-state routing protocol is better for several reasons:

  • Accurate understanding of network topology. Link-state routing protocols create a tree of shortest paths in a network. Thus, each router knows exactly where its “brother” is located. There is no such topology in distance vector protocols.
  • Fast convergence. When routers receive an LSP link state packet, they immediately forward the packet further in an avalanche manner. In distance vector protocols, a router must first update its routing table before flooding it to other interfaces.
  • Event-driven updates. LSPs are sent only when a change occurs in the topology and only information related to that change.
  • Division into zones. Link state protocols use the concept of zone - the area within which routing information is distributed. This separation helps reduce the router's CPU load and structure the network.

Examples of link state protocols: OSPF, IS-IS.

Examples of distance vector protocols: RIP, IGRP.

Another global division of protocols by scope: for intra-domain IGP routing, for inter-domain EGP routing. Let's go through the definitions.

IGP (Interior Gateway Protocol) – internal gateway protocol. These include any routing protocols used within an autonomous system (RIP, OSPF, IGRP, EIGRP, IS-IS). Each IGP protocol represents one routing domain within an autonomous system.

EGP (Exterior Gateway Protocol) – internal gateway protocol. Provides routing between different autonomous systems. EGP protocols provide the connection of individual autonomous systems and the transit of transmitted data between these autonomous systems. Example protocol: BGP.

Let us also explain the concept of an autonomous system.

An autonomous system (AS) is a set of networks that are under a single administrative control and that use a single routing strategy and rules.

The autonomous system for external networks acts as a single object.

A routing domain is a collection of networks and routers that use the same routing protocol.

Finally, a picture explaining the structure of dynamic routing protocols.

We provide repair and setup services for computers, smartphones, tablets, wi-fi routers, modems, IP-TV, printers. High quality and inexpensive. Having a problem? Fill out the form below and we will call you back.

IP routing

IP Routing– the process of selecting a path for transmitting a packet in a network. A path (route) is a sequence of routers through which a packet passes on its way to the destination node. An IP router is a special device designed to connect networks and determine the path of packets in a composite network. The router must have several IP addresses with network numbers corresponding to the numbers of the networks being connected.

Connecting networks using an IP router

Routing is carried out at the sending node at the time the IP packet is sent, and then at IP routers.

The principle of routing at the sending node looks quite simple. When you need to send a packet to a node with a specific IP address, the sending node uses a subnet mask to select network numbers from its own IP address and the recipient's IP address. Next, the network numbers are compared and if they match, the packet is sent directly to the recipient, otherwise - to the router whose address is specified in the IP protocol settings.

Path selection on the router is based on the information provided in routing table. A routing table is a special table that maps IP addresses of networks to the addresses of the following routers to which packets should be sent in order to deliver them to these networks. A required entry in the routing table is the so-called default route, containing information about how to route packets to networks whose addresses are not present in the table, so there is no need to describe routes for all networks in the table. Routing tables can be built “manually” by the administrator or dynamically, based on the exchange of information carried out by routers using special protocols.

Routing is a network layer process that determines the best path to deliver a packet of information to its recipient. The paths for transmitting information packets are called routes. The best identified routes to "familiar" recipients are recorded and stored in the routing table.

There are two types of routing:

  • Static routing
  • Dynamic routing

The division occurs depending on the method of entry into the routing table.

Routing is carried out by special devices - routers or ordinary computers with several network cards.

Routing in connectionless service-based networks

We will consider the routing process using a conditional example.

According to the example, Host 1 needs to transmit a message to Host 2 (Fig. 1).

In this case, the length of the message is 4 times longer than what is allowed for transmission. Because of this, the message must be split into 4 parts (packets) and sent sequentially to router A.

Router A is connected only to Routers B and C. Accordingly, all packets from Host A can only be transmitted to Routers B and C.

All possible ways The movements of information packets are recorded in the internal routing table. Entries in the routing table correspond to actual connections.

So, 4 packets need to be transmitted through router A. According to the routing table valid for at the moment time, packets 1-3 are transmitted to router C. Then, according to the routing table of router C, the packets are transmitted to E - router, which is connected directly to hosting B. All packets 1-3 are delivered.

At the next moment in time, the routing table on router A changed, suppose due to a traffic jam in the area paths A-C-E. According to the new routing table, Router A forwards packet 4 along the path A-B-D routing, then E and to Khost B.

I note that routing tables are designed according to routing algorithms.

This example was for networks with an unestablished connection. How is routing carried out when a connection is already established?

Routing in Connection-Based Services Networks

In connection-oriented networks, all information packets are transmitted along a single route. This is ensured by establishing a reliable virtual channel for the entire communication session.

The task is to transfer information from Host 1 to Host 2.