CCN Merged
CCN Merged
CS-418
Lecture 1 – 1
Introduction
❖Text Books:
• Data Communications & Networking (4th Edition), Behrouz A. Forouzan -
McGraw-Hill
• Data & Computer Communications (8th Edition) , William Stallings -
Prentice Hall
❖Reference Book:
• Computer Networking: A Top-Down Approach (7th Edition) James Kurose
, Keith Ross – Pearson
• Key Elements:
• Source – generates data to be transferred
• Transmitter – converts data into transmittable signals
• Transmission system – carries the data
• Receiver – converts received signal into data
• Destination – takes incoming data
• Unicast
• Only two nodes in the network are involved. Receiver node
Communication link
• Broadcast
• One node as sender , all other nodes as receivers.
• E.g. Radio , TV
Sender node
Communication link
• Multicast
• Group communication receiver
• One of the node is the sender, several ,but not all others as receivers.
• In multicast group, all nodes can act
as sender
Communication link
• Disadvantages:
• Difficult to scale
• A single break in the link can bring entire network down.
Data transfer
• Packet Switching Networks - Data flows are segmented into small chunks called packets.
• Packets are basic unit of transmission.
• A packet consists of:
• A packet header containing meta-information about the packet, e.g. address fields
• The packet payload
• a packet trailer for error detection / correction
• Packets are transmitted individually and independently from one node to the other.
• At each node, the entire packet is received, stored briefly, and then transmitted to the
next node.
• There is no concept of a connection, packets can be sent immediately without having to
set up resource reservation in the network.
• Switching elements are called routers.
• Analogy: letter transfer in postal network, envelopes correspond to packet headers.
• Example: The Internet.
Pk 11
Pk
Pk 2
Pk 1
Pk
Pk33
Pk 22
Pk
Pk 1
Pk 3
Pk 2
Pk 3
• Circuit-switching:
• Can give guaranteed bandwidths
• No reuse of resources
• Data forwarding is low-complexity operation for switches
• Routing is done only once
• Packet-switching:
• Cannot give any guarantees
• Allows reuse of resources
• Data forwarding is higher-complexity operation for routers
• Routing is done for every packet
• Communication Model
• Key Elements:
• Source – generates data to be transferred
• Transmitter – converts data into transmittable signals
• Transmission system – carries the data
• Receiver – converts received signal into data
• Destination – takes incoming data
• What is a Network?
• Set of nodes connected by communication links, capable of sending
and/or receiving data generated by other nodes on the network.
• Fundamental aim of networks: Resource sharing , Services
• Network Topologies
• Mesh
• Star
• Bus
• Ring
• Network Coverage Areas
• Local Area Networks(LANs)
• Wide Area Networks(WANs)
• Switching Techniques
• Circuit Switching
• Packet Switching
Lecture 1 – 2
Network Architectures & Protocol Basics
• Communication Model
• Key Elements:
• Source – generates data to be transferred
• Transmitter – converts data into transmittable signals
• Transmission system – carries the data
• Receiver – converts received signal into data
• Destination – takes incoming data
• What is a Network?
• Set of nodes connected by communication links, capable of sending
and/or receiving data generated by other nodes on the network.
• Fundamental aim of networks: Resource sharing , Services
• Network Topologies
• Mesh
• Star
• Bus
• Ring
• Network Coverage Areas
• Local Area Networks(LANs)
• Wide Area Networks(WANs)
• Switching Techniques
• Circuit Switching
• Packet Switching
protocol entity.
• An N-PDU is treated as payload / user N-1
Hdr
N Hdr N+1 data N Trl
N-1
Trl
N-1
Hdr
N Hdr N+1 data N Trl N-1
Trl
data by the N − 1 layer.
N-1
• Each layer adds own header and
N-2 N-1 N Trl N-2
N-2 N-1 N-1 N-2 N Hdr N+1 data
N Hdr N+1 data N Trl Hdr Hdr Trl Trl
Hdr Hdr Trl Trl
trailer before handing down to lower
layer.
• Receiving layer removes its header /
trailer before handing payload to
upper layer.
• Presentation layer:
• Translates between different representations of data types used on
different end hosts
• Example: host A uses low-endian , host B big-endian
Spring Semester 2021 20
OSI RM – Application Layer
• Contains variety of protocols that are commonly needed by
users.
• Examples:
• HTTP(HyperText Transfer Protocol) – for Web document request and
transfer
• SMTP(Simple Mail Transfer Protocol) – for transfer of email messages
• FTP(File Transfer Protocol) – for transfer of files between two end
systems
• Packet of information at the application layer is called a
message.
• Focus: Transport Layer and Lower.
Spring Semester 2021 21
TCP/IP Reference Model
• The TCP/IP protocol architecture is a
result of protocol research and Layer 5: Application
development conducted on the
experimental packet-switched network,
ARPANET, funded by the Defense Layer 4: Transport
Advanced Research Projects Agency
(DARPA).
• It is generally referred to as the TCP/IP Layer 3: Internet
protocol suite.
• This model is used in the Internet.
Layer 2: Network Access
• TCP/IP model consists of five layers:
• Application
• Transport Layer 1: Physical
• Internet
• Network Access
• Physical
Lecture 2 – 1
Data Link Layer – Framing Techniques
• We will refer any device that runs a link layer (i.e., layer 2)
protocol as a node.
• Nodes include hosts, routers or switches, and Wi-Fi access
points.
• We will also refer to the communication channels that connect
adjacent nodes along the communication path as links.
• In order for a datagram to be transferred from source host to
destination host, it must be moved over each of the individual
links in the end-to-end path.
• Over a given link, a transmitting node encapsulates the datagram
in a link layer frame and transmits the frame into the link.
Spring Semester 2021 4
Introduction to the Link Layer
• Data Link layer has number of specific functions it can carry out.
These include:
• Link access:
• A medium access control (MAC) protocol specifies the rules by which
a frame is transmitted onto the link.
• For point to point links that have a single sender at one end of the
link and a single receiver at the other end of the link, the MAC
protocol is simple – the sender can send a frame whenever the link is
idle.
• When multiple nodes share a single broadcast link the MAC protocol
serves to coordinate the frame transmissions of the many nodes.
• Data Link layer has number of specific functions it can carry out.
These include:
• Error detection and correction:
• The link layer hardware in a receiving node can incorrectly decide that a bit in a
frame is zero when it was transmitted as a one, and vice versa.
• Such bit errors are introduced by signal attenuation and electromagnetic noise.
Because there is no need to forward a datagram that has an error, many link
layer protocols provide a mechanism to detect such bit errors.
• This is done by having the transmitting node include error detection bits in the
frame, and having the receiving node perform an error check.
• Error detection in the link layer is usually implemented in hardware.
• Error correction is similar to error detection, except that a receiver not only
detects when bit errors have occurred in the frame but also determines exactly
where in the frame the errors have occurred (and then corrects these errors).
Spring Semester 2021 9
Services Provided by the Link Layer
• Data Link layer has number of specific functions it can carry out.
These include:
• Flow Control:
• The nodes on each side of a link have a limited amount of buffering
capacity.
• This is a potential problem, as a receiving node may receive frames
at a rate faster than it can process the frames (over some time
interval).
• Without flow control, the receiver's buffer can overflow and frames
can get lost.
• Similar to the transport layer, a link layer protocol can provide flow
control in order to prevent the sending node on one side of a link
from overwhelming the receiving node on the other side of the link.
Spring Semester 2021 10
Where is Link Layer Implemented
• It is implemented in a
network adapter, or
sometimes known as a
network interface card (NIC).
• The controller in the NIC , is
usually a single, special-
purpose chip that implements
many of the link-layer services
(framing, link access, error
detection, etc.).
• The data Link layer takes the packet from the network layer and
encapsulates them in frames for transmission.
• Each frame contains a frame header, a payload field for holding
the packet, and a frame trailer.
• The data link layer breaks the bit stream up into discrete frames and
compute the checksum for each frame.
• When a frame arrives at the destination, the checksum is recomputed.
• If the newly computed checksum is different from the one contained in the
frame, the data link layer knows that an error has occurred and takes steps
to deal with it.
• One way to achieve this framing is to insert time gaps between frames,
much like the spaces between words in ordinary text.
• However, networks rarely make any guarantees about timing, so it is
possible these gaps might be squeezed out or other gaps might be inserted
during transmission.
FLAG
FLAG HEADER
HEADER PAYLOAD
PAYLOAD TRAILER FLAG
Original Data
After Stuffing
At Receiver
Lecture 2 – 2
Data Link Layer – Error Detection
Techniques
Spring Semester 2021 1
Synchronization
• Data are transmitted one character at a time , where each character is 5 – 8 bits in length.
• Timing or synchronization is maintained within each character.
• When no character is being transmitted, the line between transmitter and receiver is in an
idle state. The definition of idle is equivalent to the signaling element for binary 1.
• The beginning of a character is signaled by a start bit with a value of binary 0.
• This is followed by the 5 to 8 bits that actually make up the character. The bits of the
character are transmitted beginning with the least significant bit.
• The parity bit is set by the transmitter such that the total number of ones in the character,
including the parity bit, is even (even parity) or odd (odd parity), depending on the
convention being used. The receiver uses this bit for error detection.
• The final element is a stop element, which is a binary 1.
• A minimum length for the stop element is specified, and this is usually 1, 1.5, or 2 times the
duration of an ordinary bit.
• Because the stop element is the same as the idle state, the transmitter will continue to
transmit the stop element until it is ready to send the next character.
• The frame starts with a preamble called a flag, which is 8 bits long.
The same flag is used as a postamble.
• The receiver looks for the occurrence of the flag pattern to signal the
start of a frame.
• This is followed by some number of control fields (containing data
link control protocol information), then a data field (variable length
for most protocols), more control fields, and finally the flag is
repeated.
• Synchronous transmission is far more efficient than asynchronous.
Spring Semester 2021 9
Types of Errors
• In digital transmission systems, an error occurs when a bit is
altered between transmission and reception; that is, a binary 1
is transmitted and a binary 0 is received, or a binary 0 is
transmitted and a binary 1 is received.
• Two general types of errors can occur:
• Single bit errors - A single bit error is an isolated error condition that
alters one bit but does not affect nearby bits.
• Burst errors - A burst error of length B is a contiguous sequence of B
bits in which the first and last bits and any number of intermediate bits
are received in error.
00000010 00001010
Sent Single Bit Error Received
Sent 0100010001000011
Corrupted Bits
Received 0101110101100011
Burst Error
Spring Semester 2021 11
Types of Errors
• Single bit errors are the least likely type of error in serial data
transmission.
• A burst error does not necessarily mean that the errors occur in
consecutive bits.
• The length of the burst is measured from the first corrupted bit to the last
corrupted bit. Some bits in between may not have been corrupted.
• A burst error is more likely to occur than a single bit error. The duration of
noise is normally longer than the duration of 1 bit, which means that
when noise affects data, it affects a set of bits.
• The number of bits affected depends on the data rate and duration of
noise.
• Example: when a wireless transmitter transmits at 11 Mbps and an
interference burst of 200 μs occurs, 2200 bits are affected by the burst.
0111000110101011 1
‘d +1’ bits
Transmitted Frame
11001111 1011101 1 0111001 0 01010011 0101010 1
1100111 1
1111101 1 Parity Error
0111001 0 *Bit in position (2,2) is switched to 1
0101001 1 *A single error in the parity bits is also
0101010 1 detectable and correctable.
Parity Error
1100111 1
*Bit in position (2,2) is switched to 1 and bit
1111001 1 in position (2,5)is switched to 0
0111001 0
*Two-dimensional parity can also detect
0101001 1 (but not correct!) any combination of two
1 errors in a packet.
0101010
Parity Error Parity Error
Sender Side:
10101001
Checksum
Binary addition 00111001
1’s complement
11100010 00011101
Receiver Side:
10101001
00111001 Result is zero so the data is
00011101 intact and no error
1’s complement
11111111 00000000
Receiver Side:
00101001
00111001 Result is non zero so the data
00011101 has error and it is discarded
1’s complement
01111111 10000000
‘d+r’ bits
‘15’ bits
‘15’ bits
1010001101 01110
‘15’ bits
𝑇
𝐺
Because there is no
remainder, it is
assumed that there
have been no errors.
Lecture 3 – 1
Data Link Layer – Error Control
• Various different types of code are available for use in channel coding but
the simplest and most commonly used are called linear block codes.
• In a block code:
• The user data stream is segmented into blocks of 𝑘 bits
• Each 𝑘 bit block is encoded independently of other blocks to an 𝑛 bit
codeword (𝑛 > 𝑘)
• The code rate is 𝑘/𝑛
• The set of all possible source words has size 2𝑘
• The set of all possible words in the code space has size 2𝑛
• Out of these the code uses only 2𝑘 out of 2𝑛 elements
• These are called valid codewords
• We shall consider a Hamming (7,4) code, in which three check bits (𝑐1, 𝑐2 and 𝑐3) are
combined with four information bits (𝑘1, 𝑘2, 𝑘3 and 𝑘4) to produce a block of data of
length 𝑛 = 7.
• Three check equations are used to obtain the three check bits of this Hamming (7,4) code
as follows:
𝑐1 = 𝑘1 ⊕ 𝑘2 ⊕ 𝑘4
𝑐2 = 𝑘1 ⊕ 𝑘3 ⊕ 𝑘4
𝑐3 = 𝑘2 ⊕ 𝑘3 ⊕ 𝑘4
• Given data bits = 1010 then 𝑘1 = 1 , 𝑘2 = 0 , 𝑘3 = 1 and 𝑘4 = 0 and the check bits
obtained from the three check equations above are as follows:
𝑐1 = 𝑘1 ⊕ 𝑘2 ⊕ 𝑘4 = 1 ⊕ 0 ⊕ 0 = 1
𝑐2 = 𝑘1 ⊕ 𝑘3 ⊕ 𝑘4 = 1 ⊕ 1 ⊕ 0 = 0
𝑐3 = 𝑘2 ⊕ 𝑘3 ⊕ 𝑘4 = 0 ⊕ 1 ⊕ 0 = 1
• The codeword is obtained by adding the check bits to the end of the information bits and
therefore the data 1010101 will be transmitted (data bits first).
Spring Semester 2021 17
The Hamming Codes
• Since all linear block codes contain the all zeros codeword, then
an easy way to find the minimum distance(𝑑𝑚𝑖𝑛 ) of a code is to
compare a non zero codeword which has the minimum number
of ones with the all zeros codeword.
• Thus the minimum distance of a code is equal to the smallest
number of ones in any non zero codeword, which in the case of
this Hamming (7,4) code is three.
• If the codewords of a code differ in three or more positions then
error correction is possible since an erroneous bit pattern will be
„closer‟ to one codeword than another.
• If, however, a second error occurs in bit 7 then the received bit
pattern will be 1 0 1 0 1 1 1
• It should still be possible to detect that an error has occurred
since this is not one of the 16 codewords.
• However, it is no longer possible to correct the errors since the
received bit pattern has changed in two places.
• Thus, this Hamming (7,4) code is able to detect two errors but
correct only one error.
• In general, if the minimum distance of a code is 𝑑𝑚𝑖𝑛 , then
𝑑 − 1 errors can normally be detected using a linear block code
and 𝑚𝑜𝑑(𝑑 − 1)/2 can be corrected.
Spring Semester 2021 22
Hamming Codes - Properties
• All Hamming codes (indeed, all linear block codes) possess the mathematical property that
if we add any two codewords together (modulo 2 addition) then the resulting sum is also a
codeword.
• For example, if we add codewords 1 and 2 :
000111
⊕ 001001
001110 Which is codeword 3
• This allows us to represent a whole code by means of a subset of codewords, since further
codewords can simply be obtained by modulo 2 addition.
• The subset of codewords is often expressed as a matrix known as a generator matrix, G.
• The codewords chosen are normally powers of 2, that is codewords 1, 2,4, 8.
• The check matrix is obtained by having each row of the matrix correspond to one of the check
equations in that if a particular bit is present in an equation, then that bit is marked by a one in the
matrix. This results in a matrix with dimensions 3 × 7 (𝑐 × 𝑛).
Spring Semester 2021 26
Hamming Codes – Check Matrix
• If we now compare the two types of matrix we note that the generator matrix has an
identity matrix consisting of a diagonal of ones to its left and the check matrix has this
identity matrix to its right.
1000110
1101100
0100101
𝐺= H = 1011010
0010011
0111001
0001111
• When a generator or check matrix conforms to this pattern, it is in standard echelon form.
• A further point to note is that if the echelons are removed from the two matrices, then
what remains is the transpose of each other.
• In the case of the Hamming (7,4) code:
110
1101
101
From Check Matrix 1011 𝑖𝑠 𝑡ℎ𝑒 𝑡𝑟𝑎𝑛𝑠𝑝𝑜𝑠𝑒 𝑜𝑓
011 From Generator Matrix
0111
111
Spring Semester 2021 27
Hamming Codes – Check Matrix
Example: The generator matrix for a Hamming (15,11) code is as follows:
100000000001100
010000000000110
001000000000011
000100000001101
000010000001010
𝐺 = 000001000000101
000000100001110
000000010000111
000000001001111
000000000101011
000000000011001
Obtain the check matrix.
1
Using Hamming Code (7,4)
0
1101100 0
1011010 ∗ 0
H Matrix 0111001 1 Data Vector
1
0
Spring Semester 2021 30
Hamming Codes – Decoding
To determine the transmitted codeword we can use the three check equations to determine
the check bits:
𝑐1 = 𝑘1 ⊕ 𝑘2 ⊕ 𝑘4 = 1 ⊕ 1 ⊕ 1 = 1
𝑐2 = 𝑘1 ⊕ 𝑘3 ⊕ 𝑘4 = 1 ⊕ 1 ⊕ 1 = 1
𝑐3 = 𝑘2 ⊕ 𝑘3 ⊕ 𝑘4 = 1 ⊕ 1 ⊕ 1 = 1
• The transmitted codeword is therefore seven ones as follows:
𝑘1 𝑘2 𝑘3 𝑘4 𝑐1 𝑐2 𝑐3 = 1111111
Spring Semester 2021 32
Hamming Codes – Decoding
(b) If an error occurs in bit 4 during transmission, determine the syndrome.
If an error occurs in bit 4 then the received data is 1110111. To check whether there is an
error in the received data, we multiply by the check matrix:
1
1
1101100 1 1
1011010 ∗ 0 = 1 syndrome
0111001 1 1
1
1
Column 4
• An error that was occurred has caused the syndrome to be non zero. Furthermore the
position of the error can be located by comparing the syndrome with the columns of the
check matrix. In this case the syndrome provides us with all we need to know about the
error since its numerical value equates with column 4 of the check matrix, thus indicating
an error in bit 4.
Spring Semester 2021 33
Some Other Codes
• Cyclic Codes - A cyclic code is one in which all the code words are
related by the fact that if a codeword is rotated, it becomes
another codeword – Cyclic Redundancy Check (CRC) – Already
discussed in previous lecture.
• Convolutional Codes - Convolutional codes work in a
fundamentally different manner in that they operate on data
continuously as it is received (or transmitted) by a network node.
Lecture 3 – 2
Data Link Layer – Flow Control
12
Spring Semester 2021
Spring Semester 2021 13
Stop and Wait ARQ
• The main shortcoming of the stop and wait algorithm is that it allows the sender to have
only one outstanding frame on the link at a time, and this may be far below the link’s
capacity.
The significance of the
• Consider, for example, a 1.5 Mbps link with a 45 ms round trip time. delay × bandwidth
• This link has a: product is that it
represents the amount
𝑑𝑒𝑙𝑎𝑦 × 𝑏𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ = 1.5 𝑀𝑏𝑝𝑠 ∗ 45𝑚𝑠 = 8 𝐾𝐵. of data that could be in
transit.
• Since the sender can send only one frame per RTT, and assuming a frame size of 1 KB,
about one eighth of the link’s capacity is used. To use the link fully, then, we’d like the
sender to be able to transmit up to eight frames before having to wait for an
acknowledgment.
Lecture 4 – 1
Data Link Layer Protocols - HDLC
• Asynchronous response mode (ARM): Used with an unbalanced configuration. The secondary may
initiate transmission without explicit permission of the primary. The primary still retains
responsibility for the line, including initialization, error recovery, and logical disconnection.
Original Pattern
111111111111011111101111110
• The address field identifies the secondary station that transmitted or is to receive the
frame.
• This field is not needed for point to point links but is always included for the sake of
uniformity.
• The address field is usually 8 bits long but, by prior agreement, an extended format may be
used in which the actual address length is a multiple of 7 bits.
• The leftmost bit of each octet is 1 or 0 according as it is or is not the last octet of the
address field. The remaining 7 bits of each octet form part of the address.
• The single octet address of 11111111 is interpreted as the all stations address in both basic
and extended formats. It is used to allow the primary to broadcast a frame for reception by
all secondaries.
• Information frames (I-frames) carry the data to be transmitted for the user . Additionally, flow and error control
data, using the ARQ mechanism, are piggybacked on an information frame.
• An I-frame is distinguished by the first bit of the control field being a binary 0.
• The control field of an I-frame contains both a send sequence number, N(S), and a receive sequence number,
N(R), which are used to facilitate flow control.
• N(S) is the sequence number of frames sent and N(R) the sequence number of frames successfully received by
the sending node prior to the present frame being sent.
• Thus the first frame transmitted in a data transfer has send and receive sequence numbers 0,0.
• Since 3 bits are available for each of the sequence numbers N(S) and N(R), they can have values only between 0
and 7, that is they use modulo-8 numbering. This imposes a limit on the size of the windows used for flow control.
• I-frames also contain a poll/final (P/F) bit. This acts as a poll bit when used by a primary station and a final bit by
a secondary.
• A poll bit is set when a primary is transmitting to a secondary and requires a frame or frames to be returned in
response, and the final bit is set in the final frame of a response.
• Unnumbered frames do not contain any sequence numbers and are used for various control functions.
• They have five function bits which allow for the fairly large number of commands and responses , but not all 32
possibilities are used.
24
Spring Semester 2021
HDLC - Information & FCS Field
25
Spring Semester 2021
HDLC Operation
• HDLC operation consists of the exchange of I-frames, S-frames,
and U-frames between two stations.
• The operation of HDLC involves three phases.
• First, one side or another initializes the data link so that
frames may be exchanged in an orderly fashion. During this
phase, the options that are to be used are agreed upon.
• After initialization, the two sides exchange user data and the
control information to exercise flow and error control.
• Finally, one of the two sides signals the termination of the
operation.
26
Spring Semester 2021
HDLC Operation - Initialization
• Either side may request initialization by issuing one of the set mode
commands. This command serves three purposes:
• It signals the other side that initialization is requested.
• It specifies which of the three modes (NRM,ABM,ARM) is
requested.
• It specifies whether 3- or 7-bit sequence numbers are to be used.
• If the other side accepts this request, then the HDLC module on that
end transmits an unnumbered acknowledged (UA) frame back to the
initiating side.
• If the request is rejected, then a disconnected mode (DM) frame is
sent.
27
Spring Semester 2021
• Figure shows the frames involved in link setup and
disconnect.
• The HDLC protocol entity for one side issues an SABM
command to the other side and starts a timer.
• The other side, upon receiving the SABM, returns a UA
response and sets local variables and counters to their initial
values.
• The initiating entity receives the UA response, sets its
variables and counters, and stops the timer.
• The logical connection is now active, and both sides may
begin transmitting frames.
• If the timer expire without a response to an SABM, the
originator will repeat the SABM.
• This would be repeated until a UA or DM is received or until,
after a given number of tries, the entity attempting initiation
gives up and reports failure.
• The figure shows the disconnect procedure. One side issues
a DISC command, and the other responds with a UA
response.
Spring Semester 2021 28
HDLC Operation – Data Transfer
• When the initialization has been requested and accepted, then a logical
connection is established.
• Both sides may begin to send user data in I-frames, starting with
sequence number 0.
• The 𝑁(𝑆) and 𝑁(𝑅) fields of the I-frame are sequence numbers that
support flow control and error control.
• An HDLC module sending a sequence of I-frames will number them
sequentially, modulo 8 or 128, depending on whether 3- or 7-bit sequence
numbers are used, and place the sequence number in 𝑁(𝑆).
• 𝑁(𝑅) is the acknowledgment for I-frames received; it enables the HDLC
module to indicate which number I-frame it expects to receive next.
29
Spring Semester 2021
• Figure shows full duplex exchange of I-frames.
• When an entity sends a number of I-frames in a
row with no incoming data, then the receive
sequence number is simply repeated.
• When an entity receives a number of I-frames in a
row with no outgoing frames, then the receive
sequence number in the next outgoing frame
must reflect the cumulative activity.
• Note that, in addition to I-frames, data exchange
may involve supervisory frames.
34
Spring Semester 2021
• The figure shows the disconnect procedure. One side issues
a DISC command, and the other responds with a UA
response.
Lecture 4 – 2
Data Link Layer Protocols - PPP
• The protocol starts with the line in the DEAD state, which means
that no physical layer carrier is present and no physical layer
connection exists.
• After physical connection is established, the line moves to
ESTABLISH.
• At that point LCP option negotiation begins, which, if successful,
leads to AUTHENTICATE. Now the two parties can check on each
other's identities if desired.
• When the NETWORK phase is entered, the appropriate NCP
protocol is invoked to configure the network layer.
• If the configuration is successful, OPEN is reached and data
transport can take place.
• When data transport is finished, the line moves into the
TERMINATE phase, and from there, back to DEAD when the
carrier is dropped.
Lecture 5 – 1
Queuing Theory Concepts
Queue
Customers Arriving Customers Departing
𝜆 Server 𝜇
Queue
Customers Arriving Customers Departing
𝜆 Server 𝜇
Spring Semester 2021 8
The Poisson Arrival Pattern
• Random arrivals or Poisson arrivals - The simplest arrival pattern mathematically, and the most
commonly used in all applications of queueing theory is the random or Poisson arrival process.
• If the interarrival times are exponentially distributed, number of arrivals in any given interval are Poisson
distributed.
𝜆 = arrival rate ; Δ𝑡 = time interval
• The probability that one arrival occurs between 𝑡 and 𝑡 + Δ𝑡 is independent of arrivals in earlier
intervals.
• The probability of exactly 𝑛 customers arriving during an interval of length 𝑡 is given by:
𝜆𝑡 𝑛 𝑒 −𝜆𝑡
𝑃 𝑛 𝑎𝑟𝑟𝑖𝑣𝑎𝑙𝑠 𝑖𝑛 𝑡 =
𝑛!
𝜏 ~ exponential Time
𝑛~Poission
Spring Semester 2021 9
Properties of Poisson
• M (Markov property) - memoryless arrival or Poisson arrival i.e. Previous history does not help
in predicting the future.
• Distribution of the time until the next arrival is independent of when the last arrival occurred.
• Merging - Let 𝐴1, 𝐴2, … 𝐴𝑘 be independent Poisson Processes of rate 𝜆1, 𝜆2, … 𝜆𝑘 then
𝐴 = ∑ 𝐴𝑖 is also Poisson of rate = λ = ∑ 𝜆𝑖 λ = ∑ 𝜆𝑖
𝜆1
𝜆2
𝜆3
• Splitting - Suppose that every arrival is randomly routed with probability 𝑃 to stream 1 and (1 − 𝑃) to
stream 2 then streams 1 and 2 are Poisson of rates 𝑃 𝜆 and (1 − 𝑃) 𝜆 respectively.
𝑃 𝜆𝑃
𝜆
1 −𝑃 𝜆(1 − 𝑃 )
Spring Semester 2021 10
Key Variables in Queuing Systems
𝜆 = Arrival rate (customers/sec) ; 𝐶𝑛 = Nth customer enters the system
𝜇 = Service rate (customers/sec)
𝑁 = Average no. of customers in the system
𝑁𝑞 = Average no. of customers waiting in queue
𝑇 = Average customer time in system(includes queueing delay plus service
time)
𝑊𝑞 = Average customer waiting time in the queue (does not include service
time)
1
𝑊𝑠 = Service time ; reciprocal of service rate =
𝜇
1
𝜏 = Interarrival time; reciprocal of arrival rate =
𝜆
Spring Semester 2021 11
Key Variables in Queuing Systems
𝜌 = Traffic Intensity or utilization of server ; fraction of time the server is busy
1
𝑚𝑒𝑎𝑛 𝑠𝑒𝑟𝑣𝑖𝑐𝑒 𝑡𝑖𝑚𝑒 𝜆
= = (for single server)
𝜇
= 1
𝑚𝑒𝑎𝑛 𝑖𝑛𝑡𝑒𝑟𝑎𝑟𝑟𝑖𝑣𝑎𝑙 𝑡𝑖𝑚𝑒 𝜇
𝜆
𝜆
= (for ‘m’ servers)
𝑚𝜇
For equilibrium or steady state;
𝜌<1
i.e. number of customers arriving in a finite time is equal to the number of
customers leaving the system. Otherwise, system will be unstable.
Queue
Customers Arriving Customers Departing
𝜆 Server 𝜇
Lecture 6 – 2
LAN Interconnection Devices
• Learning is based on the use of the source address field in each MAC frame.
• When a frame arrives on a particular port(interface),the source address field of the frame indicates
the source station.
• Thus, a bridge can update its forwarding database for that port on the basis of the source address
field of each incoming frame.
• To allow for changes in topology, each element in the database is equipped with a timer. When a
new element is added to the database, its timer is set.
• If the timer expires, then the element is eliminated from the database, since the corresponding
direction information may no longer be valid.
• Each time a frame is received, its source address is checked against the database. If the element is
already in the database, the entry is updated and the timer is reset.
• If the element is not in the database, a new entry is created, with its own timer.
19
Spring Semester 2021
Spanning Tree Approach – Loop Resolution
Cost = 4
Cost = 4
BRIDGE B
Priority = 32768 BRIDGE C
MAC = 0000 2222 3333 Priority = 32768
MAC = 0000 6666 7777
Cost = 4 Cost = 4
BRIDGE D
Priority = 100 Cost = 4
MAC = 0000 4444 5555 BRIDGE E
Priority = 32768
MAC = 0000 8888 9999
22
Spring Semester 2021
BRIDGE A (ROOT BRIDGE)
Priority = 100
MAC = 0000 1111 2222
Cost = 4 Cost = 4
27
Spring Semester 2021
Collision Domain
Broadcast Domain
28
Spring Semester 2021
Collision Domain
Broadcast Domain
29
Spring Semester 2021
30
Spring Semester 2021
Virtual LANs
• Modern institutional LANs are often configured hierarchically, with each
workgroup (department) having its own switched LAN connected to the switched
LANs of other groups via a switch hierarchy. But this configuration will still be a
flat network (because of a single broadcast domain). Three drawbacks of this
configuration can be:
• Lack of traffic isolation - Although the hierarchy localizes group traffic to within a single switch,
broadcast traffic must still traverse the entire institutional network. Limiting the scope of such
broadcast traffic would improve LAN performance. Perhaps more importantly, it also may be desirable
to limit LAN broadcast traffic for security/privacy reasons.
• Inefficient use of switches - if there are less people in one workgroup.
• Managing users - If an employee moves between groups, the physical cabling must be changed to
connect the employee to a different switch. Employees belonging to two groups make the problem
even harder.
• These problems can be handled by a switch that supports virtual local area
networks (VLANs).
• Since each VLAN is a different broadcast domain, so what about Spanning Tree
Protocol?
• How to send traffic to a different VLAN?
Spring Semester 2021 32
33
Spring Semester 2021
Questions?
Lecture 7 – 1
Network Layer Protocols
Network ID Host ID
• Network Identifier (Network ID) - No. of bits, starting from the leftmost bit, used to uniquely identify a
network where the host is located. Also called the network prefix. Every machine on the same network
shares same network address.
• Host Identifier (Host ID) – No of bits used to uniquely identify a host on the network.
• Hierarchical addressing was chosen because, if every address were unique and flat addressing was used,
all routers on the Internet would need to store the address of each and every machine on the Internet.
This would make efficient routing impossible.
• Routers look at the network portion of the IP address to determine if the destination IP address is on
the same network as the host IP address. Then routing decisions are made based on information the
routers keep about where various networks are located. The host portion of the address is used by
devices on the local portion of the network.
Spring Semester 2021 9
IP Address Classes
• IP addressing supports five different address classes: A, B, C, D, and E. Only classes A, B, and
C are available for commercial use.
• Each class occupies some part of the address space.
• This architecture is called classful addressing.
8 bits 8 bits 8 bits 8 bits
Class A Network ID Host ID Host ID Host ID
Entire IP address set to all 1s All Hosts On The Network - Broadcast to all nodes on the
(255.255.255.255) current network.
Spring Semester 2021 14
Class A Addresses
For Network ID
• 7 bits are used for Network ID as first bit is reserved as ‘0’ for Class A.
✓ No. of possible Network IDs = 27 − 2 = 126 (Network address 0 and 127 are reserved and cannot
be assigned to any network)
For Host ID
• 24 bits are used for Host ID
✓ No of Host IDs per network ID = 224 − 2 = 16,777,214 (Host address of all 0’s and all 1’s is
reserved)
E.g. All Host ID bits off is a network address 10.0.0.0
All Host ID bits on is a broadcast address 10.255.255.255
• Valid Host IDs are numbers between the network address and broadcast address i.e. 10.0.0.1
through 10.255.255.254
8 bits 8 bits 8 bits 8 bits
Class A 0 Network ID Host ID Host ID Host ID
Spring Semester 2021 15
Class B Addresses
For Network ID
• 14 bits are used for Network ID as first two bits are reserved as ‘10’ for Class B.
✓ No. of possible Network IDs = 214 = 16,384
For Host ID
• 16 bits are used for Host ID
✓ No of Host IDs per network ID = 216 − 2 = 65,534 (Host address of all 0’s and all 1’s is reserved)
E.g. All Host ID bits off is a network address 172.16.0.0
All Host ID bits on is a broadcast address 172.16.255.255
• Valid Host IDs are numbers between the network address and broadcast address i.e.
172.16.0.1 through 172.16.255.254
Lecture 7 – 2
Network Layer – Subnetting & VLSM
32 bits
192.168.10.64 (/26)
Possible Hosts = 62
Network Address 192.168.10.64(/26) No of wasted IP Addresses = 2
192.168.10.160 (/28)
Possible Hosts = 14
192.168.10.128 (/27) No of wasted IP Addresses = 2
192.168.10.64 (/26) Possible Hosts = 30
Possible Hosts = 62 No of wasted IP Addresses = 0
No of wasted IP Addresses = 2
Lecture 8 – 1
Network Layer – Routing Protocols
Data (Variable)
• Decision Time – refers to when routing the decisions are made i.e.
for individual packet or for each session or at the time of network configuration time.
Lecture 8 – 2
Network Layer – Shortest Path Routing
Algorithms
Spring Semester 2021 1
Interior and Exterior Gateway Routing Protocols
• One routing protocol cannot handle the task of updating routing tables of all routers on the internet. For
this reason, an internet is divided into autonomous systems.
• An autonomous system (AS) exhibits the following characteristics:
• AS is a set of routers and networks managed by a single organization.
• An AS consists of a group of routers exchanging information via a common routing protocol.
• AS is connected that is, there is a path between any pair of nodes , except in the times of failure.
• Interior gateway routing protocol is used for passing routing information between routers within an AS.
The protocol used to pass routing information between routers in different ASs are refered as an exterior
gateway routing protocol.
• AS are connected by linking a router in one AS to a router in another AS. An AS consists of a set of
routers with two different types of connectivity:
• Internal Routers - These routers in an AS connect only to other routers in the same AS. These run
interior gateway routing protocols.
• Border Routers – These routers in an AS connect both to routers within an AS and to routers in one or
more AS. These devices are responsible for passing traffic between the AS and the rest of the
internetwork. They run both interior and exterior routing protocols.
5
C D
1
1
3
2 1
2 2
8
2
2 2
A E B
1 3
3
4
7 1
6
F G
3
Step ഥ
𝑵 𝑫𝑨,𝑪 , 𝐏 𝑪 𝑫𝑨,𝑭 ,𝑷 𝑭 𝑫𝑨,𝑬 , 𝐏 𝑬 𝑫𝑨,𝑫 , 𝐏 𝑫 𝑫𝑨,𝑮 ,𝐏 𝑮 𝑫𝑨,𝑩 , 𝐏 𝑩
1 {A} 1 , A (AC) 1 , A (AF) ∞ ∞ ∞ ∞
5
C D
1
1
3
2 1
2 2
8
2
2 2
A E B
1 3
3
4
7 1
6
F G
3
Spring Semester 2021 11
Execution of Dijkstra Algorithm
Step 3 - Loop
𝑁ሖ = {A,C}
P 𝐶 = A (predecessor node of C) path : 𝐴 → 𝐶
for each neighbor of 𝐶 and not in 𝑁’ we update the cost
𝐷𝐴,𝐸 = min( 𝐷𝐴,𝐸 , 𝐷𝐴,𝐶 + 𝑑𝐶,𝐸 ) /* new cost to 𝐸 is either old cost to 𝐸 or known
least path cost to C plus cost from 𝐶 to 𝐸 */
𝐷𝐴,𝐸 = min ∞, 1 + 2 = 3
𝐷𝐴,𝐷 = min( 𝐷𝐴,𝐷 , 𝐷𝐴,𝐶 + 𝑑𝐶,𝐷 ) /* new cost to 𝐷 is either old cost to 𝐷 or
known least path cost to 𝐶 plus cost from 𝐶 to 𝐷 */
𝐷𝐴,𝐷 = min ∞, 1 + 5 = 6
Both nodes ‘C’ and ‘F’ have cost of 1 from source node. We chose Node C
for second iteration. Now we choose Node ‘F’ for third iteration and
continue step no. 3 of algorithm until all the nodes have been visited and
included in 𝑵ሖ
Spring Semester 2021 12
Execution of Dijkstra Algorithm
Step ഥ
𝑵 𝑫𝑨,𝑪 , 𝐏 𝑪 𝑫𝑨,𝑭 ,𝑷 𝑭 𝑫𝑨,𝑬 , 𝐏 𝑬 𝑫𝑨,𝑫 , 𝐏 𝑫 𝑫𝑨,𝑮 ,𝐏 𝑮 𝑫𝑨,𝑩 , 𝐏 𝑩
1 {A} 1 , A (AC) 1 , A (AF) ∞ ∞ ∞ ∞
2 {A,C} 1 , A (AC) 1 , A (AF) 3 , C (ACE) 6 , C (ACD) ∞ ∞
5
C D
1
1
3
2 1
2 2
8
2
2 2
A E B
1 3
3
4
7 1
6
F G
3
Spring Semester 2021 13
Execution of Dijkstra Algorithm
Third Iteration (Loop)
𝑁ሖ = {A,C,F}
P 𝐹 = A (predecessor node of F) path : 𝐴 → F
for each neighbor of 𝐹 and not in 𝑁’ we update the cost
𝐷𝐴,𝐸 = min( 𝐷𝐴,𝐸 , 𝐷𝐴,𝐹 + 𝑑𝐹,𝐸 ) /* new cost to 𝐸 is either old cost to 𝐸 or known
least path cost to 𝐹 plus cost from 𝐹 to 𝐸 */
𝐷𝐴,𝐸 = min 3, 1 + 3 = 3
𝐷𝐴,𝐺 = min( 𝐷𝐴,𝐺 , 𝐷𝐴,𝐹 + 𝑑𝐹,𝐺 ) /* new cost to 𝐺 is either old cost to 𝐺 or known
least path cost to 𝐹 plus cost from 𝐹 to 𝐺 */
𝐷𝐴,𝐺 = min ∞, 1 + 6 = 7
Both nodes ‘C’ and ‘F’ have cost of 1 from source node and have been added
to 𝑵ሖ . Now we choose Node ‘E ’ , which has a cost of 3 from source node,
for fourth iteration and continue step no. 3 of algorithm until all the
ሖ
nodes have been visited and included in 𝑵.
5
C D
1
1
3
2 1
2 2
8
2
2 2
A E B
1 3
3
4
7 1
6
F G
Spring Semester 2021 3 15
Execution of Dijkstra Algorithm
Fourth Iteration (Loop)
𝑁ሖ = {A,C,F,E}
P 𝐸 = C (predecessor node of E) path : 𝐴 → C → E
for each neighbor of 𝐸 and not in 𝑁’ we update the cost
𝐷𝐴,𝐷 = min( 𝐷𝐴,𝐷 , 𝐷𝐴,𝐸 + 𝑑𝐸,𝐷 ) /* new cost to 𝐷 is either old cost to 𝐷 or
known least path cost to 𝐸 plus cost from 𝐸 to 𝐷 */
𝐷𝐴,𝐷 = min 6, 3 + 1 = 4
𝐷𝐴,𝐹 = min( 𝐷𝐴,𝐹 , 𝐷𝐴,𝐸 + 𝑑𝐸,𝐹 ) /* new cost to 𝐹 is either old cost to 𝐹 or known
least path cost to 𝐸 plus cost from 𝐸 to 𝐹 */
𝐷𝐴,𝐹 = min 1, 3 + 4 = 1
Nodes ‘C’,‘F’ and ‘E’ have minimum cost from source node and have been
added to 𝑵ሖ . Now we choose Node ‘D’ , which has a cost of 4 from source
node, for fifth iteration and continue step no. 3 of algorithm until all
ሖ
the nodes have been visited and included in 𝑵.
Step ഥ
𝑵 𝑫𝑨,𝑪 , 𝐏 𝑪 𝑫𝑨,𝑭 ,𝑷 𝑭 𝑫𝑨,𝑬 , 𝐏 𝑬 𝑫𝑨,𝑫 , 𝐏 𝑫 𝑫𝑨,𝑮 ,𝐏 𝑮 𝑫𝑨,𝑩 , 𝐏 𝑩
1 {A} 1 , A (AC) 1 , A (AF) ∞ ∞ ∞ ∞
2 {A,C} 1 , A (AC) 1 , A (AF) 3 , C (ACE) 6 , C (ACD) ∞ ∞
3 {A,C,F) 1 , A (AC) 1 , A (AF) 3 , C (ACE) 6 , C (ACD) 7 , F (AFG) ∞
4 {A,C,F,E} 1 , A (AC) 1 , A (AF) 3 , C (ACE) 4 , E (ACED) 7 , F (AFG) ∞
5 {A,C,F,E,D} 1 , A (AC) 1 , A (AF) 3 , C (ACE) 4 , E (ACED) 6 , D (ACEDG) 7 , D (ACEDB)
6 {A,C,F,E,D,G} 1 , A (AC) 1 , A (AF) 3 , C (ACE) 4 , E (ACED) 6 , D (ACEDG) 7 , D (ACEDB)
7 {A,C,F,E,D,G,B} 1 , A (AC) 1 , A (AF) 3 , C (ACE) 4 , E (ACED) 6 , D (ACEDG) 7 , D (ACEDB)
Lecture 9 – 1
Network Layer – Routing Protocols (2)
7
X Z
Cost to Cost to
Cost to
𝑫𝒙 X Y Z 𝑫𝒚 X Y Z 𝑫𝒛 X Y Z
X 0 2 7 X ∞ ∞ ∞ X ∞ ∞ ∞
From
From
From
Y ∞ ∞ ∞ Y 2 0 1 Y ∞ ∞ ∞
Z ∞ ∞ ∞ Z ∞ ∞ ∞ Z 7 1 0
𝐷𝑥 𝑥 = 0 𝐷𝑦 𝑥 = 2 𝐷𝑧 𝑥 = 7
𝐷𝑥 𝑦 = 2 𝐷𝑦 𝑦 = 0 𝐷𝑧 𝑦 = 1
𝐷𝑥 (𝑧)= 7 𝐷𝑦 (𝑧)= 1 𝐷𝑧 (𝑧)= 0
Spring Semester 2021 7
Execution of Distance Vector Algorithm
• In the initial routing tables for each node each row is a distance vector—
specifically, each node’s routing table includes its own distance vector and that
of each of its neighbors.
• Because at initialization node 𝑥 has not received anything from node 𝑦 or 𝑧,
the entries in the second and third rows are initialized to infinity.
• After initialization, each node sends its distance vector to each of its two
neighbors. After receiving the updates, each node recomputes its own
distance vector.
From
𝐷𝑥 𝑦 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑦 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑦 = min{ 2 + 0 , 7 + 1} = 2
Y 2 0 1
𝐷𝑥 𝑧 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑧 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑧 = min 2 + 1,7 + 0 = 3
Z 7 1 0
Cost to
Node ‘x’ and ‘z’ send their distance vector to ‘y’ 𝑫𝒚 X Y Z
𝐷𝑦 𝑥 = min 𝑐 𝑦, 𝑥 + 𝐷𝑥 𝑥 , 𝑐 𝑦, 𝑧 + 𝐷𝑧 𝑥 = min 2 + 0,1 + 7 = 2
X 0 2 7
From
𝐷𝑦 𝑦 = 0
𝐷𝑦 𝑧 = min 𝑐 𝑦, 𝑧 + 𝐷𝑧 𝑧 , 𝑐 𝑦, 𝑥 + 𝐷𝑥 𝑧 = min 1 + 0,2 + 7 = 1 Y 2 0 1
Z 7 1 0
Cost to
Node ‘x’ and ‘y’ send their distance vector to ‘z’
𝑫𝒛 X Y Z
𝐷𝑧 𝑥 = min 𝑐 𝑧, 𝑥 + 𝐷𝑥 𝑥 , 𝑐 𝑧, 𝑦 + 𝐷𝑦 𝑥 = { 7 + 0 , 1 + 2} = 3
From
𝐷𝑧 𝑦 = min 𝑐 𝑦, 𝑧 + 𝐷𝑦 𝑦 , 𝑐 𝑧, 𝑥 + 𝐷𝑥 𝑦 = 1 + 0 ,7 + 2 = 1 X 0 2 7
𝐷𝑧 (𝑧)= 0 Y 2 0 1
Spring Semester 2021
Z 3 1 0 9
Execution of Distance Vector Algorithm
• After the nodes recompute their distance vectors, they again send their
updated distance vectors to their neighbors (if there has been a change).
• Only nodes 𝑥 and 𝑧 send updates and node 𝑦’𝑠 distance vector didn’t change
so node 𝑦 doesn’t send an update.
• After receiving the updates, the nodes then recompute their distance vectors
and update their routing tables.
From
𝐷𝑥 𝑦 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑦 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑦 = min{ 2 + 0 , 7 + 1} = 2
Y 2 0 1
𝐷𝑥 𝑧 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑧 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑧 = min 2 + 1,7 + 0 = 3
Z 3 1 0
Cost to
Node ‘x’ sends its distance vector to ‘z’
𝑫𝒛 X Y Z
𝐷𝑧 𝑥 = min 𝑐 𝑧, 𝑥 + 𝐷𝑥 𝑥 , 𝑐 𝑧, 𝑦 + 𝐷𝑦 𝑥 = { 7 + 0 , 1 + 2} = 3
X 0 2 3
From
𝐷𝑧 𝑦 = min 𝑐 𝑧, 𝑦 + 𝐷𝑦 𝑦 , 𝑐 𝑧, 𝑥 + 𝐷𝑥 𝑦 = 1 + 0 ,7 + 2 = 1 Y 2 0 1
𝐷𝑧 (𝑧)= 0 Z 3 1 0
From
X 0 4 5
1 Y
4 Y 4 0 1
1
Z 5 1 0
X 50
Z
From
Y 1 0 1
Z 5 1 0
• At time 𝑡1 , 𝑧 and 𝑥 receive the update from 𝑦 and
Cost to
update their tables.
𝑫𝒙 X Y Z
𝐷𝑥 𝑥 = 0 X 0 1 2
𝐷𝑥 𝑦 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑦 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑦 = min{ 1 + 0 , 50 + 1} = 1
From
Y 1 0 1
𝐷𝑥 𝑧 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑧 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑧 = min 1 + 1, 50 + 0 = 2
Z 5 1 0
Cost to
𝐷𝑧 𝑥 = min 𝑐 𝑧, 𝑥 + 𝐷𝑥 𝑥 , 𝑐 𝑧, 𝑦 + 𝐷𝑦 𝑥 = { 50 + 0 , 1 + 1} = 2 𝑫𝒛 X Y Z
𝐷𝑧 𝑦 = min 𝑐 𝑧, 𝑦 + 𝐷𝑦 𝑦 , 𝑐 𝑧, 𝑥 + 𝐷𝑥 𝑦 = 1 + 0 , 50 + 1 = 1 X 0 4 5
From
𝐷𝑧 (𝑧)= 0 Y 1 0 1
Spring Semester 2021 Z 2 1 0 14
Distance Vector Algorithm – Link Cost Change
• At time 𝑡2 , 𝑥 and 𝑧 send their updated distance vectors to
Cost to
neighbors and they recompute their routing table entries.
𝑫𝒙 X Y Z
𝐷𝑥 𝑥 = 0
X 0 1 2
𝐷𝑥 𝑦 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑦 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑦 = min{ 1 + 0 , 50 + 1} = 1
From
𝐷𝑥 𝑧 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑧 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑧 = min 1 + 1, 50 + 0 = 2 Y 1 0 1
Cost to
Z 2 1 0
𝑫𝒚 X Y Z
𝐷𝑦 𝑥 = min 𝑐 𝑦, 𝑥 + 𝐷𝑥 𝑥 , 𝑐 𝑦, 𝑧 + 𝐷𝑧 𝑥 = min 1 + 0,1 + 2 = 1
X 0 1 2
𝐷𝑦 𝑦 = 0
From
𝐷𝑦 𝑧 = min 𝑐 𝑦, 𝑧 + 𝐷𝑧 𝑧 , 𝑐 𝑦, 𝑥 + 𝐷𝑥 𝑧 = min 1 + 0,1 + 2 = 1 Y 1 0 1
Z 2 1 0
Cost to
𝑫𝒛 X Y Z
𝐷𝑧 𝑥 = min 𝑐 𝑧, 𝑥 + 𝐷𝑥 𝑥 , 𝑐 𝑧, 𝑦 + 𝐷𝑦 𝑥 = { 50 + 0 , 1 + 1} = 2 X 0 1 2
𝐷𝑧 𝑦 = min 𝑐 𝑧, 𝑦 + 𝐷𝑦 𝑦 , 𝑐 𝑧, 𝑥 + 𝐷𝑥 𝑦 = 1 + 0 , 50 + 1 = 1
From
Y 1 0 1
𝐷𝑧 (𝑧)= 0
Z 2 1 0
Spring Semester 2021 15
Distance Vector Algorithm – Link Cost Change
• None of the routing entries have been updated and updates will not be sent to
neighbors. Thus two iterations are required for the DV algorithm to converge.
The good news about the decreased cost between 𝑥 and 𝑦 has propagated
quickly through the network.
• Before the link cost changes, the routing tables at each node will be: Cost to
X Y Z
From
X 0 4 5
• Now consider that link cost between 𝑥 and 𝑦 has increased.
Y 4 0 1
Z 5 1 0
60 Y
4
1
X 50
Z
From
Y 6 0 1
• With the global view of the network, we can see that this new cost via 𝑧 is wrong. Z 5 1 0
• But the only information node 𝑦 has is that its direct cost to 𝑥 is 60 and that 𝑧 has last told
𝑦 that 𝑧 could get to 𝑥 with a cost of 5.
• So in order to get to 𝑥, 𝑦 would now route through 𝑧, fully expecting that 𝑧 will be able to
get to 𝑥 with a cost of 5.
• As of 𝑡1 we have a routing loop—in order to get to 𝑥, 𝑦 routes through 𝑧, and 𝑧 routes
through 𝑦.
• A packet destined for 𝑥 arriving at 𝑦 or 𝑧 at 𝑡1 will bounce back and forth between these
two nodes forever (or until the forwarding tables are changed). Y
60 1
4
Spring Semester 2021 X 50 17 Z
Distance Vector Algorithm – Link Cost Change
• At time 𝑡1 , 𝑦 informs its neighbors of its new distance vector.
Cost to
• Sometime after 𝑡1 , 𝑧 receives 𝑦’𝑠 new distance vector, which indicates that
𝑦’𝑠 minimum cost to 𝑥 is 6. 𝑫𝒛 X Y Z
• 𝑧 knows it can get to 𝑦 with a cost of 1 and hence computes a new least X 0 4 5
cost to 𝑥 :
From
Y 6 0 1
Z 7 1 0
𝐷𝑧 𝑥 = min 𝑐 𝑧, 𝑥 + 𝐷𝑥 𝑥 , 𝑐 𝑧, 𝑦 + 𝐷𝑦 𝑥 = { 50 + 0 , 1 + 6} = 7
Cost to
• Since 𝑧’𝑠 least cost to 𝑥 has increased, it then informs 𝑦 of its new distance 𝑫𝒚 X Y Z
vector at 𝑡2 .
X 0 4 5
• In a similar manner, after receiving 𝑧’𝑠 new distance vector, 𝑦 determines:
From
Y 8 0 1
𝐷𝑦 𝑥 = min 𝑐 𝑦, 𝑥 + 𝐷𝑥 𝑥 , 𝑐 𝑦, 𝑧 + 𝐷𝑧 𝑥 = min 60+, 1 + 7 = 8 Z 7 1 0
and sends 𝑧 its distance vector. 𝑧 then determines 𝐷𝑧 𝑥 = 9 and sends 𝑦 its
distance vector, and so on.
Lecture 9 – 2
Network Layer – Interior Gateway
Routing Protocols - RIP
Spring Semester 2021 1
Interior Gateway Routing Protocols
• An Interior gateway routing protocol is used to determine how routing is performed within an
autonomous system (AS). These routing protocols are also known as Intra-AS routing
protocols.
• Two most popular routing protocols that have been used extensively for routing within an
autonomous system in the Internet are :
• Routing Information Protocol (RIP), and
• Open Shortest Path First (OSPF).
1 2 1
1 2 3 6
Lecture 10-1
Network Layer – Interior Gateway
Routing Protocols - OSPF
Spring Semester 2021 1
Interior Gateway Routing Protocols
• An Interior gateway routing protocol is used to determine how routing is performed within an
autonomous system (AS). These routing protocols are also known as Intra-AS routing
protocols.
• Two most popular routing protocols that have been used extensively for routing within an
autonomous system in the Internet are :
• Routing Information Protocol (RIP), and
• Open Shortest Path First (OSPF).