diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpFactory.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpFactory.java
index 645100e..95bdec8 100644
--- a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpFactory.java
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpFactory.java
@@ -52,6 +52,13 @@
     BgpUpdateMsg.Builder updateMessageBuilder();
 
     /**
+     * Gets the builder object for route refresh message.
+     *
+     * @return builder object for route refresh message
+     */
+    BgpRouteRefreshMsg.Builder routeRefreshMsgBuilder();
+
+    /**
      * Gets the BGP message reader.
      *
      * @return BGP message reader
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpRouteRefreshMsg.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpRouteRefreshMsg.java
new file mode 100644
index 0000000..d8d5370
--- /dev/null
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpRouteRefreshMsg.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2015-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.bgpio.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.bgpio.types.BgpHeader;
+
+/**
+ * Abstraction of an entity providing BGP Route Refresh Message.
+ */
+public interface BgpRouteRefreshMsg extends BgpMessage {
+
+    @Override
+    BgpVersion getVersion();
+
+    @Override
+    BgpType getType();
+
+    @Override
+    void writeTo(ChannelBuffer channelBuffer);
+
+    @Override
+    BgpHeader getHeader();
+
+    /**
+     * Builder interface with get and set functions to build RouteRefresh message.
+     */
+    interface Builder extends BgpMessage.Builder {
+        @Override
+        BgpRouteRefreshMsg build();
+
+        @Override
+        Builder setHeader(BgpHeader bgpMsgHeader);
+
+        /**
+         * Adds the current AFI-SAFI pair and reserved bytes to be transmitted.
+         * BGP Route Refresh message contains one pair of AFI-SAFI values, but routers may transmit more than
+         * one AFI-SAFI pair
+         *
+         * @param afi AFI value to be added to AFI-SAFI pairs
+         * @param reserved reserved byte to be added. By default, this should be 0x00
+         * @param safi SAFI value to be added to AFI-SAFI pairs
+         * @return builder by setting hold time
+         */
+        Builder addAfiSafiValue(short afi, byte reserved, byte safi);
+    }
+}
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpType.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpType.java
index d65caff..e96c99f 100644
--- a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpType.java
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/BgpType.java
@@ -21,7 +21,7 @@
  */
 public enum BgpType {
 
-    NONE(0), OPEN(1), UPDATE(2), NOTIFICATION(3), KEEP_ALIVE(4);
+    NONE(0), OPEN(1), UPDATE(2), NOTIFICATION(3), KEEP_ALIVE(4), ROUTE_REFRESH(5);
 
     int value;
 
@@ -42,4 +42,4 @@
     public byte getType() {
         return (byte) value;
     }
-}
\ No newline at end of file
+}
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpFactoryVer4.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpFactoryVer4.java
index babade2..96806f1 100644
--- a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpFactoryVer4.java
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpFactoryVer4.java
@@ -22,6 +22,7 @@
 import org.onosproject.bgpio.protocol.BgpMessageReader;
 import org.onosproject.bgpio.protocol.BgpNotificationMsg;
 import org.onosproject.bgpio.protocol.BgpOpenMsg;
+import org.onosproject.bgpio.protocol.BgpRouteRefreshMsg;
 import org.onosproject.bgpio.protocol.BgpUpdateMsg;
 import org.onosproject.bgpio.protocol.BgpVersion;
 
@@ -53,6 +54,11 @@
     }
 
     @Override
+    public BgpRouteRefreshMsg.Builder routeRefreshMsgBuilder() {
+        return new BgpRouteRefreshMsgVer4.Builder();
+    }
+
+    @Override
     public BgpMessageReader<BgpMessage> getReader() {
         return BgpMessageVer4.READER;
     }
@@ -61,4 +67,4 @@
     public BgpVersion getVersion() {
         return BgpVersion.BGP_4;
     }
-}
\ No newline at end of file
+}
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpMessageVer4.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpMessageVer4.java
index 278d817..fd4669d 100644
--- a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpMessageVer4.java
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpMessageVer4.java
@@ -36,6 +36,7 @@
 
     static final byte OPEN_MSG_TYPE = 0x1;
     static final byte KEEPALIVE_MSG_TYPE = 0x4;
+    static final byte ROUTEREFRESH_MSG_TYPE = 0x5;
     static final byte UPDATE_MSG_TYPE = 0x2;
     static final byte NOTIFICATION_MSG_TYPE = 0x3;
     static final int MINIMUM_COMMON_HEADER_LENGTH = 19;
