Switch is dropping packets sent from the controller. Don't know why.

  • 2 Replies
  • 1462 Views
*

Carlos Ferreira

  • Newbie
  • *
  • 12
    • View Profile
Hello to all

I'm using the Ryu controller to implement an OpenFlow Application. My application implements a simple DHCP service and for that, it answers to Discovery and Request DHCP packets sent from clients, with Offer and Ack.
The implemented code works well with Mininet, but for some reason, it does not work with the Zodiac FX.

To debug this issue, I have captured the data traffic between the controller and the switch using wireshark, and I see the OFPT_PACKET_OUT being sent to the switch with the properly built DHCP packets.
But for some reason unknown to me, the PC running the DHCP client, is not receiving those DHCP packets. I'm also running wireshark on the client PC, and the DHCP packets coming from the controller are not received.

EDIT: The only reason that I remember for this not to be working, may be because the DHCP packets which are being injected in the network, do not use the zodiac fx interface MAC address as the Ethernet Source MAC address. The DHCP packets use an administrative tailored MAC address. Could the Switch be dropping the packets because of this? And if so, why does it do that?

Can anyone provide me some assistance?
Thank you!


2nd EDIT:
To provide some more info, I leave here the output of the DHCP offer sent by the Ryu application to the switch.
Code: [Select]
Frame 734: 477 bytes on wire (3816 bits), 477 bytes captured (3816 bits) on interface 0
    Interface id: 0 (enp0s20f0u7u3)
        Interface name: enp0s20f0u7u3
    Encapsulation type: Ethernet (1)
    Arrival Time: Oct 31, 2017 11:48:27.649334071 WET
    [Time shift for this packet: 0.000000000 seconds]
    Epoch Time: 1509450507.649334071 seconds
    [Time delta from previous captured frame: 0.035647320 seconds]
    [Time delta from previous displayed frame: 0.038531233 seconds]
    [Time since reference or first frame: 616.724347049 seconds]
    Frame Number: 734
    Frame Length: 477 bytes (3816 bits)
    Capture Length: 477 bytes (3816 bits)
    [Frame is marked: False]
    [Frame is ignored: False]
    [Protocols in frame: eth:ethertype:ip:tcp:openflow:openflow_v4:eth:ethertype:ip:udp:bootp]
    [Coloring Rule Name: TCP]
    [Coloring Rule String: tcp]
