Vous êtes sur la page 1sur 9

ECE374:

Homework 4 1

Homework 4 assignment for ECE374


Posted: 04/07/14
Due: 04/14/14


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 (XX Points):
Consider the network shown in Figure 1. Assume the network uses poison reverse

X

A
5

C
1

1
1

B
Figure 1

Fill in the following distance vector tables after the nodes converge.

DA B C X
B



C



X




DB A C
A


C


X



DC A B
A


B


X







ECE374: Homework 4 2

Solution:

DA B C X
B
1 2
C
2 1
X
5

DB A C
A
1 2
C
2 1
X
6 7

DC A B
A
1 2
B
2 1
X
6 7


Problem 2 (30 Points):
In this problem we are looking in the day in the life of a web request scenario.
Please refer to Figure 2 for this problem.

a) For the initial step we assume that the connecting laptop needs to get its own
IP address, the address of the first hop router, and the address of the
DNSserver. Describe in detail, how this is achieved by using the DHCP
protocol.
b) Before the client can send out an HTTP request to www.google.com it has to
obtain the IP address for that hostname via DNS. Describe in detail, how the
DNS request is performed. Keep in mind the client does not yet no the MAC
address of the first hop router interface!
c) After the client has retrieved the IP address, it can finally send out the HTTP
request. First describe how the TCP connection is setup and then describe
how the HTTP request is being performed.

ECE374: Homework 4 3

Figure 2


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 computers 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.

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

ECE374: Homework 4 4

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):
Lets consider the operation of a learning switch in the context of a network in
which 6 nodes labeled A through F are star connected into an Ethernet switch.
Suppose that (i) C sends a frame to D, (ii) D replies with a frame to C, (iii) E sends a
frame to D, (iv) D replies with a frame to E, (v) C sends a frame to A, and (vi) C sends
a frame back 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.

Action
Switch Table State
Link(s) packet is Explanation
forwarded to


























Solution:
Action
Switch Table State
Link(s) packet is Explanation
forwarded to
C sends a Switch learns interface A, B, D, E, and F
Since switch table
frame to D
corresponding to MAC
is empty, so switch
address of C
does not know the
interface
corresponding to
MAC address of E

ECE374: Homework 4 5

D replies with Switch learns interface C
a frame to C
corresponding to MAC
address of D
E sends
frame to D

a Switch
learns
the D
interface corresponding
to MAC address of E

D replies with Switch table state E


a frame to E
remains the same as
before
C sends
frame to A

a Switch
learns
the A, B, D, E, and F
interface corresponding
to MAC address of E

A replies with Switch table state C


a frame to C
remains the same as
before

Since
switch
already
knows
interface
corresponding to
MAC address of C
Since
switch
already knows the
interface
corresponding to
MAC address of D
Since
switch
already knows the
interface
corresponding to
MAC address of E
Switch does not
know the interface
corresponding to
MAC address of A
Since
switch
already knows the
interface
corresponding to
MAC address of C



Problem 4 (20 Points):
In Chapter 5, we provided an outline of the derivation of the efficiency of slotted
ALOHA. In this problem we will complete the derivation.
a. Recall that when there are N active nodes, the efficiency of slotted ALOHA is
Np(1-p)N-1. Find the value of p that maximizes this expression.
b. Using the value of p found in (a), find the efficiency of slotted ALOHA by
letting N approach infinity. Hint: (1-1/N)N approaches 1/e as N approached
infinity.

Solution:
a)
E ( p) = Np(1 p) N 1
E ' ( p) = N (1 p) N 1 Np( N 1)(1 p) N 2
= N (1 p) N 2 ((1 p) p( N 1))

E ' ( p ) = 0 p* =

1
N

ECE374: Homework 4 6

b)

1 N
)
1
1 N 1
1 N 1
N
E ( p*) = N (1 )
= (1 )
=
1
N
N
N
1
N
1
1
1
lim (1 ) = 1
lim (1 ) N =
N
N

N
N
e
(1

Thus

lim E ( p*) =

1
e





Problem 5 (20 Points): P5
Suppose there are two ISPs providing WiFi access in a particular caf and each ISP
operates its own AP and having its own IP address block.
a. Further suppose that by accident, each ISP has configured its AP to operate
over channel 11. Will the 802.11 protocol completely break down in this
situation? Discuss what happens when two stations, each associated with a
different ISP, attempt to transmit at the same time.
b. Now suppose that one AP operates over channel 1 and the other over
channel 11. How do your answers change?
c. Describe the process of how a wireless host detects APs that provide wireless
access. Describe both options that can be used for the specific scenario
describe in (b) above.
d. Use the figure below to explain the hidden node problem. What happens
when nodes A and C start sending a message simultaneously?

ECE374: Homework 4 7

Solution:
a) The two APs will typically have different SSIDs and MAC addresses. A wireless
station arriving to the caf will associate with one of the SSIDs (that is, one of the
APs). After association, there is a virtual link between the new station and the AP.
Label the APs AP1 and AP2. Suppose the new station associates with AP1. When the
new station sends a frame, it will be addressed to AP1. Although AP2 will also
receive the frame, it will not process the frame because the frame is not addressed to
it. Thus, the two ISPs can work in parallel over the same channel. However, the two
ISPs will be sharing the same wireless bandwidth. If wireless stations in different
ISPs transmit at the same time, there will be a collision. For 802.11b, the maximum
aggregate transmission rate for the two ISPs is 11 Mbps.
b) Now if two wireless stations in different ISPs (and hence different channels) transmit
at the same time, there will not be a collision. Thus, the maximum aggregate
transmission rate for the two ISPs is 22 Mbps for 802.11b.



Problem 6 (20 Points): P14
Consider three LANs interconnected by two routers as shown in Figure 3.
a. Assign IP addresses to all of the interfaces. For Subnet 1 use addresses of the
form 192.168.1.xxx; for Subnet 2 use addresses of the form 192.168.2.xxx;
and for Subnet 3 use addresses of the form 192.168.3.xxx.
b. Assign MAC addresses to all of the adapters.
c. Consider sending an IP datagram from Host E to Host B. Suppose all of the
ARP tables are up to date. Enumerate all steps, as done for the single router
example on slide XX
d. Repeat (c), now assuming that the ARP table in the sending host is empty
(and all other tables are up to date).



ECE374: Homework 4 8

Switch

Switch

Switch

D
Subnet 1

Subnet 3

Subnet 2

Figure 3







Solution:

a), b) See figure below.


E
C

192.168.1.001
A
192.168.2.001
192.168.3.001
00-00-00-00-00-00

44-44-44-44-44-44
77-77-77-77-77-77


Router 1
Router 2
LAN
LAN
LAN


192.168.2.002
192.168.2.003
192.168.1.002

192.168.3.002
55-55-55-55-
22-22-22-22-22-22 33-33-33-33-33-33

88-88-88-88-88-88
55

192.168.2.004
192.168.1.003
D
B

66-66-66-66-
11-11-11-11-11-11

66

192.168.3.003
99-99-99-99-99-99

ECE374: Homework 4 9




c)

1. Forwarding table in E determines that the datagram should be routed to


interface 192.168.3.002.
2. The adapter in E creates and Ethernet packet with Ethernet destination
address 88-88-88-88-88-88.
3. Router 2 receives the packet and extracts the datagram. The forwarding table
in this router indicates that the datagram is to be routed to 198.162.2.002.
4. Router 2 then sends the Ethernet packet with the destination address of 33-
33-33-33-33-33 and source address of 55-55-55-55-55-55 via its interface
with IP address of 198.162.2.003.
5. The process continues until the packet has reached Host B.



d) ARP in E must now determine the MAC address of 198.162.3.002. Host E sends out
an ARP query packet within a broadcast Ethernet frame. Router 2 receives the query
packet and sends to Host E an ARP response packet. This ARP response packet is
carried by an Ethernet frame with Ethernet destination address 77-77-77-77-77-77.

Vous aimerez peut-être aussi