## 3 Proposed Cognitive Middleware architecture  
The Cognitive Middleware defined in the previous section is a _distributed framework_ which will be realized through the implementation of appropriate _Cognitive Middleware-based Agents_ (in the following referred to as _Cognitive Managers_) which will be transparently embedded in appropriate network entities (Mobile Terminals, Base Stations, Backhaul Network entities, Core Network entities). Figure 2 outlines the high-level architecture of a generic Cognitive Manager, showing its interfacing with (i) the lower Transport layers (ii) the higher Service/Content layers and (iii) the other peer Cognitive Managers. Figure 2 highlights that a Cognitive Manager will encompass four fundamental high-level functionalities, namely the Sensing, Metadata Handling, Elaboration and Actuation functionalities. The Sensing and Actuation functionalities are embedded in the \"Adapters\", namely the equipment which interface the Cognitive Module with the Transport Layers (_Command and Measurement Adapter_) and with the Service/Content layer (_Service/Content Adapter_); these adapters (and the corresponding sensing and actuation functionalities) must be tailored to the specific technologies of the underlying networks (_i.e._, to the specific transport layers) and to the specific interfaced service/content layers. The Metadata Handling functionalities are embedded in the so-called _Metadata Handling module_, whilst the _Elaboration functionalities_ are distributed among a set of _Thinking modules._ The Metadata Handling and the Elaboration functionalities (and in particular, the Thinking modules which are the core of the proposed architecture) are technology-independent and service/content-independent. The roles of the above-mentioned functionalities are the following:  
1. _Sensing functionalities_: they are in charge of: 1. the _monitoring_ and preliminary _filtering_ of both data/services/contents coming from service/content layer (Sensing functionalities embedded in the Service/Content Adapter) and of  
Figure 2: Cognitive Manager architecture. transport layers parameters (Sensing functionalities embedded in the Command and Measurement Adapter); this monitoring has to take place according to non-invasive (transparent) techniques (e.g., \"sniffing\" and/or \"probing packets\" approaches) which do not interfere with the underlying network procedures),
2. the formal description of the above-mentioned heterogeneous parameters/data/services/contents in homogeneous metadata according to proper ontology based languages (such as OWL - Web Ontology Language) [8];
3. _Metadata Handling functionalities:_ they are in charge of the storing, discovery and composition of the metadata coming from the sensing functionalities and/or from metadata exchanged among peer Cognitive Managers, in order to dynamically derive the aggregated metadata which can serve as inputs for the thinking modules; these aggregated metadata form the so-called _Present Context;_ it is worth stressing that such Present Context has an highly dynamic nature;
4. _Elaboration functionalities:_ they are embedded in a set of _Thinking modules_ which are the core of the Cognitive Manager. These modules, following the various _application protocols_, having as key inputs the aggregated metadata forming the Present Context, produce _elaborated metadata_ aiming at (i) controlling the transport layers, (ii) providing enriched data/services/contents to the service/content layers (iii) controlling the sensing, metadata handling and actuation functionalities, (iv) further detailing and enriching the _Present Context_ (the issues (iii) and (iv), for clarity reasons, are not represented in Figure 2). Due to their paramount importance, these Thinking modules are detailed in section 4 ;
5.