24 Kasım 2021 Çarşamba

git branch seçeneği - Yeni Yerel Branch Oluşturur, Mevcut Yerel Branchleri Listeler, Mevcut Yerel Branch'i Siler

Giriş
Yerel branch'ler üzerinde işlem yapmak içindir

1. Branchleri Listelemek
Yerel branch'leri lister
Örnek
Şöyle yaparız
> git branch
* keyed-coalescer-actually-fix
  master

2. Yeni Branch Oluşturmak
Yerel yerel branch'leri oluşturur. Söz dizimi şöyle
git branch <branch>
Yeni branch oluşturmak için kullanılır. Bu durumda branch ismini belirtmek gerekir

Örnek
Şöyle yaparız.
$ git branch br2 && git branch br3 && git branch br4
Örnek
Şöyle yaparız.
git checkout -b foo #Yeni branch e geç
git branch foo #Yeni branch oluştur
git push -u origin foo # Uzak depoya gönder
-C seçeneği

Açıklaması şöyle
Run as if git was started in <path> instead of the current working directory.
Örnek
Şöyle yaparız
git -C ~/dotfiles status
-d seçeneği
Mevcut yerel branch'i siler. Açıklaması şöyle
Delete a branch
Söz dizimi şöyle
git branch -d <branch>
Eğer uzak bir branch'i silmek istiyorsak şöyle yaparız
git push -d <branchName>


Jenkinsfile

Giriş
Jenkins UI yerine kodla Jenkins pipeline oluşturmak içindir.  Scripted (groovy) veya declarative olarak yazılabilir. 

İki çeşit pipeline var
1. Build pipeline. Şeklen şöyle

2. Release pipeline. Şeklen şöyle

Environment Variables
Adres şöyle
localhost::8080/env-vars.html
GitHub
3 tane kontrol var. Bunlar şöyle
1. continuous-integration/jenkins/branch
Branch için çalışır

2. continuous-integration/jenkins/pr-head
Açıklaması şöyle
It builds the head commit of the PR branch (rather than merge it into the base branch, then build that).
3. continuous-integration/jenkins/pr-merge
Açıklaması şöyle
... the continuous-integration/jenkins/pr-merge is triggered which runs a Jenkins pipeline to build the code and perform unit tests. This allows us to prevent the PR from being merged into master if the unit tests fail.

1. Scripted Pipeline - Kullanmayın
Scripted Pipeline yazısına taşıdım

2. Declarative Pipeline
Declarative Pipeline yazısına taşıdım

Tasarım Seviyesinde Eşleşme (Coupling) Nedir

Giriş
Coupling iki bakış açısıyla tanımlanabilir.

1. Mimari Seviye
2. Tasarım Seviye

Bu yazıda daha çok tasarım seviyesi açıklamak amaçlanıyor.

Coupling Nedir?
Açıklaması şöyle
"The degree in which components depend on each other for their proper operation is called coupling. Coupling is achieved primarily by the mechanisms chosen to interact between components. The less coupled a system is, the more cohesive it is."
Bir başka açıklama şöyle
In software engineering, coupling is the degree of interdependence between software modules; a measure of how closely connected two routines or modules are the strength of the relationships between modules.
Bir başka açıklama şöyle
Generally speaking, the ease with which any system can be extended is dependent upon the degree to which its subsystems are tightly or loosely coupled. Usually, the more loosely coupled the subsystems are, the easier it is to modify them as they are isolated & don't necessarily require a complete understanding of the system as a whole
Nesneye Yönelik Tasarım
Nesneye Yönelik Tasarımda High CohesionLow Coupling amacına ulaşılmaya çalışılır.

Modüller Arası Coupling 
Şeklen şöyle


Diğer Coupling Çeşitleri
Bazı coupling çeşitleri şöyle.
No coupling: The modules do not know each other.
Call coupling: A module calls another one.
Data coupling: A module calls another one passing parameters to it.
Stamp coupling: A module calls another one passing complex parameters to it.
Control coupling: A module influences the control flow of another module.
External coupling: The modules communicate using a simple global variable.
Common coupling: The modules communicate using a common global data structure.
Content coupling: A modules depends on the inner working of another module. This is the strongest form of coupling.
Call Coupling 
Bir nesne diğerini çağıracaktır ve bundan kaçış yoktur. Bunu iki şekilde çözebiliriz
1. A nesneyi B nesnesine üye alan (field, member) olarak verilir.
2. A nesnesi B nesnesine metod parametresi olarak verilir. 
Her ikisi de Call Coupling olmasına rağmen muhtemelen 2. yöntem yani metod parametresi olarak kullanmak daha düşük bir coupling yaratır. Açıklaması şöyle
... injects dependencies not only into objects but also as arguments into methods. This means we do not have to structurally link all objects together ... The method just adds a new parameter for a new dependency. The result is we avoid high coupling because objects no longer require structural references to all other objects.