@@ -98,6 +99,9 @@
                 case NOTIFICATION_MSG_TYPE:
                     log.debug("NOTIFICATION MESSAGE is received");
                     return BgpNotificationMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader);
+                case ROUTEREFRESH_MSG_TYPE:
+                    log.debug("ROUTEREFRESH MESSAGE is received");
+                    return BgpRouteRefreshMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader);
                 default:
                     Validation.validateType(BgpErrorType.MESSAGE_HEADER_ERROR, BgpErrorType.BAD_MESSAGE_TYPE, type);
                     return null;
@@ -108,4 +112,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpOpenMsgVer4.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpOpenMsgVer4.java
index d7550ff..7c50998 100644
--- a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpOpenMsgVer4.java
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpOpenMsgVer4.java
@@ -30,6 +30,7 @@
 import org.onosproject.bgpio.types.BgpValueType;
 import org.onosproject.bgpio.types.FourOctetAsNumCapabilityTlv;
 import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv;
+import org.onosproject.bgpio.types.RouteRefreshCapabilityTlv;
 import org.onosproject.bgpio.util.Validation;
 import org.onosproject.bgpio.util.Constants;
 import org.onosproject.bgpio.types.RpdCapabilityTlv;
@@ -298,6 +299,15 @@
                 tlv = new MultiProtocolExtnCapabilityTlv(afi, res, safi);
 
                 break;
