MP-BGP and Address Families

05. Session Layer of OSI Model (Layer5)

As obvious from the name, this layer is designed to allow devices to establish and manage sessions so that multiple channels could be established b/w same terminals. Session Layer is the 5th layer in the 7Layer OSI Model after Transport Layer. OSI Model divides the network communication processes into seven layers in order to simplify it. Each layer performs specific functions to support the layers above it. The 7x Layer model starts from Physical till Application Layer.

Session Layer is also called as port layer. The main function of Session Layer is to establish, maintain and synchronize the interaction between communicating systems. It allows information of different streams, originating from different sources, to be properly combined or synchronized.

OSI Model Layers Waqas Karim

 

Functions/Duties of Session Layer

Each Layer in OSI Model Performs some important duties. Important functions performed by Session Layer are listed here:

The boundaries between layers start to get blurred once we cross Transport Layer. It becomes hard to categorize what exactly belongs at layer 5/6/7. These some of the functions that are performed by Session Layer along with the support of other layers:

  • Sessions Management: It is Responsible for establishment, management and termination of sessions & connections between end user applications. It works in three phases:
    • In the Session establishment phase, the service and the rules for communication between the two devices are proposed & agreed upon. For example, who transmits and when, how much data can be sent at a time etc.
    • Once the rules are established, the data transfer phase begins.
    • Finally, connection termination occurs when the session is complete, and communication ends gracefully.
  • Duplex Control: Session Layer also controls that whether both sender/receiver of a session will communicate at same time or one will speak & other will listen
  • Authentication (It is for Authentication b/w peer computers before the exchange happens e.g. simple username/password authentication
  • Authorization (It confirms what a user is authorized to perform).

 

Authentication is the process of verifying that “you are who you say you are”,

Authorization is the process of verifying that “you are permitted to do what you are trying to do”.

 

Session Layer Protocols

The OSI Model provides a conceptual framework for communication between computers, but the model itself is not a method of communication. Actual communication is made possible by using communication protocols. Each layer on the OSI Model has some protocols associated with it. Some important protocols on Session layer are listed in below:

OSI Model Session Layer Waqas Karim Pic1

 

Network Equipment/Components at Session Layer

Similar to protocols, each layer has associated equipment with it. Some important Equipment that operate at Session Layer of OSI Model are listed in below:

OSI Model Session Layer Waqas Karim Pic2

 

Summary

  • It is the 5th Layer in OSI 7 Layer Model
  • It performs important functions like Sessions Management, Authentication, Authorization, Duplex Control,  …
  • Important Protocols at Session Layer include SIP, PPTP, H.245, PPTP/L2TP, SMB, NFS, PAP, …
  • Equipment operating at Session Layer include Firewalls, Gateways, Load Balancers, Computers,..

 

02. Data Link Layer of OSI Model (Layer2)

OSI Model divides the network communication processes into seven layers in order to simplify it. Each layer performs specific functions to support the layers above it. The 7x Layer model starts from Physical till Application Layer. Data Link Layer is the second layer in the 7Layer OSI Model after Physical Layer. This is the place where most LAN, Ethernet and wireless LAN technologies are defined.

Data Link controls the Layer2 Network boundary. The data link layer provides functional and procedural methods of transferring data between two points. It works like traffic control system which works without concern to their ultimate destination. When devices attempt to use a medium simultaneously, frame collisions occur. Protocols like Data link specify how devices detect and recover from such collisions and may provide mechanisms to reduce or prevent them.

PDU at Data Link Layer is called Frame.

OSI Model Layers Waqas Karim

Sub-Layers of Data Link Layer

Data Link Layer has two further Sublayers which perform different functions. These layers are:

i. LLC (Logical Link Control) Sub-Layer

This LLC sublayer is primarily concerned with multiplexing protocols to be sent over Media Access Control (MAC) sublayer. The LLC does this by splitting up the data to be sent into smaller frames and adding descriptive information to these frames, called headers.

ii. MAC (Media Access Control) Sub-Layer

Media Access Control Layer controls how a computer on the network gains access to the data  … and permission to transmit it.

The MAC sublayer is also responsible for the actual access to the network cable, or communication medium.

 

Data Link Layer Protocols

The OSI Model provides a conceptual framework for communication between computers, but the model itself is not a method of communication. Actual communication is made possible by using communication protocols. Each layer on the OSI Model has some protocols associated with it. Some important protocols on Data Link layer are listed in below:

OSI Model Data LInk Layer Waqas Karim Pic1

 

 Network Equipment/Components at Data Link Layer

Similar to protocols, each layer has associated equipment with it. Some important Equipment that operate at Data Link Layer of OSI Model are listed in below:

OSI Model Data LInk Layer Waqas Karim Pic2

 

Summary

  • Data Link Layer is the 2nd Layer in OSI 7 Layer Model
  • It performs very important functions like L2 Switching, Logical Link Control, Media Access Control, Physical Addressing, Encapsulation, Error Control, …
  • Important Protocols at Data Link Layer include Ethernet, HDLC, ARP, PPP, Frame Relay, VLAN, STP, L2 QoS, LLDP, CDP, L2TP, NDP, VTP, MAC, …
  • Equipment operating at Data Link Layer include L2 Switches, Bridges, Access Points, Modems, NIC, …

 

01. Physical Layer of OSI Model (Layer1)

The 7x Layer model starts from Physical till Application Layer. OSI Model divides the network communication processes into seven layers in order to simplify it. Each layer performs specific functions to support the layers above it. Physical Layer is the first & lowest layer in the 7Layer OSI Model. It is responsible for ultimate transmission of data between sender & receiver. The physical layer defines the means of transmitting raw bits over the transmission media.  It also defines how the data is carried over the Physical media rather than logical data packets over a physical data link connecting network nodes. The bit stream is grouped into code words or symbols.

Below Figure shows the position of  Physical Layer in the OSI Model:

OSI Model Layers Waqas Karim

Functions/Duties of Physical Layer

  • Real data delivery of bits
  • Physical Medium standards of connectors, cabling, Radio, Wireless, … & their technical specifications like signal levels, impedance, Optical levels, Bandwidth, frequency, …      & their Mechanical specification like length, strength, dimensions, …). For example, Physical layer defines:
    • How many volts should be used to represent a 1 bit and how many for a 0?
    • Whether 1 will present an ON or 0 will present an ON at both sides
    • How many nanoseconds a bit lasts?
    • Whether transmission may proceed simultaneously in both directions?
    • Whether transmission may proceed simultaneously in both directions?
    • How many pins the network connector has and what each pin is used for?
  • Modulation Scheme (PSK, ASK, FSK, QAM, …)
  • Line coding (RZ, NRZ, NRZ–L, NRZ–M, Bipolar, …)
  • Bit synchronization for serial communications
  • L1 Flow Control to match sender/receiver rates
  • Start/Stop Signalling
  • Circuit Switching
  • L1 Multiplexing which is used in SDH, DWDM & OTN
  • Signal Processing including pulse shaping, Equalization, filtering,..
  • Bit-interleaving and other channel coding
  • Physical network topology specifications. It defines which topology of our network would be e.g. bus, ring, mesh or star network)
  • Bit rate Control,
  • Network/Port mode control (Point-to-point, multipoint or point-to-multipoint)
  • Communication type specification (e.g. Serial, parallel communication)
  • Duplex Control (Simplex, half duplex or full duplex transmission mode)
  • Negotiation Control (Auto-negotiation, Manual, …)
  • CSMA-CD Control & specification
  • FEC (Forward Error Correction) for Error Control which is commonly used in SDH & DWDM

 

