Sunday, 22 March 2015

SS 7 Learnings

Unix Basics commands

Unix Examples:

cat CPStranssuccess.txt |awk -F, '{print $1","$2",375,"$4",Synaxis2100,-1,"$7",,55783,,"$16",,3,,,"} > OCG375promo.txt
=========================================================================
16:24:53 [RKARM1:~]$ cat validate
clear
dt=`date +'%m%d'`
echo "*******************************************************************************************************"
ssh rkscl1 /opt/redknee/dist/validate/voice $dt
echo
echo "======================================================================================================="
echo "*******************************************************************************************************"
echo "======================================================================================================="
ssh rkscl2 /opt/redknee/dist/validate/voice $dt
echo "*******************************************************************************************************"
echo
echo
echo "Hit any key for SMS..."
read line
clear
echo "*******************************************************************************************************"
ssh rkscl1 /opt/redknee/dist/validate/sms $dt
echo
echo "======================================================================================================="
echo "*******************************************************************************************************"
echo "======================================================================================================="
ssh rkscl2 /opt/redknee/dist/validate/sms $dt
echo "*******************************************************************************************************"
echo
echo
echo "Hit any key for CPS..."
read line
clear
echo "*******************************************************************************************************"
ssh rksdp1a /opt/redknee/dist/validate/generateChargingResultReport `date +'%Y%m%d'`
echo
echo
echo "======================================================================================================="
echo "*******************************************************************************************************"


16:26:06 [RKSCL1:/opt/redknee/dist/validate]$ cat voice
dt=$1
echo
echo "Voice Analysis : " `hostname`
echo "=============="
echo "Analysis of Disconnect code:"
cd /opt/redknee/app/osa/ecp/log/er
cat *$dt* | grep -i disconnect | awk -F, '{print $12}' |sort|uniq -c
echo ""
a=`cat *$dt* | grep -i disconnect | awk -F, '$13>0' |wc -l`
echo "Number of calls with duration >0 : "$a
a=`cat *$dt* | grep -i disconnect | awk -F, '$13>0{print $13}' |sort -n | tail -1`
echo "Max duration of call so far : "$a
echo ""
echo "Critical error observed:"
cat /opt/redknee/app/osa/ecp/log/snmp/snmp.log* | grep CRITICAL
echo ""

16:28:16 [RKSCL1:/opt/redknee/dist/validate]$ cat sms
dt=$1
echo
echo "SMS Analysis : " `hostname`
echo "=============="
cd /opt/redknee/app/smshub/log/er
a=`cat *$dt* |awk -F, '$3==473&&$7=="0x80000004"&&$29==0' | wc -l`
echo "Successfully submited and rated SMS : "$a
a=`cat *$dt* |awk -F, '$3==473&&$7=="0x80000004"&&$29!=0' | wc -l`
echo "Failed to rate and charge the submited SMS : "$a
echo "Analysis of submit failure:"
cat *$dt* | awk -F, '$3==473&&$7=="0x80000004"{print $29}' |sort|uniq -c
echo ""
a=`cat *$dt* |awk -F, '$3==473&&$7=="0x80000007"&&$29==0' | wc -l`
echo "Number of SMS successfully delivered : "$a
a=`cat *$dt* |awk -F, '$3==473&&$7=="0x80000007"&&$29!=0' | wc -l`
echo "Number of SMS failed to deliver : "$a
echo ""
echo "Critical error observed:"
cat /opt/redknee/app/smshub/log/snmp/snmp.log* | grep CRITICAL
echo ""
=============================================================

How to use substring function using awk


e.g Input file.

14:43:33 [BINSDP1A:/opt/redknee/app/urcs/migration/PINUPLOAD]$  cat inputPins.txt                                  
77916261|9984
77245577|9988
77910175|9989
77248784|9990


cat inputPins.txt |awk -F\| '{print substr($2,1,3)}'

$2 – 2nd filed
1,3 – start from 1st character and end at 3rd character


14:43:27 [BINSDP1A:/opt/redknee/app/urcs/migration/PINUPLOAD]$  cat inputPins.txt |awk -F\| '{print substr($2,1,3)}'
998
998
998
999

Length and sum function together with awk :

cat inputPins.txt |awk -F\| 'length($2)==8 {SUM += $2} END {print SUM}'
7504688085


cat inputPins.txt |awk 'length($0) > 14' |wc –l

77887916|1234 – 13 characters

77081313|77081313 – more than 13 characters


