ECE 358: Computer Networks Solutions To Homework #4 Chapter 4 - The Network Layer P 4. Consider The Network Below
ECE 358: Computer Networks Solutions To Homework #4 Chapter 4 - The Network Layer P 4. Consider The Network Below
Solutions to Homework #4
Solution:
a)
For
Router
A,
data
destined
to
host
H3
is
forwarded
through
interface
3.
Distention
address
Link
interface
H3
#3
b) No,
because,
for
datagram
networks,
forwarding
rule
is
only
based
only
on
destination
address
(not
the
source
address).
c) One
possible
configuration
for
Router
A
is:
Incoming
interface
Incoming
VC#
Outgoing
Interface
Outgoing
VC#
1
12
3
22
2
63
4
18
Note,
that
the
two
flows
could
actually
have
the
same
VC
numbers.
d) One
possible
configuration
is:
for
Router
B
Incoming
interface
Incoming
VC#
Outgoing
Interface
Outgoing
VC#
1
22
2
24
For
Router
C
Incoming
interface
Incoming
VC#
Outgoing
Interface
Outgoing
VC#
1
18
2
50
For
Router
D
Incoming
interface
Incoming
VC#
Outgoing
Interface
Outgoing
VC#
1
24
3
70
2
50
3
76
P
7. Suppose
two
packets
arrive
at
different
input
ports
of
a
router
at
exactly
the
same
time.
Also
suppose
there
are
no
other
packets
in
the
router.
a. Suppose
the
two
packets
are
to
be
forwarded
to
two
different
output
ports.
Is
it
possible
to
forward
the
two
packets
through
the
switch
fabric
at
the
same
time
when
the
fabric
uses
a
shared
bus?
b. Suppose
the
two
packets
are
to
be
forwarded
to
two
different
output
ports.
Is
it
possible
to
forward
the
two
packets
through
the
switch
fabric
at
the
same
time
when
the
fabric
uses
a
crossbar?
c.
Suppose
the
two
packets
are
to
be
forwarded
to
the
same
output
port.
Is
it
possible
to
forward
the
two
packets
through
the
switch
fabric
at
the
same
time
when
the
fabric
uses
a
crossbar?
Solution:
a) No,
you
can
only
transmit
one
packet
at
a
time
over
a
shared
bus.
1
3
2
4
b) Yes,
as
long
as
the
two
packets
use
different
input
busses
and
different
output
busses,
they
can
be
forwarded
in
parallel.
1
2
3
4
c) No,
in
this
case
the
two
packets
would
have
to
be
sent
over
the
same
output
bus
at
the
same
time,
which
is
not
possible.
1
2
3
4
P
9. Consider
the
switch
shown
below.
Suppose
that
all
datagrams
have
the
same
fixed
length,
that
the
switch
operates
in
a
slotted,
synchronous
manner,
and
that
in
one
time
slot
a
datagram
can
be
transferred
from
an
input
port
to
an
output
port.
The
switch
fabric
is
a
crossbar
so
that
at
most
one
datagram
can
be
transferred
to
a
given
output
port
in
a
time
slot,
but
different
output
ports
can
receive
datagrams
from
different
input
ports
in
a
single
time
slot.
What
is
the
minimal
number
of
time
slots
needed
to
transfer
the
packets
shown
from
input
ports
to
their
output
ports,
assuming
any
input
queue
scheduling
order
you
want?
What
is
the
largest
number
of
slots
needed,
assuming
the
worst-‐case
scheduling
order
you
can
devise,
assuming
that
a
non-‐empty
input
queue
is
never
idle?
Solution:
The
minimal
number
of
time
slots
needed
is
3.
The
scheduling
is
as
follows.
Slot
1:
send
X
in
top
input
queue,
send
Y
in
middle
input
queue.
Slot
2:
send
X
in
middle
input
queue,
send
Y
in
bottom
input
queue
Slot
3:
send
Z
in
bottom
input
queue.
Largest
number
of
slots
is
still
3.
Actually,
based
on
the
assumption
that
a
non-‐empty
input
queue
is
never
idle,
we
see
that
the
first
time
slot
always
consists
of
sending
X
in
the
top
input
queue
and
Y
in
either
middle
or
bottom
input
queue,
and
in
the
second
time
slot,
we
can
always
send
two
more
datagram,
and
the
last
datagram
can
be
sent
in
third
time
slot.
NOTE:
Actually,
if
the
first
datagram
in
the
bottom
input
queue
is
X,
then
the
worst
case
would
require
4
time
slots.
P
10. Consider
a
datagram
network
using
32-‐bit
host
addresses.
Suppose
a
router
has
four
links,
numbered
0
through
3,
and
packets
are
to
be
forwarded
to
the
link
interfaces
as
follows:
Destination
Address
Range
Link
Interface
11100000
00000000
00000000
00000000
through
0
11100000
00111111
11111111
11111111
11100000
01000000
00000000
00000000
through
1
11100000
01000000
11111111
11111111
11100000
01000001
00000000
00000000
through
2
11100001
01111111
11111111
11111111
otherwise
3
a. Provide
a
forwarding
table
that
has
four
entries,
uses
longest
prefix
matching,
and
forwards
packets
to
the
correct
link
interfaces.
b. Describe
how
your
forwarding
table
determines
the
appropriate
link
interface
for
datagrams
with
destination
addresses:
11001000
10010001
01010001
01010101
11100001
01000000
11000011
00111100
11100001
10000000
00010001
01110111
Solition:
a)
Prefix Match Link Interface
11100000 00 0
11100000 01000000 1
1110000 2
11100001 1 3
otherwise 3
P
13. Consider
a
router
that
interconnects
three
subnets:
Subnet
1,
Subnet
2,
and
Subnet
3.
Suppose
all
of
the
interfaces
in
each
of
these
three
subnets
are
required
to
have
the
prefix
223.1.17/24.
Also
suppose
that
Subnet
1
is
required
to
support
up
to
60
interfaces,
Subnet
2
is
to
support
up
to
90
interfaces,
and
Subnet
3
is
to
support
up
to
12
interfaces.
Provide
three
network
addresses
(of
the
form
a.b.c.d/x)
that
satisfy
these
constraints.
Solution:
The
parent
network
address
is
223.1.17/24.
24
bits
are
prefix
for
the
network.
8
bits
can
be
used
for
subnet
portions
&
host
portions.
Start
with
the
largest
required
subnet
(Subnet
2)
• Subnet
#2
(90
interfaces)
Subnet
Host
portion
portion
128
64
32
16
8
4
2
1
With
7
bits,
we
can
get
128
addresses
(126
usable
host
addresses
+
1
subnet
address
+
1
subnet
broadcast
address),
which
is
>
90.
1
bit
is
left
for
the
subnet
portion
(we
can
have
2
subnets,
each
with
128
addresses)
223.1.17.0/25
(range
223.1.17.0
to
223.1.17.
127)
223.1.17.128/25
(range
223.1.17.128
to
223.1.17.
255)
We
assign
one
of
those
subnets
to
our
Subnet
#2
and
further
subnet
the
other
range
for
out
Subnet
#1
&
Subnet
#3.
Subnet
#2
223.1.17.128/25
,
Mask
255.255.255.128
Subnet
#1
223.1.17.0/26
,
Mask
255.255.255.0
P
16. Consider
a
subnet
with
prefix
128.119.40.128/26.
Give
an
example
of
one
IP
address
(of
form
xxx.xxx.xxx.xxx)
that
can
be
assigned
to
this
network.
Suppose
an
ISP
owns
the
block
of
addresses
of
the
form
128.119.40.64/26.
Suppose
it
wants
to
create
four
subnets
from
this
block,
with
each
block
having
the
same
number
of
IP
addresses.
What
are
the
prefixes
(of
form
a.b.c.d/x)
for
the
four
subnets?
Solution:
Any
IP
address
in
range
128.119.40.128
to
128.119.40.191
can
be
an
example.
Four
equal
size
subnets:
128.119.40.64/28,
128.119.40.80/28,
128.119.40.96/28,
128.119.40.112/28