Skip to content

Commit 5be4e09

Browse files
avargaZoltanBojthe
authored andcommitted
neddoc added to various modules
using llm LLDPAgent documented HF doc hyperflowagent docu IControllerApp OF_Controller etc doc AbstractTCPControllerApp flowtable
1 parent 8043911 commit 5be4e09

File tree

10 files changed

+290
-73
lines changed

10 files changed

+290
-73
lines changed

src/openflow/controllerApps/AbstractTCPControllerApp.ned

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,33 @@
1515
// along with this program; if not, see <http://www.gnu.org/licenses/>.
1616
//
1717

18-
1918
package openflow.controllerApps;
2019

2120
import inet.applications.contract.IApp;
2221

23-
2422
//
25-
// Template for TCP applications. It shows what gates a TCP app
26-
// needs, to be able to be used in ~StandardHost etc.
23+
// AbstractTCPControllerApp is a base class for OpenFlow controller applications that need
24+
// to communicate over TCP in addition to interacting with the OpenFlow controller.
25+
//
26+
// This module extends AbstractControllerApp (which provides the basic controller application
27+
// functionality) and implements the INET IApp interface (which provides TCP socket functionality).
28+
// It serves as a bridge between the OpenFlow controller architecture and the INET TCP/IP stack.
29+
//
30+
// Key features of AbstractTCPControllerApp:
31+
//
32+
// 1. TCP Socket Management: Provides functionality for creating and managing TCP sockets,
33+
// allowing controller applications to establish connections with external entities.
34+
//
35+
// 2. Message Queue Processing: Implements a message queue with configurable service time
36+
// to simulate processing delay for incoming messages. Messages are processed sequentially
37+
// with the specified service time between them.
38+
//
39+
// 3. Statistics Collection: Collects and records statistics about queue size, waiting time,
40+
// and packets processed per second, which can be used for performance analysis.
41+
//
42+
// This class is used as a base for controller applications that need to communicate with
43+
// external systems, such as the HyperFlowAgent which connects to a HyperFlowSynchronizer
44+
// to enable distributed controller functionality.
2745
//
2846
simple AbstractTCPControllerApp like IControllerApp, IApp
2947
{
@@ -34,12 +52,15 @@ simple AbstractTCPControllerApp like IControllerApp, IApp
3452
@statistic[queueSize](title="QueueSize"; record=vector?,stats; interpolationmode=none);
3553
@signal[waitingTime](type="simtime_t");
3654
@statistic[waitingTime](title="WaitingTime"; record=vector?,stats?; interpolationmode=none);
55+
56+
// Processing time for each message (used to simulate processing delay).
57+
// Messages are processed sequentially with this delay between them.
3758
double serviceTime @unit("s") = default(0s);
59+
60+
// Priority of flow entries installed by this application (higher values are matched first)
3861
int priority = default(1);
3962

4063
gates:
4164
input socketIn @labels(TcpCommand/up);
4265
output socketOut @labels(TcpCommand/down);
4366
}
44-
45-

src/openflow/controllerApps/IControllerApp.ned

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,28 @@
1919
package openflow.controllerApps;
2020

2121
//
22-
// Template for TCP applications. It shows what gates a TCP app
23-
// needs, to be able to be used in ~StandardHost etc.
22+
// IControllerApp is the base interface for all OpenFlow controller applications in the
23+
// openflow simulation model. It defines the common parameters and signals that all
24+
// controller applications must implement.
25+
//
26+
// Controller applications are modules that implement specific control logic for an OpenFlow
27+
// network. They run within an OpenFlow controller and make decisions about how packets should
28+
// be handled by OpenFlow switches. Examples include learning switches, routing applications,
29+
// load balancers, and security applications.
30+
//
31+
// The controller application architecture follows a modular design where multiple applications
32+
// can be installed in a single controller, each handling different aspects of network control.
33+
// Applications receive events from the controller (like packet-in messages from switches),
34+
// process them according to their logic, and respond with appropriate actions (like sending
35+
// flow modification messages to install flow entries in switches).
36+
//
37+
// Signal Definitions:
38+
// - PacketIn: Emitted when a packet-in message is received from a switch
39+
// - PacketOut: Emitted when a packet-out message is sent to a switch
40+
// - PacketFeatureRequest: Emitted when a feature request message is sent to a switch
41+
// - PacketFeatureReply: Emitted when a feature reply message is received from a switch
42+
// - PacketExperimenter: Emitted for experimenter (vendor) messages
43+
// - Booted: Emitted when the controller has completed initialization
2444
//
2545
moduleinterface IControllerApp
2646
{
@@ -33,7 +53,10 @@ moduleinterface IControllerApp
3353
@signal[PacketExperimenter];
3454
@signal[Booted];
3555
@display("i=block/app");
56+
57+
// Priority of flow entries installed by this application (higher values are matched first)
58+
// In OpenFlow, when multiple flow entries match a packet, the entry with the highest
59+
// priority is used. This parameter determines the priority value set in flow modification
60+
// messages sent by this controller application.
3661
int priority;
3762
}
38-
39-

