Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A router rule can take two expressions describing the source NID network and the router NIDs which should be preferred when sending from the specified source network. The reason a source network is specified as opposed to a source NID descriptor is because of implementation limitation. At the point of router selection we have not determined the source NI to send out of yet. However, by examining each gateway as we select the route, we are able to lookup the local network for that gateway and examine the preferred list on that gateway. If there is an explicit requirement to refine the traffic control to be per NID as opposed to per network then we can update the implementation in its own patch.

Only the source NID descriptor or the destination NID descriptor can be provided as a matching criteria but not both.

...

Gliffy Diagram
nameSelectionFlow
pagePin910

The diagram shows the integration of the UDSP provided actions in the logical flow of the selection algorithm.

...

  1. iterate over all the networks that a peer can be reached on and select the best local network
    1. The remote network with the highest priority is examined
      1. Network Rule
    2. The local network with the highest priority is selected
      1. Netword Rule
    3. The local NI with the highest priority is selected
      1. NID Rule
  2. If the peer is a remote peer and has no local networks,
    1. then select the remote peer network with the highest priority
      1. Network Rule
    2. Select the highest priority remote peer_ni on the network selected
      1. NID Rule
    3. Now that the peer's network and NI are decided select the router in round robin from the source primary NI network and peer NI's preferred router list. The preferred list on the source primary NI network takes precedence.
      1. Router Rule
  3. Otherwise for local peers, select the peer_ni from the peer.
    1. highest priority peer NI is selected
      1. NID Rule
    2. Select the peer NI which has the local NI selected on its preferred list.
      1. NID Pair Rule

...

Code Block
# Adding a local network udsp
# if multiple local networks are available, each one can have a priority. 
# The one with the highest priority is preferred
lnetctl policy add --src  <net type><net number expression>type><expr>
                   --<action type> <action context sensitive value> 
                   --idx <value>
	--src: is defined in ip2nets syntax. '<net type><expr>' syntax indicates the network.
		   <net type> is one of o2ib, tcp, gni, etc
           <expr> is an ip2nets expression describing a network number.
	--<action type>: 'priority' is the only implemented action type
	--<action context sensitive value>: is a value specific to the action type.
					  For 'priority' it's a value for [0 - 255], with 0 as the highest
                      priority
	--idx: The index of where to insert the rule. If it's larger than the policy list size it's
		   appended to the end of the list. If not specified the default behaviour is to append
		   to the end of the list

# Adding a local NID udsp
# After a local network is chosen, if there are multiple NIs in the network the
# one with highest priority is preferred.
lnetct policy add --src <Address descriptor>@<net type><expr>
                  --<action type> <action context sensitive value>
				  --idx <value>
	--src: the address descriptor defined in ip2nets syntax as described in the manual
		   <net type><expr> is similar to what has been described previously.
	--<action type>: 'priority' is the only implemented action type
	--<action context sensitive value>: is a value specific to the action type.
					  For 'priority' it's a value for [0 - 255], with 0 as the highest
                      priority
	--idx: The index of where to insert the rule. If it's larger than the policy list it's
		   appended to the end of the list. If not specified the default behaviour is to append
		   to the end of the list

# Adding a remote NID udsp
# select the peer NID with the highest priority.
lnetct policy add --dst <Address descriptor>@<net type><expr>
                  --<action type> <action context sensitive value>
				  --idx <value>
	--dst: the address descriptor defined in ip2nets syntax as described in the manual
		   <net type><expr> is similar to what has been described previously.
	--<action type>: 'priority' is the only implemented action type
	--<action context sensitive value>: is a value specific to the action type.
					  For 'priority' it's a value for [0 - 255], with 0 as the highest
                      priority
	--idx: The index of where to insert the rule. If it's larger than the policy list it's
		   appended to the end of the list. If not specified the default behaviour is to append
		   to the end of the list

# Adding a NID pair udsp
# When this rule is instantiated the local NIDs which match the rule are added on a list
# on the peer NIs matching the rule. When selecting the peer NI, the one with the 
# local NID being used on its list is preferred.
lnetct policy add --src <Address descriptor>@<net type><expr>
                  --dst <Address descriptor>@<net type><expr>
				  --idx <value>
	--src: the address descriptor defined in ip2nets syntax as described in the manual
		   <net type><expr> is similar to what has been described previously.
	--dst: the address descriptor defined in ip2nets syntax as described in the manual
		   <net type><expr> is similar to what has been described previously.
           Destination NIDs can be local or remote.
	--idx: The index of where to insert the rule. If it's larger than the policy list it's
		   appended to the end of the list. If not specified the default behaviour is to append
		   to the end of the list

# Adding a Router udsp
# similar to the NID pair udsp. The router NIDs matching the rule are added on a list
# on the peer NIs matching the rule. When sending to a remote peer, the router which
# has its nid on the peer NI list is preferred.
lnetct policy add --dst <Address descriptor>@<net type><expr>
                  --rte <Address descriptor>@<net type><expr>
				  --idx <value>
	--dst: the address descriptor defined in ip2nets syntax as described in the manual
		   <net type><expr> is similar to what has been described previously.
	--rte: the address descriptor defined in ip2nets syntax as described in the manual
		   <net type><expr> is similar to what has been described previously.
	--idx: The index of where to insert the rule. If it's larger than the policy list it's
		   appended to the end of the list. If not specified the default behaviour is to append
		   to the end of the list

# Adding a Router udsp
# similar to the NID pair udsp. The router NIDs matching the rule are added on a list
# on the source's primary NIslocal network matching the rule. When sending from on of the constituents of this
# primary NInetwork, then , the router which has its nid on the peerlocal NInetwork list is preferred. If there are two
# UDSPs setting the preference of router selection based on the sourcelocal primary NIDnetwork and the peer 
# primary NID, then the preferred list on the source's primary NIDlocal network takes precedence.
lnetct policy add --src <Address descriptor>@<net<net type><expr>
                  --rte <Address descriptor>@<net type><expr>
				  --idx <value>
	--dstsrc: the address descriptoris defined in ip2nets syntax. as described in'<net type><expr>' syntax indicates the manualnetwork.
		   <net type><expr> type> is one of o2ib, tcp, gni, etc
           <expr> is similaran toip2nets whatexpression hasdescribing beena describednetwork previouslynumber.
	--rte: the address descriptor defined in ip2nets syntax as described in the manual
		   <net type><expr> is similar to what has been described previously.
	--idx: The index of where to insert the rule. If it's larger than the policy list it's
		   appended to the end of the list. If not specified the default behaviour is to append
		   to the end of the list

# show all policies in the system.
# the policies are dumped in YAML form.
# Each policy is assigned an index.
# The index is part of the policy YAML block
lnetctl policy show

# to delete a policy the index must be specified.
# The normal behaviour then is to first show the list of policies
# grab the index and use it in the delete command.
lnetctl policy del --idx <value>

# generally, the syntax is as follows
 lnetctl policy <add | del | show>
  --src: ip2nets syntax specifying the local NID to match
  --dst: ip2nets syntax specifying the remote NID to match
  --rte: ip2nets syntax specifying the router NID to match
  --priority: Priority to apply to rule matches
  --idx: Index of where to insert the rule. By default it appends to
		 the end of the rule list 

...