How to send raw packet data from Opendaylight controller to network datapath

中文版本这里: http://www.sdnlab.com/18092.html

 


How to send raw packet data from Opendaylight controller to network datapath


Abstract

Opendaylight(ODL) controller project contains Service Abstraction Layer(AD-SAL/MD-SAL), UI, other components etc. Sending packet to network is the basic functionality for network devices. Two methods are giving to demonstrate how to deliver raw packet-data to network from ODL controller, it works fine with ODL version Boron(+) and Beryllium(+).

 

1    Introduction

ODL provides flexible and powerful REST API for custom business logic. In yang model “packet-processing(2013-07-09)”it is provided to sending packet out through openflow device from controller with RPC interface transmit-packet.

Also service “PacketProcessingService” can be used to deliver packet data from controller through a specific switch to network.

1.1  packet-processing(2013-07-09)

The yang model file is located in directory “model/model-flow-service/src/main/yang/packet-processing.yang”with ODL project  “openflowplugin”.

RPC interface transmit-packet  as follows:

rpc transmit-packet{

        description "Sending packet out through openflow device.";

        input {

            uses inv:node-context-ref;

            leaf connection-cookie {

                type connection-cookie;

            }

            leaf egress {

                type inv:node-connector-ref;

            }

            leaf buffer-id {

                  type uint32;

            }

            uses raw-packet;

        uses action-type:action-list;

        }

Fields needed are:

  • egress: switch’s egress port. ODL’s connector reference format. For example,“/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='NODE-ID']/opendaylight-inventory:node-connector[opendaylight-inventory:id='PORT-ID']”
  • node: which switch to send from. ODL’s node reference format. For example, “/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='NODE-ID']
  • raw-packet: raw packet data to send. Base64 Encoding scheme must be applied to binary raw data when calling the API.

 

1.2  PacketProcessingService Interface

The service is provided in model-flow-service from bundle of openflowplugin. Only one method available:

/**

 * Sending packet out through openflow device.

 *

 */

Future<RpcResult<java.lang.Void>> transmitPacket(TransmitPacketInput   input);

 

2    Topology

We use following topology to test above method.

 

Network device and its corresponding ref inODL is :

 

3    packet-processing(2013-07-09)

We want to send raw packet from switch’s eth2 to network.

3.1  Java example code

Java sample code with

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值