How Novell Clients Cost Addresses

(Last modified: 04Sep2004)

This document (10053626) is provided subject to the disclaimer at the end of this document.

goal

How Novell Clients Cost Addresses

fact

Novell Client 4.9 for Windows NT/2000/XP

Novell Client 4.83 for Windows NT/2000/XP

Novell Client 4.8 for Windows NT/2000

Novell Client 4.71 for Windows NT/2000

Novell Client 4.7 PT2 for Windows NT/2000 (NT47PT2.EXE)

Novell Client 4.7 PT1 for Windows NT/2000 (NT47PT1.EXE)

Novell Client 4.7 for Windows NT/2000

Clients for Windows 95/98

Novell Client 3.2 for Windows 95/98

symptom

Novell Client connecting to Remote Servers

Novell Client connecting across WAN links

Novell Client not connecting to "local" NDS replicas

cause

The TCP/IP protocol implemented in most environments uses RIP 1.0 for the client and router support. With the RIP 1.0 support, there is no way for a network host to determine the "distance" between itself and the IP address. Unlike IPX, TCP/IP does not have built-in fields for hops and ticks for network packets that track information that could be readily used for costing. Once a TCP connection has been made to a target device, the TCP/IP protocol does track a great deal of round-trip-time information, but when a list of potential devices is presented for the first time (when the client has not made a connection yet), there is no built-in support in RIP 1.0 to determine the physical or logical "distance".

Novell Engineering has been evaluating this issue for some time in an attempt to develop a method to do a best-cost algorithm to allow administrators to connect to the "closest" NDS replica server. There were two different approaches considered in the final deliberations:

1. Use the PING functionality to determine both IP router hops (TTL decrements) and RTT (round-trip time). This would require that the Client PING each server in the referral list.

2. Use the subnet information to calculate a closest subnet match to cost address distances. While this is not based on verified cost information such as hops, ticks or RTT, it does allow administrators to control what servers a client will connect to based on how they have subnetted and assigned IP addresses. It is arbitrary, but 100 percent predictable.

3. Do not allow the client to cost any referral addresses but trust the referral service to provide the referral list in a sorted (costed) list. Being that the closest address is listed first in the referral list. The client would just take the first address in the referral list a prefer it's connection over any of the other addresses in the list. If the first address in the referral list is unavailable or unable to service the request then the client would try the second address in the referral list. This process would continue until either the desired information/connection is made or the referral list has been exhausted in which case an error routine would process the next logical step.

fix

Novell clients version 4.81 and 3.31 can be updated to support a newer IP costing mechanism that implements an ICMP ping to locate closest servers. The patch file ipcost.exe can add this newer functionality. Later releases of the Novell clients  include the newer ICMP mechanism. Please refer to solution 2959403

The 4.83 and newer clients include an advanced client setting called "IP Address Costing". This setting allows the configuration of the registry key documented in the initial IP costing solution for the 4.81 clients. (see previous paragraph)

The IP Address Costing setting can contain 3 different possible values.

0 - This value indicates that the client should not do any costing but to take the first address in the referral list. This is item 3 in the above cause statement.

1 - This value indicates that the client should perform the subnet match algorithm as used in the Novell client versions 3.21 and 4.71-4.8. The original algorithm used in client versions 2.5-3.21 for Windows 95/98 and 4.3-4.71 are no longer used. This is item 2 in the above cause statement.

2 - This value indicates that the client should perform an ICMP ping for all addresses contained in the referral list to determine actual cost of each device. This is the default mechanism and will be used regardless of the presence of the registry key. This is item 1 in the above cause statement.

Address Compare algorithm

(Advanced client setting - IP Address Costing = 1)

Novell client versions between 2.5 and 3.21 for Windows 95/98 and 4.3 and 4.71 for Windows NT/2000 use the following IP Costing algorithm: (Obsolete)

The Client applies two different filter checks for any IP addresses received in a referral list:

1. Is the target address on the same Net as the source address? This is determined using the 4 different IP Classes (A, B, C, D, and E), a table is listed below defining the different IP Class address ranges:

Class A = 0.0.0.0 to 126.0.0.0
Class B = 128.0.0.0 to 191.0.0.0
Class C = 192.0.0.0 to 223.0.0.0
Class D = 224.0.0.0 to 239.0.0.0
Class E = 240.0.0.0 to 254.0.0.0

All target addresses that are not in the same Net are set at a cost of 10 (the maximum/furthest).

2. Is the target address on the same subnet as the source address? This is determined by using the source's subnet mask to compare the target and source subnet. If it matches EXACTLY, then the address is set at a cost of 4 (lowest/closest cost this client version will use). If it does not match exactly, then it is set at a cost of 7.

This means that if there are no servers on the exact same subnet as the client workstation, then all server addresses in the same Net will be costed the same. Once all addresses are costed, if there are more than one with the same lowest cost value, the client will randomly select one to connect to.

Novell client versions after the 3.21 for Windows 95/98 field test version and the 4.71 for Windows NT/2000 field test version use the following IP Costing algorithm:

