You are on page 1of 83

Chapter Three

The OSI and TCP/IP Communication Models

Fundamentals of Networking
Objectives
 In this Section, you will learn about:

Communication and layer Architecture

Layered Task

Open system Interconnection (OSI)


Communication and Layer Architecture
 Network is a combination of hardware and software that sends data from
one location to another.
 Hardware
 Consists of the physical equipment that carries signals from one point of the
network to another.
 Software
 Consists of instruction sets that make possible the services that we expect
from a network
 For example, the task of sending an e-mail from one point in the world
to another can be broken into several tasks, each performed by a
separate software package.
 Each software package uses the services of another software package. At
the lowest layer, a signal, or a set of signals, is sent from the source
computer to the destination computer.
Layered Tasks
 We use the concept of layers in our daily life. As an example, let us
consider two friends who communicate through postal mail.
 The process of sending a letter to a friend would be complex if there
were no services available from the post office.
Cont’d
 A communication architecture is a strategy for connecting host computers and
other communicating equipment.
 It defines necessary elements for data communication between devices.
 A communication architecture, therefore, defines a standard for the
communicating hosts.
 A programmer formats data in a manner defined by the communication
architecture and passes it on to the communication software.
 Separating communication functions adds flexibility, for example, we do not
need to modify the entire host software to include more communication
devices.
 Layer architecture simplifies the network design.
 It is easy to debug network applications in a layered architecture network.
 The network management is easier due to the layered architecture.
 Network layers follow a set of rules, called protocol.
 The protocol defines the format of the data being exchanged, and the control
and timing for the handshake between layers.
Open Systems Interconnection (OSI)
 International standard organization (ISO) established a committee in
1977 to develop an architecture for computer communication.
 Open Systems Interconnection (OSI) reference model is the result of
this effort.
 In 1984, the Open Systems Interconnection (OSI) reference model was
approved as an international standard for communications architecture.
 Term “open” denotes the ability to connect any two systems which
conform to the reference model and associated standards.
 The OSI model is now considered the primary Architectural model for
inter-computer communications.
 The OSI model describes how information or data makes its way from
application programmes (such as spreadsheets) through a network
medium (such as wire) to another application programme located on
another network.
 The OSI reference model divides the problem of moving information
between computers over a network medium into SEVEN smaller and
more manageable problems.
 This separation into smaller more manageable functions is known as
layering.
The Seven Layers
Cont’d
 The OSI model is composed of seven ordered layers:
 physical (layer 1), data link (layer 2), network (layer 3), transport (layer 4), session
(layer 5), presentation (layer 6), and application (layer 7).
 The next figure shows layers involved when message is sent from device A to B. As
message travels from A to B, it may pass through many intermediate nodes.
 These intermediate nodes usually involve only the first three layers of OSI model.
Cont’d
 In developing the model, the designers distilled the process of transmitting data to its most
fundamental elements.
 They identified which networking functions had related uses and collected those
functions into discrete groups that became the layers.
 Each layer defines a family of functions distinct from those of the other layers. By
defining and localizing functionality in this fashion, the designers created an
architecture that is both comprehensive and flexible.
 Most importantly, the OSI model allows complete interoperability between
otherwise incompatible systems.
 Within a single machine, each layer calls upon the services of the layer just below
it. Layer 3, for example, uses the services provided by layer 2 and provides services
for layer 4. Between machines, layer x on one machine communicates with layer x on
another machine. This communication is governed by an agreed-upon series of
rules and conventions called protocols. The processes on each machine that
communicate at a given layer are called peer-to-peer processes.
 Communication between machines is therefore a peer-to-peer process using the
protocols appropriate to a given layer.
Peer-to-Peer Processes
 At the physical layer, communication is direct:
 At the higher layers, however, communication must move down through
the layers on device A, over to device B, and then back up through the
layers.
 Each layer in the sending device adds its own information to the message
it receives from the layer just above it and passes the whole package to
the layer just below it.
 At layer 1 the entire package is converted to a form that can be
transmitted to the receiving device.
 At the receiving machine, the message is unwrapped layer by layer, with
each process receiving and removing the data meant for it.
 For example, layer 2 removes the data meant for it, then passes the rest
