0% found this document useful (0 votes)
12 views41 pages

HW and Examples

The document contains solutions to homework questions for IT 420 Spring 2021, focusing on DNS, network performance, TCP, and UDP protocols. It includes multiple-choice questions, step-by-step processes for DNS resolution, and calculations related to network delays and throughput. Additionally, it covers concepts such as sliding window protocols, congestion control, and the handling of lost packets.

Uploaded by

chris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views41 pages

HW and Examples

The document contains solutions to homework questions for IT 420 Spring 2021, focusing on DNS, network performance, TCP, and UDP protocols. It includes multiple-choice questions, step-by-step processes for DNS resolution, and calculations related to network delays and throughput. Additionally, it covers concepts such as sliding window protocols, congestion control, and the handling of lost packets.

Uploaded by

chris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

IT 420

Spring 2021
Homework 9 Solutions

Note: Where applicable, units must be correct for full credit

1. Answer the following questions concerning DNS:

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.

___6___ Local DNS server returns IP address of www.sample.com to the client

___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

___1___ Client checks HOSTs file

___5____ Local DNS server gets IP address for www.sample.com from sample.com
name server

___2___ Client sends DNS query to local DNS server.

3. A browser in a client wants to connect to http://www.njit.edu.

a. How will the browser find the IP address of http://www.njit.edu?

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.

4. Answer the following questions concerning network performance:

4.1 What is transmission delay?


a. The time required for a signal to travel across a transmission medium
b. The time needed to transmit a packet onto the link
c. The time a packet spends waiting to be processed by a router
d. The time required for a server to respond to a request

4.2 What is goodput?


a. The total round-trip delay
b. Amount of data transferred per unit time
c. The channel capacity of a single channel calculated using Nyquist’s or Shannon’s
formula
d. Change in delay

4.3 Why is jitter important?


a. high jitter means long delays
b. high jitter means the output of a real-time transmission, such as audio or video,
will be distorted
c. high jitter causes low throughput
d. the presence of jitter means the MPLS protocol cannot be used

4.4 What is quality of service?


a. the relationship between delay and throughput
b. the percentage of errors in the transmission
c. informal descriptions of performance, such as “high speed”
d. providing a specific level of service (throughput, delay, and/or jitter) by
choosing appropriate routes through the internet

4.5 What causes queueing delay?


a. transmitting a signal across a transmission medium
b. low goodput
c. packets having to wait to be processed by the router
d. high packet length
5. Consider a source computer (S) transmitting a packet of size 12000 bits to a destination
computer (D) over a network of two routers (R1 and R2) and three links (L1, L2 and L3).
L1 connects S to R1;L2 connects R1 to R2; and L3 connects R2 to D. Let each link be of
length 100km. Assume signals travel over each link at a speed of 10^8 meters per second.
Assume that the link bandwidth on each link is 10 Mbps.

a. What is the propagation delay for L1?

Propagation delay for L1 = d/s= 100 x 103 m/108 m/sec = 0.001 sec = 1 msec

b. What is the total propagation delay from S to D?

Propagation delay for 3 links = 3 * 0.001sec = 0.003 sec = 3 msec

c. What is the transmission delay to put the packet onto L1?

Transmission delay onto L1 = L/R =12000 bits / 107 bits/sec = 0.0012 sec=1.2 msec

d. What is the total transmission delay from S to D?

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?

6000 Mbytes * 8 bits = 48000 Mbits


byte
throughput = data size / time
= 48000 Mbits / 3 sec
= 16000 Mbps

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?

6000 Mbytes * 8 bits = 48000 Mbits


byte
# data bits = 0.9 * 48000 = 43200 Mbits
throughput = data size / time
= 43200 Mbits / 3 sec
= 14400 Mbps
7. A source computer is connected to a destination computer through one router (R1). The
throughput of the first hop is 100Mbps and the throughput of the second hop is 1000 Mbps.
What is the end-to-end throughput?

Throughput = min (100 Mbps, 1000 Mbps) = 100 Mbps


// end to end throughput is the minimum

8. If the bandwidth of a link is 10000 bps and the delay is 1.8 seconds, what is the bandwidth-
delay product?

Bandwidth–delay product = 10000 bits /sec * 1.8 sec = 18000 bits


// units is bits, not bps

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. Answer the following questions concerning TCP and UDP:

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.4 The bytes that are in a TCP receiver’s sliding window