Physical Layer Protocols

The OSI Model provides a conceptual framework for communication between computers, but the model itself is not a method of communication. Actual communication is made possible by using communication protocols. Each layer on the OSI Model has some protocols associated with it. Some important protocols on Physical layer are listed in below:

 

 Network Equipment/Components at Physical Layer

Similar to protocols, each layer has associated equipment with it. Some important Equipment that operate at Physical Layer of OSI Model are listed in below:

 

Summary

  • Physical Layer is the 1st & Lowest Layer in OSI 7 Layer Model
  • It performs very important functions like transmission of data, Multiplexing, Line Coding, Modulation, Physical Media standardization, Error Control, Flow Control, …
  • Important Protocols at Physical Layer include WiFi, USB, Bluetooth , RJ45, SDH, DWDM, OTN, MW, RS232, ATM, DSL, …
  • Equipment operating at Physical Layer include Hubs, Repeaters, NIC, Modems, Media Convertors, Ethernet Cables, Optical Fibers, Patch Panels, …

 

OSI Model Summary Cheatsheet

OSI Model

OSI Model (Open Systems Interconnection Model) is simply a reference tool, a standardised Reference Framework for conceptualising data communications between networks.OSI Model

OSI was the first conceptual model that characterized and standardized the communication functions of a Network system without regard to its underlying internal structure and technology.

