[pox-dev] MPLS match and labels popping

AMER amer7777 at hotmail.com
Mon Nov 9 06:05:58 PST 2015


Dear Murphy

Thank you for your advises
Which version of OvS you suggest to use for MPLS.

Best regards, 

Eng Amer Alghadhban

COE

SANS-GCFW

CEH, SCNP, CCNA


Subject: Re: MPLS match and labels popping
From: murphy.mccauley at gmail.com
Date: Sun, 8 Nov 2015 13:07:59 -0800
CC: pox-dev at lists.noxrepo.org
To: amer7777 at hotmail.com

On Nov 8, 2015, at 8:04 AM, AMER <amer7777 at hotmail.com> wrote:
Dear All

I would like to ask you about the following match commands and actions

       msg1 = nx.nx_flow_mod()
       msg1.match = nx.nx_match()
       msg1.match.eth_type = pkt.ethernet.MPLS_TYPE       
       msg1.match.mpls_label = 50# host 1 10.0.0.1
       msg1.actions.append(of.ofp_action_output(port = 1))

The above matches didn't work
I'd suggest trying to narrow down why it doesn't work.  If you remove the label match, do all MPLS packets go out port 1?  Have you used Wireshark or something to confirm that there are packets that you think should match with label 50?
It's also possible that some MPLS stuff just plain doesn't work with current/almost-current OVS, I suppose.  It was added to POX when MPLS support was pretty experimental...
when I tested it in mininet 2.2.1, OvS 2.3.2 , POX is "POX 0.2.0 (carp)"

Carp is pretty old.  I have no memory of whether there are known problems with it.
The push command is:

       msg = nx.nx_flow_mod()
       msg.match.of_eth_src = "00:00:00:00:00:04"
       msg.actions.append(nx.nx_action_push_mpls())
       msg.actions.append(nx.nx_reg_load(dst=nx.OXM_OF_MPLS_LABEL, value=50))
       msg.actions.append(of.ofp_action_output(port = 2))
       core.openflow.sendToDPID(event.dpid, msg)

Also, when I tried to use pop command as the following I received the down error

       msg1 = nx.nx_flow_mod()
       msg1.match = nx.nx_match()
       msg1.match.eth_type = pkt.ethernet.MPLS_TYPE       
       msg1.match.mpls_label = 50# host 1 10.0.0.1
       msg1.actions.append(nx.nx_action_pop_mpls()) ######<-- POP
       msg1.actions.append(of.ofp_action_output(port = 1))

The error is:

POX 0.2.0 (carp) / Copyright 2011-2013 James McCauley, et al.
INFO:forwarding.l2_mid:Simple NX switch running.
INFO:core:POX 0.2.0 (carp) is up.
INFO:openflow.of_01:[00-00-00-00-00-02 1] connected
INFO:forwarding.l2_mid:2 switches in path
INFO:openflow.of_01:[00-00-00-00-00-01 2] connected
INFO:forwarding.l2_mid:1 switches in path
ERROR:core:Exception while handling OpenFlowNexus!ConnectionUp...
Traceback (most recent call last):
  File "/home/alghada/pox/pox/lib/revent/revent.py", line 231, in raiseEventNoErrors
    return self.raiseEvent(event, *args, **kw)
  File "/home/alghada/pox/pox/lib/revent/revent.py", line 278, in raiseEvent
    rv = event._invoke(handler, *args, **kw)
  File "/home/alghada/pox/pox/lib/revent/revent.py", line 156, in _invoke
    return handler(self, *args, **kw)
  File "/home/alghada/pox/pox/forwarding/l2_mid.py", line 110, in _handle_ConnectionUp
    core.openflow.sendToDPID(event.dpid, msg1)
  File "/home/alghada/pox/pox/openflow/__init__.py", line 353, in sendToDPID
    self._connections[dpid].send(data)
  File "/home/alghada/pox/pox/openflow/of_01.py", line 692, in send
    data = data.pack()
  File "/home/alghada/pox/pox/openflow/nicira.py", line 387, in pack
    packed += i.pack()
  File "/home/alghada/pox/pox/openflow/libopenflow_01.py", line 2036, in pack
    body = self._pack_body()
  File "/home/alghada/pox/pox/openflow/nicira.py", line 815, in _pack_body
    p = struct.pack('!HHI', self.subtype, self.ethertype, 0) # 4 bytes pad
error: cannot convert argument to integer

This one is very easy.  pop requires the new Ethertype to be given.
nx_action_pop_mpls(ethertype=0x0800) or something like that will be more likely to work (if the packet was IP).
Any help is appreciated

Best regards,

Eng Amer Alghadhban
COE
SANS-GCFW
CEH, SCNP, CCNA
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.noxrepo.org/pipermail/pox-dev-noxrepo.org/attachments/20151109/a22dade5/attachment.html>


More information about the pox-dev mailing list