a. have been received and acknowledged but not consumed OR can be accepted, but have
not yet been received
b. can be sent OR have been sent but not yet acknowledged
c. have been received, acknowledged and consumed
d. have already been sent and acknowledged

1.5 Which host is responsible for congestion control?


a. Sender b. Receiver c. Both d. Neither, this is handled by switches

1.6 What is a disadvantage if the TCP timeout is too long?


a. The sender will do nothing while waiting for the timer to time-out
b. The receiver window size will get too big
c. The sender will unnecessarily time out and resend data
d. The TCP connection will be closed too early

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

1.8 What is Karn’s algorithm?


a. It chooses whether to use TCP or UDP for a transmission
b. It doubles the time-out period if a segment times-out
c. It increases the size of the congestion window exponentially after each
acknowledgement
d. It cuts the size of the sender sliding window in half if a segment times-out
2. For each statement below, say whether it applies to a well-known port, a registered (reserved)
port, or a private port.

a. __well-known__ Used by servers for commonly used protocols, such as a web server

b. __private_____ Used by clients, such as a web browser

c. __private______ Assigned temporarily by the operating system

d. __well-known_ Assigned by an external agency to commonly used protocols that


have RFCs

e. _registered__ Used by proprietary or uncommon protocols. Documented to reduce


the chances of two programs on the same host using the same port.

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.

b. ___UDP_____ Used for multicasting and broadcasting

c. ___UDP_______ Used if performance is more important than correctness

d. ___neither_______ Internet layer protocol


// TCP and UDP are transport layer protocols

e. ___both_______ Uses source and destination protocol ports in the header

f. ___TCP_______ Used if data must be received correctly and completely


4. Using a drawing similar to those presented in the notes, show a lost acknowledgement and the
recovery from it in the Stop-and-Wait protocol.

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:

a. go-back-n ___6, 7, 8, 9_______

b. selective repeat ____6_____________

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?

A sends 1, 2, 3 3 packets total


A resends 1, 2, 3 6 packets total
A sends 4, 5, 6 9 packets total
A sends 7, 8, 9 12 packets total
7. Match the TCP action with the situation that causes the action.

A. Make the timeout longer


B. Make the timeout shorter
C. Make the receive window smaller
D. Make the receive window larger
E. Make the congestion window smaller and double the time-out
F. Make the congestion window larger

___C____ The application in the receiver is consuming data more slowly than it is arriving

___A_____ The round-trip time gets longer

___D_____ The application in the receiver is consuming data as quickly or more quickly
than it is arriving

____E_____ A segment times-out

____B_____ The round-trip time gets shorter

____F_____ Segments are being acknowledged normally

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.

a. Initial condition window __8 9 10 11___________

b. Send a segment with 2 bytes window__8 9 10 11____________ seq ___8______


//sending window does not slide when data sent because the sender may have to resend
the data, as shown in step e below. The window only slides when ack received

c. Receive acknowledgement = 10 window __10 11 12 13___________

d. Send a segment with 4 bytes window__10 11 12 13____________ seq ___10___

e. The segment sent in (d) times window _10 11 12 13___________ seq ___10_____
out and is resent

f. Receive acknowledgement = 14 window _14 15 16 17____________


9. A TCP receiving sliding window is of size 5 and is currently waiting for bytes 5, 6, 7, 8, and 9.
Show the receiver sliding window (only) and state what window size and acknowledgement
will be sent after each step in the following sequence of events.

a. Initial condition window _5 6 7 8 9___________

b. Receive a segment holding bytes 5 and 6, which are consumed

window _7 8 9 10 11__________ ack ___7________ win size ___5_______

c. Receive a segment holding bytes 9 and 10, which is not consumed

window __7 8 9 10 11_________ ack ____7_______ win size ____3_______


✓✓
// 9 and 10 arrive out-of-order. They can be accepted since they are in the window. The
window cannot slide because the receiver is still waiting for bytes 7 and 8. The next
byte expected is still 7.

d. Receive a segment holding bytes 7 and 8, which is not consumed

window __7 8 9 10 11________ ack ____11______ win size ____1_______

e. Bytes 7 and 8 are consumed

window __9 10 11 12 13______ ack ____11_______ win size ____3_______

g. Receive a segment holding bytes 11, 12, and 13 which are not consumed.

window __9 10 11 12 13____________ ack ____14_______ win size _____0______

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?

