Application Layer: FTP & DNS
Download
Report
Transcript Application Layer: FTP & DNS
CPSC 441: Review (W06)
Instructor: Dr. Anirban Mahanti
Office: ICT 745
Email: [email protected]
Date: April 12, 2006
Text Book
“Computer Networking: A Top Down Approach
Featuring the Internet”, 3rd edition, Jim Kurose
and Keith Ross Addison-Wesley, 2005.
CPSC 441: Review
1
Outline
Introduction
Applications
Transport Layer
Network Layer
LANs and WLANs
Multimedia Networking
Questions
CPSC 441: Review
2
Reference Models
OSI model: 7-layer model; application,
presentation, session, transport, network,
data link, and physical.
TCP/IP model: 4-layers; application,
transport, Internet, and Host-to-Network.
Internet Protocol Stack – a hybrid of
TCP/IP and OSI reference models
CPSC 441: Review
3
Layers and Protocols?
Layered network architecture … why?
Reduces design complexity
The purpose of a layer?
Layer-N peers converse with each other using
protocols; each layer provides functionality to
the a higher layer;
Protocols?
A set of rules governing the format and
meaning of messages exchanges by peer
entities within a layer
CPSC 441: Review
4
Protocols, Layers, and PDU’s
Protocol
HTTP, FTP
TCP, UDP
ICMP, IP
PPP, Ethernet,
IEEE 802.11
Layer
Application layer
Transport layer
Network layer
Data link layer
PDU
message
segment
datagram
frame
Assuming the Internet Protocol Stack.
CPSC 441: Review
5
More on Layers and Protocols
Protocol
HTTP, FTP
TCP, UDP
ICMP, IP
PPP, Ethernet,
IEEE 802.11
Layer
Application
Transport
Network
Data Link
Imm. Lower Layer
Transport
Network
Data Link
Physical
Assuming the Internet Protocol Stack.
CPSC 441: Review
6
Internetworks
A collection of interconnected networks is
called an “internetwork” or an “internet”.
Internet is one example of a really big
internetwork.
Internet structure: Tier-1 ISPs, Tier-2
ISPs, Tier-3 ISPs, NAP, POP, etc.
CPSC 441: Review
7
Network Core
Packet switching – a technique for
transmission of packets that allows
multiple end systems to share a “route”
Virtual circuit vs. datagram networks
Circuit switching – a technique that
requires end-to-end resource reservation
for a “call”
TDMA, FDMA
Circuit vs. Message vs. Packet Switching
CPSC 441: Review
8
Delay/Loss in Packet Switched
Networks
Queuing delay and packet loss
Transmission delay
Propagation delay
CPSC 441: Review
9
Outline
Introduction
Applications
Transport Layer
Network Layer
LANs and WLANs
Multimedia Networking
Questions
CPSC 441: Review
10
Application Layer
Processes communicating across networks
What is HTTP?
Hypertext Transfer Protocol – the Web’s
application layer protocol
HTTP 1.0, HTTP 1.1
Pipelined – requests sent as soon as it is
encountered
Persistent – multiple objects can be sent over a
single TCP connection between the server and
the client
CPSC 441: Review
11
HTTP Continued …
HTTP headers
How is the end of an object determined in
HTTP/1.1?
HTTP methods
GET,
HEAD, POST, PUT …
HTTP response codes
1xx, 2xx, 3xx, 4xx, 5xx
CPSC 441: Review
12
The World Wide Web
What is a Web Proxy?
What is a caching hierarchy?
Caching issues –
Cache consistency issues
• The “conditional HTTP GET” request
Cache replacement issues
Prefetching
Cookies – a means to maintain state in
stateless HTTP servers
CPSC 441: Review
13
DNS: Domain Name System
Internet hosts:
IP address (32 bit) - used for addressing
datagrams
“name”, e.g., ww.yahoo.com - used by humans
DNS: provides translation between host
name and IP address
distributed database implemented in hierarchy
of many name servers
Distributed for scalability & reliability
CPSC 441: Review
14
DNS Services
Hostname to IP address translation
Host aliasing
Canonical and alias names
Mail server aliasing
Load distribution
Replicated Web servers: set of IP addresses
for one canonical name
CPSC 441: Review
15
DNS Infrastructure
2
Host at cis.poly.edu
wants IP address for
gaia.cs.umass.edu
Infrastructure:
Client resolver
Local DNS server
Authoritative DNS
Server
Root DNS Server
Top-Level Domain
DNS Server
root DNS server
3
TLD DNS server
4
5
local DNS server
dns.poly.edu
1
8
requesting host
7
6
authoritative DNS server
dns.cs.umass.edu
cis.poly.edu
gaia.cs.umass.edu
CPSC 441: Review
16
Electronic Mail
outgoing
message queue
user mailbox
Three major
components:
user agents
e.g., Eudora, Outlook,
Pine, Netscape
Messenger
mail servers
Incoming, outgoing
messages
Push protocol –SMTP
Pull protocol – HTTP,
IMAP, POP3
user
agent
mail
server
SMTP
SMTP
mail
server
user
agent
SMTP
user
agent
mail
server
user
agent
user
agent
user
agent
CPSC 441: Review
17
Outline
Introduction
Applications
Transport Layer
Network Layer
LANs and WLANs
Multimedia Networking
Questions
CPSC 441: Review
18
Transport Layer
Logical end-to-end communication between
processes running on different end
systems
Multiplexing/de-multiplexing
Service models: UDP vs. TCP
UDP provides multiplexing/de-multiplexing
In addition to the above, TCP provides flow
control, congestion control, and reliable data
delivery
Some applications use UDP, while some use TCP.
Why?
CPSC 441: Review
19
Reliable Delivery Concepts
GBN, SR – also called “stop-and-wait”
protocols
ACK, NAK, SACK?
Performance of “stop-and-wait”
Pipelining
Similarity/differences between TCP and
the above protocols
CPSC 441: Review
20
TCP segment structure (1/2)
32 bits
URG: urgent data
(generally not used)
ACK: ACK #
valid
PSH: push data now
(generally not used)
RST, SYN, FIN:
connection estab
(setup, teardown
commands)
Internet
checksum
(as in UDP)
source port #
dest port #
sequence number
acknowledgement number
head not
UA P R S F
len used
checksum
Receive window
Urg data pnter
Options (variable length)
counting
by bytes
of data
(not segments!)
# bytes
rcvr willing
to accept
application
data
(variable length)
CPSC 441: Review
21
TCP Segment Structure (2/2)
Sequence and acknowledgement numbering
TTL
Checksum – compulsory in TCP but not in
UDP
Handshaking procedures during TCP
connection set-up and connection
termination
SYN,
FIN, RST fields
CPSC 441: Review
22
TCP Flow Control
receive side of TCP
connection has a
receive buffer:
flow control
sender won’t overflow
receiver’s buffer by
transmitting too much,
too fast
speed-matching
app process may be
service: matching the
send rate to the
receiving app’s drain
rate
slow at reading from
buffer
CPSC 441: Review
23
TCP Connection Establishment
client
CLOSED
Passive open
SYN/SYN+ACK
server
Active open;
SYN
LISTEN
SYN_SENT
SYN_RCVD
SYN+ACK/ACK
ACK
Established
Solid line for client
Dashed line for server
CPSC 441: Review
24
TCP Connection Termination
client
server
closing
FIN_WAIT1
CLOSE_WAIT
TIME_WAIT
CLOSED
timed wait
FIN_WAIT2
LAST_ACK
CLOSED
CPSC 441: Review
25
Principles of Congestion Control
Congestion: informally: “too many sources
sending too much data too fast for network to
handle”
Different from flow control!
Manifestations:
Packet loss (buffer overflow at routers)
Increased end-to-end delays (queuing in router buffers)
Results in unfairness and poor utilization of
network resources
Resources used by dropped packets (before they were
lost)
Retransmissions
Poor resource allocation at high load
CPSC 441: Review
26
Congestion Control: Approaches
Goal: Throttle senders as needed to ensure
load on the network is “reasonable”
End-end congestion control:
no
explicit feedback from network
congestion inferred from end-system
observed loss, delay
approach taken by TCP
Network-assisted congestion control:
routers
provide feedback to end systems
single bit indicating congestion (e.g., ECN)
explicit rate sender should send at
CPSC 441: Review
27
TCP Congestion Control: Overview
end-end control (no network assistance)
Limit the number of packets in the network to
window W
Roughly,
rate =
W
RTT
Bytes/sec
W is dynamic, function of perceived network
congestion
CPSC 441: Review
28
TCP Congestion Controls
Tahoe (Jacobson 1988)
Slow
Start
Congestion Avoidance
Fast Retransmit
Reno (Jacobson 1990)
Fast Recovery
CPSC 441: Review
29
TCP Tahoe
Basic ideas
Gently
probe network for spare capacity
Drastically reduce rate on congestion
Windowing: self-clocking
Other functions: round trip time estimation,
error recovery
for every ACK {
if (W < ssthresh) then W++
else
W += 1/W
}
for every loss {
ssthresh = W/2
W =1
}
(SS)
(CA)
CPSC 441: Review
30
TCP Reno: Fast Recovery
Objective: prevent `pipe’ from emptying
after fast retransmit
each
dup ACK represents a packet having left
the pipe (successfully received)
Let’s enter the “FR/FR” mode on 3 dup ACKs
ssthresh W/2
retransmit lost packet
W ssthresh + ndup (window inflation)
Wait till W is large enough; transmit new packet(s)
On non-dup ACK (1 RTT later)
W ssthresh (window deflation)
enter CA mode
CPSC 441: Review
31
TCP Reno: Summary
Fast Recovery along with Fast Retransmit
used to avoid slow start
On 3 duplicate ACKs
Fast retransmit and fast recovery
On timeout
Fast retransmit and slow start
CPSC 441: Review
32
TCP Reno Throughput
Average throughout: .75 W/RTT
Throughput in terms of loss rate:
1.22 MSS
RTT L
What happens if L->0?
Does link capacity matter if we experience
random loss?
High-speed TCP?
CPSC 441: Review
33
Outline
Introduction
Applications
Transport Layer
Network Layer
LANs and WLANs
Multimedia Networking
Questions
CPSC 441: Review
34
Network Layer
Transport segment from sending to
receiving host
Network layer protocols in every host,
router [contrast with transport/application
layer]
Main functions of network layer
Forwarding – moving datagrams within a router
Routing – determine end-to-end paths taken by
packets
CPSC 441: Review
35
IP datagram format
IP protocol version
number
header length
(bytes)
“type” of data
max number
remaining hops
(decremented at
each router)
upper layer protocol
to deliver payload to
how much overhead
with TCP?
20 bytes of TCP
20 bytes of IP
= 40 bytes + app
layer overhead
32 bits
type of
ver head.
len service
length
fragment
16-bit identifier flgs
offset
upper
time to
Internet
layer
live
checksum
total datagram
length (bytes)
for
fragmentation/
reassembly
32 bit source IP address
32 bit destination IP address
Options (if any)
data
(variable length,
typically a TCP
or UDP segment)
E.g. timestamp,
record route
taken, specify
list of routers
to visit.
CPSC 441: Review
36
IPv4 Addressing
IP address: 32-bit
identifier for host,
router interface
interface: connection
between host/router
and physical link
router’s typically have
multiple interfaces
host may have multiple
interfaces
IP addresses
associated with each
interface
223.1.1.1
223.1.2.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.9
223.1.3.27
223.1.2.2
223.1.3.2
223.1.3.1
223.1.1.1 = 11011111 00000001 00000001 00000001
223
1
1
CPSC 441: Review
1
37
Classful Addressing
Network
Addresses consists of:
Network part
Host part
IP addresses divided into five
classes: A, B, C, D, and E.
Problems ??
110
Network
(21 bits)
Host
(8bits)
Host (24 bits)
0 (7 bits)
Class A
1 0 Network
(14 bits)
Host
(16bits)
Class B
1110
Multicast address
Class D
Class C
1111
Future use addresses
Class E
CPSC 441: Review
38
Subnets: Motivation
The “classful” addressing scheme proposes
that the network portion of a IP address
uniquely identifies one physical network.
Any network with more than 255 hosts needs a
class B address. Class B addresses can get
exhausted before we have 4 billion hosts!
Take bits from the host number part to
create a “subnet” number.
CPSC 441: Review
39
Addressing in the Internet
CIDR: Classless InterDomain Routing
subnet portion of address of arbitrary length
address format: a.b.c.d/x, where x is # bits in
subnet portion of address
Before CIDR, Internet used a class-based
addressing scheme where x could be 8, 16, or 24
bits. These corrsp to classes A, B, and C resp.
subnet
part
host
part
11001000 00010111 00010000 00000000
200.23.16.0/23
CPSC 441: Review
40
NAT: Network Address Translation
rest of
Internet
local network
(e.g., home network)
10.0.0/24
10.0.0.4
10.0.0.1
10.0.0.2
138.76.29.7
10.0.0.3
All datagrams leaving local
network have same single source
NAT IP address: 138.76.29.7,
different source port numbers
Datagrams with source or
destination in this network
have 10.0.0/24 address for
source, destination (as usual)
CPSC 441: Review
41
Routing Algorithm Classification
1. Global, decentralized ?
2. Static, dynamic?
Global:
all routers have complete
topology, link cost info
“link state” algorithms
Decentralized:
router knows about
physically-connected
neighbors
Iterative, distributed
computations
“distance vector” algorithms
Static:
routes change slowly over
time
Dynamic:
routes change more quickly
periodic update
in response to link cost
changes
3. Load sensitivity?
Many Internet routing
algos are load
insensitive
CPSC 441: Review
42
Why Hierarchical Routing?
scale: with 200 million destinations:
can’t store all dest’s in routing tables!
routing table exchange would swamp links!
administrative autonomy
internet = network of networks
each network admin may want to control routing in its own
network
CPSC 441: Review
43
Hierarchical Routing
aggregate routers into
regions, “autonomous
systems” (AS)
routers in same AS run
same routing protocol
“intra-AS” routing
protocol
routers in different AS
can run different intraAS routing protocol
Gateway router
Direct link to router in
another AS
Establishes a “peering”
relationship
Peers run an “inter-AS
routing” protocol
CPSC 441: Review
44
Interconnected ASes
3c
3a
3b
AS3
1a
2a
1c
1d
1b
Intra-AS
Routing
algorithm
2c
AS2
AS1
Inter-AS
Routing
algorithm
Forwarding
table
2b
Forwarding table is
configured by both
intra- and inter-AS
routing algorithm
Intra-AS sets entries
for internal dests
Inter-AS & Intra-As
sets entries for
external dests
CPSC 441: Review
45
Outline
Introduction
Applications
Transport Layer
Network Layer
LANs and WLANs
Multimedia Networking
Questions
CPSC 441: Review
46
Link Layer: Introduction
Some terminology:
“link”
hosts and routers are nodes
communication channels that
connect adjacent nodes along
communication path are links
wired links
wireless links
LANs
layer-2 packet is a frame,
encapsulates datagram
data-link layer has responsibility of
transferring datagram from one node
to adjacent node over a link
CPSC 441: Review
47
ARP: Address Resolution Protocol
Question: how to determine
MAC address of B
knowing B’s IP address?
237.196.7.78
1A-2F-BB-76-09-AD
237.196.7.23
Each IP node (Host,
Router) on LAN has
ARP table
ARP Table: IP/MAC
address mappings for
some LAN nodes
237.196.7.14
LAN
71-65-F7-2B-08-53
237.196.7.88
< IP address; MAC address; TTL>
58-23-D7-FA-20-B0
TTL (Time To Live): time
after which address
mapping will be forgotten
(typically 20 min)
0C-C4-11-6F-E3-98
CPSC 441: Review
48
Multiple Access Links and Protocols
Two types of “links”:
point-to-point
PPP for dial-up access
point-to-point link between Ethernet switch and host
broadcast (shared wire or medium)
traditional Ethernet
upstream HFC
802.11 wireless LAN
CPSC 441: Review
49
Taxonomy of Multiple Access Control Protocols
Three broad classes:
Channel Partitioning
divide channel into smaller “pieces” (TDM, FDM,
Code Division Multiple Access)
allocate piece to node for exclusive use
Random Access
channel not divided, allow collisions
“recover” from collisions
“Taking turns”
Nodes take turns, but nodes with more to send
can take longer turns
CPSC 441: Review
50
Random Access Protocols
When node has packet to send
transmit at full channel data rate R.
no a priori coordination among nodes
two or more transmitting nodes ➜ “collision”,
random access MAC protocol specifies:
how to detect collisions
how to recover from collisions (e.g., via delayed
retransmissions)
Examples of random access MAC protocols:
slotted ALOHA
ALOHA
CSMA, CSMA/CD, CSMA/CA
CPSC 441: Review
51
CSMA/CD (Collision Detection)
CSMA/CD: carrier sensing, deferral as in CSMA
collisions detected within short time
colliding transmissions aborted, reducing channel
wastage
collision detection:
easy in wired LANs: measure signal strengths,
compare transmitted, received signals
difficult in wireless LANs: receiver shut off while
transmitting
CPSC 441: Review
52
Ethernet CSMA/CD algorithm
1. Adaptor receives
4. If adapter detects
datagram from net layer &
another transmission while
creates frame
transmitting, aborts and
sends jam signal
2. If adapter senses channel
idle, it starts to transmit 5. After aborting, adapter
frame. If it senses
enters exponential
channel busy, waits until
backoff: after the mth
channel idle and then
collision, adapter chooses
transmits
a K at random from
{0,1,2,…,2m-1}. Adapter
3. If adapter transmits
waits K·512 bit times and
entire frame without
returns to Step 2
detecting another
transmission, the adapter
is done with frame !
CPSC 441: Review
53
Ethernet’s CSMA/CD (more)
Jam Signal: make sure all
other transmitters are
aware of collision; 48 bits
Bit time: .1 microsec for 10
Mbps Ethernet ;
for K=1023, wait time is
about 50 msec
See/interact with Java
applet on AWL Web site:
highly recommended !
Exponential Backoff:
Goal: adapt retransmission
attempts to estimated
current load
heavy load: random wait
will be longer
first collision: choose K
from {0,1}; delay is K· 512
bit transmission times
after second collision:
choose K from {0,1,2,3}…
after ten collisions, choose
K from {0,1,2,3,4,…,1023}
CPSC 441: Review
54
CSMA/CD efficiency
tprop = max prop between 2 nodes in LAN
ttrans = time to transmit max-size frame
efficiency
1
1 5t prop / ttrans
Efficiency goes to 1 as tprop goes to 0
Goes to 1 as ttrans goes to infinity
Much better than ALOHA, but still decentralized,
simple, and cheap
CPSC 441: Review
55
Switches, Routers, and Hubs
Hubs are physical layer repeaters;
no CSMA/CD at hub
Switch is a link layer store-and-forward device
CSMA/CD at switch
Maintains switch tables, implement filtering, learning algos
Routers are network-layer store-and-forward
devices
maintain routing tables, implement routing algorithms
CPSC 441: Review
56
A network with switch, router, and
hubs
to external
network
mail server
web server
router
switch
IP subnet
hub
hub
hub
CPSC 441: Review
57
Wireless Networking Technologies
Mobile devices – laptop, PDA, cellular
phone, wearable computer, …
Operating modes
Infrastructure mode (Access Point)
Ad hoc mode
Access technology
Bluetooth (1 Mbps, up to 3 meters)
IEEE 802.11 (up to 55 Mbps, 20 – 100 meters)
CPSC 441: Review
58
Infrastructure Mode
network
infrastructure
infrastructure mode
base station connects
mobiles into wired
network
handoff: mobile
changes base station
providing connection
into wired network
CPSC 441: Review
59
Ad hoc Mode
Ad hoc mode
no base stations
nodes can only
transmit to other
nodes within link
coverage
nodes organize
themselves into a
network: route among
themselves
CPSC 441: Review
60
Wireless Network Characteristics
Multiple wireless senders and receivers create
additional problems (beyond multiple access):
C
A
B
A
B
Hidden terminal problem
C
C’s signal
strength
A’s signal
strength
space
B, A hear each other
Signal fading:
A, C can not hear each other
B, C hear each other
B, C hear each other
B, A hear each other
means A, C unaware of their
interference at B
A, C can not hear each other
interfering at B
CPSC 441: Review
61
IEEE 802.11 MAC Protocol: CSMA/CA
802.11 sender
1 if sense channel idle for DIFS then
transmit entire frame (no CD)
2 if sense channel busy then
start random backoff time
timer counts down while channel idle
transmit when timer expires
3 if no ACK, increase random backoff
interval, repeat 2
802.11 receiver
- if frame received OK
sender
receiver
DIFS
data
SIFS
ACK
return ACK after SIFS (ACK needed due
to hidden terminal problem)
CPSC 441: Review
62
Avoiding collisions (more)
idea: allow sender to “reserve” channel rather than random
access of data frames: avoid collisions of long data frames
sender first transmits small request-to-send (RTS) packets
to base station using CSMA
RTSs may still collide with each other (but they’re short)
BS broadcasts clear-to-send CTS in response to RTS
RTS heard by all nodes
sender transmits data frame
other stations defer transmissions
Avoid data frame collisions completely
using small reservation packets!
CPSC 441: Review
63
Collision Avoidance: RTS-CTS exchange
A
AP
B
reservation collision
DATA (A)
defer
time
CPSC 441: Review
64
Mobile IP: Overview
Let routing handle it: routers advertise permanent
not
address of mobile-nodes-in-residence
via usual
scalable
routing table exchange.
to millions of
routing tables indicate
mobiles where each mobile located
no changes to end-systems
let end-systems handle it:
indirect routing: communication from
correspondent to mobile goes through home
agent, then forwarded to remote
direct routing: correspondent gets foreign
address of mobile, sends directly to mobile
CPSC 441: Review
65
Outline
Introduction
Applications
Transport Layer
Network Layer
LANs and WLANs
Multimedia Networking
Questions
CPSC 441: Review
66
MM Networking Applications
Classes of MM
applications:
1) Streaming stored
audio and video
2) Streaming live audio
and video
3) Real-time interactive
audio and video
Jitter is the variability
of packet delays within
the same packet stream
Fundamental
characteristics:
Typically delay
sensitive
end-to-end delay
delay jitter
But loss tolerant:
infrequent losses
cause minor glitches
Antithesis of data
CPSC 441: Review
67
Multimedia Over “Best Effort”
Internet
TCP/UDP/IP: no guarantees on delay, loss
?
?
?
?
?
?
But you said multimedia apps requires ?
QoS and level of performance to be
?
? effective!
?
?
Today’s multimedia applications implement
functionality at the app. layer to mitigate
(as best possible) effects of delay, loss
CPSC 441: Review
68
How to provide better support
for Multimedia? (1/4)
architecture
for providing QOS guarantees in IP
networks for individual flows
Fundamental changes in Internet so that
apps can reserve end-to-end bandwidth
Components of this architecture are
Integrated services philosophy:
Admission control
Reservation protocol
Routing protocol
Classifier and route selection
Packet scheduler
CPSC 441: Review
69
Concerns with Intserv (2/4)
Scalability: signaling, maintaining per-flow router
state difficult with large number of flows
Flexible Service Models: Intserv has only two
classes. Desire “qualitative” service classes
E.g., Courier, xPress, and normal mail
E.g., First, business, and cattle class
Diffserv approach:
simple functions in network core, relatively
complex functions at edge routers (or hosts)
Don’t define define service classes, provide
functional components to build service classes
CPSC 441: Review
70
How to provide better support
for Multimedia? (3/4)
Challenging to stream large
files (e.g., video) from single
origin server in real time
Solution: replicate content
at hundreds of servers
throughout Internet
content downloaded to
CDN servers ahead of
time
placing content “close” to
user avoids impairments
(loss, delay) of sending
content over long paths
CDN server typically in
edge/access network
origin server
in North America
CDN distribution node
CDN server
in S. America CDN server
in Europe
CDN server
in Asia
CPSC 441: Review
71
How to provide better support for
Multimedia? (4/4) Multicast/Broadcast
duplicate
duplicate
creation/transmission
R1
R1
duplicate
R2
R2
R3
R4
(a)
R3
R4
(b)
Source-duplication versus in-network duplication.
(a) source duplication, (b) in-network duplication
CPSC 441: Review
72
Finally … Examination Format
Technical Terms – provide technical terms
that best fit a given definition
E.g., A field in IPv4 that provides for error
detection – Checksum
Some short answer questions
E.g., Compare and contrast datagram networks
and virtual circuit networks.
You need to only write main points
Answer should be as brief as possible
CPSC 441: Review
73
Good Luck and Questions …
CPSC 441: Review
74