0% found this document useful (0 votes)
8 views136 pages

Web and HTTP Overview: Key Concepts

The document provides an overview of web and HTTP, explaining the structure of web pages, the client-server model, and the differences between non-persistent and persistent HTTP connections. It details the process of HTTP requests and responses, including the format of messages and status codes. Additionally, it discusses the use of cookies for maintaining state in a stateless protocol like HTTP.

Uploaded by

hk27272765
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)
8 views136 pages

Web and HTTP Overview: Key Concepts

The document provides an overview of web and HTTP, explaining the structure of web pages, the client-server model, and the differences between non-persistent and persistent HTTP connections. It details the process of HTTP requests and responses, including the format of messages and status codes. Additionally, it discusses the use of cookies for maintaining state in a stateless protocol like HTTP.

Uploaded by

hk27272765
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

1

Comp416/Elec416
Computer Networks

Notes 7
 Web and HTTP (part 1)
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 (Uniform
Resource Locator),
 Example URL:
[Link]/someDept/[Link]

host name path name


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
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 “state”
 HTTP messages (application-layer 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 views
 TCP connection closed of “state” may be inconsistent,
must be reconciled
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
Non-persistent HTTP: example
User enters URL: [Link]/someDepartment/[Link]
(containing text, references to 10 jpeg images)

1a. HTTP client initiates TCP


connection to HTTP server 1b. HTTP server at host
(process) at [Link] on [Link] 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/[Link] into its socket
Non-persistent HTTP: example (cont.)
User enters URL: [Link]/someDepartment/[Link]
(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
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
 obect/file transmission time

time time
Non-persistent HTTP response time = 2RTT+ file transmission time
Non-persistent and Persistent HTTP
non-persistent HTTP issues:
Persistent without pipelining:
 requires 2 RTTs per object
 client issues a new request
 OS overhead to allocate host only when previous
resources for each TCP connection response has been received
 But browsers often open parallel  one RTT for each referenced
TCP connections to fetch object
referenced objects
Persistent with pipelining:
persistent HTTP
 default in HTTP/1.1
 server leaves connection open
after sending response  client sends requests as soon
as it encounters a referenced
 subsequent HTTP messages object
between the same client/server
are sent over this connection  as little as one RTT for all the
referenced objects
Non-persistent and Persistent HTTP
n objects in a base .html file
Non-persistent HTTP:
- no parallel connections
2 RTT + tr_b + (2 RTT + tr_o) * n
- parallel connections
2 RTT + tr_b + (2 RTT + tr_o)
Persistent HTTP:
- without pipelining
2 RTT + tr_b + (RTT + tr_o) * n
- with pipelining
2 RTT + tr_b + (RTT + n * tr_o)
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 /[Link] HTTP/1.1\r\n
HEAD commands) Host: [Link]\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: [Link]
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
Other HTTP request messages
POST method: HEAD method:
 web page often includes form  requests headers (only) that
input would be returned if specified
 user input sent from client to URL were requested with an
server in entity body of HTTP HTTP GET method.
POST request message
PUT method:
 uploads new file (object) to server
GET method (for sending data to server):  completely replaces file that exists
 include user data in URL field of HTTP at specified URL with content in
GET request message (following a ‘?’): entity body of POST HTTP request
[Link]/animalsearch?monkeys&banana
message
HTTP response message
status line (protocol HTTP/1.1 200 OK
status code status phrase) Date: Tue, 08 Sep 2020 [Link] GMT
Server: Apache/2.4.6 (CentOS)
OpenSSL/1.0.2k-fips PHP/7.4.9
mod_perl/2.0.11 Perl/v5.16.3
header Last-Modified: Tue, 01 Mar 2016 [Link] GMT
lines ETag: "a5b-52d015789ee9e"
Accept-Ranges: bytes
Content-Length: 2651
Content-Type: text/html; charset=UTF-8
\r\n
data, e.g., requested data data data data data ...
HTML file

* Check out the online interactive exercises for more examples: [Link]
HTTP response status codes
 status code appears in 1st line in server-to-client response message.
 some sample codes:
200 OK
• request succeeded, requested object later in this message
301 Moved Permanently
• requested object moved, new location specified later in this message (in
Location: field)
400 Bad Request
• request msg not understood by server
404 Not Found
• requested document not found on this server
505 HTTP Version Not Supported
Trying out HTTP (client side) for yourself
1. telnet to your favorite Web server:
telnet [Link] 80  opens TCP connection to port 80 (default HTTP server
port) at [Link]. edu.
 anything typed in will be sent to port 80 at
[Link]
2. type in a GET HTTP request:
GET /kurose_ross/interactive/[Link] HTTP/1.1
Host: [Link]
 by typing this in (hit carriage return twice), you send
this minimal (but complete) GET request to HTTP
server

3. look at response message sent by HTTP server!


Maintaining user/server state: cookies
a stateful protocol: client makes
Recall: HTTP GET/response two changes to X, or none at all
interaction is stateless
X
 no notion of multi-step exchanges of
HTTP messages to complete a Web X
“transaction”
• no need for client/server to track X’
“state” of multi-step exchange
t’
• all HTTP requests are independent of X’’
each other
• no need for client/server to “recover”
X’’
from a partially-completed-but-never-
time
completely-completed transaction time
Q: what happens if network connection or
client crashes at t’ ?
Maintaining user/server state: cookies
Web sites and client browser use Example:
cookies to maintain some state  Susan uses browser on laptop,
visits specific e-commerce site
between transactions for first time
four components:  when initial HTTP requests
1) cookie header line of HTTP response arrives at site, site creates:
message • unique ID (aka “cookie”)
• entry in backend database
2) cookie header line in next HTTP for ID
request message
• subsequent HTTP requests
3) cookie file kept on user’s host, from Susan to this site will
managed by user’s browser contain cookie ID value,
4) back-end database at Web site allowing site to “identify”
Susan
Maintaining user/server state: cookies
client
server
ebay 8734 usual HTTP request msg Amazon server
cookie file creates ID
usual HTTP response 1678 for user backend
create
ebay 8734 set-cookie: 1678 entry database
amazon 1678

