COMP 3234B
Computer and Communication Networks
2nd semester 2020-2021
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?
mobile network
home network
institutional network
regional ISP
global ISP
wireless links
wired links
A global system of interconnected computer networks linking billions of devices throughout the world
hosts == end systems, running
network applications
e.g. desktop PC, server, laptop, smartphone, tablets e.g. Web, email, ftp, WhatsApp, Skype,…
communication links: the media by which data travel
routers and switches
switching devices that end systems are connected to, for forwarding data from one host to another
Twisted(pair(( copper(wire(
FibeFriboeprt&iocpc)acbsl&e
coaxial’cable’
PC server
wireless laptop
router
smartphone
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 each other
mobile network
home network
institutional network
regional ISP
global ISP
wireless links
wired links
PC server
wireless laptop
router
smartphone
Network Protocol
Oxford Dictionary
a system of fixed rules and formal behaviour used at official meetings, usually between governments
A human protocol
Hi#
Hi#
time
What’s#the#+me?#
5pm#
Thanks
You’re welcome
Network Protocol (cont’d)
A network protocol defines
TCP connection request
TCP connection response
Get http://www.cs.hku.hk/~c3234/index.html
time
format, order of msgs sent and received between network entities
actions taken upon msg transmission/receipt
application
transport
network
link
physical
Internet is complex with many protocols implementing different services
Is there a way to organize the protocols of network?
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 (complain) baggage (claim)
gates (unload) runway (land) airplane routing
ticket (purchase) baggage (check) gates (load) runway (takeoff) airplane routing
airplane routing
departure intermediate air-traffic airport control centers
arrival 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)
baggage (check)
gates (load)
runway (takeoff)
airplane routing
ticket (complain)
baggage (claim)
gates (unload)
runway (land)
airplane routing
airplane routing
airplane routing
ticket baggage gate
takeoff/landing airplane routing
departure airport
intermediate air-traffic control centers
arrival 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)
baggage (check)
gates (load)
runway (takeoff)
airplane routing
ticket (complain)
baggage (claim)
gates (unload)
runway (land)
airplane routing
airplane routing
airplane routing
ticket baggage gate
takeoff/landing airplane routing
departure airport
intermediate air-traffic control centers
arrival 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
Internet Protocol Stack
application
transport
application
transport
network
network
link
link
physical
physical
Sender Intermediate Routes Receiver
Internet protocol stack
Application
service: supporting network applications protocols: HTTP, SMTP, DNS
Transport
service: process-to-process data transfer protocols: TCP, UDP
Network
service: data routing from source host to destination host protocols: IP, routing protocols
Link
service: data transfer between neighboring network devices protocol: Ethernet, WiFi
Physical
service: bit transfer on the transmission medium
application
transport
network
link
physical
Internet protocol stack (cont’d)
Different network devices implement different numbers of layers
Application layer Transport layer Network layer Link layer Physical layer
source host
Application layer Transport layer Network layer Link layer Physical layer
des+na+on host
switch
router
Network%layer%% Link%layer%% Physical%layer%%
Link%layer%% Physical%layer%%
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
Message Segment
Datagram Frame
M
Ht) M Hn) Ht) M
Hl) Hn) Ht) M
Source’
Applica.on)layer) Transport)layer))
Network)layer)) Link)layer)) Physical)layer))
Des*na*on’
Applica.on)layer) Transport)layer))
Network)layer)) Link)layer)) Physical)layer))
M
Ht) M Hn) Ht) M
Hl) Hn) Ht) M
Data encapsulation and decapsulation (cont’d)
Application layer Transport layer Network layer L i n k l a y e r Physical layer
source host
M
Ht M
HHM Hnt t
H H H M
M
Ht M
Application layer Transport layer Network layer Linklayer Physical layer
des+na+on host
H H M Hnt t
HHM
Hn tt
l
nt t
H Hn H M ltt
switch
router
Hn H M Ht t
H H H M l nt t
Network%layer%%
H H H M l nt t
Link%layer%% Physical%layer%%
Link%layer%% H H H M l nt t
Physical%layer%%
H H H M
l tn t
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
mobile network
home network
institutional network
regional ISP
global ISP
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 serv
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
mobile network
home network
ers
institutional network
regional ISP
global ISP
Network edge (cont’d)
Applications
Client-server model
Client requests/receives services/data from servers
e.g., Web browser/server, Email client/server
Peer-to-peer model
Participating hosts (peers) are both servers and clients; run both server and client processes
e.g., BitTorrent, Blockchain systems
server
client
peer
client
peer
Access network
mobile network
home network
institutional network
regional ISP
global ISP
Communication links connecting hosts to edge routers/switches
Residential access networks
Institutional access networks (school, company)
Wireless access networks
Residential access network: digital subscriber line (DSL)
central office
DSLAM
DSL access multiplexer
telephone network
DSL splitte modem
ISP
r
voice, data transmitted at different frequencies over dedicated line to central office
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
ISP
modem
data, TV transmitted at different frequencies over shared cable
distribution network
CMTS
cable modem termination system
Use hybrid fiber coaxial (HFC) cables to connect to ISP router
typically tens of Mbps upstream and downstream 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: premise, home, building, etc.
FTTH (Fiber To The Home): typically a few Gbps upstream and downstream transmission rates
Home network
wireless devices
often combined in single box
wireless access point (54 Mbps)
to/from headend or central office
cable or DSL modem
modem
router, firewall, NAT wired Ethernet
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 (gigabits per second), 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
3G, 4G, 5G: up to a few tens of Gbps
to Internet
to Internet
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
mobile network
home network
institutional network
regional ISP
global ISP
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: 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 file 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
}
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
mobile network
home network
regional ISP
institutional
B
network
global ISP
A
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
A
mobile network
home network
regional ISP
institutional
B
network
global ISP
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
Each user alternates between
“active” period (10% of the time): generates data at 100 kb/s
“inactive” period (90% of the time): no data generation
N
users
Circuit switching with TDM
support 10 simultaneous users (1 Mbps/100 Kbps)
Packet switching
if there are 35 users, probability that there are > 10 active users is
less than 0.0004
…..
Calculation of the probability >10 active users among 35 (packet switching)
at any given time
prob. that a given user is transmitting:
prob. that exactly n users are transmitting:
n
prob. that 11 or more users are transmitting:
⇤ ⇥
35
pn(1 p)35 n
35
n=11
⇤ ⇥
= 1
10 35
pn(1 p)35 n
n
n
n=0
p = 0.1
35⇥ pn (1 p)35 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:
packets will queue in router buffers, waiting to be transmitted on link
packets can be dropped (lost) if buffer fills up
=>packet delay and loss
No guaranteed on bandwidth, end-to-end delay, and whether packets are delivered at all
A B
Tasks for transport layer
packet being transmitted (delay)
packets queueing (delay)
free (available) buffers: arriving packets dropped (loss) if no free buffers
Protocols needed to achieve reliable data transfer and congestion control
Performance metrics in packet-switched networks
Delay
Loss Throughput
Delay
Four sources of packet delays
Nodal processing delay
packet processing at a node: decide output link, bit error check, etc.
Transmission delay
R=link bandwidth (bps) L=packet length (bits) transmission delay
=time to send bits into link = L/R
transmission
nodal processing
Queueing delay
time waiting at output link for transmission
Propagation delay
d=length of physical link (m) s=propagation speed in medium (m/s) propagation delay = d/s
propagation
queueing
A B
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
A B
transmission
nodal processing
propagation
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)
A
B
buffer (waiting area)
packet being transmitted
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, with
link capacity
pipe that can carry
R bits/sec
s fluid at rate
Rs bits/sec)
link capacity
pipe that can carry
R bits/sec
c fluid at rate
Rc bits/sec)
server sends bits
file of F bits
(fluid) into pipe
to send to client
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 (7th Edition)
Acknowledgement:
Some materials are extracted from the slides created by Prof. Jim F. Kurose and Prof. Keith W. Ross for the textbook.