CS计算机代考程序代写 dns DHCP cache Microsoft Word – midterm2sol.docx

Microsoft Word – midterm2sol.docx

Midterm 2 CMPT 471 SOLUTION

1. [2 points] The checksum of a TCP packet is determined using a pseudo-header that contains

the IP source and destination addresses. This pseudo-header is prepended before the UDP
or TCP header and is sent as part of the packet

True
False

2. [2 points] Address resolution can be used to check if the assigned IP address of a machine is

already in use. This process is managed by the ND protocol in IPv6 and the ARP protocol in
IPv4

True
False

3. [2 points] A CIDR network is described by a prefix that is a multiple of 8 bits long

True
False

4. [2 points] When a host on network A determines an automatic IPv6 address for its

interface on network A, the automatic address is based upon a prefix that is stored in a
configuration file found on a router attached to network A.

True
False

5. [2 points] Address resolution is used to determine the IP address of the next hop router

True
False

6. [2 points] DHCP assigns address taken from the allocation of addresses given to the

network. After a DHCP address is given to a host that host can use the address for as long
as it wishes.

True
False

7. [2 points] UDP offers only best effort delivery. Packets are not guaranteed to read their
intended destinations.

True
False

8. [2 points] DHCP is a stateful approach to allocating addresses with a network.
True
False

9. [2 points] Selective repeat will resend all packets that were sent after the lost packet

True
False

10. [2 points] A DNS zone is an area of the DNS tree that is administered by a designated

authority.
True
False

11. [8 points] Consider an IPv4 packet that has arrived at a router and needs to be
fragmented. The packet has an MTU of 1500 bytes. The network the packet needs to pass
through has an MTU of 1220 bytes. Answer each of the following questions. Either
 show your work and the relations you are applying if calculations are involved
 give a one sentence reason why if no calculation is involved .

All points for the problem will be given for the correct relations
to calculate each value.
To give numerical values the student must make assumptions about
header lengths within the IP datagram. The most likely assumption is that
the headers have the default length with no options. Any reasonable
assumption, or no use of numerical values are both acceptable. Defaults
values (no options) are 20 bytes for IP header, 20 bytes for the TCP
header, 8 bytes for the UDP header. Maximum values are 60, 60 and 8.
Any unreasonable assumptions should result in a ½ point
deduction for each unreasonable assumption.

a) How many fragments will be created?
Payload in original IP datagram = MTU (1500) – IP header length (½ point)

IP Payload in full fragment = MTU (1220) – IP header length (½ point)
Number of fragments = Payload in original IP datagram / Payload in full fragment

(½ point)
The number of fragments should be rounded up to the nearest integer. (½ point)

b) What will the value of the more flag for each of the fragments be?
It will be 1 in the first (Number of fragments – 1 ) fragments (1 point)
It will be 0 in the last fragment (1 point)

c) How much data will be placed in each fragment?
Application data in original IP datagram (½ point)

= MTU (1500) – IP header length – TCP or UDP header length
Application data in first full fragment (½ point)

= MTU (1220) – IP header length – TCP or UDP header length
Application data in other full fragments (if necessary)

= MTU (1220) – IP header length (½ point)
Application data in last partial fragments (if necessary) (½ point)

= MTU (1220) – IP header length – application data in other fragments
d) What will the values in the offset field of the IP header be?

 In the first fragment the offset will be 0
 The size of the payload of each IP fragment = MTU of fragment – size of the IP

header
 In the Nth fragment the offset will be the N-1 times the size of the payload in

octets.
 The value of the offset field in the IP header will be the offset in octets divided by 8
(1/2 point for each bulleted point)

12. [8 points] Fill in each blank with one word. Duplicate numbers indicate that the same word
is used in both places
DHCP is used to allocate IPv4 and IPv6 _____1_____ to hosts in a network. These
______1______ are given to hosts for a finite length of time. The _____2_____ timer will
expire when this time expires. However, DHCP is designed to maintain connectivity of the
hosts in the network as much as possible so it does not wait for the lease to expire and then
ask for a new one. Instead it sets a ____3____ timer that will expire when 1/2 of the lease
time has elapsed. After the _____3_____ timer expires the host will begin sending requests
to the DHCP server to renew (extend) the lease. These requests are sent to the servers in a
_______4______ type DHCP message. These messages will be ________5______ to the
DHCP server that gave the host its lease. If the server does not respond then after a
configured number of tries the DHCP client will stop trying until the _______6______ timer
expires. After the ___6_____ timer expires the messages are _______8_______ so they can
received by all DHCP servers.

1 addresses 5 unicast
2 lease 6 rebind
3 renew (renewal) 7 give this point to everyone 7 is missing
4 DHCPREQUEST 8 broadcast
1 point for each of the eight words/phrases
Any word or phrase that carries the same information is acceptable

13. [8 points] Briefly explain the purpose of the following ICMPv6 messages. Each answer
should not exceed 3 sentences.
a) destination unreachable (port unreachable)

