Download as pdf or txt
Download as pdf or txt
You are on page 1of 126

CS232

Computer Networks

Topics for today:


Summer 2024 • Introductions
Sayeed Ghani • Course Syllabus
Lectures 1-4 • Course Overview
• What is the Internet?
June 23-26 • “Nuts and Bolts” view
• Service view
Topics for Today
➢ Introductions

▪ Course Syllabus

▪ Course overview

▪ What is the Internet?


Brief Profile
▪ Sayeed Ghani, Teaching Associate Professor
University of North Carolina at Chapel Hill, USA
• sghani@cs.unc.edu, m.ghani@upm.edu.sa
▪ B.S. MIT (1984); M.S. (1986) and Ph.D. (1990) Columbia University in EE.
▪ Fields of interest: Applications of AI and Machine Learning in
Networking/Health, Deep Learning, Computer Networks and IOT.
▪ 20 years of experience at the Institute of Business Administration (IBA),
in Pakistan. Chair of CS Dept & Head of IT (7 years); Associate Dean of
the Faculty of Computer Science (12 years).
▪ 12 years of industry experience in Pakistan & the US telecoms industry.
▪ Active YouTube channel containing recent lectures.
▪ Supervised PhD students at the Telecommunications Research Lab
▪ https://cs.unc.edu/person/sayeed-ghani/
▪ https://oric.iba.edu.pk/profile.php?id=sghani
Topics for Today
▪ Introductions

➢ Course Syllabus

▪ Course overview

▪ What is the Internet?


Course Syllabus: Computer Networks
▪ CS232: Computer Networks
▪ Credit Hours: 4
▪ Prerequisites:
• CS112 – Introduction to Object Oriented Programming
▪ Lectures:
• Six, 1-hour lectures per week
▪ Labs:
• Two, 3-hour labs per week
Resources

▪ Primary Text: [KR]

▪ Link to [KR] website:


• https://gaia.cs.umass.edu/kur Computer
ose_ross/index.php Networking: A Top
Down Approach
7th edition
Jim Kurose, Keith Ross
Pearson/Addison Wesley
April 2016
Resources

▪ Online Lectures / Slides / Sample Questions:


Topics for Today
▪ Introductions

▪ Course Syllabus

➢ Course overview

▪ What is the Internet?


Course Overview
Theory Topics Week [KR] Chapter

1. Introduction: Internet, protocols, packet/circuit switching,


performance, protocol layers, history 1 1

2. Application layer: HTTP, SMTP, DNS, socket programming 2 2


3. Transport Layer: Multiplexing/ Demultiplexing, UTP and
TCP 3 3

4. Network layer: Routing protocols, IP, SNMP 4 4&5

5. Data Link layer and LANs: Error detection/correction, ARP;


MPLS 5 6

6. Wireless and Mobile Networks: 802.11, 4G/5G, Mobile IP 6 7

7. Network Security: cryptography, TLS, IPsec, firewalls 7 8

1-9
Week 1/Ch. 1: roadmap
1.1 what is the Internet?
1.2 network edge
▪ end systems, access networks, links
1.3 network core
▪ packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Introduction 1-10
Chapter 1: Introduction
our goal: overview:
▪ get “feel” and ▪ what’s the Internet?
terminology ▪ what’s a protocol?
▪ network edge; hosts, access net,
▪ more depth, detail physical media
later in course ▪ network core: packet/circuit
▪ approach: switching, Internet structure
• use Internet as ▪ performance: loss, delay,
throughput
example
▪ security
▪ protocol layers, service models
▪ history

Introduction 1-11
Week 1/Ch. 1: roadmap
1.1 what is the Internet?
1.2 network edge
▪ end systems, access networks, links
1.3 network core
▪ packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Introduction 1-12
What’s the Internet: “nuts and bolts” view
PC
▪ billions of connected mobile network
server computing devices:
wireless
laptop
• hosts = end systems global ISP

smartphone • running network apps


home
▪ communication links network
regional ISP
wireless • fiber, copper, radio,
links satellite
wired
links • transmission rate:
bandwidth

▪ packet switches: forward


router
packets (chunks of data) institutional
• routers and switches network

Introduction 1-13
“Fun” Internet-connected devices

Web-enabled toaster +
weather forecaster

IP picture frame
http://www.ceiva.com/

Tweet-a-watt:
Slingbox: watch, monitor energy use
control cable TV remotely

sensorized,
bed
mattress
Internet
refrigerator Internet phones

Introduction 1-14
What’s the Internet: “nuts and bolts” view
mobile network
▪ Internet: “network of networks”
• Interconnected ISPs
global ISP
▪ protocols control sending, receiving
of messages
• e.g., TCP, IP, HTTP, Skype, 802.11 home
network
▪ Internet standards regional ISP
• RFC: Request for comments
• IETF: Internet Engineering Task Force

institutional
network

