Professional Documents
Culture Documents
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Computer Networks Introduction
Instructor
Vishal Gupta
Contact Information
vishalgupta@pilani.bits-pilani.ac.in
COMPUTER NETWORKS
11/5/16
COMPUTER NETWORKS
3
11/5/16
COMPUTER NETWORKS
4
11/5/16
COMPUTER NETWORKS
5
11/5/16
Layered Architecture
Layer
Designer identified which networking functions had
related uses and collected those functions into discrete
groups that became the layers.
The OSI model allows complete interoperability between
otherwise incompatible systems.
The Each layer uses the services of the layer
immediately below it.
COMPUTER NETWORKS
11/5/16
OSI Model
COMPUTER NETWORKS
7
11/5/16
Peer-to-peer Processes
11/5/16
11/5/16
COMPUTER NETWORKS
11/5/16
COMPUTER NETWORKS
10
TCP/IP Hierarchy
Protocols
7th
Application Layer
6th
Presentation Layer
Application Layer
5th
Session Layer
4th
Transport Layer
Transport
Layer
3rd
Network Layer
Network Layer
2nd
Link Layer
1st
Physical Layer
11
Link Layer
Link Layer
: includes device driver and network interface
card
Network Layer
: handles the movement of packets, i.e.
Routing
COMPUTER NETWORKS
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
11/5/16
Transport
Layer : provides a reliable
flow of data between two
B
packets queueing (delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
Introduction 1-12
propagation
B
nodal
processing
queueing
propagation
B
nodal
processing
queueing
Introduction 1-14
Caravan analogy
100 km
ten-car
caravan
toll
booth
cars propagate at
100 km/hr
toll booth takes 12 sec to
service car (transmission
time)
car~bit; caravan ~ packet
Q: How long until caravan
is lined up before 2nd toll
booth?
100 km
toll
booth
time to push entire
caravan through toll
booth onto highway =
12*10 = 120 sec
time for last car to
propagate from 1st to
2nd toll both: 100km/
(100km/hr)= 1 hr
A: 62 minutes
Introduction 1-15
toll
booth
100 km
toll
booth
Packet loss
queue
packet arriving to
full buffer is lost
BITS Pilani, Deemed to be University under Section Introduction
3 of UGC Act,1-17
1956
Throughput
throughput:
link
capacity
that
can carry
server,
server
sendswith
bits pipe
fluid
at rate
file of
F bits
(fluid)
into
pipe
Rs bits/sec
to send to client
Rs bits/sec)
link that
capacity
pipe
can carry
at rate
Rfluid
c bits/sec
Rc bits/sec)
Throughput (more)
Rs
Rc bits/sec
Rc bits/sec
bottleneck link
link on end-end path that constrains end-end throughput
BITS Pilani, Deemed to be University under Section Introduction
3 of UGC Act,1-19
1956
Questions ?
What are different types of delays in Packet Switched Networks ?
Processing Delay
Queuing Delay
Transmission Delay
Propagation Delay
COMPUTER NETWORKS
20
11/5/16
Question
Consider an application that transmits data at a steady rate
(for example, the sender generates an N-bit unit of data every
k time units, where k is small and fixed). Also, when such an
application starts, it will continue running for a relatively long
period of time. With respect to this, discuss on following:
a) Would a packet switched network of a circuit switched
network be more appropriate for this application? Why?
b) Suppose that a packet switched network is used and the only
traffic in this network comes from such application as
described above. Furthermore, assume that the sum of the
application data rates is less that the capacities of each and
every link. Is some form of congestion control needed? Why?
COMPUTER NETWORKS
21
11/5/16
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
B
packets queueing (delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
Introduction 1-23
propagation
B
nodal
processing
queueing
propagation
B
nodal
processing
queueing
Introduction 1-25
Caravan analogy
100 km
ten-car
caravan
toll
booth
cars propagate at
100 km/hr
toll booth takes 12 sec to
service car (transmission
time)
car~bit; caravan ~ packet
Q: How long until caravan
is lined up before 2nd toll
booth?
100 km
toll
booth
time to push entire
caravan through toll
booth onto highway =
12*10 = 120 sec
time for last car to
propagate from 1st to
2nd toll both: 100km/
(100km/hr)= 1 hr
A: 62 minutes
Introduction 1-26
toll
booth
100 km
toll
booth
Queueing delay
Theoretically:
La/R > 1: more work arriving than can be serviced, average delay
infinite!
La/R < 1: Nature of arriving traffic impact queuing delay.
Ideally, traffic intensity = 1
Introduction 1-28
Questions ?
Q.
Out of four types of delays, which one can vary from packet to
packet ??
COMPUTER NETWORKS
29
11/5/16
Packet loss
queue
packet arriving to
full buffer is lost
BITS Pilani, Deemed to be University under Section Introduction
3 of UGC Act,1-30
1956
Throughput
throughput:
link
capacity
that
can carry
server,
server
sendswith
bits pipe
fluid
at rate
file of
F bits
(fluid)
into
pipe
Rs bits/sec
to send to client
Rs bits/sec)
link that
capacity
pipe
can carry
at rate
Rfluid
c bits/sec
Rc bits/sec)
Throughput (more)
Rs
Rc bits/sec
Rc bits/sec
end-end
throughput:
min(Rc,Rs,R/10)
in
practice: Rc
or Rs is often
bottleneck
Rs
Rs
Rs
R
Rc
Rc
Rc
Questions ?
Q. How long does it take a packet of length 1000 bytes to
propagate over a link of distance 2500 Km, propagation speed
2.5x108 m/s, and transmission rate 2 Mbps ? Ignore queuing
and processing delay here.
Propagation delay = (2500 x 1000) / (2.5 x 108) sec = 0.01 sec
Transmission delay = L / R = (1000 x 8) / (2x106) sec = ?
COMPUTER NETWORKS
34
11/5/16
Questions ?
Consider two hosts, A and B, connected by a single link
of rate R bps. Suppose that the two hosts are
separated by m meters, and suppose the propagation
speed along the link is s meters/sec. Host A is to send a
packet of size L bits to Host B.
Express the propagation delay dprop in terms of m and s.
Determine the transmission time of packet, d trans, in terms of L
and R.
Ignoring processing and queuing delays, obtain an expression for
the end-to-end delay.
Suppose Host A begins to transmit the packet at time t = 0. At
time t = dtrans, where is the last bit of the packet?
Suppose dprop is greater than dtrans. At time t = dtrans, where is the
first bit of the packet?
Suppose s = 2.5 x 108, L = 100 bits, and R = 28 kbps. Find the
distance m so that dprop equals dtrans.
COMPUTER NETWORKS
35
11/5/16
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
WWW
HTTP
applicatio
n
transport
network
data link
physical
11/5/16
COMPUTER NETWORKS
applicatio
n
transport
network
data link
physical
applicatio
n
transport
network
data link
physical
38
11/5/16
COMPUTER NETWORKS
host or
server
host or
server
process
controlled by
app developer
process
socket
socket
TCP with
buffers,
variables
Internet
TCP with
buffers,
variables
controlled
by OS
11/5/16
COMPUTER NETWORKS
40
TCP service:
UDP service:
connection-oriented: setup
required between client and
server processes
reliable transport between
sending and receiving process
flow control: sender wont
overwhelm receiver
congestion control: throttle
sender when network
overloaded
does not provide: timing,
minimum bandwidth
guarantees
11/5/16
COMPUTER NETWORKS
Data loss
Bandwidth
Time Sensitive
file transfer
e-mail
Web documents
real-time audio/video
no loss
no loss
no loss
loss-tolerant
no
no
no
yes, 100s msec
stored audio/video
interactive games
instant messaging
loss-tolerant
loss-tolerant
no loss
elastic
elastic
elastic
audio: 5kbps-1Mbps
video:10kbps-5Mbps
same as above
few kbps up
elastic
Application
41
11/5/16
COMPUTER NETWORKS
message syntax:
what fields in
messages & how fields
are delineated
message semantics
meaning of information
in fields
public-domain
protocols:
defined in RFCs
allows for
interoperability
e.g., HTTP, SMTP
proprietary protocols:
e.g., Skype
Application 2-42
43
11/5/16
COMPUTER NETWORKS
HT
TP
req
ue
PC running HTT
st
Pr
Explorer
esp
ons
e
t
es
u
eq
e Server
r
P
ns
T
o
p
running
HT
es
r
Apache Web
TP
T
H
server
Mac running
Navigator
Source: J.F Kurose and K.W. Ross, Third
Edition
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
HTTP
44
11/5/16
COMPUTER NETWORKS
initiate TCP
connection
RTT
request
file
RTT
file
received
time
time to
transmit
file
time
Application 2-45
Persistent HTTP
non-persistent HTTP issues:
requires 2 RTTs per object
OS overhead for each TCP
connection
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
client sends requests as
soon as it encounters a
referenced object
as little as one RTT for all
the referenced objects
Application 2-46
User-Agent: Firefox/3.6.10\r\n
headerAccept: text/html,application/xhtml+xml\r\n
Accept-Language: en-us,en;q=0.5\r\n
linesAccept-Encoding: gzip,deflate\r\n
Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n
carriage return, Keep-Alive: 115\r\n
line feed at start Connection: keep-alive\r\n
\r\n
of line indicates
end of header lines
body
input is uploaded to
server in entity body
URL method:
uses GET method
input is uploaded in
URL field of request
line: www.somesite.com/animalsearch?monkeys&banana
Application 2-49
Method types
HTTP/1.0
GET
POST
HEAD
asks server to leave
requested object out of
response
HTTP/1.1
GET, POST, HEAD
PUT
uploads file in entity
body to path specified
in URL field
DELETE
deletes file specified in
the URL field
Application 2-50
header
lines
data, e.g.,
requested
HTML file
cookie file
ebay 8734
amazon 1678
server
usual http request
msg
usual http response
Amazon server
creates ID
Set-cookie: 1678 1678 for user create
entry
cookie: 1678
cookie: 1678
cookiespecific
action
access
access
backend
database
cookiespecific
action
Application 2-53
Cookies (continued)
aside
Application 2-54
origin
server
Proxy
HT
st
TP
req server reque
H
ue
se
TP
client TTP
st
n
T
o
H
res
esp
r
pon
se
TTP
H
st
e
u
eq
r
se
n
P
T
po
s
HT
e
Pr
T
HT
client
origin
server
Application 2-55
Caching example
origin
servers
assumptions
consequences
public
Internet
1.5 Mbps
access link
institutional
network
10 Mbps LAN
institutional
cache
Application 2-57
origin
servers
public
Internet
10 Mbps
access link
institutional
network
10 Mbps LAN
institutional
cache
Application 2-58
possible solution:
install cache
consequence
public
Internet
1.5 Mbps
access link
institutional
network
10 Mbps LAN
institutional
cache
Application 2-59
Conditional GET
server: response
contains no object if
cached copy is up-todate:
HTTP/1.0 304 Not
Modified
server
cache
HTTP request msg
If-modified-since: <date>
HTTP response
HTTP/1.0
304 Not Modified
object
not
modified
before
<date>
HTTP response
HTTP/1.0 200 OK
<data>
object
modified
after
<date>
Application 2-60
61
11/5/16
COMPUTER NETWORKS
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Application Layer Protocols
1.
2.
3.
FTP
SMTP
DNS
FTP
FTP
user
client
interface
user
at host
63
11/5/16
local file
system
FTP
server
remote file
system
64
11/5/16
COMPUTER NETWORKS
TCP control
connection
port 21
FTP
client
FTP
server
FTP: Review
65
11/5/16
COMPUTER NETWORKS
Electronic Mail
outgoing
message queue
user mailbox
user
agent
mail
server
user
agent
SMTP
User Agent
a.k.a. mail reader
composing, editing, reading
mail messages
e.g., Eudora, Outlook, elm,
Netscape Messenger
outgoing, incoming
messages stored on server
SMTP
mail
server
user
agent
SMTP
user
agent
mail
server
user
agent
user
agent
2: Application Layer
66
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
user
agent
SMTP
SMTP
mail
server
user
agent
SMTP
user
agent
mail
server
2: Application Layer
user
agent
user
agent
67
2: Application Layer
68
1
user
agent
69
11/5/16
mail
server
3
COMPUTER NETWORKS
mail
server
4
user
agent
70
220 hamburger.edu
HELO crepes.fr
250 Hello crepes.fr, pleased to meet you
MAIL FROM: <alice@crepes.fr>
250 alice@crepes.fr... Sender ok
RCPT TO: <bob@hamburger.edu>
250 bob@hamburger.edu ... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Do you like ketchup?
How about pickles?
.
250 Message accepted for delivery
QUIT
221 hamburger.edu closing connection
11/5/16
COMPUTER NETWORKS
user
agent
senders mail
server
user
agent
receivers mail
server
71
11/5/16
COMPUTER NETWORKS
SMTP: Review
Name some GUI user agents ?
SMTP restricts the body of mails of 7-bit ASCII. T/F ?
Can recipients local PC act as a mail server for
himself ?
Can senders user agent send mail directly to the
recipient without sending it to its corresponding
mail server ?
Can recipient use SMTP to pull messages from its
mail server ?
Take an example of GMAIL. Where are the user
agent, mail server, and SMTP in it ??
72
11/5/16
COMPUTER NETWORKS
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Application Layer Protocols
1.
DNS Protocol
Q: map between IP
addresses and
name ?
74
11/5/16
COMPUTER NETWORKS
distributed database
implemented in hierarchy of
many name servers
application-layer protocol
host, routers, name servers
to communicate to resolve
names (address/name
translation)
note: core Internet
function, implemented
as application-layer
protocol
complexity at networks
edge
DNS
DNS services
Hostname to IP
address translation
Host aliasing
Canonical and alias
names
75
11/5/16
COMPUTER NETWORKS
11/5/16
COMPUTER NETWORKS
77
11/5/16
COMPUTER NETWORKS
Example
Host at cis.poly.edu
wants IP address
for
gaia.cs.umass.edu
3
4
5
local DNS server
dns.poly.edu
requesting host
cis.poly.edu
gaia.cs.umass.edu
78
11/5/16
COMPUTER NETWORKS
79
11/5/16
COMPUTER NETWORKS
DNS records
DNS: distributed db storing resource records (RR)
RR format: (name, value, type, ttl)
Type=A
name is hostname
value is IP address
Type=NS
Type=CNAME
80
11/5/16
COMPUTER NETWORKS
msg header
identification: 16 bit #
for query, reply to
query uses same #
flags:
query or reply
recursion desired
recursion available
reply is authoritative
81
11/5/16
COMPUTER NETWORKS
DNS review
82
COMPUTER NETWORKS
DNS review
83
For the same problem in the previous slide, suppose the HTML
file references three very small objects on the same server.
Neglecting transmission times, how much time elapses with:
Non persistent HTTP with no parallel TCP connections ?
Non persistent HTTP with parallel TCP connections ?
Persistent HTTP with pipelining ?
11/5/16
COMPUTER NETWORKS
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Transport Layer
1.
2.
Note: Some of the slides are taken from Kurose and Ross, 3rd edition.
g
lo
network
data link
physical
al
ic
d
en
-e
network
data link
physical
nd
tr
network
data link
physical
o
sp
an
network
data link
physical
rt
provide logical
applicatio
n
communication between
transport
network
app processes running on
data link
physical
different hosts
transport protocols run in
end systems
send side: breaks app
messages into
segments, passes to
network layer
rcv side: reassembles
segments into
messages, passes to
app layer
more than one transport
protocol available to apps
11/5/16
COMPUTER NETWORKS
Internet: TCP and UDP
applicatio
n
transport
network
data link
physical
11/5/16
Household analogy:
12 kids sending letters
to 12 kids
processes = kids
app messages =
letters in envelopes
hosts = houses
transport protocol =
Ann and Bill
network-layer protocol
= postal service
COMPUTER NETWORKS
Internet transport-layer
protocols
reliable, in-order
delivery (TCP)
d
en
network
data link
physical
rt
COMPUTER NETWORKS
network
data link
physical
o
sp
an
delay guarantees
bandwidth guarantees
tr
network
data link
physical
nd
no-frills extension of
best-effort IP
-e
unreliable, unordered
delivery: UDP
11/5/16
network
data link
physical
al
ic
congestion control
flow control
connection setup
network
data link
physical
g
lo
applicatio
n
transport
network
data link
physical
applicatio
n
transport
network
data link
physical
Multiplexing/demultiplexin
g Multiplexing at send host:
Demultiplexing at rcv host:
= process
P4 application
application P3
P1
P1
application
transport
transport
transport
network
network
network
link
link
physical
physical
host 1
11/5/16
P2
link
host 2
COMPUTER NETWORKS
physical
host 3
32 bits
source port #
dest port #
application
data
(message)
COMPUTER NETWORKS
Connectionless
demultiplexing
Create sockets with port
numbers:
11/5/16
IP datagrams with
different source IP
addresses and/or
source port numbers
directed to same
socket
COMPUTER NETWORKS
Connectionless demux
(cont)
DatagramSocket serverSocket = new DatagramSocket(6428);
P2
P1
P1
P3
SP: 6428
DP: 9157
client
IP: A
SP: 9157
DP: 6428
SP: 6428
DP: 5775
server
IP: C
SP: 5775
DP: 6428
Client
IP:B
Connection-oriented demux
TCP socket identified
by 4-tuple:
source IP address
source port number
dest IP address
dest port number
11/5/16
COMPUTER NETWORKS
Connection-oriented demux
(cont)
P1
P4
P5
P2
P6
P1
P3
SP: 5775
DP: 80
S-IP: B
D-IP:C
client
IP: A
11/5/16
SP: 9157
DP: 80
S-IP: A
D-IP:C
server
IP: C
SP: 9157
DP: 80
S-IP: B
D-IP:C
Client
IP:B
COMPUTER NETWORKS
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Connection-oriented demux:
Threaded Web Server
P1
P2
P4
P1
P3
SP: 5775
DP: 80
S-IP: B
D-IP:C
client
IP: A
11/5/16
SP: 9157
DP: 80
S-IP: A
D-IP:C
server
IP: C
SP: 9157
DP: 80
S-IP: B
D-IP:C
Client
IP:B
COMPUTER NETWORKS
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Chapter 3 outline
3.1 Transport-layer
services
3.2 Multiplexing and
demultiplexing
3.3 Connectionless
transport: UDP
3.4 Principles of
reliable data transfer
11/5/16
segment structure
reliable data transfer
flow control
connection
management
3.6 Principles of
congestion control
3.7 TCP congestion
control
COMPUTER NETWORKS
[RFC
768]
UDP: more
DNS
SNMP
reliable transfer over
UDP: add reliability at
application layer
application-specific
error recovery!
11/5/16
32 bits
source port #
dest port #
length
checksum
segment,
including
header
COMPUTER NETWORKS
Application
data
(message)
UDP checksum
Goal: detect errors (e.g., flipped bits) in
transmitted segment
Receiver:
compute checksum of
Sender:
11/5/16
received segment
check if computed
checksum equals
checksum field value:
NO - error detected
YES - no error detected.
But maybe errors
nonetheless? More later
.
COMPUTER NETWORKS
Questions ??
11/5/16
COMPUTER NETWORKS
Questions ??
11/5/16
COMPUTER NETWORKS
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Principals of Reliable Data Transfer
Note: Some of the slides are taken from Kurose and Ross, 3rd
edition.
Transport Layer
3-102
Transport Layer
3-103
Transport Layer
3-104
deliver_data(): called
by rdt to deliver data to
upper
send
side
receive
side
3-105
state
1
event
actions
Transport Layer
state
2
3-106
Rdt1.0:
Wait for
call from
above
rdt_send(data)
packet =
make_pkt(data)
udt_send(packet)
Wait for
call from
below
sender
rdt_rcv(packet)
extract (packet,data)
deliver_data(data)
receiver
Transport Layer
3-107
Transport Layer
3-108
Wait for
ACK or
NAK
receiver
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)
udt_send(sndp
kt)
rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(NAK)
Wait for
call from
below
sender
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
Transport Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
ACK or
NAK
udt_send(sndp
kt)
rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(NAK)
Wait for
call from
below
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
Transport Layer
3-110
ACK or
NAK
udt_send(sndp
kt)
rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(NAK)
Wait for
call from
below
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
Transport Layer
3-111
Handling duplicates:
sender retransmits
current pkt if ACK/NAK
garbled
sender adds sequence
number to each pkt
receiver discards
(doesnt deliver up)
duplicate pkt
stop and wait
Sender sends one packet,
then waits for receiver
response
Transport Layer
3-112
rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isNAK(rcvpkt) )
udt_send(sndpk
t)
Wait for
ACK or
NAK 1
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt)
Wait for
call 1 from
above
rdt_send(data)
sndpkt = make_pkt(1, data,
checksum)
udt_send(sndpkt)
Transport Layer
3-113
extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)
rdt_rcv(rcvpkt) && (corrupt(rcvpkt)
Wait for
1 from
below
rdt_rcv(rcvpkt) &&
not corrupt(rcvpkt) &&
has_seq0(rcvpkt)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)
extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)
Transport Layer
3-114
rdt2.1: discussion
Sender:
seq # added to pkt
two seq. #s (0,1) will
suffice. Why?
must check if received
ACK/NAK corrupted
twice as many states
state must remember
whether current pkt
has 0 or 1 seq. #
Receiver:
must check if received
packet is duplicate
state indicates whether
0 or 1 is expected pkt
seq #
Transport Layer
3-115
Transport Layer
3-116
rdt_rcv(rcvpkt) &&
(corrupt(rcvpkt) ||
has_seq1(rcvpkt))
udt_send(sndpkt)
3-
Wait for
0 from
below
Wait for
ACK
0
sender FSM
fragment
receiver FSM
fragment
( corrupt(rcvpkt) ||
isACK(rcvpkt,1) )
udt_send(sndpkt)
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt,0)
retransmits if no ACK
received in this time
if pkt (or ACK) just delayed
(not lost):
retransmission will be
duplicate, but use of
seq. #s already handles
this
receiver must specify
seq # of pkt being
ACKed
requires countdown timer
Transport Layer
3-118
rdt3.0 sender
rdt_send(data)
sndpkt = make_pkt(0, data, checksum)
udt_send(sndpkt)
start_timer
rdt_rcv(rcvpkt)
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt,1)
rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isACK(rcvpkt,0) )
timeout
udt_send(sndpkt)
start_timer
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt)
&& isACK(rcvpkt,0)
stop_timer
stop_timer
timeout
udt_send(sndpkt)
start_timer
Wait
for
ACK0
Wait for
call 0from
above
rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) ||
isACK(rcvpkt,1) )
Wait
for
ACK1
Wait for
call 1 from
above
rdt_rcv(rcvpkt)
rdt_send(data)
sndpkt = make_pkt(1, data, checksum)
udt_send(sndpkt)
start_timer
Transport Layer
3-119
rdt3.0 in action
Transport Layer
3-120
rdt3.0 in action
Transport Layer
3-121
Performance of rdt3.0
rdt3.0 works, but performance stinks
example: 1 Gbps link, 15 ms e-e prop. delay, 1KB
packet:
Ttransmi = L (packet length in bits) = 8kb/pkt
= 8 microsec
R (transmission rate, bps) 10**9 b/sec
t
sender
sender
L/R
RTT + L / R
.008
30.008
= 0.00027
microsec
onds
3-122
receive
r
3-
You should see video lectures RL 3-1 and RL 32 for the following ideas:
Selective Repeat
Go Back N
Sliding Window
Transport Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. TCP Segments
TCP: Overview
2018, 2581
point-to-point:
connection-oriented:
handshaking
(exchange of control
msgs) inits sender,
receiver state before
data exchange
pipelined:
TCP congestion and
flow control set window
size
socket
door
a p p lic a t io n
re a d s d a ta
TCP
s e n d b u ffe r
TC P
r e c e iv e b u f f e r
flow controlled:
socket
door
segm ent
Transport Layer
source port #
dest port #
sequence number
acknowledgement
head
not
number
UAP R S F Receive window
len
used
checksum
counting
by bytes
of data
(not segments!)
# bytes
rcvr willing
to accept
application
data
(variable length)
Transport Layer
3-126
Host B
Host A
User
types
C
Seq=4
2, AC
K=7
9, dat
a
= C
= C
a
t
a
d
=43,
K
C
A
79,
Seq=
host ACKs
receipt
of echoed
C
Seq=4
3, ACK
host ACKs
receipt of
C, echoes
back C
=80
time
simple telnet scenario
Transport Layer
3-127
Retransmissions are
triggered by:
timeout events
duplicate acks
Initially consider
simplified TCP sender:
ignore duplicate acks
ignore flow control,
congestion control
Transport Layer
3-128
timeout:
retransmit segment
that caused timeout
restart timer
Ack rcvd:
If acknowledges
previously unacked
segments
update what is known
to be acked
start timer if there are
outstanding segments
Transport Layer
3-129
NextSeqNum = InitialSeqNum
SendBase = InitialSeqNum
loop (forever) {
switch(event)
TCP
sender
(simplified)
Seq=92 timeout
bytes
data
=100
K
C
A
loss
Seq=9
2,
8 byte
s data
=100
K
C
A
SendBase
= 100
Sendbase
= 100
SendBase
= 120
SendBase
= 120
time
lost ACK scenario
Transport Layer
Host B
Seq=9
2, 8
Seq=
1
00, 2
bytes
0 byt
data
es da
t
0
10
=
K
120
=
C
K
A AC
Seq=9
2,
Seq=92 timeout
timeout
Seq=9
2, 8
time
Host A
Host B
8 byte
AC
s data
20
1
=
K
premature timeout
3-131
Host B
timeout
Seq=9
2, 8
SendBase
= 120
Seq=1
bytes
data
=100
K
C
A
00, 20
bytes
data
loss
=120
K
C
A
time
Cumulative ACK scenario
Transport Layer
3-132
1.
2.
3.
4.
5.
13
True / False
Host A is sending Host B a large file over a TCP connection.
Assume Host B has no data to send to Host A. Host B will not
send acknowledgements to Host A because Host B cannot
piggyback the acknowledgement on data.
Suppose host A is sending a large file to Host B over a TCP
connection. The number of unacknowledged bytes that A sends
cannot exceed the size of the receive buffer.
Suppose host A is sending a large file to Host B over a TCP
connection. If the sequence number for a segment of this
connection is m, then the sequence number for the subsequent
segment will necessarily be m+1.
The TCP segment has a field in its header for RcvWindow.
Suppose Host A sends over a TCP connection to Host B one
segment with sequence number 38 and 4 bytes of data. In this
same segment the acknowledgement number is necessarily 42.
11/5/16
COMPUTER NETWORKS
13
11/5/16
COMPUTER NETWORKS
source port #
dest port #
sequence number
acknowledgement
head
not
number
UAP R S F Receive window
len
used
checksum
counting
by bytes
of data
(not segments!)
# bytes
rcvr willing
to accept
application
data
(variable length)
Transport Layer
3-135
flow control
sender wont
overflow
receivers buffer by
transmitting too
much,
too fast
speed-matching
service: matching
the send rate to the
receiving apps drain
rate
Transport Layer
3-136
guarantees receive
buffer doesnt
overflow
= RcvBuffer-[LastByteRcvd LastByteRead]
Transport Layer
3-137
13
11/5/16
COMPUTER NETWORKS
way
TCP ConnectionThree
Management
handshake:
receiver establish
connection before
exchanging data
segments
initialize TCP variables:
seq. #s
buffers, flow control
info (e.g. RcvWindow)
client: connection
initiator
Socket clientSocket = new
Socket("hostname","port
number");
server: contacted by
client
Socket connectionSocket =
welcomeSocket.accept();
Transport Layer
3-139
client
close
server
FIN
FIN
timed wait
close
AC K
A CK
closed
Transport Layer
3-140
client
closing
FIN
closing
AC K
Connection closed.
timed wait
FIN
server
A CK
closed
closed
Transport Layer
3-141
TCP server
lifecycle
TCP client
lifecycle
Transport Layer
3-142
14
11/5/16
COMPUTER NETWORKS
source port #
dest port #
sequence number
acknowledgement
head
not
number
UAP R S F Receive window
len
used
checksum
counting
by bytes
of data
(not segments!)
# bytes
rcvr willing
to accept
application
data
(variable length)
Transport Layer
3-144
way
TCP ConnectionThree
Management
handshake:
receiver establish
connection before
exchanging data
segments
initialize TCP variables:
seq. #s
buffers, flow control
info (e.g. RcvWindow)
Transport Layer
3-145
client
close
server
FIN
FIN
timed wait
close
AC K
A CK
closed
Transport Layer
3-146
client
closing
FIN
closing
AC K
Connection closed.
timed wait
FIN
server
A CK
closed
closed
Transport Layer
3-147
TCP server
lifecycle
TCP client
lifecycle
Transport Layer
3-148
14
11/5/16
COMPUTER NETWORKS
too short:
premature timeout
unnecessary
retransmissions
too long:
slow reaction to
segment loss
Transport Layer
3-150
fast
typical value: = 0.125 [RFC 2988]
Transport Layer
3-151
3-
Transport Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
DevRTT = (1-)*DevRTT +
*|SampleRTT-EstimatedRTT|
(typically, = 0.25)
Then set timeout interval:
TimeoutInterval = EstimatedRTT + 4*DevRTT
Transport Layer
3-153
15
11/5/16
COMPUTER NETWORKS
15
11/5/16
COMPUTER NETWORKS
15
11/5/16
COMPUTER NETWORKS
15
11/5/16
COMPUTER NETWORKS
15
11/5/16
COMPUTER NETWORKS
Computer Networks
IS ZC467
Vishal Gupta
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Network layer
transport segment from
sending to receiving host
on sending side
encapsulates segments
into datagrams
on rcving side, delivers
segments to transport
layer
network layer protocols in
every host, router
Router examines header
fields in all IP datagrams
passing through it
applicatio
n
transport
network
data link
physical
Network Layer
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
applicatio
n
transport
network
data link
physical
4-160
analogy:
routing: process of
of getting through
single interchange
routing algorithms
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
3
2
2
1
value in arriving
packets header
0111
1
3 2
Network Layer
4-162
Datagram format
IPv4 addressing
ICMP
IPv6
4-163
4-
service: host-to-host
no choice: network provides one or the
other
implementation:
in Layer
network core
Network
Virtual circuits
source-to-dest path behaves much like
telephone circuit
performance-wise
network actions along source-to-dest path
call setup, teardown for each call before data can flow
each packet carries VC identifier (not destination host
address)
every router on source-dest path maintains state for
each passing connection
link, router resources (bandwidth, buffers) may be
allocated to VC (dedicated resources = predictable
service)
Network Layer
4-165
VC implementation
a VC consists of:
1. path from source to destination
2. VC numbers, one number for each link along
path
3. entries in forwarding tables in routers along
path
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
ForwardingVC number
table
1
Forwarding table in
northwest router:
oming interface
22
12
interface
number
Incoming VC #
12
63
7
97
32
Outgoing interface
3
1
2
3
Outgoing V
22
18
17
87
4-167
Datagram networks
no call setup at network layer
routers: no state about end-to-end connections
no network-level concept of connection
applicatio
n
2. Receive data transport
network
data link
physical
Network Layer
4-168
Forwarding table
DestinationAddressRangeLinkInterface
11001000000101110001000000000000
through0
11001000000101110001011111111111
11001000000101110001100000000000
through1
11001000000101110001100011111111
4
billion
possibl
e
entries
11001000000101110001100100000000
through2
11001000000101110001111111111111
otherwise3
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4-
Which interface?
Which interface?
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4-171
Datagram format
IPv4 addressing
ICMP
IPv6
4-172
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Physical layer:
bit-level reception
Data link layer:
e.g., Ethernet
see chapter 5
Decentralized switching:
4-
Output Ports
Buffering required when datagrams arrive from fabric faster than the
transmission rate
Scheduling discipline chooses among queued datagrams for transmission
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network
layer
IP protocol
addressing conventions
datagram format
packet handling conventions
Routing protocols
path selection
RIP, OSPF, BGP
forwarding
table
ICMP protocol
error reporting
router
signaling
Link layer
physical layer
Network Layer
4-178
Computer Networks
BITS ZC481
Vishal Gupta
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Routing Protocols
1.
2.
3.
NAT
ICMP
IPv6
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
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4-
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
1: host 10.0.0.1
2: NAT router
sends datagram to
changes datagram
138.76.29.7, 5001 10.0.0.1, 3345
128.119.40.186, 80
source addr from
10.0.0.1, 3345 to
138.76.29.7, 5001,
S: 10.0.0.1, 3345
D: 128.119.40.186,
updates table
80
S: 138.76.29.7,
5001
D: 128.119.40.186,
80
138.76.29.7
S: 128.119.40.186,
80
D: 138.76.29.7,
Reply
arrives
5001
3:
dest. address:
138.76.29.7, 5001
10.0.0.1
10.0.0.4
S: 128.119.40.186,
80
D: 10.0.0.1, 3345
10.0.0.2
10.0.0.3
4: NAT router
changes datagram
dest addr from
138.76.29.7, 5001 to 10.0.0.1, 3345
Network Layer
4-184
NAT is controversial:
routers should only process up to layer 3
violates end-to-end argument
NAT possibility must be taken into account
by app designers, eg, P2P applications
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Type
0
3
3
3
3
3
3
4
Code
0
0
1
2
3
6
7
0
8
9
10
11
12
0
0
0
0
0
Network Layer
description
echo reply (ping)
dest. network unreachable
dest host unreachable
dest protocol unreachable
dest port unreachable
dest network unknown
dest host unknown
source quench (congestion
control - not used)
echo request (ping)
route advertisement
router discovery
TTL expired
bad IP header
4-186
Network Layer
4-187
IPv6
Initial motivation: 32-bit address
space soon to be completely
allocated.
Additional motivation:
header format helps speed
processing/forwarding
header changes to facilitate QoS
IPv6 datagram format:
fixed-length 40 byte header
no fragmentation allowed
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
flow label
next hdr hop limit
source address
(128 bits)
destination address
(128 bits)
data
32 bits
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Tunneling
Logical view:
Physical view:
4-
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
tunnel
IPv4
IPv4
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Tunneling
Logical view:
Physical view:
IPv6
IPv6
IPv6
IPv6
IPv4
Flow: X
Src: A
Dest: F
data
A-to-B:
IPv6
4-
IPv6
IPv6
IPv4
IPv6
IPv6
tunnel
Src:B
Dest: E
Src:B
Dest: E
Flow: X
Src: A
Dest: F
Flow: X
Src: A
Dest: F
data
data
B-to-C:
IPv6 inside
IPv4
Network Layer
B-to-C:
IPv6 inside
IPv4
Flow: X
Src: A
Dest: F
data
E-to-F:
IPv6
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Routing Protocols
1.
2.
3.
Link state
Distance Vector
Hierarchical
3
2
2
1
value in arriving
packets header
0111
1
3 2
Network Layer
4-195
Graph abstraction
5
2
2
1
Graph: G = (N,E)
w
3
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Remark: Graph abstraction is useful in other network contexts
Example: P2P, where N is set of peers and E is set of TCP connections
Network Layer
4-196
v
2
w
3
- e.g., c(w,z) = 5
cost could always be 1, or
inversely related to bandwidth,
or inversely related to
congestion
4-197
Static or dynamic?
Global:
all routers have complete
topology, link cost info
link state algorithms
Decentralized:
router knows physicallyconnected neighbors, link
costs to neighbors
iterative process of
computation, exchange of
info with neighbors
distance vector algorithms
Static:
routes change slowly
over time
Dynamic:
routes change more
quickly
periodic update
in response to link
cost changes
Network Layer
4-198
Notation:
c(x,y): link cost from node
Dijsktras Algorithm
1 Initialization:
2 N' = {u}
3 for all nodes v
4
if v adjacent to u
5
then D(v) = c(u,v)
6
else D(v) =
7
8 Loop
9 find w not in N' such that D(w) is a minimum
10 add w to N'
11 update D(v) for all v adjacent to w and not in N' :
12
D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N'
Network Layer
4-200
N'
u
ux
uxy
uxyv
uxyvw
uxyvwz
D(v),p(v) D(w),p(w)
2,u
5,u
2,u
4,x
2,u
3,y
3,y
D(x),p(x)
1,u
D(y),p(y)
2,x
D(z),p(z)
4,y
4,y
4,y
5
2
v
2
w
3
Network Layer
4-201
z
x
link
v
x
(u,v)
(u,x)
(u,x)
(u,x)
(u,x)
Network Layer
4-202
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Bellman-Ford example
5
2
v
2
w
3
Network Layer
4-204
Network Layer
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
4-205
Interconnected ASes
3c
3a
3b
AS3
1c
1a
1d
2c
2a
AS2
1b AS1
Intra-AS
Routing
algorithm
Inter-AS
Routing
algorithm
Forwarding
table
Network Layer
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
4-206
Inter-AS tasks
Suppose router in
AS1 receives
datagram for which
dest is outside of
AS1
Router should forward
packet towards one of
the gateway routers,
but which one?
AS1 needs:
1. to learn which dests
are reachable
through AS2 and
which through AS3
2. to propagate this
reachability info to
all routers in AS1
Job of inter-AS routing!
3c
3a
3b
AS3
2a
1c
1a
1d
2c
AS2
2b
1b AS1
Network Layer
4-207
3a
3b
AS3
1c
1a
4-
2a
1d
2c
AS2
2b
1b AS1
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
3a
AS3
1c
1a
4-
2a
1d
2c
AS2
2b
1b AS1
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4-
Determine from
forwarding table the
interface I that leads
to least-cost gateway.
Enter (x,I) in
forwarding table
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Computer Networks
IS ZC467
Vishal Gupta
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Routing in the Internet:
1.
2.
3.
RIP
OSPF
Border Gateway Protocol
Intra-AS Routing
Also known as Interior Gateway Protocols (IGP)
Most common Intra-AS routing protocols:
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4-
destination hops
u
1
v
2
w
2
x
3
y
3
z
2
D
y
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
RIP advertisements
Distance vectors: exchanged among
neighbors every 30 sec via Response
Message (also called advertisement)
Each advertisement: list of up to 25
destination nets within AS
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
RIP: Example
z
w
C
Destination Network
dest.
4-
w
y
z
x
A
B
B
--
Next Router
Num. of hops to
2
2
7
1
....
Routing table in D
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
RIP: Example
Dest
Next hops
w 1
x 1
z C
4
.
...
Advertisement
from A to D
z
x
C
Destination Network
dest.
4-
w
y
z
x
A
B
BA
--
Next Router
Num. of hops to
2
2
75
1
....Network
Layer
Routing
table
in D
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
routed
Transprt
(UDP)
network
forwarding
(IP)
link
Transprt
(UDP)
forwarding
table
table
link
physical
4-
network
(IP)
physical
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
4-220
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Hierarchical OSPF
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Hierarchical OSPF
Two-level hierarchy: local area, backbone.
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
4-225
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
BGP basics
Pairs of routers (BGP peers) exchange routing
info over semi-permanent TCP connections:
BGP sessions
2a
1c
1a
AS1 1d
2c
AS2
2b
1b
eBGP session
iBGP session
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Distributing reachability
info
2a
1c
1a
AS1 1d
2c
AS2
2b
1b
eBGP session
iBGP session
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4-
Policy:
Inter-AS: admin wants control over how its traffic
routed, who routes through its net.
Intra-AS: single admin, so no policy decisions
needed
Scale:
hierarchical routing saves table size, reduced
update traffic
Performance:
Intra-AS: can focus on performance
Inter-AS: policy may dominate over performance
4-
Network Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
4. Simple
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
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
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
time
frequency bands
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CSMA collisions
collision:
entire packet
transmission
time wasted
note:
5: DataLink Layer
5-240
CSMA/CD (Collision
Detection)
collision detection:
easy in wired LANs: measure signal strengths,
compare transmitted, received signals
difficult in wireless LANs: receiver shut off while
transmitting
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Hubs
Hubs are essentially physical-layer repeaters:
twisted pair
hub
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
hu
b
5-
hub
hub
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Switch
Link layer device
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Forwarding
switch
1
2
hu
b
hub
hub
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Forwarding
switch
1
2
hu
b
hub
hub
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Self learning
A switch has a switch table
entry in switch table:
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Filtering/Forwarding
When switch receives a frame:
index switch table using MAC dest address
if entry found for destination
then{
if dest on segment from which frame arrived
then drop the frame
else forward the frame on interface indicated
}
else flood
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Switch example
Suppose C sends frame to D
1
2
A
B
E
G
3
hub
hub
hu
b
address interface
switch
1
1
2
3
I
D
F
E
5: DataLink Layer
Switch example
Suppose D replies back with frame to C.
address interface
switch
hub
hub
hu
b
I
D
F
E
A
B
E
G
C
1
1
2
3
1
5: DataLink Layer
hub
5-
hub
hub
Institutional network
mail server
to external
network
web server
router
switch
IP subnet
hu
b
hub
5: DataLink Layer
hub
5-252
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Summary comparison
5: DataLink Layer
5-254
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Mobile IP
What is mobility?
spectrum of mobility, from the network
perspective:
no mobility
high mobility
6-
mobile user,
passing through
multiple access
point while
maintaining
ongoing
connections (like
cell phone)
Mobility: Vocabulary
home network:
permanent home of
mobile
(e.g., 128.119.40/24)
wide area
network
Permanent address:
address in home
network, can always
be used to reach
mobile
correspondent
e.g., 128.119.40.186
6-
Care-of-address:
address in visited
network.
(e.g., 79,129.13.2)
wide area
network
6-
correspondent:
wants to
communicate with
mobile
I wonder where
Alice moved to?
6-259
Mobility: approaches
Let routing handle it: routers advertise permanent address
of mobile-nodes-in-residence via usual routing table
exchange.
Mobility: approaches
Let routing handle it: routers advertise permanent address
of mobile-nodes-in-residence
via usual routing table
not
exchange.
scalable
millions where
of
routing tables to
indicate
each mobile
mobiles
located
no changes to end-systems
Mobility: registration
visited network
home
network
1
2
wide area
network
mobile
contacts
foreign agent
on entering
visited network
End result:
Foreign agent knows about mobile
Home agent knows location of mobile
6-
foreign agent
receives packets,
forwards to mobile
home
network
visited
network
3
wide area
network
correspondent
addresses packets
using home address
of mobile
6-
mobile replies
directly to
correspondent
6: Wireless and Mobile Networks
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
inefficient when
correspondent, mobile
are in same network
6-
6-
foreign agent
receives packets,
forwards to mobile
home
network
4
wide area
network
2
correspondent
requests, receives
foreign address of
mobile
6-
visited
network
3
4
mobile replies
directly to
correspondent
6: Wireless and Mobile Networks
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
6-
Chapter 6 outline
6.1 Introduction
Wireless
6.2 Wireless links,
characteristics
CDMA
Mobility
6.5 Principles:
addressing and routing
to mobile users
6.6 Mobile IP
6.7 Handling mobility
in cellular networks
6.8 Mobility and
higher-layer protocols
6.9 Summary
6-268
Mobile IP
RFC 3220
has many features weve seen:
home agents, foreign agents, foreignagent registration, care-of-addresses,
encapsulation (packet-within-a-packet)
foreign-agent-to-mobile
packet
dest: 128.119.40.186
dest: 128.119.40.186
Permanent
address:
128.119.40.186
Care-of address:
79.129.13.2
dest: 128.119.40.186
packet sent by
correspondent
6-
checksum
=9
code = 0
=9
standard
ICMP fields
router address
type = 16
length
sequence #
registration lifetime
RBHFMGV
bits
reserved
0 or more care-ofaddresses
mobility agent
advertisement
extension
6-271
foreign agent
COA: 79.129.13.2
registration req.
COA: 79.129.13.2
HA: 128.119.40.7
MA: 128.119.40.186
Lifetime: 9999
identification: 714
encapsulation format
.
Mobile agent
MA: 128.119.40.186
registration req.
COA: 79.129.13.2
HA: 128.119.40.7
MA: 128.119.40.186
Lifetime: 9999
identification:714
.
registration reply
time
6-
HA: 128.119.40.7
MA: 128.119.40.186
Lifetime: 4999
Identification: 714
encapsulation format
.
registration reply
HA: 128.119.40.7
MA: 128.119.40.186
Lifetime: 4999
Identification: 714
.
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Case Study
Case Study
27
11/5/16
COMPUTER NETWORKS
Link Layer
5.1 Introduction and
services
5.2 Error detection
and correction
5.3Multiple access
protocols
5.4 Link-Layer
Addressing
5.5 Ethernet
5: DataLink Layer
5-275
5-276
transportation analogy
tourist = datagram
transport segment =
communication link
transportation mode =
link layer protocol
travel agent = routing
algorithm
5: DataLink Layer
5-277
5-
Error Detection:
errors caused by signal attenuation, noise.
receiver detects presence of errors:
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Adaptors Communicating
datagram
rcving
node
sending
node
frame
frame
adapter
adapter
sending side:
encapsulates datagram in
a frame
adds error checking bits,
rdt, flow control, etc.
control, etc
extracts datagram,
passes to rcving node
adapter is semiautonomous
link & physical layers
5: DataLink Layer
5-280
Link Layer
5.1 Introduction and
services
5.2 Error detection
and correction
5.3Multiple access
protocols
5.4 Link-Layer
Addressing
5.5 Ethernet
5: DataLink Layer
5-281
Error Detection
EDC= Error Detection and Correction bits (redundancy)
D = Data protected by error checking, may include header
fields
Error detection not 100% reliable!
protocol may miss some errors, but rarely
larger EDC field yields better detection and correction
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Parity Checking
Single Bit Parity:
Detect single bit
errors
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Internet checksum
Goal: detect errors (e.g., flipped bits) in
transmitted segment (note: used at transport
layer only)
Receiver:
Sender:
compute checksum of
received segment
check if computed checksum
equals checksum field value:
NO - error detected
YES - no error detected.
But maybe errors
nonetheless? More later .
5: DataLink Layer
5-284
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
CRC Example
Want:
D.2r XOR R =
nG
equivalently:
D.2r = nG XOR
R
equivalently:
if we divide D.2r by
G, want remainder
.2r
D
R R = remainder[
]
G
5-
5: DataLink Layer
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
28
11/5/16
COMPUTER NETWORKS
11/5/16
COMPUTER NETWORKS
28
11/5/16
COMPUTER NETWORKS
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Multimedia Networking
MM Networking Applications
Fundamental
characteristics:
Typically delay
sensitive
Classes of MM
applications:
end-to-end delay
1) Streaming stored audio
delay jitter
and video
But loss tolerant:
2) Streaming live audio
infrequent losses
and video
cause minor glitches
3) Real-time interactive
Antithesis of data,
audio
video
Jitterand
is the
variability
which are loss
of packet delays within
intolerant but delay
the same packet
tolerant.
stream
7: Multimedia
7-291
Networking
Streaming Stored
Multimedia
Streaming:
media stored at source
transmitted to client
streaming: client playout
begins before all data has
arrived
7: Multimedia
7-292
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Cumulative
data
1. video
recorded
2. video
sent
network
delay
3. video received,
played out at client
time
7: Multimedia
7-293
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
7-294
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
7: Multimedia
7-295
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
applications: IP telephony,
session initialization
how does callee advertise its IP address, port number, encoding
algorithms?
7: Multimedia
7-296
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
7-297
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Differentiated services
philosophy:
Fewer changes to
Internet infrastructure,
yet provide 1st and 2nd
class service.
application layer
7: Multimedia
Networking
7-298
Streaming Stored
Multimedia
Application-level
streaming techniques
for making the best out
of best effort service:
client side buffering
use of UDP versus
TCP
multiple encodings
of multimedia
7: Multimedia
Networking
Media Player
7-299
jitter removal
decompression
error concealment
graphical user interface
w/ controls for
interactivity
7-300
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
7-301
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
7-302
constant bit
rate video
transmission
client video
reception
variable
network
delay
constant bit
rate video
playout at client
buffered
video
Cumulative
data
time
client
playout
delay
7-303
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
7: Multimedia
Networking
7: Multimedia
Networking
7-305
RTSP Example
Scenario:
7: Multimedia
7-306
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
RTSP Operation
7: Multimedia
7-307
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Multimedia Networking
7: Multimedia
7-309
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
7-310
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
constant bit
rate
transmission
client
reception
variable
network
delay
(jitter)
constant bit
rate playout
at client
buffered
data
Cumulative
data
Delay Jitter
time
client
playout
delay
7: Multimedia
7-311
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Tradeoff for q:
large q: less packet loss
small q: better interactive experience
7: Multimedia
7-312
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
lo s s
p a c k e ts
g e n e ra te d
p a c k e ts
r e c e iv e d
p la y o u t s c h e d u le
p'- r
p la y o u t s c h e d u le
p - r
tim e
7: Multimedia
Networking
r
p
7-313
p'
d i (1 u )d i 1 u ( ri ti )
where u is a fixed constant (e.g., u = .01).
7: Multimedia
7-314
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
vi (1 u )vi 1 u | ri ti d i |
pi ti d i Kvi
where K is a positive constant.
Remaining packets in talkspurt are played out periodically
7: Multimedia
Networking
7-315
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Interleaving
chunks are broken
up into smaller units
for example, 4 5 msec units per
chunk
Packet contains small units from
different chunks
7: Multimedia
Networking
7-316
7.1 Multimedia
Networking Applications
7.2 Streaming stored
audio and video
7.3 Real-time
Multimedia: Internet
Phone study
7.4 Protocols for RealTime Interactive
Applications
RTP,RTCP,SIP
7.5 Distributing
Multimedia: content
7: Multimedia
distribution networks
Networking
7-317
7: Multimedia
Networking
7: Multimedia
Networking
7-319
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
RTP Example
Consider sending 64
kbps PCM-encoded
voice over RTP.
Application collects
the encoded data in
chunks, e.g., every
20 msec = 160 bytes
in a chunk.
The audio chunk
along with the RTP
header form the RTP
packet, which is
encapsulated into a
UDP segment.
7: Multimedia
Networking
7-320
RTP Header
Payload
Payload
Payload
Payload
Payload
Payload
type
type
type
type
type
type
Sequence Number (16 bits): Increments by one for each RTP packet
sent, and may be used to detect packet loss and to restore packet
sequence.
7: Multimedia
Networking
7-322
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
7: Multimedia
7-323
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
SIP
Session Initiation Protocol
Comes from IETF
SIP long-term vision
All telephone calls and video conference calls
take place over the Internet
People are identified by names or e-mail
addresses, rather than by phone numbers.
You can reach the callee, no matter where the
callee roams, no matter what IP device the
callee is currently using.
7: Multimedia
7-324
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
SIP Services
Setting up a call
Provides mechanisms
for caller to let callee
know she wants to
establish a call
Provides mechanisms
so that caller and callee
can agree on media
type and encoding.
Provides mechanisms
to end call.
7: Multimedia
Networking
Determine current IP
address of callee.
Maps mnemonic
identifier to current IP
address
Call management
Add new media streams
during call
Change encoding
during call
Invite others
Transfer and hold calls
7-325
A lic e
1 6 7 .1 8 0 .1 1 2 .2 4
1 9 3 .6 4 .2 1 0 .8 9
B o b 's
te r m in a l r in g s
L a w a u d io
p o rt 3 8 0 6 0
G SM
tim e
7: Multimedia
Networking
p o rt 4 8 7 5 3
tim e
7-326
Codec negotiation:
Suppose Bob doesnt
have PCM ulaw encoder.
Bob will instead reply
with 606 Not
Acceptable Reply and
list encoders he can
use.
Alice can then send a
new INVITE message,
advertising an
appropriate encoder.
7: Multimedia
Networking
7-327
Bobs IP address.
Intermediate SIP
servers will be
necessary.
Alice sends and
7-328
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
SIP Registrar
When Bob starts SIP client, client sends SIP
7: Multimedia
7-330
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
SIP Proxy
Alice sends invite message to her proxy server
contains address sip:bob@domain.com
7-331
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Example
Caller jim@umass.edu
with places a
call to keith@upenn.edu
S IP r e g is tr a r
u p e n n .e d u
S IP
r e g is tr a r
e u r e c o m .fr
S IP p r o x y
u m a s s .e d u
(1) Jim sends INVITE
message to umass SIP
proxy. (2) Proxy forwards
1
request to upenn
8
registrar server.
(3) upenn server returns
redirect response,
S IP c lie n t
indicating that it should 2 1 7 . 1 2 3 . 5 6 . 8 9
try keith@eurecom.fr
7
6
S IP c lie n t
1 9 7 .8 7 .5 4 .2 1
7-332
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. Multimedia Networking
7-334
origin server
in North America
CDN server
CDN server
in S. America CDN server
in Asia
in Europe
origin server
in North America
Content replication
CDN server
CDN server
in S. America CDN server
in Asia
in Europe
7: Multimedia
Networking
7-335
CDN example
Origin server
DNS query for www.cdn.com
CDNs authoritative
DNS server
HTTP request for
www.cdn.com/www.foo.com/sports/ruth.gif
Nearby
CDN server
with
http://www.cdn.com/www.foo.com/sports/ruth.gif
7: Multimedia
Networking
7-336
CDN company
(cdn.com)
distributes gif files
uses its authoritative
DNS server to route
redirect requests
7: Multimedia
Networking
7-337
Improving QOS in IP
Networks
Thus far: making the best of best effort
Future: next generation Internet with QoS guarantees
RSVP: signaling for resource reservations
Differentiated Services: differential guarantees
Integrated Services: firm guarantees
simple model
for sharing and
congestion
studies:
7: Multimedia
7-338
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Principle 1
packet marking needed for router to
distinguish between different classes; and
new router policy to treat packets accordingly
7: Multimedia
7-339
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Principle 2
provide protection (isolation) for one class from others
7: Multimedia
7-340
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Principle 3
While providing isolation, it is desirable to use
resources as efficiently as possible
7: Multimedia
7-341
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Principle 4
Call Admission: flow declares its needs, network may
block call (e.g., busy signal) if it cannot meet needs
7: Multimedia
7-342
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
Summary of QoS
Principles
7-343
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
BITS Pilani
Pilani|Dubai|Goa|Hyderabad
Agend
a: 1. QoS
Summary of QoS
Principles
7-345
BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
7-346
Multimedia Networking
7-347
Multimedia Networking
7-348
Multimedia Networking
7-349
Multimedia Networking
Policing Mechanisms
Goal: limit traffic to not exceed declared parameters
Peak Rate: e.g., 6000 pkts per min. (ppm) avg.; 1500 ppm peak rate
(Max.) Burst Size: max. number of pkts sent consecutively (with no
intervening idle)
7-350
Multimedia Networking
Policing Mechanisms
Token Bucket: limit input to specified Burst Size and
Average Rate.
7-352
Multimedia Networking
Diffserv Architecture
Edge router:
per-flow traffic
management
r marking
scheduling
b
..
.
Core router:
Multimedia Networking
7-354
Classification and
Conditioning
7-355
Multimedia Networking
Classification and
Conditioning
may be desirable to limit traffic injection
rate of some class:
user declares traffic profile (e.g., rate,
burst size)
traffic metered, shaped if non-conforming
7-356
Multimedia Networking
Forwarding (PHB)
PHB result in a different observable
(measurable) forwarding performance
behavior
PHB does not specify what mechanisms to use
to ensure required PHB performance behavior
Examples:
Class A gets x% of outgoing link bandwidth over
time intervals of a specified length
Class A packets leave first before packets from
class B
7-357
Multimedia Networking
Forwarding (PHB)
PHBs being developed:
Chapter 7 outline
7.1 multimedia
networking applications
7.2 streaming stored
audio and video
7.3 making the best out of
best effort service
7.4 protocols for real-time
interactive applications
RTP, RTCP, SIP
Multimedia Networking
7-359
1 Mbps
phone
R1
R2
1.5 Mbps link
Principle 4
Call Admission: flow declares its needs, network may
block call (e.g., busy signal) if it cannot meet needs
7-360
Multimedia Networking
request/
reply
QoS-sensitive
scheduling (e.g.,
WFQ)
Multimedia Networking
7-361
7-362
Multimedia Networking
Call Admission
Arriving session must :
7-363
Multimedia Networking
token rate, r
bucket size, b
WFQ
Multimedia Networking
per-flow
rate, R
D
= b/R
max
7-364
best effort
service
no network
signaling
protocols
in initial IP
design
New requirement: reserve resources along end-toend path (end system, routers) for QoS for
multimedia applications
RSVP: Resource Reservation Protocol [RFC 2205]
allow users to communicate requirements to
network in robust and efficient way. i.e., signaling !
7-366
Multimedia Networking
sender-to-network signaling
path message: make sender presence known to routers
path teardown: delete senders path state from routers
receiver-to-network signaling
reservation message: reserve resources from sender(s) to
receiver
reservation teardown: remove receiver reservations
network-to-end-system signaling
path error
reservation error
7-367
Multimedia Networking