min (1200, 1000, 1400) = 1000 bytes


IT 420
Spring 2021
Homework 7 Solutions

1. Answer the following questions concerning forwarding and routing:

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

1.3 What does an interior routing protocol do?


a. It finds the list of autonomous systems to pass through to get to a destination
network
b. It compares the destination IP with the forwarding table to determine the next hop
c. It finds the best path to a destination router within the autonomous system, and
then uses this to update the forwarding tables
d. It detects and breaks loops in switch networks

1.4 What does an exterior routing protocol do?


a. It finds the list of autonomous systems to pass through to get to a destination
network
b. It compares the destination IP with the forwarding table to determine the next hop
c. It finds the best path to a destination router within the autonomous system, and then
uses this to update the forwarding tables
d. It detects and breaks loops in switch networks

1.5 Which of these is NOT a disadvantage of RIP?


a. Hop count is not always a good metric
b. Each router computes routes independently using Dijkstra’s algorithm
c. It requires the transfer of large routing tables between routers
d. It is slow to converge

1.6 Which interior routing protocol is based on Dijkstra’s graph algorithm?


a. BGP b. OSPF c. IS-IS d. RIP
// either b or c is correct
2. Create the forwarding table for Router S in the network below. All networks are /8 and
Router R is the default next hop.

Destination Network Next Hop


30.0.0.0/8 Deliver directly
40.0.0.0/8 Deliver directly
20.0.0.0/8 30.0.0.6
11.0.0.0/8 30.0.0.6
0.0.0.0/0 30.0.0.6

A router can only do two things:


• Deliver directly if the router is part of the network that the destination IP is on
• Forward to a neighbor router if the router is not part of the network that the
destination network is on
Router S can deliver directly to 30.0.0.0 and 40.0.0.0
Router S will send to neighbor router R for 11.0.0.0 and 20.0.0.0. The next hop IP address
is 30.0.0.6, since this port of the router is on the same network as S (the 30.0.0.0
network)
The problem says that the default is Router R. Again, the next hop IP is 30.0.0.6

3. A router R has forwarding table:

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

LAN Router 1 LAN Router 2


LAN

192.168.1.002 192.168.2.002 192.168.2.003


22-22-22-22-22-22 33-33-33-33-33-33 55-55-55-55-55 192.168.3.002
88-88-88-88-88-88
192.168.2.004
B 192.168.1.003 D 66-66-66-66-66
11-11-11-11-11-11 192.168.3.003 F
99-99-99-99-99-99
a. 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 B to router 1?

Source IP ___192.168.1.003_________________

Destination IP ___192.168.3.001________________

Source MAC ___11-11-11-11-11-11________________

Destination MAC ___22-22-22-22-22-22_________________

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_______________

Source MAC _____88-88-88-88-88-88_______________

Destination MAC _____77-77-77-77-77-77_______________

//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.)

___BGP____________________ Does not use metrics

___RIP, OSPF, IS_IS________ Internal routing protocol

___BGP_____________________ External routing protocol


6. Neighboring routers J and K use the RIP routing protocol

The original routing table (simplified for the purpose of this problem) in K is:

Destination Distance Route


Net 1 1 direct
Net2 2 J
Net 3 8 M
Net 4 5 M
Net 5 2 J
Net 6 5 Q

The update from J 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.

Destination Distance Route


Net 1 1 direct
Net2 2 J
Net 3 4 J
Net 4 5 M
Net 5 5 J
Net 6 5 Q
Net 7 3 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

_______ OSPF finds which autonomous systems are in the path.


// False. Since OSPF is interior, it finds path within one AS, not a list of ASs

____X___ BGP finds which autonomous systems are in the path.


//True. BGP is exterior, so it finds list of AS’s to get from here to there
____X____In AS A, the interior routing protocol finds the best path from the source to the
border router that connects to AS B.
//True. Interior protocol finds best path within AS A

_______ 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

b. Open 2_LAPA_BGP_BROKENCIRCLE.cap, which captures the withdrawal of a


route.
i. Examine packet 7, another BGP UPDATE message. What is the prefix and
mask of the withdrawn route?

3.0.0.0/8
IT 420
Spring 2021
Homework 6 Solutions

1. Answer the following questions concerning fragmentation:

1.1 Why is fragmentation of an IP packet sometimes required?


a. Because an IP packet can hold more data than a frame
b. Because a frame can hold more data than an IP packet
c. Because networks can be subnetted
d. Because different applications send different amounts of data

