0% found this document useful (0 votes)
7 views80 pages

Ch04-Communication Networks

The document provides an overview of data communication and networking, covering key topics such as data link layer protocols, local and wide area networks, and various Ethernet standards. It details the structure and operation of different network topologies, including token ring and Ethernet, and explains IP addressing and subnetting. Additionally, it discusses the IEEE 802 standards and their relevance to network communication protocols.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views80 pages

Ch04-Communication Networks

The document provides an overview of data communication and networking, covering key topics such as data link layer protocols, local and wide area networks, and various Ethernet standards. It details the structure and operation of different network topologies, including token ring and Ethernet, and explains IP addressing and subnetting. Additionally, it discusses the IEEE 802 standards and their relevance to network communication protocols.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Data Communication and Networking 24-Mar-25

Data Communication and


Networking

Dept. of Telecoms Engineering 1


Data Communication and Networking 24-Mar-25

Content
❑ Chapter 3: Data Link Layer Protocols
❖ Flow Control
❖ Error Control
❖ Connection Management
❖ Data link layer Protocols
❑ Chapter 4: Communication Networks
❖ Introduction to communication networks
❖ 802.x standard and TCP/IP Model
❖ Ethernet, Token Pass, Token Ring
❖ IP Addressing: Classfull and VLSM
❖ Network devices
❖ Switching and Routing
❖ STP, VLAN

Dept. of Telecoms Engineering 2


Data Communication and Networking 24-Mar-25

Local Area Network


❑ A local area network (LAN) is a computer network that
interconnects computers in a limited area such as a home,
school, computer laboratory, or office building using network
media
❑ Medium:
❖ Coaxial cable
❖ Twisted-pair line

Dept. of Telecoms Engineering 3


Data Communication and Networking 24-Mar-25

Wide Area Network


❑ A wide area network (WAN) is a network that covers a broad
area (i.e., any telecommunications network that links across
metropolitan, regional, or national boundaries) using private
or public network transports

Dept. of Telecoms Engineering 4


Data Communication and Networking 24-Mar-25

Physical Topology

Bus Extended Star

Ring
Hierarchical

Star Mesh

Dept. of Telecoms Engineering 5


Data Communication and Networking 24-Mar-25

Project 802
❑ IEEE 802 refers to a family of IEEE standards dealing with local
area networks and metropolitan area networks
❑ The services and protocols specified in IEEE 802 map to the
lower two layers (Data Link and Physical) of the seven-layer
OSI networking reference model. In fact, IEEE 802 splits the
OSI Data Link Layer into two sub-layers named Logical Link
Control (LLC) and Media Access Control (MAC), so that the
layers can be listed like this:
❖Data link layer
• LLC Sublayer:
• MAC Sublayer
❖Physical layer

Dept. of Telecoms Engineering 6


Data Communication and Networking 24-Mar-25

Project 802
❑ Modules in Project 802
❑ LLC: based on HDLC protocol
❖ Multiplexing protocols
transmitted over the MAC
layer (when transmitting) and
decoding them (when
receiving).
❖ Providing node-to-node flow
and error control
❑ MAC: provides addressing and
channel access control
mechanisms that make it possible
for several terminals or network
nodes to communicate within a
multiple access network that
incorporates a shared medium

Dept. of Telecoms Engineering 7


Data Communication and Networking 24-Mar-25

LLC Frame formats


❑LLC PDU:
❖DSAP: Destination
Service Access Point
❖SSAP: Source Service
Access Point
❑Control field:
❖HDLC format

Dept. of Telecoms Engineering 8


Data Communication and Networking 24-Mar-25

Ethernet
❑ Topology: bus, star, ring
❑ Media Access Control: Deterministic, Non-deterministic
❑ Addressing:
❖Every computer has a unique way of identifying itself :
MAC address or physical address.
❖The physical address is located on the Network Interface
Card (NIC).
❖MAC addresses have no structure, and are considered flat
address spaces. MAC addresses are sometimes referred to
as burned-in addresses (BIAs) because they are burned
into read-only memory (ROM) and are copied into
random-access memory (RAM) when the NIC initializes.
• 0000.0c12.3456 or 00-00-0c-12-34-56
• If MAC is all bits 1: broadcast address

Dept. of Telecoms Engineering 9


Data Communication and Networking 24-Mar-25

IEEE 802.3: frame format


❑ Preamble: 10101010 (7 bytes)
❑ The Start Frame field (10101011) tells other devices on the network that a
frame is coming down the wire.
❑ The Address field stores the source and destination MAC addresses.
❖ Source address is unicast, Destination address can be unicast, multicast or broadcast
❑ The Type/Length field is an optional field
❖ Exact length of frame, or Layer 3 protocol making the sending request, or Not used
❑ The Data field is the actual information being sent by the upper layer
protocols. Therefore, it will be all upper layer data.
❑ CRC: 4 bytes, error checking

Dept. of Telecoms Engineering 10


Data Communication and Networking 24-Mar-25

Ethernet: 802.3
❑ 10Base-2: 50Ω Thin cable, 185m.
❑ 10Base-5: 50Ω Thick cable, 500m.
❑ 10Base-T: 100Ω UTP cable, 100m.
❑ 10Base-F: Fiber optic cable, 1000m.
❑ 100Base-TX: 100Ω UTP/STP cable, 100m.
❑ 100Base-T4: 100Ω UTP (4p) cable, 100m.
❑ 100Base-FX: Fiber optic cable, 400m.
❑ 1000Base-T: 100Ω UTP/STP cable, 100m.

Dept. of Telecoms Engineering 11


Data Communication and Networking 24-Mar-25

Ethernet: 802.3

Dept. of Telecoms Engineering 12


Data Communication and Networking 24-Mar-25

Ethernet: 10BASE-5
❑ NIC: Network Interface Card
❑ MAU: Medium Attachment Unit
❑ Thick Ethernet (thicknet)
❑ 50Ω Thick cable, 500m

Dept. of Telecoms Engineering 13


Data Communication and Networking 24-Mar-25

Ethernet: 10BASE-2
❑ Thin Ethernet
❑ 50Ω Thin cable, 185m.

Dept. of Telecoms Engineering 14


Data Communication and Networking 24-Mar-25

Ethernet: 10BASE-T
❑ Twisted-pair cable
❑ 100Ω UTP cable, 100m.
❑ Data rate: 10 Mbps

Dept. of Telecoms Engineering 15


Data Communication and Networking 24-Mar-25

Ethernet: 10BASE-F
❑ Two fiber-optic cables
❑ Data rate: 10 Mbps

Dept. of Telecoms Engineering 16


Data Communication and Networking 24-Mar-25

Ethernet Operation
❑Specified by the technology
being used.
❑Determine who can transmit
and when.
❑Two types:
❖Deterministic: “Let’s take
turns”.
• Token-Ring, FDDI.
❖Non-deterministic: “First come,
first serve”.
• Ethernet : CSMA/CD.

Carrier Sense Multiple Access with Collision


Detection (CSMA/CD).

Dept. of Telecoms Engineering 17


Data Communication and Networking 24-Mar-25

Three common layer 2 technologies


❑Ethernet: logical
broadcast topology

❑Token Ring: logical


token ring topology

❑FDDI: logical token ring


topology

Dept. of Telecoms Engineering 18


Data Communication and Networking 24-Mar-25

Ethernet MAC
❑Ethernet is a shared-media broadcast
technology. The access method CSMA/CD
used in Ethernet performs three functions:
❖Transmitting and receiving data packets
❖Decoding data packets and checking them for
valid addresses before passing them to the upper
layers of the OSI model
❖Detecting errors within data packets or on the
network

Dept. of Telecoms Engineering 19


Data Communication and Networking 24-Mar-25

CSMA/CD Process

Dept. of Telecoms Engineering 20


Data Communication and Networking 24-Mar-25

Fast Ethernet
❑ Speed: 100 Mbps
❑ Distance: <250m
❑ Backward compatible with Ethernet
10 Mbps
❑ Uses Twisted-pair or Fiber

Dept. of Telecoms Engineering 21


Data Communication and Networking 24-Mar-25

Fast Ethernet: Encoding

Dept. of Telecoms Engineering 22


Data Communication and Networking 24-Mar-25

Gigabit Ethernet: Encoding

Dept. of Telecoms Engineering 23


Data Communication and Networking 24-Mar-25

Gigabit Ethernet
❑ >1 Gbps
❑ Using Fiber optic
❑ Deployed as backbone
network, connecting Fast
Ethernet networks

Dept. of Telecoms Engineering 24


Data Communication and Networking 24-Mar-25

Ethernet: summary

Dept. of Telecoms Engineering 25


Data Communication and Networking 24-Mar-25

Token Ring
❑ Token ring LAN technology was a
protocol which resided at the data link
layer (DLL) of the OSI model. It used a
special three-byte frame called a token
that travels around the ring. Token-
possession grants the possessor
permission to transmit on the medium.
Token ring frames travel completely
around the loop.
❑ Initially used only in IBM computers, it
was eventually standardized with
protocol IEEE 802.5.
❑ Physical ring topology

Dept. of Telecoms Engineering 26


Data Communication and Networking 24-Mar-25

Token Ring
❑ The data transmission process goes as follows:
❖ Empty information frames are continuously circulated
on the ring.
❖ When a computer has a message to send, it seizes the
token. The computer will then be able to send the
frame.
❖ The frame is then examined by each successive
workstation. The workstation that identifies itself to
be the destination for the message copies it from the
frame and changes the token back to 0.
❖ When the frame gets back to the originator, it sees
that the token has been changed to 0 and that the
message has been copied and received. It removes
the message from the frame.
❖ The frame continues to circulate as an "empty"
frame, ready to be taken by a workstation when it has
a message to send.
❑ Issues:
❖ Who generates token?
❖ If the node keeping token is dead, what happens?

Dept. of Telecoms Engineering 27


Data Communication and Networking 24-Mar-25

Token Bus
❑ Also use token as Token Ring
❑ Physical Bus topology
❑ Token bus was standardized by IEEE standard 802.4. It is
mainly used for industrial applications
❑ Due to difficulties handling device failures and adding new
stations to a network, token bus gained a reputation for being
unreliable and difficult to upgrade

Dept. of Telecoms Engineering 28


Data Communication and Networking 24-Mar-25

IP Addressing: IPv4
❑ An IPv4 address is 32 bits
long.
❑ The IPv4 addresses are
unique and universal.
❑ Network address + Host
address: Hierarchical
Addressing Schemes.

Dept. of Telecoms Engineering 29


Data Communication and Networking 24-Mar-25

IP Header
IP protocol version 32 bits total datagram
number
header length type of length (bytes)
ver head. length
(bytes) len service for
“type” of data fragment fragmentation/
16-bit identifier Flags
offset reassembly
max number time to upper header
remaining hops live layer checksum
(decremented at
32 bit source IP address
each router)
32 bit destination IP address
upper layer protocol
to deliver payload to Options (if any) E.g. timestamp,
record route
how much overhead with data taken, specify
TCP? (variable length, list of routers
 20 bytes of TCP
typically a TCP to visit.
 20 bytes of IP
or UDP segment)
 = 40 bytes + app layer
overhead

Dept. of Telecoms Engineering 30


Data Communication and Networking 24-Mar-25

Classful IP addressing
❑ In classful addressing, the address space is divided into five
classes: A, B, C, D, and E.
❑ In classful addressing, a large part of the available addresses
were wasted.

Dept. of Telecoms Engineering 31


Data Communication and Networking 24-Mar-25

Classful IP addressing
❑ Network Bits:
❖ Provided by Internet
Network Information
Center
❖ Define the network
the remote device
wants to connect to
❖ Defined by subnet-
mask
❑ Host Bits:
❖ Managed by Network
Administrator Class C Network address: 192.168.10.100/255.255.255.0 (or /24)
❖ Define the device IP Addr 11000000. 101010000. 00001010. 01100100
address in the N . N . N . H
network that the
AND operation
remote device wants
to connect to Default 11111111. 11111111. 11111111. 00000000
subnet
❖ All bits are 0: no use Mask
❖ All bits are 1:
Network 11000000. 101010000. 00001010. 00000000
broadcast address addr

Dept. of Telecoms Engineering 32


Data Communication and Networking 24-Mar-25

Classful IP addressing
❑ In classful addressing, a large part of the available addresses
were wasted.

Dept. of Telecoms Engineering 33


Data Communication and Networking 24-Mar-25

Classful IP addressing: Example


Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.

Dept. of Telecoms Engineering 34


Data Communication and Networking 24-Mar-25

Subnetting
❑Network administrators sometimes need to divide
networks, especially large ones, into smaller
networks:
❖Reduce the size of a broadcast domain.
❖Improve network security.
❖Implement the hierarchical managements.
❑So we need more network addresses for your
network. But I want the outside networks see our
network as a single network.

Dept. of Telecoms Engineering 35


Data Communication and Networking 24-Mar-25

Subnetting
❑ Non-subnetted
network

❑ Subnetted network into


separate smaller
networks

Dept. of Telecoms Engineering 36


Data Communication and Networking 24-Mar-25

Subnetting
❑ To create a subnet address, a network administrator “borrows” bits from
the original host portion and designates them as the subnet field.
❑ “Borrows” bits is always the leftmost host bit, the one closest to the last
network octet.
❑ Subnet addresses include the Class A, Class B, or Class C network portion,
plus a subnet field and a host field.
❑ Subnet addresses are assigned locally, usually by a network administrator.
❑ How many bits can we borrow?
❑ All of subnet bits are:
❖ 0 : reserved for network address.
❖ 1 : reserved for broadcast address.
❑ The minimum bits you can borrow is: 2 bits.
❑ The maximum bits you can borrow is:
❖ A: 22 bits ~ 222 - 2 = 4.194.302 subnets.
❖ B: 14 bits ~ 214 - 2 = 16.382 subnets.
❖ C: 06 bits ~ 206 - 2 = 62 subnets.

Dept. of Telecoms Engineering 37


Data Communication and Networking 24-Mar-25

Subnetting Example
❑ Given network 172.16.0.0: We need 6 usable subnets and up
to 8100 hosts on each subnet.
❑ Define class: class B, 255.255.0.0
❑ 6 usable subnets: borrow 3 bits
❑ Determine the subnets from 3 borrowed bits from the host
portion (last 2 bytes):
❖ 0 subnet: .00000000.00000000
❖ 1st subnet: .00100000.00000000(32=25)
❖ 2nd subnet: .01000000.00000000
❖ 3rd subnet: .0110000.00000000
❖ 4th subnet: .10000000.00000000
❖ 5th subnet: .10100000.00000000
❖ 6th subnet: .11000000.00000000(6x25)
❖ subnet: .11100000.00000000

Dept. of Telecoms Engineering 38


Data Communication and Networking 24-Mar-25

Subnetting Example
Sub-network Broadcast Use
No Possible host address
address address ?

0 172.16.0.0 .0.1 – .31.254 .31.255 N


1 172.16.32.0 .32.1 – .63.254 .63.255 Y
2 172.16.64.0 .64.1 –.95.254 .95.255 Y
3 172.16.96.0 .96.1 –.127.254 .127.255 Y
4 172.16.128.0 .128.1 –.159.254 .159.255 Y

5 172.16.160.0 .160.1 –.191.254 .191.255 Y


6 172.16.192.0 .192.1 –.223.254 .223.255 Y
7 172.16.224.0 .224.1 –.255.254 .255.255 N

Dept. of Telecoms Engineering 39


Data Communication and Networking 24-Mar-25

Subnetting
❑Addresses are loose by subnetting.
❑Network administrator must strike a balance
between the number of subnets required, the hosts
per subnet that is acceptable, and the resulting
waste of addresses.

Dept. of Telecoms Engineering 40


Data Communication and Networking 24-Mar-25

IP Address Problems
❑ In the 1990, two problems became apparent
❖ IP addresses were being exhausted
❖ IP routing tables were growing very large
❑ IP Address Exhaustion
❖ Class A, B, and C address structure inefficient
❖ Class B too large for most organizations, but future proof
❖ Class C too small
❖ Rate of class B allocation implied exhaustion by 1994
❑ IP routing table size
❖ Growth in number of networks in Internet reflected in # of table entries
• From 1991 to 1995, routing tables doubled in size every 10 months
• Stress on router processing power and memory allocation
❑ Short-term solution:
❖ Classless Interdomain Routing (CIDR), RFC 1518
❖ New allocation policy (RFC 2050)
❖ Private IP Addresses set aside for intranets
❑ Long-term solution: IPv6 with much bigger address space

Dept. of Telecoms Engineering 41


Data Communication and Networking 24-Mar-25

Supernetting
❑Summarize a contiguous group of class C addresses
using variable-length mask
❑Example: 150.158.16.0/20
❖IP Address (150.158.16.0) & mask length (20)
❖IP add = 10010110 10011110 00010000 00000000
❖Mask = 11111111 11111111 11110000 00000000
❖Contains 16 Class C blocks:
❖From 10010110 10011110 00010000 00000000
• i.e. 150.158.16.0
❖Up to 10010110 10011110 00011111 00000000
• i.e. 150.158.31.0

Dept. of Telecoms Engineering 42


Data Communication and Networking 24-Mar-25

Summarizing Within an Octet

Dept. of Telecoms Engineering 43


Data Communication and Networking 24-Mar-25

Subnetting: Example 1
❑For example, consider a relatively small
company with a Class C network,
201.45.222.0/24. They have 6 subnetworks in
their network. The first four subnets (S1, S2,
S3 and S4) are relatively small, containing only
10 hosts each. However, one of them (S5) is
for their production floor and has 50 hosts,
and the last (S6) is their development and
engineering group, which has 100 hosts.
❑Classfull IP Subneting?

Dept. of Telecoms Engineering 44


Data Communication and Networking 24-Mar-25

Subnetting Example 2
❑For example, consider the subnet address
172.16.32.0/20 and a network needing ten host
addresses.

❑With this subnet address, there are over 4000 (212 – 2


= 4094) host addresses, most of which will be wasted.

❑Need Variable Length Subnet Mask (VLSM)

Dept. of Telecoms Engineering 45


Data Communication and Networking 24-Mar-25

VLSM Example
❑Given the Class C network of 204.15.5.0/24, subnet
the network in order to create the network in the
figure below, with the host requirements shown:
❖ NetA: 14 hosts
❖ NetB: 28 hosts
❖ NetC: 2 hosts
❖ NetD: 7 hosts
❖ NetE: 28 hosts
❑Solution?
❖Classful subnetting?
❖VLSM?
❖What do we benefit when using VLSM?

Dept. of Telecoms Engineering 46


Data Communication and Networking 24-Mar-25

VLSM Example
❑Solution: Classful subnetting
• netA: 204.15.5.32/27 host address range 33 to 62
• netB: 204.15.5.64/27 host address range 65 to 94
• netC: 204.15.5.96/27 host address range 97 to 126
• netD: 204.15.5.128/27 host address range 129 to 158
• netE: 204.15.5.160/27 host address range 161 to 190

❑Solution: VSLM
• netA: requires a /28 (255.255.255.240) mask to support 14 hosts
• netB: requires a /27 (255.255.255.224) mask to support 28 hosts
• netC: requires a /30 (255.255.255.252) mask to support 2 hosts
• netD*: requires a /28 (255.255.255.240) mask to support 7 hosts
• netE: requires a /27 (255.255.255.224) mask to support 28 hosts

* a /29 (255.255.255.248) would only allow 6 usable host addresses


therefore netD requires a /28 mask

Dept. of Telecoms Engineering 47


Data Communication and Networking 24-Mar-25

VLSM Example
❑Solution: VSLM assign the largest first
•netB: 204.15.5.0/27 host address range 1 to 30
•netE: 204.15.5.32/27 host address range 33 to 62
•netA: 204.15.5.64/28 host address range 65 to 78
•netD: 204.15.5.80/28 host address range 81 to 94
•netC: 204.15.5.96/30 host address range 97 to 98

NetB: 28 hosts (using a block of 32)


