[ovs-dev] [PATCH] Change logging format for flows to that accepted by ofproto/trace.
Ethan Jackson
ethan at nicira.com
Thu Oct 11 23:32:17 UTC 2012
High level issue before I review:
Can we just convert the flow to an odp_flow_key (see
odp_flow_key_from_flow()) and then format it using the same code we
use to format the datapath flows (see odpf_flow_key_format())? That
would reduce a lot of duplication, and is probably less error prone.
Ethan
On Fri, Oct 5, 2012 at 10:23 AM, Mehak Mahajan <mmahajan at nicira.com> wrote:
> flow_format() logs packets contents. However, the format used is not
> the format accepted by ofproto/trace. Hence it becomes difficult to
> trace the packets using the debugs printed. With this commit, the
> logging of the packet contents is done in a format that is accepted
> by ofproto/trace. This will make debugging easier.
>
> Signed-off-by: Mehak Mahajan <mmahajan at nicira.com>
> ---
> lib/flow.c | 171 ++++++++++++++++++++++++++++++-------------------
> tests/ofp-print.at | 6 +-
> tests/ofproto-dpif.at | 56 ++++++++--------
> tests/ofproto.at | 12 ++--
> 4 files changed, 142 insertions(+), 103 deletions(-)
>
> diff --git a/lib/flow.c b/lib/flow.c
> index 76d2340..ac9f201 100644
> --- a/lib/flow.c
> +++ b/lib/flow.c
> @@ -479,93 +479,132 @@ flow_to_string(const struct flow *flow)
> return ds_cstr(&ds);
> }
>
> -static void format_tunnel_flags(uint16_t flags, struct ds *ds)
> -{
> - flags &= ~FLOW_TNL_F_KEY;
> -
> - if (flags & FLOW_TNL_F_DONT_FRAGMENT) {
> - ds_put_cstr(ds, ",df");
> - flags &= ~FLOW_TNL_F_DONT_FRAGMENT;
> - }
> -
> - if (flags & FLOW_TNL_F_CSUM) {
> - ds_put_cstr(ds, ",csum");
> - flags &= ~FLOW_TNL_F_CSUM;
> - }
> -
> - if (flags) {
> - ds_put_format(ds, ",flags:%#"PRIx16, flags);
> - }
> -}
> -
> void
> flow_format(struct ds *ds, const struct flow *flow)
> {
> - ds_put_format(ds, "priority:%"PRIu32, flow->skb_priority);
> + bool skip_type = true;
>
> + ds_put_format(ds, "priority=%"PRIu32, flow->skb_priority);
> + ds_put_format(ds, " metadata=%#"PRIx64, ntohll(flow->metadata));
> + ds_put_format(ds, " in_port=%"PRIu16, flow->in_port);
> if (flow->tunnel.ip_dst || flow->tunnel.tun_id) {
> - ds_put_cstr(ds, ",tunnel(");
> - ds_put_format(ds, IP_FMT"->"IP_FMT, IP_ARGS(&flow->tunnel.ip_src),
> - IP_ARGS(&flow->tunnel.ip_dst));
> + ds_put_format(ds, " tun_id=%#"PRIx64, ntohll(flow->tunnel.tun_id));
> + }
>
> - if (flow->tunnel.flags & FLOW_TNL_F_KEY) {
> - ds_put_format(ds, ",key:%#"PRIx64, ntohll(flow->tunnel.tun_id));
> + if (flow->dl_type == htons(ETH_TYPE_IP)) {
> + if (flow->nw_proto == IPPROTO_ICMP) {
> + ds_put_format(ds, " icmp");
> + } else if (flow->nw_proto == IPPROTO_TCP) {
> + ds_put_format(ds, " tcp");
> + } else if (flow->nw_proto == IPPROTO_UDP) {
> + ds_put_format(ds, " udp");
> + } else {
> + ds_put_format(ds, " ip");
> }
> - ds_put_format(ds, ",tos:%#"PRIx8",ttl:%"PRIu8, flow->tunnel.ip_tos,
> - flow->tunnel.ip_ttl);
> - format_tunnel_flags(flow->tunnel.flags, ds);
> - ds_put_char(ds, ')');
> + } else if (flow->dl_type == htons(ETH_TYPE_IPV6)) {
> + if (flow->nw_proto == IPPROTO_ICMPV6) {
> + ds_put_format(ds, " icmp6");
> + } else if (flow->nw_proto == IPPROTO_TCP) {
> + ds_put_format(ds, " tcp6");
> + } else if (flow->nw_proto == IPPROTO_UDP) {
> + ds_put_format(ds, " udp6");
> + } else {
> + ds_put_format(ds, " ipv6");
> + }
> + } else if (flow->dl_type == htons(ETH_TYPE_ARP)) {
> + ds_put_format(ds, " arp");
> + } else {
> + skip_type = false;
> }
>
> - ds_put_format(ds, ",metadata:%#"PRIx64
> - ",in_port:%04"PRIx16,
> - ntohll(flow->metadata),
> - flow->in_port);
> + ds_put_format(ds, " dl_src="ETH_ADDR_FMT, ETH_ADDR_ARGS(flow->dl_src));
> + ds_put_format(ds, " dl_dst="ETH_ADDR_FMT, ETH_ADDR_ARGS(flow->dl_dst));
> + if (!skip_type) {
> + ds_put_format(ds, " dl_type=0x%04"PRIx16, ntohs(flow->dl_type));
> + }
>
> - ds_put_format(ds, ",tci(");
> if (flow->vlan_tci) {
> - ds_put_format(ds, "vlan:%"PRIu16",pcp:%d",
> - vlan_tci_to_vid(flow->vlan_tci),
> + ds_put_format(ds, " dl_vlan=%"PRIu16,
> + vlan_tci_to_vid(flow->vlan_tci));
> + ds_put_format(ds, " dl_vlan_pcp=%d",
> vlan_tci_to_pcp(flow->vlan_tci));
> } else {
> - ds_put_char(ds, '0');
> + ds_put_format(ds, " vlan_tci=0x%04"PRIx16, ntohs(flow->vlan_tci));
> + }
> +
> + if (flow->dl_type == htons(ETH_TYPE_ARP)) {
> + ds_put_format(ds, " arp_op=%"PRIu8, flow->nw_proto);
> }
> - ds_put_format(ds, ") mac("ETH_ADDR_FMT"->"ETH_ADDR_FMT
> - ") type:%04"PRIx16,
> - ETH_ADDR_ARGS(flow->dl_src),
> - ETH_ADDR_ARGS(flow->dl_dst),
> - ntohs(flow->dl_type));
>
> if (flow->dl_type == htons(ETH_TYPE_IPV6)) {
> - ds_put_format(ds, " label:%#"PRIx32" proto:%"PRIu8" tos:%#"PRIx8
> - " ttl:%"PRIu8" ipv6(",
> - ntohl(flow->ipv6_label), flow->nw_proto,
> - flow->nw_tos, flow->nw_ttl);
> + ds_put_format(ds, " ipv6_src=");
> print_ipv6_addr(ds, &flow->ipv6_src);
> - ds_put_cstr(ds, "->");
> + ds_put_format(ds, " ipv6_dst=");
> print_ipv6_addr(ds, &flow->ipv6_dst);
> - ds_put_char(ds, ')');
> - } else if (flow->dl_type == htons(ETH_TYPE_IP) ||
> - flow->dl_type == htons(ETH_TYPE_ARP)) {
> - ds_put_format(ds, " proto:%"PRIu8" tos:%#"PRIx8" ttl:%"PRIu8
> - " ip("IP_FMT"->"IP_FMT")",
> - flow->nw_proto, flow->nw_tos, flow->nw_ttl,
> - IP_ARGS(&flow->nw_src), IP_ARGS(&flow->nw_dst));
> + ds_put_format(ds, " ipv6_label=0x%05"PRIx32" ",ntohl(flow->ipv6_label));
> + } else if (flow->dl_type == htons(ETH_TYPE_IP)) {
> + ds_put_format(ds, " nw_src="IP_FMT, IP_ARGS(&flow->nw_src));
> + ds_put_format(ds, " nw_dst="IP_FMT, IP_ARGS(&flow->nw_dst));
> + } else if (flow->dl_type == htons(ETH_TYPE_ARP)) {
> + ds_put_format(ds, " arp_spa="IP_FMT, IP_ARGS(&flow->nw_src));
> + ds_put_format(ds, " arp_tpa="IP_FMT, IP_ARGS(&flow->nw_dst));
> }
> - if (flow->nw_frag) {
> - ds_put_format(ds, " frag(%s)",
> - flow->nw_frag == FLOW_NW_FRAG_ANY ? "first"
> - : flow->nw_frag == (FLOW_NW_FRAG_ANY | FLOW_NW_FRAG_LATER)
> - ? "later" : "<error>");
> +
> + if (flow->dl_type == htons(ETH_TYPE_ARP)) {
> + ds_put_format(ds, " arp_sha="ETH_ADDR_FMT,
> + ETH_ADDR_ARGS(flow->arp_sha));
> + ds_put_format(ds, " arp_tha="ETH_ADDR_FMT,
> + ETH_ADDR_ARGS(flow->arp_tha));
> + }
> +
> + if (flow->dl_type == htons(ETH_TYPE_IPV6) ||
> + flow->dl_type == htons(ETH_TYPE_IP)) {
> +
> + ds_put_format(ds, " nw_tos=%"PRIu8, flow->nw_tos);
> + ds_put_format(ds, " nw_ttl=%"PRIu8, flow->nw_ttl);
> }
> - if (flow->tp_src || flow->tp_dst) {
> - ds_put_format(ds, " port(%"PRIu16"->%"PRIu16")",
> - ntohs(flow->tp_src), ntohs(flow->tp_dst));
> +
> + if (flow->nw_frag) {
> + switch(flow->nw_frag) {
> + case FLOW_NW_FRAG_ANY | FLOW_NW_FRAG_LATER:
> + ds_put_format(ds, " nw_frag=%s",
> + flow->nw_frag == FLOW_NW_FRAG_ANY
> + ? (flow->nw_frag == FLOW_NW_FRAG_LATER
> + ? "later"
> + : "first")
> + : (flow->nw_frag == FLOW_NW_FRAG_LATER
> + ? "<error>"
> + : "no"));
> + break;
> + case FLOW_NW_FRAG_ANY:
> + ds_put_format(ds, " nw_frag=%s",
> + flow->nw_frag & FLOW_NW_FRAG_ANY ? "yes" : "no");
> + break;
> +
> + case FLOW_NW_FRAG_LATER:
> + ds_put_format(ds, " nw_frag=%s",
> + flow->nw_frag & FLOW_NW_FRAG_LATER
> + ? "later"
> + : "not_later");
> + break;
> + }
> }
> - if (!eth_addr_is_zero(flow->arp_sha) || !eth_addr_is_zero(flow->arp_tha)) {
> - ds_put_format(ds, " arp_ha("ETH_ADDR_FMT"->"ETH_ADDR_FMT")",
> - ETH_ADDR_ARGS(flow->arp_sha),
> - ETH_ADDR_ARGS(flow->arp_tha));
> +
> + if (flow->dl_type == htons(ETH_TYPE_IP) &&
> + (flow->nw_proto == IPPROTO_ICMP)) {
> + ds_put_format(ds, " icmp_type=%"PRIu16, ntohs(flow->tp_src));
> + ds_put_format(ds, " icmp_code=%"PRIu16, ntohs(flow->tp_dst));
> + } else if (flow->dl_type == htons(ETH_TYPE_IP) &&
> + (flow->nw_proto == IPPROTO_ICMPV6)) {
> + ds_put_format(ds, " icmp_type=%"PRIu16, ntohs(flow->tp_src));
> + ds_put_format(ds, " icmp_code=%"PRIu16, ntohs(flow->tp_dst));
> + ds_put_format(ds, " nd_sll="ETH_ADDR_FMT,
> + ETH_ADDR_ARGS(flow->arp_sha));
> + ds_put_format(ds, " nd_tll="ETH_ADDR_FMT,
> + ETH_ADDR_ARGS(flow->arp_tha));
> + } else if (flow->tp_src || flow->tp_dst) {
> + ds_put_format(ds, " tp_src=%"PRIu16, ntohs(flow->tp_src));
> + ds_put_format(ds, " tp_dst=%"PRIu16, ntohs(flow->tp_dst));
> }
> }
>
> diff --git a/tests/ofp-print.at b/tests/ofp-print.at
> index 5a64ff2..b66f68b 100644
> --- a/tests/ofp-print.at
> +++ b/tests/ofp-print.at
> @@ -337,7 +337,7 @@ c0 a8 00 02 27 2f 00 00 78 50 cc 5b 57 af 42 1e \
> 50 00 02 00 26 e8 00 00 00 00 00 00 00 00 \
> "], [0], [dnl
> OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=3 (via no_match) data_len=60 buffer=0x00000111
> -priority:0,metadata:0,in_port:0000,tci(0) mac(50:54:00:00:00:05->50:54:00:00:00:06) type:0800 proto:6 tos:0 ttl:64 ip(192.168.0.1->192.168.0.2) port(10031->0) tcp_csum:26e8
> +priority=0 metadata=0 in_port=0 tcp dl_src=50:54:00:00:00:05 dl_dst=50:54:00:00:00:06 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=64 tp_src=10031 tp_dst=0 tcp_csum:26e8
> ])
> AT_CLEANUP
>
> @@ -351,7 +351,7 @@ AT_CHECK([ovs-ofctl ofp-print "\
> 00 00 00 23 20 83 c1 5f 00 00 00 00 \
> "], [0], [dnl
> OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00
> -priority:0,metadata:0,in_port:0000,tci(0) mac(00:23:20:83:c1:5f->ff:ff:ff:ff:ff:ff) type:8035
> +priority=0 metadata=0 in_port=0 dl_src=00:23:20:83:c1:5f dl_dst=ff:ff:ff:ff:ff:ff dl_type=0x8035 vlan_tci=0x0000
> ])
> AT_CLEANUP
>
> @@ -1154,7 +1154,7 @@ ff ff ff ff ff ff 00 00 00 00 82 82 82 82 82 82 \
> 31 6d 00 00 00 00 00 00 00 00 \
> "], [0], [dnl
> NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 metadata=0x5a5a5a5a5a5a5a5a reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:6 tos:0 ttl:0 ip(83.83.83.83->84.84.84.84) port(85->86) tcp_csum:316d
> +priority=0 metadata=0 in_port=0 tcp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=84.84.84.84 nw_tos=0 nw_ttl=0 tp_src=85 tp_dst=86 tcp_csum:316d
> ])
> AT_CLEANUP
>
> diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
> index 80ba333..a378db2 100644
> --- a/tests/ofproto-dpif.at
> +++ b/tests/ofproto-dpif.at
> @@ -98,7 +98,7 @@ AT_CHECK([ovs-appctl ofproto/trace br0 'in_port(1),eth(src=50:54:00:00:00:05,dst
> OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
> AT_CHECK([cat ofctl_monitor.log], [0], [dnl
> NXT_PACKET_IN (xid=0x0): table_id=1 total_len=42 in_port=1 (via invalid_ttl) data_len=42 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(50:54:00:00:00:05->50:54:00:00:00:07) type:0800 proto:1 tos:0 ttl:1 ip(192.168.0.1->192.168.0.2)
> +priority=0 metadata=0 in_port=0 icmp dl_src=50:54:00:00:00:05 dl_dst=50:54:00:00:00:07 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=1 icmp_type=0 icmp_code=0
> ])
> OVS_VSWITCHD_STOP
> AT_CLEANUP
> @@ -263,13 +263,13 @@ done
> OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
> AT_CHECK([cat ofctl_monitor.log], [0], [dnl
> OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(50:54:00:00:00:05->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->9) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=50:54:00:00:00:05 dl_dst=50:54:00:00:00:07 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=9 tcp_csum:0
> dnl
> OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(50:54:00:00:00:05->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->9) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=50:54:00:00:00:05 dl_dst=50:54:00:00:00:07 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=9 tcp_csum:0
> dnl
> OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(50:54:00:00:00:05->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->9) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=50:54:00:00:00:05 dl_dst=50:54:00:00:00:07 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=9 tcp_csum:0
> ])
>
> dnl Singleton controller action.
> @@ -282,13 +282,13 @@ done
> OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
> AT_CHECK([cat ofctl_monitor.log], [0], [dnl
> OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(10:11:11:11:11:11->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->10) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=10:11:11:11:11:11 dl_dst=50:54:00:00:00:07 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=10 tcp_csum:0
> dnl
> OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(10:11:11:11:11:11->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->10) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=10:11:11:11:11:11 dl_dst=50:54:00:00:00:07 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=10 tcp_csum:0
> dnl
> OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(10:11:11:11:11:11->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->10) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=10:11:11:11:11:11 dl_dst=50:54:00:00:00:07 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=10 tcp_csum:0
> ])
>
> dnl Modified controller action.
> @@ -301,13 +301,13 @@ done
> OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
> AT_CHECK([cat ofctl_monitor.log], [0], [dnl
> OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:15,pcp:0) mac(30:33:33:33:33:33->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->10) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=30:33:33:33:33:33 dl_dst=50:54:00:00:00:07 dl_vlan=15 dl_vlan_pcp=0 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=10 tcp_csum:0
> dnl
> OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:15,pcp:0) mac(30:33:33:33:33:33->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->10) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=30:33:33:33:33:33 dl_dst=50:54:00:00:00:07 dl_vlan=15 dl_vlan_pcp=0 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=10 tcp_csum:0
> dnl
> OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:15,pcp:0) mac(30:33:33:33:33:33->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->10) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=30:33:33:33:33:33 dl_dst=50:54:00:00:00:07 dl_vlan=15 dl_vlan_pcp=0 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=10 tcp_csum:0
> ])
>
> dnl Checksum TCP.
> @@ -320,31 +320,31 @@ done
> OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
> AT_CHECK([cat ofctl_monitor.log], [0], [dnl
> NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(20:22:22:22:22:22->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->11) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=20:22:22:22:22:22 dl_dst=50:54:00:00:00:07 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 tcp_csum:0
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(20:22:22:22:22:22->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->11) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=20:22:22:22:22:22 dl_dst=50:54:00:00:00:07 dl_vlan=80 dl_vlan_pcp=0 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 tcp_csum:0
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->50:54:00:00:00:07) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->11) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=80:81:81:81:81:81 dl_dst=50:54:00:00:00:07 dl_vlan=80 dl_vlan_pcp=0 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 tcp_csum:0
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:6 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->11) tcp_csum:0
> +priority=0 metadata=0 in_port=0 tcp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 tcp_csum:0
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:6 tos:0 ttl:0 ip(83.83.83.83->192.168.0.2) port(8->11) tcp_csum:1a03
> +priority=0 metadata=0 in_port=0 tcp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 tcp_csum:1a03
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:6 tos:0 ttl:0 ip(83.83.83.83->84.84.84.84) port(8->11) tcp_csum:3205
> +priority=0 metadata=0 in_port=0 tcp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=84.84.84.84 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 tcp_csum:3205
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:6 tos:0 ttl:0 ip(83.83.83.83->84.84.84.84) port(85->11) tcp_csum:31b8
> +priority=0 metadata=0 in_port=0 tcp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=84.84.84.84 nw_tos=0 nw_ttl=0 tp_src=85 tp_dst=11 tcp_csum:31b8
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:6 tos:0 ttl:0 ip(83.83.83.83->84.84.84.84) port(85->86) tcp_csum:316d
> +priority=0 metadata=0 in_port=0 tcp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=84.84.84.84 nw_tos=0 nw_ttl=0 tp_src=85 tp_dst=86 tcp_csum:316d
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:6 tos:0 ttl:0 ip(83.83.83.83->84.84.84.84) port(85->86) tcp_csum:316d
> +priority=0 metadata=0 in_port=0 tcp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=84.84.84.84 nw_tos=0 nw_ttl=0 tp_src=85 tp_dst=86 tcp_csum:316d
> ])
>
> dnl Checksum UDP.
> @@ -357,31 +357,31 @@ done
> OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
> AT_CHECK([cat ofctl_monitor.log], [0], [dnl
> NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(20:22:22:22:22:22->50:54:00:00:00:07) type:0800 proto:17 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->11) udp_csum:1234
> +priority=0 metadata=0 in_port=0 udp dl_src=20:22:22:22:22:22 dl_dst=50:54:00:00:00:07 vlan_tci=0x0000 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 udp_csum:1234
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(20:22:22:22:22:22->50:54:00:00:00:07) type:0800 proto:17 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->11) udp_csum:1234
> +priority=0 metadata=0 in_port=0 udp dl_src=20:22:22:22:22:22 dl_dst=50:54:00:00:00:07 dl_vlan=80 dl_vlan_pcp=0 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 udp_csum:1234
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->50:54:00:00:00:07) type:0800 proto:17 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->11) udp_csum:1234
> +priority=0 metadata=0 in_port=0 udp dl_src=80:81:81:81:81:81 dl_dst=50:54:00:00:00:07 dl_vlan=80 dl_vlan_pcp=0 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 udp_csum:1234
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:17 tos:0 ttl:0 ip(192.168.0.1->192.168.0.2) port(8->11) udp_csum:1234
> +priority=0 metadata=0 in_port=0 udp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=192.168.0.1 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 udp_csum:1234
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:17 tos:0 ttl:0 ip(83.83.83.83->192.168.0.2) port(8->11) udp_csum:2c37
> +priority=0 metadata=0 in_port=0 udp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=192.168.0.2 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 udp_csum:2c37
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:17 tos:0 ttl:0 ip(83.83.83.83->84.84.84.84) port(8->11) udp_csum:4439
> +priority=0 metadata=0 in_port=0 udp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=84.84.84.84 nw_tos=0 nw_ttl=0 tp_src=8 tp_dst=11 udp_csum:4439
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:17 tos:0 ttl:0 ip(83.83.83.83->84.84.84.84) port(85->11) udp_csum:43ec
> +priority=0 metadata=0 in_port=0 udp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=84.84.84.84 nw_tos=0 nw_ttl=0 tp_src=85 tp_dst=11 udp_csum:43ec
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:17 tos:0 ttl:0 ip(83.83.83.83->84.84.84.84) port(85->86) udp_csum:43a1
> +priority=0 metadata=0 in_port=0 udp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=84.84.84.84 nw_tos=0 nw_ttl=0 tp_src=85 tp_dst=86 udp_csum:43a1
> dnl
> NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(vlan:80,pcp:0) mac(80:81:81:81:81:81->82:82:82:82:82:82) type:0800 proto:17 tos:0 ttl:0 ip(83.83.83.83->84.84.84.84) port(85->86) udp_csum:43a1
> +priority=0 metadata=0 in_port=0 udp dl_src=80:81:81:81:81:81 dl_dst=82:82:82:82:82:82 dl_vlan=80 dl_vlan_pcp=0 nw_src=83.83.83.83 nw_dst=84.84.84.84 nw_tos=0 nw_ttl=0 tp_src=85 tp_dst=86 udp_csum:43a1
> ])
>
> AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
> diff --git a/tests/ofproto.at b/tests/ofproto.at
> index 8a728e4..5e1f40a 100644
> --- a/tests/ofproto.at
> +++ b/tests/ofproto.at
> @@ -631,21 +631,21 @@ check_async () {
> ovs-ofctl -v packet-out br0 none controller '0001020304050010203040501234'
> if test X"$1" = X"OFPR_ACTION"; then shift;
> echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=NONE (via action) data_len=14 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234"
> +priority=0 metadata=0 in_port=0 dl_src=00:10:20:30:40:50 dl_dst=00:01:02:03:04:05 dl_type=0x1234 vlan_tci=0x0000"
> fi
>
> # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
> ovs-ofctl -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
> if test X"$1" = X"OFPR_NO_MATCH"; then shift;
> echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=NONE (via no_match) data_len=14 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234"
> +priority=0 metadata=0 in_port=0 dl_src=00:10:20:30:40:50 dl_dst=00:01:02:03:04:05 dl_type=0x1234 vlan_tci=0x0000"
> fi
>
> # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
> ovs-ofctl packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
> if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
> echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=NONE (via invalid_ttl) data_len=76 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(00:26:b9:8c:b0:f9->00:25:83:df:b4:00) type:0800 proto:17 tos:0 ttl:0 ip(172.17.55.13->172.16.0.2) port(55155->53) udp_csum:8f6d"
> +priority=0 metadata=0 in_port=0 udp dl_src=00:26:b9:8c:b0:f9 dl_dst=00:25:83:df:b4:00 vlan_tci=0x0000 nw_src=172.17.55.13 nw_dst=172.16.0.2 nw_tos=0 nw_ttl=0 tp_src=55155 tp_dst=53 udp_csum:8f6d"
> fi
>
> # OFPT_PORT_STATUS, OFPPR_ADD
> @@ -743,9 +743,9 @@ ovs-appctl -t ovs-ofctl exit
>
> AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
> OFPT_PACKET_IN: total_len=14 in_port=NONE (via action) data_len=14 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234
> +priority=0 metadata=0 in_port=0 dl_src=00:10:20:30:40:50 dl_dst=00:01:02:03:04:05 dl_type=0x1234 vlan_tci=0x0000
> OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:5678
> +priority=0 metadata=0 in_port=0 dl_src=00:10:20:30:40:50 dl_dst=00:01:02:03:04:05 dl_type=0x5678 vlan_tci=0x0000
> OFPT_BARRIER_REPLY:
> ])
>
> @@ -773,7 +773,7 @@ ovs-appctl -t ovs-ofctl exit
>
> AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
> NXT_PACKET_IN: total_len=14 in_port=NONE metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered)
> -priority:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234
> +priority=0 metadata=0 in_port=0 dl_src=00:10:20:30:40:50 dl_dst=00:01:02:03:04:05 dl_type=0x1234 vlan_tci=0x0000
> OFPT_BARRIER_REPLY:
> ])
>
> --
> 1.7.2.5
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list