COMP3234B
Computer and Communication
Networks
2nd semester 2023-2024
Introduction to Computer Networks
Prof. C Wu
Department of Computer Science
The University of Hong Kong
Internet [Learning outcome 1]
Protocol [Learning outcome 1]
Layering [Learning outcome 1]
Network edge - access networks [Learning outcome 1]
Network core - circuit vs. packet switching [Learning
outcomes 1, 2]
Key performance metrics [Learning outcomes 1, 3]
What is the Internet?
A global system of interconnected computer
networks linking billions of computing devices
throughout the world
hosts == end systems
running network applications
e.g. Web, email, WhatsApp, Zoom,...
communication links: the media by which
data travel
radio
satellite
Twisted(pair((
Fiber optic cable
copper(wire(
wireless routers and switches
links
wired
links switching devices that end systems are connected
to, for forwarding data from one host to another
What is the Internet? (cont’d)
A network of networks
interconnected ISP (Internet service
provider) networks
A communication infrastructure
to support network applications
to provide different types of services
reliable data delivery vs. unreliable data delivery
(best effort)
end systems and routers/switches run
protocols to send and receive data to/from
wireless
each other
links
wired
links
Network Protocol
Oxford Dictionary
a system of fixed rules and formal behaviour used at
official meetings, usually between governments
A human protocol
Hi#
Hi#
What ’
s#t he#+m
e?#
5pm#
Thanks
time me
e w e lco
Yo u’ r
Network Protocol (cont’d)
A network protocol defines
TCP connection
format, order of msgs sent and request
received between network entities TCP connection
response
actions taken upon msg
Get http://www.cs.hku.hk/~c3234/index.html
transmission/receipt
<file>
time
application
Internet is complex with many protocols
transport
implementing different services
network
Is there a way to organize the protocols of network?
link
physical
Layering
A computer network
basic function: transmit data from source to destination
An airline system (an analogy)
basic function: transfer passenger from one place to another
ticket (purchase) ticket (complain)
baggage (check) baggage (claim)
gates (load) gates (unload)
runway (takeoff) runway (land)
airplane routing airplane routing
airplane routing
departure intermediate air-traffic arrival
airport control centers airport
Layering (cont’d)
A computer network
basic function: transmit data from source to destination
An airline system (an analogy)
basic function: transfer passenger from one place to another
ticket (purchase) ticket (complain) ticket
baggage (check) baggage (claim) baggage
gates (load) gates (unload) gate
runway (takeoff) runway (land) takeoff/landing
airplane routing airplane routing airplane routing airplane routing airplane routing
departure intermediate air-traffic arrival
airport control centers airport
Layering (cont’d)
A layer is a collection of conceptual similar functions that provide services
to the layer above it and receives services from the layer below it.
Why layering?
modulation of complex systems
easier maintenance and update of systems
change of implementation of one layer’s service is transparent to the rest
ticket (purchase) ticket (complain) ticket
baggage (check) baggage (claim) baggage
gates (load) gates (unload) gate
runway (takeoff) runway (land) takeoff/landing
airplane routing airplane routing airplane routing airplane routing airplane routing
departure intermediate air-traffic arrival
airport control centers airport
Network protocol layers
Network protocols — and the hardware and software that
implement the protocols — are organized in layers
There are 5 layers in the Internet protocol stack
Each layer
performs certain actions within that layer
uses the service provided by the layer directly below it
application application
Internet
transport transport
Protocol
Stack network network
link link
physical physical
Sender Intermediate Routes Receiver
Internet protocol stack
Application
service: supporting network applications application
protocols: HTTP, SMTP, DNS
transport
Transport
service: process-to-process data transfer
network
protocols: TCP, UDP
link
Network
service: data routing from source host to destination host
physical
protocols: IP, routing protocols
Link
service: data transfer between neighboring network devices
protocol: Ethernet, WiFi
Physical
service: bit transfer on the transmission medium
Internet protocol stack (cont’d)
Different network devices implement different numbers of layers
Application layer Application layer
Transport layer Transport layer
Network layer Network layer
Link layer Link layer
Physical layer Physical layer
router des na on host
source host switch
Network%layer%%
Link%layer%% Link%layer%%
Physical%layer%% Physical%layer%%
ti
ti
Data encapsulation and decapsulation
Different layers have different data formats
At each layer, the data packet can be divided into two parts: header and data
(or payload)
Encapsulation: upon receiving a data packet from the upper layer, the whole
packet is encapsulated in data part of a packet in this layer, and header is
added over the data for control information at this layer
Decapsulation: for each data packet of this layer, remove header of this layer
and extract data part for passing to the upper layer
Source' Des*na*on'
Message M Applica.on)layer) Applica.on)layer) M
Segment Ht) M Transport)layer)) Transport)layer)) Ht) M
Datagram Hn) Ht) M Network)layer)) Network)layer)) Hn) Ht) M
Frame Hl) Hn) Ht) M Link)layer)) Link)layer)) Hl) Hn) Ht) M
Physical)layer)) Physical)layer))
Data encapsulation and decapsulation (cont’d)
Application layer M M Application layer
Ht M Ht M Transport layer
Transport layer
Hnt Ht M
H Hnt Ht M Network layer
Network layer
Hl H
Hnt Ht M Hl Hnt Ht M Link layer
Link layer
Physical layer Physical layer
router des na on host
source host switch
H
Hnt Ht M Network%layer%% Hnt Ht M
H
Hl Hnt Ht M Link%layer%%Hl Htn Ht M Hl Hnt Ht M Link%layer%% Hl Hnt Ht M
Physical%layer%% Physical%layer%%
ti
ti
Who define network protocols?
IETF (Internet Engineering Task Force): RFC (Request for Comments)
HTTP (for the Web), SMTP (for email), TCP, IP, etc.
Other organizations, e.g.,IEEE 802 LAN Standards Committee
Ethernet, WiFi
Components of the Internet
Network edge
end systems (running network applications)
Access network
wired, wireless communication links
Network core
inter-connected routers and switches
Network edge
End systems (hosts): categorized based on
functionality
Server: provides services/data
always on
permanent IP addresses
runs server process to wait to be connected
e.g., web server, email server
Client: requests/receives services/data from servers
may be intermittently connected (on and off)
may have dynamic IP addresses
runs client process to initiate the connection
e.g., web browser, email client
Network edge (cont’d)
Applications
server client
Client-server model
Client requests/receives services/data from
servers
e.g., Web browser/server, Email client/server
client
Peer-to-peer model peer
Participating hosts (peers) are both servers and
clients; run both server and client processes
e.g., BitTorrent, Blockchain systems
peer
Access network
Communication links connecting hosts
to edge routers/switches
Residential access networks
Institutional access networks (school,
company)
Mobile access networks (WiFi, 4G/5G)
Residential access network: digital subscriber line (DSL)
central office telephone
network
DSL splitter
modem DSLAM
ISP
voice, data transmitted
at different frequencies over DSL access
dedicated line to central office multiplexer
Use existing telephone line to central office DSLAM (DSL
access multiplexer)
data over DSL phone line goes to Internet; voice over DSL phone
line goes to telephone network
typically a few Mbps (megabits per second) upstream transmission
rate, and tens of Mbps downstream transmission rate
Residential access network: cable network
cable headend
cable splitter cable modem
modem CMTS termination system
data, TV transmitted at different
frequencies over shared cable ISP
distribution network
Use hybrid fiber coaxial (HFC) cables to connect to ISP router
typically tens of Mbps to a few Gbps downstream and tens to
hundreds of Mbps upstream transmission rates
homes share cable TV network to connect to cable headend
(using DSL, each home has dedicated access to central office)
Residential access network: fiber to the x
(Image from https://en.wikipedia.org/
wiki/Fiber_to_the_x)
Use optical fiber to provide all or part of the last-mile
telecommunication network for connecting user homes/premises to
the ISP’s router
x: Node, Curb, Building, Home, etc.
FTTH (Fiber To The Home): typically a few Gbps upstream and
downstream transmission rates
Home network
Institutional access network: Ethernet
institutional link to
ISP (Internet)
institutional router
Ethernet institutional mail,
switch web servers
Ethernet is most prevalent LAN (local area network) technology,
typically used in companies, universities, etc.: 1Gbps, 10Gbps,
25Gbps, 50Gbps, 100Gbps transmission rates
Wireless access network
Shared wireless access network connects end systems to
routers via base stations (aka access points)
wireless LANs
within building
WiFi: up to a few Gbps transmission rate
wide-area wireless access network
provided by telco (cellular) operator
range within tens of km
4G, 5G: up to a few tens of Gbps
Network core
Inter-connected routers
Many communication sessions are
sharing the same network
Two fundamental approaches to move
data through a shared network
circuit switching: dedicated circuit per
communication session
packet switching: data sent in discrete
“chunks” from one router to the next
Circuit switching
End-to-end resources reserved along a
path between the source/sender host
and the destination/receiver host for the
duration of the communication session
Resources: link bandwidth, buffer space
at switches/routers, etc.
Guaranteed performance: transmission
rate, end-to-end delay
example of circuit-switched network:
traditional telephone network
Communication session <=> call
Need to first set up the connection
between source and destination (circuit)
Circuit switching (cont’d)
Q: How do multiple concurrent communication
sessions share the network?
A: Bandwidth of each link divided into pieces
to allocate to different sessions
Frequency division multiplexing (FDM)
Time division multiplexing (TDM)
FDM
Frequency division multiplexing
Frequency spectrum of a link is divided into frequency bands
Frequency band allocated to different sessions using the link
Width of the frequency band == bandwidth ==Transmission rate
(bits/second)
e.g., FM radio stations use FDM to share frequencies among radio channels
(88MHz-108MHz)
e.g., Transmissions of 26 TV channels share the cable using FDM
(47MHz-300MHz )
4 sessions
TDM
Time division multiplexing
Time divided into frames of fixed duration; each frame
is divided into a fixed number of time slots
One time slot in each frame is dedicated to a session
(like CPU task scheduling in an operating system)
Numerical example
How long does it take to send a le of 4M bits from
host A to host B over a circuit-switched network?
all links are 1.536 Mbps
each link uses TDM with frame length = 1 second
and 4 time slots in each frame
frame
}
4 sessions
fi
Packet switching
Data stream (between a source and a
destination) divided into small chunks: packets
No reservation of resources along the path, no
need for call setup
Packets from different sender hosts use
resources along the path as needed
queue of packets
Packet switching
Store and forward
switches/routers must receive the complete
packet and then forward it
packet moves one hop at a time
No guarantee of bandwidth, delay
An example: Internet is largely based on
packet switching
queue of packets
Statistical multiplexing
The on-demand sharing of a communication link among packets
from different senders in a packet-switched network is called
statistical multiplexing
time-domain multiplexing, but without division of fixed-length time
slots and preallocation of time slots
sequence of A and B packets does not have fixed pattern
queue of packets
Packet switching vs circuit switching
Advantages
Simpler: no call setup needed
More efficient: allow more users to use network
Circuit switching with TDM
Each user alternates between
support 10 simultaneous users
“active” period (10% of the time): (1 Mbps/100 Kbps)
generates data at 100 kb/s
Packet switching
“inactive” period (90% of the time):
no data generation if there are 35 users, probability that there
are > 10 active users is
less than 0.0004
N
…..
users
Calculation of the probability >10 active users among 35 (packet switching)
at any given time
prob. that a given user is transmitting: p = 0.1
⇥
prob. that exactly n users are transmitting: 35 pn (1 35 n
p)
n
prob. that 11 or more users are transmitting:
35
⇤ ⇥
35 n
p (1 p)35 n
n=11
n
⇤10 ⇥
35 n
= 1 p (1 p)35 n
n=0
n
Packet switching vs circuit switching (cont’d)
Challenges
Congestion - if arrival rate to link exceeds
transmission rate of link for a period of time: Protocols needed to achieve
reliable data transfer and
packets will queue in router buffers, waiting to be congestion control
transmitted on link
packets can be dropped (lost) if buffer fills up
=>packet delay and loss Tasks for transport layer
No guaranteed on bandwidth, end-to-end delay, packet being transmitted (delay)
and whether packets are delivered at all
B
packets queueing (delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
Performance metrics in packet-switched networks
Delay
Loss
Throughput
Delay
Four sources of packet delays
Nodal processing delay Queueing delay
packet processing at a node: time waiting at output
decide output link, bit error link for transmission
check, etc.
Transmission delay Propagation delay
R=link bandwidth (bps) d=length of physical link (m)
L=packet length (bits) s=propagation speed in medium (m/s)
transmission delay propagation delay = d/s
=time to send bits into link
= L/R
transmission
A propagation
B
nodal
processing queueing
Delay (cont’d)
Nodal delay
dproc = processing delay
typically a few microsecs or less
dqueue = queuing delay
depends on congestion
dtrans = transmission delay
= L/R, significant for low-speed links
dprop = propagation delay
a few microsecs to hundreds of msecs
transmission
A propagation
B
nodal
processing queueing
Packet loss
Cause
transmission link has limited bandwidth
buffer has limited space
Packet loss
packets arriving to a full buffer (queue) are dropped (lost)
buffer
(waiting area) packet being transmitted
A
B
packet arriving to
full buffer is lost
Throughput
Rate (bits/second) at which data are transferred
end-to-end from sending host to receiving host
Instantaneous throughput: rate at given point in time
Average throughput: rate over longer period of time
Rs < Rc What is average end-end throughput?
Rs > Rc What is average end-end throughput?
server,
server withbits
sends linkpipe
capacity
that can carry linkpipe
capacity
that can carry
file of into
(fluid) F bitspipe Rs bits/sec
fluid at rate Rc bits/sec
fluid at rate
to send to client Rs bits/sec) Rc bits/sec)
bottleneck link
link on end-end path that constrains end-end throughput
Required reading:
Chapters 1.1, 1.2, 1.3, 1.4, 1.5 in Computer Networking:
A Top Down Approach (8th Edition)
Acknowledgement:
Some materials are extracted from the slides created by Prof. Jim F.
Kurose and Prof. Keith W. Ross for the textbook.