Local Energy Trading in Future Distribution Systems

: Today, the pace of development of decentralized transactive management systems has increased signiﬁcantly due to growing renewable energy source technologies and communication infrastructure at the distribution system level. Such bilateral energy transactions have changed the structure of electricity markets and led to the emergence of a local energy market in electricity distribution. While examining this change of attitude, this paper analyzes the effects of local market formation on the performance and performance of distribution companies. Accordingly, the technical requirements in the three areas of operation, network control, and ICT in the new workspace are thoroughly examined. The hardware requirements will be presented in two parts for the end-user and the distribution systems. Then, the proposed local distribution market framework will be introduced, and ﬁnally, the conclusion will be presented.


Background
With the change in the structure of power systems, the management of power distribution systems has witnessed many changes. The systems are under severe pressure due to increased demand growth, irrational tariff policies, network constraints, and lack of investment resources. Therefore, it must move quickly from a traditional system to an intelligent and decentralized system [1].
With the onset of restructuring, it is possible to sell energy in a competitive environment, and through the mechanisms of the electricity market, energy exchanges could be established between different producers and consumers. Based on these mechanisms, distribution companies can buy energy from wholesale markets and sell electricity through retail markets. Such competition over retail electricity supply has created a good opportunity to choose the electricity supplier to different distribution system consumers [2].
However, the transferring of electricity based on this traditional pattern is basically one-sided, meaning that electricity is usually supplied from large-scale generators to different consumers over long distances. In recent decades, distributed generation (DG) units based on renewable energy sources (RES) have grown significantly at the distribution level. As these resources increases, traditional energy consumers become prosumers who can consume and produce energy [3]. Due to these energy sources' usual intermittency, the surplus of a prosumer can be stored, transferred to the power grid, cut off, or sold to other energy consumers [4]. In recent years, demand response (DR) concepts in distribution systems have been developed to balance energy production and consumption, avoid network congestion problems, and peak load control [5,6]. With different DR approaches, each consumer can benefit from a variety of monetary incentives by controlling all or part of their load.

Aims and Motivation
Moving towards the design, deployment, and implementation of a local energy market for electrical professionals must be understandable and practical. Managers who have been working in the distribution system for many years must understand how this market is implemented and adapted in the current power grid. Accordingly, the purpose of the paper is to provide a general paradigm, rather than a comprehensive literature review, for a specialist familiar with the distribution system. In this article, while examining the practical aspects of establishing a local market, the generalities and essential points that must be considered in practice by the experts to deal with the issues are clearly stated. Expressing the differences, changes and classifying practical matters can be helpful in foresight and ease of deciding on the approach to establishing a local energy market in the current situation. At the end of the article, to show how to transform the existing distribution network into one integrated with the local energy market, a model is proposed which can be entirely understood by any person specializing in the distribution system.

Contributions
This paper examines the electricity market transactions and explores definitions and reasons to establish a local energy market. The technical requirements needed to implement such large-scale market mechanisms within the distribution system are to be analyzed. In fact, the effects of setting up a local market on the control, operation, and planning of electricity distribution systems, along with the opportunities and obstacles to its implementation, will be examined. The approach and framework of implementing the local energy market in the distribution system and examining the horizon of such an attitude are also the issues discussed in this article. Considering all points, the contribution of the paper can be summarized as follows:  Classification of practical requirements for establishing a local market at the distribution level system • Introducing the functional principles of the local market framework • Proposing a local distribution market in the actual structure of the distribution system.

Paper Organization
Therefore, the different sections of this article are organized as follows; Section 2 provides an overview of the types of energy transactions in the electricity market and an introduction to the local energy market; The technical requirements for implementing such a market will be discussed in Section 3; In Section 4, A proposed framework for the operation of the local energy market in the distribution system is introduced, and in Section 5, A summary and conclusion will be presented.

An Overview of Transactions in the Electricity Market
In this section, the types of energy trading within the power system are briefly reviewed. Afterward, the local energy market's role and approach within the distribution system will be discussed in different situations.

