CommunicationAndNetworking2-Chapter1-Part2
CommunicationAndNetworking2-Chapter1-Part2
Autonomous System: (AS): it is a collection of IP networks and routers under the control of a single
organization that follows a unified routing policy. Each AS is assigned a unique Autonomous System
Number (ASN) by the Internet Assigned Numbers Authority (IANA) through regional Internet registries
(ARIN (North America), RIPE (Europe, Middle East, and parts of Central Asia), APNIC (Asia-Pacific),
AFRINIC (AFRICA)) .
1. IANA assigns ASN ranges to Regional Internet Registries (RIRs) based on demand.
2. Network operators (ISPs, large enterprises, universities, etc.) request an ASN from their
respective RIR.
3. The applicant must prove the need for an ASN, typically by demonstrating that they operate a
distinct routing policy or need BGP (Border Gateway Protocol) peering with multiple providers.
4. If the request is approved, the RIR assigns a unique ASN from its allocated block.
5. The assigned ASN is publicly recorded in databases to prevent duplication.
6. ASN is between 0 and 65535
Intra-AS (aka “intra-domain”)/ also called interior Inter-AS (aka “inter-domain”): / also called
gateway protocols (IGP) Exterior gateway protocols (EGP)
routing among routers within same AS routing among AS’es
(“network”) ▪ gateways perform inter-domain routing
▪ all routers in AS must run same intra-domain (as well as intra-domain routing)
protocol
▪ routers in different AS can run different intra-
domain routing protocols
▪ gateway router: at “edge” of its own AS, has
link(s) to router(s) in other AS’es
Intra-AS/IGP Inter-AS/EGP
- Proprietary or not
- Category of routing protocols
- Metric of Calculation of the cost
- Administrative Distance (defined by each network equipment vendor (e.g., Cisco, Juniper,
Huawei) within their routing software to determine the trustworthiness of the routing protocol)
- Timers
- Load Balancing
- Link State
- It has two primary versions OSPF v2: IP4, OSPF v3 : IPv6 (v1 was never officially released, it was
a test version)
- Metric of calculation based on the Bandwidth (more accurately data rate in bps)
-It is standardized in RFC 2328, 1998 (Request for Comments (RFCs): a formal document
published by the Internet Engineering Task Force (IETF) and other organizations to define
standards, protocols, and best practices for the Internet and networking technologies).
- Router exchange information about their interfaces (directly connected networks) so that each router
builds a map of the entire network topology.
- OSPF uses Link State Advertisement (LSA) and Link State Database (LSDB) for building the map.
- LSA: An OSPF message that contains routing information (the network range with this IP Address is
connected to Interface Intf0 on Router 1and here is the cost of this link).
- This information (LSA) is flooded every 30 min by default, however when there is a change it is
flooded immediately)
- LSDB: A database of LSAs that is located on each router. LSA LSA LSA
LSDB
LSA LSA LSA
LSA Flooding
1) A router Create LSA where it
advertises for each of its interfaces and 3) Each router records its own LSA plus
R1
the subnet that is connected to this the received LSAs into its own LSDB
interface
R2 LSA R4
LSA
4) After convergence, all the LSDBs at
R3 each routers are the same.
2) These LSA are sent to the neighbors,
and the neighbors will relay them to their
neighbors 5) Routers run Djikstra in order to find
optimal routes.
OSPF Areas:
* Large Link state database, which requires more memory on each router
* Frequent calculations over large datasets requires more processing power
- OSPF supports a hierarchical design areas to break a large network with one LSDB into smaller
areas with small separate LSDBs.
- Area: A group of links and routers that share the same LSDB.
* Single area OSPF: One area with the same LSDB
* Multiarea OSPF: multiple areas with separate LSDBs.
OSPF Areas:
Area 0 in a given
autonomous system
OSPF Areas:
- Routers in different areas A backbone router
have different LSDBs - It is recommended to
separate areas in a star
Area Border Area 0: backbone network
Router (ABR)
ABR creates
summary
information about
area 3
each subnet in an
area to advertise
into other areas, internal
“Summary LSA” area 1 routers
area 2
OSPF Areas:
- Backbone area (area0): Is a special area that all other areas must connect to
- Area Border Router (ABR): A router with interfaces connected to the backbone area and at least one other area
- All nonbackbone areas must connect to the backbone area by having one ABR.
Calculating routes
OSPF Configuration
Process ID: a value between <1-65535> which identifies an OSPF instance. Different
routers do not have to use the same process ID
OSPF configuration
OSPF Configuration
2/ Activating OSPF on interfaces
Router1(config-router)# network 192.168.10.0 0.0.0.255 area 0
Router1(config-router)# network 10.10.0.0 0.0.0.3 area 0
Router2(config-router)# network 192.168.10.0 0.0.0.255 area 0
Router2(config-router)# network 10.10.0.0 0.0.0.3 area 0
.1 .2 10.10.0.0/30 .2 .1
192.168.10.0/24 192.168.11.0/24
OSPF Configuration
192.168.10.0/24 .1 .2 10.10.0.0/30 .2 .1
192.168.11.0/24
OSPF configuration
- Enhanced distance vector (finds backup links, and converges quickly if a link goes down).
AS Number: a value <1-65535> which identifies an EIGRP routers in the same AS: those in the same
AS should have the same AS number to be able to activate neighbor relationships.
If no wildcard mask is specified the EIGRP will use the classful prefix by default.
𝐾2∗𝐵𝑊 𝐾5
Cost= 𝐾1 ∗ 𝐵𝑊 + + 𝐾3 ∗ 𝑑𝑒𝑙𝑎𝑦 ∗ ∗ 256
256−𝐿𝑜𝑎𝑑 𝐾4+𝑟𝑒𝑙𝑖𝑎𝑏𝑖𝑙𝑖𝑡𝑦
107
With 𝐵𝑊 =
𝐵𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ
𝐾2∗𝐵𝑊 𝐾5
Cost= 𝐾1 ∗ 𝐵𝑊𝑚𝑖𝑛 + + 𝐾3 ∗ 𝑑𝑒𝑙𝑎𝑦 ∗ ∗ 256
256−𝐿𝑜𝑎𝑑 𝐾4+𝑟𝑒𝑙𝑖𝑎𝑏𝑖𝑙𝑖𝑡𝑦
- RIP v2 is an improvement of RIPv1, it supports variable subnettig of the network and is more
secure.
3c other
3a 2c
3b 2a networks
2b
1c
AS3
other 1a 1b AS2
networks
1d
AS1
Border Gateway Protocol (BGP) is the protocol used for exchanging routing information between
different autonomous systems (ASes) on the Internet.
• It is a path vector protocol that makes routing decisions based on paths, rules, and network
policies.
• Routing decisions are made using attributes such as AS path, Next-Hop, and Local Preference.
• BGP is the protocol of the Internet (The Internet being a collection of thousands of interconnected
networks (AS), each managed by organizations like ISPs, data centers, and enterprises).
• Uses TCP (Port 179) to establish a connection and exchange routing updates.
• It is defined in Request for Comments (RFCs) by the Internet Engineering Task Force (IETF) RFC
4271.
Pr. Hajar El Hammouti Communications & Networking 2 46
BGP: Border Gateway Protocol
2b
2a ∂
2c
1b 3b
2d
1a 1c ∂
3a 3c
AS 2
1d 3d
AS 1 eBGP connectivity AS 3
iBGP connectivity
Loop Prevention
Whenever a router sees its own AS number in the route update it will drop that route/path
Network 100.100.0.0 is
Router 1 Router 2
Router 1 finds out that its reachable through AS
AS: 64700 AS: 64800
64700
own AS number is in the
advertised route, so it
drops this route.
Router 3
AS: 64900
Neighbor Table:
Information about all the list of manually defined neighbors are managed in the neighbor table.
# show ip bgp neighbors
The list of all possible networks learnt by BGP is stored along with their attributes in this table
#show ip bgp
Routing table (after selecting the best path):
The list of only the best path is available in the IP routing table
# show ip route
BGP Neighborhood
- BGP Neighbor router is also called BGP Peer.
- Neighbors are manually defined (unlike other routing protocols that form routing protocols
automatically).
- TPC connection is used to retransmit lost data, avoid duplicate data, etc..
Which means the router with this IP Address is neighbor and belongs to AS number..
Router A Router B
AS: 100 Network AS: 200
Network Network
192.168.1.0/24
10.10.10.0/24 is 192.168.1.2 20.20.20.0/24 is
192.168.1.1 between the two
connected to connected to
routers
router A routerB
Router configuration
RouterA(config)# router bgp 100 (enabling BGP on router A)
RouterA(config-router)# neighbor 192.168.1.2 remote-as 200 (manually configure router 2
interface as neighbor and belongs to AS 200)
RouterA(config-router)# network 10.10.10.0 mask 255.255.255.0 (advertise network
10.10.10.0 as being attached to Router A)
3/ Update:
- Sent if any new route is added or existing route is deleted
- or if any of the path attributes is updates
4/ Notification:
- To advertise for error messages such as (« BGP version is not supported»)
2/ Local Preference:
- It is used within the autonomous system
- It is exchanged between the BGP routers within the same AS
- It is used to choose the outbound BGP path which has the highest local preference.
- The default local preference value is 100
3/ AS path:
- It helps reaching the target destination using the shortest path
- or if any of the path attributes is updates
• BGP gateway receiving route advertisement uses import policy to accept/decline path (e.g., never route through
AS Y, because we do not truct or what so ever).
• AS policy also determines whether to advertise path to other neighboring ASes
AS 3 3b
AS 1 1b 3a 3c
1a 1c AS 2 3d X
2b
1d AS3, X
AS2,AS3,X 2a 2c
2d
▪ AS2 router 2c receives path advertisement AS3,X (via eBGP) from AS3 router 3a
▪ based on AS2 policy, AS2 router 2c accepts path AS3,X, propagates to all AS2 routers
▪ based on AS2 policy, AS2 router 2a advertises (via eBGP) path AS2, AS3, X to AS1 router 1c
Pr. Hajar El Hammouti Communications & Networking 2 55
BGP: Border Gateway Protocol
AS 3 3b
AS 1 1b
AS3,X
AS3,X 3a 3c
1
AS3,X
1a 1c AS 2 3d X
2 2b
local link AS3,X
2 1 AS3, X
interfaces 1d
at 1a, 1d AS2,AS3,X 2a 2c
2d
dest interface ▪ recall: 1a, 1b, 1d learn via iBGP from 1c: “path to X goes through 1c”
… …
1c 1 ▪ at 1d: OSPF intra-domain routing: to get to 1c, use interface 1
X 1 ▪ at 1d: to get to X, use interface 1
… …
2d
dest interface
… … ▪ recall: 1a, 1b, 1d learn via iBGP from 1c: “path to X goes through 1c”
1c 2
▪ at 1d: OSPF intra-domain routing: to get to 1c, use interface 1
X 2
… … ▪ at 1d: to get to X, use interface 1
▪ at 1a: OSPF intra-domain routing: to get to 1c, use interface 2
▪ at 1a: to get to X, use interface 2
Pr. Hajar El Hammouti Communications & Networking 2 57
Hot Potato Routing
AS 3 3b
AS 1 1b 3a 3c
1a 1c AS 2 3d X
2b 112
1d AS1,AS3,X AS3,X
2a 2c
201 263
2d
OSPF link weights
Policy:
▪ inter-AS: admin wants control over how its traffic routed, who routes
through its network
▪ intra-AS: single admin, so policy less of an issue
Scale:
▪ hierarchical routing saves table size, reduced update traffic
Performance:
▪ intra-AS: can focus on performance
▪ inter-AS: policy dominates over performance
Policy:
▪ inter-AS: admin wants control over how its traffic routed, who routes
through its network
▪ intra-AS: single admin, so policy less of an issue
Scale:
▪ hierarchical routing saves table size, reduced update traffic
Performance:
▪ intra-AS: can focus on performance
▪ inter-AS: policy dominates over performance
Internet network layer: historically implemented via distributed, per-router control approach:
monolithic router contains switching hardware, runs proprietary implementation of
Internet standard protocols (IP, RIP, IS-IS, OSPF, BGP) in proprietary router OS (e.g., Cisco
IOS)
different “middleboxes” for different network layer functions: firewalls, load balancers,
NAT boxes, ..
~2005: renewed interest in rethinking network control plane