Introduction 1-15
What’s the Internet: a service view
mobile network
▪ infrastructure that provides
services to applications: global ISP

• Web, VoIP, email, games, e-


commerce, social nets, … home
▪ provides programming network
regional ISP
interface to apps
• hooks that allow sending
and receiving app programs
to “connect” to Internet
• provides service options,
analogous to postal service
institutional
network

Introduction 1-16
CS232
Computer Networks

Summer 2024 Topics for today:


Sayeed Ghani
• What is the Internet?
• What is a protocol
Lecture 5, • Bandwidth
Thursday, June 27 • Circuit Switching
Topics for Today
▪ Introductions

▪ Course Syllabus

▪ Course overview

▪ What is the Internet?


What’s a protocol?
human protocols: network protocols:
▪ “what’s the time?” ▪ machines rather than
▪ “I have a question” humans
▪ introductions ▪ all communication activity
in Internet governed by
protocols
… specific messages sent
… specific actions taken
when messages protocols define format, order of
received, or other
events messages sent and received
among network entities, and
actions taken on message
transmission, receipt
Introduction 1-3
What’s a protocol?
a human protocol and a computer network protocol:

Hi TCP connection
request
Hi TCP connection
response
Got the
time? Get http://www.awl.com/kurose-ross
2:00
<file>
time

Q: other human protocols?


Introduction 1-4
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
▪ end systems, access networks, links
1.3 network core
▪ packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Introduction 1-5
A closer look at network structure:
▪ network edge: mobile network

• hosts: clients and servers


global ISP
• servers often in data
centers
home
▪ access networks, physical network
regional ISP
media: wired, wireless
communication links

▪ network core:
• interconnected routers
• network of networks institutional
network

Introduction 1-6
Access networks and physical media

Q: How to connect end


systems to edge router?
▪ residential access nets
▪ institutional access
networks (school, company)
▪ mobile access networks
keep in mind:
▪ bandwidth (bits per second)
of access network?
▪ shared or dedicated?

Introduction 1-7
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


• data over DSL phone line goes to Internet
• voice over DSL phone line goes to telephone net
▪ < 2.5 Mbps upstream transmission rate (typically < 1 Mbps)
▪ < 24 Mbps downstream transmission rate (typically < 10 Mbps)
Introduction 1-8
Bandwidth analogy
▪ Bandwidth R can be thought of as the thickness of a
pipe transmitting water

server,
PC sendswith
bits linkpipe
capacity
that can carry
file of F bits
(fluid) into pipe Rs bits/sec
fluid at rate
to send to client R bits/sec)

1000 bps = 1 kbps


1000 kbps = 1 Mbps
1000 Mbps = 1 Gbps
Introduction 1-9
The Electromagnetic Spectrum

https://scied.ucar.edu/learning-zone/earth-system/electromagnetic-spectrum
Introduction 1-10
Access network: cable network
cable headend

cable splitter
modem

C
O
V V V V V V N
I I I I I I D D T
D D D D D D A A R
E E E E E E T T O
O O O O O O A A L

1 2 3 4 5 6 7 8 9

Channels

frequency division multiplexing: different channels transmitted


in different frequency bands
Introduction 1-11
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

▪ HFC: hybrid fiber coax


• asymmetric: up to 30Mbps downstream transmission rate, 2
Mbps upstream transmission rate
▪ network of cable, fiber attaches homes to ISP router
• homes share access network to cable headend
• unlike DSL, which has dedicated access to central office
Introduction 1-12
Access network: home network
wireless
devices

to/from headend or
central office
often combined
in single box

cable or DSL modem

wireless access router, firewall, NAT


point (54 Mbps)
wired Ethernet (1 Gbps)

Introduction 1-13
Enterprise access networks (Ethernet)

institutional link to
ISP (Internet)
institutional router

Ethernet institutional mail,


switch web servers

▪ typically used in companies, universities, etc.


▪ 10 Mbps, 100Mbps, 1Gbps, 10Gbps transmission rates
▪ today, end systems typically connect into Ethernet switch

Introduction 1-14
Wireless access networks
▪ shared wireless access network connects end system to router
• via base station aka “access point”

wireless LANs: wide-area wireless access


▪ within building (100 ft.) ▪ provided by telco (cellular)
▪ 802.11b/g/n (WiFi): 11, 54, 450 operator, 10’s km
Mbps transmission rate ▪ between 1 and 10 Mbps
▪ 3G, 4G: LTE

to Internet

to Internet

Introduction 1-15
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
▪ end systems, access networks, links
1.3 network core
▪ packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Introduction 1-16
Circuit switching
end-end resources allocated
to, reserved for “call”
between source & dest:
▪ in diagram, each link has four
circuits.
• call gets 2nd circuit in top
link and 1st circuit in right
link.
▪ dedicated resources: no sharing
• circuit-like (guaranteed)
performance
▪ circuit segment idle if not used
by call (no sharing)
▪ commonly used in traditional
telephone networks
Introduction 1-17
Circuit switching

What is the maximum number of connections that can be ongoing in the


network at any one time?

https://gaia.cs.umass.edu/kurose_ross/interactive/circuit_switching.php Introduction 1-18


Circuit switching

What is the maximum number of connections that can be ongoing in the


network at any one time?

15+16+15+10=56

https://gaia.cs.umass.edu/kurose_ross/interactive/circuit_switching.php Introduction 1-19


Circuit switching

Suppose that every connection requires 2 consecutive hops, and calls are
connected clockwise. For example, a connection can go from A to C, from B to D,
from C to A, and from D to B. With these constraints, what is the is the maximum
number of connections that can be ongoing in the network at any one time?

https://gaia.cs.umass.edu/kurose_ross/interactive/circuit_switching.php Introduction 1-20


Circuit switching

Suppose that every connection requires 2 consecutive hops, and calls are
connected clockwise. For example, a connection can go from A to C, from B to D,
from C to A, and from D to B. With these constraints, what is the is the maximum
number of connections that can be ongoing in the network at any one time?
18+2+11=31

https://gaia.cs.umass.edu/kurose_ross/interactive/circuit_switching.php Introduction 1-21


Circuit switching: FDM versus TDM
Example:
FDM
4 users

frequency

time
TDM

frequency

time
Introduction 1-22
CS232
Computer Networks

Summer 2024 Topics for today:


Sayeed Ghani
• What is the Internet?
• Packet Switching
Lecture 6, • Propagation Delays
Thursday, June 27 • Transmission Delays
Interactive Exercises & Animations

• Interactive exercises:
http://gaia.cs.umass.edu/kurose_ross/interactive/

* Animations:
https://media.pearsoncmg.com/ph/esm/ecs_kurose_compn
etwork_8/cw/#interactiveanimations

Introduction 1-2
The network core: Packet Switching
▪ mesh of interconnected
routers
▪ packet-switching: hosts
break application-layer
messages into packets
• forward packets from one
router to the next, across
links on path from source
to destination
• each packet transmitted at
full link capacity

Introduction 1-3
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
▪ end systems, access networks, links
1.3 network core
▪ packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

* interactive exercises: http://gaia.cs.umass.edu/kurose_ross/interactive/


* Animations: Introduction 1-4
https://media.pearsoncmg.com/ph/esm/ecs_kurose_compnetwork_8/cw/#interactivea
The network core: Packet Switching

https://www.javatpoint.com/computer-network-switching-techniques
Introduction 1-5
Four sources of packet delay
transmission
A propagation

B
nodal
processing queueing

dnodal = dprop + dtrans + dqueue + dproc

1. dprop: propagation delay: 2. dtrans: transmission delay:


▪ d: length of physical link ▪ L: packet length (bits)
▪ s: propagation speed (~2x108 m/sec) ▪ R: link bandwidth (bps)
▪ dprop = d/s dtrans and dprop ▪ dtrans = L/R
very different

Introduction 1-6
Four sources of packet delay
transmission
A propagation

B
nodal
processing queueing

dnodal = dprop + dtrans + dqueue + dproc

3. dqueue: queueing delay 4. dproc: nodal processing


▪ time waiting at output link ▪ check bit errors
for transmission ▪ determine output link
▪ depends on congestion ▪ typically < msec
level of router
Introduction 1-7
Propagation Delay : d(prop)
Car Analogy
• Car travels distance d=200 kilometers away at a speed s=100 km/hour.
• How long does it take to reach destination?

Speed: 100Km/Hour

Time taken?

Introduction 1-8
Poll Everywhere
https://pollev.com/sayeedghani483

9
Introduction 1-10
Introduction 1-11
Propagation Delay : d(prop)

Speed: 100Km/Hour

Time taken (or propagation delay)?

• Car travels distance d=200 kilometers away at a speed s=100 km/hour.


• How long does it take to reach destination?

Propagation delay
d(prop) = distance/speed = d/s
= 200km / 100km/hr
= 2 hours

Introduction 1-12
Propagation delay example:
▪ Propagation delay example:
• How long would it take a packet to go around the
world on a fiber optic cable?
• Circumference of Earth = 40,000km
• Assume propagation speed is at speed of light
about 300,000 km/sec

• Propagation delay d(prop) = ?

Introduction 1-13
Propagation delay example:
▪ Propagation delay example:
• How long would it take a packet to go around the
world on a fiber optic cable?
• Circumference of Earth = 40,000km
• Assume propagation speed is at speed of light
about 300,000 km/sec

• Propagation delay d(prop) = distance / speed


= 40,000km / 300,000 km/sec
= 0.13 sec

Light can go around the world 7 times in a second!

Introduction 1-14
“Real” Internet delays, routes
E.g. mit.edu = domain name
95.100.239.225 is the IP address

Use following link to determine location of an IP address:


https://www.iplocation.net/ip-lookup
Introduction 1-16
“Real” Internet delays and routes
▪ what do “real” Internet delay & loss look like?
▪ Traceroute (or tracert) program: provides
delay measurement from source to router along
end-end Internet path towards destination. For
all i:
• sends three packets that will reach router i on path
towards destination
• router i will return packets to sender
• sender times interval between transmission and reply.

3 probes 3 probes

3 probes

Introduction 1-17
“Real” Internet delays, routes
mit.edu = domain name

Use following link to determine location of an IP address:


https://www.iplocation.net/ip-lookup
“Real” Internet delays, routes
▪ How far is a 200ms router?
▪ d(prop) = distance / speed
▪ Distance = ?

Introduction 1-19
“Real” Internet delays, routes
▪ How far is a 200ms router?
▪ d(prop) = distance / speed
▪ Distance = d(prop) * speed
= 200ms * 300,000 Km/sec
= 0.2 sec * 300,000 km/sec
= 60,000 km round trip

▪ Is it really 60,000km away?

Introduction 1-20
“Real” Internet delays, routes
▪ How far is a 200ms router?
▪ d(prop) = distance / speed
▪ Distance = d(prop) * speed
= 200ms * 300,000 Km/sec
= 0.2 sec * 300,000 km/sec
= 60,000 km round trip

▪ Is it really 60,000km away?

▪ No, it includes some other delays as well

Introduction 1-21
Animation
https://media.pearsoncmg.com/ph/esm/ecs_kurose_compnetwork_8/cw/content/interactiveanimatio
ns/transmission-vs-propogation-delay/transmission-propagation-delay-ch1/index.html

Propagation delay d(prop)


=?

Introduction 1-22
2. Transmission Delay: d(trans)
1000 bits
R = 10 bps

L = Length of packet (in bits)


R = bit Rate (or bandwidth) of link
Transmission delay = d(trans)
=L/R
Example: L = 1000 bits, R=10 bit/sec
d(trans) = 1000 bits / 10 bits/sec
= 100 sec
Introduction 1-23
2. Transmission Delay: d(trans)

L bits
per packet

3 2 1
source destination
R bps R bps

▪ takes L/R seconds to transmit one-hop numerical example:


(push out) L-bit packet into
link at R bps ▪ L = 7.5 Mbits
▪ store and forward: entire ▪ R = 1.5 Mbps
packet must arrive at router ▪ one-hop transmission
before it can be transmitted delay = 5 sec
on next link
▪ end-end delay = 2L/R (assuming
zero propagation delay) more on delay shortly …
Introduction 1-24
Animation
https://media.pearsoncmg.com/ph/esm/ecs_kurose_compnetwork_8/cw/content/interactiveanimatio
ns/transmission-vs-propogation-delay/transmission-propagation-delay-ch1/index.html

Propagation delay d(prop)


= d/s = 1000km / 2.8x10^5 km/sec
= d/s = 1000km / 280,000 km/sec
= 3.5ms

Introduction 1-25
Animation
https://media.pearsoncmg.com/ph/esm/ecs_kurose_compnetwork_8/cw/content/interactiveanimatio
ns/transmission-vs-propogation-delay/transmission-propagation-delay-ch1/index.html

Transmission delay
d(trans) = Length of packet / bit Rate = L/R
= 100bytes x 8 bits/byte / 1Mb/s
= 800/1000 b/ms
= 0.8msec
Introduction 1-26
CS232
Computer Networks

Topics:
Summer 2024
• What is the Internet (Cont.)?
Sayeed Ghani • Protocol Layers
Lecture 9 • Security

Tuesday, July 2nd


Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
▪ end systems, access networks, links
1.3 network core
▪ packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Introduction 1-2
Protocol “layers”
Networks are complex,
with many “pieces”:
▪ hosts Question:
▪ routers is there any hope of
▪ links of various organizing structure of
media network?
▪ applications
▪ protocols …. or at least our
▪ hardware, discussion of networks?
software

Introduction 1-3
Organization of air travel
ticket (purchase) ticket (complain)

baggage (check) baggage (claim)

gates (load) gates (unload)

runway takeoff runway landing

airplane routing airplane routing


airplane routing

▪ a series of steps

Introduction 1-4
Layering of airline functionality

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

layers: each layer implements a service


▪ via its own internal-layer actions
▪ relying on services provided by layer below

Introduction 1-5
Internet protocol stack
▪ application: supporting network
applications
• FTP, SMTP, HTTP application
▪ transport: process-process data
transfer transport
• TCP, UDP
network
▪ network: routing of datagrams from
source to destination
link
• IP, routing protocols
▪ link: data transfer between physical
neighboring network elements
• Ethernet, 802.111 (WiFi), PPP
▪ physical: bits “on the wire”
Introduction 1-6
Another view of the layers

1-7
Encapsulation / De-encapsulation

https://www.youtube.com/watch?v=FJIFfkpUO7o