OSI is a Vendor Neutral Model. Before OSI Model, each vendor used to use its own network model to manufacture Network equipment. So, one vendor’s equipment & network was not compatible with another vendor’s equipment. Buyers were bound to buy only from one vendor.

For example, if you were buying IBM Computers then you were now bound to buy all Network Equipment from IBM as well in the future. Because IBM Computers couldn’t be connected by other vendor Switches or Routers. You must buy IBM Switches to connect them. They will not work with HP Server or Cisco Switches.

OSI Model

To resolve this problem, the idea of a standardised Network Model emerged. International Organization for Standardization (ISO) started working on it, different network models were proposed and finally the OSI Model was chosen & released in 1984 by ISO. OSI provided brought in the flexibility along with standardization.

In simple words, OSI reference model describes how information from a software application in one computer moves through a network medium to a software application in another computer.

*An important point worth of mentioning here is that: Although OSI is the standard today but we never find it on real equipment. The model in action today is TCP/IP. OSI is used only for standardization & reference purposes.

 

Layers in OSI Model

OSI Model divides the network communication processes into seven layers in order to simplify it. Each layer performs specific functions to support the layers above it … which we will discuss in detail later. OSI Model has 7x Layers starting from Physical till Application level as in below:OSI Model

Physical Layer standardises the Physical medium. For example, signal level, voltage, radio, cabling standards & so on…. It simply, standardises everything which you can touch & feel. Physical layer is responsible for ultimate transmission of digital data bits in the form of electrical, optical or radio signals from the Physical layer of the source or sending device over network communications media to the Physical layer of the receiving of destination device.  Data Link Layer standardizes the Physical Addressing. It is responsible for Data Switching. Physical addressing includes MAC Address & Ethernet Frames. Network Layer deals with Logical Addressing. It is responsible for Data Routing. Transport Layer ensures the error free data transmission across networks. It mainly focuses on data delivery. Transport Layer mainly uses two protocols called TCP & UDP which we will discuss in detail in later sections.  Session Layer is responsible for session control. In simple words, it manages on how to start, control, and end conversations between two hosts or computers.  Presentation Layer is responsible for data organization & conversion so that it is readable by Application layer of all hosts/applications involved in the data communication.  Application Layer is responsible for end-user processes or applications. It supplies network services to end-user applications.

 

Continue Reading…

 

Previous Page ——————————————————–    Next Page   

 

Principles of Bit Errors – I

Errors occurring to data during the transmission process are called Bit Errors (BER). It is a key parameter that is used in assessing systems that transmit digital data from one location to another. Specifically, it is the error of a single number between receiving and sending data signals.

BER is critical for radio data links, Optical data systems (fiber), Ethernet. The basis of BER are same in all of these systems even though there are some differences in functioning of these systems, how they work and the way in which Bit Error rate is affected. . A good knowledge of the BER also enables other features of the link to be adjusted (such as the power and bandwidth, .. ) to enable the required performance to be obtained.

Below are relevant ITU-T Recommendations related to Bit Errors, control, Design & specifications:

  G.821   Specifies the Bit Error performance parameter connected with 64k bps, on the basis of bit.

  G.826   Specifies high bit rate channel Bit Error performance parameter, on the basis of block.

  G.828   Specifies Bit Error performance event, parameter and indices of international Constant Bit Rate (CBR) synchronous digital channel. It is applicable to lower order and higher order paths borne by SDH, that is, channels VC-n and VC-n-Xc. It is also applicable to the VC-n borne by PDH that meets the G.832 recommendations. The difference from G.826 is that the index defined by it is more strict than that of G.826.

  M.2100   It is a maintenance recommendation. It allows a short-term test. The test result can indicate whether the G.826 long-term requirement is met. In most cases, if the index recommended by M.2100 is satisfied, it can also meet the requirement of G.826.

 

