code: def to_bytes(self):
          '''
          Create bytes from properties
          '''
          # Verify that the properties make sense
          self.sanitize()
  
          # Write the next header type
          bitstream = BitStream('uint:8=%d' % self.next_header)
  
          # Add the reserved bits
          bitstream += BitStream(8)
  
          # Add the fragment offset
          bitstream += BitStream('uint:13=%d' % self.fragment_offset)
  
          # Add the reserved bits
          bitstream += BitStream(2)
  
          # Add the flags
          bitstream += BitStream('bool=%d' % self.more_fragments)
  
          # Add the identification
          bitstream += BitStream('uint:32=%d' % self.identification)
  
          return bitstream.bytes + bytes(self.payloadf to_bytes(self):
          '''
          Create bytes from properties
          '''
          # Verify that the properties make sense
          self.sanitize()
  
          # Write the next header type
          bitstream = BitStream('uint:8=%d' % self.next_header)
  
          # Add the reserved bits
          bitstream += BitStream(8)
  
          # Add the fragment offset
          bitstream += BitStream('uint:13=%d' % self.fragment_offset)
  
          # Add the reserved bits
          bitstream += BitStream(2)
  
          # Add the flags
          bitstream += BitStream('bool=%d' % self.more_fragments)
  
          # Add the identification
          bitstream += BitStream('uint:32=%d' % self.identification)
  
          return bitstream.bytes + bytes(self.payload)
docs: Create bytes from properties