to layer 3.
 Layer 3 then removes the data meant for it and passes the rest to layer 4,
and so on.
Cont’d
Interfaces Between Layers
 The passing of the data and network information down through the
layers of the sending device and back up through the layers of the
receiving device is made possible by an interface between each pair of
adjacent layers.
 Each interface defines the information and services a layer must provide
for the layer above it.
 Well-defined interfaces and layer functions provide modularity to a
network.
 As long as a layer provides the expected services to the layer above it,
the specific implementation of its functions can be modified or replaced
without requiring changes to the surrounding layers.
Organization of the Layers
 The seven layers can be thought of as belonging to three subgroups.
 Layers 1, 2, and 3 - physical, data link, and network - are network support
layers
 They deal with physical aspects of moving data from one device to another
(such as electrical specifications, physical connections, physical addressing,
and transport timing and reliability).
 Layers 5, 6, and 7- session, presentation, and application - can be thought of as
the user support layers;
 They allow interoperability among unrelated software systems.
 Layer 4, the transport layer, links the two subgroups and ensures that what the
lower layers have transmitted is in a form that the upper layers can use.
 The upper OSI layers are almost always implemented in software; lower layers are a
combination of hardware and software, except for the physical layer, which is mostly
hardware.
 The figure shown in the next slide, gives an overall view of the OSI layers, D7 means
the data unit at layer 7, D6 means the data unit at layer 6, and so on. The process starts
at layer 7 (the application layer), then moves from layer to layer in descending,
sequential order. At each layer, a header, or possibly a trailer, can be added to the data
unit.
 Commonly, the trailer is added only at layer 2. When the formatted data unit passes
through the physical layer (layer 1), it is changed into an electromagnetic signal and
transported along a physical link.
An exchange using OSI model

 Upon reaching its destination, the signal passes into layer 1 and is
transformed back into digital form. The data units then move back up
through the OSI layers.
 As each block of data reaches the next higher layer, the headers and
trailers attached to it at the corresponding sending layer are removed,
and actions appropriate to that layer are taken.
 By the time it reaches layer 7, the message is again in a form appropriate
to the application and is made available to the recipient.
Encapsulation
 A packet (header and data) at level 7 is encapsulated in packet at level 6.
 The whole packet at level 6 is encapsulated in a packet at level 5, and so
on.
 In other words, the data portion of a packet at level N - 1 carries the
whole packet (data and header and maybe trailer) from level N.
 The concept is called encapsulation; level N - 1 is not aware of which part of the
encapsulated packet is data and which part is the header or trailer.
 For level N - 1, the whole packet coming from level N is treated as one integral
unit.
Physical Layer
 Physical layer coordinates the functions required to carry a bit stream
over a physical medium.
 It deals with the mechanical and electrical specifications of the interface
and transmission medium.
 It also defines the procedures and functions that physical devices and
interfaces have to perform for transmission to occur.

Physical layer is responsible for movements of individual bits from one hop (node) to the
next.
Cont’d
 The physical layer is also concerned with the following:
 Physical characteristics of interfaces and medium: The physical layer defines the
characteristics of the interface between the devices and the transmission
medium. It also defines the type of transmission medium.
 Representation of bits: The physical layer data consists of a stream of bits
(sequence of 0s or 1s) with no interpretation. To be transmitted, bits must be
encoded into signals - electrical or optical. The physical layer defines the type of
encoding (how 0s and 1s are changed to signals)
 Data rate: The transmission rate - the number of bits sent each second - is also
defined by the physical layer. In other words, the physical layer defines the
duration of a bit, which is how long it lasts.
 Synchronization of bits: The sender and receiver not only must use the same bit
rate but also must be synchronized at the bit level. In other words, the sender
and the receiver clocks must be synchronized.
 Line configuration: The physical layer is concerned with the connection of
devices to the media (point – to – point or multipoint).
 Physical topology: The physical topology defines how devices are connected to
make a network.
 Transmission mode: The physical layer also defines the direction of transmission
between two devices: simplex, half-duplex, or full-duplex.
Data Link Layer
 Data link layer transforms the physical layer, a raw transmission facility, to a
reliable link.
 It makes the physical layer appear error-free to the upper layer (network layer).
