priority-tagged icmp pkts generated from vrouter node getting corrupted

Bug #1645653 reported by Vedamurthy Joshi on 2016-11-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.2
New
Medium
Anand H. Krishnan
Trunk
Fix Committed
Medium
Anand H. Krishnan

Bug Description

R3.2 Build 1

If priority-tagged icmp requests are made to vhost IP, icmp responses are created fine.

But if priority-tagged icmp requests are made from the vhost node(using scapy in this case), the request is not understood by the recepient(corrupt pkt)

Server1 : 10.204.217.194( MAC : 52:54:00:01:00:01)
Vrouter node : 10.204.217.205 ( MAC : 52:54:00:13:df:eb)

>>> ls(e1/dot1q/ip/icmp)
dst : DestMACField = '52:54:00:13:df:eb' (None)
src : SourceMACField = '52:54:00:01:00:01' (None)
type : XShortEnumField = 33024 (0)
--
prio : BitField = 5 (0)
id : BitField = 0 (0)
vlan : BitField = 0 (1)
type : XShortEnumField = 2048 (0)
--
version : BitField = 4 (4)
ihl : BitField = None (None)
tos : XByteField = 0 (0)
len : ShortField = None (None)
id : ShortField = 1 (1)
flags : FlagsField = 0 (0)
frag : BitField = 0 (0)
ttl : ByteField = 64 (64)
proto : ByteEnumField = 1 (0)
chksum : XShortField = None (None)
src : Emph = '10.204.217.194' (None)
dst : Emph = '10.204.217.205' ('127.0.0.1')
options : PacketListField = [] ([])
--
type : ByteEnumField = 8 (8)
code : MultiEnumField = 0 (0)
chksum : XShortField = None (None)
id : ConditionalField = 0 (0)
seq : ConditionalField = 0 (0)
ts_ori : ConditionalField = 24561114 (24561114)
ts_rx : ConditionalField = 24561114 (24561114)
ts_tx : ConditionalField = 24561114 (24561114)
gw : ConditionalField = '0.0.0.0' ('0.0.0.0')
ptr : ConditionalField = 0 (0)
reserved : ConditionalField = 0 (0)
addr_mask : ConditionalField = '0.0.0.0' ('0.0.0.0')
unused : ConditionalField = 0 (0)
>>> sendp(e1/dot1q/ip/icmp)

As seen on receiver :
12:57:18.094269 52:54:00:01:00:01 > 52:54:00:13:df:eb, ethertype 802.1Q (0x8100), length 60: vlan 0, p 5, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto ICMP (1), length 28)
    10.204.217.194 > 10.204.217.205: ICMP echo request, id 0, seq 0, length 8
 0x0000: 5254 0013 dfeb 5254 0001 0001 8100 a000
 0x0010: 0800 4500 001c 0001 0000 4001 b1b8 0acc
 0x0020: d9c2 0acc d9cd 0800 f7ff 0000 0000 0000
 0x0030: 0000 0000 0000 0000 0000 0000
12:57:18.094498 52:54:00:13:df:eb > 52:54:00:01:00:01, ethertype IPv4 (0x0800), length 42: (tos 0x0, ttl 63, id 16002, offset 0, flags [none], proto ICMP (1), length 28)
    10.204.217.205 > 10.204.217.194: ICMP echo reply, id 0, seq 0, length 8
 0x0000: 5254 0001 0001 5254 0013 dfeb 0800 4500
 0x0010: 001c 3e82 0000 3f01 7437 0acc d9cd 0acc
 0x0020: d9c2 0000 ffff 0000 0000

---------------------------------------------------------
When icmp req is initiated from vrouter-node :

>>> ls(e1/dot1q/ip/icmp)
dst : DestMACField = '52:54:00:01:00:01' (None)
src : SourceMACField = '52:54:00:13:df:eb' (None)
type : XShortEnumField = 33024 (0)
--
prio : BitField = 6 (0)
id : BitField = 0 (0)
vlan : BitField = 0 (1)
type : XShortEnumField = 2048 (0)
--
version : BitField = 4 (4)
ihl : BitField = None (None)
tos : XByteField = 0 (0)
len : ShortField = None (None)
id : ShortField = 1 (1)
flags : FlagsField = 0 (0)
frag : BitField = 0 (0)
ttl : ByteField = 64 (64)
proto : ByteEnumField = 1 (0)
chksum : XShortField = None (None)
src : Emph = '10.204.217.205' (None)
dst : Emph = '10.204.217.194' ('127.0.0.1')
options : PacketListField = [] ([])
--
type : ByteEnumField = 8 (8)
code : MultiEnumField = 0 (0)
chksum : XShortField = None (None)
id : ConditionalField = 0 (0)
seq : ConditionalField = 0 (0)
ts_ori : ConditionalField = 26882793 (26882793)
ts_rx : ConditionalField = 26882793 (26882793)
ts_tx : ConditionalField = 26882793 (26882793)
gw : ConditionalField = '0.0.0.0' ('0.0.0.0')
ptr : ConditionalField = 0 (0)
reserved : ConditionalField = 0 (0)
addr_mask : ConditionalField = '0.0.0.0' ('0.0.0.0')
unused : ConditionalField = 0 (0)
>>> sendp(e1/dot1q/ip/icmp)
.

receiver:
root@testbed-1-vm1:~# tcpdump -ni eth0 icmp -vv -xx -e
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
13:11:54.525846 52:54:00:13:df:eb > 52:54:00:01:00:01, ethertype IPv4 (0x0800), length 60: IP12 bad-hlen 0
 0x0000: 5254 0001 0001 5254 0013 dfeb 0800 c000
 0x0010: 0800 4500 001c 0001 0000 3f01 b2b8 0acc
 0x0020: d9cd 0acc d9c2 0800 f7ff 0000 0000 0000
 0x0030: 0000 0000 0000 0000 0000 0000
^C
1 packet captured
3 packets received by filter
0 packets dropped by kernel
root@testbed-1-vm1:~#

Sender:

root@localhost:~# tcpdump -ni eth0 icmp -vv and host 10.204.217.205 -xx
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
13:11:17.335587 IP12 bad-hlen 0
 0x0000: 5254 0001 0001 5254 0013 dfeb 0800 c000
 0x0010: 0800 4500 001c 0001 0000 3f01 b2b8 0acc
 0x0020: d9cd 0acc d9c2 0800 f7ff 0000 0000

-----------------------------------------------------------------------------

Changed in juniperopenstack:
milestone: none → r4.0

Review in progress for https://review.opencontrail.org/30159
Submitter: Anand H. Krishnan (<email address hidden>)

Reviewed: https://review.opencontrail.org/30159
Committed: http://github.com/Juniper/contrail-vrouter/commit/b42b94bc4bca8f381387829f6cef14bce890c7be
Submitter: Zuul (<email address hidden>)
Branch: master

commit b42b94bc4bca8f381387829f6cef14bce890c7be
Author: Anand H. Krishnan <email address hidden>
Date: Wed Apr 5 11:48:24 2017 +0530

Do not overwrite the ethernet protocol if no rewrite was applied

For IP/IPv6 packets from vhost, no rewrite is applied. Hence, if
the packet has vlan headers, we end up overwriting the ether type
field of the packet to v4 or v6 depending on the layer 3 protocol
of the packet, resulting in wrong protocol type.

Change-Id: I38df332e95cdad79cf1e0bc946ed2c7c3e0ef526
Closes-Bug: #1645653

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers