How to configure Q-in-Q from python?

68 views
Skip to first unread message

johc...@gmail.com

unread,
Mar 4, 2016, 8:56:43 PM3/4/16
to ostinato
Hi,

I'm able to configure Q-in-Q from Ostinato GUI interface.  The protocol field returned in drone is as follow:
[127.0.0.1:50335]   protocol {
[127.0.0.1:50335]     protocol_id {
[127.0.0.1:50335]       id: 208
[127.0.0.1:50335]     }
[127.0.0.1:50335]     [OstProto.svlan] {
[127.0.0.1:50335]       is_override_tpid: true
[127.0.0.1:50335]       tpid: 34984
[127.0.0.1:50335]       vlan_tag: 0
[127.0.0.1:50335]     }
[127.0.0.1:50335]     [OstProto.vlan] {
[127.0.0.1:50335]       is_override_tpid: false
[127.0.0.1:50335]       tpid: 33024
[127.0.0.1:50335]       vlan_tag: 0
[127.0.0.1:50335]     }


The protocol id used by GUI seems to be from ostinato.core.ost_pb.Protocol.kVlanStackFieldNumber.
However, in vlanstack_pb2.py, it looks like is_extendable is set to False, so I'm not able to access the svlan and vlan field from Python under the vlanstack proto.  Am I on the right track that the Q-in-Q config seems to be not supported from python currently?

Name: python-ostinato
Version: 0.7.1
Location: /usr/local/lib/python2.7/dist-packages
Requires: protobuf

Thanks,

-John

Srivats P

unread,
Mar 7, 2016, 10:15:13 AM3/7/16
to johc...@gmail.com, ostinato
All functionality available in the GUI is available via Python including QinQ.

I suggest you configure a QinQ stream via the GUI and then save it as
a python script to examine the python code required for QinQ

Srivats
> --
> Get Ostinato News and Updates on Twitter - Follow @ostinato
> (http://twitter.com/ostinato)
> ---
> You received this message because you are subscribed to the Google Groups
> "ostinato" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ostinato+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://ostinato.org/
@ostinato

John Cheung

unread,
Mar 7, 2016, 2:33:44 PM3/7/16
to Srivats P, ostinato
Thanks Srivats.  Didn't know that function existed and it is tremendously helpful.

Here is the code snippet for stacked vlan, which seems to work fine:

    p = s.protocol.add()
    p.protocol_id.id = ost_pb.Protocol.kVlanStackFieldNumber
    p.Extensions[svlan].is_override_tpid = True
    p.Extensions[svlan].tpid = 0x88a8
    p.Extensions[svlan].vlan_tag = 0x64
    p.Extensions[vlan].vlan_tag = 0xc8


Thanks,

-John
Reply all
Reply to author
Forward
0 new messages