The following figure shows the relationship of the data link layer to the network
and physical layers.

Data link layer is responsible for moving frames from one hop (node) to the next.
Layer 2 frame structure
Header Trailer
Start Frame Stop Frame
Data
(Flag) (Flag)
Address Type/Length FCS
Cont’d
 Responsibilities of the data link layer include the following:
 Framing: The data link layer divides the stream of bits received from the network
layer into manageable data units called frames.
 Physical addressing: If frames are to be distributed to different systems on the
network, the data link layer adds a header to the frame to define the sender and/or
receiver of the frame. If the frame is intended for a system outside the sender‘s
network, the receiver address is the address of the device that connects the
network to the next one.
 Flow control: If the rate at which the data are absorbed by the receiver is less than
the rate at which data are produced in the sender, the data link layer imposes a
flow control mechanism to avoid overwhelming the receiver.
 Error control: The data link layer adds reliability to the physical layer by adding
mechanisms to detect and retransmit damaged or lost frames. It also uses a
mechanism to recognize duplicate frames. Error control is normally achieved
through a trailer added to the end of the frame.
 Access control: When two or more devices are connected to the same link, data
link layer protocols are necessary to determine which device has control over the
link at any given time.
Cont’d
 Hop-to-hop (node-to-node) delivery by data link layer
Cont’d
 As the figure above shows, communication at the data link layer occurs between two

adjacent nodes.To send data from A to F, three partial deliveries are made.

 First, the data link layer at A sends a frame to the data link layer at B (a router).

 Second, the data link layer at B sends a new frame to the data link layer at E.

 Finally, the data link layer at E sends a new frame to the data link layer at F.

 Note that the frames that are exchanged between the three nodes have different

values in the headers. The frame from A to B has B as the destination address and A as
the source address. The frame from B to E has E as the destination address and B as
the source address. The frame from E to F has F as the destination address and E as the
source address. The values of the trailers can also be different if error checking
includes the header of the frame.
Framing
 Data link layer, needs to pack bits into frames, so that each frame is

distinguishable from another.

 Our postal system practices a type of framing.

 The simple act of inserting a letter into an envelope separates one piece of

information from another; the envelope serves as the delimiter.

 In addition, each envelope defines the sender and receiver addresses since the

postal system is a many-to-many carrier facility.

 Framing in the data link layer separates a message from one source to a

destination, or from other messages to other destinations, by adding a sender


address and a destination address.
Cont’d
 The destination address defines where the packet is to go; the sender
address helps the recipient acknowledge the receipt.
 NB: addressing here is about the next node in the LAN

 Although the whole message could be packed in one frame, that is not
normally done.
 One reason is that a frame can be very large, making flow and error
control very inefficient. When a message is carried in one very large
frame, even a single-bit error would require the retransmission of the
whole message. When a message is divided into smaller frames, a single-
bit error affects only that small frame.
 Frames can be of fixed or variable size.
Cont’d
 Fixed-Size Framing: In fixed-size framing, there is no need for defining the

boundaries of the frames; the size itself can be used as a delimiter. An


example of this type of framing is the ATM wide-area network, which uses
frames of fixed size called cells.

 Variable-Size Framing: variable-size framing is prevalent in local area


networks. In variable-size framing, we need a way to define the end of the
frame and the beginning of the next. Historically, two approaches were used
for this purpose: a character-oriented approach and a bit-oriented approach.
Character-Oriented Protocols
 In a character-oriented protocol, data to be carried are 8-bit characters from a
coding system such as ASCII.
 The header, which normally carries the source and destination addresses and other
control information, and the trailer, which carries error detection or error
correction redundant bits, are also multiples of 8 bits.
 To separate one frame from the next, an 8-bit (1-byte) flag is added at the
beginning and the end of a frame. The flag, composed of protocol-dependent
special characters, signals the start or end of a frame.
 Character-oriented framing was popular when only text was exchanged by the
data link layers. The flag could be selected to be any character not used for text
communication.
 Now, however, we send other types of information such as graphs, audio, and
video. Any pattern used for the flag could also be part of the information.
Cont’d
 If this happens, the receiver, when it encounters this pattern in the middle of
