YANG defines the structure of network configuration and state data. It is a modeling language that describes what data exists and how it relates.
Containers group related data. An interface container holds all interface attributes.
Leaves are individual values. IP address, MTU, description are leaves.
Lists are collections of entries. A list of interfaces, each with its own attributes.
Types define valid values. An IP address type, a string with max length, an enumeration.
Why YANG matters: Vendor-neutral data representation. Both NETCONF and RESTCONF use YANG. Validates configuration before applying.