usual HTTP request msg


cookie: 1678 cookie- access
specific
usual HTTP response msg action

one week later:


access
ebay 8734 usual HTTP request msg
amazon 1678 cookie: 1678 cookie-
specific
usual HTTP response msg action
time time
HTTP cookies: comments
aside
What cookies can be used for: cookies and privacy:
 authorization  cookies permit sites to
 shopping carts learn a lot about you on
their site.
 recommendations  third party persistent
 user session state (Web e-mail) cookies (tracking cookies)
allow common identity
(cookie value) to be
Challenge: How to keep state? tracked across multiple
 at protocol endpoints: maintain state at web sites
sender/receiver over multiple
transactions
 in messages: cookies inHTTP messages
carry state
1

Comp416/Elec416
Computer Networks

Notes 6
▪ Principles of network applications
Application layer: overview
Our goals: ▪ learn about protocols by
examining popular
▪ conceptual and application-layer protocols
implementation aspects of and infrastructure
application-layer protocols • HTTP
• transport-layer service • SMTP, IMAP
models • DNS
• client-server paradigm • video streaming systems, CDNs
• peer-to-peer paradigm ▪ programming network
applications
• socket API
Creating a network app
application
transport
write programs that: mobile network
network
data link
physical
▪ run on (different) end systems national or global ISP

▪ communicate over network


▪ e.g., web server software
communicates with browser software
local or
no need to write software for regional ISP

network-core devices home network content


application
▪ network-core devices do not run user transport
network
provider
network datacenter
application
applications data link
physical
transport
network
network

▪ applications on end systems allows data link


physical

for rapid app development, enterprise


propagation network
Client-server architecture
server: mobile network
▪ always-on host national or global ISP

▪ permanent IP address
▪ often in data centers, for scaling
clients: local or
regional ISP
▪ contact, communicate with server
▪ may be intermittently connected home network content
provider
▪ may have dynamic IP addresses network datacenter
network

▪ do not communicate directly with


each other
enterprise
▪ examples: HTTP, IMAP, FTP network
Peer-peer architecture
▪ no always-on server mobile network
▪ arbitrary end systems directly national or global ISP

communicate
▪ peers request service from other
peers, provide service in return to
other peers local or
regional ISP
• self scalability – new peers bring new
service capacity, as well as new service home network content
demands provider
network datacenter

▪ peers are intermittently connected network

and change IP addresses


• complex management enterprise
▪ example: P2P file sharing
network
Network applications: Processes communicating
process: program running within a host
clients, servers
▪ within same host, two processes
communicate using inter-process client process: process that
communication (defined by OS) initiates communication
server process: process
▪ processes in different hosts that waits to be contacted
communicate by exchanging
messages

user agent: interfaces with user “above” and network “below”.


▪ implements user interface & application-level protocol
• Web: browser
• E-mail: mail reader
• streaming audio/video: media player
Sockets
▪ process sends/receives messages to/from its socket
▪ socket is analogous to a door
• sending process shoves message out door
• sending process relies on transport infrastructure on other side of
door to deliver message to socket at receiving process
• two sockets involved: one on each side

application application
socket controlled by
process process app developer

transport transport
network network controlled
link by OS
link Internet
physical physical
Addressing processes
▪ to receive messages, process ▪ identifier includes both IP address
must have identifier and port numbers associated with
▪ host device has unique 32-bit process on host.
IP address ▪ example port numbers:
▪ Q: does IP address of host on • HTTP server: 80
which process runs suffice for • mail server: 25
identifying the process? ▪ IP Address + Port Number =
▪ A: no, many processes Transport Address
can be running on the ▪ to send HTTP message to
same host [Link] web server:
• IP address: [Link]
• port number: 80
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
▪ Not available in the public
processes send & respond to
domain
messages
What transport service does an app need?
data integrity 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” …
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
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?
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 1.1 [RFC 7320] TCP
Internet telephony SIP [RFC 3261], RTP [RFC TCP or UDP
3550], or proprietary
streaming audio/video HTTP [RFC 7320], DASH TCP
interactive games WOW, FPS (proprietary) UDP or TCP
Securing TCP
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
Comp416/Elec416
Computer Networks
Fall 2025
Öznur Özkasap
Professor of Computer Engineering
oozkasap@[Link]
Office hour: Monday 2:30 - 3:30 pm (or by appointment)

1
Course Objective and Prerequisite
Principles of computer networks and protocols
Internet protocol stack application
Application Layer
Transport Layer transport
Network Layer: Control and Data Planes
network
Data Link Layer, Local Area Networks
Network and distributed applications link
Protocol design and analysis physical
Assessment of network performance
Software defined networking
Prerequisite:
Knowledge of Java programming
(Comp132 or equivalent)
Text Book and Course Material