In simple words, BER is important to consider in Design & Operation for any system that transmits data over a network of some form where noise, interference and phase jitter may cause degradation of the digital signal.

The working principle of BER assessment is a bit different from other forms of assessment. BER method assesses the full E2E performance of a system including the transmitter, receiver and the medium between the two. In this way, bit error rate, BER enables the actual performance of a system in operation to be tested, rather than testing the component parts and hoping that they will operate satisfactorily when all are connected together for form a system. Bit errors optimization is critical for stable network operations. To understand the Bit Errors in deep, we need a solid grip on Factors that control BER, BER Events, Reporting Points of BER, Testing & so on…

 

 

Bit Error Rate (BER) Calculation

Bit Error is simply the calculation of how many bits have been damaged during transmission out of the total. This definition can be translated into a simple formula.

The formula for calculation of Bit Error Rate is:

 

If the medium between the transmitter and receiver is good and the signal to noise ratio is high, then the bit error rate will be very small – possibly insignificant and having no noticeable effect on the overall system However if noise can be detected, then there is chance that the bit error rate will need to be considered.

The main reasons for the degradation of a data channel and the corresponding bit error rate, BER is noise and changes to the propagation path (where radio signal paths are used). Both effects have a random element to them, the noise following a Gaussian probability function while the propagation model follows a Rayleigh model. This means that analysis of the channel characteristics are normally undertaken using statistical analysis techniques.

For fibre optic systems, bit errors mainly result from imperfections in the components used to make the link. These include the optical driver, receiver, connectors and the fibre itself. Bit errors may also be introduced as a result of optical dispersion and attenuation that may be present. Also noise may be introduced in the optical receiver itself. Typically these may be photodiodes and amplifiers which need to respond to very small changes and as a result there may be high noise levels present.

 

 

Bit Error Control Factors

BER depends on a number of factors. Some of them are controllable & some are out of system design control. By manipulating the variables that can be controlled it is possible to optimize our system to provide the optimum performance levels. These measures are best to be undertaken in the network design phase of the project so that the performance parameters can be adjusted at the initial design concept stages. Important factors that control BER are in below:

Interference  The interference levels in a system are generally induced by external factors and can not be changed by the system design. However it is possible to set the bandwidth of the system. By reducing the bandwidth the level of interference can be reduced. However reducing the bandwidth reduces the maximum data throughput.

Transmitter Power  It is also possible to increase the power level of the system so that the power per bit is increased. This has to be balanced against factors including the interference levels to other users and the impact of increasing the power output on the size of the power amplifier and overall power consumption and battery life, etc.

Lower order modulation  Lower order modulation schemes can be used, but this is at the expense of data throughput.

Bandwidth  Another approach that can be adopted to reduce the Bit Error Rate is to reduce the bandwidth. Lower levels of noise will be received and therefore the signal to noise ratio will improve. Again this results in a reduction of the data throughput attainable.

 

It is critical to balance all the available factors to achieve a satisfactory bit error rate. But normally it is not possible to achieve all the requirements and some compromises & trade-offs are always required. The BER can be improved by choosing a strong signal strength (upto a certain level because after this level cross-talk occurs which results in even more bit errors), by choosing a slow and robust modulation scheme or line coding scheme and by applying channel coding schemes such as redundant forward error correction codes.

 

Relationship of BER & Measurement Points

It is important to understand the different points/parts of a Transmission system especially SDH. The optical synchronous transmission equipment makes an overall system check for bit errors by sections and layers, including B1 (regenerator section bit error), B2 (multiplex section bit error), B3 (higher-order path bit error) and V5 (lower-order path bit error). Their relation is illustrated below:

From the above figure, RST, MST, HPT and LPT indicate regenerator section terminal, multiplex section terminal, higher-order path terminal and lower-order path terminal respectively. B1, B2, B3 and V5 bit error are detected between these terminals.

If only the lower-order path has bit errors, no bit error can be detected at higher-order path, multiplex section and regenerator section. If the regenerator section has bit errors, bit errors will occur to multiplex section, higher-order path and lower-order path.

