diff --git a/src/common.c b/src/common.c
index 9c0d15a..25e19f1 100644
--- a/src/common.c
+++ b/src/common.c
@@ -19,6 +19,7 @@
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>
+#include <inttypes.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -66,6 +67,44 @@
     }
 }
 
+#define LY_OVERFLOW_ADD(MAX, X, Y) ((X > MAX - Y) ? 1 : 0)
+
+#define LY_OVERFLOW_MUL(MAX, X, Y) ((X > MAX / Y) ? 1 : 0)
+
+LY_ERR
+ly_strntou8(const char *nptr, size_t len, uint8_t *ret)
+{
+    uint8_t num = 0, dig, dec_pow;
+
+    if (len > 3) {
+        /* overflow for sure */
+        return LY_EDENIED;
+    }
+
+    dec_pow = 1;
+    for ( ; len && isdigit(nptr[len - 1]); --len) {
+        dig = nptr[len - 1] - 48;
+
+        if (LY_OVERFLOW_MUL(UINT8_MAX, dig, dec_pow)) {
+            return LY_EDENIED;
+        }
+        dig *= dec_pow;
+
+        if (LY_OVERFLOW_ADD(UINT8_MAX, num, dig)) {
+            return LY_EDENIED;
+        }
+        num += dig;
+
+        dec_pow *= 10;
+    }
+
+    if (len) {
+        return LY_EVALID;
+    }
+    *ret = num;
+    return LY_SUCCESS;
+}
+
 uint32_t
 ly_value_prefix_next(const char *str_begin, const char *str_end, ly_bool *is_prefix, const char **str_next)
 {
diff --git a/src/common.h b/src/common.h
index 6e174c7..7a08f97 100644
--- a/src/common.h
+++ b/src/common.h
@@ -385,6 +385,19 @@
 int ly_strncmp(const char *refstr, const char *str, size_t str_len);
 
 /**
+ * @brief Similar functionality to strtoul() except number length in the string
+ * must be specified and the whole number must be parsed for success.
+ *
+ * @param[in] nptr Number string.
+ * @param[in] len Number string length starting at @p nptr.
+ * @param[out] ret Parsed number.
+ * @return LY_EDENIED on overflow.
+ * @return LY_EVALID on encountering a non-digit character.
+ * @return LY_SUCCESS on success.
+ */
+LY_ERR ly_strntou8(const char *nptr, size_t len, uint8_t *ret);
+
+/**
  * @brief Similar to strlen(3) but accepts NULL and returns 0.
  *
  * @param[in] s String to examine.
diff --git a/src/plugins.c b/src/plugins.c
index 694bcc9..f0800ed 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -55,7 +55,8 @@
  * ietf-inet-types
  */
 extern const struct lyplg_type_record plugins_ip_address[];
-extern const struct lyplg_type_record plugins_ip_prefix[];
+extern const struct lyplg_type_record plugins_ipv4_prefix[];
+extern const struct lyplg_type_record plugins_ipv6_prefix[];
 
 /*
  * ietf-yang-types
@@ -420,7 +421,8 @@
 
     /* ietf-inet-types */
     LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ip_address), error);
-    LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ip_prefix), error);
+    LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ipv4_prefix), error);
+    LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ipv6_prefix), error);
 
     /* ietf-yang-types */
     LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_date_and_time), error);