Energy Trading in Power Systems
With the change in the electricity industry structure, many countries moved towards the emergence of competitive electricity markets by liberalizing integrated electricity companies in centralized sectors [14]. The electricity market is a mechanism through which electricity suppliers and consumers interact to determine the price and amount of energy. Therefore, to make a profit, the market (electricity and services) was formed for various generation, transmission, and distribution enterprises.
In general, the electricity market is divided into wholesale and retail systems that conduct transactions based on well-defined protocols [15]. In a power transmission system, large power generators and large power consumers participate in wholesale electricity markets to sell and buy energy. Large electricity consumers are electrical distribution systems that buy energy from wholesale markets to meet consumers' energy demand in different regions. The wholesale market, which operates at the transmission network level, is responsible for ensuring the balance of supply and demand, maintaining the system's reliability and security, and minimizing the cost of supplying demand at a system level to the regional level [16]. Participants in this market include power generation companies, transmission companies, distribution companies, large consumers, and independent system operators (ISO). Electricity is sold through various contracts, such as a central auction (e.g., PoolCo model) and bilateral contract.
With the Distribution System Operator (DSO) introduction, the retail market was introduced at the level of electricity distribution companies, whose task is to purchase high voltage energy from the wholesale market and transfer it to customers and clients (potential customers). The DSO acts as a gateway to the services available in the market. In fact, the participants can ask DSO for general services, and it can introduce and offer possible ones. Due to consumers' access to various retail services and free entry into the market, this market is very competitive because consumers can change their retailer for better services and more reasonable prices [17]. In this market, a flat energy price is usually calculated based on the price of the transmission node, which can cause market inefficiency due to not paying attention to the distribution system's limitations [18]. Therefore, to make more profit and reduce the financial risk of the commitment, profit-based retailers must prepare their plans based on two tasks: (1) buying from the wholesale market (2) selling in the retail market. The planning is managed through wholesale markets (such as Real-time markets) or wholesale contracts (such as Future Contracts). In addition to buying energy from large power plants, some retailers prefer to receive some of their electricity through bilateral contracts with small-scale power units at certain times. These units can include renewable energy sources and traditional generators such as diesel engines [19]. With recent advances in electrical networks, new entities such as DR service providers and electric vehicle aggregators have been able to offer new capabilities to increase the efficiency of power systems. On the whole, the market can get the required energy through actual generation sources (traditional and renewable generator) and virtual production (DR and electric vehicle response) [20]. Figure 1 shows an overview of the wholesale and retail markets, according to the above explanations.
Energies 2021, 14, x FOR PEER REVIEW 4 of 2 market (2) selling in the retail market. The planning is managed through wholesal markets (such as Real-time markets) or wholesale contracts (such as Future Contracts). In addition to buying energy from large power plants, some retailers prefer to receiv some of their electricity through bilateral contracts with small-scale power units at certai times. These units can include renewable energy sources and traditional generators suc as diesel engines [19]. With recent advances in electrical networks, new entities such a DR service providers and electric vehicle aggregators have been able to offer new capabilities to increase the efficiency of power systems. On the whole, the market can ge the required energy through actual generation sources (traditional and renewabl generator) and virtual production (DR and electric vehicle response) [20]. Figure 1 show an overview of the wholesale and retail markets, according to the above explanations. Today, increasing concerns of climate change advances in technology and subsidie encouragement have led to high penetration of renewables and distributed energy suc as rooftop solar at the distributed system level. The need to invest in replacing old an worn-out generation units and modernizing transmission and distribution networ infrastructure has also led to this attitude's growth and, consequently, changes in th electricity market's current structure [21]. So there is a must to transit to a competitive an efficient eco-system. In the new environment, transactions depend on informe consumers' ability and willingness to seek out and select contracts that fit their need actively. Accordingly, it is necessary to introduce a new paradigm based on which th expectations and demands of the electricity industry and consumers can be adequatel met [22].

Local Trading in the Distribution System
As a result of the surge of various DG options at the distribution system level and th emergence of prosumers, new challenges have arisen to supply and demand dynamics i power generation and the need for on-site flexibility. After years of centralization, th current market environment requires simplifying entities, structures, and a more stead behavior. The goal is to develop a more predictable model, more standard, and mor Today, increasing concerns of climate change advances in technology and subsidies encouragement have led to high penetration of renewables and distributed energy such as rooftop solar at the distributed system level. The need to invest in replacing old and wornout generation units and modernizing transmission and distribution network infrastructure has also led to this attitude's growth and, consequently, changes in the electricity market's current structure [21]. So there is a must to transit to a competitive and efficient ecosystem. In the new environment, transactions depend on informed consumers' ability and willingness to seek out and select contracts that fit their needs actively. Accordingly, it is necessary to introduce a new paradigm based on which the expectations and demands of the electricity industry and consumers can be adequately met [22].

