Part 1 - In which I introduce SS7
Way back in the olden days, telephone switches were run by (usually) women with big boards where plugs on retractable reels of wire would be plugged in to connect the calls. There once was a man named Strowager, who was an undertaker. It so happened that the wife of his main competitor [apparenlty there is competition for dead people; who knew?] worked at the local exchange for his town.
Strowager became convinced that said wife was connecting calls for Strowager to her husband instead, so he went off, as you do, and invented the automatic telephone exchange. There's a beautifully reconstructed one at Motat, for those Aucklanders who haven't seen it, in which you can call between phones in the room and watch it run.
Fast forward a bit to the two Steves, who made their money originally by selling "blue boxes". Blue boxes transmitted a series of tones into the line which would make the local switch think the next call was a maintenance test call, and give it away for free. We in the industry of course think that giving away free calls is a Bad Thing, so something had to be done.
The result was the introduction of SS7 - Signaling System no. 7. Yes, I'm pretty sure there was an SS6. No, I don't know about SS1-5, I don't think they existed. Maybe it was like dBase II, which was actually the first one, but I digress.
SS7 loosely follows the OSI layered architecture. It took the signaling out of band - amongst other things this means blue boxes don't work any more.
MTP1
MTP stands for Message Transfer Part [not Protocol]. In the OSI architecture, MTP1 is the physical layer. This layer defines the physical aspects of the E1, which is the basic digital trunk used in most parts of the world. Not much more needs to be discussed about MTP1, it's a wire.
MTP2
MTP2 is the link layer protocol. It introduces a very important identifier: the Point Code. In the ITU flavour of MTP, the point code is 14 bits long. The astute reader will note that this means there can only be a relatively small number of PCs in the whole world. So in addition to that there is also another indicator field which classifies the PC as international, national active or national standby.
International PCs have a different format to national ones. New Zealand has only a handful (something like 10, although I don't remember exactly how many) of international PCs allocated to it's gateways. Generally 2 per international gateway.
In the national network the use of the standby PC is useful when the signaling point in question does not need to be visible outside the network. A BSC, for example, would probably have a national standby PC.
In any case that means that within each country, a further bunch of codes are available. Enough to go around, anyway.
MTP2 provides instant detection of link faults. While idling, special packets are sent to continously fill the line. Should either end stop receiving them, they will know within milliseconds that there is a problem. Spanning tree on Ethernet typically needs about 30s to switch over, so in some respects MTP was well ahead of it's time.
MTP3
MTP3 is the network layer protocol. When PC A wishes to signal to PC B, MTP3 takes care of routing between A and B. A and B could be directly connected, or they may be connected via one or more STPs - Signaling Transfer Points - which are, essentially, SS7 routers.
What if A and B are in different countries? A and B can only route to each other if they have international PCs, right? Because otherwise they could have the same national PC. It turns out that that isn't a problem for a voice call.
Nevertheless, MTP3 includes message types that possibly can go between switches that are not physically connected, so it does perform routing functions. Routing tables are generally quite static - telephone switches don't tend to come and go - with failover being the main automatic routing function.
The E1 is divided into 32 64kbps channels. One is reserved for timing synch, leaving 31 available for traffic including signaling. Traditionally timeslot 16 is used for SS7 if there are voice channels on the trunk, but MTP could use all of it. High capacity signaling nodes such as the HLR or IN may do so.
Each timeslot used is designated a Signaling Link, identified by a Signaling Link Code. A collection of Signaling Links is a Linkset, and Linksets may be combined into MTP routes. In this way many slow channels are combined into a quicker logical one, with great allowances for redundancy - since without signaling, there are no phone calls.
MTP is in the process of being largely replaced by SIGTRAN - SIGnaling TRANsport - which provides IP versions of MTP2 and MTP3, depending on the situation. Since SIGTRAN runs on IP networks - typically gigabit ethernet - we are no longer constrained to have lots of 2Mb cables between boxes to get reasonable signaling capacity. A pair of CAT6 cables (for redundancy) does the job for even the biggest beasts. The higher layers of the stack see the lower SIGTRAN layers as if they were traditional MTP, and are unchanged.
Most of our systems at 2degrees are connected via SIGTRAN. Only a few use MTP for various not very important reasons.
TUP/ISUP
TUP - Telephony User Part, ISUP - ISDN User Part
A short digression to explain why I don't need everyone to have an international PC to make an international voice call.
TUP is no longer widely used, having been supplanted by ISUP, so I won't talk about it here, although it basically works the same way.
When an ISUP switch ("local office") in Auckland wants to place a voice call to a number in Australia, it analyses the number in it's routing tables and comes up with the point code of another switch that can connect it. The second switch likely has no endpoints - no phones - and in that case is known as a transit switch. The transit switch will do the same, and so on, until the call reaches an international switch.
The international switch passes the call to the next international switch, where it may go through several hops (although to Australia it typically wouldn't of course) and then into Australian transit switches, and finally to the destination local office which will make someone's phone ring.
The ISUP call starts with a message called IAM - Initial Address Message. It contains all the information about the calling party (CgPty) and some but not necessarily all of the information about the called party. This is to allow for people with slow fingers on POTS phones. For now we'll ignore SAMs. One particularly important part of the ISUP messaging is the CIC, the Circuit Identification Code, which the switches use to pick a trunk for the voice channel.
The IAM is passed along to the next switch and so on until it arrives at the destination. The destination checks the number is correct and passes back an Address Complete Message. At this point, the phone begins to ring. ACM is passed back along the chain to the originating switch.
When the CdPty goes off hook, the destination sends back Answer Message (ANM). As each switch in the train receives the ANM, they connect through their respective trunks and the voice circuit forms. Also, they begin timing the call for the purposes of billing.
Good times are had by all until someone hangs up. Whichever end that is initiates a Release (REL) message which is passed along the chain until the other end gets it, deallocates the trunk, stops the billing timer, and then sends back Release Complete (RLC). This goes back the other way and all the other trunks are torn down.
In this manner, it is not necessary for the Auckland local office to know any international PCs, and likewise for the Australian local office. They only need to know the PC of the next transit switch, and the entire signaling conversation is between adjacent switches.
The local NZ version of ISUP is known as PTC331 and all NZ carriers are required to abide by it. It's a subset of ITU ISUP dropping lots of stuff that isn't often used.
SCCP and TCAP
So, it's fine for basic voice that not everyone have an international PC. But what if I want to send an SMS? ISUP is for voice calls, and MTP3 can't tell me anything about the relationship between a phone number and a Point Code.
As new desired applications appeared - the first big driver being tollfree (0800/0508) calling - MTP's limitations becamse clear. Thus two new protocols were introduced - Signaling Connection Control Part and Transaction Capabilities Application Part.
You can think of SCCP as a new network layer protocol that uses all of MTP as the link layer. It has two important parameters, the Global Title, and the SubSystem Number.
SCCP allows direct communication between two signaling points no matter where they are in the world. It's the backbone of high level telephony - mobile would not exist without it, and certainly not international roaming.
The GT looks just like a phone number. In fact, the Service Centre Number configured into your handset for SMS is a GT. It's the GT of our SMSC. GTs may be physical - one GT = one machine - or they may be virtual - one GT = many machines. The translation between GT and PC is peformed by the STP. Being effectively a phone number, it is globally unique - hence the name - and routable around the world.
The SSN is an identifier for the application - like the TCP port number. Multiple applications could run on the same device (also like TCP/IP), and in that case they would have different SSNs. SSN 6 is an HLR, 8 is an MSC, 146 is CAMEL.
TCAP allows for an end to end transaction to occur. SCCP transports TCAP from point to point; TCAP allows an application to perform a dialogue. The dialogue could be a simple request and response, or it may be an ongoing conversation - for example CAMEL uses a dialogue that lasts for the duration of a call. Unique dialogues are identified by TCAP dialog IDs at each end.
I'll end this post here by saying, ready for next time, that SCCP allows one machine to address another anywhere in the world, and TCAP allows them to converse reliably.