The relation between bit errors: Generally, if there are higher-order bit errors, there will be lower-order bit errors. For example, if there is a B1 bit error, there will be bit errors of B2, B3 and V5. Contrarily, there may not be higher-order bit errors when lower-order bit errors exist. For example, if there is a V5 bit error, there may not be bit errors of B3, B2 and B1.

Because higher-order bit error will lead to lower-order bit error, we should process the bit errors by the sequence of higher-order and lower-order.

 

 

Bit Error Performance Events

Important Bit Error Performance Events are listed in below table:

 

Error Block (EB) is the set of consecutive bits on channel, namely, a group of bits. Each bit belongs to and only belongs to a unique block. Treat a group of bits as an integrity. One or multiple bit errors are called block error, namely, the term Errored Block adopted in the G.826 recommendations. Background Block Error (BBE) refers to block error out of SES. ES is the Bit error second. In the G.821 it is defined as one or multiple errored bits in a second. Severed bit error seconds (SES) is bit error rate in a second if it is ≥10-3 as defined in G.821. Severed errored block second: In G.826 it is defined as errored blocks in a second, ≥30℅ or at least one error. Unavailable Second (UAS) is a period that starts from the first second of ten consecutive SESs.

 

Continued ….

 

Principles of Bit Errors – II

BGP Local Preference (LOCAL_PREF)

BGP LOCAL_PREF is the Second BGP attribute if we dive deep into BGP’s algorithm of best path selection followed by aggregate (detailed in my first post in BGP section). 

When an AS (autonomous system) has multiple routes to another AS, the LOCAL_PREF indicates the degree of preference for one route over the other routes. The route with the highest LOCAL_PREF value is preferred.

You can watch the detailed video on LOCAL_PREF on our YouTube Channel:

LOCAL_PREF, Weight & MED are often confused with each other. LOCAL_PREF is different from Weight & MED. Unlike weight, LOCAL_PREF is not vendor specific (Weight is Cisco proprietary, so it is found only on Cisco routers). LOCAL_PREF is to influence your own AS how to get or exit to another AS while MED is to influence other AS how to enter your AS. Means, LOCAL_PREF is used to influence route selection within the local autonomous system. MED is b/w AS’s while LOCAL_PREF is only for local AS. LOCAL_PREF only affect the traffic leaving the AS.

 

LOCAL_PREF is always exchanged between iBGP Peers i.e. if we change the LOCAL_PREF on one the router, it is broadcasted to all the iBGP Neighbors in the AS. LOCAL_PREF is never exchanged between eBGP Peers (it is only exchanged between iBGP Peers).

The path with the highest LOCAL_PREF is always preferred.

LOCAL_PREF is a ‘Well-Known Discretionary’ BGP attribute. Well Known means that it must be recognized by all the BGP Routers. 

Discretionary means that although LOCAL_PREF is recognized by all BGP Routers in the domain but it may or may not be sent in a specific Update message. Its up to the discretion of BGP Implementation to send or not to send these attributes in the update messages to the peers.

LOCAL_PREF is a 32-bit number. So, it ranges from 0 to 4294967295 (232 – 1). Default LOCAL_PREF value is 100 (if we don’t set any value, all routes/routers have a LOCAL_PREF of 100). If a BGP route is received without a LOCAL_PREF attribute, the route is stored in the routing table and advertised by BGP as if it were received with a LOCAL_PREF value of 100. A non-BGP route that is advertised by BGP is advertised with a LOCAL_PREF value of 100 by default.

LOCAL_PREF is always set on inbound on routes which we receive and it influences the OUTBOUND routing behaviour. We use LOCAL_PREF when we want to influence our BGP routing OUTBOUND on a router.

Let me explain it through a simple example in below.

 

 

Configuration Example

There are different methods to set LOCAL_PREF in BGP including Global commands, route maps and so on. We will use Global level command in this example:

Consider below topology. Here we have four Routers. R1 is receiving a route for 4.4.4.4/32 from both R2 & R3.

In normal conditions, it will prefer the route from R3. We can influence this selection by using higher LOCAL_PREF towards R2.

First, lets establish simple BGP as in below:

 