the data, thinks it has reached the end of the frame.
 To fix this problem, a byte-stuffing strategy was added to character-oriented
framing. In byte stuffing (or character stuffing), a special byte is added to the
data section of the frame when there is a character with the same pattern as the
flag.The data section is stuffed with an extra byte.
 This byte is usually called the escape character (ESC), which has a predefined
bit pattern.
 Whenever the receiver encounters the ESC character, it removes it from the
data section and treats the next character as data, not a delimiting flag.
 Byte stuffing by the escape character allows the presence of the flag in the data
section of the frame, but it creates another problem. What happens if the text
contains one or more normal escape characters followed by a flag?
Cont’d
The receiver removes the escape character, but keeps the flag, which is
incorrectly interpreted as the end of the frame. To solve this problem, the escape
characters that are part of the text must also be marked by another escape character.
In other words, if the escape character is part of the text, an extra one is added to
show that the second one is part of the text.

Byte stuffing is the process


of adding 1 extra byte
whenever there is a flag or
escape character in the
text.
Bit-Oriented Protocols
 In a bit-oriented protocol, the data section of a frame is a sequence of bits to be interpreted
by the upper layer as text, graphic, audio, video, and so on.
 However, in addition to headers (and possible trailers), we still need a delimiter to separate
one frame from the other. Most protocols use a special 8-bit pattern flag 01111110 as the
delimiter to define the beginning and the end of the frame, as shown in the figure.

 This flag can create the same type of problem we saw in the byte-oriented protocols.

 That is, if the flag pattern appears in the data, we need to somehow inform the receiver that
this is not the end of the frame. We do this by stuffing 1 single bit (instead of 1 byte) to
prevent the pattern from looking like a flag. The strategy is called bit stuffing. In bit stuffing, if
a 0 and five consecutive 1 bits are encountered, an extra 0 is added. This extra stuffed bit is
eventually removed from the data by the receiver.
Cont’d
 Note that the extra bit is added after one 0 followed by five 1s regardless of

the value of the next bit. This guarantees that the flag field sequence does
not inadvertently appear in the frame.

Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0
in the data, so that the receiver does not mistaken the pattern 0111110 for a flag.
Cont’d
 The above figure shows bit stuffing at the sender and bit removal at the receiver.

Note that even if we have a 0 after five 1s, we still stuff a 0. The 0 will be
removed by the receiver.

 This means that if the flag like pattern 01111110 appears in the data, it will

change to 011111010 (stuffed) and is not mistaken as a flag by the receiver. The
real flag 01111110 is not stuffed by the sender and is recognized by the receiver
as a flag.
Flow Control
 Flow control coordinates the amount of data that can be sent before receiving
an acknowledgment and is one of the most important duties of the data link
layer. In most protocols, flow control is a set of procedures that tells the sender
how much data it can transmit before it must wait for an acknowledgment from
the receiver.
 The flow of data must not be allowed to overwhelm the receiver. Any receiving
device has a limited speed at which it can process incoming data and a limited
amount of memory in which to store incoming data.
 The receiving device must be able to inform the sending device before those
limits are reached and to request that the transmitting device send fewer frames
or stop temporarily. Incoming data must be checked and processed before they
can be used.
 The rate of such processing is often slower than the rate of transmission. For
this reason, each receiving device has a block of memory, called a buffer,
reserved for storing incoming data until they are processed. If the buffer begins
to fill up, the receiver must be able to tell the sender to halt transmission until
it is once again able to receive.
Encapsulation
 As upper layer application data is determined for transmission over a network from

an end system, a series of processes and instructions must be applied to the data
before transmission can be successfully achieved.

 This process of appending and pre-pending instructions to data is referred to as

encapsulation and for which each layer of the reference model is designed to
represent. 7 Application Data

6
Presentation layer Data

5
Session layer Data
4
Transport layer Data
3
Network layer Data
2
Data link layer Data
1
Physical layer
Communication Between Two End Stations
 As part of the IEEE 802.3 Ethernet standard, data is encapsulated with

instructions in the form of a header and a trailer before it can be propagated


over physical media on which Ethernet is supported.

 Each stage of encapsulation is referred to by a protocol data unit or PDU, which

at the data link layer is known as a frame.