1.2 An IPv4 fragment has an offset that is 0 and MF = 1. This is


a. the first fragment b. a middle fragment
c. the last fragment d. none of these

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: Identification = 12345


Offset = 0
Total Length = 620 (20 bytes header and 600 bytes of data)
More Fragments = 1 (or true)

Fragment 2: Identification = 12345


Offset = 600/8 = 75
Total Length = 620 (20 bytes header and 600 bytes of data)
More Fragments = 1 (or true)

Fragment 3: Identification = 12345


Offset = 1200/8 = 150
Total Length = 220 (20 bytes header and 200 bytes of data)
More Fragments = 0 (or false)
3. An IPv6 packet has a 40 byte base header, a 16 byte authentication extension header and a 20
byte destination extension header (neither of which are used for routing) and 2000 bytes of
data (total packet length is 2076 bytes). This is to be fragmented to travel over a network
with a MTU of 800 bytes. Considering the fragmentable and unfragmentable parts of this
packet, create a sketch showing the headers and data in each fragment, including the number
of bytes. Don’t forget the fragmentation header, which is 8 bytes.

Fragment 1: base header | fragmentation header | auth header + dest header + data
40 bytes 8 bytes 16 bytes + 20 bytes + 716 bytes

Fragment 2: base header | fragmentation header | data


40 bytes 8 bytes 752 bytes

Fragment 3: base header | fragmentation header | data


40 bytes 8 bytes 532 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

__E__ ARP A. Provides error detection/reporting and network management


queries

__B_ NAT B. Permits many hosts to share a few public IP addresses by


translating between private and public IP addresses

__C__ DHCP C. Assigns IP addresses automatically, usually for a limited


amount of time

__A__ ICMP D. Given a MAC address, finds the corresponding IP address

E. Given an IP address, finds the corresponding MAC address

7. a. Is ARP used in IPv6?

No. The ARP function is provided by the ICMPv6 neighbor discovery protocol.

b. Is ICMP used in IPv6?

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

LAN Router 1 LAN Router 2


LAN

192.168.1.002 192.168.2.002 192.168.2.003


22-22-22-22-22-22 33-33-33-33-33-33 55-55-55-55-55 192.168.3.002
88-88-88-88-88-88
192.168.2.004
B 192.168.1.003 D 66-66-66-66-66
11-11-11-11-11-11 192.168.3.003 F
99-99-99-99-99-99

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

Source MAC in ARP request _00-00-00-00-00-00_____

Destination MAC in ARP request _ff-ff-ff-ff-ff-ff__________


//ff-ff-ff-ff-ff-ff is the broadcast MAC address

b. What are the source and destination MAC addresses in the ARP response?

Source MAC in ARP response __22-22-22-22-22-22______

Destination MAC in ARP response __00-00-00-00-00-00_______


10. Use the Wireshark trace (icmp-ethereal-trace-1) provided on Canvas to answer the questions
below concerning the ICMP Protocol.

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______

b. What is the IP address of the remote host? __143.89.14.34_______

c. Expand the ICMP data for packet 3. What are the type and code?

_type = 8, code = 0_______

d. Expand the ICMP data for packet 4. What are the type and code?

__type = 0, code = 0__________

e. Are ICMP messages encapsulated by IP packets (yes or no) __yes________________


IT 420
Spring 2021
Homework 5 Solutions

1. Answer the following questions concerning IPv4 subnetting:

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

1.3 What is an advantage of variable length subnet masks?


a. It creates subnets of the same size
b. Each subnet can be of a different size so that each subnet has just the right
number of addresses
c. Each subnet uses several different masks
d. It can be done automatically by a router

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?

log2(128) = 7, so 7 subnet bits

3. A network uses 23 bits of network id and 4 bits of subnet it. How many actual hosts
can be on each subnet?

Number of host id bits = 32 – 23 – 4 = 5


25-2 = 30 hosts

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?

log2(16) = 4, so 4 subnet bits


Number of host id bits = 32 – 22 – 4 = 6
26-2 = 62 hosts

5. An organization has a network address of 135.102.192.0/18. The organization wants to


create subnets so that each subnet can support 200 hosts. How many bits of subnet id are
there?

log2(256) = 8 bits of host id


Number of subnet id bits = 32 – 18 – 8 = 6
6. An ISP has CIDR block 135.102.192.192/27. The ISP wants to create 4 sub-blocks of equal
size from this block.

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__________

