Ch04-Communication Networks
Ch04-Communication Networks
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
Physical Topology
Ring
Hierarchical
Star Mesh
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
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
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
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.
Ethernet: 802.3
Ethernet: 10BASE-5
❑ NIC: Network Interface Card
❑ MAU: Medium Attachment Unit
❑ Thick Ethernet (thicknet)
❑ 50Ω Thick cable, 500m
Ethernet: 10BASE-2
❑ Thin Ethernet
❑ 50Ω Thin cable, 185m.
Ethernet: 10BASE-T
❑ Twisted-pair cable
❑ 100Ω UTP cable, 100m.
❑ Data rate: 10 Mbps
Ethernet: 10BASE-F
❑ Two fiber-optic cables
❑ Data rate: 10 Mbps
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.
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
CSMA/CD Process
Fast Ethernet
❑ Speed: 100 Mbps
❑ Distance: <250m
❑ Backward compatible with Ethernet
10 Mbps
❑ Uses Twisted-pair or Fiber
Gigabit Ethernet
❑ >1 Gbps
❑ Using Fiber optic
❑ Deployed as backbone
network, connecting Fast
Ethernet networks
Ethernet: summary
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
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?
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
IP Addressing: IPv4
❑ An IPv4 address is 32 bits
long.
❑ The IPv4 addresses are
unique and universal.
❑ Network address + Host
address: Hierarchical
Addressing Schemes.
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
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.
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
Classful IP addressing
❑ In classful addressing, a large part of the available addresses
were wasted.
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.
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.
Subnetting
❑ Non-subnetted
network
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.
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
Subnetting Example
Sub-network Broadcast Use
No Possible host address
address address ?
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.
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
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
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?
Subnetting Example 2
❑For example, consider the subnet address
172.16.32.0/20 and a network needing ten host
addresses.
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?
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
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
Network Devices
❑ Hub/Repeater
❑ Switch/Bridge
❑ Router/3-layer switch
❑ Gateway
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.
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
Network Devices
❑Router:
❖Layer 3 device
❖Routing packets to destination based on destination IP
address
❖Running routing protocol
❖Split layer 2 broadcast domain
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
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
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
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)
B’ A’
MAC addr interface TTL
A 1 60 Switch table
(initially empty)
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
Routing
❑Each router needs running a routing protocol to
update the its routing table
❑Delay of packets
❖Queuing delay
❖Processing delay
❖Propagation delay
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
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
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
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
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
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.