atech_R1
atech_R1(config)#router bgp 100
atech_R1(config-router)#bgp router-id 1.1.1.1
atech_R1(config-router)#bgp log-neighbor-changes
atech_R1(config-router)#neighbor 12.12.12.2 remote-as 200
atech_R1(config-router)#neighbor 13.13.13.3 remote-as 200

 

atech_R2
atech_R2(config)#router bgp 200
atech_R2(config-router)#bgp router-id 2.2.2.2
atech_R2(config-router)#bgp log-neighbor-changes
atech_R2(config-router)#neighbor 3.3.3.3 remote-as 200
atech_R2(config-router)#neighbor 3.3.3.3 update-source Loopback0
atech_R2(config-router)#neighbor 3.3.3.3 next-hop-self
atech_R2(config-router)#neighbor 4.4.4.4 remote-as 200
atech_R2(config-router)#neighbor 4.4.4.4 update-source Loopback0
atech_R2(config-router)#neighbor 4.4.4.4 next-hop-self
atech_R2(config-router)#neighbor 12.12.12.1 remote-as 100

 

atech_R3
atech_R3(config)#router bgp 200
atech_R3(config-router)#bgp router-id 3.3.3.3
atech_R3(config-router)#bgp log-neighbor-changes
atech_R3(config-router)#neighbor 2.2.2.2 remote-as 200
atech_R3(config-router)#neighbor 2.2.2.2 update-source Loopback0
atech_R3(config-router)#neighbor 2.2.2.2 next-hop-self
atech_R2(config-router)#neighbor 4.4.4.4 remote-as 200
atech_R2(config-router)#neighbor 4.4.4.4 update-source Loopback0
atech_R2(config-router)#neighbor 4.4.4.4 next-hop-self
atech_R3(config-router)#neighbor 13.13.13.1 remote-as 100

 

 

atech_R4
atech_R4(config)#router bgp 200
atech_R4(config-router)#bgp router-id 4.4.4.4
atech_R4(config-router)#bgp log-neighbor-changes
atech_R4(config-router)#neighbor 2.2.2.2 remote-as 200
atech_R4(config-router)#neighbor 2.2.2.2 update-source Loopback0
atech_R4(config-router)#neighbor 2.2.2.2 next-hop-self
atech_R4(config-router)#neighbor 3.3.3.3 remote-as 200
atech_R4(config-router)#neighbor 3.3.3.3 update-source Loopback0
atech_R4(config-router)#neighbor 3.3.3.3 next-hop-self
atech_R4(config-router)#network  4.4.4.4 mask 255.255.255.255

 

Now, if we check the route at R1:

atech_R1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network        Next Hop     Metric   LocPrf     Weight     Path
*>4.4.4.4/32   12.12.12.2                        0         200 i
*>             13.13.13.3                        0         200 i

We can see that although it is receiving 4.4.4.4/32 route from both R2 & R3 but it is preferring the route from R3 by default. 

Now, lets increase LOCAL_PREF on R2:

atech_R2(config)#router bgp 200
atech_R2(config-router)#bgp default local-preference 200

 

atech_R1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not foundNetwork          Next Hop      Metric    LocPrf    Weight    Path
* 4.4.4.4/32     13.13.13.3                        0 200 i
*>               12.12.12.2                        0 200 i

 

As in above, R1 is preferring route from R2 now because it has High LOCAL_PREF as compared to R3. In this way, we can influence the BGP route selection by changing the LOCAL_PREF.

We can achieve the same results by using Route Maps which gives more granularity & control upto prefix level. The route map simply captures all the desired routes & apply it on the neighbor command.

 

 

*Note
There is already IGP(OSPF) in AS200 which is required for iBGP. I have not showed the OSPF configuration here so that readers can focus & grip the topic under discussion i.e. LOCAL_PREF. This is OSPF configuration if you want to simulate the same lab yourself

 

