Internet Windows Android

Routing protocols in IP networks. IP Routing Protocol Questions to Consider

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-2.jpg" alt="(!LANG:>IP Routing Protocol">!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-3.jpg" alt="(!LANG:>IP address l IPv 4 -address is a unique 32 bit sequence of binary digits,"> IP-адрес l IPv 4 -адрес - это уникальная 32 разрядная последовательность двоичных цифр, с помощью которой компьютер однозначно идентифицируется в IP сети. (на канальном уровне в роли таких же уникальных адресов компьютеров выступают МАС адреса сетевых адаптеров, невозможность совпадения которых контролируется изготовителями на стадии производства.)!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-4.jpg" alt="(!LANG:>IP version l version 4, or IPv 4 l version 6 (IPv6)"> Версии l версия 4 протокола IP, или IPv 4 l версия 6 (IPv 6), в которой IP адрес представляется в виде 128 битной последовательности двоичных цифр. ipv 6 install!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-5.jpg" alt="(!LANG:>Structure l For convenience of working with IP addresses, a 32-bit sequence is usually"> Структура l Для удобства работы с IP адресами 32 разрядную последовательность обычно разделяют на 4 части по 8 битов (на октеты) l каждый октет переводят в десятичное число и при записи разделяют эти числа точками. l в таком виде (это представление называется «десятичные числа с точками» , или, «dotted decimal notation») IP адреса занимают гораздо меньше места и намного легче запоминаются 192. 168. 5. 200 11000000 10101000 0000101 11001000!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-6.jpg" alt="(!LANG:>Subnet mask l The subnet mask is a 32-bit number consisting of going"> Маска подсети l Маска подсети - это 32 разрядное число, состоящее из идущих вначале единиц, а затем - нулей, например (в десятичном представлении) 255. 0 ИЛИ 255. 240. 0.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-7.jpg" alt="(!LANG:>Subnet mask l The subnet mask plays an extremely important role in IP addressing and"> Маска подсети l Маска подсети играет исключительно важную роль в IP адресации и маршрутизации l сеть ARPANet строилась как набор соединенных друг с другом гетерогенных сетей. Для правильного взаимодействия в такой сложной сети каждый участник должен уметь определять, какие IP адреса принадлежат его локальной сети, а какие - удаленным сетям. l здесь и используется маска подсети, с помощью которой производится разделение любого IP адреса на две части: идентификатор сети (Net ID) и идентификатор узла (Host ID). l такое разделение делается очень просто: там, где в маске подсети стоят единицы, находится идентификатор сети, а где стоят нули - идентификатор узла. Например, в IP адресе 192. 168. 5. 200 при использовании маски подсети 255. 0 идентификатором сети будет число 192. 168. 5. 0, а идентификатором узла - число 200. Стоит поменять маску подсети, на число 255. 0. 0, как и идентификатор узла, и идентификатор сети изменятся на 192. 168. 0. 0 и 5. 200, соответственно, и от этого, иначе будет вести себя компьютер при посылке IP пакетов.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-8.jpg" alt="(!LANG:>Rules for assigning network and host IP addresses can only contain"> Правила назначения IP-адресов сетей и узлов 1. идентификатор сети не может содержать только двоичные нули или только единицы. Например, адрес 0. 0 не может являться идентификатором сети; 2. идентификатор узла также не может содержать только двоичные нули или только единицы - такие адреса зарезервированы для специальных целей l все нули в идентификаторе узла означают, что этот адрес является адресом сети. Например, 192. 168. 5. 0 является правильным адресом сети при использовании маски 255. 0 и его нельзя использовать для адресации компьютеров, l все единицы в идентификаторе узла означают, что этот адрес является адресом широковещания для данной сети. Например, 192. 168. 5. 255 является адресом широковещания в сети 192. 168. 5. 0 при использовании маски 255. 0 и его нельзя использовать для адресации компьютеров!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-9.jpg" alt="(!LANG:>Rules for assigning network and host IP addresses l host identifier within one and"> Правила назначения IP-адресов сетей и узлов l идентификатор узла в пределах одной и той же подсети должен быть уникальным; l диапазон адресов от 127. 0. 0. 1 до 127. 255. 254 нельзя использовать в качестве IP адресов компьютеров. Вся сеть 127. 0. 0. 0 по маске 255. 0. 0. 0 зарезервирована под так называемый «адрес заглушки» (loopback), используемый в IP для обращения компьютера к самому себе. PING 127. 12. 34. 56!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-10.jpg" alt="(!LANG:>l IP addresses are allocated globally by a private non-profit corporation called ICANN"> l Распределением IP адресов в мире занимается частная некоммерческая корпорация под названием ICANN (Internet Corporation for Assigned Names and Numbers), а точнее, работающая под ее патронажем организация IANA (Internet Assigned Numbers Authority).!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-11.jpg" alt="(!LANG:>Classic and classless IP addressing">!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-12.jpg" alt="(!LANG:>Development l Initially, the entire space of possible IP addresses was divided into five classes"> Развитие l Первоначальная все пространство возможных IP адресов было разбито на пять классов l принадлежность IP адреса к определенному классу определялась по нескольким битам первого октета l для адресации сетей и узлов использовались только классы А, В и С. l для этих сетей были определены фиксированные маски подсети по умолчанию, равные, соответственно, 255. 0. 0. 0, 255. 0. 0 и 255. 0, которые не только жестко определяли диапазон возможных IP адресов узлов в таких сетях, но и механизм маршрутизации.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-13.jpg" alt="(!LANG:>Address classes in original IP addressing scheme Class First Possible number of bits v"> Классы адресов в первоначальной схеме IP-адресации Класс Первые Возможное число биты в значения сетей узлов в сети октете первого октета А 0 1 -126 16777214 В 10 128 -191 16384 65534 С 110 192 -223 2097152 254 D 1110 224 -239 Используется для многоадресной рассылки (multicast) Е 1111 240 -254 Зарезервирован как экспериментальный!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-14.jpg" alt="(!LANG:>Problems l To obtain the required range of IP addresses, organizations were asked to fill out a registration form ,"> Проблемы l Для получения нужного диапазона IP адресов организациям предлагалось заполнить регистрационную форму, в которой следовало указать текущее число компьютеров и планируемый рост компью терного парка в течение двух лет. l с развитием Интернета такой подход к распределению IP адресов стал вызывать проблемы, особенно острые для сетей класса В. l организациям, в которых число компьютеров не превышало нескольких сотен (скажем, 500), приходилось регистрировать для себя целую сеть класса В. l Поэтому количество доступных сетей класса В стало на глазах «таять» , но при этом громадные диапазоны IP адресов (в нашем примере - более 65000) пропадали зря.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-15.jpg" alt="(!LANG:>Problem Solving l To solve the problem, a classless IP addressing scheme was developed">!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-16.jpg" alt="(!LANG:>Classless Inter. Domain Routing,) , CIDR l missing IP address binding"> Бесклассовая схема IP-адресации (Classless Inter. Domain Routing,), CIDR l отсутствует привязка IP адреса к классу сети и маске подсети по умолчанию l допускается применение так называемых масок подсети с переменной длиной (Variable Length Subnet Mask, VLSM). l Например, если при выделении сети для вышеуказанной организации с 500 компьютерами вместо фиксированной маски 255. 0. 0 использовать маску 255. 254. 0 то получившегося диапазона из 512 возможных IP адресов будет вполне достаточно. Оставшиеся 65 тысяч адресов можно зарезервировать на будущее или раздать другим желающим подключиться к Интернету. Этот подход позволил гораздо более эффективно выделять организациям нужные им диапазоны IP адресов, и проблема с нехваткой IP сетей и адресов стала менее острой.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-17.jpg" alt="(!LANG:>l Calculate the maximum possible number of nodes in any IP network how many bits"> l Рассчет максимально возможного количества узлов в любой IP сети сколько битов содержится в идентификаторе узла, или, иначе, сколько нулей имеется в маске подсети. l Это число используется в качестве показателя степени двойки, а затем из результата вычитается два зарезервированных адреса (сети и широковещания). l Аналогичным способом легко вычислить и возможное количество сетей классов А, В или С, если учесть, что первые биты в октете уже зарезервированы, а в классе А нельзя использовать IP адреса 0. 0 и 127. 0. 0. 0 для адресации сети.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-18.jpg" alt="(!LANG:>LANG IP addresses l All addresses used on the Internet, must register in"> IP-адреса для локальных сетей l Все используемые в Интернете адреса, должны регистрироваться в IANA, что гарантирует их уникальность в масштабе всей планеты. Такие адреса называют реальными, или публичными (public) IP адресами. l Для локальных сетей, не подключенных к Интернету, регистрация IP адресов, естественно, не требуется, так что, в принципе, здесь можно использовать любые возможные адреса. Однако, чтобы не допускать возможных конфликтов при последующем подключении такой сети к Интернету, RFC 1918 рекомендует применять в локальных сетях только следующие диапазоны так называемых частных (private) IP адресов (в Интернете эти адреса не существуют и использовать их там нет возможности): ¡ 10. 0- 10. 255; ¡ 172. 16. 0. 0- 172. 31. 255; а!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-19.jpg" alt="(!LANG:>IP Routing Basics l to properly communicate with other computers and networks , each"> Основы IР-маршрутизации l чтобы правильно взаимодействовать с другими компьютерами и сетями, каждый компьютер определяет, какие IP адреса принадлежат его локальной сети, а какие - удаленным сетям. l если выясняется, что IP адрес компьютера назначения принадлежит локальной сети, пакет посылается непосредственно компьютеру назначения, если же это адрес удаленной сети, то пакет посылается по адресу основного шлюза.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-20.jpg" alt="(!LANG:>Example COMPUTER l IP address - 192. 168. 5. 200 ; l subnet mask -"> Пример КОМПЬЮТЕР l IP адрес - 192. 168. 5. 200; l маска подсети - 255. 0; l основной шлюз - 192. 168. 5. 1. При запуске протокола IP на компьютере выполняется операция логического «И» между его собственными IP адресом и маской подсети l IP адрес в 32 разрядном виде 11000000 10101000 00000101 11001000; l маска подсети - 11111111 0000; l идентификатор сети - 11000000 10101000 00000101 0000 Т. е. 192. 168. 5. 0 идентификатор собственной сети!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-21.jpg" alt="(!LANG:>Example Task: send an IP packet to address 192. 168. 5. 15. l the computer is performing"> Пример Задача: отправить IP-пакет по адресу 192. 168. 5. 15. l компьютер выполняет операцию логического «И» с IP адресом компьютера назначения и собственной маской подсети. l полученный в результате идентификатор сети назначения будет совпадать с идентификатором собственной сети компьютера отправителя.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-22.jpg" alt="(!LANG:>Example him"> Пример Так наш компьютер определит, что компьютер назначения находится в одной с ним сети, и выполнит следующие операции: l с помощью протокола ARP будет определен физический МАС адрес, соответствующий IP адресу компьютера назначения; l с помощью протоколов канального и физического уровня по этому МАС адресу будет послана нужная информация.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-23.jpg" alt="(!LANG:>Example 2 Task: send an IP packet to address 192. 168 10. 20. l The computer will"> Пример 2 Задача: отправить IP-пакет по адресу 192. 168. 10. 20. l Компьютер выполнит аналогичную процедуру определения идентификатора сети назначения. l В результате будет получен адрес 192. 168. 10. 0, не совпадающий с идентификатором сети компьютера отправителя. l Так будет установлено, что компьютер назначения находится в удаленной сети, и алгоритм действий компьютера отправителя изменится: 1. будет определен МАС адрес не компьютера назначения, а маршрутизатора; 2. с помощью протоколов канального и физического уровня по этому МАС адресу на маршрутизатор будет послана нужная информация. Дальнейшая судьба IP пакета зависит от правильной настройки маршрутизаторов, объединя ющих сети 192. 168. 5. 0 и 192. 168. 10. 0. важна правильная настройка маски подсети в параметрах IP адресации!!!!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-24.jpg" alt="(!LANG:> Ways to configure IP settings and check if it works 1. manually assign (easy make a mistake when"> Способами настройки параметров IP и проверка работоспособности 1. назначить вручную (легко ошибиться, при изменении надо перенастраивать, сетевые администраторы полностью контролируют все IP адреса, невозможно работать в крупных корпоративных сетях с мобильными устройствами типа ноутбуков или КПК, которые часто перемещаются из одного сегмента сети в другой) 2. автоматическое получение IP адреса. Специальные серверы, поддерживающие протокол динамической конфигурации узлов (Dynamic Host Con iguration Protocol, DHCP), задача которых состоит f в обслуживании запросов клиентов на получение IP адреса и другой информации, необходимой для правильной работы в сети. Если сервер DHCP недоступен (отсутствует или не работает), то начиная с версии Windows 98 компьютеры самостоятельно назначают себе IP адрес. При этом используется механизм автоматической личной IP адресации (Automatic Private IP Addressing, АРIPA), для которого корпорацией Microsoft в IANA был зарегистрирован диапазон адресов 169. 254. 0. 0 - 169. 254. 255.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-25.jpg" alt="(!LANG:>Checking IP 1. IPCONFIG /ALL. 2 parameters and functionality PING 127."> Проверка параметров и работоспособности протокола IP 1. IPCONFIG /ALL. 2. PING 127. 0. 0. 1 3. PING w. x. y. z, где w. x. y. z - IP адрес соседнего компьютера. 4. PING w. x. y. z, где w. x. y. z - IP адрес основного шлюза. 5. PING w. x. y. z, гдеw. x. y. z - IP адрес любого удаленного компьютера.!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-26.jpg" alt="(!LANG:>Questions 1. What parameters and settings are required to ensure the operation of the TCP protocol stack /IP?2."> Вопросы 1. Какие параметры и настройки обязательны дляобеспечения работы стека протоколов TCP/IP? 2. Что такое IP адрес? Какова его структура? Какиевозможны способы представления IP адресов? 3. Чем отличаются версии 4 и 6 протокола IP? Какие преимущества обеспечит версия 6 протокола IP? Почему возникла необходимость в переходе на версию 6 протокола IP? 4. Что такое маска подсети? Для чего она нужна? 5. В чем заключается смысл разделения IP адреса на идентификаторы сети и узла? Для чего это требуется? 6. Какие IP адреса и маски являются допустимыми, а какие - нет? Почему? 7. В чем различие между классовой и бесклассовой IP адресациями? Каковы их преимущества и недостатки?!}

Src="https://present5.com/presentation/3/159928527_437552731.pdf-img/159928527_437552731.pdf-27.jpg" alt="(!LANG:>Questions 1. What are IP address classes? determined? 2."> Вопросы 1. Что такое классы IP адресов? По каким правилам они определяются? 2. Как назначить IP адреса в локальной сети (без выхода в Интернет)? 3. Каковы основные принципы маршрутизации пакетов в локальных и удаленных сетях? 4. Что такое таблица маршрутов (таблица маршрутизации)? Объясните смысл каждой из ее колонок. 5. Как «прописать» в таблице маршрутизации отсутствующий в ней новый маршрут? 6. Что такое динамическая конфигурация узлов? Для чего она нужна? 7. В чем заключается технология автоматической личной IP адресации? 8. Каков типовой алгоритм проверки работоспособности протокола IP?!}

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 the solution of 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 transmit it over a network to another device through other networks. If there are no routers on the network, then routing is not supported. Routers direct (redirect) traffic to all networks that make up the internetwork.

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

  • Destination address
  • Neighboring 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 the 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 learn (learn) the access paths to the remote network using static routing (manual entry by the administrator of the location of all networks in the routing table) or using dynamic routing.

Dynamic routing is a routing protocol process that determines how a device interacts 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 step-by-step process of host A communicating with host B on another network. In the example, the user of host A pings the IP address of host B. The next operations are not so simple, so let's consider them in more detail:

  • At the command prompt, the user types ping 172.16.20.2. Host A generates a packet using network layer protocols and ICMP.

  • IP uses ARP to find out the destination network for the packet by looking up the IP address and subnet mask of host A. This is a request to the remote host, i.e. the packet is not destined for the host on the local network, so the packet must be routed to the router to be forwarded to the correct remote network.
  • In order for Host A to send a packet to the router, the host must know the hardware address of the router's interface connected to the local network. The network layer passes the packet and the hardware destination address to the link layer for framing and forwarding to the local host. To obtain the 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. After caching the address, there is usually no timeout.
  • The router responds and reports the hardware address of the Ethernet interface connected to the LAN. Now the host has all the information to forward the packet to the router on the local network. The network layer drops the packet down to generate an ICMP echo request (Ping) at the link layer, padding 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 type of packet (ICMP) in the network layer protocol field.
  • The link layer forms a frame in which the packet is encapsulated along with the control information needed to be sent over the local network. This information includes the source and destination hardware addresses, and the value in the type field set by the network layer protocol (this will be the type field because IP uses Ethernet_II frames by default). Figure 3 shows a frame generated at the link layer and sent 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 the frame CRC checksum located in the FCS (Frame Check Sequence) field.
  • The link layer of host A sends the frame to the physical layer. There, zeros and ones are encoded into a digital signal, followed by transmission of this signal over a local physical network.

  • The signal reaches the router's Ethernet 0 interface, which is synchronized to the digital signal preamble to extract the frame. The router interface checks the CRC after building the frame, and at the end of the frame reception compares the received value with the contents of the FCS field. It also checks the transfer process for fragmentation and media conflicts.
  • The hardware address of the destination is checked. Because it matches the router address, the frame type field is parsed to determine what to do with this data packet. The type field is set to IP, so the router passes the packet to the IP process running on the router. The frame is removed. The original packet (generated by host A) is buffered by the router.
  • The IP protocol looks at the destination IP address in the packet to determine if the packet is directed to the router itself. Because 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 buffered packet to Ethernet interface 1. The router needs to form a frame to forward the packet to the destination host. The router first checks its ARP cache to determine if the hardware address has already been resolved during previous interactions with the network. If the address is not in the ARP cache, the router sends an ARP broadcast request to the Ethernet 1 interface to look up the hardware address for the IP address 172.16.20.2.
  • Host B responds with the hardware address of its network adapter to the 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.

A frame generated by the router's Ethernet 1 interface has a hardware source address from Ethernet 1 and a hardware destination address for Host B's network adapter. source and destination never change. The packet 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 dropped and the packet is passed to the IP protocol. It parses the destination IP address. Because the destination IP address is the same as the address set on Host B, IP 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 source IP equal to host B and destination IP equal to host A. The process restarts, but in the opposite direction. However, the hardware addresses of all devices along the path of the packet 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 go through more sections on the way to the destination host.

Routing tables

In the TCP/IP stack, routers and end nodes make decisions about who to forward 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 routing 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 building a single-route routing table, it is necessary to specify only one path to the network 116.0.0.0 according to the smallest metric value.

As you can see, the table defines several routes with different parameters. Read each such entry in the routing table as follows:

To deliver a packet to a network with an address from the Network address field 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 field Metrics.

In this table, the "Destination network address" column contains the addresses of all networks to which this router can forward packets. In the TCP/IP stack, the so-called one-hop approach to optimizing the packet forwarding route (next-hop routing) is adopted - 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 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, the responsibility for choosing the next routing hop is transferred to the next router. A one-hop approach to routing means a distributed solution to the route selection problem. This removes the limit on the maximum number of transit routers on a packet's path.

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

One-hop routing has another advantage - it allows you to reduce the volume of routing tables in end nodes and routers by using the so-called default route - default (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 transmitted to the router specified in the default line. Therefore, routers often store limited information about networks on the Internet in their tables, forwarding packets for other networks to the default port and router. It is assumed that the default router will forward the packet to the backbone network, and the routers connected to the backbone have complete information about the composition of the Internet.

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

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 a terminal node, the route should be chosen differently than for all other nodes of the network to which it belongs. In the case when the table has different packet forwarding entries for the entire network N and its individual node with address N,D, when a packet arrives addressed to node N,D, the router will give preference to the entry for N,D.

Entries in the routing table relating to networks directly connected to the router have zeros ("connected") in the "Metric" 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 the 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 does not know about.

Simple routing

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

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

  • Random routing is the transmission of a message from a node in any randomly chosen direction, except for the directions in which the message arrived at the node.
  • Flooding is the transfer of a message from a node in all directions, except for the direction in which the message arrived at the node. Such routing guarantees a short packet delivery time, at the expense of throughput degradation.
  • Routing by previous experience - each packet has a counter of 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 the network topology, but the adaptation process is slow and inefficient.

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

Fixed Routing

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

  • Single-path fixed routing is when a single path is established between two subscribers. A network with such routing is unstable to failures and congestion.
  • Multipath Fixed Routing - Multiple possible paths can be set 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, 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 links between routers. Usually, not only the topology of links is taken into account, but also their throughput and state.

Adaptive protocols allow all routers to collect information about the topology of links in the network, quickly processing all changes in the configuration of links. 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 generalize topological information: this work is distributed among all routers, the following algorithms are distinguished:

  • Local adaptive routing - each node contains information about the state of the communication line, queue lengths and a routing table.
  • Global adaptive routing - based on the use of information received from neighboring nodes. To do this, each node contains a routing table, which indicates the time it takes for messages to pass through. Based on the information received from neighboring nodes, the value of the table is recalculated taking into account the length of the queue 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 - based on the use of a table periodically sent by the center and on the analysis of 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 performance attempts to answer the question of how an algorithm determines the preference of one route over others.

Routing algorithms use many different metrics. Complex routing algorithms for route selection can be based on multiple indicators, combining them in such a way that the result is one hybrid indicator. The following are the metrics that are used in routing algorithms:

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

Route length.

Route length is the most common measure of routing. 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 link that has been traversed. Other routing protocols specify a "hop count" (number of hops), i.e., a measure of the number of passes a packet must make on its way from source to destination through network interconnection elements (such as routers).

Reliability.

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

Delay.

Routing delay is usually understood as the amount of time it takes for a packet to travel from source to destination across the internetwork. Latency depends on many factors, including the bandwidth of the intermediate network links, queues at the port of each router along the path of the packet, network congestion on all intermediate links of the network, and the physical distance that the packet needs to be moved. Since there is a conglomeration of several important variables here, latency is the most common and useful metric.

Bandwidth.

Bandwidth refers to the available traffic power of any channel. Ceteris paribus, a 10 Mbps Ethernet link is preferred over any leased line with a bandwidth of 64 Kbps. Although bandwidth is an estimate of the maximum achievable throughput of a link, routes traversing higher bandwidth links will not necessarily be better than routes traversing slower links.

TCP/IP communication protocol

The Internet, which is a network of networks and unites a huge number of different local, regional and corporate networks, functions and develops thanks to the use of a single TCP / IP data transfer protocol. The term TCP/IP includes the names of two protocols:

  • Transmission Control Protocol (TCP) - transport protocol;
  • Internet Protocol (IP) is a routing protocol.

Routing protocol. The IP protocol provides for the transfer of information between computers on a network. Let's consider the operation of this protocol by analogy with the transfer of information using regular mail. In order for the letter to reach its destination, the address of the recipient (to whom the letter is) and the address of the sender (from whom the letter is from) are indicated on the envelope.

Similarly, information transmitted over the network is "packed into an envelope" on which the IP addresses of the recipient's and sender's computers are "written", for example, "To: 198.78.213.185", "From: 193.124.5.33". The contents of the envelope in computer language is called by IP packet and is a set of bytes.

In the process of forwarding ordinary letters, they are first delivered to the post office closest to the sender, and then transferred along the chain of post offices to the post office closest to the recipient. At intermediate post offices, letters are sorted, that is, it is determined to which next post office a particular letter must be sent.

IP packets on the way to the recipient computer also pass through numerous intermediate Internet servers on which the operation is performed. routing. As a result of routing, IP packets are sent from one Internet server to another, gradually approaching the recipient computer.

Internet Protocol (IP) provides routing of IP packets, that is, the delivery of information from the sending computer to the receiving computer.

Determination of the route of information passage. The "geography" of the Internet differs significantly from the geography we are accustomed to. The speed of obtaining information does not depend on the remoteness of the Web server, but on the number of intermediate servers and the quality of the communication lines (their bandwidth) through which information is transmitted from node to node.

You can get acquainted with the route of information on the Internet quite simply. The special tracert.exe program, which is included with Windows, allows you to trace through which servers and with what delay information is transmitted from the selected Internet server to your computer.

Let's see how access to information is realized in the "Moscow" part of the Internet to one of the most popular search servers of the Russian Internet www.rambler.ru.

Determination of the information flow path

2. In the window MS-DOS session in response to the system prompt to enter the command .

3. After some time, a trace of information transmission will appear, that is, a list of nodes through which information is transmitted to your computer, and the time of transmission between the nodes.


Tracing the information transfer route shows that the www.rambler.ru server is at a "distance" of 7 hops from us, i.e. the information is transmitted through six intermediate Internet servers (through the servers of the Moscow providers MTU-Inform and Demos). The speed of information transfer between nodes is quite high, one "transition" takes from 126 to 138 ms.

transport protocol. Now imagine that we need to send a multi-page manuscript by mail, but the post office does not accept parcels and parcels. The idea is simple: if the manuscript does not fit into a regular postal envelope, it should be sorted into sheets and sent in several envelopes. At the same time, the sheets of the manuscript must be numbered so that the recipient knows in what sequence these sheets should be joined later.

On the Internet, a similar situation often occurs when computers exchange large files. If you send such a file in its entirety, then it can "clog" the communication channel for a long time, making it inaccessible for sending other messages.

To prevent this from happening, on the sender computer, it is necessary to split a large file into small parts, number them and transport them in separate IP packets to the recipient computer. On the receiving computer, you need to assemble the source file from the individual parts in the correct sequence.

Transmission Control Protocol (TCP), that is, the transport protocol, provides for splitting files into IP packets during transmission and assembling files during receipt.

Interestingly, for the IP protocol responsible for routing, these packets are completely unrelated to each other. Therefore, the last IP packet may well overtake the first IP packet along the way. It may happen that even the delivery routes of these packages will be completely different. However, TCP will wait for the first IP packet and reassemble the source file in the correct sequence.

Determination of the time of exchange of IP packets. The time of IP packet exchange between the local computer and the Internet server can be determined using the ping utility, which is included with the Windows operating system. The utility sends four IP packets to the specified address and shows the total transmission and reception time for each packet.

Determination of IP packet exchange time

1. Connect to the Internet, enter the [Programs-MS-DOS Session] command.

2. In the window MS-DOS session in response to the system prompt to enter the command .

3. In the window MS-DOS session the result of the test passage of the signal in four attempts will be displayed. The response time characterizes the speed parameters of the entire chain of communication lines from the server to the local computer.


Questions for reflection

1. What ensures the holistic functioning of the global computer network Internet?

Practical tasks

4.5. Track the route of information from one of the most popular Internet search servers www.yahoo.com, located in the "American" segment of the Internet.

4.6. Determine the time of exchange of IP packets with the www.yahoo.com server.

IP stands for Internet Protocol (Internet Protocol), and specifically the 4th version of this protocol is currently the most common. IPv4 is defined through RFC 791.

Within OSI, it is a network (3rd) layer protocol. This level, I remind you, is designed to determine the path of data transfer.

IPv4 uses packet switching. In this case, the original transmitted message is divided into small parts (packets), which are transmitted independently over the network.

In addition, IPv4 does not guarantee the delivery of packets, or the absence of duplicates. This is the so-called “best effort delivery” (as opposed to guaranteed delivery). Accordingly, these tasks are transferred to higher-level protocols, such as TCP.

Addressing

IPv4 identifies the sender and recipient using a 32-bit address, which limits the number of possible addresses to 4,294,967,296. Of this number, IPv4 reserves special address ranges called private (~18M) and multicast (~270M).

Addresses are usually written as four dotted decimal octets, for example: 198.51.100.25 corresponds to the number C6336419 16 .

When using the global address space, it is necessary to distinguish between the addresses available in local physical networks that do not require routing, and addresses that are physically located on another network. In the case of the latter, the packets are directed to the router, which must pass them on.

In the first versions of the standard, the first octet was used to identify the network, the rest to identify the host. It quickly became clear that 256 networks is not enough. Therefore, classes of networks were introduced:

Class First beats Network address length Host address length
A 0 8 24
B 10 16 16
C 110 24 8
D 1110 N/A N/A
E 1111 N/A N/A
Class Range start End of range
A 0.0.0.0 127.255.255.255
B 128.0.0.0 191.255.255.255
C 192.0.0.0 223.255.255.255
D 224.0.0.0 239.255.255.255
E 240.0.0.0 255.255.255.255

Class D is reserved for multicast, class E is just reserved "just in case".

The length of the network address and the length of the host address were determined by the first bits of the address. Since about 1985, this has also been abandoned. The reasons for this are that many organizations demanded more addresses than the class C network provided and received a class B network. The class B network, however, exceeded the requirements of the organization many times over.

Network classes have been replaced by a network mask. This is a bitmask that indicates which bits of the address are network and which are host. By standard convention, the mask must be filled from left to right, so that the network address is always in the high bits. This allows you to specify only network address length, instead of the entire netmask.

For example, 192.0.2.0/24 means that the first 24 bits (three octets) are for the network address and the rest are for the host address. /24 is equivalent to the netmask 255.255.255.0.

The use of netmasks is described in RFC 1517.

Numerous standards also reserve different address ranges for special needs.

Range Description RFC
0.0.0.0/8 Current network (source address) 6890
10.0.0.0/8 private network 1918
100.64.0.0/10 Shared address space CGN 6598
127.0.0.0/8 loopback 6890
169.254.0.0/16 Autoconfiguration 3927
172.16.0.0/12 private network 1918
192.0.0.0/24 IETF Protocol Assignments 6890
192.0.2.0/24 Documentation and examples 1 5737
192.88.99.0/24 Relay ipv6 to ipv4 3068
192.168.0.0/16 private network 1918
198.18.0.0/15 Network bandwidth testing 2544
198.51.100.0/24 Documentation and examples 2 5737
203.0.113.0/24 Documentation and examples 3 5737
224.0.0.0/4 Multicast 5771
240.0.0.0/4 reserved 1700
255.255.255.255 Broadcast request 919

Host addresses are also reserved, in binary representation consisting of zeros (denoting the entire network, reserved) and ones (broadcast request for this network).

For example, 203.0.113.0 means (in the text) network 203.0.113.0/24, and 203.0.113.255 means a broadcast request to that network.

Packet Format

A packet consists of a header and data. IP does not imply any integrity check. The underlying protocol (say, Ethernet) already provides integrity checks at the data link layer, and the higher one (say, TCP) at the data layer.

Version, 4 bits The first header field. In IPv4, the value is 0010 2 , i.e. 4. Header length, 4 bits Number of 32-bit words in the header. The minimum value is 5, which corresponds to a header length of 20 bytes. The maximum is 15, the length of the header is 60 bytes. DSCP or ToS - type of service, 6 bits Specifies the prioritization for, say, VoIP. ECN, 2 bits Flag for explicit indication of network congestion. Requires support from both sides (receiving and transmitting). When this flag is received, the baud rate is reduced. If the flag is not supported, the packets are simply dropped. Total length, 16 bits The total length of the packet in bytes, including header and data. The minimum length is 20, the maximum length is 65535. Identification, 16 bits Used to uniquely identify the datagram. Because it may be necessary to split a packet into smaller pieces when being transmitted over different networks, this field is used to identify the pieces that belong to the same packet. Flags, 3 bits

Bit flags:

  1. Reserved, always 0
  2. Don't fragment. If further transmission of the packet requires fragmentation, the packet is discarded.
  3. More fragments. For fragmented packets, all but the last one have this flag set to 1.
Offset, 13 bits The offset of the fragment relative to the beginning of the datagram, measured in blocks of 64 bits. The first fragment has an offset of 0. The maximum offset is 65528 bytes, which exceeds the maximum packet length of 65515 (minus the 20-byte header). Time To Live (TTL), 8 bits When a packet passes through a router, this field is decremented by 1. If this field is zero, the router discards it. Protocol, 8 bit
  • 1-ICMP
  • 6 - TCP
  • 17-UDP
Header checksum, 16 bits The sum of 16-bit words in the header is considered, except for the checksum itself. This sum is also summed up in blocks of 16 bits until one remains. Then negation is bitwise applied to the result. Sender's address, 32 bits Everything is clear here Receiver's address, 32 bits Everything is clear here too. Options (optional field)

Rarely used. Consists of header-data blocks. The option header is 8-16 bits long and consists of the following fields:

  • Option type, 8 bits - a field specifying what the option is. The value “0” means the end of the list of options. A total of 26 codes are registered.
  • Length, 8 bits - the size of the entire option in bits, including the header. For some types of options may be missing.

ARP

IP defines logical addresses. However, in order to send a packet on an Ethernet network, you must also know the physical address of the destination host (or router). The ARP protocol is used to map one to the other.

ARP (Address Resolution Protocol) is formally a network (3rd) layer protocol in the OSI model, although it actually provides layer 2 and layer 3 interaction. ARP is implemented for various layer 2 and layer 3 protocol pairs.

The protocol itself is built on a simple request-response scheme. Let's look at a specific example.

If a host, say A with logical address 198.51.100.1 (on the network 198.51.100.0/24) wants to send a packet to host B with logical address 198.51.100.2, it sends a layer 2 protocol broadcast request (in this case Ethernet) with an encapsulated message ARP asking network nodes - what is the physical address of the node with the logical address 198.51.100.2, and containing the logical and physical addresses of node A. Node B, having seen its own logical address in the request, sends a response to node A at the logical and physical address received in the request. Query results are cached.

ARP messages have the following structure:

Physical protocol (HTYPE), 2 bytes Layer 2 protocol used. Ethernet has identifier 1. Logical protocol (PTYPE), 2 bytes Layer 3 protocol used. Corresponds to EtherTypes. IPv4 has an ID of 0x0800. Physical address length (HLEN), 1 byte Physical address length in octets, for Ethernet - 6 Logical address length (PLEN), 1 byte Logical address length in octets, for IPv4 - 4 Operation (OPER), 2 bytes 1 for request, 2 for the answer, and many other options for protocol extensions. Sender's physical address (SHA), HLEN bytes In the request, the requester's address. The response contains the address of the requested node. Sender's logical address (SPA), PLEN bytes
Destination physical address (THA), HLEN bytes Ignored in the request. The response contains the address of the requester. Destination logical address (TPA), PLEN bytes

Typically, network nodes also send ARP messages when changing their IP address or when they turn on. This is usually implemented as an APR where TPA=SPA and THA=0. Another option is an ARP response in which TPA=SPA and THA=SHA.

In addition, ARP can be used to detect a logical address conflict (with SPA=0).

There are protocol extensions that perform the reverse operations, InARP (Inverse ARP), which obtains an L3 address from an L2 address, and RARP, which obtains the L3 address of the requesting node.

RARP was used to autoconfigure L3 addresses. Subsequently replaced by BOOTP and then DHCP.

Routing in IPv4 networks

The basic routing algorithm in IPv4 networks is called the forwarding algorithm.

If there is a destination address D and a network prefix N, then

  • If N matches the network prefix of the current node, send data over the local link.
  • If there is a route for N in the routing table, send data to the next-hop router.
  • If there is a default route, send next-hop data to the default router
  • Otherwise, it's an error.

The routing table is a mapping table between network addresses and next-hop router addresses for those networks. So, for example, a node with the address 198.51.100.54/24 can have the following routing table: 203.0.113.0/24

Destination Gateway device
198.51.100.0/24 0.0.0.0 eth0
203.0.113.0/24 198.51.100.1 eth0
0.0.0.0/0 203.0.113.1 eth0

Basically, the route is also tied to the network device from which the data should be sent.

If the node can be reached via multiple routes, the route with the longer netmask (i.e., the more specific one) is chosen. There can only be one default route.

For example, host 198.51.100.54/24 has a routing table:

Destination Gateway device
198.51.100.0/24 0.0.0.0 eth0
203.0.113.0/24 198.51.100.1 eth0
203.0.113.224/27 198.51.100.5 eth0