Host A Host B

Frame Header Data Trailer

 Data link layer frames are used to govern transmission over the
communications medium.
Frame Formats
Host A Host B

Ethernet II D.MAC S.MAC Type Data FCS

IEEE802.3 D.MAC S.MAC Length LLC SNAP Data FCS

Field Value >= 1536 (0x0600) Ethernet II

Field Value <= 1500 (0x05DC) IEEE802.3


Ethernet II Frame
 The Ethernet II frame references a hexadecimal type value which identifies the upper

layer protocol. One common example of this is the Internet Protocol (IP) which is
represented by a hexadecimal value of 0x0800. Since

 This value for IP represents a value greater than 0x0600, it is determined that the

Ethernet II frame type should be applied during encapsulation. Another common


protocol that relies on the Ethernet II frame type at the data link layer is ARP, and is
represented by the hexadecimal value of 0x0806.
6 bytes 6 bytes 2 bytes 46-1500 bytes 4 bytes
D.MAC S.MAC Type Data FCS

0x0800 IP 2048 (0x0800)

0x0806 ARP 2054 (0x0806)


The Ethernet II frame type is associated with protocols with a type value greater
than 1536 (0x600).
IEEE802.3 Frame
 For the IEEE 802.3 frame type, the type field is contained as part of the SNAP extension

header and is not so commonly applied the protocols in today’s networks, partially due to
the requirement for additional instructions which results in additional overhead per frame.

 Some older protocols that have existed for many years but that are still applied in support

of Ethernet networks are likely to apply the IEEE 802.3 frame type. One clear example of
this is found in the case of the Spanning Tree Protocol (STP) that is represented by a value
of 0x03 within the type field of the SNAP header.
6 bytes 6 bytes 2 bytes 38-1492 bytes 4 bytes
D.MAC S.MAC Length LLC SNAP Data FCS

1 byte 1 byte 1 byte 3 bytes 2 bytes


D.SAP S.SAP Control Org Code Type

STP 0x03 3 (0x03)


The IEEE 802.3 frame type is associated with protocols with a type value less
than 1500 (0x05DC).
Frame Forwarding
 Ethernet based networks achieve communication between two end stations on a local area

network using Media Access Control (MAC) addressing that allows end systems within a
multi access network to be distinguished.

 The MAC address is a physical address that is burned into the network interface card to

which the physical medium is connected.

 This same MAC address is retrieved and used as the destination MAC address of the

intended receiver by the sender, before the frame is transferred to the physical layer for
forwarding over the connected medium.

Media Access Control


(MAC) addressing facilitates
data link layer
communication.
MAC Address
 Each MAC address is a 48 bit value commonly represented in a hexadecimal

(base 16) format and comprised of two parts that attempt to ensure that every
MAC address is globally unique.

 This is achieved by the defining of an organizationally unique identifier that is

vendor specific, based on which it is possible to trace the origin of a product


back to its vendor based on the first 24 bits of the MAC address.

 The remaining 24 bits of the MAC address is a value that is incrementally and

uniquely assigned to each product (e.g. a Network Interface Card or similar


product supporting port interfaces for which a MAC is required).
The Ethernet MAC Address
 MAC addresses are comprised of an organizationally unique identifier and a
vendor assigned address value.

48 bits

24 bits 24 bits

OUI Assigned by each organization


Unicast Frame Forwarding
. 48 bits

7 bits 0

Host A Host B

unicast

Host C Host D
Broadcast Frame Forwarding
. 48 bits
FF FF FF FF FF FF

Host A Host B

broadcast

Host C Host D
Multicast Frame Forwarding
48 bits
7 bits 1

Host A Host B

multicast

Host C Host D
Carrier Sense
Host A Host B Host C

Carrier Sense (Network Occupied)

Host A Host B Host C

Data
Frame Processing
. Host A Host B

MAC MAC 0x080 Data FCS IP Data


B A 0

Data

 Data link (frame) instructions are received, processed and discarded.


Establishing a Single Switched Network
 The behavior of the enterprise switch when introduced to the local area
network is detailed along with an understanding of the handling of unicast and
broadcast type frames, to demonstrate how switches enable networks to
overcome the performance obstacles of shared networks.
Building a Single Switched Network
Switch A