The client now applies three different filter checks for IP addresses received in a referral list:

1. Is the target address on the same Net as the source address? This is determined using the 4 different IP Classes (A, B, C, D, and E), a table is listed below defining the different IP Class address ranges:

Class A = 0.0.0.0 to 126.0.0.0
Class B = 128.0.0.0 to 191.0.0.0
Class C = 192.0.0.0 to 223.0.0.0
Class D = 224.0.0.0 to 239.0.0.0
Class E = 240.0.0.0 to 254.0.0.0

All target addresses that are not in the same Net are set at a cost of 10 (the maximum/furthest).

2. Is the target address on the same subnet as the source address? This is determined by using the source's subnet mask to compare the target and source subnet. If it matches EXACTLY, then the address is set at a cost of 1 (lowest/closest cost this client version will use). If it does not match exactly, then it will use the next filter check. Note that this value is different from the previous version of the client to support the next logic check.

3. The Client calculates the subnet for the workstation address and every server/target address in the referral list (those that are on the same Net but different subnet). The client then compares the workstation subnet against each server subnet in binary to determine how many CONSECUTIVE matching bits there are. This is not that same as doing an AND logical operation between the two subnets since it is checking for CONSECUTIVE matching bits, not total matching bits. It will then take the total number of subnet Id bits and subtract the number of consecutive matching bits.

IP Cost = Total Subnet Id bits - Matching Subnet Id bits

The lower the IP Cost number, the "closer" the address is and the higher the priority it has for being selected. The IP Cost has a range of 1 to 10 where 1 is on the same subnet as the workstation and all IP Costs greater than 10 are set equal to 10.

The following is an example of how the new costing logic would work:

Workstation address: 137.65.84.5 = 10001001.01000001.01010100.00000101 (binary)
Workstation Subnet Mask: 255.255.252.0 (decimal) = 11111111.11111111.11111100.00000000 (binary)

Server Referral IP Address List:
Ref1 = 137.65.67.1    = 10001001.01000001.01000011.00000001
Ref2 = 151.155.158.1 = 10010111.10011011.10011110.00000001
Ref3 = 137.65.118.1   = 10001001.01000001.01110110.00000001
Ref4 = 137.65.183.1   = 10001001.01000001.10110111.00000001
Ref5 = 137.65.103.1   = 10001001.01000001.01100111.00000001

Ref1 Costing:
Logic Check 1: 137.65 is same net as workstation
Logic Check 2: Source subnet is 010101, Target subnet is 010000. Not equal
Logic Check 3: Matching bits = 3, Cost = 6 Total - 3 Matching = 3
Result: Cost = 3

Ref2 Costing:
Logic Check 1: 151.155 is NOT same net as workstation, set Cost = 10
Logic Check 2: Not checked since Net not same
Logic Check 3: Not checked since Net not same
Result: Cost = 10

Ref3 Costing:
Logic Check 1: 137.65 is same net as workstation
Logic Check 2: Source subnet is 010101, Target subnet is 011101. Not equal
Logic Check 3: Matching bits = 2, Cost = 6 Total - 2 Matching = 4
Result: Cost = 4

Ref4 Costing:
Logic Check 1: 137.65 is same net as workstation
Logic Check 2: Source subnet is 010101, Target subnet is 101101. Not equal
Logic Check 3: Matching bits = 0, Cost = 6 Total - 0 Matching = 6
Result: Cost = 6

Ref5 Costing:
Logic Check 1: 137.65 is same net as workstation
Logic Check 2: Source subnet is 010101, Target subnet is 011001. Not equal
Logic Check 3: Matching bits = 2, Cost = 6 Total - 2 Matching = 4
Result: Cost = 4

Costing Results:

Ref1 = 137.65.67.1    = Cost 3
Ref2 = 151.155.158.1 = Cost 10
Ref3 = 137.65.118.1   = Cost 4
Ref4 = 137.65.183.1   = Cost 6
Ref5 = 137.65.103.1   = Cost 4

Given this scenario, the 137.65.67.1 Target Address will be selected because it has the lowest cost using the subnet consecutive matching bit algorithm.

.

ICMP Ping algorithm

(Advanced client setting - IP Address Costing = 2) (Default setting)

With this setting the Novell client will perform an ICMP ping to any referral list it receives for SLP, DNS, or NDS services. There are a number of calculations used by the client to generate an actual cost for each address in the referral list. The below is a step by step guide to how the Novell client currently generates this information. (As of 4.83 SP1 and 4.9)

There are two processes that occur when the client needs to access a resource on the network. The first process is a dynamic calculation of cost that gets performed every time the client needs to access a network resource via an address. This calculation is necessary to perform the logic of already established connections, and the specified preferred protocol.

Dynamic calculation

Initially sets all addresses at a base of 0x8000.

If the address type matches the preferred protocol setting of the client then this base value is divided in half. So addresses that match the preferred protocol will have an initial base address of 0x4000.