R2
atech_R2(config)#router ospf 1
atech_R2(config-router)#router-id 2.2.2.2
atech_R2(config-router)#interface range Lo0, Fa0/0, Fa1/0
atech_R2(config-router)#ip ospf 1 area 0
R3
atech_R3(config)#router ospf 1
atech_R3(config-router)#router-id 3.3.3.3
atech_R3(config-router)#interface range Lo0, Fa0/1, Fa1/0
atech_R3(config-router)#ip ospf 1 area 0
R4
atech_R4(config)#router ospf 1
atech_R4(config-router)#router-id 4.4.4.4
atech_R4(config-router)#interface range Lo0, Fa0/0, Fa0/1
atech_R4(config-router)#ip ospf 1 area 0

 

*No OSPF on R1 as it has only eBGP..

 

 

You can watch the detailed video on LOCAL_PREF in English or Hindi/Urdu on our YouTube Channel:

 

I hope this article has been helpful to you. You suggestion, comments & questions are welcomed. Please write in comments below if any…

 

 

 

BGP Weight

BGP Weight is the first BGP attribute if we dive deep into BGP’s algorithm of best path selection followed by Local_Preference & aggregate (detailed in my first post in BGP section). Weight is vendor specific (Cisco proprietary) so it is found only on Cisco routers. Weight is always local on a router and it is not exchanged between BGP routers. The path with the highest weight is always preferred.

The range of Weight is 0-65535 and it defaults to 0 always. i.e. The default weight for learned routes is 0 and the default weight for a locally originated route is 32768. We use Weight when we want to influence our BGP routing Outwards on a cisco router.

There are different methods to set weight in BGP. It can be set either through neighbor command, route maps or via the AS-PATH access list.

 

Configuration Example

Let me explain it through a simple example in below.

Here we have three Routers. R1 is receiving a route for 2.2.2.2/32 from both R2 & R3. In normal conditions, it will prefer the route from fa0/0. We can influence this selection by using higher Weight towards R3.

 

First, lets establish simple BGP as in below:

 

atech_R1
atech_R1(config)#router bgp 100
atech_R1(config-router)#bgp router-id 1.1.1.1
atech_R1(config-router)#bgp log-neighbor-changes
atech_R1(config-router)#neighbor 12.12.12.2 remote-as 200
atech_R1(config-router)#neighbor 13.13.13.3 remote-as 200

 

atech_R2
atech_R2(config)#router bgp 200
atech_R2(config-router)#bgp router-id 2.2.2.2
atech_R2(config-router)#bgp log-neighbor-changes
atech_R2(config-router)#network 2.2.2.2 mask 255.255.255.255
atech_R2(config-router)#neighbor 3.3.3.3 remote-as 200
atech_R2(config-router)#neighbor 3.3.3.3 update-source Loopback0
atech_R2(config-router)#neighbor 3.3.3.3 next-hop-self
atech_R2(config-router)#neighbor 12.12.12.1 remote-as 100

 

atech_R3
atech_R3(config)#router bgp 200
atech_R3(config-router)#bgp router-id 3.3.3.3
atech_R3(config-router)#bgp log-neighbor-changes
atech_R3(config-router)#neighbor 2.2.2.2 remote-as 200
atech_R3(config-router)#neighbor 2.2.2.2 update-source Loopback0
atech_R3(config-router)#neighbor 2.2.2.2 next-hop-self
atech_R3(config-router)#neighbor 13.13.13.1 remote-as 100

Now, if we check the route at R1:

atech_R1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not foundNetwork        Next Hop     Metric   LocPrf     Weight     Path
*>2.2.2.2/32   12.12.12.2                        0         200 i
*              13.13.13.3                        0         200 i

We can see that although it is receiving 2.2.2.2/32 route from both R2 & R3 but it is preferring the route from R2 by default.Now, if we increase the weight on R1 towards R3:

atech_R1(config)#router bgp 100
atech_R1(config-router)# neighbor 13.13.13.3 weight 100

 

atech_R1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not foundNetwork       Next Hop    Metric LocPrf Weight Path
*> 2.2.2.2/32 13.13.13.3                100    200 i
*             12.12.12.2  0             0      200 i

 

As in above, R1 is preferring route from R3 now because it has more weight as compared to R2. So, we can influence the BGP route selection by changing the weight.

We can achieve the same results by using Route Maps which gives more granularity & control upto prefix level. The route map simply captures all the desired routes & apply it on the neighbor command.

 

 

I hope this article has been helpful to you. You suggestion, comments & questions are welcomed. Please write in comments below if any…