Professional Documents
Culture Documents
Ece 374 Computer Networks and Internet
Ece 374 Computer Networks and Internet
Homework
4
1
Homework
4
assignment
for
ECE374
Posted:
04/08/12
Due:
04/15/12
Note:
In all written assignments, please show as much of your work as you can. Even if
you get a wrong answer, you can get partial credit if you show your work. If you make a
mistake, it will also help the grader show you where you made a mistake.
Problem
1
(15
Points):
Consider
a
network
in
which
all
nodes
are
connected
to
three
other
nodes.
In
a
single
time
step,
a
node
can
receive
all
transmitted
broadcast
packets
from
its
neighbors,
duplicate
the
packets,
and
send
them
to
all
of
its
neighbors
(except
to
the
node
that
sent
a
given
packet).
At
the
next
time
step,
neighboring
nodes
can
receive,
duplicate,
and
forward
these
packets,
and
so
on.
Suppose
that
uncontrolled
flooding
is
used
to
provide
broadcast
in
such
a
network.
At
time
step
t,
how
many
copies
of
the
broadcast
packet
will
be
transmitted,
assuming
that
during
time
step
1,
a
single
broadcast
packet
is
transmitted
by
the
source
node
to
its
three
neighbors.
Solution:
After
1
step
3
copies
are
transmitted,
after
2
steps
6
copies
are
transmitted.
After
3
steps,
12
copies
are
transmitted,
and
so
on.
After
k
steps,
3*2^k-‐1
copies
will
be
transmitted
in
that
step.
3
6
12
24
48
…
Figure
1
Solution:
(The
following
description
is
short,
but
contains
all
major
key
steps
and
key
protocols
involved.)
Your
computer
first
uses
DHCP
to
obtain
an
IP
address.
You
computer
first
creates
a
special
IP
datagram
destined
to
255.255.255.255
in
the
DHCP
server
discovery
step,
and
puts
it
in
a
Ethernet
frame
and
broadcast
it
in
the
Ethernet.
Then
following
the
steps
in
the
DHCP
protocol,
you
computer
is
able
to
get
an
IP
address
with
a
given
lease
time.
A
DHCP
server
on
the
Ethernet
also
gives
your
computer
a
list
of
IP
addresses
of
first-‐hop
routers,
the
subnet
mask
of
the
subnet
where
your
computer
resides,
and
the
addresses
of
local
DNS
servers
(if
they
exist).
Since
your
computer’s
ARP
cache
is
initially
empty,
your
computer
will
use
ARP
protocol
to
get
the
MAC
addresses
of
the
first-‐hop
router
and
the
local
DNS
server.
ECE374:
Homework
4
3
Your
computer
first
will
get
the
IP
address
of
the
Web
page
you
would
like
to
download.
If
the
local
DNS
server
does
not
have
the
IP
address,
then
your
computer
will
use
DNS
protocol
to
find
the
IP
address
of
the
Web
page.
Once
your
computer
has
the
IP
address
of
the
Web
page,
then
it
will
send
out
the
HTTP
request
via
the
first-‐hop
router
if
the
Web
page
does
not
reside
in
a
local
Web
server.
The
HTTP
request
message
will
be
segmented
and
encapsulated
into
TCP
packets,
and
then
further
encapsulated
into
IP
packets,
and
finally
encapsulated
into
Ethernet
frames.
Your
computer
sends
the
Ethernet
frames
destined
to
the
first-‐hop
router.
Once
the
router
receives
the
frames,
it
passes
them
up
into
IP
layer,
checks
its
routing
table,
and
then
sends
the
packets
to
the
right
interface
out
of
all
of
its
interfaces.
Then
your
IP
packets
will
be
routed
through
the
Internet
until
they
reach
the
Web
server.
The
server
hosting
the
Web
page
will
send
back
the
Web
page
to
your
computer
via
HTTP
response
messages.
Those
messages
will
be
encapsulated
into
TCP
packets
and
then
further
into
IP
packets.
Those
IP
packets
follow
IP
routes
and
finally
reach
your
first-‐hop
router,
and
then
the
router
will
forward
those
IP
packets
to
your
computer
by
encapsulating
them
into
Ethernet
frames.
Problem
3
(15
Points):
Let’s
consider
the
operation
of
a
learning
switch
in
the
context
of
a
network
in
which
6
nodes
labeled
A
through
F
are
start
connected
into
an
Ethernet
switch.
Suppose
that
(i)
B
sends
a
frame
to
E,
(ii)
E
replies
with
a
frame
to
B,
(iii)
A
sends
a
frame
to
B,
(iv)
B
replies
with
a
frame
to
A.
The
switch
table
is
initially
empty.
Show
the
state
of
the
switch
table
before
and
after
each
of
these
events.
For
each
of
these
events,
identify
the
link(s)
on
which
the
transmitted
frame
will
be
forwarded,
and
briefly
justify
your
answers.
Solution:
Action
Switch
Table
State
Link(s)
packet
is
Explanation
forwarded
to
B
sends
a
Switch
learns
interface
A,
C,
D,
E,
and
F
Since
switch
table
frame
to
E
corresponding
to
MAC
is
empty,
so
switch
address
of
B
does
not
know
the
interface
corresponding
to
MAC
address
of
E
E
replies
with
Switch
learns
interface
B
Since
switch
a
frame
to
B
corresponding
to
MAC
already
knows
address
of
E
interface
ECE374:
Homework
4
4
corresponding
to
MAC
address
of
B
A
sends
a
Switch
learns
the
B
Since
switch
frame
to
B
interface
corresponding
already
knows
the
to
MAC
address
of
A
interface
corresponding
to
MAC
address
of
B
B
replies
with
Switch
table
state
A
Since
switch
a
frame
to
A
remains
the
same
as
already
knows
the
before
interface
corresponding
to
MAC
address
of
A
Problem
4
(20
Points):
Suppose
two
nodes,
A
and
B,
are
attached
to
opposite
ends
of
an
1200m
cable,
and
that
they
each
have
one
frame
of
1,500
bits
(including
all
headers
and
preambles)
to
send
to
each
other.
Both
nodes
attempt
to
transmit
at
time
t=0.
Suppose
there
are
four
repeaters
between
A
and
B,
each
inserting
a
40-‐bit
delay.
Assume
the
transmission
rate
is
100
Mbp,
and
CSMA/CD
with
backoff
intervals
of
multiples
of
512
bits
times
is
used.
After
the
collision,
A
draws
K=0
and
B
draws
K=1
in
the
exponential
backoff
protocol.
Ignore
the
jam
signal
in
this
case.
a. What
is
the
one-‐way
propagation
delay
(including
repeater
delays)
between
A
and
B
in
seconds?
Assume
the
signal
propagation
speed
is
2*108
m/sec.
b. At
what
time
(in
seconds)
is
A’s
packet
completely
delivered
at
B?
c. Now
suppose
that
only
A
has
a
packet
to
send
and
that
the
repeaters
are
replaced
with
switches.
Suppose
that
each
switch
has
a
20-‐bit
processing
delay
in
addition
to
a
store-‐and-‐forward
delay.
At
what
time,
in
seconds,
is
A’s
packet
delivered
at
B?
Solution:
a)
𝟏𝟐𝟎𝟎𝒎 𝟒𝟎𝒃𝒊𝒕𝒔
𝟖
+𝟒∗ Type equation here.
𝟐 ∗ 𝟏𝟎 𝒎/𝒔𝒆𝒄 𝟏𝟎𝟎 ∗ 𝟏𝟎𝟔 𝒃𝒑𝒔
b)
First note, the transmission time of a single frame is given by 1500/(100Mbps)=15 micro
sec, longer than the propagation delay of a bit.
• At time t = 0 , both A and B transmit.
ECE374:
Homework
4
5
• At time t = 7.6µ sec , both A and B detect a collision, and then abort.
• At time t = 15.2µ sec last bit of B 's aborted transmission arrives at A .
• At time t = 22.8µ sec first bit of A 's retransmission frame arrives at B .
1500bits
• At time t = 22.8µ sec+ = 37.8µ sec A 's packet is completely
100 ×10 6 bps
delivered at B .
c) The line is divided into 5 segments by the switches, so the propagation delay between
𝟏𝟐𝟎𝟎𝒎/𝟓
switches or between a switch and a host is given by 𝟐∗𝟏𝟎𝟖 𝒎/𝒔𝒆𝒄 = 𝟏. 𝟐𝒎𝒊𝒄𝒓𝒐𝒔𝒆𝒄.
The delay from Host A to the first switch is given by 15micosec (transmission delay),
longer than propagation delay. Thus, the first switch will wait 16.4=15+1.2+0.2 (note, 0.2
is processing delay) till it is ready to send the frame to the second switch. Note that the
store-and-forward delay at a switch is 15 microsec. Similarly each of the other 3 switches
will wait for 16.4 microsec before ready for transmitting the frame.
The total delay is:
16.4*4 + 15+0.8=81.4 micro sec.
Problem
5
(20
Points):
The
figure
below
shows
three
wireless
nodes
and
their
transmission
ranges.
a. Use
the
figure
below
to
explain
the
“hidden
node”
problem.
What
happens
when
nodes
A
and
C
start
sending
a
message
simultaneously?
b. Use
diagram
below
to
explain
how
CSMA/CA
is
realized
in
the
case
of
the
IEEE
802.11
protocol.
For
your
explanation,
assume
that
A
wants
to
send
a
frame
to
the
destination.
c. Why
are
acknowledgements
used
in
802.11
but
not
in
wired
Ethernet?
d. Describe
the
role
of
beacon
frames
in
802.11.
A
A B C
ECE374:
Homework
4
6
Solution:
a) A
cannot
detect
a
transmission
from
C
and
vice
versa.
If
A
and
C
start
sending
simultaneously
to
B
a
collision
at
B
will
happen
but
A
and
C
will
not
become
aware
of
the
collision.
ECE374:
Homework
4
7
b)
c) Usually
no
packet
loss
in
wired
Ethernet.
This
is
much
more
likely
in
a
wireless
scenario.
Robustness
is
increased
through
retransmissions.
To
be
able
to
perform
retransmissions
ACKs
are
required.
d) APs
transmit
beacon
frames.
An
AP’s
beacon
frames
will
be
transmitted
over
one
of
the
11
channels.
The
beacon
frames
permit
nearby
wireless
stations
to
discover
and
identify
the
AP.