cat PP.2010031[8-9]* PP.2010032[0-4]* | grep ,290, | awk -F, '$9==0 && $36==0 { SUM += $13} END {print SUM}'



Solaris Important paths

TIP & TRICKS

Wondering if we can replace IPs with hostname while accessing the Nodes, especially while onsite. This way we need not to look up the IP again ‘n again for a node.
We can achieve this by tweaking the windows host file as per below steps

Steps to configure Hostname for remote Node

      I.        Go to path “C:\WINDOWS\system32\drivers\etc” on your Laptop
    II.        Edit the file hosts with notepad
   III.        Update the IPs and corresponding node hostname separated by TAB.
e.g.
172.24.1.103   rkppsiglab
172.24.1.106   rkppapplab
172.24.1.109   rkppdblab
172.24.1.112   rkppcrmlab
172.24.1.115   rkppdatamartlab
172.24.1.48     rkppdatamart

  IV.        Save the changes and you are DONE !!!

Advantages

ü  We can directly put the node hostname while doing FTP from command prompt e.g. ftp rkppsiglab instead of ftp 172.24.1.103
ü  If we are using the other FTP software like FileZilla we can also use Hostname to connect for FTP with node.
ü  Putty : Logon to node using Putty, just put the hostname  under “Host Name (or IP Address)” fill in box and connect.
ü  IP in the GUI URL access to app can also be replaced by the hostname. E.g. http://rkcrm:9260/AppCrm/home

Tip

v  Go to the CRM node of the Customer and cat /etc/hosts file. Copy the configuration and update as in above point#3.

=====================================================================

 
Below are some of the references that be used while configuring the Network Time Protocol (NTP) server for Solaris and Linux Nodes.

For Solaris : When there exists an NTP server on the same subnet
NTP servers broadcast (actually multicast) out NTP updates. All you need to do is copy the default ntp.client into place and start the NTP daemon.
  1. copy /etc/inet/ntp.client to /etc/inet/ntp.conf
cp /etc/inet/ntp.client /etc/inet/ntp.conf
  1. restart the ntp daemon:
    Solaris 10:
svcadm restart ntp
Pre-Solaris 10:
/etc/init.d/xntpd stop
/etc/init.d/xntpd start

When no NTP server on the same subnet
Use this when there is no NTP server on the same subnet. In this case you need the ip address of the NTP server that is going to be used.
  1. Find out what the NTP servers ip address is (it will work with hostname but then relies on DNS to be working).
  2. Create the /etc/inet/ntp.conf and add the server and driftfile.
vi /etc/inet/ntp.conf

server NTPServerIPAddress
driftfile /etc/ntp.drift
  1. restart the ntp daemon:
    Solaris 10:
svcadm restart ntp
Pre-Solaris 10:
/etc/init.d/xntpd stop
/etc/init.d/xntpd start



For Linux : Below are the steps for configuring the NTP server on Linux (PARC) machine.

Login as root

1) Update the server under /etc/ntp.conf  à Configure the server in this file
2) Give command “chkconfig ntpd on” à Enable the NTP
3) Start the NTP “/etc/init.d/ntpd start”  à Start the NTP service
4) Check if the NTP server is reachable or not using “ntpq –p”



=================================================================================

 
To fast convert the Signaling System 7 Point code (SPC) from decimal point code to 14-bit point and vice versa, attached is the Calculator

Logic

It can be calculated manually as per logic below. J

1)    Convert the given DECimal point code to BINary e.g. 12850 à 11001000110010
2)    Divide it into 3 parts starting from last 3 bits, then next 8 bits and then remaining bits e.g. 110 01000110 010
3)    Convert back it from BIN to DEC considering each fragmented part
a.    110                  à        6
b.    01000110        à        70
c.    010                  à        2
4)    The new point code in ITU-14 bit format is 6-70-2.


=====================================================================

1.       Idea is to setup RK hostname as main hostname with no alias to customer hostname.
2.       To display customer hostname on the prompt, we will tweak .kshrc. We need this step to avoid any confusion for PO/R&D who logs in to the multiple customer nodes.

Please find standard hostname setup procedure as follows:


Hostname in /etc/nodename
Hostname setup to main IP
Hostname - App mapping
Hostname - App mapping
Hostname - App mapping
Hostname - App mapping
Hostname - App mapping
RKSGW1
RKSGW1 RKUSSDSG1 RKMSGSG1 RKVOICESG1 RKIVRSC1
RKMSGSG1 : iHUB + SDM
RKUSSDSG1 : USSD-GW
RKVOICESG1 : Callcontrol + OSA-FW
RKIVRSC1 : MVIU + IVP