If the we already have a connection to the address then subtract the value of 5 from the base.

Once we have determined the base values for each address in the referral list we then compare with the costing table. The costing table is built using an ICMP ping packet. (These packets can be easily identified in a packet trace by looking at the data within the ICMP packet. The Novell client currently puts the following information inside the ICMP packet.)

(NWFS: Version=xxxxxxxx: Novell Net Service Route Request, v4.x, (xxxxxxxx))

The version number supplied is a date stamp of the nwfs.sys module on the workstation. This is calculated as the number of seconds since midnight 1970. The last part of the string indicates either 4.83 or 4.9 and the date reflected would be the respective date of the nwfs.sys module as indicated by the Novell version information. This same information can be found on the workstation by viewing the properties of the nwfs.sys module.

Static calculation (IP Costing Table)

When the ICMP reply is received by the client the following calculation occurs to generate the raw costs that are stored in the table. All addresses start with a raw cost of 0.

The time in milliseconds is measured between the request and reply packets. For example if it took a round trip time of 4 ms for the reply packet to get back to the workstation then the client would add a cost of 4.

The TTL value contained in the IP header of the packet is evaluated. The client looks at the value and performs the following logic.

If the value is less then 128 then it assumes that the initial TTL value was 128. It then subtracts the value from 128 and then adds this value to the raw cost of the address. For example if the TTL value was 127 then the client would add 1 to the raw cost of the address.

If the value is greater then 128 then the client assumes that the initial TTL value was 256. It then subtracts the value from 256 and then adds this value to the raw cost of the address.

Example:

So lets look at an example. Lets say that I have both IPX and IP installed on my workstation and I perform an SLP request for my tree called "Mytree". My preferred network protocol setting in the client is set to IP.

1. The first thing that will happen is the Novell client will generate an SLP request for ndap.novell = mytree

2. Let say that there are two servers that both contain a replica for this tree. The referral list that comes back from each server is...

10.10.10.1

192.1.1.1

123456:addbeef

3. The client first performs it's dynamic calculations of the addresses to determine the base cost.

10.10.10.1 - This matches my preferred network protocol so I set the base to 0x4000

192.1.1.1 - This also matches my preferred network protocol so I set the base to 0x4000

123456:addbeef - This is an IPX address and does not match my preferred network protocol so I set the base to 0x8000

The workstation is not currently connected to any of the addresses so it does not adjust the costs for current connections. If it already had a connection to lets say "10.10.10.1", then the base cost would decremented by 5 to reflect 0x3FFB. If it had been connected to both servers then it would have to decrement both by 5.

4. The client now will start building the static IP costing table. We generate the ICMP ping packet to each IP address in the referral list and measure the time for each address to reply in milliseconds.

10.10.10.1 - 5ms

192.1.1.1 - 2ms

At the same time the client also processes the TTL values that were inside the IP header of the reply packet. (The TTL value is set to a specific initial value by the sending host, Each router that the packet is forwarded across will decrement this value. For example NetWare servers will set the initial TTL value to 128 so when the workstation receives a packet with the TTL of 122 then we can assume that there are 6 routers between the workstation and the server)

10.10.10.1 - TTL value of 126

192.1.1.1 - TTL value of 254

The client takes the TTL value and the millisecond timer and add them together. This is then saved to the IP costing table as a raw cost.

Address                                Cost

10.10.10.1                               7

192.1.1.1                                 4

The cost of 7 for address 10.10.10.1 is based on 5ms + (128 - 126)

The cost of 4 for address 192.1.1.1 is based on 2ms + (256 - 254)

5. So now the client just puts all of this information together to determine the closest address.

Address                                   Base                              Cost                           Total

10.10.10.1                              0x4000                          7                                0x4007

192.1.1.1                                0x4000                          4                                0x4004

123456:addbeef                     0x8000                          4                                0x8004

The client will now connect to the lowest total valued address. In our example we would connect to the 192.1.1.1 address.

Note: We did not discuss the processed utilized under IPX for our last address of 123456:addbeef. The cost generated for this address is created by normal IPX communications. The workstation would generate a RIP request to the desired IPX address. The server that can route the request for the workstation would respond with a RIP response packet. Contained in this packet is a Hop/Tic count. The Novell client will use the Tic count to cost IPX routes. It does not use the Hop count.

Also note that the client will randomize equally costed routes. So if there is no connection already made to the server or if the base + cost equals the same for multiple addresses, then the client will jump between the different addresses. This process allows for load balancing of network traffic.

.

No Cost

(Advanced client setting - IP Address Costing = 0)

This setting tells the Novell client to not perform any costing of referrals. It does not keep a costing table and will select the first address in any referral list. (This setting is to allow for future NDS enhancements)

document

Document Title: How Novell Clients Cost Addresses
Document ID: 10053626
Solution ID: NOVL13356
Creation Date: 30May2000
Modified Date: 04Sep2004
Novell Product Class:Management Products
NetWare

disclaimer

The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information.
Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.