Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Burgess M.Principles of network and system administration.2004.pdf
Скачиваний:
181
Добавлен:
23.08.2013
Размер:
5.65 Mб
Скачать

10.6. IP ROUTING AND FORWARDING

401

telephony and computer networking in a single integrated solution. ATM was originally envisaged as a competitor to the TCP/IP that would work both at LAN and WAN scales, however it has lost out to IP in LANs due mainly to IP’s ability to work across a variety of technologies. It was assumed that ATM would run over SONET, but this is not a necessity.

ATM offers Quality of Service (QoS), that enables it to offer guaranteed bandwidth to customers.

Rather than speaking of ‘packets’, ATM speaks of ‘cells’. Cells have a fixed size, which makes multiplexing them extremely easy. In the 1980s this was seen as a great advantage over rival link layers such as Ethernet, since it allowed much higher speeds to be achieved. ATM is a hybrid of layer 2 and layer 3 technology. In order to ‘route’ ATM packets over a complex network of junctions, a ‘virtual circuit’ must be established. This is either routed ‘by hand’, i.e. programmed by an administrator, or established with the aid of routing protocol. In other words, ATM needs help in order to route traffic. In this respect it is like frame relay.

ATM is a switched technology – it does not support broadcast in the normal sense, however it has a LAN emulation mode (LANE) which admits the use of ATM for local networking; this has not received wide acceptance. ATM allows bandwidth allocation and Quality of Service (QoS) guarantees. ATM transmits only fixed-size frames, called cells, not variable-sized frames as with frame relay and packet switching. The standard for ATM cell relay is 53 byte cells. Frame relay will probably be used in the future as an inter-operable access protocol to higher speed ATM networks. Thus, frame relay and ATM are likely to be complementary rather than competitive technologies in the future.

10.6 IP routing and forwarding

Packet switches forward data from one cable to another, thus securing routes for end to end communication. There are two processes at work here:

Routing: is the process of discovering network topology and selecting a viable path from one place to another.

Forwarding: is what a packet switch does at each junction of a packet’s journey: it is the selection of the next hop towards a final destination, based on the best available route (see figure 10.4). Forwarding is sometimes performed in hardware and sometimes in software.

With virtual circuits and purely layer 2 technology, forwarding tables have to be built up by hand. Above a certain level of complexity, however, it becomes impractical to manage the routes through a network by programming forwarding tables by hand. Global networks have a highly non-trivial structure that cannot be managed without computational assistance. Routing protocols are designed to provide this assistance, by ‘signaling’ between switches. Signaling is a process which requires a protocol that can discover network topology and program software-programmable switches with the necessary information to construct and

402

CHAPTER 10. NETWORK-LEVEL SERVICES

foreach interface attached to router

{

if (destination-network == interface-address)

{

Deliver packet to interface

}

else

{

foreach network in forwarding table

{

if (destination-network == network)

{

Deliver packet to neighbor router

}

else

{

Deliver packet to default route

}

}

}

}

Figure 10.4: A simplified, schematic forwarding algorithm, given a table of information about the structure of the network and the immediate neighbors. To take into account subnetting and CIDR masks, we must interpret the equals ‘==’ sign to include a logical AND between the network and its mask.

maintain forwarding tables. The Internet Protocol family was designed for this purpose. It uses a routable packet format in which:

1.Every IP datagram contains the IP address of its destination host, and can thus be routed independently.

2.Each IP address contains a network part that identifies a unique destination network, somewhere on the Internet.

3.Every network is connected to the Internet by a router.

This arrangement leads to a fairly simple hierarchy that is, in principle, sufficient to send traffic to any destination. The datagram forwarding algorithm used by routers is straightforward, and uses a lookup table, called a forwarding table. The forwarding table lists network addresses and interfaces over which to send the packet, either to reach the next hop router or the final host (see figure 10.4).

Protocols that set up forwarding tables include Open Shortest Path First (OSPF) and the Routing Information Protocol (RIP) to name but two examples. Unfortunately, these protocols do not scale very well to very large numbers of

10.6. IP ROUTING AND FORWARDING

403

networks, so they are only used within limited regions called areas, or groups of areas called Autonomous Systems.1 Between such areas, a different system of forwarding is used. This is a deliberate strategy that has several benefits.

The task of finding detailed routes can be delegated to small autonomous areas, which behave as closed containers with privacy policies. This is called interior routing.