src/openflow/controllerApps/LLDPAgent.ned

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,47 @@
1515

1616
package openflow.controllerApps;
1717

18+
//
19+
// The LLDPAgent is a controller application responsible for network topology discovery
20+
// using the Link Layer Discovery Protocol (LLDP). It is deployed exclusively on the
21+
// controller side, not on switches.
22+
//
23+
// The module periodically sends LLDP packets to all switches using OpenFlow packet-out
24+
// messages. Each switch forwards these LLDP packets on all its ports. When a switch
25+
// receives an LLDP packet on one of its ports, it forwards it to the controller via
26+
// a packet-in message. The LLDPAgent uses these packet-in messages to build a graph
27+
// of the network topology.
28+
//
29+
// The topology information is stored in an LLDPMibGraph, which represents the network
30+
// as a graph where switches and hosts are vertices and links are edges. This graph
31+
// is used by other controller applications like LLDPBalancedMinHop to compute paths
32+
// between hosts.
33+
//
34+
// The LLDPAgent installs flow entries in switches to forward LLDP packets to the
35+
// controller. It also handles the expiration of topology information based on the
36+
// configured timeout.
37+
//
1838
simple LLDPAgent like IControllerApp
1939
{
2040
parameters:
2141
@class(openflow::LLDPAgent);
2242
@display("i=block/app");
2343

24-
//default value cisco
44+
// How often to send LLDP packets for topology discovery (default value from Cisco)
2545
double pollInterval @unit("s") = default(30s);
2646

27-
//default value cisco
47+
// How long topology information is valid before expiring (default value from Cisco)
2848
double timeOut @unit("s") = default(120s);
49+
50+
// Hard timeout for flow entries (0 means no hard timeout)
2951
int flowModHardTimeOut = default(0);
52+
53+
// Idle timeout for flow entries (how long a flow entry remains if not used)
3054
int flowModIdleTimeOut = default(60);
55+
56+
// Whether to print the topology graph to the console
3157
bool printMibGraph = default(false);
58+
59+
// Priority of flow entries installed by this application (higher values are matched first)
3260
int priority = default(1);
3361
}

src/openflow/hyperflow/HF_ARPResponder.ned

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,41 @@
22
package openflow.hyperflow;
33
import openflow.controllerApps.IControllerApp;
44