diff --git a/src/plugins_types/ip_prefix.c b/src/plugins_types/ip_prefix.c
deleted file mode 100644
index d6f596c..0000000
--- a/src/plugins_types/ip_prefix.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/**
- * @file ip_prefix.c
- * @author Michal Vasko <mvasko@cesnet.cz>
- * @brief ietf-inet-types ip-prefix type plugin.
- *
- * Copyright (c) 2019-2021 CESNET, z.s.p.o.
- *
- * This source code is licensed under BSD 3-Clause License (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     https://opensource.org/licenses/BSD-3-Clause
- */
-
-#define _GNU_SOURCE /* asprintf, strdup */
-#include <sys/cdefs.h>
-
-#include "plugins_types.h"
-
-#include <arpa/inet.h>
-#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__)
-#include <netinet/in.h>
-#include <sys/socket.h>
-#endif
-#include <assert.h>
-#include <errno.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libyang.h"
-
-#include "common.h"
-#include "compat.h"
-
-/**
- * @brief Canonize an ipv4-prefix value.
- *
- * @param[in] ipv4_prefix Prefix to canonize.
- * @param[out] canonical Canonical format of @p ipv4_prefix.
- * @param[out] err Error structure on error.
- * @return LY_ERR value.
- */
-static LY_ERR
-canonize_ipv4_prefix(const char *ipv4_prefix, char **canonical, struct ly_err_item **err)
-{
-    LY_ERR ret;
-    const char *pref_str;
-    char *ptr, *result = NULL;
-    uint32_t pref, addr_bin, i, mask;
-
-    *canonical = NULL;
-    *err = NULL;
-
-    pref_str = strchr(ipv4_prefix, '/');
-    if (!pref_str) {
-        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid IPv4 prefix \"%s\".", ipv4_prefix);
-        goto error;
-    }
-
-    /* learn prefix */
-    pref = strtoul(pref_str + 1, &ptr, 10);
-    if (ptr[0] || (pref > 32)) {
-        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid IPv4 prefix \"%s\".", ipv4_prefix);
-        goto error;
-    }
-
-    result = malloc(INET_ADDRSTRLEN + 3);
-    if (!result) {
-        ret = LY_EMEM;
-        goto error;
-    }
-
-    /* copy just the network prefix */
-    strncpy(result, ipv4_prefix, pref_str - ipv4_prefix);
-    result[pref_str - ipv4_prefix] = '\0';
-
-    /* convert it to binary form */
-    if (inet_pton(AF_INET, result, (void *)&addr_bin) != 1) {
-        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Failed to convert IPv4 address \"%s\".", result);
-        goto error;
-    }
-
-    /* zero host bits */
-    mask = 0;
-    for (i = 0; i < 32; ++i) {
-        mask <<= 1;
-        if (pref > i) {
-            mask |= 1;
-        }
-    }
-    mask = htonl(mask);
-    addr_bin &= mask;
-
-    /* convert back to string */
-    if (!inet_ntop(AF_INET, (void *)&addr_bin, result, INET_ADDRSTRLEN)) {
-        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Failed to convert IPv4 address (%s).", strerror(errno));
-        goto error;
-    }
-
-    /* add the prefix */
-    strcat(result, pref_str);
-
-    *canonical = result;
-    return LY_SUCCESS;
-
-error:
-    free(result);
-    return ret;
-}
-
-/**
- * @brief Canonize an ipv6-prefix value.
- *
- * @param[in] ipv6_prefix Prefix to canonize.
- * @param[out] canonical Canonical format of @p ipv6_prefix.
- * @param[out] err Error structure on error.
- * @return LY_ERR value.
- */
-static LY_ERR
-canonize_ipv6_prefix(const char *ipv4_prefix, char **canonical, struct ly_err_item **err)
-{
-    LY_ERR ret;
-    const char *pref_str;
-    char *ptr, *result = NULL;
-    unsigned long int pref, i, j;
-
-    union {
-        struct in6_addr s;
-        uint32_t a[4];
-    } addr_bin;
-    uint32_t mask;
-
-    *canonical = NULL;
-    *err = NULL;
-
-    pref_str = strchr(ipv4_prefix, '/');
-    if (!pref_str) {
-        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid IPv6 prefix \"%s\".", ipv4_prefix);
-        goto error;
-    }
-
-    /* learn prefix */
-    pref = strtoul(pref_str + 1, &ptr, 10);
-    if (ptr[0] || (pref > 128)) {
-        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid IPv6 prefix \"%s\".", ipv4_prefix);
-        goto error;
-    }
-
-    result = malloc(INET6_ADDRSTRLEN + 4);
-    if (!result) {
-        ret = LY_EMEM;
-        goto error;
-    }
-
-    /* copy just the network prefix */
-    strncpy(result, ipv4_prefix, pref_str - ipv4_prefix);
-    result[pref_str - ipv4_prefix] = '\0';
-
-    /* convert it to binary form */
-    if (inet_pton(AF_INET6, result, (void *)&addr_bin.s) != 1) {
-        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Failed to convert IPv6 address \"%s\".", result);
-        goto error;
-    }
-
-    /* zero host bits */
-    for (i = 0; i < 4; ++i) {
-        mask = 0;
-        for (j = 0; j < 32; ++j) {
-            mask <<= 1;
-            if (pref > (i * 32) + j) {
-                mask |= 1;
-            }
-        }
-        mask = htonl(mask);
-        addr_bin.a[i] &= mask;
-    }
-
-    /* convert back to string */
-    if (!inet_ntop(AF_INET6, (void *)&addr_bin.s, result, INET6_ADDRSTRLEN)) {
-        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Failed to convert IPv6 address (%s).", strerror(errno));
-        goto error;
-    }
-
-    /* add the prefix */
-    strcat(result, pref_str);
-
-    *canonical = result;
-    return LY_SUCCESS;
-
-error:
-    free(result);
-    return ret;
-}
-
-/**
- * @brief Validate, canonize and store value of the ietf-inet-types ipv4-prefix type.
- * Implementation of the ::lyplg_type_store_clb.
- */
-static LY_ERR
-lyplg_type_store_ipv4_prefix(const struct ly_ctx *ctx, const struct lysc_type *type, const void *value, size_t value_len,
-        uint32_t options, LY_VALUE_FORMAT format, void *prefix_data, uint32_t hints, const struct lysc_node *ctx_node,
-        struct lyd_value *storage, struct lys_glob_unres *unres, struct ly_err_item **err)
-{
-    LY_ERR ret = LY_SUCCESS;
-    char *canonical;
-
-    /* store as a string */
-    ret = lyplg_type_store_string(ctx, type, value, value_len, options, format, prefix_data, hints, ctx_node,
-            storage, unres, err);
-    LY_CHECK_RET(ret);
-
-    /* canonize */
-    ret = canonize_ipv4_prefix(storage->_canonical, &canonical, err);
-    LY_CHECK_GOTO(ret, cleanup);
-
-    if (strcmp(canonical, storage->_canonical)) {
-        /* some conversion took place, update the value */
-        lydict_remove(ctx, storage->_canonical);
-        storage->_canonical = NULL;
-        LY_CHECK_GOTO(ret = lydict_insert_zc(ctx, canonical, &storage->_canonical), cleanup);
-    } else {
-        free(canonical);
-    }
-
-cleanup:
-    if (ret) {
-        type->plugin->free(ctx, storage);
-    }
-    return ret;
-}
-
-/**
- * @brief Validate, canonize and store value of the ietf-inet-types ipv6-prefix type.
- * Implementation of the ::lyplg_type_store_clb.
- */
-static LY_ERR
-lyplg_type_store_ipv6_prefix(const struct ly_ctx *ctx, const struct lysc_type *type, const void *value, size_t value_len,
-        uint32_t options, LY_VALUE_FORMAT format, void *prefix_data, uint32_t hints, const struct lysc_node *ctx_node,
-        struct lyd_value *storage, struct lys_glob_unres *unres, struct ly_err_item **err)
-{
-    LY_ERR ret = LY_SUCCESS;
-    char *canonical;
-
-    /* store as a string */
-    ret = lyplg_type_store_string(ctx, type, value, value_len, options, format, prefix_data, hints, ctx_node,
-            storage, unres, err);
-    LY_CHECK_RET(ret);
-
-    /* canonize */
-    ret = canonize_ipv6_prefix(storage->_canonical, &canonical, err);
-    LY_CHECK_GOTO(ret, cleanup);
-
-    if (strcmp(canonical, storage->_canonical)) {
-        /* some conversion took place, update the value */
-        lydict_remove(ctx, storage->_canonical);
-        storage->_canonical = NULL;
-        LY_CHECK_GOTO(ret = lydict_insert_zc(ctx, canonical, &storage->_canonical), cleanup);
-    } else {
-        free(canonical);
-    }
-
-cleanup:
-    if (ret) {
-        type->plugin->free(ctx, storage);
-    }
-    return ret;
-}
-
-/**
- * @brief Plugin information for ip-prefix type implementation.
- *
- * Note that external plugins are supposed to use:
- *
- *   LYPLG_TYPES = {
- */
-const struct lyplg_type_record plugins_ip_prefix[] = {
-    {
-        .module = "ietf-inet-types",
-        .revision = "2013-07-15",
-        .name = "ipv4-prefix",
-
-        .plugin.id = "libyang 2 - ipv4-prefix, version 1",
-        .plugin.store = lyplg_type_store_ipv4_prefix,
-        .plugin.validate = NULL,
-        .plugin.compare = lyplg_type_compare_simple,
-        .plugin.print = lyplg_type_print_simple,
-        .plugin.hash = lyplg_type_hash_simple,
-        .plugin.duplicate = lyplg_type_dup_simple,
-        .plugin.free = lyplg_type_free_simple
-    },
-    {
-        .module = "ietf-inet-types",
-        .revision = "2013-07-15",
-        .name = "ipv6-prefix",
-
-        .plugin.id = "libyang 2 - ipv6-prefix, version 1",
-        .plugin.store = lyplg_type_store_ipv6_prefix,
-        .plugin.validate = NULL,
-        .plugin.compare = lyplg_type_compare_simple,
-        .plugin.print = lyplg_type_print_simple,
-        .plugin.hash = lyplg_type_hash_simple,
-        .plugin.duplicate = lyplg_type_dup_simple,
-        .plugin.free = lyplg_type_free_simple
-    },
-    {0}
-};
diff --git a/src/plugins_types/ipv4_prefix.c b/src/plugins_types/ipv4_prefix.c
new file mode 100644
index 0000000..65ec68e
--- /dev/null
+++ b/src/plugins_types/ipv4_prefix.c
@@ -0,0 +1,358 @@
+/**
+ * @file ipv4_prefix.c
+ * @author Michal Vasko <mvasko@cesnet.cz>
+ * @brief ietf-inet-types ipv4-prefix type plugin.
+ *
+ * Copyright (c) 2019-2021 CESNET, z.s.p.o.
+ *
+ * This source code is licensed under BSD 3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://opensource.org/licenses/BSD-3-Clause
+ */
+
+#define _GNU_SOURCE /* asprintf, strdup */
+#include <sys/cdefs.h>
+
+#include "plugins_types.h"
+
+#include <arpa/inet.h>
+#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__)
+#include <netinet/in.h>
+#include <sys/socket.h>
+#endif
+#include <assert.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libyang.h"
+
+#include "common.h"
+#include "compat.h"
+
+/**
+ * @page howtoDataLYB LYB Binary Format
+ * @subsection howtoDataLYBTypesIPv4Prefix ipv4-prefix (ietf-inet-types)
+ *
+ * | Size (B) | Mandatory | Type | Meaning |
+ * | :------  | :-------: | :--: | :-----: |
+ * | 4 | yes | `struct in_addr *` | IPv4 address in network-byte order |
+ * | 1 | yes | `uint8_t *` | prefix length up to 32 |
+ */
+
+/**
+ * @brief Stored value structure for ipv4-prefix
+ */
+struct lyd_value_ipv4_prefix {
+    struct in_addr addr;
+    uint8_t prefix;
+};
+
+static void lyplg_type_free_ipv4_prefix(const struct ly_ctx *ctx, struct lyd_value *value);
+
+/**
+ * @brief Convert IP address with a prefix in string to a binary network-byte order value.
+ *
+ * @param[in] value String to convert.
+ * @param[in] value_len Length of @p value.
+ * @param[in,out] addr Allocated address value to fill.
+ * @param[out] prefix Prefix length.
+ * @param[out] err Error information on error.
+ * @return LY_ERR value.
+ */
+static LY_ERR
+ipv4prefix_str2ip(const char *value, size_t value_len, struct in_addr *addr, uint8_t *prefix, struct ly_err_item **err)
+{
+    LY_ERR ret = LY_SUCCESS;
+    const char *pref_str;
+    char *mask_str = NULL;
+
+    /* it passed the pattern validation */
+    pref_str = ly_strnchr(value, '/', value_len);
+    ly_strntou8(pref_str + 1, value_len - (pref_str + 1 - value), prefix);
+
+    /* get just the network prefix */
+    mask_str = strndup(value, pref_str - value);
+    LY_CHECK_ERR_GOTO(!mask_str, ret = LY_EMEM, cleanup);
+
+    /* convert it to netword-byte order */
+    if (inet_pton(AF_INET, mask_str, addr) != 1) {
+        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Failed to convert IPv4 address \"%s\".", mask_str);
+        goto cleanup;
+    }
+
+cleanup:
+    free(mask_str);
+    return ret;
+}
+
+/**
+ * @brief Zero host-portion of the IP address.
+ *
+ * @param[in,out] addr IP address.
+ * @param[in] prefix Prefix length.
+ */
+static void
+ipv4prefix_zero_host(struct in_addr *addr, uint8_t prefix)
+{
+    uint32_t i, mask;
+
+    /* zero host bits */
+    mask = 0;
+    for (i = 0; i < 32; ++i) {
+        mask <<= 1;
+        if (prefix > i) {
+            mask |= 1;
+        }
+    }
+    mask = htonl(mask);
+    addr->s_addr &= mask;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_store_clb for the ipv4-prefix ietf-inet-types type.
+ */
+static LY_ERR
+lyplg_type_store_ipv4_prefix(const struct ly_ctx *ctx, const struct lysc_type *type, const void *value, size_t value_len,
+        uint32_t options, LY_VALUE_FORMAT format, void *UNUSED(prefix_data), uint32_t hints,
+        const struct lysc_node *UNUSED(ctx_node), struct lyd_value *storage, struct lys_glob_unres *UNUSED(unres),
+        struct ly_err_item **err)
+{
+    LY_ERR ret = LY_SUCCESS;
+    struct lysc_type_str *type_str = (struct lysc_type_str *)type;
+    struct lyd_value_ipv4_prefix *val;
+
+    /* clear storage */
+    memset(storage, 0, sizeof *storage);
+
+    if (format == LY_VALUE_LYB) {
+        /* validation */
+        if (value_len != 5) {
+            ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv4-prefix value size %zu (expected 5).",
+                    value_len);
+            goto cleanup;
+        }
+        if (((uint8_t *)value)[4] > 32) {
+            ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv4-prefix prefix length %" PRIu8 ".",
+                    ((uint8_t *)value)[4]);
+            goto cleanup;
+        }
+
+        /* store/allocate value */
+        if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+            val = (void *)value;
+            options &= ~LYPLG_TYPE_STORE_DYNAMIC;
+        } else {
+            val = malloc(sizeof *val);
+            LY_CHECK_ERR_GOTO(!val, ret = LY_EMEM, cleanup);
+            memcpy(val, value, value_len);
+        }
+
+        /* init storage */
+        storage->_canonical = NULL;
+        storage->ptr = val;
+        storage->realtype = type;
+
+        /* zero host */
+        ipv4prefix_zero_host(&val->addr, val->prefix);
+
+        /* success */
+        goto cleanup;
+    }
+
+    /* check hints */
+    ret = lyplg_type_check_hints(hints, value, value_len, type->basetype, NULL, err);
+    LY_CHECK_GOTO(ret, cleanup);
+
+    /* length restriction of the string */
+    if (type_str->length) {
+        /* value_len is in bytes, but we need number of characters here */
+        ret = lyplg_type_validate_range(LY_TYPE_STRING, type_str->length, ly_utf8len(value, value_len), value, value_len, err);
+        LY_CHECK_GOTO(ret, cleanup);
+    }
+
+    /* pattern restrictions */
+    ret = lyplg_type_validate_patterns(type_str->patterns, value, value_len, err);
+    LY_CHECK_GOTO(ret, cleanup);
+
+    /* allocate the value */
+    val = malloc(sizeof *val);
+    LY_CHECK_ERR_GOTO(!val, ret = LY_EMEM, cleanup);
+
+    /* init storage */
+    storage->_canonical = NULL;
+    storage->ptr = val;
+    storage->realtype = type;
+
+    /* get the mask in network-byte order */
+    ret = ipv4prefix_str2ip(value, value_len, &val->addr, &val->prefix, err);
+    LY_CHECK_GOTO(ret, cleanup);
+
+    /* zero host */
+    ipv4prefix_zero_host(&val->addr, val->prefix);
+
+    if (format == LY_VALUE_CANON) {
+        /* store canonical value */
+        if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+            ret = lydict_insert_zc(ctx, (char *)value, &storage->_canonical);
+            options &= ~LYPLG_TYPE_STORE_DYNAMIC;
+            LY_CHECK_GOTO(ret, cleanup);
+        } else {
+            ret = lydict_insert(ctx, value_len ? value : "", value_len, &storage->_canonical);
+            LY_CHECK_GOTO(ret, cleanup);
+        }
+    }
+
+cleanup:
+    if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+        free((void *)value);
+    }
+
+    if (ret) {
+        lyplg_type_free_ipv4_prefix(ctx, storage);
+    }
+    return ret;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_compare_clb for the ietf-inet-types ipv4-prefix type.
+ */
+static LY_ERR
+lyplg_type_compare_ipv4_prefix(const struct lyd_value *val1, const struct lyd_value *val2)
+{
+    struct lyd_value_ipv4_prefix *v1 = val1->ptr, *v2 = val2->ptr;
+
+    if (val1->realtype != val2->realtype) {
+        return LY_ENOT;
+    }
+
+    if (memcmp(v1, v2, sizeof *v1)) {
+        return LY_ENOT;
+    }
+    return LY_SUCCESS;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_compare_clb for the ietf-inet-types ipv4-prefix type.
+ */
+static const void *
+lyplg_type_print_ipv4_prefix(const struct ly_ctx *ctx, const struct lyd_value *value, LY_VALUE_FORMAT format,
+        void *UNUSED(prefix_data), ly_bool *dynamic, size_t *value_len)
+{
+    struct lyd_value_ipv4_prefix *val = value->ptr;
+    char *ret;
+
+    if (format == LY_VALUE_LYB) {
+        *dynamic = 0;
+        if (value_len) {
+            *value_len = sizeof *val;
+        }
+        return val;
+    }
+
+    /* generate canonical value if not already */
+    if (!value->_canonical) {
+        /* IPv4 mask + '/' + prefix */
+        ret = malloc(INET_ADDRSTRLEN + 3);
+        LY_CHECK_RET(!ret, NULL);
+
+        /* convert back to string */
+        if (!inet_ntop(AF_INET, &val->addr, ret, INET_ADDRSTRLEN)) {
+            free(ret);
+            return NULL;
+        }
+
+        /* add the prefix */
+        sprintf(ret + strlen(ret), "/%" PRIu8, val->prefix);
+
+        /* store it */
+        if (lydict_insert_zc(ctx, ret, (const char **)&value->_canonical)) {
+            LOGMEM(ctx);
+            return NULL;
+        }
+    }
+
+    /* use the cached canonical value */
+    if (dynamic) {
+        *dynamic = 0;
+    }
+    if (value_len) {
+        *value_len = strlen(value->_canonical);
+    }
+    return value->_canonical;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_hash_clb for the ietf-inet-types ipv4-prefix type.
+ */
+static const void *
+lyplg_type_hash_ipv4_prefix(const struct lyd_value *value, ly_bool *dynamic, size_t *key_len)
+{
+    struct lyd_value_ipv4_prefix *val = value->ptr;
+
+    *dynamic = 0;
+    *key_len = sizeof *val;
+    return val;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_dup_clb for the ietf-inet-types ipv4-prefix type.
+ */
+static LY_ERR
+lyplg_type_dup_ipv4_prefix(const struct ly_ctx *ctx, const struct lyd_value *original, struct lyd_value *dup)
+{
+    LY_ERR ret;
+    struct lyd_value_ipv4_prefix *orig_val = original->ptr, *dup_val;
+
+    ret = lydict_insert(ctx, original->_canonical, ly_strlen(original->_canonical), &dup->_canonical);
+    LY_CHECK_RET(ret);
+
+    dup_val = malloc(sizeof *dup_val);
+    if (!dup_val) {
+        lydict_remove(ctx, dup->_canonical);
+        return LY_EMEM;
+    }
+    memcpy(dup_val, orig_val, sizeof *orig_val);
+
+    dup->ptr = dup_val;
+    dup->realtype = original->realtype;
+    return LY_SUCCESS;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_free_clb for the ietf-inet-types ipv4-prefix type.
+ */
+static void
+lyplg_type_free_ipv4_prefix(const struct ly_ctx *ctx, struct lyd_value *value)
+{
+    lydict_remove(ctx, value->_canonical);
+    free(value->ptr);
+}
+
+/**
+ * @brief Plugin information for ipv4-prefix type implementation.
+ *
+ * Note that external plugins are supposed to use:
+ *
+ *   LYPLG_TYPES = {
+ */
+const struct lyplg_type_record plugins_ipv4_prefix[] = {
+    {
+        .module = "ietf-inet-types",
+        .revision = "2013-07-15",
+        .name = "ipv4-prefix",
+
+        .plugin.id = "libyang 2 - ipv4-prefix, version 1",
+        .plugin.store = lyplg_type_store_ipv4_prefix,
+        .plugin.validate = NULL,
+        .plugin.compare = lyplg_type_compare_ipv4_prefix,
+        .plugin.print = lyplg_type_print_ipv4_prefix,
+        .plugin.hash = lyplg_type_hash_ipv4_prefix,
+        .plugin.duplicate = lyplg_type_dup_ipv4_prefix,
+        .plugin.free = lyplg_type_free_ipv4_prefix
+    },
+    {0}
+};
diff --git a/src/plugins_types/ipv6_prefix.c b/src/plugins_types/ipv6_prefix.c
new file mode 100644
index 0000000..7484061
--- /dev/null
+++ b/src/plugins_types/ipv6_prefix.c
@@ -0,0 +1,360 @@
+/**
+ * @file ipv6_prefix.c
+ * @author Michal Vasko <mvasko@cesnet.cz>
+ * @brief ietf-inet-types ipv6-prefix type plugin.
+ *
+ * Copyright (c) 2019-2021 CESNET, z.s.p.o.
+ *
+ * This source code is licensed under BSD 3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://opensource.org/licenses/BSD-3-Clause
+ */
+
+#define _GNU_SOURCE /* asprintf, strdup */
+#include <sys/cdefs.h>
+
+#include "plugins_types.h"
+
+#include <arpa/inet.h>
+#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__)
+#include <netinet/in.h>
+#include <sys/socket.h>
+#endif
+#include <assert.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libyang.h"
+
+#include "common.h"
+#include "compat.h"
+
+/**
+ * @page howtoDataLYB LYB Binary Format
+ * @subsection howtoDataLYBTypesIPv6Prefix ipv6-prefix (ietf-inet-types)
+ *
+ * | Size (B) | Mandatory | Type | Meaning |
+ * | :------  | :-------: | :--: | :-----: |
+ * | 16 | yes | `struct in6_addr *` | IPv6 address in network-byte order |
+ * | 1 | yes | `uint8_t *` | prefix length up to 128 |
+ */
+
+/**
+ * @brief Stored value structure for ipv6-prefix
+ */
+struct lyd_value_ipv6_prefix {
+    struct in6_addr addr;
+    uint8_t prefix;
+};
+
+static void lyplg_type_free_ipv6_prefix(const struct ly_ctx *ctx, struct lyd_value *value);
+
+/**
+ * @brief Convert IP address with a prefix in string to a binary network-byte order value.
+ *
+ * @param[in] value String to convert.
+ * @param[in] value_len Length of @p value.
+ * @param[in,out] addr Allocated address value to fill.
+ * @param[out] prefix Prefix length.
+ * @param[out] err Error information on error.
+ * @return LY_ERR value.
+ */
+static LY_ERR
+ipv6prefix_str2ip(const char *value, size_t value_len, struct in6_addr *addr, uint8_t *prefix, struct ly_err_item **err)
+{
+    LY_ERR ret = LY_SUCCESS;
+    const char *pref_str;
+    char *mask_str = NULL;
+
+    /* it passed the pattern validation */
+    pref_str = ly_strnchr(value, '/', value_len);
+    ly_strntou8(pref_str + 1, value_len - (pref_str + 1 - value), prefix);
+
+    /* get just the network prefix */
+    mask_str = strndup(value, pref_str - value);
+    LY_CHECK_ERR_GOTO(!mask_str, ret = LY_EMEM, cleanup);
+
+    /* convert it to netword-byte order */
+    if (inet_pton(AF_INET6, mask_str, addr) != 1) {
+        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Failed to convert IPv6 address \"%s\".", mask_str);
+        goto cleanup;
+    }
+
+cleanup:
+    free(mask_str);
+    return ret;
+}
+
+/**
+ * @brief Zero host-portion of the IP address.
+ *
+ * @param[in,out] addr IP address.
+ * @param[in] prefix Prefix length.
+ */
+static void
+ipv6prefix_zero_host(struct in6_addr *addr, uint8_t prefix)
+{
+    uint32_t i, j, mask;
+
+    /* zero host bits */
+    for (i = 0; i < 4; ++i) {
+        mask = 0;
+        for (j = 0; j < 32; ++j) {
+            mask <<= 1;
+            if (prefix > (i * 32) + j) {
+                mask |= 1;
+            }
+        }
+        mask = htonl(mask);
+        ((uint32_t *)addr->s6_addr)[i] &= mask;
+    }
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_store_clb for the ipv6-prefix ietf-inet-types type.
+ */
+static LY_ERR
+lyplg_type_store_ipv6_prefix(const struct ly_ctx *ctx, const struct lysc_type *type, const void *value, size_t value_len,
+        uint32_t options, LY_VALUE_FORMAT format, void *UNUSED(prefix_data), uint32_t hints,
+        const struct lysc_node *UNUSED(ctx_node), struct lyd_value *storage, struct lys_glob_unres *UNUSED(unres),
+        struct ly_err_item **err)
+{
+    LY_ERR ret = LY_SUCCESS;
+    struct lysc_type_str *type_str = (struct lysc_type_str *)type;
+    struct lyd_value_ipv6_prefix *val;
+
+    /* clear storage */
+    memset(storage, 0, sizeof *storage);
+
+    if (format == LY_VALUE_LYB) {
+        /* validation */
+        if (value_len != 17) {
+            ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv6-prefix value size %zu (expected 17).",
+                    value_len);
+            goto cleanup;
+        }
+        if (((uint8_t *)value)[16] > 128) {
+            ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv6-prefix prefix length %" PRIu8 ".",
+                    ((uint8_t *)value)[16]);
+            goto cleanup;
+        }
+
+        /* store/allocate value */
+        if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+            val = (void *)value;
+            options &= ~LYPLG_TYPE_STORE_DYNAMIC;
+        } else {
+            val = malloc(sizeof *val);
+            LY_CHECK_ERR_GOTO(!val, ret = LY_EMEM, cleanup);
+            memcpy(val, value, value_len);
+        }
+
+        /* init storage */
+        storage->_canonical = NULL;
+        storage->ptr = val;
+        storage->realtype = type;
+
+        /* zero host */
+        ipv6prefix_zero_host(&val->addr, val->prefix);
+
+        /* success */
+        goto cleanup;
+    }
+
+    /* check hints */
+    ret = lyplg_type_check_hints(hints, value, value_len, type->basetype, NULL, err);
+    LY_CHECK_GOTO(ret, cleanup);
+
+    /* length restriction of the string */
+    if (type_str->length) {
+        /* value_len is in bytes, but we need number of characters here */
+        ret = lyplg_type_validate_range(LY_TYPE_STRING, type_str->length, ly_utf8len(value, value_len), value, value_len, err);
+        LY_CHECK_GOTO(ret, cleanup);
+    }
+
+    /* pattern restrictions */
+    ret = lyplg_type_validate_patterns(type_str->patterns, value, value_len, err);
+    LY_CHECK_GOTO(ret, cleanup);
+
+    /* allocate the value */
+    val = malloc(sizeof *val);
+    LY_CHECK_ERR_GOTO(!val, ret = LY_EMEM, cleanup);
+
+    /* init storage */
+    storage->_canonical = NULL;
+    storage->ptr = val;
+    storage->realtype = type;
+
+    /* get the mask in network-byte order */
+    ret = ipv6prefix_str2ip(value, value_len, &val->addr, &val->prefix, err);
+    LY_CHECK_GOTO(ret, cleanup);
+
+    /* zero host */
+    ipv6prefix_zero_host(&val->addr, val->prefix);
+
+    if (format == LY_VALUE_CANON) {
+        /* store canonical value */
+        if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+            ret = lydict_insert_zc(ctx, (char *)value, &storage->_canonical);
+            options &= ~LYPLG_TYPE_STORE_DYNAMIC;
+            LY_CHECK_GOTO(ret, cleanup);
+        } else {
+            ret = lydict_insert(ctx, value_len ? value : "", value_len, &storage->_canonical);
+            LY_CHECK_GOTO(ret, cleanup);
+        }
+    }
+
+cleanup:
+    if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+        free((void *)value);
+    }
+
+    if (ret) {
+        lyplg_type_free_ipv6_prefix(ctx, storage);
+    }
+    return ret;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_compare_clb for the ietf-inet-types ipv6-prefix type.
+ */
+static LY_ERR
+lyplg_type_compare_ipv6_prefix(const struct lyd_value *val1, const struct lyd_value *val2)
+{
+    struct lyd_value_ipv6_prefix *v1 = val1->ptr, *v2 = val2->ptr;
+
+    if (val1->realtype != val2->realtype) {
+        return LY_ENOT;
+    }
+
+    if (memcmp(v1, v2, sizeof *v1)) {
+        return LY_ENOT;
+    }
+    return LY_SUCCESS;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_compare_clb for the ietf-inet-types ipv6-prefix type.
+ */
+static const void *
+lyplg_type_print_ipv6_prefix(const struct ly_ctx *ctx, const struct lyd_value *value, LY_VALUE_FORMAT format,
+        void *UNUSED(prefix_data), ly_bool *dynamic, size_t *value_len)
+{
+    struct lyd_value_ipv6_prefix *val = value->ptr;
+    char *ret;
+
+    if (format == LY_VALUE_LYB) {
+        *dynamic = 0;
+        if (value_len) {
+            *value_len = sizeof *val;
+        }
+        return val;
+    }
+
+    /* generate canonical value if not already */
+    if (!value->_canonical) {
+        /* IPv6 mask + '/' + prefix */
+        ret = malloc(INET6_ADDRSTRLEN + 4);
+        LY_CHECK_RET(!ret, NULL);
+
+        /* convert back to string */
+        if (!inet_ntop(AF_INET6, &val->addr, ret, INET6_ADDRSTRLEN)) {
+            free(ret);
+            return NULL;
+        }
+
+        /* add the prefix */
+        sprintf(ret + strlen(ret), "/%" PRIu8, val->prefix);
+
+        /* store it */
+        if (lydict_insert_zc(ctx, ret, (const char **)&value->_canonical)) {
+            LOGMEM(ctx);
+            return NULL;
+        }
+    }
+
+    /* use the cached canonical value */
+    if (dynamic) {
+        *dynamic = 0;
+    }
+    if (value_len) {
+        *value_len = strlen(value->_canonical);
+    }
+    return value->_canonical;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_hash_clb for the ietf-inet-types ipv6-prefix type.
+ */
+static const void *
+lyplg_type_hash_ipv6_prefix(const struct lyd_value *value, ly_bool *dynamic, size_t *key_len)
+{
+    struct lyd_value_ipv6_prefix *val = value->ptr;
+
+    *dynamic = 0;
+    *key_len = sizeof *val;
+    return val;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_dup_clb for the ietf-inet-types ipv6-prefix type.
+ */
+static LY_ERR
+lyplg_type_dup_ipv6_prefix(const struct ly_ctx *ctx, const struct lyd_value *original, struct lyd_value *dup)
+{
+    LY_ERR ret;
+    struct lyd_value_ipv6_prefix *orig_val = original->ptr, *dup_val;
+
+    ret = lydict_insert(ctx, original->_canonical, ly_strlen(original->_canonical), &dup->_canonical);
+    LY_CHECK_RET(ret);
+
+    dup_val = malloc(sizeof *dup_val);
+    if (!dup_val) {
+        lydict_remove(ctx, dup->_canonical);
+        return LY_EMEM;
+    }
+    memcpy(dup_val, orig_val, sizeof *orig_val);
+
+    dup->ptr = dup_val;
+    dup->realtype = original->realtype;
+    return LY_SUCCESS;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_free_clb for the ietf-inet-types ipv6-prefix type.
+ */
+static void
+lyplg_type_free_ipv6_prefix(const struct ly_ctx *ctx, struct lyd_value *value)
+{
+    lydict_remove(ctx, value->_canonical);
+    free(value->ptr);
+}
+
+/**
+ * @brief Plugin information for ipv6-prefix type implementation.
+ *
+ * Note that external plugins are supposed to use:
+ *
+ *   LYPLG_TYPES = {
+ */
+const struct lyplg_type_record plugins_ipv6_prefix[] = {
+    {
+        .module = "ietf-inet-types",
+        .revision = "2013-07-15",
+        .name = "ipv6-prefix",
+
+        .plugin.id = "libyang 2 - ipv6-prefix, version 1",
+        .plugin.store = lyplg_type_store_ipv6_prefix,
+        .plugin.validate = NULL,
+        .plugin.compare = lyplg_type_compare_ipv6_prefix,
+        .plugin.print = lyplg_type_print_ipv6_prefix,
+        .plugin.hash = lyplg_type_hash_ipv6_prefix,
+        .plugin.duplicate = lyplg_type_dup_ipv6_prefix,
+        .plugin.free = lyplg_type_free_ipv6_prefix
+    },
+    {0}
+};