Local Trading in the Distribution System
As a result of the surge of various DG options at the distribution system level and the emergence of prosumers, new challenges have arisen to supply and demand dynamics in power generation and the need for on-site flexibility. After years of centralization, the current market environment requires simplifying entities, structures, and a more steady behavior. The goal is to develop a more predictable model, more standard, and more transparent [23]. In response to these challenges, system operators and suppliers began to develop new strategies to achieve a more decentralized system. Therefore, Transactive Energy (TE) has been introduced to coordinate active consumers using market-based structures. That is, the solution is local energy management, which is the decentralized coordination of energy supply, storage, transport, conversion, and consumption in a specific geographical area [24].
In fact, transactive energy can be considered a free market with internet-enabled facilities, where consumers, prosumers, and networks can trade securely with a reasonable price and near real-time settlement to solve their mutual problems [25]. In this regard, the European Commissioner for Energy proposed a decentralized, smart and integrated market model in 2016 to achieve sustainability goals in the decarbonization of the electricity sector in Europe [26]. In a nutshell, by reforming the energy market, the model aims to empower consumers to have more control over their choices. Thus, an alternative market organization was introduced as consumer-centric electricity markets [8] or micromarket/local electricity markets [27].
Local electricity markets are an emerging trend designed to involve end-users in the future of sustainable energy. In general, such a market can be considered an efficient way to manage energy at a community level. Local electricity markets can provide two different types of services: energy and flexibility. Flexibility services are related to participation in DR programs. Both markets can be established in the form of pool-based (central) and peer-to-peer (P2P)-based (distributed). However, both approaches require a proper ICT infrastructure as a critical factor [27].
Direct negotiation or bilateral contracts are not allowed in the centralized method, but all participants must prepare a contract through the platform entity. This entity is the local market operator and manages the market. This method is often used at the microgrid level, and there will be a single price for electricity [28].
Direct energy trading of consumers and prosumers is called P2P energy trading, which is developed based on the concept of the "P2P economy" and is usually located within the distribution system [29]. In this architecture, the participants' transaction is done separately, one-to-one, and based on pay-as-bid, so there are different prices in each transaction [30]. The prosumer community group is another model that aims to provide common ground for the coordination of neighbouring prosumers to exchange energy and information with the local community and, even with external energy institutions [31]. The concepts of P2P and Community-based transactions are firmly following the principle of participatory economics because it is a structure that eases exchange between members of all agents or peers, so it will be very suitable for local electricity markets.
The P2P approach in energy markets is made with the help of a well-known Distributed Ledger Technology (DLT). The most famous branch of this technology is blockchain.
Blockchain can be defined as a distributed and digital transaction technology that allows secure storing of information and execution of smart contracts in P2P networks [32]. Based on a smart contract, energy data transactions must first be approved by peers using a kind of agreed protocol embedded in a common execution path. Instead of having a central body responsible for coordinating, settling, and archiving, the technology does this in a decentralized manner and relies on several institutions that work parallel with a specific ledger copy [33].
In general, important applications of the local energy market in the distribution system can be divided into flexibility services and energy services. The difference between the two services is in the way the parties participate in the market. When only energy supply is needed, it can be referred to as energy services. But if it is taken in the direction of demand response measures, it can be considered a flexibility service. In the following subsections, the local energy market's essential applications in the distribution system will be discussed. Flexibility services at the distribution level can be provided through DR and end-user accompaniment. With the realization of smart grids, load response has shifted to intelligent load management with two-way communication. Therefore, the program moves towards real-time interactions with the end-user.
As renewable energy resources increase, to maximize these resources' integration and profitability, there is a need for end-users flexibility. In fact, high flexibility is required to deal with the uncertainty of renewable production and demand-side variability. Accordingly, flexible power service can be defined as an adjustment of power from a specific location in the network at a given moment of a given period [34].
In smart grids, despite energy prosumers and distributed energy production (such as PV) or consumption (such as EV), it is predicted that the optimal use of local resources and their benefits due to their physical proximity to the load can be a good factor of success of local stakeholder interactions through the local energy market [35]. Therefore, DR will be a challenging issue in the new environment. In this case, transactive control is a way to manage consumption rates and generation resources on the demand side through the local market. Therefore, interactive nodes are defined as connection points between different network parts for power transmission [36]. Each node is a physical point in the electrical network representing consumers or prosumers, substations, and power companies. These nodes decentrally and constantly share information for local decisionmaking. To exchange information between different levels of transactive energy systems, the use of open automated demand response (OpenADR) is one of the valuable tools for DR data transmission. With this methodology, all price and demand-side information can be exchanged between nodes and upstream transactive system levels in a single language [37].
Therefore, transactive control demand response can be considered as a system to involve end-users in the interactive market that optimizes the use of intelligent loads and equipment of the electricity company based on consumer preferences and specific local network parameters. Recently, the implementation of DR programs in residential and commercial buildings with transactive control is increasing. Loads such as air conditioning systems (HVACs) and thermostatically controlled loads (TCLs) are the main objectives of transactive control through DR schemes [38,39]. By developing and expanding the capabilities, home energy management systems (HEMS) and building automation systems (BAS) have also been used in the transactive control processes. As a control interface, these systems can play an effective role in implementing DR programs in the context of the transactive energy system [40,41]. Electric vehicle charge management can also be used in the context of transactive control as a form of DR programs. In a decentralized transactive system, by pricing interactive nodes, DSO can force different consumers to inject excess surplus vehicle storage power into the network at specific periods to modify the demand pattern. In such a structure, a fleet operator can play the role of a low-level monitoring agent of the network to prevent congestion or violation of constraints [42,43].
TE-based grid management, including microgrids and aggregator models, also provides local control of power consumption and power generation resources. Interactions and energy management in these situations can be executed in two ways: centralized and decentralized or transactive control. In general, microgrids can be divided into three categories, depending on the parties' participation in energy supply and demand. The goal of energy management in the first class is to minimize energy costs one-sidedly. The second category is hierarchical with two sides: the microgrid operator and the other is the end-user. The last category has several parties, each of which can act as a producer or consumer of energy [44]. In each case, the transactive control system must program the demand-side price so that it is possible to run DR programs while operating the microgrid. Therefore, different DR models are prepared between the virtual power plant and consumers, and based on cost and distribution of additional profits between the parties; pricing procedures are designed [45]. The integration of transactive energy systems within the DSO enables the aggregator to improve the mutual benefits between itself and the electrical system by providing flexibility from available resources. In fact, an aggregator can communicate directly with the demand side, attune registered customers, consumers, and prosumers, and determine costs and rewards between them [46]. In this case, the load aggregator intends to maximize its benefits by bidding for transactive services. So aggregators in such a local market can be managers who sell flexibility to third parties such as DSOs while at the same time reducing end-user flexibility by dropping their electricity bills in periods without the request of third individuals [47].

Energy Services in the Local Market
As mentioned, transactive energy systems can enable P2P management on smart grids using intelligent devices. To this end, the system introduced a P2P market among all subscribers, consumers, and prosumers equipped with DERs [8]. P2P markets represent only one of the successful models of transactive energy markets, and similar measures can be taken at the distribution network level [48]. For instance, there is the concept of a local pool in the energy transaction of distribution networks, which balances supply and demand with the lowest production cost. In [49], two types of P2P electricity trading mechanisms in distribution systems are introduced for the future distribution system; auction-based P2P trading, bilateral contract-based P2P trading.
To implement the auction-based P2P energy trading mechanism, the Distribution System Operator (DSO), in addition to its responsibilities for the safe and reliable operation of the system, is designed to manage a competitive P2P electricity trading market. In this case, prosumers are considered entities with self-centered economic purposes. In such cases, as a local market's participants, each prosumer submits a price offer to buy or sell to DSO confidentially so that after receiving all the offers, the DSO runs the market mechanism with an iterative negotiation process. According to this mechanism, if the DSO is independent of the utility, the company can submit its offers to the DSO and others.
In the bilateral P2P energy trading mechanism, the DSO's tasks, in addition to its previous responsibilities, was not to manage the market but to provide a platform in which trading offers are sent and traded. Also, to prevent arbitrage, prosumers must register as buyers or sellers in this platform during a particular operation period [49]. In this case, price offers are offered to DSO, and all buyers and sellers can see these prices. If the buyer is willing to trade with a seller, he can send a contract to the bidder and ask for its approval. The approved contract must be sent to the DSO for final approval to review issues such as safe system operation; otherwise, the contract will be canceled.
P2P energy trading allows each peer (a consumer, a prosumer, a manufacturer, or even a supplier) to choose a peer to trade (buy or sell) energy according to their specific goals, such as minimizing cost, maximizing profit, minimizing pollution, and acquire more reliable energy supply [4]. Customers in P2P markets, if they are prosumers, can trade surplus production with customers who request energy. The energy transaction can also be based on multiple long-term or temporary contracts between all network players. In general, two types of contracts can be considered: (1) between prosumers and (2) between energy providers and consumers [50].
In general, unlike the current distribution method, which mainly seeks to save on scale and benefits of the goal, the value of the P2P architecture stems from the sharing economy. Besides, regardless of the choice of market matching mechanism, it is expected that the implementation of large-scale P2P interactions will affect the power company's ability to operate an efficient and reliable distribution network [51]. Figure 2 gives an overview of the local distribution market.

