| As the key technology of smart grid, power line communication (PLC) has a great advantage compared with other last-hop access methods. Power network has much wide coverage, there’s no need to wiring again for communication, and thus reducing the cost. However, power line has very bad channel conditions, once it was known as a terrible media for carrier communication. With the development of technology, some new techniques, such as orthogonal frequency division multiplexing (OFDM), multiple carrier code division multiple access (MC-CDMA), automatic relay and so on, are used in PLC with effective performance improving. Mainly based on protocols of power-line intelligent metering evolution (PRIME) and Home Plug AV, this paper proposes a new media access control (MAC) layer algorithm in order to improve the reliability and efficiency of PLC.Depending on channel sensing ability, this paper proposes a distributed resource allocation algorithm for indoor PLC networks. The algorithm is divided into two steps, sub-carrier allocation and power loading. A new MAC frame structure including a sync cycle and a data cycle is defined. During the sync cycle, a node can occupy a sub-carrier based on carrier-sense multiple access with collision-avoidance (CSMA/CA) and finish handshaking by request to send and clear to send (RTS/CTS), which would resolve the problem of hidden terminal simultaneously. Then bit loading is accomplished based on the traditional iterative water-filling algorithm and heap sorting. This method has low complexity. Simulation results show that the performance of the proposed algorithm is better than methods used in Home Plug AV and CPLC standards under the same conditions.In order to evaluate the performance under various conditions, a system-level PLC simulation platform based on network simulator version3(NS-3) is built. Core modules of the platform include PLC protocol layers’ entities, virtual net device, signal propagation models and so on. PLC network layer and layers above are implemented in original NS-3modules, data link control layer and layers below are implemented with new modules which are written in C++. This platform focuses on MAC layer functions’ implementation and MAC layer is built based on a new multi-frequency protocol. We conduct research on point-to-multipoint PLC scenario and realize a cross-band multi-frequency PLC protocol, in which a sync cycle and a data cycle are also defined. In the sync cycle, time domain synchronization and frequency domain synchronization are accomplished. Preambles are used to complete frequency cognition task because of its high robustness. Then a frequency band is selected based on a strategy and control messages are exchanged between nodes. At last both nodes acquire the information of selected frequency band and frequency domain synchronization ends. The data cycle is divided into multiple slots, and each slot can be scheduled to a node. It depends on the master node and many kinds of schedulers are available. Interfaces with schedulers and frequency-band selection categories are reserved.Considering relaying, our protocol has two versions, with and without relays. Automatic relaying brings higher complexity for PLC protocol, so many differences exists between the two versions in details. PLC simulation platform has high compatibility, high expansibility, high usability and a visualizer is realized. Based on the platform, the performances under different conditions are compared, and relevant simulation verification of PLC multi-frequency protocol in this paper is completed successfully. |