Computer Networking:
A Top Down Approach
8th edition.
Jim Kurose, Keith Ross
Pearson Education, 2022.

These lecture viewgraphs are adapted from J.F Kurose and K.W.
Ross’s copyrighted material associated with their book.

Course material: [Link]

Discussion board, Project / Assignment submissions:


through KUHub Learn
3
Learning outcomes
Students who complete this course successfully are
expected to:
✓ gain extensive knowledge on principles of computer
networks and protocols including the Internet protocol
stack, application layer, transport layer, network layer,
software defined networking and data link layer
✓ understand key mechanisms in protocol design and
analysis in computer networks
✓ learn how to assess network performance using software
tools
✓ practice with design and implementation of network and
distributed software

4
Course elements & Grading
Assignments (In class written) 25%
Projects (Practical network programming and protocols projects) 35%
Midterm exam (Written) 30%
Participation (in questions/discussions and random attendance points) 10%
Your assignment average and project average should be at least 50 / 100 to
get a passing grade.

Academic Honesty
Please read KU Statement on Academic Honesty (on the course web site).

Attendance and Policy


Students taking this course are required to attend classes regularly and on
time. Random attendance is taken.

5
Practical contents
Network Socket Programming and TCP Protocol

Multithreading in Network Programming and


Using RESTFul APIs in Java

6
Practical contents
Wireshark: Network Protocol Analyzer

Secure Sockets Layer (SSL) in Java

7
Practical contents

Cisco Packet Tracer

8
Practical work: Course projects
Application layer:
supporting network applications application

transport
Transport layer:
process-process data transfer network

link
Network layer:
routing of datagrams from source physical
to destination

9
Outline
Computer Networks and the Internet
The Network Edge
The Network Core
Delay, Loss, and Throughput in Packet-Switched Networks
Protocol Layers and Their Service Models

Application Layer
Principles of Network Applications
The Web and HTTP, SMTP, DNS
Peer-to-Peer Applications, CDNs
Socket Programming (Creating Network Applications) with TCP and UDP

Transport Layer
Transport-Layer Services
Multiplexing and Demultiplexing
Connectionless Transport: UDP
Principles of Reliable Data Transfer and Protocols
Connection-Oriented Transport: TCP
Principles of Congestion Control, TCP Congestion Control
10
Outline (cnt’d)
Network Layer: Data Plane
Network layer overview: Forwarding and Routing
Service Models, Routers
The Internet Protocol (IP): Forwarding and Addressing in the Internet
Generalized Forwarding and Software Defined Networks (SDN)

Network Layer: Control Plane


Routing Algorithms: Link State routing and Distance-Vector routing
Routing in the Internet
SDN Control Plane
The Internet Control Message Protocol (ICMP), Network Management

Data Link Layer and Local Area Networks


Error-Detection and -Correction Techniques
Multiple Access Links and Protocols
Switched Local Area Networks: Link-Layer Addressing, Ethernet
Link Virtualization, MPLS, Data Center Networking

11
Chapter 1: Introduction
Goal: Overview:
❑ get overview, ❑ what’s the Internet?
terminology and “feel”
❑ what’s a protocol?
of computer
networking ❑ network edge; hosts, access net,
❑ more depth, detail physical media
later in course ❑ network core: packet/circuit
❑ approach: switching, Internet structure
▪ use Internet as an ❑ performance: loss, delay,
example throughput
❑ protocol layers, service models
❑ history

12
The Internet: a “nuts and bolts” view
Billions of connected
computing devices: mobile network

▪ hosts = end systems national or global ISP

▪ running network apps at


Internet’s “edge”

Packet switches: local or


forward packets Internet
regional
ISP
(chunks of data) home network content
▪ routers, switches provider
network datacenter
network
Communication links
▪ fiber, copper, radio,
satellite
▪ transmission rate: enterprise
network
bandwidth
Networks
▪ collection of devices,
routers, links: managed by
an organization
“Fun” Internet-connected devices

Tweet-a-watt:
monitor energy use
bikes
Pacemaker & Monitor

Amazon Echo Web-enabled toaster +


IP picture frame
weather forecaster
Internet
refrigerator
Slingbox: remote cars
Security Camera control cable TV AR devices
sensorized, scooters
bed
mattress Others?
Gaming devices
Internet phones Fitbit
The Internet: a “nuts and bolts” view
▪ Internet: “network of networks”
mobile network
• Interconnected ISPs 4G
national or global ISP

▪ protocols are everywhere Streaming


IP
• control sending, receiving of Skype video

messages local or
regional
• e.g., HTTP (Web), streaming video, ISP
Skype, TCP, IP, WiFi, 5G, Ethernet home network content
provider
HTTP network
Internet standards
datacenter
▪ network
Ethernet
• RFC: Request for Comments
• IETF: Internet Engineering Task Force enterprise
TCP

network

WiFi
The Internet: a “services” view
▪ Infrastructure that provides services
to applications: mobile network
• Web, streaming video, multimedia national or global ISP
teleconferencing, email, games, e-
commerce, social media, inter-connected
Streaming
appliances, … Skype video

▪ provides programming interface to local or


regional
distributed applications: ISP

• “hooks” allowing sending/receiving apps to home network content


“connect” to, use Internet transport service HTTP
provider
network datacenter
• provides service options, analogous to postal network

service

▪ communication services provided to apps enterprise


