This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Hello,

I'm interrested by Diameter Protocol, specially by the way AVP of type IPAddress are encoded: Example: 10.50.54.38 will be (hex) 0a 32 36 26 and octetstring representation will be .26& I would like to know to to convert from xxxx.xxxx.xxxx.xxxx to the octetstring. (I know that the representation must have 12 or 24 long length).

Thank for your share.

asked 25 Feb '14, 07:18

Arkham's gravatar image

Arkham
11112
accept rate: 0%


The "octetstring" is just the binary values as displayed in ASCII, with a '.' period used when it's not a printable ASCII character. So the number 10 in the IP address is the hex byte 0x0a on the wire, and that's not a display-able ASCII character so it shows a period; whereas the number 50 is hex 0x32, which happens to be the ASCII character "2", 0x36 is "6", and 0x26 is "&". But basically those octetstring displays are meaningless for binary data such as an IP Address.

I don't know what you mean by "12 or 24 length" - an IPv4 address is 4 octets big, which is 8 hex characters, or 4 "octetstring" characters; IPv6 is 16 octets, 32 hex chars, and 16 octetstring chars.

permanent link

answered 25 Feb '14, 09:33

Hadriel's gravatar image

Hadriel
2.7k2939
accept rate: 18%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×58
×16
×6

question asked: 25 Feb '14, 07:18

question was seen: 2,605 times

last updated: 25 Feb '14, 09:33

p​o​w​e​r​e​d by O​S​Q​A