This is the code for class Switches from https://github.com/osrg/ryu/blob/master/ryu/topology/switches.py#L429
The member variables of particular interest to me in the class Switches are the following.
self.dps = {} # datapath_id => Datapath class
self.port_state = {} # datapath_id => ports
self.ports = PortDataState() # Port class -> PortData class
self.links = LinkState() # Link class -> timestamp
self.is_active = True
These are the member variables that the RYU uses to cache the topology details.I am trying to figure out how a topology can be represented using the following variables.
1) dps is a dictionary which maps datapath_id to datapath class?
- Can someone explain to me what is a datapath_id and a datapath class?
2) port_state is a dictionary which maps datapath id to ports
- As per my understanding on a switch without a VLAN all the ports will belong to the same datapath id? In case of a switch with VLAN ports on the switch can have multiple datapath id's. Is my understanding correct?
3) ports is again a dictionary which maps Port class to PortData class?
- what does this mean?
4) links is again a dictionary which maps Link class to timestamp
- again what does this mean?
I am trying to get my head around how RYU controller stores the topology information using the above structures.Any help in understanding or explanation would be greatly appreciated.