RKSGW2
RKSGW2 RKUSSDSG2 RKMSGSG2 RKVOICESG2 RKIVRSC2





RKSCL1
RKSCL1 RKUSSDSC1 RKMSGSCL1 RKVOICESCL1 RKDATASCL1
RKMSGSCL1 : Message ID MAP
RKSCL1: MM TFA + MM BalQ
RKVOICESCL1 : ECP + VPN
RKUSSDSC1 : Suite + CMCM + BalQ/BundleQ
RKDATASCL1 : S5600Controller + Radius
RKSCL2
RKSCL2 RKUSSDSC2 RKMSGSCL2 RKVOICESCL2 RKDATASCL2 





RKSDP1A
RKSDP1A RKURCS1 RKURCSPRI
RKSCP1A : CPS + Redstore
RKURCS1 : URCS + OCG + Pin Manager



RKSDP1B
RKSDP1B RKURCS2 RKURCSSEC





RKVMS1
RKVMS1 RKVMGT1 RKMSGSNF1 RKORA1
RKVMS1 : VRA + OVMS + TCB TFA




RKVMS2
RKVMS2 RKVMGT2 RKMSGSNF2 RKORA2





RKCRM
RKCRM RKCRMDB RKINVOICE RKECARE1
RKCRM : CRM + S-HLR + CRM API
RKCRMDB : Oracle
RKINVOICE : Invoice Server


RKARS1
RKARS1
RKARS : MM CRM + MM OCG/BM




RKINBILL1








To interpret above table:
Ø  Hostname mapping against the application is to be setup in
o   Application Configuration
o   RMI Cluster
o   RMI Registry
Ø  All applications will connect to URCS / OCG over hostnames RKURCSPRI,RKURCSSEC
o   ECP1 will connect to RKURCSPRI,RKURCSSEC in its proxy configuration
o   On RKSCL1 node – RKURCSPRI will map to RKURCS1 and RKURCSSEC will map to RKURCS2
§  RKSDP1A RKURCS1 RKURCSPRI
§  RKSDP1B RKURCS2 RKURCSSEC
o   On RKSCL2 node – RKURCSPRI will map to RKURCS2 and RKURCSSEC will map to RKURCS1
§  RKSDP1A RKURCS1 RKURCSSEC
§  RKSDP1B RKURCS2 RKURCSPRI

Ø  /etc/host setup – sample for RKSDP1A
::1     localhost
127.0.0.1       localhost
10.76.10.12     RKSDP1A loghost RKURCS1 RKURCSPRI <Cust>SDP1A
10.76.10.112    RKSDP1A-1
10.76.10.212    RKSDP1A-2
192.168.10.112  BINSDP1A-1
192.168.10.212  BINSDP1A-2

# Aliases for Apps
10.76.10.12    RKSGW1 RKUSSDSG1 RKMSGSG1 RKVOICESG1 RKIVRSC1
10.76.10.13    RKSGW2 RKUSSDSG2 RKMSGSG2 RKVOICESG2 RKIVRSC2
10.76.10.14    RKSCL1 RKUSSDSC1 RKMSGSCL1 RKVOICESCL1 RKDATASCL1
10.76.10.15    RKSCL2 RKUSSDSC2 RKMSGSCL2 RKVOICESCL2 RKDATASCL2 
10.76.10.16    RKSDP1A RKURCS1 RKURCSPRI
10.76.10.17    RKSDP1B RKURCS2 RKURCSSEC
10.76.10.18    RKVMS1 RKVMGT1 RKMSGSNF1 RKORA1
10.76.10.19    RKVMS2 RKVMGT2 RKMSGSNF2 RKORA2
10.76.10.20    RKCRM RKCRMDB RKINVOICE RKECARE1
10.76.10.21    RKARS1
10.76.10.22    RKINBILL1              

Ø  To display customer hostname, when they login to the node as rkadm or their own user
o   Change .kshrc as follows:
§  export HOST=$(hostname)         è                           export HOST=”BINSDP1A”

§  export PS1="\D{%H:%M:%S} [\h:\w]\$ "              è           export PS1="\D{%H:%M:%S} [$HOST:\w]\$ "
§  export SHELL=bash
============================================================================



Tuesday, 22 March 2011

SS7 Basics

SS7 - Signaling system 7

Mobile Terminating Call Flow Diagram:

