SS7 (Signalling System No. 7) point codes in the telecom world are similar to IP addresses in the internet world. In MTP layer 3, the OPC (Originating point code) and DPC (destination point codes) are used for message routing. This is similar to the source and destination IP addresses used for routing in TCP/IP networks.
Although only one international SS7 protocol has been defined by ITU-T, there are many variants of the SS7 protocols. Most of the variants are based on ANSI and ETSI standards. The Chinese and Japanese (TTC) also have their own standards.
For this article, we shall restrict the discussion of SS7 point code conversions to ANSI and ETSI standards only.
ANSI SS7 Point Code
ANSI standard uses 24-bit point codes. They are mostly written in a 24-bit number expressed in decimal or hexadecimal or represented using the 8-8-8
format. So if the point code is represented by a 24-bit decimal number, let’s say 8327732
, it has to be first converted to binary.
1 |
8327732 (decimal) = 11111110001001000110100 (binary) |
The binary representation for 8327732
is 1111111 00010010 00110100
. Since the binary representation is only 23-bits in length, we will need to perform zero padding to convert it to 24-bits. We then have to split the binary numbers into three groups of 8-bits for the 8-8-8
format.
1 |
11111110001001000110100 = (01111111)(00010010)(00110100) |
If we convert each of the 3 groups of 8-bit numbers to decimal, we will get 127-18-52
. This is the 8-8-8
representation of point code 8327732
.
1 |
(01111111)(00010010)(00110100) = (127)(18)(52) |
To convert from 8-8-8
format to 24-bit format, we will have to reverse the logic. We convert each of the 3 numbers to binary, pad them with zeros if necessary to form 8-bit binary numbers, concatenate them and convert the 24-bit binary number back to decimal format.
ETSI SS7 Point Code
ETSI standard uses 14-bit point codes. Similar to ANSI formats, they are either written as a single 14-bit number expressed in decimal or hexadecimal or more commonly represented using the 3-8-3
format. Let’s go through one example for point codes in ETSI format. Let’s say you have a ETSI point code, 10643
, that is a 14-bit decimal point code. To convert the point code into 3-8-3
format, we first convert the point code into binary, that is 10100110010011
.
1 |
10643 (decimal) = 10100110010011 (binary) |
If the binary representation is not 14-bits in length, we will need to perform 0-padding till we get 14-bits. We will then need to split the binary digits into groups of 3-bits, 8-bits and 3-bits.
1 |
10100110010011 = (101)(00110010)(011) |
Once we have grouped the binary numbers, we convert each group to decimal. This will become 5-50-3
.
1 |
(101)(00110010)(011) = (5)(50)(3) |
So pointcode 10643
(in 14-bit decimal format) can be represented as 5-50-3
, which is in 3-8-3
format.
Besides the populat 3-8-3
point code format, there are other similar formats as well. Namely the 4-3-4-3
and 4-3-7
formats. So before converting a point code, you will need to know the point code format type and whether it’s based on ANSI or ETSI standards.