Coupling'e Sebep Olan Yöntemler
Bir kaç sebep sayılabilir.

1. Inheritance
Kalıtım sıkı bir coupling sözleşmesidir. Kalıtım ile gelen arayüze sadık kalmak gerekir. 

2. Composition

3.Composition With Interfaces

4. Data Transfer Objects

5. Streams and pipes
Kod içinde circular reference varsa High Coupling olduğu çok rahat görülebilir.

Low Coupling Nasıl Elde Edilir?
Bir çok yöntem var.

1.En basit olanı Encapsulation (Bilgi Saklama) kullanmak. Encapsulation şöyle tarif edilir.
"Encapsulation (aka information hiding) is the idea that one shouldn't expose implementation details"

The degree in which components depend on each other for their proper operation is called coupling. Coupling is achieved primarily by the mechanisms chosen to interact between components. The less coupled a system is, the more cohesive it is.
2. Message Center kullanmak. Açıklaması şöyle. Burada Message Center Publish/Subscribe veya benzeri bir altyapıyı temsil ediyor.
Message center reduces coupling and enables view models and other components to communicate with without having to know anything about each other besides a simple Message contract.
3. Bazı tasarım Örüntüleri Kullanmak
Örneğin Facade örüntüsü coupling'i bitirmez ancak azaltabilir. Açıklaması şöyle.
The facade hides whatever you do behind it. It is similar to how an object encapsulates its state. The facade encapsulates a (sub)system. The consumer code only needs to talk to the facade and it is unaware of the details behind it.

Of course, it is still coupled. And yes, you have moved the problem to the Facade. However, thanks to the Facade, the consumer code does not have to change because of the changes of what is behind the facade.


NewSQL Veri Tabanları

Giriş
Açıklaması şöyle
NewSQL is a class of relational database management systems that seek to provide the scalability of NoSQL systems for online transaction processing (OLTP) workloads while maintaining the ACID guarantees of a traditional database system.
Listede Vitess yok ancak bence o da dahil edilmeli. Vitess'in yerine kulanılabilecek TiDB listeye dahil edilmiş

23 Kasım 2021 Salı

Yazılım Mimarisi - Event Driven Architecture (EDA) With Event-Carried State Transfer pattern

Event-Carried State Transfer Pattern Nedir?
Açıklaması şöyle
As the name suggests, the main characteristic for the event-carried state transfer pattern is that the events contain state, which is quite different from notification events that just contain an identifier to retrieve state from the producer.
Örnek
Şöyle yaparız
{
  "specversion" : "1.0",
  "type" : "com.example.orderPlaced",
  "order" : {
    "id" : "A001-1234-1234",
    "time" : "2020-12-15T00:00:00Z",
    "products" : [{
      "id" : "1234321",
      "name" : "eBook Seven Languages in Seven Weeks",
      "price" : 25.00,
      "quantity" : 1
    }]
  }
}
Açıklaması şöyle. Burada önemli olan event'in içinde işlenmesi için gerekli alanların da olması. Böylece işleyen kod gidip tekrar çağrı yapıp bu bilgileri toparlamak zorunda kalmıyor
Including state in events eliminates the need for the consumer to make a call back to the producer to retrieve state. Instead, consumers build a private replica of state by storing the state from events they consume.
Fat Event vs Delta Event
Açıklaması şöyle
In many publications an event that contains any state is referred to as a fat event. That would make all events that leverage the event-carried state transfer pattern fat events. Some authors, including myself, make distinctions between delta events and fat events. Delta events contain just the properties that changed, so just enough detail, nothing more.


22 Kasım 2021 Pazartesi

Grafana