NetE: 28 hosts (using a block of 32)
NetA: 14 hosts (using a block of (16)
NetD: 7 hosts (using a block of (16)
NetC: 2 hosts (using a block of 4)

Dept. of Telecoms Engineering 48


Data Communication and Networking 24-Mar-25

A Working VLSM Example


❑Subnetting without VLSM:
❖8 networks
❖What is the reason?

Dept. of Telecoms Engineering 49


Data Communication and Networking 24-Mar-25

A Working VLSM Example


❑VLSM solution

Dept. of Telecoms Engineering 50


Data Communication and Networking 24-Mar-25

A Working VLSM Example

Dept. of Telecoms Engineering 51


Data Communication and Networking 24-Mar-25

A Working VLSM Example

Dept. of Telecoms Engineering 52


Data Communication and Networking 24-Mar-25

Summarizing Within an Octet


❑Route summary: reduce routing traffic

Dept. of Telecoms Engineering 53


Data Communication and Networking 24-Mar-25

Network Devices
❑ Hub/Repeater
❑ Switch/Bridge
❑ Router/3-layer switch
❑ Gateway

Dept. of Telecoms Engineering 54


Data Communication and Networking 24-Mar-25

Network Devices
❑Hub/Repeater
❖ Propagate signals from
one port to others
❖ Layer 1 devices: connects
segments of a LAN.
❖ Extending a network with
a repeater or a hub,
results in a larger
collision domain.
❑ Collision Domains are the
area where collisions occur.
All of layer 1
interconnections are part of
the collision domain.

Dept. of Telecoms Engineering 55


Data Communication and Networking 24-Mar-25

Network Devices
❑Switch
❖A multi port bridge
❖Support full duplex
❖Hardware switching
❖Dynamically builds and
maintains a Content-
Addressable Memory
(CAM) table
❑ Segmenting Collision Domain
❑ Can not prevent layer 2
broadcast domain

Dept. of Telecoms Engineering 56


Data Communication and Networking 24-Mar-25

Network Devices
❑Router:
❖Layer 3 device
❖Routing packets to destination based on destination IP
address
❖Running routing protocol
❖Split layer 2 broadcast domain

Dept. of Telecoms Engineering 57


Data Communication and Networking 24-Mar-25

Network Devices
❑Gateway:
❖The gateway acts as a “Translator” in between two
different systems that is used dissimilar communication
protocols, data format or different architectures
❖Operate at Application layer in OSI model

Synway E1/T1 Trunk Gateway for VoIP


Dept. of Telecoms Engineering 58
Data Communication and Networking 24-Mar-25

Switching
❑ link-layer device: smarter
than hubs, take active role
❖ store, forward Ethernet
frames
❖ examine incoming frame’s
MAC address, selectively
forward frame to one-or-
more outgoing links when
frame is to be forwarded on
segment, uses CSMA/CD to
access segment
❑ transparent
❖ hosts are unaware of
presence of switches
❑ plug-and-play, self-
learning
❖ switches do not need to be
configured

Dept. of Telecoms Engineering 59


Data Communication and Networking 24-Mar-25

Switching
❑ allows multiple simultaneous A
transmissions
❑ hosts have dedicated, direct C’ B
connection to switch
❑ switches buffer packets 1 2
6 3
❑ Ethernet protocol used on each
5 4
incoming link, but no collisions;
full duplex
C
❖ each link is its own collision
domain
B’ A’
❑ switching: A-to-A’ and B-to-B’
simultaneously, without switch with six interfaces
collisions (1,2,3,4,5,6)
❖ not possible with dumb hub

Dept. of Telecoms Engineering 60


Data Communication and Networking 24-Mar-25

Switching
❑ Q: how does switch know that A
A’ reachable via interface 4, B’
reachable via interface 5? C’ B
❑ A: each switch has a switch
table, each entry: 1 2
6 3
❖ (MAC address of host, interface to 4
5
reach host, time stamp)
❑ looks like a routing table! C
❑ Q: how are entries created,
B’ A’
maintained in switch table?
❖ something like a routing protocol? switch with six interfaces
(1,2,3,4,5,6)

Dept. of Telecoms Engineering 61


Data Communication and Networking 24-Mar-25

Switch: self-learning Source: A


Dest: A’
❑ switch learns which hosts A A A’
can be reached through
which interfaces C’ B
❖ when frame received,
switch “learns” location of 1 2
sender: incoming LAN 6 3
segment 5 4
❖ records sender/location pair
in switch table C

B’ A’
MAC addr interface TTL

A 1 60 Switch table
(initially empty)

Dept. of Telecoms Engineering 62


Data Communication and Networking 24-Mar-25

Self-learning, forwarding: example


❑ frame destination A A A’
unknown: flood Source: A
❑ destination A location C’ B Dest: A’
known: selective send
1 2
❑ How does self-learning A6A’ 3
work if switches can be 5 4
connected together?
C
A’ A
B’ A’
MAC addr interface TTL
A 1 60
A’ 4 60 Switch table
(initially empty)

Dept. of Telecoms Engineering 63


Data Communication and Networking 24-Mar-25

Loop problem in learning MAC addresses

Dept. of Telecoms Engineering 64


Data Communication and Networking 24-Mar-25

Routing
❑ Router receives packets and
forwards them to the destination
(based on destination IP)
❑ How does router work?
❖ Check the header of IP packet
❖ Look up the routing table
❖ Determine the output port
❖ Forward the packet to the output
Control Plane
port
Forwarding Next Hop + Port
Table
Routing
Packets Output
Packets
Packet Output
Queuing and
Classification Queue
Schedule rules

Input
Packets

Header payload
User Plane

Dept. of Telecoms Engineering 65


Data Communication and Networking 24-Mar-25

Routing
❑Each router needs running a routing protocol to
update the its routing table
❑Delay of packets
❖Queuing delay
❖Processing delay
❖Propagation delay

Dept. of Telecoms Engineering 66


Data Communication and Networking 24-Mar-25

Routing Protocols: Classification


❑ Global or decentralized information?
❖ Global:
• all routers have complete topology, link cost info
• “link state” algorithms
❖ Decentralized:
• router knows physically-connected neighbors, link costs to neighbors
• iterative process of computation, exchange of info with neighbors
• “distance vector” algorithms
❑ Static or dynamic?
❖ Static:
• routes change slowly over time
❖ Dynamic:
• routes change more quickly
• periodic update
• in response to link cost changes

Dept. of Telecoms Engineering 67


Data Communication and Networking 24-Mar-25

Routing Algorithms: Link State


Dijkstra’s algorithm Notation:
❑ net topology, link costs ❑ c(x,y): link cost from node x
known to all nodes to y; = ∞ if not direct
❖ accomplished via “link state neighbors
broadcast”
❑ D(v): current value of cost of
❖ all nodes have same info
path from source to dest. v
❑ computes least cost paths
from one node (‘source”) to ❑ p(v): predecessor node along
path from source to v
all other nodes
❖ gives forwarding table for that ❑ N': set of nodes whose least
node cost path definitively known
❑ iterative: after k iterations,
know least cost path to k
dest.’s

Dept. of Telecoms Engineering 68


Data Communication and Networking 24-Mar-25

Dijkstra’s algorithm: example


Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 u,x 2,u 4,x 2,x ∞
2 u,x,y 2,u 3,y 4,y
3 u,x,y,v 3,y 4,y
4 u,x,y,v,w 4,y
5 u,x,y,v,w,z
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y

Dept. of Telecoms Engineering 69


Data Communication and Networking 24-Mar-25

Dijkstra’s algorithm: example


Resulting shortest-path tree from u:
v w
u z
x y
Resulting forwarding table in u:
destination link
v (u,v)
x (u,x)
y (u,x)
w (u,x)
z (u,x)

Dept. of Telecoms Engineering 70


Data Communication and Networking 24-Mar-25

Dijkstra’s algorithm, discussion


❑ Algorithm complexity: n nodes
❖ each iteration: need to check all nodes, w, not in N
❖ n(n+1)/2 comparisons: O(n2)
❖ more efficient implementations possible: O(nlogn) Dijkstra selects vertex
❖ Do not work with negative link costs: 3 immediately after 0.
But shortest path from
❑ Oscillations possible: 0 to 3 is 0-1-2-3.

❖ e.g., link cost = amount of carried traffic

1 A A A A
1+e 2+e 0 0 2+e 2+e 0
D 0 0 B D B D B D B
1+e 1 0 0 1+e 1
0 e 0 0 1 1+e 0 e
1
C C C C
1
e
… recompute … recompute … recompute
initially
routing

Dept. of Telecoms Engineering 71


Data Communication and Networking 24-Mar-25

Dijkstra’s algorithm: Example


❑Given a network topology with the link cost of
distance (km). Assuming v=2.108 m/s:
❖Find the Shortest Path from node A to other nodes so that
the end-to-end delay is smallest?
❖If the packet processing time at each node is 1us, how can
you modify the algorithm?

Dept. of Telecoms Engineering 72


Data Communication and Networking 24-Mar-25

Distance Vector Algorithm


❑Bellman-Ford Equation (dynamic programming)
Define:
dx(y) := cost of least-cost path from x to y
Then
dx(y) = min {c(x,v) + dv(y) }

where min is taken over all neighbors v of x

Dept. of Telecoms Engineering 73


Data Communication and Networking 24-Mar-25

Bellman-Ford example
5
Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3
3
v w 5 B-F equation says:
2
u 2 1 z du(z) = min { c(u,v) + dv(z),
3
1 2 c(u,x) + dx(z),
x 1
y
c(u,w) + dw(z) }
= min {2 + 5,
1 + 3,
5 + 3} = 4

Node that achieves minimum is next


hop in shortest path ➜ forwarding table

Dept. of Telecoms Engineering 74


Data Communication and Networking 24-Mar-25

Distance Vector Algorithm


❑Dx(y) = estimate of least cost from x to y
❑Node x knows cost to each neighbor v:
c(x,v)
❑Node x maintains distance vector
Dx = [Dx(y): y є N ]
❑Node x also maintains its neighbors’ distance vectors
❖For each neighbor v, x maintains
Dv = [Dv(y): y є N ]

Dept. of Telecoms Engineering 75


Data Communication and Networking 24-Mar-25

Distance Vector Algorithm


❑Basic idea:
❖From time-to-time, each node sends its own distance
vector estimate to neighbors
❖Asynchronous
❖When a node x receives new DV estimate from neighbor, it
updates its own DV using B-F equation:
Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N

❖Under minor, natural conditions, the estimate Dx(y)


converge to the actual least cost dx(y)

Dept. of Telecoms Engineering 76


Data Communication and Networking 24-Mar-25

Distance Vector Algorithm


Iterative, asynchronous: each Each node:
local iteration caused by:
 local link cost change
 DV update message from wait for (change in local link
neighbor cost or msg from neighbor)

Distributed:
 each node notifies neighbors recompute estimates
only when its DV changes
 neighbors then notify their
neighbors if necessary if DV to any dest has changed,
notify neighbors

Dept. of Telecoms Engineering 77


Data Communication and Networking
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) 24-Mar-25
+
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to
x y z x y z
x 0 2 7 x 0 2 3
from

from
y ∞∞ ∞ y 2 0 1
z ∞∞ ∞ z 7 1 0
node y table
cost to
x y z y
2 1
x ∞ ∞ ∞
x z
from

y 2 0 1 7
z ∞∞ ∞
node z table
cost to
x y z
x ∞∞ ∞
from

y ∞∞ ∞
z 7 1 0 Network Layer time

Dept. of Telecoms Engineering 78


Data Communication and Networking
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) 24-Mar-25
+
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to cost to
x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from

from

from
y ∞∞ ∞ y 2 0 1 y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y table
cost to cost to cost to
x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from

from
from

y 2 0 1 y 2 0 1 y 2 0 1 7
z ∞∞ ∞ z 7 1 0 z 3 1 0
node z table
cost to cost to cost to
x y z x y z x y z

x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
from

y ∞∞ ∞ y 2 0 1 y 2 0 1
z 7 1 0 z 3 1 0 z 3 1 0
time

Dept. of Telecoms Engineering 79


Data Communication and Networking 24-Mar-25

Distance Vector: link cost changes


Link cost changes:
❖ node detects local link cost change 1
y
❖ updates routing info, recalculates 4 1
distance vector x z
50
❖ if DV changes, notify neighbors

At time t0, y detects the link-cost change, updates its DV,


“good and informs its neighbors.

news At time t1, z receives the update from y and updates its table.
It computes a new least cost to x and sends its neighbors its DV.
travels
At time t2, y receives z’s update and updates its distance table.
fast” y’s least costs do not change and hence y does not send any
message to z.

Dept. of Telecoms Engineering 80

You might also like