Contents

PacketOut

@open_flow13

Scenario: new

  • When I create an OpenFlow message with:
    Pio::PacketOut.new
  • Then the message has the following fields and values:
    fieldvalue
    version4
    to_binary.length24
    transaction_id0
    xid0
    buffer_id:no_buffer
    in_port0
    actions_length0
    raw_data.length0

Scenario: new (actions = SendOutPort(1), raw_data = ARP Request)

  • When I create an OpenFlow message with:
    data_dump = [
      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xac, 0x5d, 0x10, 0x31, 0x37,
      0x79, 0x08, 0x06, 0x00, 0x01, 0x08, 0x00, 0x06, 0x04, 0x00, 0x01,
      0xac, 0x5d, 0x10, 0x31, 0x37, 0x79, 0xc0, 0xa8, 0x02, 0xfe, 0xff,
      0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xa8, 0x02, 0x05, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00
    ].pack('C*')
    
    Pio::PacketOut.new(raw_data: data_dump, actions: Pio::SendOutPort.new(1))
  • Then the message has the following fields and values:
    fieldvalue
    version4
    to_binary.length100
    transaction_id0
    xid0
    buffer_id:no_buffer
    in_port0
    actions_length16
    raw_data.length60
    data.classPio::Arp::Request
    destination_macff:ff:ff:ff:ff:ff
    source_macac:5d:10:31:37:79
    ether_type2054
    hardware_type1
    protocol_type2048
    hardware_length6
    protocol_length4
    operation1
    sender_hardware_addressac:5d:10:31:37:79
    sender_protocol_address192.168.2.254
    target_hardware_addressff:ff:ff:ff:ff:ff
    target_protocol_address192.168.2.5

Source: features/open_flow13/packet_out.feature at commit 40dd0fb6, Pio (GPL license).