Giriş
Açıklaması şöyle
Grafana is an open source solution for running data analytics, pulling up metrics that make sense of the massive amount of data & to monitor our apps with the help of cool customizable dashboards.
Grafana connects with every possible data source, commonly referred to as databases such as Graphite, Prometheus, Influx DB, ElasticSearch, MySQL, PostgreSQL etc
Açıklaması şöyle
Grafana is a tool that can inject various data sources and display them in a comprehensive graphical experience. It supports various data sources like ELK, Prometheus, Graphite. And It also supports sending alerts base on different conditions.
Prometheus
Grafana, Prometheus'un çıktısını dashboard tarzı daha okunaklı hale getirir. İlişkisi şeklen şöyle

Ekranları gösteren bir örnek burada

Data Source Ekleme
Data Source Ekleme yazısına taşıdım

grafana-server komutu
Grafana'yı başlatmak için "./bin/grafana-server" komutu çalıştırılır

Dashboard
Grafana Dashboard Genel Görünüm yazısına bakabilirsiniz
Grafana Dashboard Import yazısına bakabilirsiniz

Dashboard şöyle. Burada cluster için toplam CPU ve Memory kullanımı görülebilir

Container'lar için toplam CPU ve Memory kullanımı şöyle


Örnek - Create
 create -> Add Panel ile panel eklenir. Her panel'in metrics browser alanına birer birer şunlar eklenir
jenkins_plugins_active{}
jenkins_plugins_inactive{}
jenkins_plugins_failed{}
jenkins_plugins_withUpdate{}
Helm İle Kurulum
Şöyle yaparız
kubectl create ns prometheus
kubectl create ns grafana

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts

# deploy/prometheus-server diye deployment yapar
helm install prometheus prometheus-community/prometheus 
  --namespace prometheus 
  --set alertmanager.persistentVolume.storageClass="gp2" 
  --set server.persistentVolume.storageClass="gp2"

helm install grafana grafana/grafana 
  --namespace grafana 
  --set persistence.storageClassName="gp2" 
  --set persistence.enabled=true 
  --set adminPassword='EKS!sAWSome' 
  --values ./grafana.yaml 
  --set service.type=LoadBalancer

#get the DNS of grafana load balancer.
kubectl get svc -n grafana
Docker
Şöyle yaparız
docker pull grafana/grafana

docker run -d -p 3000:3000 grafana/grafana
"localhost:3000" adresine bağlanıtız. Kullanıcı ismi ve şifre "admin:admin"

Docker Compose
Docker Compose yazısına taşıdım

Kubernetes
Grafana Kubernetes Deployment yazısına taşıdım

Loki
Açıklaması şöyle
Grafana Loki is logging aggregation system which allows high available and multi tenancy.
In micro-service paradigm to read the logs from each micro-service is really hard when we do one by one. To identify one issue have to tail logs in multiple modules. But what loki does is support the log aggregation in single dashboard and will allow to query the results form dashboard.
Şeklen şöyle



promptail-config.yml şöyle. Logları loki'ye gönderir.
server: http_listen_address: 0.0.0.0 http_listen_port: 9080 positions: filename: /tmp/positions.yaml clients: - url: http://loki:3100/loki/api/v1/push scrape_configs: - job_name: docker entry_parser: raw pipeline_stages: - docker:{} static_configs: - labels: job: dockerlogs __path__: /var/lib/docker/containers/*/*log
promptail için docker plugin kurulmalı. Şöyle yaparız
docker plugin install grafana/loki-docker-driver:latest
  --alias loki --grant-all-permissions
loki-config.yml şöyle
auth_enabled: false

server:
  http_listen_port: 3100
  grpc_listen_port: 9096

common:
  path_prefix: /tmp/loki
  storage:
    filesystem:
      chunks_directory: /tmp/loki/chunks
      rules_directory: /tmp/loki/rules
  replication_factor: 1
  ring:
    instance_addr: 127.0.0.1
    kvstore:
      store: inmemory

schema_config:
  configs:
    - from: 2020-10-24
      store: boltdb-shipper
      object_store: filesystem
      schema: v11
      index:
        prefix: index_
        period: 24h

ruler:
  alertmanager_url: http://localhost:9093
Şöyle yaparız
version: "3"

networks:
  loki:

services:
  app:
    image: quiz-server:latest
    container_name: 'quiz-server'
    ports:
    - '8080:8080'
  loki:
    image: grafana/loki
    volumes:
      - /home/sajith/Documents/personal/blogs/grafana-loki/loki:/etc/loki
    ports:
      - "3100:3100"
    command: -config.file=/etc/loki/config.yaml
    networks:
      - loki

  promtail:
    image: grafana/promtail
    volumes:
      - /var/lib/docker/containers:/var/lib/docker/containers
      - /home/sajith/Documents/personal/blogs/grafana-loki/promtail/config.yml:/etc/promtail/config.yml
    command: -config.file=/etc/promtail/config.yml
    networks:
      - loki

  grafana:
    image: grafana/grafana:master
    ports:
      - "3000:3000"
    networks:
      - loki
Influx Veri Tabanı
Influx ile ilişkisi şeklen şöyle



20 Kasım 2021 Cumartesi

Machine Learning ve Overfitting - Öğrenme Yerine Ezber Yöntemini Kullanma

Overfitting Nedir?
Açıklaması şöyle
Overfitting, modelinizin öğrenme yerine ezber yöntemine geçmesine verilen isimdir. Aşırı öğrenme durumunu tespit etmek için en iyi yöntemlerden birisi; eğitim verisi dışında, ilk kez karşılaşacağı veriler ile modeli test etmektir. Eğitim verileri ile %90'ın üzerinde (hatta %100'e yakın) başarılı sonuç elde edebilirken harici veriler ile bu oran çok çok düşük olabilmektedir.
Overfitting problemini görsel olarak soran bir soru burada

Aşırı Öğrenmenin Önüne Nasıl Geçebiliriz?
Bazı önlemler burada

Önlem - Verileri Artırın
Açıklaması şöyle
If you're training a complex model with small amount of data, your model is very likely to overfit.
Örnek
Çözmek istediğimiz problem şu olsun
Imagine that you're building a model that predicts house price based on the floor area.
Elimizdeki veri şöyle olsun
area  price
30    100001
50    150002
80    200003
Problemin açıklaması şöyle
You train your model, then ask it to predict the price for a house of area=50, and it tells you that the price should be 150002. Is that impressively accurate? Not really. It's just memorizing the training data.
Overfitting is commonly detected through a large difference in performance between the training and test set. If you test on the training set, you're unable to detect overfitting.
Önlem - Aynı Veri Training ve Test İçin Kullanmayın
Bir örnek şöyle
As a teacher, you wouldn’t give your students an exam that’s got the exact same exercises you have provided as homework: you want to find out whether they (a) have actually understood the intuition behind the methods you taught them and (b) make sure they haven’t just memorized the homework exercises.

16 Kasım 2021 Salı

Global System for Mobile Communications Railway - GSM-R ve EIRENE ve MORANE Projeleri

Giriş
GSM-R yaratılırken EIRENE – MORANE projelerinden de girdi sağlanmıştır. 

IUC
IUC Fransızcası "Union internationale des chemins de fer" İngilizcesi "International Union of Railways" Türkçesi "Uluslararası Demiryolları Birliği"

IUC GSM Tabanlı Bir Sistem Oluşturmaya Karar Veriyor
1993 yılında IUC GSM Tabanlı Bir Sistem Oluşturmaya Karar Veriyor. Açıklaması şöyle
The UIC anticipated the need for a common wireless data frequency band and digital communications standard for border-crossing rail traffic, and so conducted a detailed technical and economical survey of digital technologies and, in 1993, decided to base the new system on GSM (Global System for Mobile Communications). This would ensure that railways could participate in the evolution of the public standard to include their specific needs. In addition, they might benefit from the economy of scale of the existing public market for the cost of their equipment.
Ancak standart GSM'in yetersiz kalacağını düşünüyorlar. Yetersizlikleri tanımlayacakları EIRENE isimli bir çalışma başlatıyorlar. EIRENE (European Integrated Radio Enhanced NEtwork) kısaltmasıdır. Yetersiz olduğunu düşündükleri noktalar şöyle
The decision to choose an open standard had some drawbacks, as not all specific requirements were covered by the GSM. Enhancements for special needs were necessary, which were researched and defined by the UIC’s ‘European Integrated Radio Enhanced Network’ (EIRENE) Project. The GSM system had to be modified to meet several types of features and requirements specific to railways, namely:

- Fast and guaranteed call set-up, (over all on emergency calls – maximum two seconds)
- Enable seamless communication for train speeds of up to 500km/h
- Functional addressing (e.g. a train number or coach number) for setting up a call and for display of calling/called party
- Location dependent functions, e.g. connection to the local ground
- Broadcast and group calls
- Priority and pre-emption mechanisms
- Set-up of urgent or frequent calls through a single keystroke or similar, including emergency call
- Train control European Rail Traffic Management System (ERTMS)
- Link assurance, an indication that the connection is maintained
- Automatic mobile network management
- Control over system configuration
- Automatic and manual test modes with fault indications
- Increased flexibility of operation through the use of SIM cards
Daha sonra bu EIRENE ve GSM-R sistemini deneyecekleri bir proje daha başlatıyorlar. Bu çalışmanın adı da MORANE. MORANE (MObile radio for RAilway Networks in Europe) kısaltmasıdır. 
The principal purpose of MORANE was to develop the GSM-R system in accordance with the EIRENE specifications and perform validation on three trial sites: SCNF, Deutsche Bahn, Ferrovie dello Stato
Açıklaması şöyle
In 1995, the UIC decided to establish a project to set up tests of the new system. Three railways, SNCF, DB, and Firenze SMN (Italy), set up the consortium ‘Mobile Radio for Railway Networks in Europe’ (MORANE) to conduct the trials. The overall aim of the project was to specify, develop, test, and validate the new GSM-R (GSM for Railways) system.
EIRENE Numbering Plan support
Aynı zamanda Functional Addressing de deniliyor. Alanlar şöyle.
IC International Code (also known as RAC-Railway Access Code, used for routing to the relevant GSM-R-Network)
CT Call Type (Identifies how to interpret the user number that follows)
UIN User Identifier Number. Call Type değerine göre yorumlanır
FC Function Code (used as an identification of f.e the person or equipment on a particular train, or a particular team within a given area)
Şeklen şöyle
Örnek
Example: connect to the train driver of train number 12345678 the following digits have to be entered:
• 2 (Call type, in this case it identifies the following number as a train number)
• 12345678 (UserIdentifierNumber, in this case "train number")
• 01 (Function Code, in this case "lead driver")
Yani çevrilen telefon numarası
2 12345678 01

GSM-R Numbering Plan
EIRENE tanımından gelen Call Type tablosu şöyle
Prefix Usage definition
        Reserved for access to public or to other GSM-R networks
1         Reserved for short codes
        Train Function Number
        Engine Function Number
        Coach Number
6         Maintenance and shunting team members
        Train controllers
        Mobile Subscriber Number
        Reserved for breakout codes and national use
50       Group calls
51       Broadcast calls
52–55 Reserved for international use
56–57 Reserved for national use
58       Reserved for system use
59       Reserved for system use
0 ile başlayan numaralar Direct Call olduğu için mutlaka bağlanır
2,3,4,6,7,8,9 ile başlayan numaralar için Access Matrix kullanılır

Yani International Function Number şöyle
IC + CT + UIN + FC 
National Function Number şöyle
CT + UIN + FC 
Voice Group Call Ne Demek?
Çok sayıda kullanıcının aynı görüşmeye katılmasına izin verir.  Push To Talk gibi sadece bir tanesi konuşabilir.

Call Type Tipleri
Call Type 1 
Call Type 2
Call Type 3 
Call Type 4
Call Type 5
Call Type 6
var Açıklaması şöyle
• The Call Type (CT) prefix is used to distinguish between the different types of user numbers that are allowed within the national EIRENE numbering plan. It is an indication to the network of how to process the number dialed.
• The User Identifier Number (UIN) is the main identifier of, e.g., a train, a shunting team, etc.
• The Function Code (FC) is used as an identification of, e.g., the person or equipment on a particular train, or a particular team within a given area.

