Packet Structure Routing Packet Handling

60 Communication Networks Copyright © 2005 PragSoft

4.3.1. Packet Structure

The general structure of a virtual circuit packet is shown in Figures 4 . 43. The contents of the fields with darker shading vary according to the Packet Type, and may be altogether absent from some packets. Figure 4.43 General virtual circuit packet structure. Field Description Packet Format Determines the internal format of the packet. Packet Type Identifies the type of the packet. Virtual Circuit ID Identifies the virtual circuit for routing the packet. Facilities Parameters such as packet size, window size, etc. Service Parameters Parameters for the network service to which this packet belongs see Section 4.1. User Data Actual network user data. Figure 4.44 shows the general structure of a datagram packet. Because packet headers may vary in length, the Header Length field is needed to indicate where User Data starts. Each packet is assigned a limited lifetime denoted by the Lifetime field. This is an integer quantity and is decreased in value by the nodes that handle the packet. When this value reaches zero, the packet is discarded. This is intended as a measure against congestion by packets that aimlessly circulate the network. Figure 4.44 General datagram packet structure. Field Description Header Length Length of the packet header in bits or octets. Source Address Network address of the source end. Destination Address Network address of the destination end. Lifetime Packet lifetime indicator to avoid packets living forever. Options Various options such as priority, security, etc. User Data Actual network user data.

4.3.2. Routing

Routing is the task of selecting a path for the transport of packets across the network, and is one of the most important functions of the network layer. Routing is generally viewed as an optimization problem with the objective of choosing an optimal path according to certain criteria: • Transmission cost measured in terms of tied up network resources. www.pragsoft.com Chapter 4: The Network Layer 61 • Transmission delay measured as the delay involved in delivering each packet. • Throughput measured as the total number of packets delivered per unit of time. The overall cost depends on all these three, and an optimal route is one that minimizes the overall cost. This can be represented by a weighted network, where an abstract cost figure is associated with each link, as illustrated in Figure 4 . 45. The cost of a route is the sum of the cost of its links. Figure 4.45 A weighted network. 20 12 8 11 5 7 6 11 4 a b c d e f g There are three classes of routing algorithms: • Flooding • Static Routing • Dynamic Routing Of these, only dynamic routing makes any serious optimization attempts. In flooding, every possible path between the source and the destination station are exercised. Each node, upon receiving a packet, forwards copies of it to all its neighboring nodes except the one from which it received the packet. Flooding is a highly robust technique since it offers the best chance of at least one packet copy reaching the destination. Its major disadvantage, however, is that it quickly congests the network. To avoid packets being indefinitely copied, each packet is assigned a limited lifetime which when expired will cause it to be destroyed see Section 4.3.1. Because of its limitations, use of flooding is confined to specialized applications that require very high levels of robustness e.g., military networks. Flooding is only suited to the datagram approach. In static routing, a fixed routing directory is used to guide the selection of a route which remains unchanged for the duration of the connection. The directory consists of a table which for each node pair p,q in the network suggests a partial path by nominating the first intermediate node, r, along the path. This should be interpreted as ‘to get from p to q, first go to r’. The path can then be continued by looking at the entry for the pair r, q, etc., until q is reached. A sample route directory is shown in Figure 4 . 46. The route directory is tied to the network topology and remains unchanged unless the network topology changes. The route directory may be stored in a central location or distributed amongst the 62 Communication Networks Copyright © 2005 PragSoft nodes each node requires its corresponding row only. The directory should remain accessible to network administrators for manual updates. Figure 4.46 Static route directory for the network in Figure 4.45. To a b c d e f g a - b b b b b b b a - c d d d d c b b - d d d d From d b b c - e f e e d d d d - d g f d d d d d - g g e e e e e f - The advantages of static routing are its simplicity and ease of implementation. Its disadvantage is lack of flexibility in face of possible variations within the network. Static routing can be used with both the datagram and the virtual circuit approach. Although static routing takes some form of cost into account, these cost measures are fixed and predetermined. Variations in traffic load have no impact on route selection, which makes this method unsuitable for large networks with significant traffic fluctuations. For small networks with relatively constant traffic, however, static routing can be very effective. Dynamic routing attempts to overcome the limitations of static routing by taking network variations into account when selecting a route. Each node maintains a route directory which describes the cost associated with reaching any other node via a neighboring node. A sample directory is shown in Figure 4 . 47. Figure 4.47 Dynamic route directory for node ‘d’ in Figure 4.45. To a b c d e f g From d b b c - e f e Cost 7 7 4 6 8 6 The nodes periodically calculate estimates for the costs of the links to their neighboring nodes according to the statistical data that they have collected queue lengths, packet delays, traffic load, etc., and share these estimates with other nodes. This enables the nodes to update their route directories in an objective manner so that they reflect the current state of the network. To select a route between two stations, dynamic routing employs a graph optimization algorithm to find an optimal or close to optimal path as described earlier in this section. www.pragsoft.com Chapter 4: The Network Layer 63 The advantage of dynamic routing is its potential to improve performance and reduce congestion by choosing more optimal routes. Its disadvantage is its inherent complexity. Nevertheless, dynamic routing algorithms enjoy widespread use because they have proved to be generally more effective than other algorithms. Like static routing, dynamic routing can be used with both the datagram and the virtual circuit approach.

4.3.3. Congestion Control