Friday, November 15, 2013

ASN.1 QUESTION

THE FOLLOWING SNMP MESSAGE HAS BEEN CAPTURED:

30 29 02 01 00 04 06 70 75 62 6c 6963 a0 1c 02 04 4f 89 fb dd 02 01 00 02 01 00 30 0e 30 0c 06 08 2b 06 01 02 01 01 05 00 05 00
DECODE THIS MESSAGE TO FIND THE COMMUNITY STRING, THE OID(s) ETC.


Friday, October 25, 2013

SimpleWeb.org exercise1 solution:

EXERCISE 1
Consider a MIB that consistsof the following objects: an IP address, a string with the system’s name,
an object that shows how long the system isalready operational and a routing table. 
The routing table has three columns: destination IP address, routing policy and the IP address of the next hop.
The routing table is indexed by the destination address and policy.
The naming tree for this MIB is shown in the picture on the next page.
Note that this MIB is used as example on the slides that explain the SMI, and will also be used in the remainder of this course. 
The exercise is now to write the complete MIB definition (in the SMIv2 syntax), including IMPORT statements and a MODULE IDENTITY (you may register this MIB under "enterprises ut(785) 8")
Don’t forget to check the syntax of this MIB using the MIB module validator at
Here is my solution: "I'm new in field, so I hope you can help to improve the solution... thanks"

NEWSH-MIB DEFINITIONS ::= BEGIN

       IMPORTS
    MODULE-IDENTITY, OBJECT-TYPE, OBJECT-IDENTITY, IpAddress, TimeTicks, enterprises
       FROM SNMPv2-SMI;

shModule MODULE-IDENTITY
    LAST-UPDATED "201310251200Z"
    ORGANIZATION "KFUPM"
    CONTACT-INFO "Alshaboti"
    DESCRIPTION  "Just for fun"

REVISION "201310251200Z"    --OCT 25, 2013
    DESCRIPTION
        "This version updates..."

::= { enterprises ut(785) 7 }


deviceNode  OBJECT-IDENTITY
STATUS current
DESCRIPTION "The first node in the tree.node(1)"
::= {shModule 2}

address OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION "Ip of this device"
::={deviceNode 1}

info OBJECT-IDENTITY
STATUS current
DESCRIPTION "under this node name and sysuptime exist"
::= {deviceNode 2}


name OBJECT-TYPE
SYNTAX OCTET STRING
    MAX-ACCESS read-write
    STATUS current
    DESCRIPTION "Name of the device"
    ::={info 1}

upTime OBJECT-TYPE
SYNTAX TimeTicks
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "Name of the device"
    ::={info 2}

routeTable OBJECT-TYPE
SYNTAX SEQUENCE OF RouteEntry
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION "Routing table"
    ::={deviceNode 3}

RouteEntry ::= SEQUENCE { dest IpAddress, policy INTEGER, next IpAddress}

routeEntry OBJECT-TYPE
SYNTAX RouteEntry
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION "Entry of routing table"
INDEX {dest,policy}
    ::={routeTable 1}

dest OBJECT-TYPE
SYNTAX IpAddress
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "destination IP address"
    ::={routeEntry 1}
policy OBJECT-TYPE
SYNTAX INTEGER(0..65535)--must have a rang because its INDEX
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "policy number"
    ::={routeEntry 2}
next OBJECT-TYPE
SYNTAX IpAddress
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "next hop IP address"
    ::={routeEntry 3}

END