Class: PacketGen::Header::SCTP::SackChunk

Inherits:
BaseChunk show all
Defined in:
lib/packetgen/header/sctp/chunk.rb

Overview

Selective Acknowledge Chunk

       0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Type = 3    |  Chunk Flags  |         Chunk Length          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Cumulative TSN Ack                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Advertised Receiver Window Credit (a_rwnd)           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Gap Ack Blocks = N  |  Number of Duplicate TSNs = M |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Gap Ack Block #1 Start     |     Gap Ack Block #1 End      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                                                               /
\                              ...                              \
/                                                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Gap Ack Block #N Start     |     Gap Ack Block #N End      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Duplicate TSN 1                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                                                               /
\                              ...                              \
/                                                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Duplicate TSN M                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Author:

  • Sylvain Daubert

Since:

  • 3.4.0

Constant Summary

Constants inherited from BaseChunk

BaseChunk::TYPES

Instance Attribute Summary collapse

Attributes inherited from BaseChunk

#length, #type

Instance Method Summary collapse

Methods inherited from BaseChunk

#calc_length, #human_type, #to_human

Methods included from Padded32

#padded?, #to_s

Methods inherited from Base

bind, calculate_and_set_length, #header_id, inherited, #ip_header, #ll_header

Methods included from PacketGen::Headerable

#added_to_packet, included, #method_name, #packet, #packet=, #parse?, #protocol_name, #read

Methods inherited from Types::Fields

#[], #[]=, #bits_on, define_bit_fields_on, define_field, define_field_after, define_field_before, #fields, fields, inherited, #inspect, #offset_of, #optional?, #optional_fields, #present?, #read, remove_bit_fields_on, remove_field, #sz, #to_h, #to_s, update_field

Constructor Details

#initialize(options = {}) ⇒ SackChunk

Returns a new instance of SackChunk.

Since:

  • 3.4.0



341
342
343
344
# File 'lib/packetgen/header/sctp/chunk.rb', line 341

def initialize(options={})
  options[:type] = BaseChunk::TYPES['SACK'] unless options.key?(:type)
  super
end

Instance Attribute Details

#a_rwndInteger

32-bit Advertised Receiver Window Credit

Returns:

  • (Integer)


322
# File 'lib/packetgen/header/sctp/chunk.rb', line 322

define_field :a_rwnd, Types::Int32

#ctsn_ackInteger

32-bit Cumulative TSN Ack

Returns:

  • (Integer)


318
# File 'lib/packetgen/header/sctp/chunk.rb', line 318

define_field :ctsn_ack, Types::Int32

#dup_tsnsTypes::ArrayOfInt32

Array of 32-bit Duplicate TSNs.

Returns:



339
# File 'lib/packetgen/header/sctp/chunk.rb', line 339

define_field :dup_tsns, Types::ArrayOfInt32

#gapsTypes::ArrayOfInt32

Array of 32-bit Integers, encoding boudaries of a Gap Ack Block. 16 most significant bits encode block start. 16 least significant bits encode block end.

Returns:



335
# File 'lib/packetgen/header/sctp/chunk.rb', line 335

define_field :gaps, Types::ArrayOfInt32

#num_dup_tsnInteger

16-bit Number of Duplicate TSNs

Returns:

  • (Integer)


330
# File 'lib/packetgen/header/sctp/chunk.rb', line 330

define_field :num_dup_tsn, Types::Int32

#num_gapInteger

16-bit Number of Gap Ack Blocks

Returns:

  • (Integer)


326
# File 'lib/packetgen/header/sctp/chunk.rb', line 326

define_field :num_gap, Types::Int32