This message is sent to the sending source, by the destination host (½ point) , to
indicate that the packet could not be delivered (½ point) because there was no
process with the correct port address on the destination host. (1 point)

b) destination unreachable (no route to network)
This message is sent to the sending source, by a router along the path (½ point), to
indicate that at the sending router (½ point)there was no path to the destination
host in the forwarding table. (1 point)

c) time exceeded (hop limit exceeded)
This message is sent to the sending source, by a router along the path (½ point), to
indicate that at the sending router (½ point) the packet was dropped because its
time to live (ttl) expired. (1 point)

d) packet too big
This message is sent to the sending source, by a router along the path (½ point), to
indicate that at the sending router (½ point) the packet was dropped because it size
was larger than the MTU of the next network it needed to travel through and the do
not fragment flag was set. (1 point)

14. [8 points] Answer each of these questions. One word or phrase is a sufficient answer for

each question.
a) What are the protocols used by IPv4 and IPv6 for address resolution?

ARP for IPv4 (1 point) and ND (or NDP) for IPv6 (1 point)
b) What values are placed in each entry of the ARP cache?

The destination IP address (1 point) and the corresponding destination Ethernet
address (1 point)

c) What is the purpose of a DHCP relay client?
To relay DHCP messages to DHCP servers on other physical network segments of the
same logical network, (2 points)

d) What are two resolvers you could use from the Linux command line?
Any two of DIG, nslookup or host (1 point for each correct resolver)

15. Fill in each blank with one word
Flow control and error control are tasks managed by TCP in the transport layer. Error control
includes the specification of the ____1____ to be taken when a particular error occurs. Flow
control is accomplished using several approaches. This simplest approach ._____2_____ and
____3____ flow control forces the source host to wait for an acknowledgement of the first
packet it sends before it can send a second packet. A more efficient class of flow control
methods are based upon _____4_____ _____5_____ . These methods permit multiple
packets (or octets) to be sent by the source host before the source is required to stop sending
and wait for an ______6______.
1 action 2 points
2 stop 1 point
3 wait 1 point
4 sliding 1 point
5 windows 1 point
6 acknowledgement (ACK) 2 points

16. [20 points] Company A has been assigned most of a block of addresses 202.78.0.0/17.

Company A’s block of addresses does not include 202.78.32.0/20. Company A presently uses
three smaller address blocks 202.78.56.0/21, 202.78.52.0/22, and 202.78.64.0/20 within its
assigned block of addresses. One of the smaller address blocks is used for each department
in Company A.
Assume company A is connected to the internet through a single router, router X, with the
following IP addresses and Ethernet interfaces
 external IP, 123.123.123.1 (to internet) on eth3
 IP connected to 202.78.56.0/21, on eth0
 IP connected to 202.78.52.0/22, on eth120
 IP connected to 202.78.64.0/20, on eth2

Company B has CIDR address block 202.78.32.0/20. Company B has one router Y with
internal IP address 202.78.32.1 and external IP address 123.123.123.3. The rest of
202.78.0.0/17 is not allocated.
There is also a router Z in the internet directly connected to both company A’s router and to
company B’s router.
For parts d) e) and f) the routing table should have columns destination, gateway, mask and
interface . No metric column is required.

A. [6 points] How many bits are in the host id of each of Company A’s networks? How

many addresses are in the address block for each of Company A’s networks? How does
the number of bits in the host id relate the number of addresses in the address block?
If the number of bits in the host id is N then the number of addresses is 2N.
(1.5 points)
The number of bits in the host id is 32 – the number of bits in the mask (or prefix)
202.78.56.0/21 32-21=11 211=2048 (1.5 points)
202.78.52.0/22 32-22=10 210=1024 (1.5 points)
202.78.64.0/20 32-20=12 212=4096 (1.5 points)

B. [3 points] For each of company A’s networks list the addresses that cannot be assigned
to network hosts? Why should these addresses not be assigned to hosts?
The first address in the block of addresses is the network address (½ point), the last
address in each block of addresses is the directed broadcast address (½ point).
Neither of these two hosts should be used as an address for a host. So the addresses
that are not used for hosts are
202.78.56.0, 202.78.63.255,
202.78.52.0, 202.78.55.255,
202.78.64.0, 202.78.79.255
Deduct ½ for each missing or incorrect address (maximum deduction 2)

C. [6 points] List the routing table entries in router X’s routing table that are needed to
send a packet arriving from the internet to the correct one of Company A’s networks.
Destination gateway mask interface
202.78.56.0 * 255.255.248.0 eth0
202.78.52.0 * 255.255.252.0 eth120
202.78.64.0 * 255.255.240.0 eth2
½ point for each entry in table above

D. [5 points] Consider router Z. What entries are needed in router Z’s routing table to
reach ONLY Company A’s three networks and Company B’s network? This routing table
should have two entries. Use aggregation.
Destination gateway mask interface

202.78.0.0 123.123.123.1 255.255.128.0 eth3
202.78.32.0 123.123.123.3 255.255.240.0 ? not specified
1 point for each of the green entries
½ point for each other entry except interface for company B