The task of locating the correct autonomous area can be handled separately, using an aggregate label for all of the networks within the container. This is called exterior routing.

Another advantage of the container model is that, by assigning local route autonomy, one can build private networks. Today, this allows a business model for the Internet, in which passage through someone else’s autonomous region can be charged for or otherwise made into a contractual agreement.

How do we progress from creating such a simple local algorithm to directing traffic over the entire globe? The answer to this lies in the hierarchy of the network structure. When a router does not know where to send a packet, it sends it to a generic default route: this normally takes the search up a level of the hierarchy to a router that knows about more subordinate networks.2 The very top level routers (between Autonomous Systems) know implicitly about all of the networks on the Internet. This idea assumes that the network is a strict hierarchy, but it is only approximately a hierarchy. A suitable generalization of a tree structure is to form a top level super-network mesh, that connects multiple parallel tree/mesh structures (see figure 10.5).

Thus, rather than dealing with one huge mesh, there is a forcible break-up into routing domains, or Autonomous Systems.

Definition 7 (Autonomous System). An Autonomous System is an aggregate of networks that belongs to a single political entity on the net; often, it represents a large organization, such as an Internet Service Provider or company. The networks within an Autonomous System share a common external routing policy. More importantly for the scalability of the Internet, Autonomous Systems are black-box containers, somewhat analogous to file-directories that hide detail from the top-level view of locating networks within containers. They allow separation of responsibility for what happens inside from what happens in between. Each AS has a label or AS number. Inside an AS, traffic flows freely along optimal paths, without regard for politics. Between Autonomous Systems, the politics of organizations decide which routes are allowed to pass through neighboring ASs.

To cope with the scaling issues, this extra hierarchical structure has been added to the Internet. The Autonomous System structure allows aggregation of networks

1The nomenclature of network region units is confused. Strictly speaking, only OSPF speaks of areas, and only BGP defines true autonomous systems. However, Cisco OSPF refers to autonomous systems as groups of related areas. We use these terms in their intended spirit, but loosely.

2This is like typing cd . . . when one is navigating a file system. If we do not know the location of a file, it makes sense to just go up a level to get a better overview.

404

CHAPTER 10. NETWORK-LEVEL SERVICES

Figure 10.5: A simplified view of the approximately two-level hierarchy of the Internet. If we arrange the Autonomous Systems in a circle, we see a spatial distinction between the lower level network (radiating from the center) and the interconnections between the tops of each ‘tree’. The dark spots represent the Border Gateways or top-level routers in these Autonomous Systems. Traffic that crosses from one AS to another is passed along these ‘exterior routes’ (dashed lines). The BGP protocol acts as a directory service for locating networks in the Autonomous Systems, somewhat like finding files in directories. Once traffic arrives at the correct AS, it is up to the local AS to get the packets to their destination through the low-level network. Note that few low-level networks are really tree-like, but they are often approximately so, somewhat like a file system with extra symbolic links.

into families that are referred to by collective labels or prefixes, thus reducing the number of forwarding table entries that have to be placed in top-level routers.

10.6.1Static routing

We have already considered static routing in section 2.7.5, in connection with setting up a host in a LAN. Since most LANs are connected by only a single router, it suffices to delegate the task of ‘getting there from here’ to that router. One does this by sending all traffic to the default location: the LAN router. This is just a single entry in a routing table. On Unix-like systems this table looks something like this:

Routing Table: IPv4

 

 

 

 

 

Destination

Gateway

Flags

Ref

Use

Interface

--------------------

-------------------- ----- ----- ------ ---------

128.39.89.0

128.39.89.4

U

1

8

le0

224.0.0.0

128.39.89.4

U

1

0

le0

default

128.39.89.1

UG

1

67

 

127.0.0.1

127.0.0.1

UH

1

0

lo0

Routing Table: IPv6

 

 

 

 

 

Destination/Mask

Gateway

 

Flags Ref Use If

---------------------

--------------------------- ----- --- --- -----

2001:700:700:3::/64

2001:700:700:3:a00:20ff:fe85:bb11 U 1

0 le0:1

10.6. IP ROUTING AND FORWARDING

 

 

 

405

fe80::/10

fe80::a00:20ff:fe85:bb11

U

1

0

le0

ff00::/8

fe80::a00:20ff:fe85:bb11

U

1

0

le0

default

fe80::2a0:c9ff:fe28:2489

UG

1

0

le0

::1

::1

UH