+            case RouteRefreshCapabilityTlv.TYPE:
+                log.debug("RouteRefreshCapabilityTlv");
+
+                if (RouteRefreshCapabilityTlv.LENGTH != length) {
+                    throw new BgpParseException("Invalid length received for RouteRefreshCapabilityTlv.");
+                }
+
+                tlv = new RouteRefreshCapabilityTlv(true);
+                break;
             default:
                 log.debug("Warning: Unsupported TLV: " + type);
                 cb.skipBytes(length);
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpRouteRefreshMsgVer4.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpRouteRefreshMsgVer4.java
new file mode 100644
index 0000000..9239176
--- /dev/null
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpRouteRefreshMsgVer4.java
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2015-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.bgpio.protocol.ver4;
+
+import com.google.common.base.MoreObjects;
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.onosproject.bgpio.exceptions.BgpParseException;
+import org.onosproject.bgpio.protocol.BgpType;
+import org.onosproject.bgpio.types.BgpHeader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.onosproject.bgpio.protocol.BgpRouteRefreshMsg;
+import org.onosproject.bgpio.protocol.BgpMessageReader;
+import org.onosproject.bgpio.protocol.BgpMessageWriter;
+import org.onosproject.bgpio.protocol.BgpVersion;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Provides BGP Route Refresh message.
+ */
+public class BgpRouteRefreshMsgVer4 implements BgpRouteRefreshMsg {
+
+    /*
+    <Route Refresh Message>::=
+
+    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
+    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+    |                                                               |
+    +                                                               +
+    |                                                               |
+    +                                                               +
+    |                           Marker                              |
+    +                                                               +
+    |                                                               |
+    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+    |          Length               |      Type     |
+    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+    |           AFI                 |    Reserved   |     SAFI      |
+    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+    REFERENCE : RFC 2918
+    */
+
+    private static final Logger log = LoggerFactory.getLogger(BgpRouteRefreshMsgVer4.class);
+
+    public static final byte PACKET_VERSION = 4;
+    public static final int PACKET_LENGTH = 0x17;
+    public static final int MARKER_LENGTH = 16;
+    public static final BgpType MSG_TYPE = BgpType.ROUTE_REFRESH;
+    private static final byte[] MARKER = new byte[]{(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+            (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff};
+
+    private static final BgpHeader DEFAULT_ROUTEREFRESH_HEADER = new BgpHeader(MARKER,
+            (short) PACKET_LENGTH, BgpType.ROUTE_REFRESH.getType());
+
+    private BgpHeader bgpMsgHeader;
+    private byte version;
+    private List<AfiSafiValue> afiSafiValues;
+
+    public static final BgpRouteRefreshMsgVer4.Reader READER = new Reader();
+
+    /**
+     * Reader class for reading BGP route refresh message from channel buffer.
+     */
+    static class Reader implements BgpMessageReader<BgpRouteRefreshMsg> {
+
+        @Override
+        public BgpRouteRefreshMsgVer4 readFrom(ChannelBuffer cb, BgpHeader bgpHeader)
+                throws BgpParseException {
+
+            Short afi = cb.readShort();
+            log.debug("AFI read from Route Refresh message = {}", afi);
+
+            byte reserved = cb.readByte();
+            log.debug("Reserved read from Route Refresh message = {}", reserved);
+
+            byte safi = cb.readByte();
+            log.debug("SAFI read from Route Refresh message = {}", safi);
+
+            List<AfiSafiValue> afiSafiList = new LinkedList<>();
+
+            AfiSafiValue afisafiValue = new AfiSafiValue(afi, reserved, safi);
+            afiSafiList.add(afisafiValue);
+
+            return new BgpRouteRefreshMsgVer4(DEFAULT_ROUTEREFRESH_HEADER, PACKET_VERSION, afiSafiList);
+        }
+    }
+
+    /**
+     * Default constructor.
+     */
+    public BgpRouteRefreshMsgVer4() {
+        this.bgpMsgHeader = null;
+        this.version = 0;
+        this.afiSafiValues = null;
+    }
+
+    public BgpRouteRefreshMsgVer4(BgpHeader msgHeader, byte version, List<AfiSafiValue> afiSafiValues) {
+        this.bgpMsgHeader = msgHeader;
+        this.version = version;
+        this.afiSafiValues = afiSafiValues;
+    }
+
+    /**
+     * Builder class for BGP route refresh message.
+     */
+    static class Builder implements BgpRouteRefreshMsg.Builder {
+        BgpHeader bgpHeader = null;
+        boolean isHeaderSet = false;
+        List<AfiSafiValue> afiSafiList = null;
+
+        @Override
+        public Builder setHeader(BgpHeader bgpMsgHeader) {
+            this.bgpHeader = bgpMsgHeader;
+            this.isHeaderSet = true;
+            return this;
+        }
+
+        @Override
+        public BgpRouteRefreshMsg.Builder addAfiSafiValue(short afi, byte reserved, byte safi) {
+            if (afiSafiList == null) {
+                afiSafiList = new LinkedList<>();
+            }
+            AfiSafiValue currentElement = new AfiSafiValue(afi, reserved, safi);
+            afiSafiList.add(currentElement);
+            return this;
+        }
+
+        @Override
+        public BgpRouteRefreshMsg build() {
+            BgpHeader header = isHeaderSet ? bgpHeader : DEFAULT_ROUTEREFRESH_HEADER;
+            return new BgpRouteRefreshMsgVer4(header, PACKET_VERSION, afiSafiList);
+        }
+    }
+
+    @Override
+    public void writeTo(ChannelBuffer cb) {
+        WRITER.write(cb, this);
+    }
+
+    static final Writer WRITER = new Writer();
+
+    /**
+     * Writer class for writing the BGP route refresh message to channel buffer.
+     */
+    static class Writer implements BgpMessageWriter<BgpRouteRefreshMsgVer4> {
+
+        @Override
+        public void write(ChannelBuffer cb, BgpRouteRefreshMsgVer4 message) {
+            //Iterate over the added AFI-SAFI pair and write a new packet for each of those
+
+            for (AfiSafiValue element : message.afiSafiValues) {
+                cb.writeBytes(MARKER, 0, MARKER_LENGTH);
+                cb.writeShort(PACKET_LENGTH);
+                cb.writeByte(MSG_TYPE.getType());
+
+                cb.writeShort(element.afi);
+                cb.writeByte(element.reserved);
+                cb.writeByte(element.safi);
+            }
+        }
+    }
+
+    @Override
+    public BgpVersion getVersion() {
+        return BgpVersion.BGP_4;
+    }
+
+    @Override
+    public BgpType getType() {
+        return MSG_TYPE;
+    }
+
+    @Override
+    public BgpHeader getHeader() {
+        return this.bgpMsgHeader;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass()).toString();
+    }
+}
+
+final class AfiSafiValue {
+    final short afi;
+    final byte reserved;
+    final byte safi;
+
+    public AfiSafiValue(short afi, byte reserved, byte safi) {
+        this.afi = afi;
+        this.reserved = reserved;
+        this.safi = safi;
+    }
+}
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/RouteRefreshCapabilityTlv.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/RouteRefreshCapabilityTlv.java
new file mode 100644
index 0000000..6d54a4e
--- /dev/null
+++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/RouteRefreshCapabilityTlv.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2015-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.bgpio.types;
+
+import com.google.common.base.MoreObjects;
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Objects;
+
+/**
+ * Provides RouteRefreshCapabilityTlv.
+ */
+public class RouteRefreshCapabilityTlv implements BgpValueType {
+
+    /*
+       Capability Code = 2
+       Length = 0
+
+       REFERENCE : RFC 2918
+     */
+    private static final Logger log = LoggerFactory.getLogger(RouteRefreshCapabilityTlv.class);
+
+    public static final byte TYPE = 2;
+    public static final byte LENGTH = 0;
+
+    private boolean isSupported = false;
+
+    /**
+     * Constructor to initialize variables.
+     * @param isSupported Is Route Refresh supported
+     */
+    public RouteRefreshCapabilityTlv(boolean isSupported) {
+        this.isSupported = isSupported;
+    }
+
+    /**
+     * Returns object of RouteRefreshCapabilityTlv.
+     * @param isSupported Is Route Refresh supported
+     * @return object of RouteRefreshCapabilityTlv
+     */
+    public static RouteRefreshCapabilityTlv of(boolean isSupported) {
+        return new RouteRefreshCapabilityTlv(isSupported);
+    }
+
+    /**
+     * Returns isSupported value.
+     * @return isSupported value
+     */
+    public boolean isSupported() {
+        return isSupported;
+    }
+
+    @Override
+    public short getType() {
+        return TYPE;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(isSupported);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof RouteRefreshCapabilityTlv) {
+            RouteRefreshCapabilityTlv other = (RouteRefreshCapabilityTlv) obj;
+            return Objects.equals(this.isSupported, other.isSupported);
+        }
+        return false;
+    }
+
+    @Override
+    public int write(ChannelBuffer cb) {
+        int iLenStartIndex = cb.writerIndex();
+        cb.writeByte(TYPE);
+        cb.writeByte(LENGTH);
+
+        return cb.writerIndex() - iLenStartIndex;
+    }
+
+    /**
+     * Reads from channel buffer and returns object of RouteRefreshCapabilityTlv.
+     * @param cb of type channel buffer
+     * @return object of RouteRefreshCapabilityTlv
+     */
+    public static BgpValueType read(ChannelBuffer cb) {
+        //No need to read. If TLV is received, it means it is supported
+
+        return new RouteRefreshCapabilityTlv(true);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+                .add("Type", TYPE)
+                .add("Length", LENGTH).toString();
+    }
+
+    @Override
+    public int compareTo(Object o) {
+        return 0;
+    }
+}
diff --git a/protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpOpenMsgTest.java b/protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpOpenMsgTest.java
index a5d1b90..3fe02ee 100644
--- a/protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpOpenMsgTest.java
+++ b/protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpOpenMsgTest.java
@@ -297,7 +297,7 @@
         // OPEN Message with invalid message type.
         byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
                                      (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
-                                     (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 0x00, 0x1d, 0x05, 0X04,
+                                     (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 0x00, 0x1d, 0x06, 0X04,
                                      (byte) 0xfe, 0x09, 0x00, (byte) 0xb4, (byte) 0xc0, (byte) 0xa8, 0x00, 0x0f, 0x00 };
 
         ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
diff --git a/protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpRouteRefreshMsgTest.java b/protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpRouteRefreshMsgTest.java
new file mode 100644
index 0000000..408ba0e
--- /dev/null
+++ b/protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpRouteRefreshMsgTest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2015-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.bgpio.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.bgpio.exceptions.BgpParseException;
+import org.onosproject.bgpio.types.BgpHeader;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test case for BGP Route Refresh Message.
+ */
+public class BgpRouteRefreshMsgTest {
+
+    /**
+     * This test case checks BGP Route Refresh message.
+     */
+    @Test
+    public void routeRefreshMessageTest1() throws BgpParseException {
+
+        // BGP RouteRefresh Message
+        byte[] rrMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+                                          (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+                                          (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+                                          (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
+                                          0x00, 0x17, 0x05, 0x00, 0x02, 0x00, 0x01};
+
+        byte[] testRouteRefreshMsg;
+        ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+        buffer.writeBytes(rrMsg);
+
+        BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
+        BgpMessage message;
+        BgpHeader bgpHeader = new BgpHeader();
+
+        message = reader.readFrom(buffer, bgpHeader);
+
+        assertThat(message, instanceOf(BgpRouteRefreshMsg.class));
+
+        ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+        message.writeTo(buf);
+
+        int readLen = buf.writerIndex();
+        testRouteRefreshMsg = new byte[readLen];
+        buf.readBytes(testRouteRefreshMsg, 0, readLen);
+
+        assertThat(testRouteRefreshMsg, is(rrMsg));
+    }
+}
