OSPF Issues

Because Network become rathe large and VPN-channels are rather slow OSPF was adopted as dynamic routing protocol for whole United Networks. OSPF provides Site-to-Site connectivity. It has a number of characteristics:

  • OSPF is implemented by Quagga package. There must be allowed daemons “zebra” and actually “ospfd”:

/etc/quagga/daemons

  zebra=yes
  bgpd=no
  ospfd=yes
  ospf6d=no
  ripd=no
  ripngd=no
  isisd=no
  • Area 0.0.0.0 is backbone one. It extends from srvgate.gogolya.pushkino to all other nearest (zero-hop) Srvgates (see General Topology).
  • Each Srvgate except Central one has own area behind it (all Subordinate Networks are placed in this area).
  • All Sites' area numbers are combined from the second and the third octet of Srvgate's IP-address in VPN network. For example: srvgate.sokol.msk has address 172.31.16.128, so its area will be 0.0.16.128.
  • If somewhere there is subordinate connection of one Srvgate to another and then the latter to Central Site from OSPF's viewpooint intermediate area becomes transit area with OSPF-tunneling. It is allowed.
  • Backbone VPN network where Srvgates pick up VPN connections to Central Site there is NBMA (Non-broadcast multi-access) media. So “neighbor” directive must present in ospfd.conf in “router” section.

/etc/quagga/ospfd.conf

interface eth0
!
interface eth1
!
interface lo
!
interface tun0
 ip ospf network non-broadcast
!
router ospf
 network 172.16.32.0/24 area 0.0.16.32
 network 172.31.0.0/16 area 0.0.0.0
 neighbor 172.31.98.98
 neighbor 172.31.99.99
!
  • Each Srvgate must set up two neighbor relationships: “srvgate.gogolya.pushkino” (DR, router-id 172.31.99.99) and “srvgate.sokol.msk” (BDR, router-id 172.31.98.98).
  • All intra-area routes are aggregated at some Srvgate and announced to core (area 0.0.0.0) as a single “line”.
  • OSPF in United Networks has standard timers and all other parameters.

RIP Issues

A Site where network hardware which can not serve default route presents it is allowed to deploy RIPv2 and implement one-direction redistribution from OSPF to RIP. RIP will be localized at the Site boundary (or in the certain Subordinate Network of this Site) and RIP-compatible hardware will accept routes to all “dust corners” :-) of United Networks - to allow System Administrators to control it. For example DSL-524T has no opportunity to enter manually Default route. So it isn't able to “understand” from where some requests has arrived. This DSL-modem can be seen from local Srvgate only via Web interface (via ARP). There is no way to directly connect it from remote Site. But fortunately it supports RIPv2. So problem can be solved by two methods: via redistribution of all routes from OSPF to RIP and then RIP will announce them to DSL-524T, or simply originate Default route from Srvgate and spread it between RIP-devices. Indeed this is at the discretion of System Administrator responsible for this Site.

BGP Issues

United Networks got Autonomous System in RIPE NCC (AS197627) and Provider Independent IP-block 91.223.181.0/24. AS/PI and BGP are currently deployed only on Central Site. UN gets two FullViews from two ISPs: Beirel-Telecom and Uniline and announces itself back to them. UN is classified as a stub network.

Since both of operators have uplinks to the sole Higher ISP named “Netorn” there will be the only route 91.223.181.0/24 on the nearest Internet Exchange “MSK-IX”. By default (in normal situation) this announce is from Beirel due to some routing policies adopted in Netorn. Announce of 91.223.181.0/24 will be from Uniline in a case of unavailability of Beirel and if the first is still alive. There is no opportunity to load-balance incoming traffic between two United Networks uplinks.

In the future Uniline promises to connect to other ISP in addition to Netorn and then possibility to use different BGP policies for different traffic flows will appear.

But we still can load-balance outgoing traffic. The division of Internet on two halves is used. Let's consider it in detail. Well, let's begin with layout.

As you can see it rather complex for those tasks which it decides. It was done intentionally for educational purpose. First of all AS Number 197627 is 32-bit long. And we wanted to see how Cisco and Quagga (running under FreeBSD) behave. Cisco required Software upgrade immediately. Syntax of BGP clauses differs from Cisco to Quagga. Cisco uses RFC 5396 compliant ASDot Notation where ASN=197627 is represented as ASN32/65536 + ”.” + ASN32%65536, i. e. “3.1019” (representation by two 16-bit numbers). Another subject to study was ASN=23456 that masquerade 32-bit ASNs for systems which “understand” only native 16-bit ASNs.