G0/0/1

G0/0/2 G0/0/3

Host A Host B Host C


IP: 10.1.1.1/24 IP: 10.1.1.2/24 IP: 10.1.1.3/24
MAC:00-01-02-03-04-AA MAC:00-01-02-03-04-BB MAC:00-01-02-03-04-CC

 Switches operate within the scope of the data link layer.


Data link Layer
 As a link layer device, each switch relies on a MAC based table that provides

association between a destination MAC address and the port interface via which
a frame should be forwarded.

 This is commonly referred to as the MAC address table.

47
The Initial State of The Switch
Switch A MAC Address Table
MAC Interface

G0/0/1

G0/0/2 G0/0/3

Host A Host B Host C


IP: 10.1.1.1/24 IP: 10.1.1.2/24 IP: 10.1.1.3/24
MAC:00-01-02-03-04-AA MAC:00-01-02-03-04-BB MAC:00-01-02-03-04-CC

 Each switch uses a MAC table for making forwarding decisions.


MAC Address Learning
Switch A MAC Address Table

MAC Interface
00-01-02-03-04-AA G0/0/1
G0/0/1

G0/0/2 G0/0/3

Host A Host B Host C


IP: 10.1.1.1/24 IP: 10.1.1.2/24 IP: 10.1.1.3/24
MAC:00-01-02-03-04-AA MAC:00-01-02-03-04-BB MAC:00-01-02-03-04-CC

 The source MAC addresses of received frames are recorded.


Forwarding The First Data

 Frames destined for unknown link layer destinations are flooded.


The Destination Reply
Switch A
.
MAC Interface
G0/0/1
00-01-02-03-04-AA G0/0/1
G0/0/2 G0/0/3
00-01-02-03-04-CC G0/0/3

Host A Host B Host C


IP: 10.1.1.1/24 IP: 10.1.1.2/24 IP: 10.1.1.3/24
MAC:00-01-02-03-04-AA MAC:00-01-02-03-04-BB MAC:00-01-02-03-04-CC

 Frames are forwarded to destinations based on the MAC table.


Spanning Tree Protocol
Layer 2 Redundancy
 Switches may be established as single point-to-point links via which end systems

are able to forward frames to destinations located via other switches within the
broadcast domain.

 The failure however of any point-to-point switch link results in the immediate

isolation of the downstream switch and all end systems to which the link is
connected.

 In order to resolve this issue, redundancy is highly recommended within any

switching network.
Layer 2 Redundancy
. Switch A Switch B

Switch C Switch D Switch E

 Redundancy in a switching network minimizes connection failure but generates


potential switching loops.
Broadcast Storms
 In the example, Host A generates a frame, which is received by Switch B which
is subsequently forwarded out of all other interfaces.
 An instance of the frame is received by the connected switches A and C, which
in turn flood the frame out of all other interfaces.
 The continued flooding effect results in both Switch A and Switch C flooding
instances of the frame from one switch to the other, which in turn is flooded
back to Switch B, and thus the cycle continues.
 In addition, the repeated flooding effect results in multiple instances of the
frame being received by end stations, effectively causing interrupts and extreme
switch performance degradation.
Broadcast Storms
. Switch B
Host A
G0/0/3
G0/0/2

00-01-02-03-04-AA
Switch A

Host B

Switch C
00-01-02-03-04-BB

 Switching loops allow for broadcast storms to occur and duplication of


frames to be received by end stations.
MAC Instability
. Switch B
Host A
G0/0/3
G0/0/2

00-01-02-03-04-AA
Switch A

MAC Interface
00-01-02-03-04-AA G0/0/3
00-01-02-03-04-AA G0/0/2

Host B

Switch C
00-01-02-03-04-BB

 Receiving previously forwarded frames generates false MAC entries, and


instability within the MAC address table.
Resolving Layer 2 Redundancy Issues
Switch B
. Host A
G0/0/3
G0/0/2

00-01-02-03-04-AA
Switch A

Host B

Switch C
00-01-02-03-04-BB

 Loops are eliminated by restricting traffic flow over redundant paths.


The Spanning Tree Root Bridge
 The removal of any potential for loops serves as the primary goal of spanning