Technical Requirements
The distribution system as the last chain of electricity supply has inherent characteristics in the traditional structure and basic concepts. The network design of this system is mainly radial and one-side supply. Protection devices of network and even customers are designed based on a one-way network. Despite moving towards smart grids in recent years, most distribution networks are not completely monitoring all electrical parameters. This will make it difficult to control and observe the network with high penetration of DER units.
Due to these systems' structures, the distribution network's reliability also has different values at different voltage levels. Unlike transmission networks, the distribution network's reliability may have a considerable difference depending on the city and village or different geographical areas (mountainous, plains, etc.) or even the type of consumers (industrial, residential, etc.). Recently, despite the improvement in the reliability of electricity distribution networks, factors such as investment, management policies, and load sensitivities have affected the classification of different network reliability levels. Thus, it must be said that the reliability of the distribution network has a considerable difference compared to the transmission network.
In addition, despite moving to implement ICT infrastructure in smart distribution networks, embedded platforms are unlikely to meet all of the future's real-time activities. Also, data from consumers, producers, and electrical grid parameters are stored and managed almost centrally. Such a centralized structure, based on retailers' attitudes, will not allow any change in the presentation of data in a decentralized context. The dominant view of the distribution company is still as a service enterprise. Therefore, a transparent financial turnover from consumption to production is perhaps one of its managers' most significant concerns, so that changes in these conditions will require a fundamental change in the performance of the distribution company.
By changing the approach to transactive energy, the structure and technical requirements will undergo fundamental changes. In general, the term transactive energy refers to methods used to manage the generation, consumption, or electrical power flow in an electrical system through economic or market-based structures, while at the same time, the reliability constraints are considered. To implement the P2P market, which is associated with the entry of many DERs in the distribution network, the views and equipment required must be reviewed and revised. These are presented in the following three categories:

•
Electrical network: Rethinking about the network's design and planning so that the possibility of a two-way or multi-way power supply is considered. This should be seen in the network topology and typology, the selection of new equipment, and the

Technical Requirements
The distribution system as the last chain of electricity supply has inherent characteristics in the traditional structure and basic concepts. The network design of this system is mainly radial and one-side supply. Protection devices of network and even customers are designed based on a one-way network. Despite moving towards smart grids in recent years, most distribution networks are not completely monitoring all electrical parameters. This will make it difficult to control and observe the network with high penetration of DER units.
Due to these systems' structures, the distribution network's reliability also has different values at different voltage levels. Unlike transmission networks, the distribution network's reliability may have a considerable difference depending on the city and village or different geographical areas (mountainous, plains, etc.) or even the type of consumers (industrial, residential, etc.). Recently, despite the improvement in the reliability of electricity distribution networks, factors such as investment, management policies, and load sensitivities have affected the classification of different network reliability levels. Thus, it must be said that the reliability of the distribution network has a considerable difference compared to the transmission network.
In addition, despite moving to implement ICT infrastructure in smart distribution networks, embedded platforms are unlikely to meet all of the future's real-time activities. Also, data from consumers, producers, and electrical grid parameters are stored and managed almost centrally. Such a centralized structure, based on retailers' attitudes, will not allow any change in the presentation of data in a decentralized context. The dominant view of the distribution company is still as a service enterprise. Therefore, a transparent financial turnover from consumption to production is perhaps one of its managers' most significant concerns, so that changes in these conditions will require a fundamental change in the performance of the distribution company.
By changing the approach to transactive energy, the structure and technical requirements will undergo fundamental changes. In general, the term transactive energy refers to methods used to manage the generation, consumption, or electrical power flow in an electrical system through economic or market-based structures, while at the same time, the reliability constraints are considered. To implement the P2P market, which is associated with the entry of many DERs in the distribution network, the views and equipment required must be reviewed and revised. These are presented in the following three categories:

•
Electrical network: Rethinking about the network's design and planning so that the possibility of a two-way or multi-way power supply is considered. This should be seen in the network topology and typology, the selection of new equipment, and the choice of feeder and network capacity so that the new approach should provide a suitable redundancy in the planning of network elements. Conventional electrical Control layer: In this situation, given that perhaps each end-user can also be a prosumer, the principles of network protection and control need to be adapted based on the new situation. In this case, the concept of a control system can include power supply sustainability (i.e., voltage control, frequency control, active power control) to power quality (e.g., harmonics level, flicker level, voltage fluctuations) and even network load flow. Installation of the control equipment should be used at the network level and prosumers' location to meet the new paradigm's goals. • ICT layer: The implementation of the new structure, given the size and volume of the distribution network, requires appropriate and robust platforms, devices, and telecommunications protocols. In modern architecture, much data is generated, and the management of this data, its validation, and the security of data exchange between multiple parties are perhaps the most complex processes in such an environment. The exchange of consumption or production data on an instantaneous basis and the sending transaction signals and requests should be made with suitable ICT facilities. That is, information flow will be one of the main concerns of LEM architecture. Therefore, telecommunication devices such as sensors, routers, servers, wired or wireless communication channels, and communication protocols, along with communication applications, are required to establish intended data flow.