https://www.youtube.com/watch?v=AH-09WaUK-4

Introduction 1-8
PDU=Protocol Data Unit

message M
source
application
Encapsulation
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
link
physical

switch
Datagram = Packet

destination Hn Ht M network
M application Hl Hn Ht M link Hn Ht M
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
physical
https://www.youtube.com/watch?v=FJIFfkpUO7o
Introduction 1-9
https://www.youtube.com/watch?v=AH-09WaUK-4
PDU=Protocol Data Unit

message M
source
application
Encapsulation
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
Hl Hn Ht M link
physical
Note: The link layer Hl Hn Ht M switch
address (MAC address) will
change on each link

destination Hn Ht M network
M application Hl Hn Ht M link Hn Ht M
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
physical
https://www.youtube.com/watch?v=FJIFfkpUO7o
Introduction 1-10
https://www.youtube.com/watch?v=AH-09WaUK-4
Encapsulation Analogy
Sending a letter

Introduction 1-11
Encapsulation Analogy
Transporting a car from Madinah to Riyadh

Madinah Riyadh

Car Car

Car on Car on
a truck a truck

Car on Car on
a truck on a truck on
a train a train
Introduction 1-12
Why layering?
dealing with complex systems:
▪ explicit structure allows identification,
relationship of complex system’s pieces
• layered reference model for discussion
▪ modularization eases maintenance, updating of
system
• change of implementation of layer’s service
transparent to rest of system
• e.g., change in gate procedure doesn’t affect rest of
system
▪ layering considered harmful?

Introduction 1-13
ISO/OSI reference model
▪ presentation: allow applications
to interpret meaning of data, application
e.g., encryption, compression,
machine-specific conventions presentation
▪ session: synchronization, session
checkpointing, recovery of data transport
exchange
network
▪ Internet stack “missing” these
layers! link
• these services, if needed, must be physical
implemented in application
• needed?

Introduction 1-14
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
▪ end systems, access networks, links
1.3 network core
▪ packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Introduction 1-15
Network security
▪ field of network security:
• how bad guys can attack computer networks
• how we can defend networks against attacks
• how to design architectures that are immune to attacks
▪ Internet not originally designed with (much)
security in mind
• original vision: “a group of mutually trusting users
attached to a transparent network” ☺
• Internet protocol designers playing “catch-up”
• security considerations in all layers!

Introduction 1-16
Bad guys: put malware into hosts via Internet
▪ malware can get in host from:
• virus: self-replicating infection by receiving/executing
object (e.g., e-mail attachment)
• worm: self-replicating infection by passively receiving
object that gets itself executed
▪ spyware malware can record keystrokes, web
sites visited, upload info to collection site
▪ infected host can be enrolled in botnet, used for
spam. DDoS attacks

Introduction 1-17
Bad guys: attack server, network infrastructure
Denial of Service (DoS): attackers make resources
(server, bandwidth) unavailable to legitimate traffic
by overwhelming resource with bogus traffic

1. select target
2. break into hosts around
the network (see botnet)
3. send packets to target from
compromised hosts
target

Introduction 1-18
Bad guys can sniff packets
packet “sniffing”:
▪ broadcast media (shared Ethernet, wireless)
▪ promiscuous network interface reads/records all packets
(e.g., including passwords!) passing by

A C

src:B dest:A payload


B

▪ wireshark software used for end-of-chapter labs is a


(free) packet-sniffer
Introduction 1-19
Bad guys can use fake addresses
IP spoofing: send packet with false source address
A C

src:B dest:A payload

… lots more on security (throughout, Chapter 8)

Introduction 1-20
CS232
Computer Networks

Topics:
Summer 2024
• Application Layer (Ch. 2)
Sayeed Ghani • Overview (Cont.)
Lecture 11 • Protocol
• Transport Service Requirements
Thursday, July 4th
An application-layer protocol defines:
▪ types of messages exchanged, open protocols:
• e.g., request, response ▪ defined in RFCs, everyone
▪ message syntax: has access to protocol
• what fields in messages & definition
how fields are delineated ▪ allows for interoperability
▪ message semantics ▪ e.g., HTTP, SMTP
• meaning of information in proprietary protocols:
fields
▪ e.g., Skype, Zoom
▪ rules for when and how
processes send & respond to
messages
Application Layer: 2-2
What transport service does an app need?
data reliability throughput
▪ some apps (e.g., file transfer, ▪ some apps (e.g., multimedia)
web transactions) require require minimum amount of
100% reliable data transfer throughput to be “effective”
▪ other apps (e.g., audio) can ▪ other apps (“elastic apps”)
tolerate some loss make use of whatever
throughput they get
timing
▪ some apps (e.g., Internet security
telephony, interactive games) ▪ encryption, data integrity,
require low delay to be “effective” …
Application Layer: 2-3
Transport service requirements: common apps
application data loss throughput time sensitive?

file transfer/download no loss elastic no


