Openflow Swicth 未推送 MPLS 标签。 (开日光)

Openflow Swicth not pushing MPLS tag. (OpenDayLight)

我有以下带有 ODL 控制器的线性 SDN 架构:

Host1 -- ZodiacFX1 -- ZodiacFX2 --- Host2

我使用 2 台笔记本电脑作为主机和 2 个 ZodiacFX openflow 交换机。

我希望 ZodiacFX1 将 MPLS 标记推送到从 Host1 接收的所有 IP 数据包,而 ZodiacFX2 弹出 MPLS 标记并将 IP 数据包发送到 Host2。

我在 ZodiacFX1 上为 MPLS 推送添加了一个流,我可以在 ZodiacFX1 和 ODL 的操作数据存储中看到该流处于活动状态。但是如果我 ping h1->h2 没有推送。

流程是这样的:

注意:(主机 1 连接到 ZodiacFX1 的端口 1,ZodiacFX1 端口 2 连接到 ZodiacFX2 端口 1。)

 GET  http://192.168.21.147:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:123917682137538/table/2

{
"flow-node-inventory:table": [
    {
        "id": 2,
        "opendaylight-flow-table-statistics:flow-table-statistics": {
            "active-flows": 1,
            "packets-looked-up": 0,
            "packets-matched": 0
        },
        "flow": [
            {
                "id": "125",
                "idle-timeout": 0,
                "cookie": 401,
                "flags": "",
                "hard-timeout": 0,
                "instructions": {
                    "instruction": [
                        {
                            "order": 0,
                            "apply-actions": {
                                "action": [
                                    {
                                        "order": 2,
                                        "output-action": {
                                            "output-node-connector": "2",
                                            "max-length": 0
                                        }
                                    },
                                    {
                                        "order": 1,
                                        "set-field": {
                                            "protocol-match-fields": {
                                                "mpls-label": 27
                                            }
                                        }
                                    },
                                    {
                                        "order": 0,
                                        "push-mpls-action": {
                                            "ethernet-type": 34887
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                },
                "cookie_mask": 0,
                "opendaylight-flow-statistics:flow-statistics": {
                    "duration": {
                        "nanosecond": 0,
                        "second": 7
                    },
                    "byte-count": 0,
                    "packet-count": 0
                },
                "priority": 0,
                "table_id": 2,
                "match": {
                    "in-port": "1",
                    "ethernet-match": {
                        "ethernet-type": {
                            "type": 2048
                        }
                    }
                }
            },
            {
                "id": "124",
                "idle-timeout": 0,
                "cookie": 401,
                "flags": "",
                "hard-timeout": 0,
                "instructions": {
                    "instruction": [
                        {
                            "order": 0,
                            "apply-actions": {
                                "action": [
                                    {
                                        "order": 2,
                                        "output-action": {
                                            "output-node-connector": "2",
                                            "max-length": 0
                                        }
                                    },
                                    {
                                        "order": 1,
                                        "set-field": {
                                            "protocol-match-fields": {
                                                "mpls-label": 27
                                            }
                                        }
                                    },
                                    {
                                        "order": 0,
                                        "push-mpls-action": {
                                            "ethernet-type": 34887
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                },
                "cookie_mask": 0,
                "opendaylight-flow-statistics:flow-statistics": {
                    "duration": {
                        "nanosecond": 0,
                        "second": 180
                    },
                    "byte-count": 0,
                    "packet-count": 0
                },
                "priority": 8,
                "table_id": 2,
                "match": {
                    "in-port": "1",
                    "ethernet-match": {
                        "ethernet-type": {
                            "type": 2048
                        }
                    }
                }
            }
        ]
    }
]
}

而且我在十二生肖控制台界面也能看到:

Flow 6
 Match:
  In Port: 1
  ETH Type: IPv4
 Attributes:
  Table ID: 2                           Cookie:0x191
  Priority: 8                           Duration: 247 secs
 Hard Timeout: 0 secs                  Idle Timeout: 0 secs
  Byte Count: 0                 Packet Count: 0
  Last Match: 00:04:07
  Instructions:
  Apply Actions:
   Push MPLS tag
   Set MPLS Label: 27
   Output Port: 2

可能是什么问题?我认为主要问题是,在这种情况下,Zodiac 正在遵循此流程,我也尝试过优先级为 0 的流程,但没有 MPLS 推送。

Flow 5
Match:
In Port: 1
 Attributes:
 Table ID: 0                           Cookie:0x2b00000000000008
 Priority: 2                           Duration: 2845 secs
 Hard Timeout: 0 secs                  Idle Timeout: 0 secs
 Byte Count: 576265                    Packet Count: 5246
 Last Match: 00:00:00
Instructions:
 Apply Actions:
Output Port: 3
Output Port: 2
Output: CONTROLLER

您似乎还有其他应用程序(可能是 l2switch)在推送 也流向您的开关。也许只需安装 openflowplugin 并尝试。

另外,尝试将您的 mpls 流放在 table 0 而不是 table 2.