Technical Effects of Local Trading on the Distribution System
The development of local energy markets has economic, social, and technical effects on the electrical distribution companies [52]. Economic effects can be summarized as impacting customers' energy bills and energy-sales revenue at the distribution level. The effects that individuals can experience independently and as part of families, households, communities, and society can be called social effects. Factors such as influences on lifestyle, culture, welfare, and environment are included in this category. The technical effects that local energy markets have on the electricity distribution system are unknown and opaque. These effects can be observed in network layout changes, network planning and operation approaches, network electrical analysis methods, network maintenance programs, staff technical skills, and regulation. Accordingly, the technical implications discussed below will include a wide range of items, including impacts on technical infrastructure, network constraints, skill requirements, and even regulatory rules:

•
Principles of network layout: The power distribution system's current structure transfers power from upstream to customers. In such an architecture, the design and development of the network have been considered over the years so that feeders, transformers, and other equipment have been implemented based on the radial structure. With the daily growing penetration of generation resources at low and medium voltage levels, all network equipment should be ready to distribute power on both sides and even transfer excess power to higher levels. Therefore, feeders and transformers' capacity, providing multi-way feeding facilities for feeders, creating conditions for power transmission to higher levels, reviewing the protection method of all distribution voltage levels, and even the customers' side can be affected. So, the revision and modification of the network layout will be based on the structure's goals that can produce and consume in each network node. Besides, it should be able to be used as a microgrid in all special situations. • Network planning and operation: With the local energy market approach, the distribution system's planning and operation are also affected. Any network planning should be done with a view to production/consumption at load points. This view will undoubtedly leave planning with many uncertainties. On the other hand, with the proximity of production sources to load centres, the need to invest in network assets in the upstream decreases. This can manage the risk of uncertainties so that the network schedule is prepared with acceptable accuracy over a specified time horizon. The approach to operating the grid in the local energy market environment needs to be seriously reconsidered. It must be very smart since each node has the potential to generate power, and at the same time, the power circulation in the network can be changed. From this perspective, instantaneous changes in the operation of such a structure should be monitored to prevent potential network problems. The impact of this space by moving towards automated operation can significantly prevent problems in operation. However, until reaching this level of automation, the existence of appropriate and intelligent controls throughout the network may be a short-term solution. Network constraints must also be carefully considered in these circumstances. Network density and loading limit of feeders and transformers can be the most critical operating constraints of such an architecture related to the distribution system's reliability. Therefore, due to the possibility of extensive changes in the power flow along the feeder, the network density constraints should always be checked. Network losses are also a constraint that must be managed in the network's operation and according to the flow path. The widespread presence of renewable and non-renewable energy sources will increase the possibility of power quality issues (harmonics, flicker, etc.) in different nodes, which are additional problems caused by the new paradigm. The operation of such a network should examine the effects of power quality concerning changes in the power supply methods of the network nodes to prevent potential hazards to equipment. Apart from the above, in cases where there is a surplus generation at the distribution level, the return of power upstream or distribution at points where there is a shortage can also affect the network's operation. • Electrical network analysis methods: To create a local energy market structure, the current approaches to analyzing the electrical grid must also be changed. Load flow calculations are one of the most popular analyses performed in traditional distribution networks, often with radial structures. With the new structure, such calculations must be performed for two-way or multi-way-feed analysis depending on the nodes' production or consumption status. In fact, electrical analysis of networks whose nodes can be converted to consumption or production nodes should be considered in the other analyses, such as calculating short circuit level, line loading limit, node voltage values, and cases that endanger network stability. Analysis of the power quality of such a network can be one of the most complex analyses. A wide variety of renewable generations with different technologies and active prosumers may have adverse effects on various nodes, adjacent loads, and even the entire distribution system. Such an analysis, given the diversity of electricity generation types, should be done to make the necessary arrangements before damage occurs to the equipment [53]. Distribution network reliability analyzes are also likely to be changed in this architecture. Due to the nodes' dynamic state in terms of production or consumption, it can be assumed that the reliability analysis of such a distribution system will be associated with many complexities. Perhaps new definitions should be introduced in such a structure to reflect the concept of reliability better. Also, network stability analysis should be added at the distribution level. The diversity of production resources in the distribution network will require unique methods of sustainability analysis. • Network maintenance and repair programs: Distribution system repair programs can also be affected the local energy market environment. In a traditional distribution system, the profitability of selling energy to customers is the primary driver of decisionmaking in network maintenance and repair programs. In the new architecture, the diversity of factors will complicate such a decision. On the one hand, the preferences of prosumers should be taken into account, and on the other hand, the stability of the network structure for the overall satisfaction of customers should be considered. These can affect the duration of repair programs, the type of programs, and even the period of their implementation. Therefore, asset management in such a market is a complex issue that includes several factors and constraints and will be intensely dependent on the new distribution network's complex structure. • Technical skills of employees: Any action in such a new environment requires employees who, in addition to recognizing and understanding the true meaning of structure, have the mental and practical readiness to implement the ideas in line with the goals. Although continuous staff training can play an important role, intelligent and creative personnel in such a structure can greatly impact the system's proper functioning in critical situations. Variety of actions, many changes in the type of analysis, the need for up-to-date knowledge, very high concentration, and correct knowledge of the situation should be considered for capable employees' skills. • Regulations and laws: In general, a P2P transaction agreement is a contract for the sale of goods. However, because electricity is a physical phenomenon, it follows nature's laws, especially Kirchhoff's laws, which impose physical restrictions on the electricity trade [47]. Thus, in practice, the trade parties do not exchange electricity but merely agree to change their supply and demand for electricity by a certain amount of money. Accordingly, the rules governing the parties must conceive such a viewpoint. The laws may be defined depending on the restrictions defined for any country or region. These regulations can even be adjusted for the amount of generation capacity at the distribution level (local or general), the amount of high-level transmission capacity, or such actions' timing. Thus, they influence the development and progress of the local energy market. Regulators should also provide frameworks for meeting two-way power flow requirements. These regulations should also be defined because of voltage stability problems and the challenges of microgrids' safe operation, especially during island operation. Besides, since local energy systems use distribution infrastructure, the rules for using the distribution network should be considered depending on the different local conditions and the network structure (urban or rural).

