Routing etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
Routing etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

17 Nisan 2020 Cuma

Routing Protokolleri

Forwarding ve Routing Nedir
Forwarding (data plane) yani iletme tablolarda hızlı bir şekilde arama (lookup) yapılmasıdır.

Herhangi bir Layer'da bir paket alınır, zarfı incelenir ve bir arama yapılarak karara varılır. Eğer bu işlem Layer 2'de ise Switching veya Bridging olarak adlandırılır. Layer 3'te ise Routing olarak adlandırılır.

Routing data plane tablolarının oluşması için control plane'deki veriyi kullanır. Routing genellikle Layer 3'te gerçekleşir. Klasik anlamda Control Plane şu anlama gelir. Yani ayarlar, policy'ler bu plane ile atanır
Through a Control Plane, you can specify authentication policies, metrics generation, and configure service proxies across the mesh.

IP Routing
Açıklaması şöyle. Biz hemen her zaman LSSR kullanıyoruz.
The IP protocol includes two options:

- Loose Source and Record Route (LSRR)
- Strict Source and Record Route (SSRS)

They're both described in RFC 791.

The difference between them is that LSRR can specify a partial route, while SSRS specifies the complete, exact route. With LSRR, each router along the path uses its local routing table to determine how to send to the next hop in the source route.
LSSR şöyle çalışır. Yoldaki her router kendisi karar verir.
Routing is done on an end to end basis. This means, each router along the path needs to make its own individual routing decision based on which path that Router thinks is the best. Fortunately, without direct control over the networks a packet will traverse, there is no way to "specify a specific set of routers this packet hops to". E.g. If I send a packet destined for Google to my ISP then it is up to my ISP to forward this traffic along its best path.
Routing Algoritmalarında Hangi Kriterlere Bakılır
Routing metrikleri bir çok farklı şeye değinebilir.
  • measuring link utilisation (using SNMP)
  • number of hops (hop count)
  • speed of the path
  • packet loss (router congestion/conditions)
  • latency (delay)
bu metriklerden bazıları.

Bazı Kavramlar
Convergence
Router'ların birbirleri ile senkronize olması anlamına gelir.
Convergence occurs as a result of a change in network topology, i.e., a link becoming available or unavailable. When this occurs, each router independently runs a routing algorithm to recalculate metrics and build a new routing table based on this information. Once all the routing tables have been updated, convergence is complete.
Hold Timer veya Hold Interval
Bir başka router'dan belirtilen süre bilgi alınmazsa ilgili yollar silinir. Süreyi Hold Time belirler. Böylece ağdaki dalgalanmalar hemen hesaplamaları etkilemez.

RIP - Routing Information Protocol
RIP yazısına taşıdım.

EIGRP
Açıklaması şöyle
Distance vector protocols - RIP and EIGRP are using multicast addresses for communication - 224.0.0.9 and 224.0.0.10 respectively.
Temel olarak bandwidth ve toplam delay değerini kullanır. Açıklaması şöyle
The composite metric is based on bandwidth, delay, load, and reliability. MTU is not an attribute for calculating the composite metric.
Bir başka açıklama şöyle
The EIGRP Metric is a combination of a measure of the entire path's cumulative delay, and the minimum bandwidth across the entire path. The delay value is value assigned to each 'hop' based upon that interface's speed.
The metric can also include factoring the interface's load and reliability, but this is often left disabled.
Aslında tam formül şöyle. Önce sabitler tanımlanır.
     K1 = Bandwidth  
     K2 = Load       
     K3 = Delay      