SMS Call Flow:

SMS Basic :

  • SMS (Short Message Service) is the transmission of short text messages to and from a mobile phone, or any other device capable of generating the SMS. It is composed of a maximum of 160 characters, each coded on 7 bits (GSM) or 140 bytes.
  • End to end SMS delivery completes in two parts, First SMS submission in SMSC (Short Message Service Centre) by originating subscriber, second Delivery of SMS to recipient subscriber. So SMS is a Stored and Forward Service.
  • Once a message is sent, it is received by a Short Message Service Centre (SMSC) of the calling subscriber’s network, which then delivers it to the appropriate destination device. In the GSM SMS delivery, SMS termination does not require the SMSC of the recipient subscriber’s Operator. However In CDMA (Code Division Multiple Access) network or GSM to CDMA SMS transfer, or in case of some services like Push SMS, the recipient SMSC is also used for terminating the SMS to the recipient. In all these types of SMS transfer, the air interface-signalling channel is extensively used for terminating the SMS traffic.
  • SMS uses the signaling channel (not dedicated), so it can be sent/received simultaneously with the voice/data/fax service over a network.
SMS Text Length:
The “short” part refers to the maximum size of the text messages: 160 characters (letters, numbers or symbols in the Latin alphabet). For other alphabets, such as Chinese, the maximum SMS size is 70 characters.
Types of SMS :
With the growing convergence Technology of networks and services, SMS can be send from a mobile phone, fixed phone, or even via the Internet. On the basis of originating and terminating identities, SMS can be broadly classified into the following 4 categories : P2P, A2P, P2N & I2P.
  • P2P (Person to Person) : In Person to Person (P2P) mode, the SMS is between two individual subscribers. The SMSC or originating operator stores the SMS & sends it to the recipient, either directly or in case of GSM to CDMA or CDMA to CDMA network, through the SMSC of the terminating operator.
  • A2P (Application/Advertiser to Person) : In Advertiser/Application to Person (A2P) SMS mode, advertising agencies have a commercial agreement with one or more service providers. Advertisers provide the messages and mobile numbers to an operator, who then sends the messages in broadcast mode to the recipients. If the SMS transfer is on-net, then SMS moves only within the network of one operator and hence there is no issue of loading resources of other operators, but if the recipient subscriber is attached with another operator, then the resources of the terminating operator are also used for delivering of such SMSs. This type of SMS delivery is also termed as Push method.
  • P2N (Person to Network) or P2A (Person to Application) : The Person to Network (P2N) SMSs are usually an on-net service. In this type mode, the content provider usually has a revenue share agreement with the service provider. The operator gives the content provider a 4-5 digit short SMS code. The content provider then uses the short codes to provide different kinds of services like astrology information, ring tones, picture downloads, tele-voting, games, etc. Operators charge premium rate for these SMS to the short codes.
  • I2P (Internet to Person) : The Internet to Person (I2P) arrangement allowed by some operators with the provision of a web interface enables a person to send an SMS from the Internet to mobile subscribers. They also accept SMS originating from the Internet messaging web sites.
Basic SMS Network Element :
  • SMSC
  • HLR
  • MSC
  • VLR
  • BSC
  • BTS
  • UE (User Equipment : Mobile/Laptop/Fixed Phone)
SMS is carried on a signaling channel of air interface from mobile handsets to the Base Transceiver Station (BTS), and thereafter it is carried on the Signaling System 7 (SS7) signalling channel throughout BSC, MSC/VLR, SMSC.
Basic SMS Call Flow :
End to end SMS transaction completes in 2 parts :
  • Message submission by originating subscriber to its SMSC (Mobile Originating Part)
  • Message delivery by SMSC to recipient Subscriber (Mobile terminating Part)
Basic end to end SMS call flow shown in following diagram :
SMS Originating Part – MO SM Submit :
  • The SM is sent from the originating Mobile Station (MS) to the serving Mobile Switching Center (MSC). The address of the SMSC where the SM should be submitted to is stored on the SIM card of the subscriber and forwarded to the MSC with the message.
  • The MSC forwards the SM to the SMSC. The SMSC returns a positive (ACK) or negative (NACK) response indicating whether the message was successfully stored of not.
SMS Terminating Part – MT SM Deliver :
  • To delivers a SM SMSC has to find out the location (serving MSC) and the International Mobile Subscriber Identity (IMSI) of the recipient subscriber first. This information (routing information) is retrieved from the Home Location Register (HLR) of the recipient subscriber based on the recipient number (MSISDN).
  • HLR Provides routing Information to SMSC, which includes IMSI and serving MSC of recipient number.
  • Based on routing information SMSC delivers SM to the serving MSC and MSC forwards it to the recipient Mobile Station.