tree for which an inverted tree type architecture is formed.
 The root bridge represents the logical center but not necessarily the physical
center of the STP-capable network.
 Only a single root bridge can exist in a converged STP-capable network at any
one time.
 Non-root bridges are considered to be downstream from the root bridge and
communication to non-root bridges flows from the root bridge towards all non-
root bridges
The Spanning Tree Root Bridge
.
Root

Non-Root Non-Root

Non-Root Non-Root Non-Root

 An inverted tree architecture is created as a result of STP.

 The root bridge represents the base of the spanning tree.


Bridge ID
 Discovery of the root bridge for an STP network is a primary task performed in

order to form the spanning tree.

 This comprises of two parts, the first being a 16 bit bridge priority and the

second, a 48 bit MAC address.

 The device that is said to contain the highest priority (smallest bridge ID) is

elected as the root bridge for the network.


Bridge ID
4096 00-01-02-03-04-AA

. Root

32768 00-01-02-03-04-BB 32768 00-01-02-03-04-CC

32768 00-01-02-03-04-DD 32768 00-01-02-03-04-EE 32768 00-01-02-03-04-FF

 Bridge Identifiers are used to elect the root bridge.

 The bridge priority can be manipulated to force root selection.


Bridge Protocol Data Unit
 The spanning tree topology relies on the communication of specific information
to determine the role and status of each switch in the network.
 Two forms of BPDU are used within STP:
 A Configuration BPDU is initially created by the root and propagated
downstream to ensure all non-root bridges remain aware of the status of the
spanning tree topology and importantly, the root bridge.
 The TCN BPDU is a second form of BPDU, which propagates information in
the upstream direction towards the root and shall be introduced in more detail
as part of the topology change process.
 The Bridge ID field is used to determine the current designated switch from
which BPDU are expected to be received .
 The BPDU is generated and forwarded by the root bridge based on a Hello
timer, which is set to 2 seconds by default.
Bridge Protocol Data Unit
.
Root

BPDU BPDU

BPDU Bridge Port Message Max Hello FwdD


PID PVI Flags Root ID RPC
Type ID ID Age Age Time elay

Configuration TCN
Path Cost
 Another feature of the BPDU is the propagation of two parameters relating
to path cost .
 The root path cost (RPC) is used to measure the cost of the path to the
root bridge in order to determine the spanning tree shortest path, and
 When the bridge is the root bridge, the root path cost is 0.
 The path cost (PC) is a value associated with the root port, which is the port
on a downstream switch that connects to the LAN segment, on which a
designated switch or root bridge resides
Path Cost
.
Root

RPC 0 RPC 0

20000 20000
RPC 20000 20000
20000
20000
RPC 20000 RPC 20000 RPC 20000

20000 20000 20000

20000

 Root path cost is carried in the BPDU and used to determine the shortest
path to the root.
Path Cost Standards
.
Path Cost
Port Speed 802.1D 802.1t
Legacy
10 Mbps 99 1999999 1999
100 Mbps 18 199999 199
1 Gbps 4 20000 20
10 Gbps 2 2000 2

 STP supports various path cost standards.

 The 802.1t is the default standard used by Huawei switches.


Spanning Tree Port Roles
 A converged spanning tree network defines that each interface be assigned a specific
port role.
 Port roles are used to define the behavior of port interfaces that participate within
an active spanning tree topology.
 For the spanning tree protocol, three port roles of designated, root and alternate
are defined.
 The designated port is associated with a root bridge or a designated bridge of a LAN
segment and defines the downstream path via which Configuration BPDU are
forwarded
 The root bridge is responsible for the generation of configuration BPDU to all
downstream switches, and thus root bridge port interfaces always adopt the
designated port role.
 The root port identifies the port that offers the lowest cost path to the root, based
on the root path cost.
Cont’d
 Where two or more ports offer equal root path costs, the decision of which
port interface will be the root port is determined by comparing the bridge ID
in the configuration BPDU that is received on each port.
 Any port that is not assigned a designated or root port role is considered an
alternate port,
Spanning Tree Port Roles
.
Root
Root

RPC 0 RPC 0
D D

R RPC 20000 R
A D