5-
5+
//
6+
// The HF_ARPResponder is a specialized controller application that extends the basic ARPResponder
7+
// functionality to work within the HyperFlow distributed controller architecture. (The HF prefix
8+
// stands for HyperFlow.)
9+
//
10+
// Basic ARPResponder Functionality:
11+
// - Maintains a mapping between IP addresses and MAC addresses
12+
// - Responds to ARP requests if it knows the MAC address for the requested IP
13+
// - Floods ARP requests to all switches if it doesn't know the requested MAC address
14+
// - Learns new IP-to-MAC mappings from ARP packets passing through the network
15+
//
16+
// HyperFlow is a distributed controller architecture that:
17+
// - Enables multiple OpenFlow controllers to work together as a logically centralized controller
18+
// - Provides fault tolerance and scalability through controller distribution
19+
// - Synchronizes state between controllers using a publish-subscribe mechanism
20+
// - Allows controllers to operate independently while maintaining a consistent network view
21+
//
22+
// HF_ARPResponder's Role:
23+
//
24+
// 1. State Synchronization: When it learns a new IP-to-MAC mapping, it not only stores it locally
25+
// but also publishes this information to other controllers through the HyperFlow synchronization channel.
26+
//
27+
// 2. Distributed Learning: It can receive IP-to-MAC mappings discovered by other controllers through
28+
// the HyperFlow "ReFire" mechanism, allowing all controllers to maintain a consistent ARP table.
29+
//
30+
// 3. Fault Tolerance: If one controller fails, others can continue to respond to ARP requests
31+
// because they share the same ARP table information.
32+
//
33+
// 4. Scalability: By distributing the ARP handling across multiple controllers, the system can
34+
// handle larger networks more efficiently.
35+
//
36+
// Note: HF_ARPResponder requires the HyperFlowAgent to be installed in the same controller.
37+
// The HyperFlowAgent provides the communication infrastructure that enables the
38+
// distributed functionality of HF_ARPResponder.
39+
//
640
simple HF_ARPResponder like IControllerApp
741
{
842
parameters:
Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,79 @@
11

22
package openflow.hyperflow;
33

4-
5-
4+
//
5+
// The HyperFlowAgent is a core component of the HyperFlow distributed controller architecture
6+
// for OpenFlow networks. It enables multiple OpenFlow controllers to work together as a logically
7+
// centralized controller while being physically distributed.
8+
//
9+
// HyperFlow is a distributed controller architecture that:
10+
// - Enables multiple OpenFlow controllers to work together as a logically centralized controller
11+
// - Provides fault tolerance and scalability through controller distribution
12+
// - Synchronizes state between controllers using a publish-subscribe mechanism
13+
// - Allows controllers to operate independently while maintaining a consistent network view
14+
//
15+
// HyperFlowAgent's Role:
16+
//
17+
// 1. State Synchronization: The HyperFlowAgent maintains two channels for synchronization:
18+
// - Control Channel: Contains information about controllers and their connected switches
19+
// - Data Channel: Contains events and state changes that need to be synchronized
20+
//
21+
// 2. Controller Communication: The HyperFlowAgent connects to a central HyperFlowSynchronizer
22+
// that facilitates communication between distributed controllers. It periodically:
23+
// - Reports its status and connected switches (ReportIn)
24+
// - Requests synchronization with other controllers (SyncRequest)
25+
// - Checks if other controllers are alive (CheckAlive)
26+
//
27+
// 3. Event Distribution: When state changes occur in one controller (e.g., a new ARP entry),
28+
// the HyperFlowAgent:
29+
// - Packages the change as a DataChannelEntry
30+
// - Sends it to the HyperFlowSynchronizer
31+
// - The change is then distributed to all other controllers
32+
//
33+
// 4. Event Notification: The HyperFlowAgent emits HyperFlowReFire signals to notify other
34+
// controller applications (like HF_ARPResponder, HF_LLDPAgent) about state changes from
35+
// other controllers, allowing them to update their local state.
36+
//
37+
// 5. Fault Tolerance: The HyperFlowAgent detects controller failures and recoveries, enabling
38+
// the system to continue operating even if some controllers fail.
39+
//
640
simple HyperFlowAgent extends openflow.controllerApps.AbstractTCPControllerApp
741
{
842
parameters:
943
@class(openflow::HyperFlowAgent);
1044
@class(HyperFlowAgent);
1145
@signal[HyperFlowReFire];
1246
@display("i=block/app");
47+
48+
// Hard timeout for flow entries (0 means no hard timeout)
1349
int flowModHardTimeOut = default(0);
50+
51+
// Idle timeout for flow entries (how long a flow entry remains if not used)
1452
int flowModIdleTimeOut = default(1);
53+
54+
// Local port for the TCP socket (use -1 for automatic port assignment)
1555
int localPort = default(-1);
56+
57+
// Local address for the TCP socket (use "" for any address)
1658
string localAddress = default("");
59+
60+
// Address of the HyperFlowSynchronizer to connect to
1761
string connectAddressHyperFlowSynchronizer = default("HyperFlowSynchronizer");
62+
63+
// Port of the HyperFlowSynchronizer to connect to
1864
int connectPortHyperFlowSynchronizer = default(1003);
1965

66+
// When to initiate the connection to the HyperFlowSynchronizer
2067
double connectAt @unit("s") = default(1s);
2168

22-
//should be 1/3 of the checkAliveEvery
69+
// How often to send ReportIn messages (should be 1/3 of the checkAliveEvery)
70+
// ReportIn messages inform the synchronizer about this controller and its switches
2371
double reportInEvery @unit("s") = default(1s);
72+
73+
// How often to send SyncRequest messages to get updates from other controllers
2474
double checkSyncEvery @unit("s") = default(1s);
2575

26-
//should be the same as aliveintervall of the synchronizer module
76+
// How often to check if other controllers are alive
77+
// Should be the same as aliveInterval of the synchronizer module
2778
double checkAliveEvery @unit("s") = default(3s);
28-
29-
30-
3179
}

src/openflow/openflow/controller/IOpenFlowController.ned

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11

2-
32
package openflow.openflow.controller;
43

5-
//Interface module for the OpenFlow Controller module.
6-
//Communication with OpenFlow switch;
7-
//Sending Packet-Out messages;
8-
//Sending Flow Modification messages;
9-
4+
//
5+
// IOpenFlowController is the base interface for OpenFlow controller implementations in the
6+
// openflow4core simulation model. It defines the common parameters and gates that all
7+
// OpenFlow controller implementations must provide.
8+
//
9+
// The OpenFlow controller is responsible for:
10+
//
11+
// 1. Establishing and maintaining connections with OpenFlow switches
12+
// 2. Processing OpenFlow protocol messages (HELLO, FEATURES_REQUEST, PACKET_IN, etc.)
13+
// 3. Managing the network by installing flow entries in switches
14+
// 4. Providing an interface for controller applications to implement network control logic
15+
//
16+
// This interface allows for different controller implementations while maintaining
17+
// compatibility with the rest of the simulation model. The primary implementation
18+
// is the OF_Controller module.
19+
//
1020
moduleinterface IOpenFlowController
1121
{
1222
parameters:
13-
14-
string address;// = default("");
15-
int port;// = default(6633);
16-
double serviceTime @unit("s");// = default(0s);
17-
double bootTime @unit("s");// = default(0s);
18-
23+
// IP address the controller listens on
24+
string address;
25+
26+
// TCP port the controller listens on (standard OpenFlow port is 6633)
27+
int port;
28+
29+
// Processing time for each message (used to simulate controller processing delay)
30+
double serviceTime @unit("s");
31+
32+
// Time before the controller is fully operational (boot delay)
33+
double bootTime @unit("s");
34+
1935
gates:
2036
input socketIn @labels(TcpCommand/up);
2137
output socketOut @labels(TcpCommand/down);

src/openflow/openflow/controller/OF_Controller.ned

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
11

2-
32
package openflow.openflow.controller;
43

5-
//Communication with OpenFlow switch;
6-
//Sending Packet-Out messages;
7-
//Sending Flow Modification messages;
8-
4+
//
5+
// The OF_Controller is the core module that implements the OpenFlow controller functionality
6+
// in the openflow simulation model. It handles the communication with OpenFlow switches,
7+
// processes OpenFlow protocol messages, and provides an interface for controller applications.
8+
//
9+
// The OF_Controller is responsible for:
10+
//
11+
// 1. Connection Management: Establishing and maintaining TCP connections with OpenFlow switches.
12+
// It handles the OpenFlow handshake process (HELLO, FEATURES_REQUEST, FEATURES_REPLY) and
13+
// maintains information about connected switches.
14+
//
15+
// 2. Message Processing: Processing OpenFlow protocol messages received from switches, such as
16+
// PACKET_IN, FEATURES_REPLY, and EXPERIMENTER messages. It also sends messages to switches,
17+
// such as PACKET_OUT and FLOW_MOD messages.
18+
//
19+
// 3. Controller Application Interface: Providing an interface for controller applications to
20+
// register themselves and receive notifications about OpenFlow events. It emits signals for
21+
// various events (PacketIn, PacketOut, etc.) that controller applications can subscribe to.
22+
//
23+
// 4. Switch Information Management: Maintaining a list of connected switches and their capabilities,
24+
// which can be accessed by controller applications.
25+
//
26+
// The OF_Controller is typically used as a submodule within the Open_Flow_Controller compound module,
27+
// which combines it with standard networking components (TCP/IP stack, Ethernet interfaces) and
28+
// controller applications to form a complete OpenFlow controller.
29+
//
930
simple OF_Controller like IOpenFlowController
1031
{
1132
parameters:
@@ -22,13 +43,24 @@ simple OF_Controller like IOpenFlowController
2243
@signal[waitingTime](type="simtime_t");
2344
@statistic[waitingTime](title="WaitingTime"; record=vector?,stats?; interpolationmode=none);
2445
@display("i=block/app");
25-
46+
47+
// IP address the controller listens on (empty string means all available interfaces)
2648
string address = default("");
49+
50+
// TCP port the controller listens on (standard OpenFlow port is 6633)
2751
int port = default(6633);
52+
53+
// Processing time for each message (used to simulate controller processing delay)
2854
double serviceTime @unit("s") = default(0s);
55+
56+
// Time before the controller is fully operational (boot delay)
2957
double bootTime @unit("s") = default(0s);
58+
59+
// Whether to process messages in parallel (true) or sequentially (false)
60+
// When false, messages are processed one at a time with serviceTime delay between them
61+
// When true, multiple messages can be processed simultaneously
3062
bool parallelProcessing = default(false);
31-
63+
3264
gates:
3365
input socketIn @labels(TcpCommand/up);
3466
output socketOut @labels(TcpCommand/down);

0 commit comments

Comments
 (0)