Network Config¶
Network Config implements classes related to node-based flow/profile aggregation, routing, link management, and management of system level concerns such as multicast-capability.
-
class
Node
(_id)¶ Defines all the required information for a node in the network. This includes:
- All provided profiles (aggregated) whose node_id is this node
-
id_type
¶ alias of
str
-
ID
= None¶ the ID of this node
-
provided
= None¶ aggregate of all ‘provided’ profiles whose source ID is this node
-
HasProfiles
()¶
-
AddProfile
(prof)¶
-
AddProvidedProfile
(prof)¶
-
class
Route
(path=[])¶ Describes how a flow traverse the links of the system’s network. This is specified as a list of nodes, with the source node at the front of the list and the destination node at the end of the list.
-
header
= 'route:'¶ line header specifying a route in the config file
-
path
= None¶ list of node IDs with a source, intermediate nodes, and a destination
-
AddDest
(dest)¶ Append a node onto the end of the route.
-
AddSource
(src)¶ Add a node onto the beginning of a route.
-
InsertNode
(node, pos)¶ Insert a node into the route before the given position.
-
ParseFromLine
(line)¶ Handles parsing of a route path from a line in the config file. A route is defined as:
route: src_node_id, hop_node_1, ... , hope_node_n, dst_node_id
-
Length
()¶
-
-
class
Topology
(links={})¶ Describes the active links between nodes on the system’s network. This is specified as a dictionary of node : list of nodes pairs.
-
header
= 'topology:'¶ line header specifying a topology link in the config file.
-
ParseFromLine
(line)¶ Handles parsing of a link from a line in the config file. A topology is defined as:
topology: src_node_id : direct_node_1, ... , direct_node_n
-
-
class
Config
(nodes={}, multicast=False, retransmit=False, routes=[], topology={})¶ Contains the routing and topology information to fully describe the system’s network and provide a mapping between application data flows (logical) and the system’s network links. It also provides interfaces for setting low-level communications considerations such as retransmission, multiple-unicast, multicast, etc.
-
addProfile
(prof)¶
-
GetRoute
(src, dst)¶ Returns the path for the flow from src to dst.
-
ParseHeader
(header)¶ Parses information from the configuration’s header if it exists:
- multicast capability
- retransmission setting
A profile header is at the top of the file and has the following syntax:
# <property> = <value>
-
ParseFromFile
(fName)¶ Builds the entries from a properly formatted CSV file. Internally calls
Config.ParseFromString()
.
-
ParseFromString
(conf_str)¶ Handles parsing of the header, topology, and routes in a config file.
-
-
main
(argv)¶