The second thing was probing iBGP along with eBGP - there is a need in two active routers. Cisco and FreeBSD are two very different types of router. Moreover everyday use of Cisco does not allow to forget Cisco configuration skills. For example ACLs, “sh ip route” and so on.. :-)

The third thing is DMZ organization where UN servers grant protected access to themselves from outside.

The fourth thing is redundancy: to use different hardware to avoid simultaneous failure of two servers and provide to internal users of Site “gogolya.pushkino” stable Internet connection.

So if you look at drawing you can see the following:

  • Srvgate (FreeBSD) has BGP link to Beirel. It is “multihop” eBGP.
  • Sr-2821 (Cisco) has BGP link to Uniline, it is also “multihop” eBGP.
  • Also there is iBGP connection between Srvgate and Sr-2821 through DMZ (once more cause to refresh access lists and firewall rules).
  • Since AS has two uplinks then all internal Vlans have two exits to Internet. There was a reason to set up VRRP between Cisco and FreeBSD for internal Vlans (subnets). VRRP was choosen because it is just one standard based Gateway Redundancy Protocol. HSRP and GLBP supported by Cisco are propreitary protocols. FreeBSD has FreeVRRPD implementation, Cisco has native VRRP. FreeBSD is primary VRRP gateway for internal subnets.
  • Due to eBGP routes received from Beirel are more preferable for FreeBSD then iBGP routes received from Sr-2821 and finally from Uniline. All outgoing traffic will be directed by our AS197627 to Beirel by default. Beirel became primary gateway to Internet for Central Site for different reasons (the first is Netorn and the second is our inner topology).

So, now let's look at prefixies which usual BGP border receives from its neighbors:

/root> netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
1.0.4.0/22         91.223.---.---       UG1         0        0 vlan--
1.0.25.0/24        91.223.---.---       UG1         0        0 vlan--
1.0.26.0/23        91.223.---.---       UG1         0        0 vlan--
1.0.28.0/22        91.223.---.---       UG1         0        0 vlan--
1.0.224.0/19       91.223.---.---       UG1         0        0 vlan--
1.1.64.0/19        91.223.---.---       UG1         0        0 vlan--
1.5.0.0/16         91.223.---.---       UG1         0        0 vlan--
1.8.1.0/24         91.223.---.---       UG1         0        0 vlan--
... 
126.252.0.0/16     91.223.---.---       UG1         0        0 vlan--
126.253.0.0/16     91.223.---.---       UG1         0        0 vlan--
126.254.0.0/16     91.223.---.---       UG1         0        0 vlan--
126.255.0.0/16     91.223.---.---       UG1         0        0 vlan--
128.0.0.0/21       89.222.---.---       UG1         0        0 vlan--
128.0.24.0/24      89.222.---.---       UG1         0        0 vlan--
128.1.0.0/16       89.222.---.---       UG1         0        0 vlan--
128.1.1.0/24       89.222.---.---       UG1         0        0 vlan--
...
223.253.56.0/21    89.222.---.---       UG1         0        0 vlan--
223.255.161.0/24   89.222.---.---       UG1         0        0 vlan--
223.255.240.0/24   89.222.---.---       UG1         0        0 vlan--
223.255.254.0/24   89.222.---.---       UG1         0        0 vlan--
... 
/root>

These are fragments of Full View (or Full Table) with most of routes omitted. The first column has prefixes as increasing sequence: 1.0.0.0, 1.0.0.1,… 2.0.0.0,… 223.255.255.255. Notice that for routes beginning with first octet lower 127 one gateway is used and for routes beginning with first octet greater than 127 is another gateway (91.223.—.— and 89.222.—.—). Mask 128.0.0.0 which has the most significant (and single) bit set to “1” (and therefore it has length of 1 bit) divides this series on two subsequences: 1.0.0.0-126.255.255.255 and 128.0.0.0-223.255.255.255. Using the following prefix-lists and route-maps construction:

ip prefix-list Pfx-In seq 5 permit 0.0.0.0/1 le 32

route-map RM-In permit 10
 match ip address prefix-list Pfx-In
 set local-preference 110
route-map RM-In permit 20
 match as-path 1

…on Uniline uplink we mark the first half of incoming routes on this connection (which will be used later for outgoing traffic from our AS) with higher local-preference then others including all routes incoming from Beirel. These marked routes will be used by the procesing router to choose the first uplink for routes 1.0.0.0-126.255.255.255 unconditionally and all other routes will be analyzed and they will choose one of two uplinks depending all other BGP attributes. In our certain case it will always be Beirel (see above).