e-mail no loss elastic no
Web documents no loss elastic no
real-time audio/video loss-tolerant audio: 5Kbps-1Mbps yes, 10’s msec
video:10Kbps-5Mbps
streaming audio/video loss-tolerant same as above yes, few secs
interactive games loss-tolerant Kbps+ yes, 10’s msec
text messaging no loss elastic yes and no
Application Layer: 2-4
Transport service requirements: common apps
application data loss throughput time sensitive?

file transfer/download no loss elastic no


e-mail no loss elastic no
Web documents no loss elastic no
real-time audio/video loss-tolerant audio: 5Kbps-1Mbps yes, 10’s msec
video:10Kbps-5Mbps
streaming audio/video loss-tolerant same as above yes, few secs
interactive games loss-tolerant Kbps+ yes, 10’s msec
text messaging no loss elastic yes and no
Application Layer: 2-5
Transport service requirements: common apps
application data loss throughput time sensitive?

file transfer/download no loss elastic no


e-mail no loss elastic no
Web documents no loss elastic no
real-time audio/video loss-tolerant audio: 5Kbps-1Mbps yes, 10’s msec
video:10Kbps-5Mbps
streaming audio/video loss-tolerant same as above yes, few secs
interactive games loss-tolerant Kbps+ yes, 10’s msec
text messaging no loss elastic yes and no
Application Layer: 2-6
Transport service requirements: common apps
application data loss throughput time sensitive?

file transfer/download no loss elastic no


e-mail no loss elastic no
Web documents no loss elastic no
real-time audio/video loss-tolerant audio: 5Kbps-1Mbps yes, 10’s msec
video:10Kbps-5Mbps
streaming audio/video loss-tolerant same as above yes, few secs
interactive games loss-tolerant Kbps+ yes, 10’s msec
text messaging no loss elastic yes and no
Application Layer: 2-7
CS232
Computer Networks

Topics:
Summer 2024
• Application Layer (Ch. 2)
Sayeed Ghani • Overview (Cont.)
Lecture 12 • Traffic Calculations
• TCP vs UDP
Thursday, July 4th • TLS
Bits vs Bytes

• 1 Byte = 8 bits

• File sizes are normally in Bytes


e.g. 100 byte file = 800 bits

• Communication speeds are in bits/sec

1-2
Real-time Application Throughput requirements

Real Time applications:


1. Text messaging:
sending 1 message of size 1000 bytes every 10 seconds,
Throughput required = ?

2. Video conferencing:
sending 1 message (image) of size 1000 bytes every msec
Throughput required = ?

1-3
Real-time Application Throughput requirements

Real Time applications:


1. Text messaging:
sending 1 message of size 1000 bytes every 10 seconds,
Throughput required = 1000x8/10 = 800 bits/sec

2. Video conferencing:
sending 1 message (image) of size 1000 bytes every msec
Throughput required = 1000x8 / 0.001 sec = 8 Mbps

1-4
Non-real time Applications
Non-real time application:
1. File download (no timing issue)
downloading MP3 file of size 100 Mbytes
Assume throughput is 1 Mbps, how long will it take?
Time = ?

2. File download (with time constraint)


downloading MP3 file of size 100 Mbytes
Assume we want this in 20 seconds, how much throughput is required?
throughput required = ?

1-5
Non-real time Applications
Non-real time application:
1. File download (no timing issue)
downloading MP3 file of size 100 Mbytes
Assume throughput is 1 Mbps, how long will it take?
Time = Size / throughput = 100x8 Mbits / 1 Mb/sec = 800 seconds

2. File download (with time constraint)


downloading MP3 file of size 100 Mbytes
Assume we want this in 20 seconds, how much throughput is required?
throughput required = 100x8 Mbits / 20 sec = 40 Mb/s

1-6
Throughput vs Delay
L=5000 bits s=200,000 km/s

R = 1 Mbps
d=2000 km
A B

d(prop) = d/s = 2000km/200,000 km/s = 0.01 sec = 10 msec


d(trans) = L/R = 5000 bits / 1000,000 b/s = 0.005 sec = 5 msec

Total Delay for a packet to get from A to B = ?

Throughput = ?

1-7
Throughput vs Delay
L=5000 bits s=200,000 km/s

R = 1 Mbps
d=2000 km
A B

d(prop) = d/s = 2000km/200,000 km/s = 0.01 sec = 10 msec


d(trans) = L/R = 5000 bits / 1000,000 b/s = 0.005 sec = 5 msec

Total Delay for a single packet to get from A to B


= d(prop) + d(trans) + d(queue) + d(proc)
= 10mse + 5 msec + 0 +0
= 15msec

Throughput from A to B = ?

1-8
Throughput vs Delay
L=5000 bits s=200,000 km/s

R = 1 Mbps
d=2000 km
A B

d(prop) = d/s = 2000km/200,000 km/s = 0.01 sec = 10 msec


