# Network Management
###### tags: `專題`
## 本週記事
* 這次閱讀材料:
* AUTOSAR_SWS_NetworkManagementInterface
* Specification of Network Management
* 這次閱讀心得:
* 大多內容都是和實作相關,以後邊實作的時候,相信會更有感覺
* 下次預計要閱讀項目:
* Specification of UDP Network Management
* classic platform 的 network management 如何實作
## 閱讀心得:
### Specification of Network Management
* Introduction:
* Adaptive Network Management (NM) is intended to work independent of the communication stack used. Its main purpose is to coordinate the transition between normal operation and bus-sleep mode of the underlying networks (physical and partial networks).
* NM is based on decentralized direct network management strategy
* AUTOSAR Adaptive NM coordination algorithm:
* Every network node transmits periodic NM messages as long as it requires buscommunication; otherwise it does not transmit NM messages.
* limitations:
* only supporting UdpNM
* does not allow node detection
* cannot be configured as the master network coordinator
* does not support coordinated shutdown using the information in CBV
* does not support passive mode and passive startup
* modeling part for mapping the logical networks to the BitVector positions is not available in the manifest
* two functionalities are provided:
* Field for requesting and releasing logical network handles
* Support for partial networking
* NetworkControl:
* SM received logical network request from application
* SM requires network communication and request/release different logical networks
* NM checks the requested state over all logical networks handles and will activate or deactivate the according physical networks
* Operational Modes
* network mode
* Repeat Message State(ensure that any transition from Bus-Sleep or Prepare Bus-Sleep to the Network Mode becomes visible for the other nodes on the network. Additionally, it ensures that any node stays active for a minimum amount of time.)
* Normal Operation State(The Normal Operation State ensures that any node can keep the NM-cluster awake as long as the network functionality is required.)
* Ready Sleep State(The Ready Sleep State ensures that any node in the NM-cluster waits with the transition to the Prepare Bus-Sleep Mode as long as any other node keeps the NM-cluster awake.)
* prepare bus-sleep mode
* The purpose of the Prepare Bus Sleep state is to ensure that all nodes have time to stop their network activity before the Bus Sleep state is entered.
* bus-sleep mode
* is to reduce power consumption in the node, when no messages are to be exchanged.
* partial network:
* Rx Handling of NM messages
* Tx Handling of NM messages
### AUTOSAR_SWS_NetworkManagementInterface
* **Network Management Interface** 是 adaptation layer,介於 Communication Manager 和 AUTOSAR bus specific network management module 之間。
* **Network Management Interface** 的目的為:支援generic lower layer modules(需要遵守特定的要求(bus specific NM modules))
* **Network Management Interface** 提供的支援
* Basic functionality
* NM Coordinator functionality
* Partial Network functionality
* (下面兩個擇一)
* **Network Management Interface** 限制:
* 只能用在支援 broadcast communication and bus-sleep mode 的 communication system
* 整個NM-Clusters 只會有一個instance 且 他會管理全部的channels,而他只包含common modes and definitions 和 不同的 bus specific NM layers 的return values
* NM Coordination functionality 會結合 Partial Network functionality
* **Network Management Interface(Nm)** 提供服務給 Communication Manager (ComM) 且使用bus cpecific Network Management 的幾個特定modules:
* CAN Network Management
* FlexRay Network Management
* Ethernet Network Management
* J1939 Network Management
* Nm 提供:
* notification callbacks 給 bus specific Network Management modules
* support generic bus specific NM layers (BusNm) -> 任何提供interface 和 使用 Nm 提供的 callback functions 的component 都可以被使用為 bus specific NM
* Nm 藉由增加 generic lower layer modules as Complex Drivers 以提供 generic bus specific NM layer
* Nm 需要循環的去看 main scheduling function 用以讓 Nm 能去感測到 timers expired
* Header files in Nm Interface module:
* Std_Types.h : for AUTOSAR standard types
* Platform_Types.h 和 Compiler.h 沒有直接被包含在 AUTOSAR standard types
* ComM_Nm.h : for Communication Manager callback functions
* BswM_Nm.h : If the BswM is used for CarWakeup-functionality