diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java
index 6a41ad3..261b863 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java
@@ -15,23 +15,50 @@
  */
 package org.onosproject.lisp.msg.protocols;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
+import org.onlab.util.ImmutableByteSequence;
 
 import java.util.List;
 
 /**
  * Default LISP map notify message class.
  */
-public class DefaultLispMapNotify implements LispMapNotify {
+public final class DefaultLispMapNotify implements LispMapNotify {
+
+    private final long nonce;
+    private final short keyId;
+    private final byte[] authenticationData;
+    private final byte recordCount;
+    private final List<LispMapRecord> mapRecords;
+
+    /**
+     * A private constructor that protects object instantiation from external.
+     *
+     * @param nonce              nonce
+     * @param keyId              key identifier
+     * @param authenticationData authentication data
+     * @param recordCount        record count number
+     * @param mapRecords         a collection of map records
+     */
+    private DefaultLispMapNotify(long nonce, short keyId, byte[] authenticationData,
+                                 byte recordCount, List<LispMapRecord> mapRecords) {
+        this.nonce = nonce;
+        this.keyId = keyId;
+        this.authenticationData = authenticationData;
+        this.recordCount = recordCount;
+        this.mapRecords = mapRecords;
+    }
 
     @Override
     public LispType getType() {
-        return null;
+        return LispType.LISP_MAP_NOTIFY;
     }
 
     @Override
     public void writeTo(ByteBuf byteBuf) {
-
+        // TODO: serialize LispMapRegister message
     }
 
     @Override
@@ -41,64 +68,76 @@
 
     @Override
     public long getNonce() {
-        return 0;
+        return this.nonce;
     }
 
     @Override
     public byte getRecordCount() {
-        return 0;
+        return this.recordCount;
     }
 
     @Override
     public short getKeyId() {
-        return 0;
+        return this.keyId;
     }
 
     @Override
     public byte[] getAuthenticationData() {
-        return new byte[0];
+        return ImmutableByteSequence.copyFrom(this.authenticationData).asArray();
     }
 
     @Override
     public List<LispMapRecord> getLispRecords() {
-        return null;
+        return ImmutableList.copyOf(mapRecords);
     }
 
     public static final class DefaultNotifyBuilder implements NotifyBuilder {
 
-        @Override
-        public LispMessage build() {
-            return null;
-        }
+        private long nonce;
+        private short keyId;
+        private byte[] authenticationData;
+        private byte recordCount;
+        private List<LispMapRecord> mapRecords = Lists.newArrayList();
 
         @Override
         public LispType getType() {
-            return null;
+            return LispType.LISP_MAP_NOTIFY;
         }
 
         @Override
         public NotifyBuilder withNonce(long nonce) {
-            return null;
+            this.nonce = nonce;
+            return this;
         }
 
         @Override
         public NotifyBuilder withRecordCount(byte recordCount) {
-            return null;
+            this.recordCount = recordCount;
+            return this;
         }
 
         @Override
         public NotifyBuilder withKeyId(short keyId) {
-            return null;
+            this.keyId = keyId;
+            return this;
         }
 
         @Override
         public NotifyBuilder withAuthenticationData(byte[] authenticationData) {
-            return null;
+            this.authenticationData = authenticationData;
+            return this;
         }
 
         @Override
         public NotifyBuilder addRecord(LispMapRecord record) {
-            return null;
+            this.mapRecords.add(record);
+            return this;
+        }
+
+        @Override
+        public LispMessage build() {
+            return new DefaultLispMapNotify(nonce, keyId, authenticationData,
+                    recordCount, mapRecords);
         }
     }
 }
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java
index 1b2987e..f041d2b 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java
@@ -15,22 +15,58 @@
  */
 package org.onosproject.lisp.msg.protocols;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
+import org.onlab.util.ImmutableByteSequence;
 
 import java.util.List;
 
 /**
  * Default LISP map register message class.
  */
-public class DefaultLispMapRegister implements LispMapRegister {
+public final class DefaultLispMapRegister implements LispMapRegister {
+
+    private final long nonce;
+    private final short keyId;
+    private final byte[] authenticationData;
+    private final byte recordCount;
+    private final List<LispMapRecord> mapRecords;
+    private final boolean proxyMapReply;
+    private final boolean wantMapNotify;
+
+    /**
+     * A private constructor that protects object instantiation from external.
+     *
+     * @param nonce              nonce
+     * @param keyId              key identifier
+     * @param authenticationData authentication data
+     * @param recordCount        record count number
+     * @param mapRecords         a collection of map records
+     * @param proxyMapReply      proxy map reply flag
+     * @param wantMapNotify      want map notify flag
+     */
+    private DefaultLispMapRegister(long nonce, short keyId,
+                                   byte[] authenticationData, byte recordCount,
+                                   List<LispMapRecord> mapRecords,
+                                   boolean proxyMapReply, boolean wantMapNotify) {
+        this.nonce = nonce;
+        this.keyId = keyId;
+        this.authenticationData = authenticationData;
+        this.recordCount = recordCount;
+        this.mapRecords = mapRecords;
+        this.proxyMapReply = proxyMapReply;
+        this.wantMapNotify = wantMapNotify;
+    }
+
     @Override
     public LispType getType() {
-        return null;
+        return LispType.LISP_MAP_REGISTER;
     }
 
     @Override
     public void writeTo(ByteBuf byteBuf) {
-
+        // TODO: serialize LispMapRegister message
     }
 
     @Override
@@ -40,84 +76,100 @@
 
     @Override
     public boolean isProxyMapReply() {
-        return false;
+        return proxyMapReply;
     }
 
     @Override
     public boolean isWantMapNotify() {
-        return false;
+        return wantMapNotify;
     }
 
     @Override
     public byte getRecordCount() {
-        return 0;
+        return recordCount;
     }
 
     @Override
     public long getNonce() {
-        return 0;
+        return nonce;
     }
 
     @Override
     public short getKeyId() {
-        return 0;
+        return keyId;
     }
 
     @Override
     public byte[] getAuthenticationData() {
-        return new byte[0];
+        return ImmutableByteSequence.copyFrom(this.authenticationData).asArray();
     }
 
     @Override
     public List<LispMapRecord> getLispRecords() {
-        return null;
+        return ImmutableList.copyOf(mapRecords);
     }
 
     public static final class DefaultRegisterBuilder implements RegisterBuilder {
 
-        @Override
-        public LispMessage build() {
-            return null;
-        }
+        private long nonce;
+        private short keyId;
+        private byte[] authenticationData;
+        private byte recordCount;
+        private final List<LispMapRecord> mapRecords = Lists.newArrayList();
+        private boolean proxyMapReply;
+        private boolean wantMapNotify;
 
         @Override
         public LispType getType() {
-            return null;
+            return LispType.LISP_MAP_REGISTER;
         }
 
         @Override
-        public RegisterBuilder withIsProxyMapReply(boolean isProxyMapReply) {
-            return null;
+        public RegisterBuilder withIsProxyMapReply(boolean proxyMapReply) {
+            this.proxyMapReply = proxyMapReply;
+            return this;
         }
 
         @Override
-        public RegisterBuilder withIsWantMapNotify(boolean isWantMapNotify) {
-            return null;
+        public RegisterBuilder withIsWantMapNotify(boolean wantMapNotify) {
+            this.wantMapNotify = wantMapNotify;
+            return this;
         }
 
         @Override
         public RegisterBuilder withRecordCount(byte recordCount) {
-            return null;
+            this.recordCount = recordCount;
+            return this;
         }
 
         @Override
         public RegisterBuilder withNonce(long nonce) {
-            return null;
+            this.nonce = nonce;
+            return this;
         }
 
         @Override
         public RegisterBuilder withKeyId(short keyId) {
-            return null;
+            this.keyId = keyId;
+            return this;
         }
 
         @Override
         public RegisterBuilder withAuthenticationData(byte[] authenticationData) {
-            return null;
+            this.authenticationData = authenticationData;
+            return this;
         }
 
         @Override
         public RegisterBuilder addRecord(LispMapRecord record) {
-            return null;
+            this.mapRecords.add(record);
+            return this;
+        }
+
+        @Override
+        public LispMessage build() {
+            return new DefaultLispMapRegister(nonce, keyId, authenticationData,
+                    recordCount, mapRecords, proxyMapReply, wantMapNotify);
         }
     }
 }
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java
index 7f89dc0..94322e1 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java
@@ -20,15 +20,40 @@
 /**
  * Default LISP map reply message class.
  */
-public class DefaultLispMapReply implements LispMapReply {
+public final class DefaultLispMapReply implements LispMapReply {
+
+    private final long nonce;
+    private final byte recordCount;
+    private final boolean probe;
+    private final boolean etr;
+    private final boolean security;
+
+    /**
+     * A private constructor that protects object instantiation from external.
+     *
+     * @param nonce       nonce
+     * @param recordCount record count number
+     * @param probe       probe flag
+     * @param etr         etr flag
+     * @param security    security flag
+     */
+    private DefaultLispMapReply(long nonce, byte recordCount, boolean probe,
+                                boolean etr, boolean security) {
+        this.nonce = nonce;
+        this.recordCount = recordCount;
+        this.probe = probe;
+        this.etr = etr;
+        this.security = security;
+    }
+
     @Override
     public LispType getType() {
-        return null;
+        return LispType.LISP_MAP_REPLY;
     }
 
     @Override
     public void writeTo(ByteBuf byteBuf) {
-
+        // TODO: serialize LispMapReply message
     }
 
     @Override
@@ -38,64 +63,75 @@
 
     @Override
     public boolean isProbe() {
-        return false;
+        return this.probe;
     }
 
     @Override
     public boolean isEtr() {
-        return false;
+        return this.etr;
     }
 
     @Override
     public boolean isSecurity() {
-        return false;
+        return this.security;
     }
 
     @Override
     public byte getRecordCount() {
-        return 0;
+        return this.recordCount;
     }
 
     @Override
     public long getNonce() {
-        return 0;
+        return this.nonce;
     }
 
     public static final class DefaultReplyBuilder implements ReplyBuilder {
 
-        @Override
-        public LispMessage build() {
-            return null;
-        }
+        private long nonce;
+        private byte recordCount;
+        private boolean probe;
+        private boolean etr;
+        private boolean security;
 
         @Override
         public LispType getType() {
-            return null;
+            return LispType.LISP_MAP_REPLY;
         }
 
         @Override
-        public ReplyBuilder withIsProbe(boolean isProbe) {
-            return null;
+        public ReplyBuilder withIsProbe(boolean probe) {
+            this.probe = probe;
+            return this;
         }
 
         @Override
-        public ReplyBuilder withIsEtr(boolean isEtr) {
-            return null;
+        public ReplyBuilder withIsEtr(boolean etr) {
+            this.etr = etr;
+            return this;
         }
 
         @Override
-        public ReplyBuilder withIsSecurity(boolean isSecurity) {
-            return null;
+        public ReplyBuilder withIsSecurity(boolean security) {
+            this.security = security;
+            return this;
         }
 
         @Override
         public ReplyBuilder withRecordCount(byte recordCount) {
-            return null;
+            this.recordCount = recordCount;
+            return this;
         }
 
         @Override
         public ReplyBuilder withNonce(long nonce) {
-            return null;
+            this.nonce = nonce;
+            return this;
+        }
+
+        @Override
+        public LispMessage build() {
+            return new DefaultLispMapReply(nonce, recordCount, probe, etr, security);
         }
     }
 }
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java
index ab109d1..313f926 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java
@@ -15,6 +15,8 @@
  */
 package org.onosproject.lisp.msg.protocols;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
 import org.onosproject.lisp.msg.types.LispAfiAddress;
 
@@ -23,15 +25,60 @@
 /**
  * Default LISP map request message class.
  */
-public class DefaultLispMapRequest implements LispMapRequest {
+public final class DefaultLispMapRequest implements LispMapRequest {
+
+    private final long nonce;
+    private final byte recordCount;
+    private final LispAfiAddress sourceEid;
+    private final List<LispAfiAddress> itrRlocs;
+    private final List<LispEidRecord> eidRecords;
+    private final boolean authoritative;
+    private final boolean mapDataPresent;
+    private final boolean probe;
+    private final boolean smr;
+    private final boolean pitr;
+    private final boolean smrInvoked;
+
+    /**
+     * A private constructor that protects object instantiation from external.
+     *
+     * @param nonce          nonce
+     * @param recordCount    record count number
+     * @param sourceEid      source EID address
+     * @param itrRlocs       a collection of ITR RLOCs
+     * @param eidRecords     a collection of EID records
+     * @param authoritative  authoritative flag
+     * @param mapDataPresent map data present flag
+     * @param probe          probe flag
+     * @param smr            smr flag
+     * @param pitr           pitr flag
+     * @param smrInvoked     smrInvoked flag
+     */
+    private DefaultLispMapRequest(long nonce, byte recordCount, LispAfiAddress sourceEid,
+                                  List<LispAfiAddress> itrRlocs, List<LispEidRecord> eidRecords,
+                                  boolean authoritative, boolean mapDataPresent, boolean probe,
+                                  boolean smr, boolean pitr, boolean smrInvoked) {
+        this.nonce = nonce;
+        this.recordCount = recordCount;
+        this.sourceEid = sourceEid;
+        this.itrRlocs = itrRlocs;
+        this.eidRecords = eidRecords;
+        this.authoritative = authoritative;
+        this.mapDataPresent = mapDataPresent;
+        this.probe = probe;
+        this.smr = smr;
+        this.pitr = pitr;
+        this.smrInvoked = smrInvoked;
+    }
+
     @Override
     public LispType getType() {
-        return null;
+        return LispType.LISP_MAP_REQUEST;
     }
 
     @Override
     public void writeTo(ByteBuf byteBuf) {
-
+        // TODO: serialize LispMapRequest message
     }
 
     @Override
@@ -41,109 +88,149 @@
 
     @Override
     public boolean isAuthoritative() {
-        return false;
+        return this.authoritative;
+    }
+
+    @Override
+    public boolean isMapDataPresent() {
+        return this.mapDataPresent;
     }
 
     @Override
     public boolean isProbe() {
-        return false;
+        return this.probe;
     }
 
     @Override
     public boolean isSmr() {
-        return false;
+        return this.smr;
     }
 
     @Override
     public boolean isPitr() {
-        return false;
+        return this.pitr;
     }
 
     @Override
     public boolean isSmrInvoked() {
-        return false;
+        return this.smrInvoked;
     }
 
     @Override
     public byte getRecordCount() {
-        return 0;
+        return this.recordCount;
     }
 
     @Override
     public long getNonce() {
-        return 0;
+        return this.nonce;
     }
 
     @Override
     public LispAfiAddress getSourceEid() {
-        return null;
+        return this.sourceEid;
     }
 
     @Override
     public List<LispAfiAddress> getItrRlocs() {
-        return null;
+        return ImmutableList.copyOf(itrRlocs);
     }
 
     @Override
     public List<LispEidRecord> getEids() {
-        return null;
+        return ImmutableList.copyOf(eidRecords);
     }
 
     public static final class DefaultRequestBuilder implements RequestBuilder {
 
-        @Override
-        public LispMessage build() {
-            return null;
-        }
+        private long nonce;
+        private byte recordCount;
+        private LispAfiAddress sourceEid;
+        private List<LispAfiAddress> itrRlocs = Lists.newArrayList();
+        private List<LispEidRecord> eidRecords = Lists.newArrayList();
+        private boolean authoritative;
+        private boolean mapDataPresent;
+        private boolean probe;
+        private boolean smr;
+        private boolean pitr;
+        private boolean smrInvoked;
 
         @Override
         public LispType getType() {
-            return null;
+            return LispType.LISP_MAP_REQUEST;
         }
 
         @Override
-        public RequestBuilder withIsAuthoritative(boolean isAuthoritative) {
-            return null;
+        public RequestBuilder withIsAuthoritative(boolean authoritative) {
+            this.authoritative = authoritative;
+            return this;
         }
 
         @Override
-        public RequestBuilder withIsProbe(boolean isProbe) {
-            return null;
+        public RequestBuilder withIsProbe(boolean probe) {
+            this.probe = probe;
+            return this;
         }
 
         @Override
-        public RequestBuilder withIsSmr(boolean isSmr) {
-            return null;
+        public RequestBuilder withIsMapDataPresent(boolean mapDataPresent) {
+            this.mapDataPresent = mapDataPresent;
+            return this;
+        }
+
+
+        @Override
+        public RequestBuilder withIsSmr(boolean smr) {
+            this.smr = smr;
+            return this;
         }
 
         @Override
-        public RequestBuilder withIsPitr(boolean isPitr) {
-            return null;
+        public RequestBuilder withIsPitr(boolean pitr) {
+            this.pitr = pitr;
+            return this;
         }
 
         @Override
-        public RequestBuilder withIsSmrInvoked(boolean isSmrInvoked) {
-            return null;
+        public RequestBuilder withIsSmrInvoked(boolean smrInvoked) {
+            this.smrInvoked = smrInvoked;
+            return this;
         }
 
         @Override
         public RequestBuilder withRecordCount(byte recordCount) {
-            return null;
+            this.recordCount = recordCount;
+            return this;
         }
 
         @Override
         public RequestBuilder withNonce(long nonce) {
-            return null;
+            this.nonce = nonce;
+            return this;
         }
 
         @Override
-        public RequestBuilder withItrRloc(LispAfiAddress itrRloc) {
-            return null;
+        public RequestBuilder withSourceEid(LispAfiAddress sourceEid) {
+            this.sourceEid = sourceEid;
+            return this;
+        }
+
+        @Override
+        public RequestBuilder addItrRloc(LispAfiAddress itrRloc) {
+            this.itrRlocs.add(itrRloc);
+            return this;
         }
 
         @Override
         public RequestBuilder addEidRecord(LispEidRecord record) {
-            return null;
+            this.eidRecords.add(record);
+            return this;
+        }
+
+        @Override
+        public LispMessage build() {
+            return new DefaultLispMapRequest(nonce, recordCount, sourceEid, itrRlocs,
+                    eidRecords, authoritative, mapDataPresent, probe, smr, pitr, smrInvoked);
         }
     }
 }
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java
index 13a5b5e..a128814 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java
@@ -91,28 +91,28 @@
     interface ReplyBuilder extends Builder {
 
         /**
-         * Sets isProbe flag.
+         * Sets probe flag.
          *
-         * @param isProbe isProbe flag
+         * @param probe probe flag
          * @return ReplyBuilder object
          */
-        ReplyBuilder withIsProbe(boolean isProbe);
+        ReplyBuilder withIsProbe(boolean probe);
 
         /**
-         * Sets isEtr flag.
+         * Sets etr flag.
          *
-         * @param isEtr isEtr flag
+         * @param etr etr flag
          * @return ReplyBuilder object
          */
-        ReplyBuilder withIsEtr(boolean isEtr);
+        ReplyBuilder withIsEtr(boolean etr);
 
         /**
-         * Sets isSecurity flag.
+         * Sets security flag.
          *
-         * @param isSecurity isSecurity flag
+         * @param security security flag
          * @return ReplyBuilder object
          */
-        ReplyBuilder withIsSecurity(boolean isSecurity);
+        ReplyBuilder withIsSecurity(boolean security);
 
         /**
          * Sets record count.
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java
index f0a49e8..0783368 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java
@@ -21,12 +21,13 @@
 
 /**
  * LISP map request message interface.
- *
+ * <p>
  * LISP map request message format is defined in RFC6830.
  * https://tools.ietf.org/html/rfc6830#page-27
  *
  * <pre>
  * {@literal
+ * <p>
  * 0                   1                   2                   3
  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -62,6 +63,13 @@
     boolean isAuthoritative();
 
     /**
+     * Obtains map data present flag.
+     *
+     * @return map data present flag
+     */
+    boolean isMapDataPresent();
+
+    /**
      * Obtains probe flag.
      *
      * @return probe flag
@@ -130,44 +138,52 @@
     interface RequestBuilder extends Builder {
 
         /**
-         * Sets isAuthoritative flag.
+         * Sets authoritative flag.
          *
-         * @param isAuthoritative isAuthoritative flag
+         * @param authoritative authoritative flag
          * @return RequestBuilder object
          */
-        RequestBuilder withIsAuthoritative(boolean isAuthoritative);
+        RequestBuilder withIsAuthoritative(boolean authoritative);
 
         /**
-         * Sets isProbe flag.
+         * Sets probe flag.
          *
-         * @param isProbe isProbe flag
+         * @param probe probe flag
          * @return RequestBuilder object
          */
-        RequestBuilder withIsProbe(boolean isProbe);
+        RequestBuilder withIsProbe(boolean probe);
 
         /**
-         * Sets isSmr flag.
+         * Sets map data resent flag.
          *
-         * @param isSmr isSmr flag
+         * @param mapDataPresent map data present flag
          * @return RequestBuilder object
          */
-        RequestBuilder withIsSmr(boolean isSmr);
+        RequestBuilder withIsMapDataPresent(boolean mapDataPresent);
 
         /**
-         * Sets isPitr flag.
+         * Sets smr flag.
          *
-         * @param isPitr isPitr flag
+         * @param smr smr flag
          * @return RequestBuilder object
          */
-        RequestBuilder withIsPitr(boolean isPitr);
+        RequestBuilder withIsSmr(boolean smr);
 
         /**
-         * Sets isSmrInvoked flag.
+         * Sets pitr flag.
          *
-         * @param isSmrInvoked isSmrInvoked flag
+         * @param pitr pitr flag
          * @return RequestBuilder object
          */
-        RequestBuilder withIsSmrInvoked(boolean isSmrInvoked);
+        RequestBuilder withIsPitr(boolean pitr);
+
+        /**
+         * Sets smrInvoked flag.
+         *
+         * @param smrInvoked smrInvoked flag
+         * @return RequestBuilder object
+         */
+        RequestBuilder withIsSmrInvoked(boolean smrInvoked);
 
         /**
          * Sets record count.
@@ -186,12 +202,20 @@
         RequestBuilder withNonce(long nonce);
 
         /**
+         * Sets source EID address.
+         *
+         * @param sourceEid source EID
+         * @return RequestBuilder object
+         */
+        RequestBuilder withSourceEid(LispAfiAddress sourceEid);
+
+        /**
          * Adds ITR RLOC into RLOC collection.
          *
          * @param itrRloc ITR RLOC
          * @return RequestBuilder object
          */
-        RequestBuilder withItrRloc(LispAfiAddress itrRloc);
+        RequestBuilder addItrRloc(LispAfiAddress itrRloc);
 
         /**
          * Adds EID record into record collection.