Hardware Requirements
The integration of DERs into the power distribution network is likely to present operational challenges for the system, which require monitoring and control systems to be installed to prevent potential problems. The existence of these challenges in P2P transactions has caused the following problems in the implementation of the local energy market [48]: • Uncertainty: Planning and dispatching of DER power is associated with uncertainties. This is more acute in small areas of the distribution network or even parts of an islanded network. • An intrinsic feature of the network: Distribution lines, especially low voltage systems, are resistive. The network resistance presence will have significant consequences for power consumption (active and reactive), voltage, and even frequency. Therefore, according to the structure of the distribution network, it is necessary to install different monitoring systems in different parts of the system so that in addition to monitoring various parameters affecting the operation of the network, it provides opportunities for timely control and action. In addition, decision-making and control over the proper execution of P2P trading contracts should be provided in such circumstances.
Such systems can be divided into network side and end-user side. Grid-side systems are facilities that must be added to or installed in an existing grid to enable the formation of a local energy market. Accordingly, such requirements must also exist on the part of the end-user. In this work, only the technical requirements are considered, and the items related to ICT or similar are beyond the scope of this work.

Network Side Systems
Such systems are divided into two parts, monitoring and control systems, each of which is described below.

•
Monitoring systems: These systems are responsible for monitoring electrical parameters, network constraints, and other items such as economic parameters. From a technical point of view, only monitoring electrical parameters and grid constraints is considered to confirm the local energy market's performance. These systems are discussed as follows: 1.
Voltage monitoring: In the new structure, monitoring the voltage of the nodes is one of the most necessary measurements. Changes in this electrical parameter due to generation changes, power supply direction, and even voltage quality should be considered. Therefore, forecasting the amplitude of voltage changes must be considered to prevent possible damage. Thanks to smart meters, this requirement can be met.

2.
Frequency monitoring: the existence of various energy generation sources at the distribution level, network frequency changes must also be monitored. Accordingly, the cases that cause frequency instability should be considered to prevent instability of the entire network. To this end, measurement of frequency changes during generation units on/off transition, power outages, and disruptions, repair programs must be very carefully tracked.

3.
Power monitoring: In one-way power flow networks, line-loading limits must be observed. However, if it is possible to feed in several ways, the concept of congestion should be considered. In this case, the flow of active and reactive power and their direction must be monitored not to affect the congestion of lines. Therefore, the use of power-directional monitoring equipment in the network is mandatory so that in case of any change in power direction for various reasons, the network status can be monitored.

4.
Consumed or produced energy Monitoring: The amount of produced or consumed energy on each side (network or prosumer) should be monitored to validate market deals.
• Control systems: Such systems' primary role is to control various parameters for the local energy market's proper functioning. In general, control systems can be classified into two categories: electrical parameter control systems and contract-guarantee control systems.

1.
Electrical parameter controller: A typical distribution network can have two general statuses concerning the upstream network; connected and islanded.
In grid-connected mode, the grid frequency and voltage at the common coupling point are mainly determined by the upstream grid. The distribution grid frequency usually follows the transmission grid. In the connected case, the distribution network controller's role can be introduced to regulate the voltage at buses, solve voltage increase during low load conditions, balance active and reactive power in the DERs-load environment, and proper power flow in the network. Accordingly, the control of the parameters can be done with the upstream network's help, so the distribution level controllers must have proper coordination with the upstream network. Dividing the network into different control zones may be an excellent way to control the whole network. Due to the lack of connection to the upstream grid in islanded or off-grid mode, the electrical parameters must be controlled by different DER units and intelligent loads, which will require precise load sharing mechanisms for power balance. Accordingly, the controller's primary role can be considered in the continuous regulation of active and reactive power to balance the system and maintain the frequency in the allowable range, voltage regulation, and proper power flow [49].

2.
Contract controller: A Transactive controller is used to exchange all the information needed in trading and managing energy exchanges on a telecommunications platform [50]. When a prosumer wants to buy or sell energy from the grid, it sends a request to the system. Therefore, a transactive control platform should evaluate all prosumer inquiry requests to send the relevant prices to all prosumers to decide whether to accept or reject requests [51]. Different technical approaches, such as game theory, auction theory, and constrained optimization for p2p transactions, have been proposed. According to their type, the control of these transactions should often be done through a centralized institution [52].
With the increase in the number of transactions in the local energy market, such a centralized institution may not respond in a timely and appropriate manner. Therefore, blockchain-based p2p transactions have been suggested. In this case, smart contracts are used, which is a computer transaction protocol. In such a situation, many contracts between prosumers in a local energy market can be managed in a decentralized manner and in real-time through the blockchain's capabilities [53]. Consensus protocols embedded in the blockchain can control the automatic control of p2p transactions, which can be done through the relevant software.

End-User Side Systems
The location of smart meters is the common coupling point with end-users. There should be the ability to monitor and control these users' consumption, which can be prosumers, active and passive loads, to enable them to exchange energy with the distribution network.

•
Monitoring system: Using the smart meter capabilities, various electrical parameters can be monitored on the end-user side. Parameters such as voltage, frequency, instantaneous power, as well as energy consumption or production are important items that can be monitored by a smart meter at the common connection point of users. By establishing a common platform, each end-user can analyze and control their energy exchanges with the local market. Besides, the presence of building monitoring systems, IoT platforms, and monitoring and recording of energy consumption at the site of various electrical devices can also improve end users' observing system. These will provide them a more accurate analysis to participate in the local energy market. • Control systems: By installing controllers in monitoring facilities' vicinity, two systems can be used simultaneously. Accordingly, by monitoring the electrical parameters, the desired controls can be applied instantly to provide proper participation in the local energy market by end-users. Well-known controllers include controllable-load control and thermostatic-load control, but the development and expansion of other types of load controllers should also be considered [37]. A building energy management system on behalf of the end-user considering market offers can automatically apply appropriate controls based on predefined settings such as optimum temperature, expected profit and risk preferences, etc.

