I'm trying to understand the format of the OID in SNMP so I completely understand the format of the OID I want to use the new (ipNetToPhysicalPhysAddress) rather than the older (ipNetToMediaPhysAddress).
Using the Net-SNMP pacakge I found from an answer given to this question I see this output:
snmpwalk -v2c -c public 192.168.1.1
IP-MIB::ipNetToPhysicalPhysAddress.12.ipv4."192.168.1.114" = STRING: 0:5:3b:b3:4c:4a
Using wsnmputil I built from the Windows classic examples I see this output:
wsnmputil.exe -v2 get 192.168.1.1 public 1.3.6.1.2.1.4.35.1.4
OID :1.3.6.1.2.1.4.35.1.4.12.1.4.192.168.1.114
ip.35.1.4.12.1.4.192.168.1.114
OCTET STRING - <0x00><0x05><0x3b><0xb3><0x4c><0x4a>
This shows the actual full OID for a given IP as 1.3.6.1.2.1.4.35.1.4.12.1.4.192.168.1.114
I found that the 1.3.6.1.2.1.4.35.1.4 prefix is the ipNetToPhysicalPhysAddress node at https://oidref.com/1.3.6.1.2.1.4.35.1.4
I found that ipNetToPhysicalPhysAddress syntax / type is PhysAddress (SIZE(0..65535)) at https://datatracker.ietf.org/doc/html/rfc4293.html
I found that PhysAddress Represents media- or physical-level addresses as an OCTET STRING at https://www.rfc-editor.org/rfc/rfc2579
That explains the MAC Address provided as an OCTET STRING.
What I'm trying to figure out here is how is the rest of the OID is defined, the 12.1.4.192.168.1.114 part of the OID?
From the snmpwalk output it appears the 12 is a number that is not standardized but 1.4 represents the next part is an IPv4 format (I also see what looks like 2.16 represents the IPv6 address). Perhaps the 4 and 16 is the length of the IP address that follows. Maybe the 1 and 2 are the family?
Does anyone know where the part of the OID that follows ipNetToPhysicalPhysAddress is defined?
TIA!!
When looking at RFC4293 you see:
ipNetToPhysicalTableisOID1.3.6.1.2.1.4.35andipNetToPhysicalEntryisOID1.3.6.1.2.1.4.35.1ipNetToPhysicalPhysAddressis part of theipNetToPhysicalEntryas4so that's where you get1.3.6.1.2.1.4.35.1.4This is where the rest of the
OIDis defined:The types of these entries can be found in RFC4001
The
ipNetToPhysicalIfIndexis defined as aInterfaceIndexwhich is defined as:The
ipNetToPhysicalNetAddressTypeis defined as aInetAddressTypewhich is defined as:The
ipNetToPhysicalNetAddressis defined asInetAddresswhich is defined as:Note that
(SIZE (0..255))means there is aSIZEfollowed by the data which can be0 to 255bytes in length. ThereforeSIZEmax value is255.