network
• Reliable data delivery from source to
destination
• Best-effort (unreliable) data delivery
What’s a protocol?
human protocols: network protocols:
❑ “what’s the time?” ❑ Computers (devices) rather
❑ “I have a question” than humans
❑ introductions ❑ all communication activity in
the Internet governed by
Rules for: protocols
… specific msgs sent protocols define the format,
… specific actions taken order of msgs sent and
when msgs received, received among network
or other events entities, and actions taken
on msg transmission,
receipt
17
What’s a protocol?
a human protocol and a computer network protocol:

Hi TCP connection
request
Hi TCP connection
response
Got the
time? Get [Link]
2:00
<file>
time

Mastering the field of computer networking is equivalent to


understanding what, why and how of networking protocols
18
A closer look at Internet structure

mobile network

Network edge: national or global ISP

- hosts: clients and servers


- servers often in data centers local or
regional
ISP
home network content
provider
network datacenter
network

enterprise
network
A closer look at Internet structure

mobile network

Network edge: national or global ISP

- hosts: clients and servers


- servers often in data centers local or
regional
ISP
Access networks, physical media: home network content
provider
- wired, wireless communication links network datacenter
network

enterprise
network
A closer look at Internet structure

mobile network
Network edge: national or global ISP

- hosts: clients and servers


- servers often in data centers
local or
Access networks, physical media: regional
ISP
- wired, wireless communication links home network content
provider
network
Network core: datacenter
network

- interconnected routers
- network of networks enterprise
network
The network edge:
❑ end systems (hosts):
▪ run application programs
▪ e.g. Web, email
▪ at “edge of network” peer-peer

❑ client/server model
▪ client host requests, receives
service from always-on server
client/server
▪ e.g. Web browser/server; email
client/server
❑ peer-peer model:
▪ minimal (or no) use of dedicated
servers
▪ e.g. Skype, BitTorrent
22
Network edge: reliable data transfer service
(connection-oriented)
Goal: data transfer TCP service [RFC 793]
between end systems ❑ reliable, in-order byte-
❑ handshaking: setup stream data transfer
(prepare for) data ▪ loss: acknowledgements and
transfer ahead of time retransmissions
▪ Hello, hello back human ❑ flow control:
protocol
▪ sender won’t overwhelm
▪ set up “state” in two receiver
communicating hosts
❑ congestion control:
❑ TCP - Transmission
▪ senders “slow down sending
Control Protocol rate” when network
▪ Internet’s reliable data congested
transfer service
23
Network edge: best effort (unreliable) data
transfer service (connectionless)
Goal: data transfer App’s using TCP:
between end systems ❑ HTTP (Web), FTP (file
▪ same as before! transfer), Telnet (remote
❑ UDP - User Datagram login), SMTP (email)
Protocol [RFC 768]:
Internet’s connectionless
service
App’s using UDP:
❑ streaming media,
▪ unreliable data
transfer teleconferencing, DNS,
Internet telephony
▪ no flow control
▪ no congestion control

24
Comp416/Elec416
Computer Networks

Notes 5
 Layering, encapsulation, service models
Protocol “layers” and reference models
Networks are complex, Question: is there any
with many “pieces”: hope of organizing
 hosts structure of network?
 routers and/or our discussion
 links of various media of networks?
 applications
 protocols
 hardware, software
Example: organization of air travel
end‐to‐end transfer of person plus baggage
ticket (purchase) ticket (complain)
baggage (check) baggage (claim)
gates (load) gates (unload)
runway takeoff runway landing
airplane routing airplane routing
airplane routing

How would you define/discuss the system of airline travel?


 a series of steps, involving many services
Example: organization of air travel

ticket (purchase) ticketing service ticket (complain)


baggage (check) baggage service baggage (claim)
gates (load) gate service gates (unload)
runway takeoff runway service runway landing
airplane routing routing service
airplane routing airplane routing

layers: each layer implements a service


 via its own internal‐layer actions
 relying on services provided by layer below
Why layering?
Approach to designing/discussing complex systems:
 explicit structure allows identification,
relationship of system’s pieces
• layered reference model for discussion
 modularization eases maintenance,
updating of system
• change in layer's service implementation:
transparent to rest of system
• e.g., change in gate procedure doesn’t
affect rest of system
Layered Internet protocol stack
 application: supporting network applications
• HTTP, IMAP, SMTP, DNS
application
application
 transport: process‐process data transfer
• TCP, UDP transport
transport
 network: routing of datagrams from source to
destination network
• IP, routing protocols
link
 link: data transfer between neighboring
network elements physical
• Ethernet, 802.11 (WiFi), PPP
 physical: bits “on the wire”
Services, Layering and Encapsulation
M
application Application exchanges messages to implement some application
application service using services of transport layer
Ht M
transport Transport‐layer protocol transfers M (e.g., reliably) from transport
one process to another, using services of network layer

network  transport‐layer protocol encapsulates network


application‐layer message, M, with
link transport layer‐layer header Ht to create a link
transport‐layer segment
• Ht used by transport layer protocol to
physical implement its service physical

source destination
Services, Layering and Encapsulation
M
application application
Ht M
transport Transport‐layer protocol transfers M (e.g., reliably) from transport
one process to another, using services of network layer

network Hn Ht M network
Network‐layer protocol transfers transport‐layer segment
[Ht | M] from one host to another, using link layer services
link link
 network‐layer protocol encapsulates