1

9

lo0

It is a list of interfaces, and networks that can be reached from them. The table contains a default route for ‘all other traffic’. One can easily extend this idea over a larger network, and configure routes manually by knowing all of the interfaces and networks available to them. This would be a huge job, however, prone to error.

10.6.2Source routing

Source routing is like creating a Permanent Virtual Circuit. The source host must have knowledge of all the network hardware and its topology. It then specifies the exact route that a packet must take through the network. In other words, the path through the network is predetermined. Normally, this is not the case: changing topology and errors mean that one cannot guarantee the same route, so adaptive routing is used, in which routes are not fixed at the outset; packets are sent by the best available route at the time, hop by hop.

10.6.3Routing protocols

Automated, adaptive routing protocols fall into two classes:

Distance Vector (DV) algorithms: e.g. RIP or (E)IGRP. These use the Bell- man–Ford shortest path algorithm, which is approximately as follows: each router begins by announcing its own beliefs about network topology. As it receives messages from other neighboring routers, it revises this belief and re-announces. A cost or metric is assigned to reaching a particular network from each router. The cost is usually the number of hops required to reach the destination, so a network attached to a neighboring router would have a hop-count of 1 from its origin. The algorithm then reasons: if router A is one hop away from router B, who believes that it is 4 hops away from network X, then A must be 5 hops away from network X. As all of the messages are sent and resent, the numbers get adjusted and the path costs (metrics) stabilize. A router then picks the cheapest available route to forward packets to a given destination.

A metric of ‘infinity’ (an arbitrary large number) is used to indicate no available route. If some routers go down, or metrics suddenly increase, the updating algorithm can become confused and distant routers do not receive correct information. It is possible then for routing loops to occur, in which a packet is sent one way, as a result of new data about the shortest path, only to be sent back again as a result of old data about the shortest path. Packets can ping-pong back and forth, and routing table updates count slowly upward to ‘infinity’ before things right themselves. Distance vector algorithms send route announcements every 30 seconds or so, between adjacent pairs, so counting to infinity can take a long time.

406

CHAPTER 10. NETWORK-LEVEL SERVICES

The computational complexity of the distance vector algorithm’s convergence is of order LN where L is the number of links or adjacencies and N L is the number of nodes. This is quite expensive for large N .

Link State (LS) algorithms: e.g. OSPF. These use the Dijkstra shortest path algorithm. Link state algorithms attempt to construct a map of an entire network area, by sending messages of the form: ‘router A is adjacent to router B and the link is up’, which allows the construction of an adjacency

matrix representing the network. Routers then send their information to all their neighbors, who – in turn – pass on the information to others, only if it is new. Link state algorithms are less ‘chatty’ because they send only differential information (updates), not a complete copy of everything each time. Each router creates a link state packet (LSP) containing the ID of the router node, a list of directly connected neighbors and a link cost for each one, a sequence number and a time to live. Sequence numbers ensure updates take precedence, and node ID ensures that a copy is not flooded back to the original sender in a loop. Once a complete map is known, a router can compute the shortest path from the adjacency matrix. The link state algorithm scales like L log L for L links, which is significantly better than the distance vector scaling of L2; thus for large networks, it has a bright future.

RIP

RIP (versions 1 and 2) is a distance vector routing protocol that is still found in some networks, but its largely considered to be obsolete. RIP sends UDP packets containing routing updates based on hop-count to neighbors. RIP was made popular by its inclusion as part of Unix (in the routed daemon). The RIP protocol has various limitations on size: the maximum hop count is only 15, so it can only be used in small networks.

OSPF

The Open Shortest Path First (OSPF) was originally developed to defend the idea of distributed routing from those who believed that centralized management was the answer to routing. OSFP is designed to work within an Autonomous System, i.e. it is an Interior Routing Protocol. OSPF attempts to scale by introducing its own layers or hierarchy called areas. Area 0 is normally an organizational backbone, running an efficient point-to-point protocol, such as Frame Relay. Other areas are connected to this backbone by Area Border Routers (ABR), and the backbone of the Autonomous System is connected to others by an Autonomous System Border Router (ASBR) running BGP.

IS-IS

The Intermediate System to Intermediate System (IS-IS) protocol was designed in competition with OSPF in order to implement the OSI model for routing. It has similar functionality to OSFP and is also a link state protocol. Although OSPF is more widely implemented, IS-IS has its share of followers. One of the criticisms