This documents the IOU NVRAM structure. It is based on the information in dynamips’ fs_nvram.h, see https://github.com/GNS3/dynamips/blob/master/common/fs_nvram.h
Only the first half of the NVRAM is used, the second half is zero filled.
The structure is almost identical to the Dynamips NVRAM layout. The major difference is the missing NVRAM header in IOU.
|Layout of first Half|
All data is stored in big endian order, high byte first.
|2||2||Format, 1 = raw, 2 = compressed|
|6||2||IOS version, e.g. 0x0F04 = 15.4|
|24||4||??? 0 = raw, 1 = compressed|
|28||2||??? 0 = raw, 1 = compressed|
|32||4||uncompressed len, raw = 0|
Total 36 bytes
The checksum is basically the sum of all 2-byte-words in the first half of the NVRAM. For further details have a look into iou_import, function checksum.
In raw format the configuration is stored unchanged. In compressed format, the configuration is packed the same way as in the unix compress program, see http://en.wikipedia.org/wiki/Compress . It uses the LZW algorithm.
The startup-config is padded to an aligment of 4. In IOS <= 15.0 or when the NVRAM size is at least 128 KByte, if padding takes place, an additional 4 byte padding is added.
|2||2||Format, only 1 = raw|
Total 16 bytes
The private configuration is always stored in raw format.
The files are growing from the end of the area down to lower offsets. Each file block is 1024 bytes long and starts with the magic number 0xDCBA. An unused/erased block is all zero.
|4||2||Flags, bit 0=start, 1=end, 2=no RW|
|6||2||Length of data in this block|
|8||24||File name, NUL terminated|
Total 1024 bytes