__10000111.01100110.11000000.110 01 000 135.102.192.200/29__________

__10000111.01100110.11000000.110 10 000 135.102.192.208/29__________

__10000111.01100110.11000000.110 11 000 135.102.192.216/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?

number of bits that A’s gateway router looks at = 17 + 6 + 2 = 25 bits


//recall that the mask gets longer as we break up addresses into smaller blocks

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.

• The net id for the entire site is 100.10.172.0/24


• The LAN on the first floor must be able to support at least 100 hosts.
• The LAN on the second floor must be able to support at least 50 hosts.
• The LAN on the third floor must be able to support at least 25 hosts.

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:

Number of host id bits: _log2(128) = 7 bits________________

First address _100.10.172.00000000 = 100.10.172.0__

Last address __100.10.172.01111111 = 100.10.172.127__

Second Floor:

Number of host id bits: __ log2(64) = 6 bits________________


First address _100.10.172.10000000 = 100.10.172.128__

Last address __100.10.172.10111111 = 100.10.172.191__

Third Floor:

Number of host id bits: __ log2(32) = 5 bits________________

First address _100.10.172.11000000 = 100.10.172.192__

Last address __100.10.172.11011111 = 100.10.172.223__

9. Show the shortest form of 4567:0000:0000:0000:0000:0000:12DF:0000 by removing


leading zeros and using ::

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. Answer the following questions concerning IPv6 addresses:

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

11.3 An anycast IPv6 address is


a. One source to one destination
b. One source to many destinations
c. One source to all destinations
d. One source to the one most reachable member of a group

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?

//HLEN field is length of header in 4 byte units


HLEN = bytes in header / 4
= 24 / 4
=6

b. What value will be in the Total Length field in the header?

// Total length field is all bytes in the packet = header + data


Total length = 900 + 24 = 924

14. An IPv6 packet contains the 40 byte base header, two 20 byte extension headers, and 900
bytes of data.

a. What value is in the payload length field?

// payload length field is everything in the packet except for the base header
payload length = 900 + 20 +20 = 940 bytes

b. How many total bytes are in the packet?

total bytes = 900 + 20 + 20 + 40 = 980 bytes


IT 420
Fall 2020
Practice Problems

1. Answer the following questions:

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.2 Assume an HTTP request contains


if-modified-since: Wed 7 Aug 2013 13:44:01 GMT
Further assume that the file on the server has been modified since that time.
What response code will the server send?
a. 404 Not Found b. 200 OK c. 304 Not Modified

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.

SMTP SMTP IMAP


IT 420
TCP Worksheet Solutions

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_________

b. Send a segment with 3 bytes

Window: _8 9 10 11 12__________ Seq No# ____8_____

c. Receive acknowledgement = 11

Window: __11 12 13 14 15________

d. Send a segment with 2 bytes

Window: __11 12 13 14 15__________ Seq No# ____11____

e. Send a segment with 2 bytes

Window: _11 12 13 14 15___________ Seq No# _____13_____

f. Receive acknowledgement = 13

Window: _13 14 15 16 17___________

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

Window: __4 5 6 7 8____________

b. Receive a segment holding bytes 4 and 5

Window: __6 7 8 9 10___________ Ack No# ___6______

c. Receive a segment holding byte 9

Window: __6 7 8 9 10___________ Ack No# ___6______


d. Receive a segment holding bytes 6, 7 and 8

Window: __10 11 12 13 14_______ Ack No# ___10_____

e. Receive two segments back-to-back: the first holds bytes 10 and 11, the second
holds bytes 12 and 13. Assume cumulative acks.

Window: __14 15 16 17 18_______ Ack No# ___14_____

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

Window: __11 12 13 14 15_______

b. Receive a segment holding bytes 11 and 12, which are immediately consumed

Window: __13 14 15 16 17_______ Ack No# __13___ Win Size ___5___

c. Receive a segment holding bytes 13 and 14, which are not consumed

Window: __13 14 15 16 17_______ Ack No# __15___ Win Size ___3___

d. Bytes 13 and 14 are consumed

Window: __15 16 17 18 19 ______ Ack No# __15___ Win Size ___5___

e. Receive a segment holding bytes 15, 16, 17, 18 and 19 which are not consumed

Window: __15 16 17 18 19_______ Ack No# __20___ Win Size ___0____