d(trans) = L/R = 5000 bits / 1000,000 b/s = 0.005 sec = 5 msec

Total Delay for a single packet to get from A to B


= d(prop) + d(trans) + d(queue) + d(proc)
= 10mse + 5 msec + 0 +0
= 15msec

Throughput from A to B = 1 Mbps

1-9
Throughput vs Delay
Rs = 1 Mbps, R = 100 Mbps, Rc = 0.1 Mbps A
i.e. throughput from A to B = 0.1 Mbps

Now assume Total delay from A to B = 3 msec Rs

sending 1 message (image) of size 1000 bits every msec R


Throughput required = 1000 bits / 0.001 sec = 1 Mbps
Rc

1-10
Throughput vs Delay

Application Layer: 2-11


Internet transport protocols services
TCP service: UDP service:
▪ reliable transport between sending ▪ unreliable data transfer
and receiving process between sending and receiving
▪ flow control: sender won’t process
overwhelm receiver ▪ does not provide: reliability,
▪ congestion control: throttle sender flow control, congestion
when network overloaded control, timing, throughput
guarantee, security, or
▪ connection-oriented: setup required connection setup.
between client and server processes
▪ does not provide: timing, minimum Q: why bother? Why
throughput guarantee, security is there a UDP?
Application Layer: 2-12
Internet applications, and transport protocols
application
application layer protocol transport protocol

file transfer/download FTP [RFC 959] TCP


e-mail SMTP [RFC 5321] TCP
Web documents HTTP [RFC 7230, 9110] TCP
Internet telephony SIP [RFC 3261], RTP [RFC TCP or UDP
3550], or proprietary
streaming audio/video HTTP [RFC 7230], DASH TCP
interactive games WOW, FPS (proprietary) UDP or TCP

Application Layer: 2-13


Securing TCP
Vanilla TCP & UDP sockets: TLS implemented in
▪ no encryption application layer
▪ cleartext passwords sent into socket ▪ apps use TLS libraries, that
traverse Internet in cleartext (!) use TCP in turn
Transport Layer Security (TLS) ▪ cleartext sent into “socket”
▪ provides encrypted TCP connections traverse Internet encrypted
▪ data integrity ▪ more: Chapter 8
▪ end-point authentication

Application Layer: 2-14


CS232
Computer Networks

Topics:
Summer 2024
• Application Layer (Ch. 2)
Sayeed Ghani • Web & HTTP
Lecture 13 • Persistent vs Non-persistent HTTP

Sunday, July 7th


Link Utilization

A1
Utilization
= fraction of used bandwidth
= throughput / Link bandwidth

Bottleneck
Throughput (A1-B1) 400 Mbps / 4
= Min (60, 100, 90) = 60 Mbps = 100 Mbps

Utilization of Rs = 60/60 = 1.0 = 100%

Utilization of R = 60 * 4 / 400 = 240/400


= 0.6 = 60%
Utilization of Rc = 60/90 = 0.67 = 67%
B1

Application Layer: 2-2


Application layer: overview
▪ P2P applications
▪ Principles of network ▪ video streaming and content
applications distribution networks
▪ Web and HTTP ▪ socket programming with
▪ E-mail, SMTP, IMAP UDP and TCP
▪ The Domain Name System
DNS

Application Layer: 2-3


Web and HTTP
First, a quick review…
▪ web page consists of objects, each of which can be stored on
different Web servers
▪ object can be HTML file, JPEG image, Java applet, audio file,…
▪ web page consists of base HTML-file which includes several
referenced objects, each addressable by a URL, e.g.,
www.someschool.edu/someDept/pic.gif

host name path name

Application Layer: 2-4


UPM website
Many objects

HTML file

Lots of
images

Application Layer: 2-5


Introduction

Internet protocol stack

▪ application: supporting network


applications application
• FTP, SMTP, HTTP
▪ transport: process-process data transfer transport
• TCP, UDP
▪ network: routing of datagrams from network
source to destination
• IP, routing protocols
link
▪ link: data transfer between neighboring
network elements
• Ethernet, 802.111 (WiFi), PPP physical
▪ physical: bits “on the wire”

1-6
An application-layer protocol defines:
▪ types of messages exchanged, open protocols:
• e.g., request, response ▪ defined in RFCs, everyone
▪ message syntax: has access to protocol
• what fields in messages & definition
how fields are delineated ▪ allows for interoperability
▪ message semantics ▪ e.g., HTTP, SMTP
• meaning of information in proprietary protocols:
fields
▪ e.g., Skype, Zoom
▪ rules for when and how
processes send & respond to
messages
Application Layer: 2-7
HTTP overview
HTTP: hypertext transfer protocol
▪ Web’s application-layer protocol
▪ client/server model: PC running
• client: browser that requests, Firefox browser
receives, (using HTTP protocol) and
“displays” Web objects
server running
• server: Web server sends (using Apache Web
HTTP protocol) objects in response server
to requests
iPhone running
Safari browser

