HW and Examples
HW and Examples
Spring 2021
Homework 9 Solutions
1.1 In DNS (Domain Name System) what is the authoritative DNS server for NJIT?
a. The root name server b. NJIT’s name server
c. The .edu name server d. The HOSTS file
1.2 What does the following DNS resource record do? (time to live is not shown)
(networkutopia.com dns1.networkutopia.com, NS)
a. It ties name “networkutopia.com” to an IP address
b. It ties name “dns1.networkutopia.com” to an IP address
c. It says the name server for domain “networkutopia.com” is
“dns1.networkutopia.com”
d. The resource record is incorrect
1.3 Every DNS name server knows all name -IP address pairs in the Internet.
a. true b. false
2. Put the steps of a full DNS name resolution for www.sample.com in order. 1 is first.
___4__ Local DNS server gets IP address for sample.com name server from .com
name server
__3___ Local DNS server gets IP address for .com name server from root name
server
___5____ Local DNS server gets IP address for www.sample.com from sample.com
name server
The browser will ask the operating system to send a DNS request to get the IP
address of the host running the web server.
b. How will the browser find the protocol port number that http://www.njit.edu is
using?
Web servers use well-known port 80 for the http protocol, so the browser already
knows the port.
Propagation delay for L1 = d/s= 100 x 103 m/108 m/sec = 0.001 sec = 1 msec
Transmission delay onto L1 = L/R =12000 bits / 107 bits/sec = 0.0012 sec=1.2 msec
Transmission delay onto 3 links = 3 * 0.0012 sec = 0.0036 sec = 3.6 msec
6. a. A user downloads 6000 Mbytes of data in 3 seconds. What is the effective data rate in
Mbits per second?
b. A user downloads 6000 Mbytes (total) in 3 seconds. Assuming 10% of the bits are
overhead, what is the effective data rate in Mbits per second?
8. If the bandwidth of a link is 10000 bps and the delay is 1.8 seconds, what is the bandwidth-
delay product?
9. What is the round-trip delay for a packet that passes through 3 routers on the way to the
server and 3 routers on the way back? Assume each router has a queuing delay of 5µsec,
and the server delay is 40µsec. Neglect propagation, transmission, and processing delays.
Delay from leaving client until leaving the first router = 5 μsec (only queueing delay in R1)
Time to pass through 3 routers on the way to the server = 3 * 5µsec = 15 µsec
Delay to get to the server from the last router and server processing = 40μsec
Time to pass through 3 routers on the way back to the host = 3 * 5µsec = 15 µsec
Total delay = 15 + 40 + 15µsec
= 70 µsec
IT 420
Spring 2021
Homework 8 Solutions
1.1 The UDP pseudo-header is sent from the sender to the receiver with the UDP datagram.
a. true b. false
1.2 When using a sender sliding window holding N packets in the Selective Repeat protocol,
how many packets can be sent without requiring a single ACK to be received?
a. 1 b. N-2 c. N d. Cannot be determined
1.3 In TCP, segments that arrive at the receiver out-of-order do not need to be resent.
a. true b. false
//See question 9. Bytes 9 and 10 arrive before bytes 7 and 8. The receiver remembers they
have been received and they do not need to be resent.
1.7 Host A sends SYN + ACK to host B. Assuming normal operation, how does
host B respond?
a. FIN b. SYN c. SYN + ACK d ACK
a. __well-known__ Used by servers for commonly used protocols, such as a web server
3. For each statement below, say whether it applies to TCP, UDP, both, or neither
a. __TCP________ Stream-based
// Stream based means that the application programmer just has to send (“stream”)
the data to the socket and TCP will break it up into segments. This IS NOT
streaming audio or video.
Packet 0
Time
Out
Packet 0
Ack 0
// This was marked partially incorrect if you showed a lost packet, rather than the required
lost acknowledgement.
5. A sender sends packets 5, 6, 7, 8, and 9 to a receiver, but packet 6 is lost. What packet(s) will
be resent after the timeout in:
6. Station A needs to send a message consisting of 9 packets to Station B using a sliding window
(window size 3) and go-back-n protocol. Assume all packets are ready and immediately
available for transmission and that the maximum number of packets are sent at a time. If packet
1 that A transmits gets lost (but no acks from B ever get lost), then what is the number of
packets that A will transmit for sending the message to B?
___C____ The application in the receiver is consuming data more slowly than it is arriving
___D_____ The application in the receiver is consuming data as quickly or more quickly
than it is arriving
8. Assume that a TCP sending sliding window is of size 4 and currently includes bytes 8, 9, 10
and 11 . The next byte to be sent is byte 8. Show the sender sliding window (only) and state
what sequence number (if any) will be sent after each step in the following sequence of events.
e. The segment sent in (d) times window _10 11 12 13___________ seq ___10_____
out and is resent
g. Receive a segment holding bytes 11, 12, and 13 which are not consumed.
10. A TCP connection has 1200 unsent bytes in the sender sliding window. The receive window is
1000 bytes and the congestion window is 1400 bytes. How many bytes can the sender send?
1.1 Assume that the destination address in an IP packet is 131.45.5.5 and the forwarding
table contains all of the entries below. Which entry will be used for this destination
address?
a.131.0.0.0 / 8 b. 131.45.0.0 / 16 c. 131.45.3.0 / 24 d. 0.0.0.0 / 0
// a, b, and d match the destination. c does not because the third octet is different.
// Choose the match with the longest mask, which is b
1.2 Which type of autonomous system has connections to more than one autonomous
system and is designed to carry transit traffic?
a. Transit AS b. Intermediate AS c. Multi-homed AS d. Stub AS
Network/Mask Next_Hop
128.235.223.0/24 deliver directly
128.235.168.0/21 128.235.171.1
128.235.176.0/21 128.235.178.1
128.235.172.0/22 128.235.173.1
0.0.0.0/0 128.235.180.1
Network/Mask Next_Hop
128.235.223.0/24 deliver directly
10000000.11101011.11011111. 00000000
128.235.168.0/21 128.235.171.1
10000000.11101011.10101 000.00000000
128.235.176.0/21 128.235.178.1
10000000.11101011.10110 000.00000000
128.235.172.0/22 128.235.173.1
10000000.11101011.101011 00.00000000
0.0.0.0/0 128.235.180.1
Explain what router R will do with packets with the following destination addresses. Make
sure to use longest match routing. Expected answers are of the form “forward to the next
hop IP address”.
a. 128.235.180.15 10000000.11101011.10110100.00001111
Matches third entry. Forward to 128.235.178.1
b. 128.235.167.82 10000000.11101011.10100111.01010010
Use default. Forward to 128.235.180.1
c. 128.235.173.6 10000000.11101011.10101101.00000110
Matches fourth entry. Forward to 128.235.173.1
4. Consider the diagram below. Assume all routers are NOT NAT routers. Host B sends a
packet to host E.
C E
A 192.168.1.001
00-00-00-00-00-00 192.168.2.001 192.168.3.001
44-44-44-44-44-44 77-77-77-77-77-77
Source IP ___192.168.1.003_________________
Destination IP ___192.168.3.001________________
b. Assuming the ARP caches are up to date, what are the source and destination IP
addresses in the IP packet and the source and destination MAC addresses in the frame
that goes from router 2 to E?
Source IP ____192.168.1.003___________________
Destination IP _____192.168.3.001_______________
//Since these are not NAT routers, the source and destination IP stay the same for all
hops. The source and destination MACs change for each hop because each router
makes a new frame.
5. For each item below, indicate whether it applies to RIP, OSPF, IS-IS, BGP or none. (Choose
all that apply.)
The original routing table (simplified for the purpose of this problem) in K is:
Destination Distance
Net 3 3
Net 5 4
Net7 2
Show the contents of the routing table in K after it has been revised to reflect the
information from J.
There are three cases where K’s forwarding table is changed using RIP ro uting.
1. J knows a route that K does not. In the problem this is Net 7. The hop count from K to
Net 7 is 2 (from J to net 7) + 1 (from K to J) = 3. The next hop is J, since J knows how to
get to Net 7.
2. J knows a better route than K does. In the problem, this is Net 3. J know a path with 3
hops but K’s current path is 8 hops. New hop count is 3 (from J to Net 3) + 1 (from K to
J) = 4. The next hop is J, since J knows how to get to Net 3.
3. For a particular destination network, K is already sending to J but J says the path is now
longer. In this situation, we will believe J and make the path in K longer. In the problem,
this is Net 5. J says the path to Net 5 is now 4 hops, but K thinks it is 2 hops. New hop
count is 4 (from J to Net 5) + 1(from K to J) = 5. The next hop stays J.
7. Find the shortest path from A to F using Dijkstra’s Algorithm. You must state all steps of
the algorithm as demonstrated in class.
3
B C
10
2
5 3
F
A
10
2
1
6 E
D
7
1. Mark A as solved. Cost to B from A is 2, cost to D from A is 6 and cost to F from A is 10.
2. Lowest cost for an unsolved node is B, so mark B as solved. Cost to C through B is 5, and
cost to D through B is 7
3. Lowest cost for an unsolved node is C, so mark C as solved. Cost to D through C is 8, cost
to E through C is 7, and cost to F through C is 15.
4. Lowest cost for an unsolved node is E, so mark E as solved. Cost to F through E is 8 and
cost to D through E is 14.
5. Done. Lowest cost path is A-B-C-E-F with a cost of 8
8. We wish to find the path between two networks in two different neighboring autonomous
systems. The source network is in AS A and the destination network is in AS B. Put an “X”
in front of the actions that occur to find the path.
//Interior and exterior routing works together to get a packet from the source to the dest.
Exterior routing finds what autonomous systems (ASs) must be gone through. Interior
routing finds the best path between two routers within one AS. So BGP says go thru AS200,
then interior routing says go thru these interior routers to get through AS200
_______ The interior routing protocol in AS A finds the best path from the source to the
destination
// False. The source and destination are in different AS’s, and an interior protocol only
finds paths within one AS.
____X__In AS B, the interior routing protocol finds the best path from the border router
that connects to AS A and the destination
// True. Interior protocol finds best path with AS B.
9. Using the wireshark traces provided on Canvas, answer the following questions concerning
BGP.
a. Open 1_LAPA_BGP_INITIALCIRCLE.cap, which captures an initial BGP peering
session between two autonomous systems.
i. Examine packet 19, which is a BGP OPEN message – it does not advertise
available routes, it just introduces BGP peers to each other. What is the
autonomous system (AS) number of the sender?
AS number is 200
ii. Again using packet 19, are BGP messages carried by TCP or UDP?
TCP
iii. Packet 37, a BGP UPDATE message, advertises a route. What is the prefix and
mask of the advertised network? (Hint: look at the network layer reachability
information)
3.0.0.0/8
iv. Again using packet 37, find the path through autonomous systems to get to the
destination network identified in iii above. (Hint: look at the path attributes)
200 300
3.0.0.0/8
IT 420
Spring 2021
Homework 6 Solutions
1.3 IPv6 packets can only be fragmented at the source but IPv4 packets can be fragmented
by the source or any router.
a. True b. false
2. A large IPv4 packet carrying a 20 byte header and 1400 bytes of data (total packet length is
1420 bytes) is fragmented to pass over a network where the MTU is 620 bytes. Assume the
identification of the original datagram is 12345. For each fragment, show the contents of the
Identification field, the Offset field, the Total Length field, and the More Fragments flag in
the IP header.
Number of fragments = 1400 total /600 per frag = 2.333, so three fragments
1400 – 600 – 600 = 200 bytes of data in fragment 3.
Fragment 1: base header | fragmentation header | auth header + dest header + data
40 bytes 8 bytes 16 bytes + 20 bytes + 716 bytes
Number of fragments: 2036 total fragmentable / 752 per frag = 2.71, so 3 frags
2000 – 716 – 752 = 532 bytes of data in fragment 3.
4. A large IPv4 datagram is fragmented into 4 fragments at router 1 to pass over a network with
an MTU of 1500 bytes. Assume each fragment is larger than 900 bytes. Then, each fragment
arrives at router 2, which wants to forward the fragments over a network with an MTU of
900 bytes to the destination. How many fragments will arrive at the destination host?
Each of the four original fragments will be fragmented into 2 fragments by router 2.
4* 2 = 8 fragments
5. UDP is a transport layer protocol that allows the application programmer to choose the size
of the UDP segment, which is encapsulated in an IP packet. The application programmer
chose to make each UDP segment the maximum size, which is about 65K bytes.
Unexpectedly, the application program has poor performance. Why is this and how can the
application programmer fix it?
A UDP segment of 65K bytes means the IP packet is also a little over 65K bytes. This will
have to be fragmented into many fragments to fit into smaller frames. Fragmentation
seriously degrades network performance. The application programmer should make the
UDP segments small enough so that fragmentation is not required.
6. Match the protocol with its function. One function is not used
No. The ARP function is provided by the ICMPv6 neighbor discovery protocol.
Yes.
8. A NAT router connects a private network to the Internet and uses global IP address
50.50.50.50. Host 10.0.0.2 on the private network sends an IP packet to a server at
40.40.40.40.
a. What will be the source and destination IP addresses in the packet header after it
leaves the sending host on the private network?
Source IP ___10.0.0.2____________________________________
Destination IP ____40.40.40.40____________________________________
b. What will be the source and destination IP addresses in the packet header after it
leaves the NAT router?
Source IP ___50.50.50.50____________________________________
Destination IP ___40.40.40.40_____________________________________
c. What will be the source and destination IP addresses in the packet header when the
server’s response leaves the server?
Source IP ____40.40.40.40___________________________________
Destination IP ____50.50.50.50____________________________________
9. Consider the diagram below. Assume all routers are NOT NAT routers. Host A sends a
packet to host E.
C E
A 192.168.1.001
00-00-00-00-00-00 192.168.2.001 192.168.3.001
44-44-44-44-44-44 77-77-77-77-77-77
a. Assume the ARP cache in host A is empty, so it will have to ARP to find the MAC
address of the router 1interface. What are the source and destination MAC
addresses in the ARP request? [Hint: an ARP request is broadcast.]
b. What are the source and destination MAC addresses in the ARP response?
Recall that the ping tool, which checks if a remote host is reachable, is implemented with
ICMP. The message that goes to the remote host is an ICMP Echo request and the response
from the remote host is an ICMP Echo reply. Examine packets 3 and 4.
a. What is the IP address of the host sending the Echo request? __192.168.1.101______
c. Expand the ICMP data for packet 3. What are the type and code?
d. Expand the ICMP data for packet 4. What are the type and code?
1.1 A network uses 4 subnet id bits. How many possible subnets can be created?
a. 4 b. 14 c. 16 d. Cannot be determined
1.2 8 subnets of equal size are created in a /19 network. What is the mask for each
subnet?
a. /17 b. /19 c. /22 d. /23
// mask = 19 + 3 = 22
2. We wish to create 100 subnets in a /22 network. Assume that we wish to use the minimum
number of bits for the subnet id. How many bits will be used for the subnet id?
3. A network uses 23 bits of network id and 4 bits of subnet it. How many actual hosts
can be on each subnet?
4. We wish to create 16 subnets in a /22 network. Assume that we wish to use the minimum
number of bits for the subnet id. How many actual hosts can be on each subnet?
What are the network addresses (in binary and dotted decimal/mask notation) for each
subblock?
_
__10000111.01100110.11000000.110 00 000 135.102.192.192/29__________
7. An ISP has a large /17 CIDR block. The ISP uses the next 6 bits to identify to which
customer to send a packet. One of those customers (customer A) uses another 2 bits to
identify subnets within the customer's site. How many bits does customer A's gateway router
look at to determine to which subnet to send the packet?
8. Your boss wants you to design subnets to support a new office. The office has three floors
and each floor should be a subnet.
Design the subnets using variable length subnet masks. [Assume the address blocks
include addresses where the host ids are all zeros and all ones.]
First Floor:
Second Floor:
Third Floor:
4567::12DF:0
10. Expand BC:34::56 to its un-compressed form. You do not need to include leading zeros.
BC:34:0:0:0:0:0:56
11.1 If you create an IPv6 suffix using EUI-64, what is it based on?
a. the IPv4 host id b. the MAC address c. a random number d. the mask
11.2 This type of IPv6 address is valid only on the current network and will not be routed.
A. EUI-64 B. Link-local C. Multicast D. Global unicast
12. Answer the following questions concerning the IPv4 and IPv6 protocols:
12.1 An IPv6 packet consists of the following (in the stated order): Base Header,
Fragmentation Header, Routing Header, UDP Segment. What will be the Next
Header field of the Routing Header?
a. Fragmentation Header b. Authentication Header
c. UDP d. Routing Header
// next header field says what comes next in the packet. UDP comes next after
routing header
12.2 What is the purpose of the Time To Live field in the IPv4 header?
a. It indicates the quality of service requirements
b. It indicates the number of bytes in the header
c. It indicates whether the packet is a fragment or not
d. It detects lost packets
13. An IPv4 packet has 900 bytes of data and a 24 byte header.
a. What values will be in the HLEN (also called IHL) field in the header?
14. An IPv6 packet contains the 40 byte base header, two 20 byte extension headers, and 900
bytes of data.
// payload length field is everything in the packet except for the base header
payload length = 900 + 20 +20 = 940 bytes
1.1 To initiate a connection using a socket in the standard client-server model, the client
must know the following about the server:
a. the MAC address of the host running the server program
b. the IP address and the MAC address of the host running the server program
c. the IP address of the host running the server program and the protocol port the
server is using
d. the name of the server program
1.3 In HTTP (HyperText Transport Protocol), what is the difference between the browser
cache and a cookie?
a. The browser cache keeps copies of recently used files and a cookie keeps
information that the server needs to remember previous interactions
b. Nothing. They are two names for the same thing
c. Cookies hold copies of recently used files and the browser cache keeps information
that the server needs to remember previous interactions
d. The browser cache is in the client and cookies are in a proxy server
1.4 Which e-mail protocols pull mail from the receiver’s email server? (Choose two)
a. IMAP b. MIME c. POP d. SMTP
1.5 Standard FTP uses two connections: control and data. Which of the following is true?
a. The data connection is initiated by the client
b. The data connection is active for the entire length of the FTP session, which may
involve several file transfers.
c. The control connection is initiated by the server
d. The control connection is active for the entire length of the FTP session, which may
involve several file transfers.
2. Many computing applications use caching to increase performance. Answer the questions
below concerning caching:
a. What is one difference between HTTP caching in the client and HTTP caching in a
proxy server?
One difference is location – the browser cache is located in the client and the proxy
server cache is in a separate device.
Also, the browser cache holds only files recently used by this host and the proxy
server cache holds files recently used by all clients that use the proxy server.
b. Describe the steps a browser takes to determine whether to use an item from its
cache.
A browser saves the Last-Modified date information along with the cached copy.
Before it uses a document from the local cache, a browser either makes a HEAD
request to the server and compares the Last-Modified date of the server’s copy to
the Last-Modified date on the cached copy or uses the if-modified-since header. If
the cached version is stale, the browser downloads the new version.
c. Contrast how browser caches, DNS caches, and ARP caches avoid stale data.
HTTP finds stale data when files on the server have been modified more recently
that files in the cache. DNS caches use the time to live in each resource record to
decide when to remove it from cache. ARP removes the oldest entry whenever the
table runs out of space or after an entry has not been updated for a long period of
time (e.g. 20 minutes).
3. Consider the email protocols POP and IMAP. List one way they are the same and one way
they are different.
They are the same because both are used to pull email from the receiver’s mail server to his
mail client. They are different because IMAP is more complex and full-featured than POP.
4. Consider the image below. Label each of the three arrows to show which e-mail protocol is
being used. The choices are IMAP, DHCP, and SMTP.
1. Assume that a TCP sending sliding window is of size 5 and currently includes bytes 8, 9, 10
11, and 12. The next byte to be sent is byte 8.
a. Initial condition
Window: _8 9 10 11 12_________
c. Receive acknowledgement = 11
f. Receive acknowledgement = 13
2. A TCP receiving sliding window is of size 5 and is currently waiting for bytes 4, 5, 6, 7 and
8. Assume all bytes are consumed as they arrive.
a. Initial condition
e. Receive two segments back-to-back: the first holds bytes 10 and 11, the second
holds bytes 12 and 13. Assume cumulative acks.
3. A TCP receiving sliding window is of size 5 and is currently waiting for bytes 11, 12, 13,
14, and 15.
a. Initial condition
b. Receive a segment holding bytes 11 and 12, which are immediately consumed
c. Receive a segment holding bytes 13 and 14, which are not consumed
e. Receive a segment holding bytes 15, 16, 17, 18 and 19 which are not consumed
2
A D E
1
2
5 C 3
20 3000
MF 1 1 1 0
20 3980
0 1480 2960
Id x x x
MF 1 1 0
4. We wish to assign a CIDR block of 32 addresses (include host addresses of all 0’s and
all 1’s in the block, even though they will not be assigned to actual hosts)
a. How many host id bits are needed for 32 addresses? _5 bits because 25 = 32
a. How many bits will be used for the subnet id? __4 bits (24= 16)
a. How many bits should the ISP add to the mask to identify the subnets?
___2 bits because 22 = 4____
d. For the first subblock, what range of addresses are in the CIDR block in binary?
8. A network has the address 204.15.6.0/24. Using variable length subnet masks, create
two subnets, one with12 hosts (subnet A) and one with 6 hosts (subnet B).
a. How many bits of host id are needed for subnet A? _4 (24 – 2 = 14)___
b. What is the first address in the subnet A block? _204.15.6.0 (00000000)____
Assume that the subnet B address block starts immediately after the subnet A address
block.
d. How many bits of host id are needed for subnet B? 3 (23 – 2 = 6)_