B
1 4

2
A D E
1
2

5 C 3

1. Mark A as solved. Cost to B is 1 and cost to C is 5


2. Mark B as solved. Cost to E is 1 + 4 = 5 and cost to D is 1 + 2 = 3
3. Mark D as solved. Cost to C is 3 + 2 = 5, cost to E is 3 + 1 = 4
4. Mark E as solved. Done! Path is A B D E with a cost of 4
Mtu= 820
3020 bytes
Id = 123

20 3000

0 800 1600 2400


20 800 20 800 20 800 20 600

Id 123 123 123 123

Total length 820 820 820 620

MF 1 1 1 0

Offset 0/8 =0 800/8 = 100 1600/8 = 200 2400/8 = 300

Number of fragments = 3000bytes/800 bytes per frag = 3.75 = 4 fragments

Bytes in last fragment = 3000 – 800 – 800 – 800 = 600


Mtu= 1500
4000 bytes
Id = x

20 3980

0 1480 2960

20 1480 20 1480 20 1020

Id x x x

Total length 1500 1500 1040

MF 1 1 0

Offset 0/8 =0 1480/8 = 185 2960/8 = 370

Number of fragments = 3980bytes/1480 bytes per frag = 2.7 = 3 fragments

Bytes in last fragment = 3980 – 1480 – 1480 = 1020


IT 420
IP Worksheet Solutions

1. Consider the class-less IP network 130.45.128.0/21

10000010.00101101 10000 000.00000000

a. How many bits are in the net id? __21 bits_______

b. How many bits are in the host id? _32 – 21 = 11 bits

c. How many possible actual hosts are there? _211 – 2 = 2046

d. What is the mask in binary? 11111111.11111111.11111000.00000000

e. What is the network address in binary?__10000010.00101101 10000 000.0000000

f. What is the broadcast address in binary?_10000010.00101101 10000 111.11111111

g. What range of addresses (in binary) can be assigned to hosts?

__10000010.00101101 10000 000.00000001 to

___10000010.00101101 10000 111.11111110

2. Is the host 128.235.208.16 on the network 128.235.204.0/22?

128.235.204.0 = 10000000 11101011 11001100 00000000


128.235.208.16 = 10000000 11101011 11010000 00010000

No, because the first 22 bits are different.

3. One network is assigned the block of class-less IP addresses from 194.172.128.0 to


194.172.131.255. How many bits are in the net id part of this address block?

194.172.128.0 = 11000010 10101100 10000000 00000000


194.172.131.255 = 11000010 10101100 10000011 11111111

22 bits, because the first 22 bits are the same

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

b. How many bits are in the net id? _32 – 5 = 27 bits


5. We wish to create 10 subnets in a /24 network. Assume that we wish to use the
minimum number of bits for the subnet id.

a. How many bits will be used for the subnet id? __4 bits (24= 16)

b. How many bits are in the host id? _____4_________

Number of host bits = 32 – 24 – 4 = 4

c. How many possible hosts are there on each subnet? 24 – 2 = 14____

6. A /16 network uses an additional 6 bits for a subnet id.

a. How many possible subnets are there? __26 = 64_____________

b. How many bits will be in the hostid? __32 – 16 – 6 = 10_______

c. What is the mask for each subnet in slash notation? ___/22__________________

7. An ISP has a CIDR block 71.94.128.0/17 (01000111 01011110 10000000 00000000).


The ISP wants to sub-divide this into 4 smaller CIDR blocks for its customers.

a. How many bits should the ISP add to the mask to identify the subnets?
___2 bits because 22 = 4____

b. What are the addresses of each smaller block in binary?

01000111 01011110 10000000 00000000


01000111 01011110 10100000 00000000
01000111 01011110 11000000 00000000
01000111 01011110 11100000 00000000

c. What is the maximum number of hosts in each sub-block?


Number of host bits = 32 – 17 - 2 = 13 Number of hosts = 213-2 = 8190

d. For the first subblock, what range of addresses are in the CIDR block in binary?

__01000111 01011110 100 00000 00000000___________ to

__01000111 01011110 100 11111 11111111___________

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)____

c. What is the last address in the subnet A block? _204.15.6.15 (00001111)__

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)_

e. What is the first address in the subnet B block? _204.15.6.16 (00010000)____

f. What is the last address in the subnet B block? __204.15.6.23 (00010111)_

You might also like