transport‐layer segment [Ht | M] with
physical network layer‐layer header Hn to create a physical
network‐layer datagram
source • Hn used by network layer protocol to destination
implement its service
Services, Layering and Encapsulation
M
application application
Ht M
transport transport

network Hn Ht M network
Network‐layer protocol transfers transport‐layer segment
[Ht | M] from one host to another, using link layer services
link Hl Hn Ht M link
Link‐layer protocol transfers datagram [Hn| [Ht |M] from
host to neighboring host, using physical‐layer services
physical physical
 link‐layer protocol encapsulates network
datagram [Hn| [Ht |M], with link‐layer header
source Hl to create a link‐layer frame destination
Services, Layering and Encapsulation
M
application M application
message
Ht M
transport Ht M transport
segment
network Hn Ht M Hn Ht M network
datagram

link Hl Hn Ht M Hl Hn Ht M link
frame

physical physical

source destination
message M
source
application
Encapsulation: an
segment Ht
datagram Hn Ht
M transport
network
end‐end view
M
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
 Networks under attack
Network security
 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!
 We now need to think about:
• how bad guys can attack computer networks
• how we can defend networks against attacks
• how to design architectures that are immune to attacks
Bad guys: packet interception
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 our end‐of‐chapter labs is a (free) packet‐sniffer


Bad guys: fake identity
IP spoofing: injection of packet with false source address

A C

src:B dest:A payload

B
Bad guys: denial of service
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 target

from compromised
hosts
Lines of defense:
 authentication: proving you are who you say you are
• cellular networks provides hardware identity via SIM card; no such
hardware assist in traditional Internet
 confidentiality: via encryption
 integrity checks: digital signatures prevent/detect tampering
 access restrictions: password‐protected VPNs
 firewalls: specialized “middleboxes” in access and core
networks:
 off‐by‐default: filter incoming packets to restrict senders, receivers,
applications
 detecting/reacting to DOS attacks

… lots more on security (throughout, Chapter 8)


 Internet history
Internet history
1961‐1972: Early packet‐switching principles
 1961: Kleinrock ‐ queueing  1972:
theory shows effectiveness of • ARPAnet public demo
packet‐switching • NCP (Network Control Protocol)
 1964: Baran ‐ packet‐switching first host‐host protocol
in military nets • first e‐mail program
 1967: ARPAnet conceived by • ARPAnet has 15 nodes
Advanced Research Projects
Agency
 1969: first ARPAnet node
operational
Internet history
1972‐1980: Internetworking, new and proprietary networks
 1970: ALOHAnet satellite
Cerf and Kahn’s internetworking
network in Hawaii principles:
 1974: Cerf and Kahn ‐  minimalism, autonomy ‐ no
architecture for interconnecting internal changes required to
networks interconnect networks
 best‐effort service model
 1976: Ethernet at Xerox PARC  stateless routing
 late70’s: proprietary  decentralized control
architectures: DECnet, SNA, XNA define today’s Internet architecture
 1979: ARPAnet has 200 nodes
Internet history
1980‐1990: new protocols, a proliferation of networks
 1983: deployment of TCP/IP  new national networks: CSnet,
 1982: smtp e‐mail protocol BITnet, NSFnet, Minitel
defined  100,000 hosts connected to
 1983: DNS defined for name‐ confederation of networks
to‐IP‐address translation
 1985: ftp protocol defined
 1988: TCP congestion control
Internet history
1990, 2000s: commercialization, the Web, new applications
 early 1990s: ARPAnet late 1990s – 2000s:
decommissioned  more killer apps: instant
 1991: NSF lifts restrictions on messaging, P2P file sharing
commercial use of NSFnet  network security to forefront
(decommissioned, 1995)
 est. 50 million host, 100 million+
 early 1990s: Web users
• hypertext [Bush 1945, Nelson 1960’s]
• HTML, HTTP: Berners‐Lee
 backbone links running at Gbps
• 1994: Mosaic, later Netscape
• late 1990s: commercialization of the
Web
Internet history
2005‐present: scale, SDN, mobility, cloud
 aggressive deployment of broadband home access (10‐100’s Mbps)
 2008: software‐defined networking (SDN)
 increasing ubiquity of high‐speed wireless access: 4G/5G, WiFi
 service providers (Google, FB, Microsoft) create their own networks
• bypass commercial Internet to connect “close” to end user, providing
“instantaneous” access to social media, search, video content, …
 enterprises run their services in “cloud” (e.g., Amazon Web Services,
Microsoft Azure)
 rise of smartphones: more mobile than fixed devices on Internet (2017)
 ~18B devices attached to Internet (2017)
Chapter 1: summary
We’ve covered a “ton” of material! You now have:
 Internet overview  context, overview,
 what’s a protocol? vocabulary, “feel”
 network edge, access network, core of networking
• packet‐switching versus circuit‐  more depth, detail,
switching
• Internet structure and fun to follow!
 performance: loss, delay, throughput
 layering, service , encapsulation
 networks under attack
 history
1

Comp416/Elec416
Computer Networks

Notes 4
▪ Performance: loss, delay, throughput
How do packet delay and loss occur?
▪ packets queue in router buffers, waiting for turn for transmission
▪ queue length grows when arrival rate to link (temporarily) exceeds output link
capacity
▪ packet loss occurs when memory to hold queued packets fills up
packet being transmitted (transmission delay)

B
packets in buffers (queueing delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
Packet delay: four sources
transmission
A propagation

B
nodal
processing queueing

dnodal = dproc + dqueue + dtrans + dprop

dproc: nodal processing dqueue: queueing delay


▪ check bit errors ▪ time waiting at output link for
▪ determine output link transmission
▪ typically < microsecs ▪ depends on congestion level of
router
Packet delay: four sources
transmission
A propagation

B
nodal
processing queueing

dnodal = dproc + dqueue + dtrans + dprop


dtrans: transmission delay: dprop: propagation delay:
▪ L: packet length (bits) ▪ d: length of physical link
▪ R: link transmission rate (bps) ▪ s: propagation speed (~2x108 m/sec)
▪ dtrans = L/R ▪ dprop = d/s
dtrans and dprop
very different
Caravan analogy
100 km 100 km

ten-car caravan toll booth toll booth toll booth


(aka 10-bit packet) (aka link)

▪ car ~ bit; caravan ~ packet; toll ▪ time to “push” entire caravan


service ~ link transmission through toll booth onto
▪ toll booth takes 12 sec to service highway = 12*10 = 120 sec
car (bit transmission time) ▪ time for last car to propagate
▪ “propagate” at 100 km/hr from 1st to 2nd toll both:
100km/(100km/hr) = 1 hr
▪ Q: How long until caravan is lined
up before 2nd toll booth? ▪ A: 62 minutes
Caravan analogy
100 km 100 km

ten-car caravan toll booth toll booth


(aka 10-bit packet) (aka router)

▪ suppose cars now “propagate” at 1000 km/hr


▪ and suppose toll booth now takes one min to service a car
▪ Q: Will cars arrive to 2nd booth before all cars serviced at first booth?
A: Yes! after 7 min, first car arrives at second booth; three cars still at
first booth
Packet queueing delay (revisited)
▪ a: average packet arrival rate

average queueing delay


▪ L: packet length (bits)
▪ R: link bandwidth (bit transmission rate)

L .a arrival rate of bits “traffic


:
R service rate of bits intensity” traffic intensity = La/R 1

▪ La/R ~ 0: avg. queueing delay small La/R ~ 0

▪ La/R -> 1: avg. queueing delay large


▪ La/R > 1: more “work” arriving is
more than can be serviced - average
delay infinite!
La/R -> 1
“Real” Internet delays and routes
▪ what do “real” Internet delay & loss look like?
▪ traceroute 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 (with time-to-live field value of i)
• router i will return packets to sender
• sender measures time interval between transmission and reply

3 probes 3 probes

3 probes
Real Internet delays and routes
traceroute: [Link] to [Link]
3 delay measurements from
[Link] to [Link]
1 cs-gw ([Link]) 1 ms 1 ms 2 ms 3 delay measurements
2 [Link] ([Link]) 1 ms 1 ms 2 ms
3 [Link] ([Link]) 6 ms 5 ms 5 ms to [Link]
4 [Link] ([Link]) 16 ms 11 ms 13 ms
5 [Link] ([Link]) 21 ms 18 ms 18 ms
6 [Link] ([Link]) 22 ms 18 ms 22 ms
7 [Link] ([Link]) 22 ms 22 ms 22 ms trans-oceanic link
8 [Link] ([Link]) 104 ms 109 ms 106 ms
9 [Link] ([Link]) 109 ms 102 ms 104 ms
10 [Link] ([Link]) 113 ms 121 ms 114 ms looks like delays
11 [Link] ([Link]) 112 ms 114 ms 112 ms
12 [Link] ([Link]) 111 ms 114 ms 116 ms decrease! Why?
13 [Link] ([Link]) 123 ms 125 ms 124 ms
14 [Link] ([Link]) 126 ms 126 ms 124 ms
15 [Link] ([Link]) 135 ms 128 ms 133 ms
16 [Link] ([Link]) 126 ms 128 ms 126 ms
17 * * *
18 * * * * means no response (probe lost, router not replying)
19 [Link] ([Link]) 132 ms 128 ms 136 ms

* Do some traceroutes from exotic countries at [Link]


Packet loss
▪ queue (aka buffer) preceding link in buffer has finite capacity
▪ packet arriving to full queue dropped (aka lost)
▪ lost packet may be retransmitted by previous node, by source end
system, or not at all
buffer
(waiting area) packet being transmitted
A

B
packet arriving to
full buffer is lost

* Check out the Java applet for an interactive animation (on publisher’s website) of queuing and loss
Throughput
▪ throughput: rate (bits/time unit) at which bits are being sent from
sender to receiver
• instantaneous: rate at given point in time
• average: rate over longer period of time

link capacity
pipe that can carry linkthat
pipe capacity
can carry
Rsfluid
bits/sec
at rate Rfluid
c bits/sec
at rate
serverserver,
sends with
bits
(fluid) into pipe (Rs bits/sec) (Rc bits/sec)
file of F bits
to send to client
Throughput
Rs < Rc What is average end-end throughput?

Rs bits/sec Rc bits/sec

Rs > Rc What is average end-end throughput?

Rs bits/sec Rc bits/sec

bottleneck link
link on end-end path that constrains end-end throughput
Throughput: network scenario
▪ per-connection end-
Rs end throughput:
Rs Rs min(Rc,Rs,R/10)
▪ in practice: Rc or Rs is
R often bottleneck
Rc Rc
Rc
* Check out the online interactive exercises for more
examples: [Link]

10 connections (fairly) share


backbone bottleneck link R bits/sec
1

Comp416/Elec416
Computer Networks

Notes 2
Network edge:
Access networks and physical media
Access networks and physical media
Q: How to connect end systems mobile network
national or global ISP
to edge router?
▪ residential access nets
▪ institutional access networks (school,
company)
local or
▪ mobile access networks (WiFi, 4G/5G) regional ISP

home network content


provider
network datacenter
network

enterprise
network
Access networks: cable-based access
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 (FDM): different channels transmitted in


different frequency bands
Access networks: cable-based access
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 40 Mbps – 1.2 Gbs downstream transmission rate, 30-100 Mbps
upstream transmission rate
▪ network of cable, fiber attaches homes to ISP router
• homes share access network to cable headend
Access networks: digital subscriber line (DSL)
central office telephone
network

DSL splitter
modem DSLAM

voice, data transmitted ISP


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
▪ 24-52 Mbps dedicated downstream transmission rate
▪ 3.5-16 Mbps dedicated upstream transmission rate
Access networks: home networks
Wireless and wired
devices

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

cable or DSL modem

WiFi wireless access router, firewall, NAT


point (54, 450 Mbps)
wired Ethernet (1 Gbps)
Wireless access networks
Shared wireless access network connects end system to router
▪ via base station aka “access point”

Wireless local area networks Wide-area cellular access networks


(WLANs) ▪ provided by mobile, cellular network
▪ typically within or around operator (10’s km)
building (~100 ft) ▪ 10’s Mbps
▪ 802.11b/g/n (WiFi): 11, 54, 450 ▪ 4G cellular networks (5G coming)
Mbps transmission rate

to Internet
to Internet
Access networks: enterprise networks

Enterprise link to
ISP (Internet)
institutional router
Ethernet institutional mail,
switch web servers

▪ companies, universities, etc.


▪ mix of wired, wireless link technologies, connecting a mix of switches
and routers (we’ll cover differences shortly)
▪ Ethernet: wired access at 100Mbps, 1Gbps, 10Gbps
▪ WiFi: wireless access points at 11, 54, 450 Mbps
Access networks: data center networks
mobile network
▪ high-bandwidth links (10s to 100s national or global ISP
Gbps) connect hundreds to thousands
of servers together, and to Internet

local or
regional ISP

home network content


provider
network datacenter
network

Courtesy: Massachusetts Green High Performance Computing enterprise


Center ([Link]) network
Host: sends packets of data
host sending function:
▪ takes application message
▪ breaks into smaller chunks, two packets,
known as packets, of length L bits L bits each

▪ transmits packet into access


2 1
network at transmission rate R
• link transmission rate, aka link host
capacity, aka link bandwidth R: link transmission rate

packet time needed to L (bits)


transmission = transmit L-bit =
delay packet into link R (bits/sec)
Links: physical media
▪ bit: propagates between Twisted pair (TP)
transmitter/receiver pairs
▪ two insulated copper wires
▪ physical link: what lies • Category 5: 100 Mbps, 1 Gbps Ethernet
between transmitter & • Category 6: 10Gbps Ethernet
receiver
▪ guided media:
• signals propagate in solid
media: copper, fiber, coax
▪ unguided media:
• signals propagate freely,
e.g., radio
Links: physical media
Coaxial cable: Fiber optic cable:
▪ two concentric copper conductors ▪ glass fiber carrying light pulses, each
pulse a bit
▪ bidirectional
▪ high-speed operation:
▪ broadband: • high-speed point-to-point
• multiple frequency channels on cable transmission (10’s-100’s Gbps)
• 100’s Mbps per channel ▪ low error rate:
• repeaters spaced far apart
• immune to electromagnetic noise
Links: physical media
Wireless radio Radio link types:
▪ signal carried in various ▪ Wireless LAN (WiFi)
“bands” in electromagnetic • 10-100’s Mbps; 10’s of meters
spectrum ▪ wide-area (e.g., 4G cellular)
▪ no physical “wire” • 10’s Mbps over ~10 Km
▪ broadcast, “half-duplex” ▪ Bluetooth: cable replacement
(sender to receiver)
• short distances, limited rates
▪ propagation environment
effects: ▪ terrestrial microwave
• reflection • point-to-point; 45 Mbps channels
• obstruction by objects ▪ satellite
• Interference/noise • up to 45 Mbps per channel
• 270 msec end-end delay
1

Comp416/Elec416
Computer Networks

Notes 3
Network core:
packet/circuit switching
internet structure
The network core
▪ mesh of interconnected routers mobile network
national or global ISP
▪ packet-switching: hosts break
application-layer messages into
packets
• network forwards packets from one local or
regional ISP
router to the next, across links on
path from source to destination home network content
provider
network datacenter
network

enterprise
network
Two key network-core functions

routing algorithm Routing:


Forwarding: local
local forwarding
forwarding table
table
▪ global action:
header value output link determine source-
▪ aka “switching” 0100
0101
3
2 destination paths
▪ local action: 0111 2
taken by packets
1001 1
move arriving
packets from ▪ routing algorithms
router’s input link 1
to appropriate
router output link 3 2

destination address in arriving


packet’s header
routing
forwarding
forwarding
Packet-switching: store-and-forward

L bits
per packet
3 2 1
source destination
R bps R bps

▪ packet transmission delay: takes L/R seconds to One-hop numerical example:


transmit (push out) L-bit packet into link at R bps ▪ L = 10 Kbits
▪ store and forward: entire packet must arrive at ▪ R = 100 Mbps
router before it can be transmitted on next link ▪ one-hop transmission delay
= 0.1 msec
Packet-switching: queueing
R = 100 Mb/s
A C

D
B R = 1.5 Mb/s
E
queue of packets
waiting for transmission
over output link

Queueing occurs when work arrives faster than it can be serviced:


Packet-switching: queueing
R = 100 Mb/s
A C

D
B R = 1.5 Mb/s
E
queue of packets
waiting for transmission
over output link

Packet queuing and loss: if arrival rate (in bps) to link exceeds
transmission rate (bps) of link for some period of time:
▪ packets will queue, waiting to be transmitted on output link
▪ packets can be dropped (lost) if memory (buffer) in router fills up
Alternative to packet switching: circuit switching
end-end resources allocated to,
reserved for “call” between source
and destination
▪ 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

* Check out the online interactive exercises for more examples: [Link]
Circuit switching: FDM and TDM
Frequency Division Multiplexing
(FDM) 4 users

frequency
▪ optical, electromagnetic frequencies
divided into (narrow) frequency
bands
▪ each call allocated its own band, can
transmit at max rate of that narrow time
band

Time Division Multiplexing (TDM)

frequency
▪ time divided into slots
▪ each call allocated periodic slot(s), can
transmit at maximum rate of (wider) time
frequency band (only) during its time
slot(s)
Packet switching versus circuit switching
example:
▪ 1 Gb/s link
N
▪ each user: users 1 Gbps link
• 100 Mb/s when “active”
• active 10% of time

Q: how many users can use this network under circuit-switching and packet switching?

▪ circuit-switching: 10 users
▪ packet switching: with 35 users, Q: how did we get value 0.0004?
probability > 10 active at same time
is less than .0004 *

* Check out the online interactive exercises for more examples: [Link]
Packet switching versus circuit switching
Is packet switching a “slam dunk winner”?
▪ great for “bursty” data – sometimes has data to send, but at other times not
• resource sharing
• simpler, no call setup
▪ excessive congestion possible: packet delay and loss due to buffer overflow
• protocols needed for reliable data transfer, congestion control
▪ Q: How to provide circuit-like behavior with packet-switching?
• “It’s complicated.” We’ll study various techniques that try to make packet
switching as “circuit-like” as possible.

Q: human analogies of reserved resources (circuit switching) versus


on-demand allocation (packet switching)?
Internet structure: a “network of networks”
mobile network
▪ hosts connect to Internet via access national or global ISP
Internet Service Providers (ISPs)
▪ access ISPs in turn must be
interconnected
• so that any two hosts (anywhere!) local or
regional ISP
can send packets to each other
▪ resulting network of networks is home network content
provider
very complex network datacenter
network

• evolution driven by economics, enterprise


national policies network

Let’s take a stepwise approach to describe current Internet structure


Internet structure: a “network of networks”
Question: given millions of access ISPs, how to connect them together?
access access
net net
access
net
access
access net
net
access
access net
net

access access
net net

access
net
access
net

access
net
access
net
access access
net access net
net
Internet structure: a “network of networks”
Question: given millions of access ISPs, how to connect them together?
access access
net net
access
net
access
access net
net
access
access net
net

connecting each access ISP to


each other directly doesn’t scale:
access
access
net O(N2) connections. net

access
net
access
net

access
net
access
net
access access
net access net
net
Internet structure: a “network of networks”
Option: connect each access ISP to one global transit ISP?
Customer and provider ISPs have economic agreement.
access access
net net
access
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
Internet structure: a “network of networks”
But if one global ISP is viable business, there will be competitors ….

access access
net net
access
net
access
access net
net
access
access net
net ISP A

access
net ISP B access
net

access ISP C
net
access
net

access
net
access
net
access access
net access net
net
Internet structure: a “network of networks”
But if one global ISP is viable business, there will be competitors …. who will
want to be connected
Internet exchange point
access access
net net
access
net
access
access net
net
IXP access
access net
net ISP A

access
net
IXP ISP B access
net

access ISP C
net
access
net

access
net
peering link
access
net
access access
net access net
net
Internet structure: a “network of networks”
… and regional networks may arise to connect access nets to ISPs

access access
net net
access
net
access
access net
net
IXP access
access net
net ISP A

access
net
IXP ISP B access
net

access ISP C
net
access
net

access
net
regional ISP access
net
access access
net access net
net
Internet structure: a “network of networks”
… and content provider networks (e.g., Google, Microsoft, Akamai) may
run their own network, to bring services, content close to end users
access access
net net
access
net
access
access net
net
IXP access
access net
net ISP A

Content provider network


access
net
IXP ISP B access
net

access ISP C
net
access
net

access
net
regional ISP access
net
access access
net access net
net
Internet structure: a “network of networks”
Tier 1 ISP Tier 1 ISP Google
IXP IXP IXP
Regional ISP Regional ISP

access access access access access access access access


ISP ISP ISP ISP ISP ISP ISP ISP

At “center”: small # of well-connected large networks


▪ “tier-1” commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national & international coverage
▪ content provider networks (e.g., Google, Facebook): private network that connects its
data centers to Internet, often bypassing tier-1, regional ISPs
Tier-1 ISP Network map: Sprint (2019)

POP: point-of-presence
to/from other Sprint PoPS
links to peering
networks


… … …
links to/from Sprint customer networks

You might also like