RPC 20000 RPC 20000 RPC 20000


D D D

R R R

 Spanning tree supports designated, root and alternate port roles.

 The root path cost enables port roles to be determined.


Port ID
.
4096 00-01-02-03-04-AA 32768 00-01-02-03-04-BB
RPC 0 128.1
D R
Root
D A
RPC 0 128.2
D D 128.3

A 128.2

R
128.1

32768 00-01-02-03-04-CC

 Where the root path cost is equal, a port identifier is used to determine the
active and alternate paths to the root.
Timers
 The root bridge is responsible for the generation of configuration BPDU based

on a BPDU interval that is defined by a Hello timer.

 This Hello timer by default represents a period of 2 seconds .

 A Max Age timer is associated with each BDPU and represents life span of a

BPDU from the point of conception by the root bridge, and ultimately controls
the validity period of a BDPU before it is considered obsolete.

1/9/2022
Timers
.
BPDU Interval MSG Age: 0
(2 seconds) MAX Age: 20

MSG Age: 1 MSG Age: 1


MAX Age: 20 MAX Age: 20

MSG Age: 2 MSG Age: 2


MAX Age: 20 MAX Age: 20

 The MAX Age represents the aging timer of a BPDU.

 BPDU are discarded when Message Age exceeds MAX Age.


Root Election Process
. Switch A
32768 00-e0-fc-16-ee-43

BPDU BPDU

BPDU BPDU

BPDU

Switch B Switch C

32768 00-e0-fc-41-42-59
BPDU 32768 00-e0-fc-41-43-69

 All STP switches advertise BDPU to peers with self as root.


Port Role Establishment Process
. Switch A
32768 00-e0-fc-16-ee-43
Root
G0/0/1 G0/0/2
D D
RPC 0 RPC 0

Root Port Root Port


G0/0/1 RPC 20000 G0/0/1

D A
Switch B Switch C
G0/0/2 G0/0/2

32768 00-e0-fc-41-42-59 RPC 20000 32768 00-e0-fc-41-43-69

 The Bridge ID and Root Path Cost are used to elect port roles.
Port State Transition
.
Disabled

① ⑤


Forwarding Blocking

⑤ ③

④ ⑤

Learning Listening

Root Failure
. Switch A

Root

MAX Age MAX Age


BPDU
Switch B Switch C
BPDU

 Non root bridges wait for MAX Age before assuming loss of root.

 Re-convergence is then initiated, beginning with root election.


Indirect Link Failure
. Switch A

Root

BPDU

Switch B Switch C
A
BPDU

 Switch B begins root election, but BPDU is ignored by Switch C.

 Root BDPU is propagated to switch B after MAX Age expires.


Direct Link Failure
.
4096 00-01-02-03-04-AA 32768 00-01-02-03-04-BB
RPC 0 128.1
Switch A D R Switch B
Root
D A
D RPC 0 128.2
D

A
R Switch C

32768 00-01-02-03-04-CC

 Switch B detects failure and switches alternate port to root port.

 STP converges after 2x forward delay (30 seconds by default).


Topology Change MAC Instability
. Switch B
Host A
G0/0/3
G0/0/2

A 00-01-02-03-04-AA
Switch A

MAC Interface
00-01-02-03-04-AA G0/0/3

00-01-02-03-04-BB G0/0/2

R
Host B

Switch C
00-01-02-03-04-BB

 Changes in the STP topology may invalidate MAC table entries.

 MAC table entries expire only after 300 seconds by default.


Topology Change Process
.
Root

BPDU BPDU

TCN BPDU

BPDU BPDU BPDU

TCN BPDU

TCN BPDU BPDU

 Topology Change Notification informs root of topology change.

 Root flushes MAC entries using BPDU with TC bit set.


Topology Change MAC Refresh
.
Host A
Switch B
G0/0/3

G0/0/2 00-01-02-03-04-AA

Switch A G0/0/1 D
MAC Interface
00-01-02-03-04-AA G0/0/3

00-01-02-03-04-BB G0/0/2
Root G0/0/1
R 00-01-02-03-04-BB G0/0/1

Switch C Host B

00-01-02-03-04-BB
System Administration
Thank You…..!!!

You might also like