Call Type 1  - Kısaca Short Code
Call Type 1 için şöyle. Kısa yol içindir
Short Codes FC destination
1200  Signalman
1300  Regulator
1400  ECO
1500 ECP Extn (this role is a role which can take complete control of a specific Line                            Section thereby removing operational control from the Signalman)
1600 ECP Basic (this role is a role that shares access  to the radio network over a                                specific Line Section
1700 Signalman
1800 Network Loading
1900  Instruction
Call Type 2
Call Type 2 için şöyle. Tren içinde aramalar için kullanılıyor. Sanırım Call Type 2 için Function Code aslında "variable length" olabiliyor. Emin değilim.
Function Codes FC designation
01          Driver 1 (to be used for the Cab Radio)
02          Driver 2
07          Intercom
08          PA
10          Conductor
20          Catering
30          Security
99          Instruction
Call Type 3 
Call Type 3 için şöyle. Call Type 2 ile kesişen alanları var.
Function Codes FC designation
01          Driver 1
02          Driver 2
07          Intercom
08          PA
50          Train-borne recorder
Örnek
3 01011201 10 için Call Type = 3, User Identifier Number 01011201, Function Code = 10

Call Type 4 
Call Type 4 için şöyle. C
Function Codes FC designation
52          Train data bus
60          Pre-recorded passenger info
61          Displayed Passenger Info. Unit
Call Type 6
Call Type 6 "Shunting Team" içinde kullanılıyor. Calling Party şeklen şöyle

Mesela
6 85123 5 131
Call Type 6'dan önce başka rakamlar da olabilir. Eğer şeklen şöyle olursa
CgPa = <CC><NDC><GCRNumber><CT6 Number>
CdPa= <CallTypeAutomaticConference><Location Number starting with CT6ToVGSREFPrefixes><Function Code without team member function digit>

Calling Party= 41 512 940 6 85123 5 131
Called Party = 50 85 123501

Bazı Özellikler

1. Calling Line Identification Özelliği- CLIP
Beni arayan numarayı normalde SIM kartına ait telefon numarası ile görürüm. Eğer CLIP özelliği varsa telefon numarası yerine, arayan kişinin Functional Number numarasını görürüm.

2. Location Dependent Addressing Özelliği 
Açıklaması şöyle. Örneği "controller" aranmak istediğinde kullanılır
Location dependent addressing (LDA) is an effective and efficient addressing method in GSM-R (GSM for railways), which needs information on the location of the mobile station in order to forward the call to the correct called party.
Şeklen şöyle. Bir short code tuşlanır. 1200 gibi. 1 Call Type Short Code olduğunu belirtir. 200 ise Short Code numarasıdır


3. Access Matrix Özelliği
Şeklen şöyle.


4. Functional Number With Variable Length
Açıklama yaz

5. Follow me
Açıklama yaz

6. Delayed Deregistration
Açıklama yaz

7. Enhanced Railway Emergency Group Call
Kısaca eREC. Açıklayıcı bir video burada. Acil bir durumda kontrolör bir alan içindeki tüm trenleri arayıp, tam duruşa geçmelerini isteyebilir.

Redis Standalone Mode

Giriş
Açıklaması şöyle
What is a Single Redis Instance?

It’s a solution using the single Redis node deployment architecture.

Standalone Redis Pros:
- Simple and classical architecture.(Image 1)
- Easy deployment and configuration.

Standalone Redis Cons:
- It is not suitable for data reliability requirements.
- There is no backup(slave) node for real-time data synchronization.
- Because Redis is a single-threaded mechanism, its performance is limited by the processing capacity of a single-core CPU. The major bottleneck is the CPU, which restricts the number of instructions that can be performed on a single computer.
Şeklen şöyle


15 Kasım 2021 Pazartesi

Amazon Web Service (AWS) - Elastic Container Service - Docker İçindir

Giriş
Açıklaması şöyle. Docker Container gibi düşünülebilir. Container'lar halen EC2 üzerinde çalışır.
Elastic Container Service (ECS) and Elastic Container Service for Kubernetes (EKS) are container management services that support Docker containers and allow you to run applications on a managed cluster of Amazon EC2 instances. So there is no need to manage the infrastructure to deploy individual microservices.
Açıklaması şöyle. ECS Amazon'a mahsus bir çözümdür
Amazon ECS (Elastic Container Service) is a fully managed container orchestration service that allows you to easily deploy, manage, and scale Docker containers in AWS. It is an AWS-opinionated solution for running containers at scale, but organizations prefer ECS for the simplicity it provides.
Açıklaması şöyle
ECS allows you to use Network Access Control Lists (ACLs) and Amazon Virtual Private Clouds (VPCs) for resource isolation and security. Possibly one of the key features of ECS is that it is available in 69 availability zones and 22 regions globally, guaranteeing peace of mind regarding uptime, reliability, and low latency.
Şeklen şöyle



11 Kasım 2021 Perşembe

Redis - List Veri Yapısı

Giriş
List komutları burada
- B harfi ile başlayanlar blocking. 
- BL ile başlayanlar, listenin ilk elemanı içindir.
- BR ile başlayanlar listenin son elemanı içindir

Şeklen şöyle. Burada LPUSH, RPOP, DEL görülebilir.


LPUSH
Listenin başına eleman ekler
Örnek
Şöyle yaparız
LPUSH myset 123
LPUSH myset "123"

RPOPLPUSH - Reliable Queue

İlk listenin son elemanını pop ederken, ikinci liste'nin önüne push eder. Açıklaması şöyle
Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.

For example: consider source holding the list a,b,c, and destination holding the list x,y,z. Executing RPOPLPUSH results in source holding a,b and destination holding c,x,y,z.
Açıklaması şöyle
Lists : they allow us to adopt a worker-queue based approach which can distribute load among worker apps. the messages are removed once they are consumed. it can provide some level of fault-tolerance and reliability using RPOPLPUSH (and BRPOPLPUSH)

8 Kasım 2021 Pazartesi

Signalling System No. 7

Giriş
SS7 mobil telefon altyapılarında sinyalleşme için kullanılır. Açıklaması şöyle. SS7'den önce örneğin SS5 vardı
Signalling System No 7 (SS7), which is called Common Channel Signalling System 7 (CCSS7) in the US or Common Channel Interoffice Signaling 7 (CCIS7) in the UK, is a system that connects one mobile phone network to another.

It was first developed in 1975 and has many variants. Most networks use protocols defined by the American National Standards Institute and the European Telecommunications Standards Institute.
Açıklaması şöyle
SS7 is a set of protocols allowing phone networks to exchange the information needed for passing calls and text messages between each other and to ensure correct billing. It also allows users on one network to roam on another, such as when travelling in a foreign country.
Şeklen şöyle

MTP 1 – Layer 1 Physical interface
MTP 2 – Layer 2 Data Link
MTP 3 – Layer 3 Network
Buraya kadar her şey ortak

1. PSTN Açısından
TUP – Telephone User Part. Açıklaması şöyle
- Message Transfer Part carries SS7 signals between nodes.
- Telephone User Part carries voice calls between users.
- Data User Part carries digital data between users.

2. Intelligent Network Açısından
1. SCCP – Signaling Connection Control Part
Açıklama yaz

2. TCAP – Transaction Capabilities Application Part
Açıklama yaz

3. INAP - Intelligent Network Application Protocol or Intelligent Network Application
Açıklaması şöyle. Normal trafik içindir. Bazı yerlerde INAP yerine SIN kelimesi de kullanılıyor
Intelligent Network Application Part (INAP) is a Signaling System 7 (SS7) telecommunication protocol that provides the intelligent service logic control among various Functional Entities (FEs) in Intelligent Network (IN). 
Yani INAP HTTP protokolü gibi düşünülebilir.. INAP türevleri var. Bunlar Ericsson INAP, Nokia INAP, Siemens INAP or Huawei INAP olabilir. SMS mesajları sanırım INAP ile gönderiliyor

CAP - CAMEL Application Part
CAMEL kelimesi Customized Applications for Mobile network Enhanced Logic anlamına gelir. Açıklaması şöyle. Yani farklı ülkelerde roaming gibi şeylerde kullanılır.
The CAMEL Application Part (CAP) is a signaling protocol used in the Intelligent Network (IN) architecture.
...
CAMEL is used when the subscriber is roaming between networks, allowing the home network to monitor and control calls made by the subscriber. CAMEL provides services such as prepaid roaming services, fraud control, special numbers (e.g., 123 for voicemail that works everywhere) and closed user groups (e.g., office extension numbers that work everywhere).

As with CAMEL, CAP has been defined in four phases, each of which has an accompanying specification that builds upon the previous phase. 
Açıklaması şöyle. Yani INAP yerine CAP geldi.
Customized Applications for Mobile network Enhanced Logic also known as CAMEL was developed as a standard for mobile intelligence across different vendor equipments for GSM network. What this means is that the end user should be able to roam between different networks (maybe in different countries) and be reachable at the same number and should receive only one bill from the original service provider (Home Operator).

Before CAMEL, the GSM networks used INAP (Intelligent Network Application Part) for injecting intelligence in GSM networks. The limitations of INAP was that it did not support mobility management. CAMEL solved the mobility management problem and provided with much more functionality. With the evolution of 3G standards, CAMEL has evolved to provide new functionalities that will be discussed later.
Camel'ın safhaları var. Bunlardan birisi
Camel Phase 3

4. MAP
Açıklaması Mobile Application Part. Yukarıdaki şekilde MAP görünmüyor. O yüzden yeni bir şekil ekliyorum. USSD mesajları sanırım MAP ile gönderiliyor.

Diğer Bazı Kavramlar
MSISDN
Bildiğimiz telefon numarasıdır. Açıklaması şöyle. Yani 905xx xxx xx xx  şeklindedir.
In GSM and its variant DCS 1800, MSISDN is built up as
  • MSISDN = CC + NDC + SN
  • CC = Country Code
  • NDC = National Destination Code, identifies one or part of a PLMN
  • SN = Subscriber Number
IMSI
Açıklaması şöyle. Bence MSISDN ve IMSI aynı şeyler.
An International Mobile Subscriber Identity (IMSI) is a unique 15-digit number that identifies every mobile network user globally. The IMSI is divided into two parts. The first part is a six-digit or five-digit number based on the North American or European standards, respectively. The initial set of numbers identifies the mobile network operator in a specific country with whom the user is subscribed to. The second part of the IMSI number is allocated by the network operator to uniquely identify the subscriber.
Mobile Switching Centre - MSC
Açıklaması şöyle. Yani kullanıcının önündeki bir çeşit router
A Mobile Switching Center (MSC) is a core part of the GSM/CDMA network system. It acts as a control center of a Network Switching Subsystem (NSS). The MSC connects calls between subscribers by switching the digital voice packets between network paths. It also provides information needed to support mobile service subscribers. Based on the size of the mobile operator, multiple MSC can be implemented.
Service Switching Point - SSP
Örneğin Nokia'nin bir SSP'si var. Açıklaması şöyle. Çağrının başlayıp bittiği yer
What are SSP, STP and SCP Signaling System 7 nodes?
There are three main types of signaling nodes in a SS7 network: Service Switching Points (SSPs), Signal Transfer Points (STPs) and Service Control Points (SCPs). SSPs originate or terminate a call and are the initial point on the SS7 network. The control signals are routed through various STPs, which operate as interconnected switches on the SS7 network. The SCPs determine how to route a call or set up and manage some special feature.

SCPs and STPs usually exist as a collection of discrete nodes so that service can continue if one network point fails. The SCPs may also communicate with a Service Data Point, which stores the user database and directory. 
Service Control Point - SCP
Açıklaması şöyle. Yani bağlantının sağlanması için gerekli bilgileri bilen bir çeşit veri tabanı. Ben GSM-R projesinde bir SCP'de çalıştım
When a subscriber starts to make a call, this request is received by the network's Mobile Switching Centre (MSC). The MSC then sends a message that 'queries' the SCP's database. Note that the essential element of any CAMEL solution is a Service Control Point (SCP). This unit effectively hosts a database which holds the instructions needed for an intelligent application.

The SCP processes that query, comes up with an appropriate response and then sends a message back to the MSC telling what action it should take with the subscriber’s request for a specific service. The call is then connected in the most appropriate manner, a process which is transparent to the customer. A very good example of this process in action is short code dialing over a VPN (Virtual Private Network) where the user calls a colleague’s internal extension telephone number but is, in fact, routed to that person’s mobile phone which is roaming abroad.
Örnek bir akış şöyle. Burada SSP'den SCP'ye IDP MSISDN gönderildiği görülebilir
(MSISDN) -> SSP -> (IDP MSISDN) SCP

SCP -> (Continue/Release) SSP -> (MSISDN) SMSC

Initial Detection Point Message
INAP ile gönderilir. Açıklaması şöyle
... if the Service Switching Point (SSP) does require further instructions it sends an IDP to a Service Control Point (SCP) via an IN protocol. The protocol may be INAP but could be CAMEL, or bespoke INAP flavors such as Ericsson INAP, Nokia INAP, Siemens INAP or Huawei INAP.
Şeklen şöyle. Yani bağlantının yapılıp yapılamayacağını sorgular. Bağlantı için erişim, kontör kontrolü vs gibi herhangi bir şart kontrol edilebilir.