Proposed Local Energy Market Framework
In this section, a plan for the local market is proposed. The market components are studied, and then, framework and how the proposed market works are discussed.

Market Components
To design a transactive local energy market, its components must first be introduced. In general, the components are divided into three general categories: local energy sources, distribution system structure, and information system. Each of these components is discussed below.

•
Local energy sources: At the distribution level, there are several developments and usage potentials of local energy sources. These energy sources can include various renewable and non-renewable sources, at low or medium voltage levels, and an end-user as a prosumer or independent unit. These resources can participate in energy trading depending on the type of production, availability range, and network conditions. Also, various storage systems can be available at low or medium voltage levels as local energy sources, depending on the situation. Electric vehicles are another category of local energy sources that can influence local energy transactions. All of these energy sources at different locations and different voltage levels of the distribution system must be identified, and their potential for energy exchange should be considered.

•
Distribution system structure: In general, distribution networks are operated at two low voltage and medium voltage levels. The structure of most distribution networks is also radial. Therefore, the use of feeding conditions from two or more directions in such networks' design has not been considered. The operation of a structure powered by local energy sources requires high skills, expertise, and readiness and may improve the distribution network's level of automation. Islanded operation is another issue that can be encountered in the distribution network. The distribution system structure is often unprepared for such situations, and if it is operated in an islanded mode, proper precautions must be taken. The long-length distribution network, low loadfactor of the feeders, the relatively low reliability of the network, the high impact of environmental conditions, and even severe changes in demand are prominent features of the network that should be considered in the design of local market transactions.

•
Information system: The information layer is one of the essential constituents in implementing a local market. Data preparation and transfer, processing, and decisionmaking point sending a command and proper planning should be considered in designing such a market. This will accurately and identify any problems in the implementation of market transactions at the distribution level. In sensitive and critical situations or cases of disruption, decision-makers with the right information can provide the best solution to get out of problems, so transferring the right volume of data that must be prepared at any moment or in critical moments will be very important. Due to distribution network size, the diversity of energy sources, and the high volume of instantaneous data, data providers' responsibilities in each sector should be specified so that in the time of failure and consequently the decision-making time, correct judgment and actions be executed.

Proposed Market Performance Framework
In this section, a proposed framework for a distribution system with integrated P2P energy transactions is presented. First, the general principles of forming such a market in a distribution system are described. Then the various components of market formation are stated, and finally, the performance of such a market will be reviewed.

General Principles
Supposing there is a distribution network with two low voltage and medium voltage levels, in which several local energy sources are producing energy at different voltage levels. These energy sources can supply power at end-user location, or an independent place, and even within the islanded network on different feeders.
The market principles proposed here will be based on the zoning of the distribution network with the approach of having energy sources. Accordingly, low voltage feeders on which there are different energy sources are located in one zone. Under these conditions, all energy exchanges within this zone and energy exchange outside this zone will be managed by a Local Controller (LC). With this structure, all low voltage feeders are classified into different zones, and each zone will be controlled and managed by an LC. If the low voltage feeder does not have energy sources, it can be considered within one of the close zones.
The same approach will be taken for zoning medium-voltage feeders. Finally, the distribution network will include different zones with several LCs, each of which will be responsible for controlling and managing energy within the zone and exchanging energy with other zones. All LCs will also be connected to a local or regional DSO for energy exchange with the bulk grid. Figure 3 shows an overview of the relationship between energy exchange and data between proposed local market components. Accordingly, within each electricity distribution company, they will be divided into different local market zones, in which LCs will manage and control local and P2P interactions. It will be possible to change the zones or expand their number based on the development of the number of energy sources or the number of feeders.

General Principles
Supposing there is a distribution network with two low voltage and medium voltage levels, in which several local energy sources are producing energy at different voltage levels. These energy sources can supply power at end-user location, or an independent place, and even within the islanded network on different feeders.
The market principles proposed here will be based on the zoning of the distribution network with the approach of having energy sources. Accordingly, low voltage feeders on which there are different energy sources are located in one zone. Under these conditions, all energy exchanges within this zone and energy exchange outside this zone will be managed by a Local Controller (LC). With this structure, all low voltage feeders are classified into different zones, and each zone will be controlled and managed by an LC. If the low voltage feeder does not have energy sources, it can be considered within one of the close zones.
The same approach will be taken for zoning medium-voltage feeders. Finally, the distribution network will include different zones with several LCs, each of which will be responsible for controlling and managing energy within the zone and exchanging energy with other zones. All LCs will also be connected to a local or regional DSO for energy exchange with the bulk grid. Figure 3 shows an overview of the relationship between energy exchange and data between proposed local market components. Accordingly, within each electricity distribution company, they will be divided into different local market zones, in which LCs will manage and control local and P2P interactions. It will be possible to change the zones or expand their number based on the development of the number of energy sources or the number of feeders. To further clarify the concepts of the proposed framework, a demonstration example is presented in Figure 4. This figure shows the relationships of the parts if the proposed model is implemented in a typical distribution system. As shown in the figure, a medium voltage (MV) feeder fed from the MV distribution substation is converted to a low voltage (LV) feeder by an MV/LV transformer. A renewable energy source (RES) can inject power To further clarify the concepts of the proposed framework, a demonstration example is presented in Figure 4. This figure shows the relationships of the parts if the proposed model is implemented in a typical distribution system. As shown in the figure, a medium voltage (MV) feeder fed from the MV distribution substation is converted to a low voltage (LV) feeder by an MV/LV transformer. A renewable energy source (RES) can inject power into the system on each of the feeders. The MV substation is also connected to the Bulk Grid. According to the proposed framework, local market management of LV and MV levels in two zones, Zone1 and Zone2, is accomplished through Lc1 and Lc2. Data exchange with DSO and with Bulk Grid is arranged to determine the network status. Power exchange via Bulk Grid is also included if required. This architectural arrangement can be used to develop the local market in any LV and MV feeders and according to the number of local energy sources. The simplicity of local market implementation with partitioning principles based on feeders and local resources is one of the benefits of the proposed practical plan for a power distribution company. It can be implemented based on the principles set out in the previous sections.
exchange with DSO and with Bulk Grid is arranged to determine the network status. Power exchange via Bulk Grid is also included if required. This architectural arrangement can be used to develop the local market in any LV and MV feeders and according to the number of local energy sources. The simplicity of local market implementation with partitioning principles based on feeders and local resources is one of the benefits of the proposed practical plan for a power distribution company. It can be implemented based on the principles set out in the previous sections.