K4 & K5 = Reliability
Daha sonra formül tanımlanır.
256 * { K1*BW + [(K2*BW)/(256-load)] + (K3*delay) } * { K5/(reliability+K4) }
Ancak K1 ve K3 genelde 1 kabul edilir. K2,K4,K5 genelde 0 kabul edilir. Bu durumda formül şuna döner
256 * (Bandwidth + Delay)
256 ile çarpmanın sebebi şöyle. Yani geriye uyumluluk
In regards to the EIGRP metric being so high - part of the reason is because EIGRP multiplies its metric by 256 in order to be backward compatible with IGRP (EIGRP's predecessor).
Bandwith 100 ve Delay 20 ise şöyle hesaplanır
EIGRP Metric = 256 * (Bandwidth + Delay)
EIGRP Metric = 256 * (100 + 20)
EIGRP Metric = 256 * 120
EIGRP Metric = 30720
Bandwith Nasıl Hesaplanır?
Açıklaması şöyle
The Bandwidth value is based upon the minimum bandwidth link across the entire path. But because metric values in any routing protocol consider a lower value to be superior, a formula has to be used to convert a higher bandwidth to a lower resulting metrics. That formula is as follows:
Bandwidth = 10^7 / BW in Kbps
Hedefe giden yol üzerindeki en küçük bandwidth değeri alınır. Örneğin 100 Mbps olsun. Bu değeri Kbps'e çeviririz. Yani şöyle hesaplanır.
Bandwidth value = 10,000,000 / 100,000 = 100 Delay
Delay Nasıl Hesaplanır?
Açıklaması şöyle
Delay is supposed to be a calculation of the amount of time it takes a bit to be transmitted to an adjacent neighbor. But in reality it is simply a constant value based upon the interface bandwidth. However, since this factor is additive, it essentially works as a hop count. Or maybe we should say a smart hop count, since it also factors each hop’s bandwidth.
Eğer veri iki tane 100 Mbps'lik hattan geçecekse 200 Delay eder. Bu sayıyı 10'a böleriz. Şöyle hesaplanır
Delay Value = 200 / 10 = 20

BGP  - Border Gateway Protocol
Border Gateway Protocol yazısına taşıdım.

OSPF
OSPF yazısına taşıdım.

15 Ekim 2017 Pazar

Border Gateway Protocol - BGP

BGP  - Border Gateway Protocol
BGP Exterior Gateway Protocol sınıfına giren protokollerden bir tanesi. Aslında bu devirde Exterior Gateway Protocol olarak kullanılan tek şey BGP.

İlk BGP standardı 1989 yılında yayınlandı. 1989 yılında IPv6 ve IPv4 için multicast standartları henüz yoktu. BGP yönlendirme bilgisini değiş tokuş etmek için TCP port 179 kullanır. Açıklaması şöyle
BGP does use TCP (layer-4) to exchange routes with other BGP speakers.
BGP tüm komşu BGP'ler ile bağlantı kurar. Açıklaması şöyle
BGP creates a TCP connection with each neighbor configured in BGP. It uses those connections to exchange prefixes.
Açıklaması şöyle
With BGP you peer directly via IP address and not by multicasted hellos so static IP addressing is preferred as both sides of the peering need to match as it requires a TCP handshake for the peering to establish.
Google DNS 8.8.8.8.varlığını BGP ile bildirir.

Paket yönlendirmek için ise Layer 2'yi kullanır. Açıklaması şöyle
When the router makes a forwarding decision for an IP packet, it looks in the table for the next hop address, adds the layer 2 header, and transmits it out an interface.
Diğer tüm değerler eşitse, BGP hop count değerini kullanır.

eBGP - External BGP
Açıklaması şöyle
eBGP requires directly-connected peers as the TTL=1 for those hellos. This can be overridden with the 'ebgp-multihop #' to set a different TTL. eBGP is by definition between two different autonomous systems (AS). This is typical for ISP connections
Açıklaması şöyle
"External BGP neighbors have a restriction in that they must be physically connected, adjacent to one another."
iBGP - Internal BGP
Açıklaması şöyle
iBGP has a TTL of 255 so this can be peered across the enterprise within the same AS. This is typical for enterprise remote site connections or internal BGP as the main routing protocol of the enterprise.
Açıklaması şöyle
iBGP does not propagate routes learned via other iBGP neighbors.
Local Preference
iBGP peer'lar için bu sayının varsayılan değeri 100. Şu komut ile görülebilir.
sh ip bgp
MBGP - Multiprotocol BGP extensions
1998 yılında RFC 2283 yani BGP için protocol extension yayınlandı. Böylece BGP çeşitli adres aileleri için çalışabilir hale geldi.

BGP Best Path Selection Algorithm
BGP Path Selection için bir sürü algoritma kullanabiliyor. Ancak varsayılan algoritma AS_PATH: Shortest. Açıklaması şöyle
By default, the shortest path will be the best path. If you notice, the first three are locally configured options that you can use to override any selections that would normally be made by the shortest path.

For example, there may be times that you receive prefixes from multiple other ASes, but the AS with the shortest path has the lowest bandwidth, so you want to override the shortest path to use a different AS with a longer path, but much higher bandwidth.

Also, the options below the shortest path come into play in case of ties in the path length.
BGP Router Finite State Machine
BGP Router 6 tane state'ten oluşan bir Finite State Machine işletir.

Prefix Listesi
Şöyledir. Router'lar izin verilen prefix'i yayınlarlar.
ip prefix-list Summary permit 172.31.0.0/16 le 20
   !
   router bgp 65001
   neighbor 10.1.1.1 prefix-list Summary out
Açıklaması şöyle
A prefix list doesn't actually advertise prefixes; it permits or denies prefixes that that the router can advertise.

Open Mesajı
İçi şöyledir.
Marker: ffffffffffffffffffffffffffffffff
Length: 29
Type: OPEN Message (1)
Version: 4
My AS: 23456
Hold Time: 180
BGP Identifier: xxx
Optional Parameters Length: 0
Notification Mesajı
İçi şöyledir.
Marker: ffffffffffffffffffffffffffffffff
Length: 21
Type: NOTIFICATION Message (3)
Major error Code: OPEN Message Error (2)
Minor error Code (Open Message): Bad Peer AS (2)

router bgp 202xxx
bgp router-id xxx
bgp log-neighbor-changes
neighbor xxx remote-as 212xx
neighbor xxx dont-capability-negotiate
neighbor xxx password 7 0337723xxxxxxxx

BGP router identifier xxx, local AS number 202xxx
...