Application Layer: 2-8


HTTP overview (continued)
HTTP uses TCP: HTTP is “stateless”
▪ client initiates TCP connection ▪ server maintains no
(creates socket) to server, port 80 information about past client
▪ server accepts TCP connection requests
from client aside
protocols that maintain
▪ HTTP messages (application-layer “state” are complex!
protocol messages) exchanged
▪ past history (state) must be
between browser (HTTP client) and maintained
Web server (HTTP server) ▪ if server/client crashes, their
▪ TCP connection closed views of “state” may be
inconsistent, must be reconciled

Application Layer: 2-9


message
source HTTP / TCP Layers
M application
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
link
physical

switch

destination Hn Ht M network
M application Hl Hn Ht M link Hn Ht M
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
physical

1-10
UDP Packets

UDP = Packets can independently travel over different routes

1-11
Introduction

TCP Connection

access access
4321 access
net net

net
access
access net
net
access
access net
net

global
access
net
ISP access
net

access
net
access
net

access
net
access
net
access access
net access
net
net 4321
1-12
TCP connection = All packets will travel over same route
HTTP connections: two types
Non-persistent HTTP
1. TCP connection opened
2. at most one object sent
over TCP connection
3. TCP connection closed
downloading multiple
objects required multiple
connections

Application Layer: 2-13


Non-persistent HTTP: example
User enters URL: www.someSchool.edu/someDepartment/home.index
(containing text, references to 10 jpeg images)

1a. HTTP client initiates TCP


connection to HTTP server 1b. HTTP server at host
(process) at www.someSchool.edu on www.someSchool.edu waiting for TCP
port 80 connection at port 80 “accepts”
connection, notifying client
2. HTTP client sends HTTP
request message (containing
URL) into TCP connection 3. HTTP server receives request message,
socket. Message indicates forms response message containing
time that client wants object requested object, and sends message
someDepartment/home.index into its socket
Application Layer: 2-14
Non-persistent HTTP: example (cont.)
User enters URL: www.someSchool.edu/someDepartment/home.index
(containing text, references to 10 jpeg images)

4. HTTP server closes TCP


5. HTTP client receives response connection.
message containing html file,
displays html. Parsing html file,
finds 10 referenced jpeg objects

6. Steps 1-5 repeated for


each of 10 jpeg objects
time

Application Layer: 2-15


Non-persistent HTTP: response time

RTT (definition): time for a small


packet to travel from client to initiate TCP
server and back connection
RTT
HTTP response time (per object):
▪ one RTT to initiate TCP connection request file
▪ one RTT for HTTP request and first few RTT time to
transmit
bytes of HTTP response to return file
file received
▪ object/file transmission time

time time
Non-persistent HTTP response time = 2RTT+ file transmission time
Application Layer: 2-16
Animation

https://media.pearsoncmg.com/ph/esm/ecs_kurose_compnetwork_8/cw/content/interactiveanimat
ions/http-delay-estimation/index.html

Application Layer: 2-17


HTTP connections: two types
Non-persistent HTTP Persistent HTTP
1. TCP connection opened ▪TCP connection opened to
2. at most one object sent a server
over TCP connection ▪multiple objects can be
3. TCP connection closed sent over single TCP
connection between client,
downloading multiple and that server
objects required multiple ▪TCP connection closed
connections

Application Layer: 2-18


Persistent HTTP (HTTP 1.1)
Non-persistent HTTP issues: Persistent HTTP (HTTP1.1):
▪ requires 2 RTTs per object ▪ server leaves connection open after
▪ OS overhead for each TCP sending response
connection ▪ subsequent HTTP messages
▪ browsers often open multiple between same client/server sent
parallel TCP connections to over open connection
fetch referenced objects in ▪ client sends requests as soon as it
parallel encounters a referenced object
▪ as little as one RTT for all the
referenced objects (cutting
response time in half)
Application Layer: 2-19
HTTP request message
▪ two types of HTTP messages: request, response
▪ HTTP request message:
• ASCII (human-readable format)
carriage return character
line-feed character
request line (GET, POST,
GET /index.html HTTP/1.1\r\n
HEAD commands) Host: www-net.cs.umass.edu\r\n
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X
10.15; rv:80.0) Gecko/20100101 Firefox/80.0 \r\n
header Accept: text/html,application/xhtml+xml\r\n
lines Accept-Language: en-us,en;q=0.5\r\n
Accept-Encoding: gzip,deflate\r\n
Connection: keep-alive\r\n
\r\n
carriage return, line feed
at start of line indicates
end of header lines * Check out the online interactive exercises for more
examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Application Layer: 2-20
HTTP request message: general format
method sp URL sp version cr lf request
line
header field name value cr lf
header
~
~ ~
~ lines

header field name value cr lf


cr lf

~
~ entity body ~
~ body

Application Layer: 2-21

You might also like