Pay attention to the syntax of previously mentioned construction:

ip prefix-list Pfx-In seq 5 permit 0.0.0.0/1 le 32

Some comment is needed.

  • ip prefix-list” - it is clause defenition in Cisco/Quagga notation which defines prefix list comparision.
  • seq 5” - sequence number. Prefix list can contain many operation of comparision. First match breaks compare procedure. So position defined by sequence number takes not the least.
  • permit” - positive match (exits if match).
  • 0.0.0.0/1 le 32” - key phrase! if we would write simply “0.0.0.0/1” it would mean “exact match prefix”. In other words: “match if exactly such prefix”. That is most significant bit is set to “0” and all others have no mean. And mask exactly: 10000000.00000000.00000000.00000000 (in binary). If use “le 32” (“less or equal 32 bit”) then we talk to it: “this prefix and all prefixes with all possible masks 2, 3, 4, … 32 length including”.

Structure of route map is rather transparent: first we check current prefix against defined above prefix list and if match occurs set greater LocalPref to this route (prefix). If no - next operator permits all with defaults (let's remember about default implicit “deny” at the end of route map).

So we can crystalize a “solid”. If current target IP in packet addressed from UN to Internet has the first octet is less than 128 it travels through Uniline (because it marked with LocalPref=110 just on that uplink), for all others will be used Beirel. It is about outgoing traffic. As for incoming one here is Beirel rule. :-)

PBR Issues

Policy Based Routing (PBR) is used at almost all Sites to demarcate Internet route from United Networks. Each Site exits to Internet via local ISP, and when it needs to access some place in UN it uses VPN connection. It's achieved by accepting UN routes via OSPF from Central Site where local Site is connected and pointing Static Default Route (that is less specific) for all other destinations. It is primitive example.

At current moment Central Site uses actively PBR because there are two uplinks. For goals of load-balancing between two uplinks considered Srvgate doesn't use Default route 0.0.0.0/0 instead of that it divides whole Internet on two halves by using the following routes: 0.0.0.0/1 and 128.0.0.0/1 (these both replace 0.0.0.0/0). Thus when Srvgate initiates connection with some Site somewhere in Internet it looks at address of destination compares it with these two routes and decides which uplink will be used. Answer will arrive on the same interface. So we use both ISPs approximately equally. When some computer in Internet initiates connection to srvgate.gogolya.pushkino DNS-system resolves symbolic name cyclicly into one or anothe address. So here equal use of both uplinks takes place too. This distinctly could be seen when torrents work - there are a lot of peering connection initiated and both uplinks are “chock-a-block” utilized.

When this Srvgate wants to connect to some Site in UN it uses some “more specific route” then above (0.0.0.0/1 and 128.0.0.0/1) which is received via OSPF from that desired site. This is fully similar other Sites.

Balancing is done on FreeBSD Firewall PF by using Packet Filter's directives “route-to”.

Sometimes particular case of PBR such as Static Routes can be met at work computers of System Administrators. Most of all work computer must participate in Corporate Network (not in United Networks), so default route points to local gateway. But because address pool 172.16.0.0/12 is used rarely there will not be intersections if we enter static route pointing to 172.16.0.0/12 via Tunnelling VPN interface. When System Administrator's work computer wants to access Corporate Network or Internet it goes via its Default Route which is provided by local conditions. If work computer needs to access some UN resource it uses VPN connection to Central Site.

OpenVPN Issues

OpenVPN has some issues related to routing process. OpenVPN is a Client-Server pplication. Its daemon on the Server side has own internal routing table which is populated during VPN connection establishing based on Client Configuration. Administrator must manually specify subnets which is connected to VPN-client. Without this information OpenVPN does not provide third-level connectivity even if routing tables on Server and Client are correct.

Using this its routing table OpenVPN offers to its clients some option called “client-to-client direct connection” emulating some variety of Broadcast Media. It is not real broadcasting it is simply emulation. Client sends a packet to OpenVPN Server destined to another client using IP of latter. OpenVPN Server looks at destination IP-address understands that this is address of other Client and resends int to real destination. Traceroute shows absense of intermediate hops during such transmission, but packet really visits two points what is visible from Round-Trip Delay (RTD).

This feature leads to incorrect work of OSPF's “point-to-multipoint” mode. Because of this need to point “neighbors” arises. Often OSPF loose its routes from periferal routers.

routing.txt · Last modified: 2016/01/31 11:14 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki