SlideShare a Scribd company logo
1 of 64
Download to read offline
Dr. Shavan Askar Application Layer 2-1
Chapter 2
Application Layer+ Addressing
Computer
Networking:ATop
Down Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012All material copyright 1996-2012
J.F Kurose and K.W. Ross, All Rights Reserved
Dr. Shavan Askar Network Layer 4-2
Cable Types
Straight-through cables get their name from how they are made. Out
of the 8 pins that exist on both ends of an Ethernet cable, each pin
connects to the same pin on the opposite side.
Connecting a router to a hub
Connectig a computer to a swtich
Connecting a LAN port to a switch, hub,
or computer
Dr. Shavan Askar Network Layer 4-3
Cable Types
Crossover cables are very similar to straight-through cables,
except that they have pairs of wires that crisscross. This allows
for two devices to communicate at the same time. Unlike
straight-through cables, we use crossover cables to connect like
devices.
Connecting a computer to a router
Connecting a computer to a computer
Connecting a router to a router
Connecting a switch to a switch
Connecting a hub to a hub
Dr. Shavan Askar Network Layer 4-4
Cable Types
Rollover cables, like other cabling types, got their name from how
they are wired. Rollover cables essentially have one end of the
cable wired exactly opposite from the other. This essentially “rolls
over” the wires- but why would we need to do such a thing?
Rollover cables, also called Yost cables, usually connect a device
to a router or switch’s console port. This allows a programmer to
make a connection to the router or switch, and program it as
needed.
Dr. Shavan Askar Application Layer 2-5
Ipconfig displays all current TCP/IP network configuration values
and refreshes Dynamic Host Configuration Protocol (DHCP) and
Domain Name System (DNS) settings. Used without
parameters, ipconfig displays the IP address, subnet mask, and
default gateway for all adapters.
Dr. Shavan Askar Network Layer 4-6
IP addressing: introduction
 IP address: 32-bit
identifier for host, router
interface
 interface: connection
between host/router and
physical link
 router’s typically have
multiple interfaces
 host typically has one or
two interfaces (e.g., wired
Ethernet, wireless 802.11)
 IP addresses associated
with each interface
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
223.1.1.1 = 11011111 00000001 00000001 00000001
223 1 11
Dr. Shavan Askar Network Layer 4-7
IP addressing: introduction
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
A: wired Ethernet interfaces
connected by Ethernet switches
A: wireless WiFi interfaces
connected by WiFi base station
For now: don’t need to worry
about how one interface is
connected to another (with no
intervening router)
Dr. Shavan Askar Network Layer 4-8
Subnets
IP address:
subnet part - high order
bits
host part - low order
bits
what’s a subnet ?
device interfaces with
same subnet part of IP
address
can physically reach
each other without
intervening router network consisting of 3 subnets
223.1.1.1
223.1.1.3
223.1.1.4 223.1.2.9
223.1.3.2223.1.3.1
subnet
223.1.1.2
223.1.3.27
223.1.2.2
223.1.2.1
Dr. Shavan Askar Network Layer 4-9
recipe
 to determine the
subnets, detach each
interface from its host
or router, creating
islands of isolated
networks
 each isolated network
is called a subnet
subnet mask: /24
Subnets
223.1.1.0/24
223.1.2.0/24
223.1.3.0/24
223.1.1.1
223.1.1.3
223.1.1.4 223.1.2.9
223.1.3.2223.1.3.1
subnet
223.1.1.2
223.1.3.27
223.1.2.2
223.1.2.1
Dr. Shavan Askar Network Layer 4-10
how many? 223.1.1.1
223.1.1.3
223.1.1.4
223.1.2.2223.1.2.1
223.1.2.6
223.1.3.2223.1.3.1
223.1.3.27
223.1.1.2
223.1.7.0
223.1.7.1
223.1.8.0223.1.8.1
223.1.9.1
223.1.9.2
Subnets
Dr. Shavan Askar Network Layer 4-11
IP addressing: CIDR
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
11001000 00010111 00010000 00000000
subnet
part
host
part
200.23.16.0/23
Dr. Shavan Askar Network Layer 4-12
IP addresses: how to get one?
Q: How does a host get IP address?
 hard-coded by system admin in a file
 Windows: control-panel->network->configuration-
>tcp/ip->properties
 UNIX: /etc/rc.config
 DHCP: Dynamic Host Configuration Protocol:
dynamically get address from as server
 “plug-and-play”
Dr. Shavan Askar Network Layer 4-13
DHCP: Dynamic Host Configuration Protocol
goal: allow host to dynamically obtain its IP address from network
server when it joins network
 can renew its lease on address in use
 allows reuse of addresses (only hold address while
connected/“on”)
 support for mobile users who want to join network (more
shortly)
DHCP overview:
 host broadcasts “DHCP discover” msg [optional]
 DHCP server responds with “DHCP offer” msg [optional]
 host requests IP address: “DHCP request” msg
 DHCP server sends address: “DHCP ack” msg
Dr. Shavan Askar Network Layer 4-14
DHCP client-server scenario
223.1.1.0/24
223.1.2.0/24
223.1.3.0/24
223.1.1.1
223.1.1.3
223.1.1.4 223.1.2.9
223.1.3.2223.1.3.1
223.1.1.2
223.1.3.27
223.1.2.2
223.1.2.1
DHCP
server
arriving DHCP
client needs
address in this
network
Dr. Shavan Askar Application Layer 2-15
IP Subnetting
 Static Subnetting (Fixed Length Subnet Mask)
 Dynamic subnetting (Variable Length Subnet Mask)
Dr. Shavan Askar Application Layer 2-16
Fixed Subnetting
Example:
An organization is assigned the network number 193.1.1.0/24
and it needs to define six subnets. The largest subnet is
required to support 25 hosts.
Dr. Shavan Askar Application Layer 2-17
Dr. Shavan Askar Application Layer 2-18
Dr. Shavan Askar Application Layer 2-19
Variable Length Subnet Mask VLSM
In real life scenario, some subnets may require large number of host addresses while
other may require only few addresses.
For example, assume that you are a network administrator at a company that has three
departments connected with wan links.
Development department has 74 computers.
Production department has 52 computers.
Administrative department has 28 computers.
All departments are connected with each other via wan link.
Each wan link requires two IP addresses.
Dr. Shavan Askar Application Layer 2-20
Variable Length Subnet Mask VLSM
Given the following IP address; 192.168.85.24/24. Use VLSM to assign IP addresses for
the subnets shown in the Figure below:
Note that subnet A has 25 PCs, subnet B: 50 PCs, subnet C: 10 PCs.
Subnet C
Subnet B
Subnet A
Subnet Network
Address/prefix
Broadcast
Address/prefix
Dr. Shavan Askar Application Layer 2-21
Variable Length Subnet Mask VLSM
Given the following IP address; 192.168.85.24/24. Use VLSM to assign IP addresses for
the subnets shown in the Figure below:
Note that subnet A has 25 PCs, subnet B: 50 PCs, subnet C: 10 PCs.
Start with the largest subnet, subnet B
50 PCs means that we will need 6 bits in the host portion
The last octet will be subnetted as follow:
00 000000
00 111111
192.168.85.0/26
Range of host IP addresses: 192.168.85.1/26 to
192.168.85.62/26
The first IP (192.168.85.0/26) is assigned for subnet address
And the last IP (192.168.85.63/26) is for broadcast address
Dr. Shavan Askar Application Layer 2-22
Variable Length Subnet Mask VLSM
Given the following IP address; 192.168.85.24/24. Use VLSM to assign IP addresses for
the subnets shown in the Figure below:
Note that subnet A has 25 PCs, subnet B: 50 PCs, subnet C: 10 PCs.
Now assign a subnet for Subnet A, 25 PCs
It needs 5 bits in the host portion, so
010 00000
010 11111
Subnet address is 192.168.85.64/27
Subnet C, 10 PCs so it needs 4 bits only
0110 0000
0110 1111
192.168.85.96/28
The link between two routers needs 2 bits,
011100 00
011100 11
Dr. Shavan Askar Application Layer 2-23
Client-server architecture
server:
 always-on host
 permanent IP address
 data centers for scaling
clients:
 communicate with server
 may be intermittently
connected
 may have dynamic IP
addresses
 do not communicate directly
with each other
client/server
Dr. Shavan Askar Application Layer 2-24
Addressing processes
 to receive messages,
process must have identifier
 host device has unique 32-
bit IP address
 Q: does IP address of host
on which process runs
suffice for identifying the
process?
 identifier includes both IP
address and port numbers
associated with process on
host.
 example port numbers:
 HTTP server: 80
 mail server: 25
 to send HTTP message to
gaia.cs.umass.edu web
server:
 IP address: 128.119.245.12
 port number: 80
 more shortly…
 A: no, many processes
can be running on same
host
Dr. Shavan Askar Application Layer 2-25
What transport service does an app need? (refer to 2.1.3 in the Book)
data integrity
 some apps (e.g., file transfer,
web transactions) require
100% reliable data transfer
 other apps (e.g., audio) can
tolerate some loss
timing
 some apps (e.g., Internet
telephony, interactive
games) require low delay
to be “effective”
throughput
 some apps (e.g.,
multimedia) require
minimum amount of
throughput to be
“effective”
 other apps (“elastic apps”)
make use of whatever
throughput they get
security
 encryption, data integrity,
…
Dr. Shavan Askar Application Layer 2-26
Internet transport protocols services
TCP service:
 reliable transport between
sending and receiving
process
 flow control: sender won’t
overwhelm receiver
 congestion control: throttle
sender when network
overloaded
 does not provide: timing,
minimum throughput
guarantee, security
 connection-oriented: setup
required between client and
server processes
UDP service:
 unreliable data transfer
between sending and
receiving process
 does not provide:
reliability, flow control,
congestion control,
timing, throughput
guarantee, security,
orconnection setup,
Q: why bother? Why is
there a UDP?
Dr. Shavan Askar Application Layer 2-27
Web and HTTP
 web page consists of objects
 object can be HTML file, JPEG image, Java applet,
audio file,…
 web page consists of base HTML-file which
includes several referenced objects
 each object is addressable by a URL, e.g.,
www.someschool.edu/someDept/pic.gif
host name path name
Dr. Shavan Askar Application Layer 2-28
HTTP overview
HTTP: hypertext
transfer protocol
 Web’s application layer
protocol
 client/server model
 client: browser that
requests, receives,
(using HTTP protocol)
and “displays” Web
objects
 server: Web server
sends (using HTTP
protocol) objects in
response to requests
PC running
Firefox browser
server
running
Apache Web
server
iphone running
Safari browser
Dr. Shavan Askar Application Layer 2-29
HTTP overview (continued)
uses TCP:
 client initiates TCP
connection (creates
socket) to server, port 80
 server accepts TCP
connection from client
 HTTP messages
(application-layer protocol
messages) exchanged
between browser (HTTP
client) and Web server
(HTTP server)
 TCP connection closed
HTTP is “stateless”
 server maintains no
information about
past client requests
protocols that maintain
“state” are complex!
 past history (state) must be
maintained
 if server/client crashes, their
views of “state” may be
inconsistent, must be
reconciled
aside
Dr. Shavan Askar Application Layer 2-30
HTTP connections
non-persistent HTTP
 at most one object
sent over TCP
connection
 connection then
closed
 downloading multiple
objects required
multiple connections
persistent HTTP
 multiple objects can
be sent over single
TCP connection
between client, server
Dr. Shavan Askar Application Layer 2-31
Non-persistent HTTP
suppose user enters URL:
1a. HTTP client initiates TCP
connection to HTTP server
(process) at
www.someSchool.edu on port
80
2. HTTP client sends HTTP request
message (containing URL) into
TCP connection socket.
Message indicates that client
wants object
someDepartment/home.index
1b. HTTP server at host
www.someSchool.edu waiting
forTCP connection at port 80.
“accepts” connection, notifying
client
3. HTTP server receives request
message, forms response
message containing requested
object, and sends message into
its socket
time
(contains text,
references to 10
jpeg images)
www.someSchool.edu/someDepartment/home.index
Dr. Shavan Askar Application Layer 2-32
Non-persistent HTTP (cont.)
5. HTTP client receives response
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
4. HTTP server closesTCP
connection.
time
Dr. Shavan Askar Application Layer 2-33
Non-persistent HTTP: response time
RTT (definition): time for a
small packet to travel from
client to server and back
HTTP response time:
 one RTT to initiate TCP
connection
 one RTT for HTTP request
and first few bytes of HTTP
response to return
 file transmission time
 non-persistent HTTP
response time =
2RTT+ file transmission
time
time to
transmit
file
initiate TCP
connection
RTT
request
file
RTT
file
received
time time
Dr. Shavan Askar Application Layer 2-34
Persistent HTTP
non-persistent HTTP issues:
 requires 2 RTTs per object
 browsers often open
parallel TCP connections
to fetch referenced objects
persistent HTTP:
 server leaves connection
open after sending
response
 subsequent HTTP
messages between same
client/server sent over
open connection
 as little as one RTT for all
the referenced objects
Dr. Shavan Askar Application Layer 2-35
Web caches (proxy server) 2.2.5
 user sets browser: Web
accesses via cache
 browser sends all HTTP
requests to cache
 object in cache: cache
returns object
 else cache requests
object from origin
server, then returns
object to client
goal: satisfy client request without involving origin server
client
proxy
server
client origin
server
origin
server
Dr. Shavan Askar Application Layer 2-36
More about Web caching
 cache acts as both
client and server
 server for original
requesting client
 client to origin server
 typically cache is
installed by ISP
(university, company,
residential ISP)
why Web caching?
 reduce response time
for client request
 reduce traffic on an
institution’s access link
 Internet dense with
caches: enables “poor”
content providers to
effectively deliver
content (so too does
P2P file sharing)
Dr. Shavan Askar Application Layer 2-37
Caching example:
origin
servers
public
Internet
institutional
network
1 Gbps LAN
1.54 Mbps
access link
assumptions:
 avg object size: 100K bits
 avg request rate from browsers to
origin servers:15/sec
 avg data rate to browsers: 1.50 Mbps
 RTT from institutional router to any
origin server: 2 sec
 access link rate: 1.54 Mbps
consequences:
 LAN utilization: 0.15%
 access link utilization = 99%
 total delay = Internet delay + access
delay + LAN delay
= 2 sec + minutes + usecs
problem!
Dr. Shavan Askar Application Layer 2-38
assumptions:
 avg object size: 100K bits
 avg request rate from browsers to
origin servers:15/sec
 avg data rate to browsers: 1.50 Mbps
 RTT from institutional router to any
origin server: 2 sec
 access link rate: 1.54 Mbps
consequences:
 LAN utilization: 0.15%
 access link utilization = 99%
 total delay = Internet delay + access
delay + LAN delay
= 2 sec + minutes + usecs
Caching example: fatter access link
origin
servers
1.54 Mbps
access link
154 Mbps 154 Mbps
msecs
Cost: increased access link speed (not cheap!)
9.9%
public
Internet
institutional
network
1 Gbps LAN
institutional
network
1 Gbps LAN
Dr. Shavan Askar Application Layer 2-39
Caching example: install local cache
origin
servers
1.54 Mbps
access link
local web
cache
assumptions:
 avg object size: 100K bits
 avg request rate from browsers to
origin servers:15/sec
 avg data rate to browsers: 1.50 Mbps
 RTT from institutional router to any
origin server: 2 sec
 access link rate: 1.54 Mbps
consequences:
 LAN utilization: 0.15%
 access link utilization = 100%
 total delay = Internet delay + access
delay + LAN delay
= 2 sec + minutes + usecs
?
?
How to compute link
utilization, delay?
Cost: web cache (cheap!)
public
Internet
Dr. Shavan Askar Application Layer 2-40
Caching example: install local cache
Calculating access link
utilization, delay with cache:
 suppose cache hit rate is 0.4
 40% requests satisfied at cache,
60% requests satisfied at origin
origin
servers
1.54 Mbps
access link
 access link utilization:
 60% of requests use access link
 data rate to browsers over access link
= 0.6*1.50 Mbps = .9 Mbps
 utilization = 0.9/1.54 = .58
 total delay
 = 0.6 * (delay from origin servers) +0.4
* (delay when satisfied at cache)
 = 0.6 (2.01) + 0.4 (~msecs)
 = ~ 1.2 secs
 less than with 154 Mbps link (and
cheaper too!)
public
Internet
institutional
network
1 Gbps LAN
local web
cache
Dr. Shavan Askar Application Layer 2-41
FTP: the file transfer protocol
file transfer
FTP
server
FTP
user
interface
FTP
client
local file
system
remote file
system
user
at host
 transfer file to/from remote host
 client/server model
 client: side that initiates transfer (either to/from remote)
 server: remote host
 ftp: RFC 959
 ftp server: port 21
Dr. Shavan Askar Application Layer 2-42
FTP: separate control, data connections
 FTP client contacts FTP server
at port 21, using TCP
 client authorized over control
connection
 client browses remote
directory, sends commands
over control connection
 when server receives file
transfer command, server
opens 2nd TCP data
connection (for file) to client
 after transferring one file,
server closes data connection
FTP
client
FTP
server
TCP control connection,
server port 21
TCP data connection,
server port 20
 server opens another TCP
data connection to transfer
another file
 control connection: “out of
band”
 FTP server maintains
“state”: current directory,
earlier authentication
Dr. Shavan Askar Application Layer 2-43
Electronic mail
Three major components:
 user agents
 mail servers
 simple mail transfer
protocol: SMTP
User Agent
 a.k.a. “mail reader”
 composing, editing, reading
mail messages
 e.g., Outlook, Thunderbird,
iPhone mail client
 outgoing, incoming
messages stored on server
user mailbox
outgoing
message queue
mail
server
mail
server
mail
server
SMTP
SMTP
SMTP
user
agent
user
agent
user
agent
user
agent
user
agent
user
agent
Dr. Shavan Askar Application Layer 2-44
Electronic mail: mail servers
mail servers:
 mailbox contains incoming
messages for user
 message queue of outgoing
(to be sent) mail messages
 SMTP protocol between
mail servers to send email
messages
 client: sending mail
server
 “server”: receiving mail
server
mail
server
mail
server
mail
server
SMTP
SMTP
SMTP
user
agent
user
agent
user
agent
user
agent
user
agent
user
agent
Dr. Shavan Askar Application Layer 2-45
user
agent
Scenario: Alice sends message to Bob
1) Alice uses UA to compose
message “to”
bob@someschool.edu
2) Alice’s UA sends message
to her mail server; message
placed in message queue
3) client side of SMTP opens
TCP connection with Bob’s
mail server
4) SMTP client sends Alice’s
message over the TCP
connection
5) Bob’s mail server places the
message in Bob’s mailbox
6) Bob invokes his user agent
to read message
mail
server
mail
server
1
2 3 4
5
6
Alice’s mail server Bob’s mail server
user
agent
Dr. Shavan Askar Application Layer 2-46
Mail access protocols
 SMTP: delivery/storage to receiver’s server
 mail access protocol: retrieval from server
 POP: Post Office Protocol [RFC 1939]: authorization,
download
 IMAP: Internet Mail Access Protocol [RFC 1730]: more
features, including manipulation of stored msgs on
server
 HTTP: gmail, Hotmail, Yahoo! Mail, etc.
sender’s mail
server
SMTP SMTP
mail access
protocol
receiver’s mail
server
(e.g., POP,
IMAP)
user
agent
user
agent
Dr. Shavan Askar Application Layer 2-47
DNS: domain name system
people: many identifiers:
 SSN, name, passport #
Internet hosts, routers:
 IP address (32 bit) -
used for addressing
datagrams
 “name”, e.g.,
www.yahoo.com -
used by humans
Q: how to map between IP
address and name, and
vice versa ?
Domain Name System:
 distributed database
implemented in hierarchy of
many name servers
 application-layer protocol: hosts,
name servers communicate to
resolve names (address/name
translation)
 note: core Internet function,
implemented as application-
layer protocol
 complexity at network’s
“edge”
Dr. Shavan Askar Application Layer 2-48
DNS: services, structure
why not centralize DNS?
 single point of failure
 traffic volume
 distant centralized database
 maintenance
DNS services
 hostname to IP address
translation
 host aliasing
 canonical, alias names
 mail server aliasing
 load distribution
 replicated Web
servers: many IP
addresses correspond
to one name
A: doesn’t scale!
Dr. Shavan Askar Application Layer 2-49
Root DNS Servers
com DNS servers org DNS servers edu DNS servers
poly.edu
DNS servers
umass.edu
DNS servers
yahoo.com
DNS servers
amazon.com
DNS servers
pbs.org
DNS servers
DNS: a distributed, hierarchical database
client wants IP for www.amazon.com; 1st approx:
 client queries root server to find com DNS server
 client queries .com DNS server to get amazon.com DNS server
 client queries amazon.com DNS server to get IP address for
www.amazon.com
… …
Dr. Shavan Askar Application Layer 2-50
TLD, authoritative servers
top-level domain (TLD) servers:
 responsible for com, org, net, edu, aero, jobs, museums,
and all top-level country domains, e.g.: uk, fr, ca, jp
 Network Solutions maintains servers for .com TLD
 Educause for .edu TLD
authoritative DNS servers:
 organization’s own DNS server(s), providing
authoritative hostname to IP mappings for organization’s
named hosts
 can be maintained by organization or service provider
Dr. Shavan Askar Application Layer 2-51
Local DNS name server
 does not strictly belong to hierarchy
 each ISP (residential ISP, company, university) has
one
 also called “default name server”
 when host makes DNS query, query is sent to its
local DNS server
 has local cache of recent name-to-address translation
pairs (but may be out of date!)
 acts as proxy, forwards query into hierarchy
Dr. Shavan Askar Application Layer 2-52
requesting host
cis.poly.edu
gaia.cs.umass.edu
root DNS server
local DNS server
dns.poly.edu
1
2
3
4
5
6
authoritative DNS server
dns.cs.umass.edu
7
8
TLD DNS server
DNS name
resolution example
 host at cis.poly.edu
wants IP address for
gaia.cs.umass.edu
iterated query:
 contacted server
replies with name of
server to contact
 “I don’t know this
name, but ask this
server”
Dr. Shavan Askar Application Layer 2-53
45
6
3
recursive query:
 puts burden of name
resolution on
contacted name
server
 heavy load at upper
levels of hierarchy?
requesting host
cis.poly.edu
gaia.cs.umass.edu
root DNS server
local DNS server
dns.poly.edu
1
2
7
authoritative DNS server
dns.cs.umass.edu
8
DNS name
resolution example
TLD DNS
server
Dr. Shavan Askar Application Layer 2-54
DNS records
DNS: distributed db storing resource records (RR)
type=NS
 name is domain (e.g.,
foo.com)
 value is hostname of
authoritative name
server for this domain
RR format: (name, value, type, ttl)
type=A
 name is hostname
 value is IP address
type=CNAME
 name is alias name for some
“canonical” (the real) name
 www.ibm.com is really
servereast.backup2.ibm.com
 value is canonical name
type=MX
 value is name of mailserver
associated with name
Dr. Shavan Askar Application Layer 2-55
Pure P2P architecture
 no always-on server
 arbitrary end systems
directly communicate
 peers are intermittently
connected and change IP
addresses
examples:
 file distribution
(BitTorrent)
 Streaming (KanKan)
 VoIP (Skype)
Dr. Shavan Askar Application Layer 2-56
File distribution: client-server vs P2P
Question: how much time to distribute file (size F) from
one server to N peers?
 peer upload/download capacity is limited resource
us
uN
dN
server
network (with abundant
bandwidth)
file, size F
us: server upload
capacity
ui: peer i upload
capacity
di: peer i download
capacityu2 d2
u1 d1
di
ui
Dr. Shavan Askar Application Layer 2-57
File distribution time: client-server
 server transmission: must
sequentially send (upload) N
file copies:
 time to send one copy: F/us
 time to send N copies: NF/us
increases linearly in N
time to distribute F
to N clients using
client-server approach
Dc-s > max{NF/us,,F/dmin}
 client: each client must
download file copy
 dmin = min client download rate
 min client download time: F/dmin
us
network
di
ui
F
Dr. Shavan Askar Application Layer 2-58
File distribution time: P2P
 server transmission: must
upload at least one copy
 time to send one copy: F/us
time to distribute F
to N clients using
P2P approach
us
network
di
ui
F
DP2P > max{F/us,,F/dmin,,NF/(us + Sui)}
 client: each client must
download file copy
 min client download time: F/dmin
 clients: as aggregate must download NF bits
 max upload rate (limting max download rate) is us + Sui
… but so does this, as each peer brings service capacity
increases linearly in N …
Dr. Shavan Askar Application Layer 2-59
P2P file distribution: BitTorrent
tracker: tracks peers
participating in torrent
torrent: group of peers
exchanging chunks of a file
Alice arrives …
 file divided into 256Kb chunks
 peers in torrent send/receive file chunks
… obtains list
of peers from tracker
… and begins exchanging
file chunks with peers in torrent
churn: peers may come and go
Assign keys to peers
 rule: assign key to the peer that has the
closest ID.
 convention in lecture: closest is the
immediate successor of the key.
 e.g., n=4; peers: 1,3,4,5,8,10,12,14;
 key = 13, then successor peer = 14
 key = 15, then successor peer = 1
Application 2-60
Dr. Shavan Askar Application Layer 60
1
3
4
5
8
10
12
15
Circular DHT (1)
 each peer only aware of immediate successor and
predecessor.
 “overlay network”
Application 2-61
Dr. Shavan Askar Application Layer 61
0001
0011
0100
0101
1000
1010
1100
1111
Who’s responsible
for key 1110 ?
I am
O(N) messages
on avgerage to resolve
query, when there
are N peers
1110
1110
1110
1110
1110
1110
Define closest
as closest
successor
Application 2-62
Circular DHT (1)
Dr. Shavan Askar Application Layer 62
Circular DHT with shortcuts
 each peer keeps track of IP addresses of predecessor,
successor, short cuts.
 reduced from 6 to 2 messages.
 possible to design shortcuts so O(log N) neighbors, O(log N)
messages in query
1
3
4
5
8
10
12
15
Who’s responsible
for key 1110?
Application 2-63
Dr. Shavan Askar Application Layer 63
Peer churn
example: peer 5 abruptly leaves
peer 4 detects peer 5 departure; makes 8 its immediate
successor; asks 8 who its immediate successor is; makes
8’s immediate successor its second successor.
what if peer 13 wants to join?
1
3
4
5
8
10
12
15
handling peer churn:
peers may come and go (churn)
each peer knows address of its
two successors
each peer periodically pings its
two successors to check aliveness
if immediate successor leaves,
choose next successor as new
immediate successor
Application 2-64
Dr. Shavan Askar Application Layer 64

More Related Content

What's hot (20)

IP Datagram Structure
IP Datagram StructureIP Datagram Structure
IP Datagram Structure
 
Tcp
TcpTcp
Tcp
 
Unit 6 : Application Layer
Unit 6 : Application LayerUnit 6 : Application Layer
Unit 6 : Application Layer
 
Network layer logical addressing
Network layer logical addressingNetwork layer logical addressing
Network layer logical addressing
 
Chapter 6 - Networking
Chapter 6 - NetworkingChapter 6 - Networking
Chapter 6 - Networking
 
Transport layer
Transport layer Transport layer
Transport layer
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
"Internet Protocol Suite" prepared by Szymon M. from Poland
"Internet Protocol Suite" prepared by Szymon M. from Poland"Internet Protocol Suite" prepared by Szymon M. from Poland
"Internet Protocol Suite" prepared by Szymon M. from Poland
 
Wireshark Lab HTTP, DNS and ARP v7 solution
Wireshark Lab HTTP, DNS and ARP v7 solutionWireshark Lab HTTP, DNS and ARP v7 solution
Wireshark Lab HTTP, DNS and ARP v7 solution
 
Chapter1 intro
Chapter1 introChapter1 intro
Chapter1 intro
 
Lecture 5 internet-protocol_assignments
Lecture 5 internet-protocol_assignmentsLecture 5 internet-protocol_assignments
Lecture 5 internet-protocol_assignments
 
Internet protocols
Internet protocolsInternet protocols
Internet protocols
 
Application Layer and Protocols
Application Layer and ProtocolsApplication Layer and Protocols
Application Layer and Protocols
 
More on Tcp/Ip
More on Tcp/IpMore on Tcp/Ip
More on Tcp/Ip
 
Network protocol
Network protocolNetwork protocol
Network protocol
 
Final networks lab manual
Final networks lab manualFinal networks lab manual
Final networks lab manual
 
IP Routing
IP RoutingIP Routing
IP Routing
 
TCP/IP
TCP/IPTCP/IP
TCP/IP
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
 
Application layer
Application layerApplication layer
Application layer
 

Similar to net work iTM3

IP, DNS and MAC concepts
IP, DNS and MAC conceptsIP, DNS and MAC concepts
IP, DNS and MAC conceptsIrshaad Abdool
 
Lecture 23 DHCP and NAT.pptx
Lecture 23 DHCP and NAT.pptxLecture 23 DHCP and NAT.pptx
Lecture 23 DHCP and NAT.pptxHanzlaNaveed1
 
Computer Networking: A Top-Down Approach
Computer Networking: A Top-Down Approach Computer Networking: A Top-Down Approach
Computer Networking: A Top-Down Approach PolRobinson
 
Training Day Slides
Training Day SlidesTraining Day Slides
Training Day Slidesadam_merritt
 
Zdalna komunikacja sieciowa - zagadnienia sieciowe
Zdalna komunikacja sieciowa - zagadnienia sieciowe Zdalna komunikacja sieciowa - zagadnienia sieciowe
Zdalna komunikacja sieciowa - zagadnienia sieciowe Agnieszka Kuba
 
Ip Addressing Basics
Ip Addressing BasicsIp Addressing Basics
Ip Addressing Basicstmavroidis
 
Networking Basics
Networking Basics Networking Basics
Networking Basics lokeshw24
 
IP Addressing and Subnetting
IP Addressing and SubnettingIP Addressing and Subnetting
IP Addressing and SubnettingAtakan ATAK
 
Rashmi T S-Intrenship PPT.pptx
Rashmi T S-Intrenship PPT.pptxRashmi T S-Intrenship PPT.pptx
Rashmi T S-Intrenship PPT.pptxManojGowdaKb
 
CCNA ppt Day 3
CCNA ppt Day 3CCNA ppt Day 3
CCNA ppt Day 3VISHNU N
 
16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)Jeff Green
 
Chapter_6_ Network Layer.pptx
Chapter_6_ Network Layer.pptxChapter_6_ Network Layer.pptx
Chapter_6_ Network Layer.pptxduotchol
 
MULTIMEDIA COMMUNICATION & NETWORKS
MULTIMEDIA COMMUNICATION & NETWORKSMULTIMEDIA COMMUNICATION & NETWORKS
MULTIMEDIA COMMUNICATION & NETWORKSKathirvel Ayyaswamy
 
Networking
NetworkingNetworking
NetworkingRashmi
 

Similar to net work iTM3 (20)

IP, DNS and MAC concepts
IP, DNS and MAC conceptsIP, DNS and MAC concepts
IP, DNS and MAC concepts
 
Lecture 23 DHCP and NAT.pptx
Lecture 23 DHCP and NAT.pptxLecture 23 DHCP and NAT.pptx
Lecture 23 DHCP and NAT.pptx
 
Computer Networking: A Top-Down Approach
Computer Networking: A Top-Down Approach Computer Networking: A Top-Down Approach
Computer Networking: A Top-Down Approach
 
Training Day Slides
Training Day SlidesTraining Day Slides
Training Day Slides
 
Chapter06
Chapter06Chapter06
Chapter06
 
Zdalna komunikacja sieciowa - zagadnienia sieciowe
Zdalna komunikacja sieciowa - zagadnienia sieciowe Zdalna komunikacja sieciowa - zagadnienia sieciowe
Zdalna komunikacja sieciowa - zagadnienia sieciowe
 
IPAddressing .pptx
IPAddressing .pptxIPAddressing .pptx
IPAddressing .pptx
 
Ip Addressing Basics
Ip Addressing BasicsIp Addressing Basics
Ip Addressing Basics
 
Networking Basics
Networking Basics Networking Basics
Networking Basics
 
ffuyu yguyguyg.pptx
ffuyu yguyguyg.pptxffuyu yguyguyg.pptx
ffuyu yguyguyg.pptx
 
IP Addressing.ppt
IP Addressing.pptIP Addressing.ppt
IP Addressing.ppt
 
15 3
15 315 3
15 3
 
Week6 final
Week6 finalWeek6 final
Week6 final
 
IP Addressing and Subnetting
IP Addressing and SubnettingIP Addressing and Subnetting
IP Addressing and Subnetting
 
Rashmi T S-Intrenship PPT.pptx
Rashmi T S-Intrenship PPT.pptxRashmi T S-Intrenship PPT.pptx
Rashmi T S-Intrenship PPT.pptx
 
CCNA ppt Day 3
CCNA ppt Day 3CCNA ppt Day 3
CCNA ppt Day 3
 
16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)
 
Chapter_6_ Network Layer.pptx
Chapter_6_ Network Layer.pptxChapter_6_ Network Layer.pptx
Chapter_6_ Network Layer.pptx
 
MULTIMEDIA COMMUNICATION & NETWORKS
MULTIMEDIA COMMUNICATION & NETWORKSMULTIMEDIA COMMUNICATION & NETWORKS
MULTIMEDIA COMMUNICATION & NETWORKS
 
Networking
NetworkingNetworking
Networking
 

More from Aram Mohammed

Financial markets and institutions ITM3
Financial markets and institutions ITM3Financial markets and institutions ITM3
Financial markets and institutions ITM3Aram Mohammed
 
Information Technology Fundamentals ITM!
Information Technology  Fundamentals ITM!Information Technology  Fundamentals ITM!
Information Technology Fundamentals ITM!Aram Mohammed
 
Information Technology ITM1
Information Technology  ITM1Information Technology  ITM1
Information Technology ITM1Aram Mohammed
 
Information Technology ITM1
Information Technology  ITM1Information Technology  ITM1
Information Technology ITM1Aram Mohammed
 
Information Technology ITM1
Information Technology ITM1Information Technology ITM1
Information Technology ITM1Aram Mohammed
 
Information Technology ITM1
Information Technology  ITM1Information Technology  ITM1
Information Technology ITM1Aram Mohammed
 
Information Technology IT1
Information Technology  IT1Information Technology  IT1
Information Technology IT1Aram Mohammed
 
Information Technology ITM1
Information Technology ITM1Information Technology ITM1
Information Technology ITM1Aram Mohammed
 
Introduction to financial management ITM3
Introduction to financial management ITM3Introduction to financial management ITM3
Introduction to financial management ITM3Aram Mohammed
 
System analysis ITM3.pptx
System analysis ITM3.pptx System analysis ITM3.pptx
System analysis ITM3.pptx Aram Mohammed
 
System analysis ITM3(1).pptx
System analysis ITM3(1).pptx System analysis ITM3(1).pptx
System analysis ITM3(1).pptx Aram Mohammed
 

More from Aram Mohammed (17)

Web Design EJ3
Web Design EJ3Web Design EJ3
Web Design EJ3
 
Web design EJ3
Web design    EJ3Web design    EJ3
Web design EJ3
 
Financial markets and institutions ITM3
Financial markets and institutions ITM3Financial markets and institutions ITM3
Financial markets and institutions ITM3
 
Java doc Pr ITM2
Java doc Pr ITM2Java doc Pr ITM2
Java doc Pr ITM2
 
Information Technology Fundamentals ITM!
Information Technology  Fundamentals ITM!Information Technology  Fundamentals ITM!
Information Technology Fundamentals ITM!
 
Information Technology ITM1
Information Technology  ITM1Information Technology  ITM1
Information Technology ITM1
 
Information Technology ITM1
Information Technology  ITM1Information Technology  ITM1
Information Technology ITM1
 
Information Technology ITM1
Information Technology ITM1Information Technology ITM1
Information Technology ITM1
 
Information Technology ITM1
Information Technology  ITM1Information Technology  ITM1
Information Technology ITM1
 
Information Technology IT1
Information Technology  IT1Information Technology  IT1
Information Technology IT1
 
Information Technology ITM1
Information Technology ITM1Information Technology ITM1
Information Technology ITM1
 
Introduction to financial management ITM3
Introduction to financial management ITM3Introduction to financial management ITM3
Introduction to financial management ITM3
 
System analysis ITM3.pptx
System analysis ITM3.pptx System analysis ITM3.pptx
System analysis ITM3.pptx
 
E-management ITM3
E-management ITM3E-management ITM3
E-management ITM3
 
E-management ITM3
E-management ITM3E-management ITM3
E-management ITM3
 
System analysis ITM3(1).pptx
System analysis ITM3(1).pptx System analysis ITM3(1).pptx
System analysis ITM3(1).pptx
 
Network(pr)kurdish
Network(pr)kurdishNetwork(pr)kurdish
Network(pr)kurdish
 

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 

net work iTM3

  • 1. Dr. Shavan Askar Application Layer 2-1 Chapter 2 Application Layer+ Addressing Computer Networking:ATop Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012All material copyright 1996-2012 J.F Kurose and K.W. Ross, All Rights Reserved
  • 2. Dr. Shavan Askar Network Layer 4-2 Cable Types Straight-through cables get their name from how they are made. Out of the 8 pins that exist on both ends of an Ethernet cable, each pin connects to the same pin on the opposite side. Connecting a router to a hub Connectig a computer to a swtich Connecting a LAN port to a switch, hub, or computer
  • 3. Dr. Shavan Askar Network Layer 4-3 Cable Types Crossover cables are very similar to straight-through cables, except that they have pairs of wires that crisscross. This allows for two devices to communicate at the same time. Unlike straight-through cables, we use crossover cables to connect like devices. Connecting a computer to a router Connecting a computer to a computer Connecting a router to a router Connecting a switch to a switch Connecting a hub to a hub
  • 4. Dr. Shavan Askar Network Layer 4-4 Cable Types Rollover cables, like other cabling types, got their name from how they are wired. Rollover cables essentially have one end of the cable wired exactly opposite from the other. This essentially “rolls over” the wires- but why would we need to do such a thing? Rollover cables, also called Yost cables, usually connect a device to a router or switch’s console port. This allows a programmer to make a connection to the router or switch, and program it as needed.
  • 5. Dr. Shavan Askar Application Layer 2-5 Ipconfig displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. Used without parameters, ipconfig displays the IP address, subnet mask, and default gateway for all adapters.
  • 6. Dr. Shavan Askar Network Layer 4-6 IP addressing: introduction  IP address: 32-bit identifier for host, router interface  interface: connection between host/router and physical link  router’s typically have multiple interfaces  host typically has one or two interfaces (e.g., wired Ethernet, wireless 802.11)  IP addresses associated with each interface 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2223.1.3.1 223.1.3.27 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 11
  • 7. Dr. Shavan Askar Network Layer 4-7 IP addressing: introduction 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2223.1.3.1 223.1.3.27 A: wired Ethernet interfaces connected by Ethernet switches A: wireless WiFi interfaces connected by WiFi base station For now: don’t need to worry about how one interface is connected to another (with no intervening router)
  • 8. Dr. Shavan Askar Network Layer 4-8 Subnets IP address: subnet part - high order bits host part - low order bits what’s a subnet ? device interfaces with same subnet part of IP address can physically reach each other without intervening router network consisting of 3 subnets 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.2223.1.3.1 subnet 223.1.1.2 223.1.3.27 223.1.2.2 223.1.2.1
  • 9. Dr. Shavan Askar Network Layer 4-9 recipe  to determine the subnets, detach each interface from its host or router, creating islands of isolated networks  each isolated network is called a subnet subnet mask: /24 Subnets 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.2223.1.3.1 subnet 223.1.1.2 223.1.3.27 223.1.2.2 223.1.2.1
  • 10. Dr. Shavan Askar Network Layer 4-10 how many? 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.2223.1.2.1 223.1.2.6 223.1.3.2223.1.3.1 223.1.3.27 223.1.1.2 223.1.7.0 223.1.7.1 223.1.8.0223.1.8.1 223.1.9.1 223.1.9.2 Subnets
  • 11. Dr. Shavan Askar Network Layer 4-11 IP addressing: CIDR 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 11001000 00010111 00010000 00000000 subnet part host part 200.23.16.0/23
  • 12. Dr. Shavan Askar Network Layer 4-12 IP addresses: how to get one? Q: How does a host get IP address?  hard-coded by system admin in a file  Windows: control-panel->network->configuration- >tcp/ip->properties  UNIX: /etc/rc.config  DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server  “plug-and-play”
  • 13. Dr. Shavan Askar Network Layer 4-13 DHCP: Dynamic Host Configuration Protocol goal: allow host to dynamically obtain its IP address from network server when it joins network  can renew its lease on address in use  allows reuse of addresses (only hold address while connected/“on”)  support for mobile users who want to join network (more shortly) DHCP overview:  host broadcasts “DHCP discover” msg [optional]  DHCP server responds with “DHCP offer” msg [optional]  host requests IP address: “DHCP request” msg  DHCP server sends address: “DHCP ack” msg
  • 14. Dr. Shavan Askar Network Layer 4-14 DHCP client-server scenario 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.2223.1.3.1 223.1.1.2 223.1.3.27 223.1.2.2 223.1.2.1 DHCP server arriving DHCP client needs address in this network
  • 15. Dr. Shavan Askar Application Layer 2-15 IP Subnetting  Static Subnetting (Fixed Length Subnet Mask)  Dynamic subnetting (Variable Length Subnet Mask)
  • 16. Dr. Shavan Askar Application Layer 2-16 Fixed Subnetting Example: An organization is assigned the network number 193.1.1.0/24 and it needs to define six subnets. The largest subnet is required to support 25 hosts.
  • 17. Dr. Shavan Askar Application Layer 2-17
  • 18. Dr. Shavan Askar Application Layer 2-18
  • 19. Dr. Shavan Askar Application Layer 2-19 Variable Length Subnet Mask VLSM In real life scenario, some subnets may require large number of host addresses while other may require only few addresses. For example, assume that you are a network administrator at a company that has three departments connected with wan links. Development department has 74 computers. Production department has 52 computers. Administrative department has 28 computers. All departments are connected with each other via wan link. Each wan link requires two IP addresses.
  • 20. Dr. Shavan Askar Application Layer 2-20 Variable Length Subnet Mask VLSM Given the following IP address; 192.168.85.24/24. Use VLSM to assign IP addresses for the subnets shown in the Figure below: Note that subnet A has 25 PCs, subnet B: 50 PCs, subnet C: 10 PCs. Subnet C Subnet B Subnet A Subnet Network Address/prefix Broadcast Address/prefix
  • 21. Dr. Shavan Askar Application Layer 2-21 Variable Length Subnet Mask VLSM Given the following IP address; 192.168.85.24/24. Use VLSM to assign IP addresses for the subnets shown in the Figure below: Note that subnet A has 25 PCs, subnet B: 50 PCs, subnet C: 10 PCs. Start with the largest subnet, subnet B 50 PCs means that we will need 6 bits in the host portion The last octet will be subnetted as follow: 00 000000 00 111111 192.168.85.0/26 Range of host IP addresses: 192.168.85.1/26 to 192.168.85.62/26 The first IP (192.168.85.0/26) is assigned for subnet address And the last IP (192.168.85.63/26) is for broadcast address
  • 22. Dr. Shavan Askar Application Layer 2-22 Variable Length Subnet Mask VLSM Given the following IP address; 192.168.85.24/24. Use VLSM to assign IP addresses for the subnets shown in the Figure below: Note that subnet A has 25 PCs, subnet B: 50 PCs, subnet C: 10 PCs. Now assign a subnet for Subnet A, 25 PCs It needs 5 bits in the host portion, so 010 00000 010 11111 Subnet address is 192.168.85.64/27 Subnet C, 10 PCs so it needs 4 bits only 0110 0000 0110 1111 192.168.85.96/28 The link between two routers needs 2 bits, 011100 00 011100 11
  • 23. Dr. Shavan Askar Application Layer 2-23 Client-server architecture server:  always-on host  permanent IP address  data centers for scaling clients:  communicate with server  may be intermittently connected  may have dynamic IP addresses  do not communicate directly with each other client/server
  • 24. Dr. Shavan Askar Application Layer 2-24 Addressing processes  to receive messages, process must have identifier  host device has unique 32- bit IP address  Q: does IP address of host on which process runs suffice for identifying the process?  identifier includes both IP address and port numbers associated with process on host.  example port numbers:  HTTP server: 80  mail server: 25  to send HTTP message to gaia.cs.umass.edu web server:  IP address: 128.119.245.12  port number: 80  more shortly…  A: no, many processes can be running on same host
  • 25. Dr. Shavan Askar Application Layer 2-25 What transport service does an app need? (refer to 2.1.3 in the Book) data integrity  some apps (e.g., file transfer, web transactions) require 100% reliable data transfer  other apps (e.g., audio) can tolerate some loss timing  some apps (e.g., Internet telephony, interactive games) require low delay to be “effective” throughput  some apps (e.g., multimedia) require minimum amount of throughput to be “effective”  other apps (“elastic apps”) make use of whatever throughput they get security  encryption, data integrity, …
  • 26. Dr. Shavan Askar Application Layer 2-26 Internet transport protocols services TCP service:  reliable transport between sending and receiving process  flow control: sender won’t overwhelm receiver  congestion control: throttle sender when network overloaded  does not provide: timing, minimum throughput guarantee, security  connection-oriented: setup required between client and server processes UDP service:  unreliable data transfer between sending and receiving process  does not provide: reliability, flow control, congestion control, timing, throughput guarantee, security, orconnection setup, Q: why bother? Why is there a UDP?
  • 27. Dr. Shavan Askar Application Layer 2-27 Web and HTTP  web page consists of objects  object can be HTML file, JPEG image, Java applet, audio file,…  web page consists of base HTML-file which includes several referenced objects  each object is addressable by a URL, e.g., www.someschool.edu/someDept/pic.gif host name path name
  • 28. Dr. Shavan Askar Application Layer 2-28 HTTP overview HTTP: hypertext transfer protocol  Web’s application layer protocol  client/server model  client: browser that requests, receives, (using HTTP protocol) and “displays” Web objects  server: Web server sends (using HTTP protocol) objects in response to requests PC running Firefox browser server running Apache Web server iphone running Safari browser
  • 29. Dr. Shavan Askar Application Layer 2-29 HTTP overview (continued) uses TCP:  client initiates TCP connection (creates socket) to server, port 80  server accepts TCP connection from client  HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server)  TCP connection closed HTTP is “stateless”  server maintains no information about past client requests protocols that maintain “state” are complex!  past history (state) must be maintained  if server/client crashes, their views of “state” may be inconsistent, must be reconciled aside
  • 30. Dr. Shavan Askar Application Layer 2-30 HTTP connections non-persistent HTTP  at most one object sent over TCP connection  connection then closed  downloading multiple objects required multiple connections persistent HTTP  multiple objects can be sent over single TCP connection between client, server
  • 31. Dr. Shavan Askar Application Layer 2-31 Non-persistent HTTP suppose user enters URL: 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index 1b. HTTP server at host www.someSchool.edu waiting forTCP connection at port 80. “accepts” connection, notifying client 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time (contains text, references to 10 jpeg images) www.someSchool.edu/someDepartment/home.index
  • 32. Dr. Shavan Askar Application Layer 2-32 Non-persistent HTTP (cont.) 5. HTTP client receives response 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 4. HTTP server closesTCP connection. time
  • 33. Dr. Shavan Askar Application Layer 2-33 Non-persistent HTTP: response time RTT (definition): time for a small packet to travel from client to server and back HTTP response time:  one RTT to initiate TCP connection  one RTT for HTTP request and first few bytes of HTTP response to return  file transmission time  non-persistent HTTP response time = 2RTT+ file transmission time time to transmit file initiate TCP connection RTT request file RTT file received time time
  • 34. Dr. Shavan Askar Application Layer 2-34 Persistent HTTP non-persistent HTTP issues:  requires 2 RTTs per object  browsers often open parallel TCP connections to fetch referenced objects persistent HTTP:  server leaves connection open after sending response  subsequent HTTP messages between same client/server sent over open connection  as little as one RTT for all the referenced objects
  • 35. Dr. Shavan Askar Application Layer 2-35 Web caches (proxy server) 2.2.5  user sets browser: Web accesses via cache  browser sends all HTTP requests to cache  object in cache: cache returns object  else cache requests object from origin server, then returns object to client goal: satisfy client request without involving origin server client proxy server client origin server origin server
  • 36. Dr. Shavan Askar Application Layer 2-36 More about Web caching  cache acts as both client and server  server for original requesting client  client to origin server  typically cache is installed by ISP (university, company, residential ISP) why Web caching?  reduce response time for client request  reduce traffic on an institution’s access link  Internet dense with caches: enables “poor” content providers to effectively deliver content (so too does P2P file sharing)
  • 37. Dr. Shavan Askar Application Layer 2-37 Caching example: origin servers public Internet institutional network 1 Gbps LAN 1.54 Mbps access link assumptions:  avg object size: 100K bits  avg request rate from browsers to origin servers:15/sec  avg data rate to browsers: 1.50 Mbps  RTT from institutional router to any origin server: 2 sec  access link rate: 1.54 Mbps consequences:  LAN utilization: 0.15%  access link utilization = 99%  total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + usecs problem!
  • 38. Dr. Shavan Askar Application Layer 2-38 assumptions:  avg object size: 100K bits  avg request rate from browsers to origin servers:15/sec  avg data rate to browsers: 1.50 Mbps  RTT from institutional router to any origin server: 2 sec  access link rate: 1.54 Mbps consequences:  LAN utilization: 0.15%  access link utilization = 99%  total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + usecs Caching example: fatter access link origin servers 1.54 Mbps access link 154 Mbps 154 Mbps msecs Cost: increased access link speed (not cheap!) 9.9% public Internet institutional network 1 Gbps LAN
  • 39. institutional network 1 Gbps LAN Dr. Shavan Askar Application Layer 2-39 Caching example: install local cache origin servers 1.54 Mbps access link local web cache assumptions:  avg object size: 100K bits  avg request rate from browsers to origin servers:15/sec  avg data rate to browsers: 1.50 Mbps  RTT from institutional router to any origin server: 2 sec  access link rate: 1.54 Mbps consequences:  LAN utilization: 0.15%  access link utilization = 100%  total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + usecs ? ? How to compute link utilization, delay? Cost: web cache (cheap!) public Internet
  • 40. Dr. Shavan Askar Application Layer 2-40 Caching example: install local cache Calculating access link utilization, delay with cache:  suppose cache hit rate is 0.4  40% requests satisfied at cache, 60% requests satisfied at origin origin servers 1.54 Mbps access link  access link utilization:  60% of requests use access link  data rate to browsers over access link = 0.6*1.50 Mbps = .9 Mbps  utilization = 0.9/1.54 = .58  total delay  = 0.6 * (delay from origin servers) +0.4 * (delay when satisfied at cache)  = 0.6 (2.01) + 0.4 (~msecs)  = ~ 1.2 secs  less than with 154 Mbps link (and cheaper too!) public Internet institutional network 1 Gbps LAN local web cache
  • 41. Dr. Shavan Askar Application Layer 2-41 FTP: the file transfer protocol file transfer FTP server FTP user interface FTP client local file system remote file system user at host  transfer file to/from remote host  client/server model  client: side that initiates transfer (either to/from remote)  server: remote host  ftp: RFC 959  ftp server: port 21
  • 42. Dr. Shavan Askar Application Layer 2-42 FTP: separate control, data connections  FTP client contacts FTP server at port 21, using TCP  client authorized over control connection  client browses remote directory, sends commands over control connection  when server receives file transfer command, server opens 2nd TCP data connection (for file) to client  after transferring one file, server closes data connection FTP client FTP server TCP control connection, server port 21 TCP data connection, server port 20  server opens another TCP data connection to transfer another file  control connection: “out of band”  FTP server maintains “state”: current directory, earlier authentication
  • 43. Dr. Shavan Askar Application Layer 2-43 Electronic mail Three major components:  user agents  mail servers  simple mail transfer protocol: SMTP User Agent  a.k.a. “mail reader”  composing, editing, reading mail messages  e.g., Outlook, Thunderbird, iPhone mail client  outgoing, incoming messages stored on server user mailbox outgoing message queue mail server mail server mail server SMTP SMTP SMTP user agent user agent user agent user agent user agent user agent
  • 44. Dr. Shavan Askar Application Layer 2-44 Electronic mail: mail servers mail servers:  mailbox contains incoming messages for user  message queue of outgoing (to be sent) mail messages  SMTP protocol between mail servers to send email messages  client: sending mail server  “server”: receiving mail server mail server mail server mail server SMTP SMTP SMTP user agent user agent user agent user agent user agent user agent
  • 45. Dr. Shavan Askar Application Layer 2-45 user agent Scenario: Alice sends message to Bob 1) Alice uses UA to compose message “to” bob@someschool.edu 2) Alice’s UA sends message to her mail server; message placed in message queue 3) client side of SMTP opens TCP connection with Bob’s mail server 4) SMTP client sends Alice’s message over the TCP connection 5) Bob’s mail server places the message in Bob’s mailbox 6) Bob invokes his user agent to read message mail server mail server 1 2 3 4 5 6 Alice’s mail server Bob’s mail server user agent
  • 46. Dr. Shavan Askar Application Layer 2-46 Mail access protocols  SMTP: delivery/storage to receiver’s server  mail access protocol: retrieval from server  POP: Post Office Protocol [RFC 1939]: authorization, download  IMAP: Internet Mail Access Protocol [RFC 1730]: more features, including manipulation of stored msgs on server  HTTP: gmail, Hotmail, Yahoo! Mail, etc. sender’s mail server SMTP SMTP mail access protocol receiver’s mail server (e.g., POP, IMAP) user agent user agent
  • 47. Dr. Shavan Askar Application Layer 2-47 DNS: domain name system people: many identifiers:  SSN, name, passport # Internet hosts, routers:  IP address (32 bit) - used for addressing datagrams  “name”, e.g., www.yahoo.com - used by humans Q: how to map between IP address and name, and vice versa ? Domain Name System:  distributed database implemented in hierarchy of many name servers  application-layer protocol: hosts, name servers communicate to resolve names (address/name translation)  note: core Internet function, implemented as application- layer protocol  complexity at network’s “edge”
  • 48. Dr. Shavan Askar Application Layer 2-48 DNS: services, structure why not centralize DNS?  single point of failure  traffic volume  distant centralized database  maintenance DNS services  hostname to IP address translation  host aliasing  canonical, alias names  mail server aliasing  load distribution  replicated Web servers: many IP addresses correspond to one name A: doesn’t scale!
  • 49. Dr. Shavan Askar Application Layer 2-49 Root DNS Servers com DNS servers org DNS servers edu DNS servers poly.edu DNS servers umass.edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers DNS: a distributed, hierarchical database client wants IP for www.amazon.com; 1st approx:  client queries root server to find com DNS server  client queries .com DNS server to get amazon.com DNS server  client queries amazon.com DNS server to get IP address for www.amazon.com … …
  • 50. Dr. Shavan Askar Application Layer 2-50 TLD, authoritative servers top-level domain (TLD) servers:  responsible for com, org, net, edu, aero, jobs, museums, and all top-level country domains, e.g.: uk, fr, ca, jp  Network Solutions maintains servers for .com TLD  Educause for .edu TLD authoritative DNS servers:  organization’s own DNS server(s), providing authoritative hostname to IP mappings for organization’s named hosts  can be maintained by organization or service provider
  • 51. Dr. Shavan Askar Application Layer 2-51 Local DNS name server  does not strictly belong to hierarchy  each ISP (residential ISP, company, university) has one  also called “default name server”  when host makes DNS query, query is sent to its local DNS server  has local cache of recent name-to-address translation pairs (but may be out of date!)  acts as proxy, forwards query into hierarchy
  • 52. Dr. Shavan Askar Application Layer 2-52 requesting host cis.poly.edu gaia.cs.umass.edu root DNS server local DNS server dns.poly.edu 1 2 3 4 5 6 authoritative DNS server dns.cs.umass.edu 7 8 TLD DNS server DNS name resolution example  host at cis.poly.edu wants IP address for gaia.cs.umass.edu iterated query:  contacted server replies with name of server to contact  “I don’t know this name, but ask this server”
  • 53. Dr. Shavan Askar Application Layer 2-53 45 6 3 recursive query:  puts burden of name resolution on contacted name server  heavy load at upper levels of hierarchy? requesting host cis.poly.edu gaia.cs.umass.edu root DNS server local DNS server dns.poly.edu 1 2 7 authoritative DNS server dns.cs.umass.edu 8 DNS name resolution example TLD DNS server
  • 54. Dr. Shavan Askar Application Layer 2-54 DNS records DNS: distributed db storing resource records (RR) type=NS  name is domain (e.g., foo.com)  value is hostname of authoritative name server for this domain RR format: (name, value, type, ttl) type=A  name is hostname  value is IP address type=CNAME  name is alias name for some “canonical” (the real) name  www.ibm.com is really servereast.backup2.ibm.com  value is canonical name type=MX  value is name of mailserver associated with name
  • 55. Dr. Shavan Askar Application Layer 2-55 Pure P2P architecture  no always-on server  arbitrary end systems directly communicate  peers are intermittently connected and change IP addresses examples:  file distribution (BitTorrent)  Streaming (KanKan)  VoIP (Skype)
  • 56. Dr. Shavan Askar Application Layer 2-56 File distribution: client-server vs P2P Question: how much time to distribute file (size F) from one server to N peers?  peer upload/download capacity is limited resource us uN dN server network (with abundant bandwidth) file, size F us: server upload capacity ui: peer i upload capacity di: peer i download capacityu2 d2 u1 d1 di ui
  • 57. Dr. Shavan Askar Application Layer 2-57 File distribution time: client-server  server transmission: must sequentially send (upload) N file copies:  time to send one copy: F/us  time to send N copies: NF/us increases linearly in N time to distribute F to N clients using client-server approach Dc-s > max{NF/us,,F/dmin}  client: each client must download file copy  dmin = min client download rate  min client download time: F/dmin us network di ui F
  • 58. Dr. Shavan Askar Application Layer 2-58 File distribution time: P2P  server transmission: must upload at least one copy  time to send one copy: F/us time to distribute F to N clients using P2P approach us network di ui F DP2P > max{F/us,,F/dmin,,NF/(us + Sui)}  client: each client must download file copy  min client download time: F/dmin  clients: as aggregate must download NF bits  max upload rate (limting max download rate) is us + Sui … but so does this, as each peer brings service capacity increases linearly in N …
  • 59. Dr. Shavan Askar Application Layer 2-59 P2P file distribution: BitTorrent tracker: tracks peers participating in torrent torrent: group of peers exchanging chunks of a file Alice arrives …  file divided into 256Kb chunks  peers in torrent send/receive file chunks … obtains list of peers from tracker … and begins exchanging file chunks with peers in torrent churn: peers may come and go
  • 60. Assign keys to peers  rule: assign key to the peer that has the closest ID.  convention in lecture: closest is the immediate successor of the key.  e.g., n=4; peers: 1,3,4,5,8,10,12,14;  key = 13, then successor peer = 14  key = 15, then successor peer = 1 Application 2-60 Dr. Shavan Askar Application Layer 60
  • 61. 1 3 4 5 8 10 12 15 Circular DHT (1)  each peer only aware of immediate successor and predecessor.  “overlay network” Application 2-61 Dr. Shavan Askar Application Layer 61
  • 62. 0001 0011 0100 0101 1000 1010 1100 1111 Who’s responsible for key 1110 ? I am O(N) messages on avgerage to resolve query, when there are N peers 1110 1110 1110 1110 1110 1110 Define closest as closest successor Application 2-62 Circular DHT (1) Dr. Shavan Askar Application Layer 62
  • 63. Circular DHT with shortcuts  each peer keeps track of IP addresses of predecessor, successor, short cuts.  reduced from 6 to 2 messages.  possible to design shortcuts so O(log N) neighbors, O(log N) messages in query 1 3 4 5 8 10 12 15 Who’s responsible for key 1110? Application 2-63 Dr. Shavan Askar Application Layer 63
  • 64. Peer churn example: peer 5 abruptly leaves peer 4 detects peer 5 departure; makes 8 its immediate successor; asks 8 who its immediate successor is; makes 8’s immediate successor its second successor. what if peer 13 wants to join? 1 3 4 5 8 10 12 15 handling peer churn: peers may come and go (churn) each peer knows address of its two successors each peer periodically pings its two successors to check aliveness if immediate successor leaves, choose next successor as new immediate successor Application 2-64 Dr. Shavan Askar Application Layer 64