Ethernet II, Src: RealtekS_53:44:58 (00:e0:4c:53:44:58), Dst: Northbou_08:e7 (70:b3:d5:6c:d8:e7)
    Destination: Northbou_08:e7 (70:b3:d5:6c:d8:e7)
        Address: Northbou_08:e7 (70:b3:d5:6c:d8:e7)
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
        .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
    Source: RealtekS_53:44:58 (00:e0:4c:53:44:58)
        Address: RealtekS_53:44:58 (00:e0:4c:53:44:58)
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
        .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
    Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.100.2, Dst: 192.168.100.101
    0100 .... = Version: 4
    .... 0101 = Header Length: 20 bytes (5)
    Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
        0000 00.. = Differentiated Services Codepoint: Default (0)
        .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
    Total Length: 463
    Identification: 0xe00b (57355)
    Flags: 0x02 (Don't Fragment)
        0... .... = Reserved bit: Not set
        .1.. .... = Don't fragment: Set
        ..0. .... = More fragments: Not set
    Fragment offset: 0
    Time to live: 64
    Protocol: TCP (6)
    Header checksum: 0x0f65 [correct]
    [Header checksum status: Good]
    [Calculated Checksum: 0x0f65]
    Source: 192.168.100.2
    Destination: 192.168.100.101
    [Source GeoIP: Unknown]
    [Destination GeoIP: Unknown]
Transmission Control Protocol, Src Port: 6631, Dst Port: 62719, Seq: 15325, Ack: 14777, Len: 423
    Source Port: 6631
    Destination Port: 62719
    [Stream index: 0]
    [TCP Segment Len: 423]
    Sequence number: 15325    (relative sequence number)
    [Next sequence number: 15748    (relative sequence number)]
    Acknowledgment number: 14777    (relative ack number)
    0101 .... = Header Length: 20 bytes (5)
    Flags: 0x018 (PSH, ACK)
        000. .... .... = Reserved: Not set
        ...0 .... .... = Nonce: Not set
        .... 0... .... = Congestion Window Reduced (CWR): Not set
        .... .0.. .... = ECN-Echo: Not set
        .... ..0. .... = Urgent: Not set
        .... ...1 .... = Acknowledgment: Set
        .... .... 1... = Push: Set
        .... .... .0.. = Reset: Not set
        .... .... ..0. = Syn: Not set
        .... .... ...0 = Fin: Not set
        [TCP Flags: ·······AP···]
    Window size value: 55896
    [Calculated window size: 55896]
    [Window size scaling factor: -1 (unknown)]
    Checksum: 0x0aaf [unverified]
    [Checksum Status: Unverified]
    Urgent pointer: 0
    [SEQ/ACK analysis]
        [Bytes in flight: 423]
        [Bytes sent since last PSH flag: 423]
    TCP payload (423 bytes)
    [PDU Size: 423]
OpenFlow 1.3
    Version: 1.3 (0x04)
    Type: OFPT_PACKET_OUT (13)
    Length: 423
    Transaction ID: 3272150592
    Buffer ID: OFP_NO_BUFFER (4294967295)
    In port: 2
    Actions length: 16
    Pad: 000000000000
    Action
        Type: OFPAT_OUTPUT (0)
        Length: 16
        Port: OFPP_IN_PORT (4294967288)
        Max length: 65509
        Pad: 000000000000
    Data
        Ethernet II, Src: fe:ff:ff:ff:ff:ff (fe:ff:ff:ff:ff:ff), Dst: AsustekC_ab:be:83 (e0:cb:4e:ab:be:83)
            Destination: AsustekC_ab:be:83 (e0:cb:4e:ab:be:83)
                Address: AsustekC_ab:be:83 (e0:cb:4e:ab:be:83)
                .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
                .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
            Source: fe:ff:ff:ff:ff:ff (fe:ff:ff:ff:ff:ff)
                Address: fe:ff:ff:ff:ff:ff (fe:ff:ff:ff:ff:ff)
                .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
                .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
            Type: IPv4 (0x0800)
        Internet Protocol Version 4, Src: 10.0.0.1, Dst: 10.0.0.3
            0100 .... = Version: 4
            .... 0101 = Header Length: 20 bytes (5)
            Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
                0000 00.. = Differentiated Services Codepoint: Default (0)
                .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
            Total Length: 369
            Identification: 0x0001 (1)
            Flags: 0x00
                0... .... = Reserved bit: Not set
                .0.. .... = Don't fragment: Not set
                ..0. .... = More fragments: Not set
            Fragment offset: 0
            Time to live: 64
            Protocol: UDP (17)
            Header checksum: 0x6578 [correct]
            [Header checksum status: Good]
            [Calculated Checksum: 0x6578]
            Source: 10.0.0.1
            Destination: 10.0.0.3
            [Source GeoIP: Unknown]
            [Destination GeoIP: Unknown]
        User Datagram Protocol, Src Port: 67, Dst Port: 68
            Source Port: 67
            Destination Port: 68
            Length: 349
            Checksum: 0x0a99 [correct]
                [Calculated Checksum: 0x0a99]
            [Checksum Status: Good]
            [Stream index: 10]
        Bootstrap Protocol (Offer)
            Message type: Boot Reply (2)
            Hardware type: Ethernet (0x01)
            Hardware address length: 6
            Hops: 0
            Transaction ID: 0x07c4276c
            Seconds elapsed: 0
            Bootp flags: 0x0000 (Unicast)
                0... .... .... .... = Broadcast flag: Unicast
                .000 0000 0000 0000 = Reserved flags: 0x0000
            Client IP address: 0.0.0.0
            Your (client) IP address: 10.0.0.3
            Next server IP address: 10.0.0.1
            Relay agent IP address: 0.0.0.0
            Client MAC address: AsustekC_ab:be:83 (e0:cb:4e:ab:be:83)
            Client hardware address padding: 00000000000000000000
            Server host name: 00000000-0000-0000-0000-000000000001
            Boot file name not given
            Magic cookie: DHCP
            Option: (53) DHCP Message Type (Offer)
                Length: 1
                DHCP: Offer (2)
            Option: (1) Subnet Mask
                Length: 4
                Subnet Mask: 255.0.0.0
            Option: (6) Domain Name Server
                Length: 4
                Domain Name Server: 10.0.0.1
            Option: (6) Domain Name Server
                Length: 4
                Domain Name Server: 8.8.8.8
            Option: (54) DHCP Server Identifier
                Length: 4
                DHCP Server Identifier: 10.0.0.1
            Option: (12) Host Name
                Length: 38
                Host Name: 2.00000000-0000-0000-0000-000000000001
            Option: (3) Router
                Length: 4
                Router: 10.0.0.1
            Option: (15) Domain Name
                Length: 7
                Domain Name: archsdn
            Option: (51) IP Address Lease Time
                Length: 4
                IP Address Lease Time: (43200s) 12 hours
            Option: (58) Renewal Time Value
                Length: 4
                Renewal Time Value: (21600s) 6 hours
            Option: (59) Rebinding Time Value
                Length: 4
                Rebinding Time Value: (37800s) 10 hours, 30 minutes
            Option: (255) End
                Option End: 255

« Last Edit: November 01, 2017, 03:41:52 AM by Claymore »

*

Carlos Ferreira

  • Newbie
  • *
  • 12
    • View Profile
Re: Switch is dropping packets sent from the controller. Don't know why.
« Reply #1 on: November 01, 2017, 03:41:31 AM »
It seems that I have solved my issue.

I was misusing the OFPAT_OUTPUT action.
Instead of passing the same input port, used in the OFPT_PACKET_OUT header, I was mistakenly using the OFPP_IN_PORT. Because of this, the packet was being sent to Port 0 and Port Broadcast.
This is why it worked on mininet, but not on the Zodiac FX, since the PC was connected to port 1.

*

Paul Zanna

  • Moderator
  • Sr. Member
  • *****
  • 367
    • View Profile
    • Northbound Networks
Re: Switch is dropping packets sent from the controller. Don't know why.
« Reply #2 on: November 01, 2017, 01:18:20 PM »
I'm glad you found the issue, I was going to recommend taking a look at the debug trace output to see if that helped.

Regards,
Paul