SMS Delivery Report :
Successful DeliveryOn successful delivery SMSC sends delivery report to the originator if requested.
Failed Delivery – If SMS is not delivered to the recipient number SMSC send failure reason to the originator.
  • Permanent Error : For example – Unknown Subscriber
  • Temporary Error : For example – Absent Subscriber
SMSC Retry : In case of temporary errors the SMSC schedules a next delivery attempt, called SMSC retry.
Network Trigger : If the subscriber is not reachable (absent) the SMSC notifies the HLR that there is a message waiting for the recipient number. When the HLR detects the presence of the subscriber, it alerts the SMSC and SMSC forwards SM to the serving MSC.
Regular SMS Messages :
Send Routing Information for Short Message (SRI-SM):
Between Origin SMSC and Destination HLR, to retrieve the routing information needed for routing the short message to the servicing MSC.
Mobile Originating Forward Short Message (MO Forward SM):
Between Origin MSC and Origin SMSC, to forward mobile originated short messages.
Mobile Terminating Forward Short Message (MT Forward SM):
Between Origin SMSC and Destination MSC, to forward mobile terminated short messages.
Send-Info-For-MO-SMS:
Between the Origin MSC and VLR, to request subscriber related information from the VLR.
Send-Info-For-MT-SMS:
Between the Destination MSC and VLR, to request subscriber related information from the VLR.
Report Short Message Delivery Status:
Between Origin SMSC  and Destination HLR, to set the Message Waiting Data into the HLR or to inform the HLR of successful SM transfer after polling.
Alert Service Centre:
Between Destination HLR and Origin SMSC,  to inform SMSC  that a subscriber, whose MSISDN is in the Message Waiting Data file, is active or the MS has memory available.
Inform Service Centre:
Between Destination HLR and Origin SMSC, to  inform the SMSC which MSISDN number is stored in the Message Waiting Data file, or to provide status on different messaging flags.
Ready For Short Message:
Between the Destination MSC and  Destination VLR as well as between the Destination VLR and the Destination HLR. The MSC initiates this service if a subscriber indicates memory available situation. The VLR uses the service to indicate this to the HLR.

 GSM Overview:


The Switching System:
The switching system (SS) is responsible for performing call processing and subscriber-related functions. The switching system includes the following functional units.
  • home location register (HLR) —The HLR is a database used for storage and management of subscriptions. The HLR is considered the most important database, as it stores permanent data about subscribers, including a subscriber's service profile, location information, and activity status. When an individual buys a subscription from one of the PCS operators, he or she is registered in the HLR of that operator.
  • mobile services switching center (MSC) —The MSC performs the telephony switching functions of the system. It controls calls to and from other telephone and data systems. It also performs such functions as toll ticketing, network interfacing, common channel signaling, and others.
  • visitor location register (VLR) —The VLR is a database that contains temporary information about subscribers that is needed by the MSC in order to service visiting subscribers. The VLR is always integrated with the MSC. When a mobile station roams into a new MSC area, the VLR connected to that MSC will request data about the mobile station from the HLR. Later, if the mobile station makes a call, the VLR will have the information needed for call setup without having to interrogate the HLR each time.
  • authentication center (AUC) —A unit called the AUC provides authentication and encryption parameters that verify the user's identity and ensure the confidentiality of each call. The AUC protects network operators from different types of fraud found in today's cellular world.
  • equipment identity register (EIR) —The EIR is a database that contains information about the identity of mobile equipment that prevents calls from stolen, unauthorized, or defective mobile stations. The AUC and EIR are implemented as stand-alone nodes or as a combined AUC/EIR node.
The Base Station System (BSS):
All radio-related functions are performed in the BSS, which consists of base station controllers (BSCs) and the base transceiver stations (BTSs).
  • BSC —The BSC provides all the control functions and physical links between the MSC and BTS. It is a high-capacity switch that provides functions such as handover, cell configuration data, and control of radio frequency (RF) power levels in base transceiver stations. A number of BSCs are served by an MSC.
  • BTS —The BTS handles the radio interface to the mobile station. The BTS is the radio equipment (transceivers and antennas) needed to service each cell in the network. A group of BTSs are controlled by a BSC.

No comments:

Post a Comment