Market Characteristics
A set of characteristics can be identified and taken into account to form the proposed market. Each one will be described below.

•
Market players: In each network zone, which represents the local market at a low or medium voltage level, local actors, including various energy sources, consumers, etc., are available. While selecting the zone, the type of role, location, marketability, and other conditions should be clear. In fact, determining the actors in each zone, meaning the local market members, will reflect the energy exchange activities of that zone.

•
How to connect to the market: Another important issue of each of the actors is how to connect to the market. This helps in intra-zone trading and transaction management and can show each actor's role in energy transactions at different moments in terms of energy production.

•
Market size: Each zone's market size is another important feature that shows the market capability in energy transactions. This feature indicates how capable the zone is in exchanging energy within the zone and possibly exchanging energy with outside zones. Intra-zone potentials and future planning for its development must be seen through such a feature.

Market Characteristics
A set of characteristics can be identified and taken into account to form the proposed market. Each one will be described below.

•
Market players: In each network zone, which represents the local market at a low or medium voltage level, local actors, including various energy sources, consumers, etc., are available. While selecting the zone, the type of role, location, marketability, and other conditions should be clear. In fact, determining the actors in each zone, meaning the local market members, will reflect the energy exchange activities of that zone. • How to connect to the market: Another important issue of each of the actors is how to connect to the market. This helps in intra-zone trading and transaction management and can show each actor's role in energy transactions at different moments in terms of energy production. • Market size: Each zone's market size is another important feature that shows the market capability in energy transactions. This feature indicates how capable the zone is in exchanging energy within the zone and possibly exchanging energy with outside zones. Intra-zone potentials and future planning for its development must be seen through such a feature. • Market control: The roles of market control of each zone are coordination with DSO and other zone controllers. Examining the network's status inside and outside the zone for energy exchange, pricing of energy resources, managing energy sales between different actors are among the important tasks of local load controllers. Besides, the management of data exchange between different actors in each zone, the final approval of the energy transaction, as well as the network constraints check should be executed through the market controller.

How the Market Works
In general, the performance of the proposed local market can be divided into two parts. The first part is the process of energy exchange that must take place between different actors and zones. In this case, the energy trading can be done between any of the different actors or zones and even the large network. This is executed by determining the market price, the volume of energy transactions, and examining the network conditions for power transmission. To this end, initially, each zone must maintain a stable energy supply status of its zone through energy exchanges within the zone or purchases from outside the zone for different hours relative to the energy supply. Then, if there are surplus energy sources, apply to exchange energy outside its zone.
In the second part, the energy exchanges and local market actions should be monitored through the local controller to prevent problems in energy exchanges and network constraints. Data validation and execution of transactions, review of trading energy prices, amount and hours of power supply, as well as network status review are among the tasks that the local controller should perform. It must also communicate with the DSO to provide the energy needed through a large grid. The stages of market operation are briefly described in Figure 3: 1.
To perform an energy transaction between two actors within Zone 1 in a specific period, the amount of energy requested and purchased by the two actors is specified, and the transaction price is sent to LC1 for approval.

2.
The LC1 entity verifies the transaction data and, if there is no objection, approves it. 3.
In this interval, LC1 examines the grid's condition inside the zone for the rest of the producers and consumers of energy and the grid's condition and confirms the possibility of transferring power outside zone 1.

4.
Through LC2, the possibility of purchasing energy from Zone 1 is checked, and energy exchange is executed with DSO approval. 5.
In cases where LC1 requests power supply through DSO, the possibility of supply through Zone 2 or a large network with the approved price is examined and done.
Given the similar radial structure of most distribution networks, the proposed framework is almost general. However, the implementation of this model confronts several challenges. Perhaps the most significant constraint on converting the current structure to one integrated with the local market is the lack of proper monitoring equipment, leading to not covering the widespread network. Data sharing and processing play a vital role in the local market, which must be systematized within the distribution system (workforce and equipment). Another limitation is the infirmity of telecommunication platforms for the fast and accurate execution of market orders at a large scale. The other challenge can be the lack of adequate application software that can process data quickly and make careful market decisions. Even the readiness of the distribution company's staff to accept and understand such a market can be considered as another practical concern of its implementation.

Conclusions
This paper examines the local energy market's effects on the control, operation, and planning of power distribution systems. New services in the local market, called flexibility and energy services, are fundamentally changing distribution companies' approaches. Bilateral energy exchange, market decentralization, and broad end-user participation are some of such a market's salient features. These affairs are carefully examined in this article, and the new attitude of the local market is portrayed. Besides, the local market's technical effects on distribution systems in terms of the impact on technical infrastructure, network constraints and skill requirements, and regulatory rules have been investigated. The requirements on the network side and the end-user side needed to implement such a market properly are also categorized and presented. According to the current structure, a local market framework in the distribution system is proposed to understand the issue better. In this context, the approach to moving to a local market in a real distribution company is examined, and the descriptions are provided.
The investment and financial discussion to upgrade the existing network with a local market can be considered in future works. Also, the authors intend to simulate and run the proposed model using blockchain as a DLT technology. In addition, integrating data-driven strategies to form the zones can complement the proposed framework.