Computer Network - Network layer - routing algorithm

Computer Network - Network layer - routing algorithm

Optimization principle

1. Each part of the best path is the best path
if the router from the optimal path J on router I to K, then the optimal path from J to K must be along the same routing path

2. access to all the best path router and set is a collection of tree called

3. The purpose of the routing algorithm
to find and use all routers tree collection

Shortest Path Routing

Dijkstra's algorithm

1. Each node from a source node along with the best known path distance of the node to be labeled, and the label into permanent labels temporary label
2. Initially, all nodes are labeled temporary denoted as infinity
3 the source node labeled 0, and permanent label, to make it work and node
4 checks node adjacent to the temporary working node, if the node is less than the distance to the label of the working node and node operation annotation node, with the new calculated and relabel the node
5. Find the minimum value throughout the figures with temporary annotation nodes, the node which becomes permanent, and the next round of checking the working node
6. repeat fourth, five-step, until the destination node becomes the working node

Flooding algorithm

description

A simple method of data packets sent to all network nodes, each node sends its packets to the new addition to all the other link flooding received on the incoming links, it is a static algorithm

problem

  • Duplicate packets, due to the circulation may be an infinite number
  • Nodes need to keep track of packet flooding to prevent flooding
  • Even with restrictions on the number of hops will be doubled explosion

Two solutions measures

  • Header of each packet contains a hop counter, after every hop of the counter by one, to 0 then the packet is discarded

  • Record which packet has been diffused, thereby avoiding re-transmission of these packets. Method:
    1. Each packet header a sequence number, each time a new packet transmission plus 1
    at each router 2. The recording it sees all (source router, serial number) of
    3. When a packet arrives, the router check the packet, if repeated, is no longer a proliferation

Selective diffusion

It is a flooding an improved method, each packet is transmitted only to come close to the right direction on the line

Diffusion method application

  • Highly robust diffusion method can be used for military applications
  • Distributed database applications, can be used to simultaneously update all databases
  • It can be used in a wireless network
  • As a measure diffusion method, other routing algorithm for comparison

Distance vector algorithm

description

Distance vector is a distributed routing algorithm, the shortest path is calculated across nodes allocated, is the dynamic algorithm, is used for the RIP protocol.

ALGORITHM

1. Each node knows the distance to its neighbors in the link
2. Each node advertised minimum distance vector known to all neighbors
3. Each node using the received vector to update its own vector
4. Recurring

principle

1. Each router maintains a routing table (see below)


2. Each subnet routing table to index router (such as the right of To), and each entry corresponds to a router
3. The entry consists of two parts: the time of arrival estimate or router object distance estimation (as in FIG. the New estimated delay form J), and an output line to the destination router (such as the right of line) used in the preferred
4 intervals, the router sends all its neighbor routers to each destination node routing table, and it each also receives neighbor routers, the routing table
5. a router is received from a neighboring router sent the X table, wherein Xi is a distance from the router to router X i, if the distance X to the router is m, then the through the router to the distance X i is Xi + m. The information different from the neighbor calculated Xi + m, and the minimum value, the routing table update this

problem

Infinite calculation
algorithm drawbacks: rapid response to good news, bad news unresponsive to
the core of the problem: when X tells Y that it has a path when, Y do not know if he himself on this path

Link-state routing algorithm

In order to solve the problem of distance vector algorithms?

1. The main problem of distance vector routing algorithm
2. When selecting a route without considering line bandwidth (different lines of different bandwidths)
3. routing convergence speed (calculation infinity)

description

Alternatively distance vector calculation more, but with a simple dynamic

Algorithm Overview

Each node in the flood information about their neighbors in the LSP (Link State Packet).
All nodes learn and complete network diagram
algorithm each node runs Dijkstra to calculate the path to other destinations

Process Description

1. Discover neighbors, and know its network address

  • Router starts, by sending a neighbor node discovery HELLO packets
    2 measured each neighbor node to delay or overhead
  • A straightforward method is: a sending of ECHO packet, and the other end sends a response immediately, the delay is the round-trip time divided by 2
  • Sometimes you need to consider the load
    3. Create a link state packet
  • Identifier of packets constituting the sender, serial number, age, neighbor list. Entry includes a router neighbors, and neighbors to this delay
  • When to create create a link state packet? Regularly create or major incidents
    4. Send this packet to all other routers

The basic idea:

  • 3 link state packet diffusion method using
  • Diffusion control, a serial number to each packet header, each time a new data packet plus 1
  • Each router record sees all the (source router, serial number) of
  • When a link state packet arrives, the router examines the packet
  • If the new router in the packet list to see the check received packets, if there is new, then in addition to that line it coming on line all the other forwards the packet
  • If a duplicate, it is discarded
  • If outdated, if the number is smaller than the current maximum number seen from the router, it is considered obsolete, are discarded

Improve:

  • Rotation number may be confusing. The solution: use a 32-bit number. Even if one packet per second, required 137 years to Rotary
  • After collapse of the router, if it starts from 0 again, the next packet is discarded as a duplicate packet. Solution: packet increasing age (age) field per second minus the age of 1, is zero, the information is discarded from the router
  • Serial number is damaged. The solution: the packet domain increases with age
  • When the link state packet arrives, a time delay, and link state packet data comparison from the same number of routers has been reached in the other, discarding duplicate packets, keep the new packet
  • All link state packet reply is required

Send flag is 1: need to forward in this direction,
confirming flag is 1: must be confirmed in this direction

A link state packets from the direct arrival, B it must be sent to C, F, A to return acknowledgment
sent from a link state packet E has two, one after the EAB, EFB after another
from the D the link state packets sent to two, one after the DCB, through another DFB

Use Agreement

Widely used Internet (OSPF, ISIS)

Hierarchical routing

Why use hierarchical routing?

As the network grows in size, rapid growth in the router's routing table, router memory footprint, but also time-consuming to scan the table, very troublesome.

Hierarchical routing how to do?

Routers are divided into regions, each router knows how to send packets to the destination address of its location, but the internal structure of other regions seem unaware of each other when connected to network together, it is natural to each network You do not have to know the topology of other networks.

Examples


It is divided into five regions, if the complete route 1A router table entry 17, if the hierarchical routing, the entries on the right, is reduced a lot.

cost

The cost of increasing the length of the route

Broadcast routing

  • The broadcast packet to all nodes
  • The RPF (Reverse Path Forwarding), will be broadcast on the incoming link is sent to all remaining links, or may be constructed using a receiver, and all the nodes on the tree

Multicast routing

  • Multicast transmission to a subset of nodes is referred to as the group
  • Using different source tree for each group and

Guess you like

Origin www.cnblogs.com/mengxiaoleng/p/11890343.html