Hey

I'm using the following script to create the bridge (OVS). As you can
see, I'm using

ovs-vsctl set bridge $NAME protocols=OpenFlow13

To set the version of OFP. Is there any other place where I have to
configure this? Because my app won't work anyways with OVS, here's the
version I'm using:

clt-mob-p-1093:/home/staff/aepp/unix # ovs-vsctl --version
ovs-vsctl (Open vSwitch) 1.10.0
Compiled May  6 2013 11:47:07
clt-mob-p-1093:/home/staff/aepp/unix #

usage()
{
cat << EOF
usage: $0 options

This script creates or deletes an Open vSwitch.

OPTIONS:
   -h      Show this message
   -o      Can be 'add' or 'del'
   -n      The name of the bridge
   -p      Amount of port numbers
   -v      Verbose

EXAMPLE:
   # $0 -o add -n lan0 -p 5
   # $0 -o del -n lan0 -p 5
EOF
}

NAME=
PORTS=
OP=
VERBOSE=0
while getopts "h:o:n:p:v" OPTION
do
  case $OPTION in
    h)
      usage
      exit 1
      ;;
    n)
      NAME=$OPTARG
      ;;
    p)
      PORTS=$OPTARG
      ;;
    o)
      OP=$OPTARG
      ;;
    v)
      VERBOSE=1
      ;;
    ?)
      usage
      exit
      ;;
  esac
done

if [[ -z $NAME ]] || [[ -z $PORTS ]] || [[ -z $OP ]]
then
  usage
  exit 1
fi

if [ "$OP" == "add" ]
then
  # create the bridge
  ovs-vsctl add-br $NAME

  # use OFP13
  ovs-vsctl set bridge $NAME protocols=OpenFlow13

  for tap in `seq 0 $PORTS`; do
    ip tuntap add mode tap ${NAME}p$tap
  done;

  # check if the ifaces, only in verbose
  if [ "$VERBOSE" == "1" ]
    then
    echo "Output of: #ip tuntap list"
    ip tuntap list
  fi

  for tap in `seq 0 $PORTS`; do
    ip link set ${NAME}p$tap up
  done;

  # check state of the ifaces, only in verbose
  if [ "$VERBOSE" == "1" ]
  then
    echo "Output of: #ip link"
    ip link
  fi

  for tap in `seq 0 $PORTS`; do
    ovs-vsctl add-port $NAME ${NAME}p$tap
  done;

  # list all ports by ovs-vsctl to check, if taps are there
  if [ "$VERBOSE" == "1" ]
    then
    echo "Output of: #ip ovs-vsctl list-ports $NAME"
    ovs-vsctl list-ports $NAME
  fi

  # set the controller to localhost
  # TODO: make this variable
  ovs-vsctl set-controller $NAME tcp:0.0.0.0:6633

# TODO: be more verbose
elif [ "$OP" == "del" ]
then
  # remove the bridge
  ovs-vsctl del-br $NAME

  # remove all taps
  for tap in `seq 0 $PORTS`; do
    ip tuntap del ${NAME}p$tap mode tap
  done;

else
  usage
  exit 1
fi

THX in advance, Philipp - g *pae

2013/5/15 Isaku Yamahata <[email protected]>:
> On Tue, May 14, 2013 at 04:10:46PM +0200, Philipp Aeschlimann wrote:
>> Hey there
>>
>> I'm trying some things with QoS and therefore i wrote a simple
>> test-app here (click download in the upper right corner):
>>
>> https://owncloud.engineering.zhaw.ch/public.php?service=files&t=f6f7e645b0d67b3c9a0cc537f8b38dfb
>>
>> It sends OFPQueueGetConfigRequest and tries to receive an
>> OFPQueueGetConfigReply. But with the appliance from here
>> https://github.com/osrg/ryu/wiki/OpenFlow_Tutorial I get this error:
>>
>> error msg ev version: 0x1 msg_type 0x1 xid 0xa6425c5e type 1 code 1
>> data _???B\^unsupported version 0x1. If possible, set the switch type
>> 0x1 code 0x1
>> unsupported version 0x1. If possible, set the switch to use one of the
>> versions [4]
>
> You have to configure OVS to use OF 1.3 instead of OF1.0.
> By default OVS uses OF1.0.
>
>> And with OVS 1.10.0 (installed localy) I get:
>>
>> error msg ev version: 0x4 msg_type 0x1 xid 0xd49cfa2a type 1 code 1
>> data ?????* type 0x1 code 0x1
>
> Althouh you set OVS to use OF1.3 somehow, OVS doesn't support
> OFPQueueGetConfigRequest yet. OVS returns an error message in respond to
> the request.
> type 0x1 = error
> code 0x1 = bad request
>
>
>> But with the following changes and the softswitch from here:
>> https://github.com/CPqD/ofsoftswitch13 everything works as expected
>>
>> diff --git a/ryu/ofproto/ofproto_v1_3_parser.py
>> b/ryu/ofproto/ofproto_v1_3_parser.py
>> index 3f2d020..cace1aa 100644
>> --- a/ryu/ofproto/ofproto_v1_3_parser.py
>> +++ b/ryu/ofproto/ofproto_v1_3_parser.py
>> @@ -2734,7 +2734,7 @@ class OFPPacketQueue(MsgBase):
>>      @classmethod
>>      def parser(cls, buf, offset):
>>          (msg.queue_id, msg.port, msg.len) = struct.unpack_from(
>> -            ofproto_v1_3.OFP_PACKET_QUEUE_PACK_STR, buf, offset)
>> +            ofproto_v1_3.OFP_PACKET_QUEUE_PACK_STR, buffer(buf), offset)
>>
>>          length = ofproto_v1_3.OFP_PACKET_QUEUE_SIZE
>>          offset += ofproto_v1_3.OFP_PACKET_QUEUE_SIZE
>
> See below.
>
>
>> @@ -2766,7 +2766,7 @@ class OFPQueueGetConfigReply(MsgBase):
>>
>>          msg.queues = []
>>          offset += ofproto_v1_3.OFP_QUEUE_GET_CONFIG_REPLY_SIZE
>> -        while offset < msg.length:
>> +        while offset < msg_len:
>
> This line looks good.
>
>>              queue = OFPPacketQueue.parser(buf, offset)
>
> msg.buf should be passed. Then first hunk can be dropped.
>
> thanks,
>
>>              msg.queues.append(queue)
>>              offset += queue.len
>>
>> The above errors from OVS are showing up anyways. THX in advance...
>>
>> g *pae
>>
>> --
>> ZHAW - Zurich University of Applied Sciences
>> Institute of Applied Information Technology InIT
>> InIT Cloud Computing Laboratory ICCLab
>>
>> Philipp Aeschlimann
>> Obere Kirchgasse 2
>> CH-8401 Winterthur
>>
>> Tel. +41 58 934 6964 (intern 6964)
>> mailto:[email protected]
>> www.zhaw.ch
>> www.cloudcomp.ch
>>
>> GPG IDKey: 647E122E
>> Fingerprint: 47B7 8D8A 98D1 E91D 4B7C E261 D88C BE9E 647E 122E
>>
>> ------------------------------------------------------------------------------
>> AlienVault Unified Security Management (USM) platform delivers complete
>> security visibility with the essential security capabilities. Easily and
>> efficiently configure, manage, and operate all of your security controls
>> from a single console and one unified framework. Download a free trial.
>> http://p.sf.net/sfu/alienvault_d2d
>> _______________________________________________
>> Ryu-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
> --
> yamahata

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to