## 3 Regulatory Framework  
Depending on the market framework, the bids to the AS market can be aggregated at the PS level or offered by a single DER or a group of DERs, enabling market participation. Italy has an ancillary services market (MSD), where the TSO (i.e., Terna) operates as a single counterparty to procure the resources needed to ensure system security, adequacy and quality of supply. MSD is a pay as bid market where all programmable production units with a minimum installed capacity of 10 MVA and the needed technical requirements are requested to participate by offering all their upward and downward regulation intervals. On the MSD, some ancillary services are procured with a mechanism of remuneration (i.e., infra-zonal congestion relief, frequency restoration reserve with automatic activation--aFRR, tertiary reserve, subdivided into ready, spinning, and replacement reserve, and real-time balancing). Furthermore, a series of services are provided without remuneration, as their provision is mandatory (i.e., primary reserve, which is comparable to the frequency containment reserve--FCR, primary and secondary voltage control). The DER involvement in the distribution network's management implies the development of local markets. The most promising regulatory framework is a local flexibility market where the DSO first solves the local distribution network security issues and then aggregates the remaining flexibility for the centralised TSO. The local markets are where local \"products of flexibility\" can be purchased from aggregators and producers by the DSOs for fixing distribution network issues. Their models result in an optimisation problem of which the solution is the economic optimum of the market and respects its rules and principles. Different market models for the flexibility products for local and system services have been recently proposed in Italy and other European Countries. Among the other differences, they differ from one to the other for the role assumed by the involved system operators and the other market players. Although each EU Country proposed many variants for service market schemes, recent projects elaborated the subject and reached the following definitions [8; 9; 10]:  
1. _Extended centralised dispatching:_ all participants, from transmission and distribution, offer system services to the global market. The TSO is the only buyer of flexibility. 2. _Local Ancillary Service market:_ DERs may participate in a new local AS market managed by the DSO. In this market, local services for solving distribution network operation issues are directly purchased by the DSO that, in turn, offers system services to the global AS market managed by the TSO by aggregating the remaining bids from the same or other DERs that participate in the local market. 3. _Shared balancing responsible model:_ TSOs and DSOs handle the flexibility offered by only the resources connected to the networks that they manage. DERs connected to the distribution system cannot provide system services to the TSOs. Still, the DSOs have the new role of balancing the demand and the production at its voltage level according to a schedule defined in advance with the TSO and based on the day-ahead energy market results or historical data. 4. _Common TSO-DSO market model:_ TSOs and DSOs can purchase services from flexible resources connected to the transmission and distribution grid. Both operators buy products from the joint-operated marketplace. There is no priority for the TSO or DSO, but the service is allocated by considering the highest need in terms of increasing social welfare. There are two variants of this market model. In the first, bids for system and local services are cleared in the same session, considering both transmission and distribution constraints. The DSO operates a local market that runs earlier than the common session but with participants' commitment in the second variant. Then, in the common market, the optimisation of the bid allocation considers the results of the first local market. 5.