Cheat Sheet For Networking
Cheat Sheet For Networking
Cheat Sheet For Networking
R1,
R13
A) We will use CTP (connors transport protocol) with its data not 223.1.3.27 = 11011111 00000001 00000011 00011011
exceeding 1196 bytes and use a 4 byte header (with destination in R15 8 interfaces
it) to the packet. This then sends the destination and segment to 3 forwarding tables
the network layer, which sends the segment to the STP at the
R20
destination host. This is then extracted and sent to the correct
Yes, since the full IPv6 datagram is encompassed in an IPv4 datagram.
port number.
P4
B) Use CTP which accepts data chunks no larger than 1192 bytes. OG = outgoing!!!!!!!!!!!!!!!!!!!!
Now, however, the segment has two 4 byte headers; one header a) destination address link interface
acts as a source port field and the other a destination port field. H3 3
This is then sent to the network layer, which again sends it to the Data destined for H3 is sent through the #3 link interface
STP at the destination host. This is then examined, extracted, and b) no, the forwarding rule for datagram networks is based solely on the destination
sent to the source port.
address
C) no
c) Router A:
R2,
incoming interface| incoming VC No.| OG interface| OG VC No
A) The mail system will use Mail Transport Protocol (MTP) to send
its mail. The front of each letter will act as the header and the
1
12
3
22
contents of each letter will act as the packets segment data. MTP
2
63
4
18
will take a destination [IP] address and nothing more (since it only d) Router B:
requires the house address not the individuals address). It will
incoming interface| incoming VC No.| OG interface| OG VC No.
then take the letter and send the letter to the destination
1
22
2
24
address, which will then deal with it however it sees fit.
Router C:
B) No, the contents will never have to be looked at because all the incoming interface| incoming VC No.| OG interface| OG VC No
data needed for sending is in the header (on the front of the
1
18
2
50
letter).
Router D:
R5,
incoming interface| incoming VC No.| OG interface| OG VC No
Most firewalls block/intercept UDP traffic. TCP however is not
1
24
3
70
blocked through firewalls and therefore is used for video/voice
2
50
3
76
traffic.
P10
R6,
a) Entry Prefix Match Interface
Yes, the application designer can incorporate reliable data
1st 11100000 00 0
transfer into his/her application layer protocol. This would be very 2nd 11100000 01000000 1
difficult to accomplish however and require much debugging.
3rd 1110000 2
R7,
4th 11100001 1 3
Yes both segments will arrive at the same socket. The systems OS 5th otherwise 3
will provide the originating IP of each segment to differentiate
b) 11001000 10010001 01010001 01010101 interface is 3
between the two.
11100001 01000000 11000011 00111100 interface is 2
R8,
11100001 10000000 00010001 01110111 interface is 3
The web server creates an individual connection socket for each P13
persistent connect, each identified with a source IP address,
223.1.17.128/25
destination IP address, source port number, and destination port 223.1.17.0/26
number. When host C receives a packet it examines these four
223.1.17.192/28
identifiers to determine where to send the segment data.
P19
Therefore A and B travel through different sockets, both identified Max Frag = 700 - 20 (header) = 680 bytes
as 80 but with different source IPs.
Required Frags = 4
R15,
Each Frag's ID No. = 422
a) 20 bytes
Each will be of size 700 bytes (including the header)
b) Ack No. = 90
-except the last one which will be 360 bytes (including the header)
P14,
the offsets will be 0, 85, 170, 255
NAK based protocol only detects when a subsequence packet is The first three frags will have flag = 1
lost when a later packet it received and the protocol notices a gap the last will have flag = 0
in the sequence numbers. So for the first case this would be a bad P22
choice since NAK can have a long error recovery time. In the
a) most likely there would be a packet sniffer somewhere within the NAT. as the packets
second case ACK based protocol would be undesirable because of came through we would check their sequence numbers and for consecutive sequence
the high data rate and high overhead associated with ACK.
numbers we would group them into clusters (assuming they aren't randomly assigned).
P24,
b) no, the result from a is dependent on the fact that the sequence numbers are assigned
a) True, if a sender window had size of 3 and sent the packets 1, 2, sequentially.
and 3 at Time zero. At some point when Time > zero (call this time P26
X) the receiver ACKS 1, 2, and 3. At some point after this when
step N Dt,pt Du,pu Dv,pv Dw,pw Dy,py Dz,pz
Time > X the sender times out and 1 and 2 are resent.
0 x
3,x
6,x
6,x 8,x
b) True, ^basically the same.
1 xv 7,v 6,v 3,x
6,x
6,x 8,x
c) True, Alternating Bit Protocol revolves around the 0 and 1 of an 2 xvu 7,v 6,v 3,x 6,x
6,x 8,x
alternating ACK. So the accumulative ACK is impossible since it
3 xvuw 7,v 6,v 3,x
6,x
6,x 8,x
needs to be sent after each packet is received. (Therefore SR is
4 xvuwy 7,v 6,v 3,x 6,x
6,x 8,x
acting like ABP)
5 xvuwyt 7,v 6,v 3,x 6,x
6,x 8,x
d) True, ^basically the same thing again
6 xvuwytz 7,v 6,v 3,x 6,x
6,x 8,x
P26,
P28
a) There are 4,294,967,296 (2^32) possible sequence numbers. Cost to __ u v x y z
Sequence numbers increment by the side (in bytes) of data sent.
v20355
Therefore the MSS size is irrelevant and the max file size that can From __ x 5 3 0 4 4
be sent from A to B is 2^32 of bytes (about 4.3 Gigabytes).
z75480
b) 4294967296/536 = 8,012,998.687 = 8,012,999 segments.
P37 a) eBGP
66 (bytes of header) * 8,012,999 segments = 528,857,934 bytes of b) iBGP
header
c) eBGP
4,294,967,296 + 528,857,934 = 4,823,825,230 bytes.
d) Ibgp
4,823,825,230 bytes / 155,000,000 bytes per second = 31.6
HOME WORK 3 QUESTION
seconds
P27,
R1. Suppose the network layer provides the following service. The network layer
a) Seq No. = 207
in the source host accepts a segment of maximum size 1,200 bytes and a destination host
source port = 302
address from the transport layer. The network layer then guarantees to deliver the
destination port = 80
segment to the transport layer at the destination host. Suppose many network application
b) ACK No. = 207
processes can be running at the destination host.
source port = 302
a. Design the simplest possible transport-layer protocol that will get application
destination port = 80
data to the desired process at the destination host. Assume the operating system in the
c) ACK No. = 127
destination host has assigned a 4-byte port number to each running application process.
d)
b. Modify this protocol so that it provides a return address to the destination process.
A
B
c. In your protocols, does the transport layer have to do anything in the core of the
[Seq No. = 127, 80 bytes]
computer network?
[ACK No. = 207] R2. Consider a planet where everyone belongs to a family of six, every family lives in its
(lost)
own house, each house has a unique address, and each person in a
a. In the second segment sent from Host A to B, what are the sequence number, source port number, and destination
port number?
b. If the first segment arrives before the second segment, in the acknowledgment of the first arriving segment, what is
the acknowledgment number, the source port number, and the destination port number?
c. If the second segment arrives before the first segment, in the acknowledgment of the first arriving segment, what is
the acknowledgment number?
d. Suppose the two segments sent by A arrive in order at B. The first acknowledgment is lost and the second
acknowledgment arrives after the first timeout interval. Draw a timing diagram, showing these segments and all
other segments and acknowledgments sent. (Assume there is no additional packet loss.) For each segment in your
figure, provide the sequence number and
the number of bytes of data; for each acknowledgment that you add, provide
the acknowledgment number.
P28. Host A and B are directly connected with a 100 Mbps link. There is one TCP connection between the two hosts,
and Host A is sending to Host B an enormous file over this connection. Host A can send its application data into its
TCP socket at a rate as high as 120 Mbps but Host B can read out of its TCP receive buffer at a maximum rate of 50
Mbps. Describe the effect of TCP flow control.
P31. Suppose that the five measured SampleRTT values (see Section 3.5.3) are 106 ms, 120 ms, 140 ms, 90 ms, and
115 ms. Compute the EstimatedRTT after each of these SampleRTT values is obtained, using a value of = 0.125 and
assuming that the value of EstimatedRTT was 100 ms just before the first of these five samples were obtained.
Compute also the evRTT after each sample is obtained, assuming a value of = 0.25 and assuming the value of
DevRTT was 5 ms just before the first of these five samples was obtained. Last, compute the TCP TimeoutInterval after
each of these samples is obtained.
P37. Compare GBN, SR, and TCP (no delayed ACK). Assume that the timeout values for all three protocols are
sufficiently long such that 5 consecutive data segments and their corresponding ACKs can be received (if not lost in
the channel) by the receiving host (Host B) and the sending host (Host A) respectively. Suppose Host A sends 5 data
segments to Host B, and the 2nd segment (sent from A) is lost. In the end, all 5 data segments have been correctly
received by Host B.
a. How many segments has Host A sent in total and how many ACKs has Host B sent in total? What are their sequence
numbers? Answer this question for all three protocols.
b. If the timeout values for all three protocol are much longer than 5 RTT, then which protocol successfully delivers all
five data segments in shortest time interval?
P43. Host A is sending an enormous file to Host B over a TCP connection. Over this connection there is never any
packet loss and the timers never expire. Denote the transmission rate of the link connecting Host A to the Internet by
R bps. Suppose that the process in Host A is capable of sending data into its TCP socket at a rate S bps, where S = 10
R. Further suppose that the TCP receive buffer is large enough to hold the entire file, and the send buffer can hold
only one percent of the file. What would prevent the process in Host A from continuously passing data to its TCP
socket at rate S bps? TCP flow control? TCP congestion control? Or something else? Elaborate.
P46. Consider that only a single TCP (Reno) connection uses one 10Mbps link which does not buffer any data. Suppose
that this link is the only congested link between the sending and receiving hosts. Assume that the TCP sender has a
huge file to send to the receiver, and the receivers receive buffer is much larger than the congestion window. We also
make the following assumptions: each TCP segment size is 1,500 bytes; the two-way propagation delay of this
connection is 150 msec; and this TCP connection is always in congestion avoidance phase, that is, ignore slow start.
a. What is the maximum window size (in segments) that this TCP connection can achieve?
b. What is the average window size (in segments) and average throughput (in bps) of this TCP connection?
c. How long would it take for this TCP connection to reach its maximum window again after recovering from a packet
loss?
P55. In this problem we investigate whether either UDP or TCP provides a degree of end-point authentication.
a. Consider a server that receives a request within a UDP packet and responds to that request within a UDP packet (for
example, as done by a DNS server). If a client with IP address X spoofs its address with address Y, where will the server
send its response?
b. Suppose a server receives a SYN with IP source address Y, and after responding with a SYNACK, receives an ACK
with IP source address Y with the correct acknowledgment number. Assuming the server chooses a random initial
sequence number and there is no man-in-the-middle, can the server be certain that the client is indeed at Y (and
not at some other address X that is spoofing Y)?
HOME WORK 4 QUESTION
R13. What is the 32-bit binary equivalent of the IP address 223.1.3.27?
R15. Suppose there are three routers between a source host and a destination host. Ignoring fragmentation, an IP
datagram sent from the source host to the destination host will travel over how many interfaces? How many
forwarding tables will be indexed to move the datagram from the source to the destination?
R20. It has been said that when IPv6 tunnels through IPv4 routers, IPv6 treats the IPv4 tunnels as link-layer protocols.
Do you agree with this statement? Why or why not?
P4. Consider the network below.
a. Suppose that this network is a datagram network. Show the forwarding table in router A, such that all traffic
destined to host H3 is forwarded through interface 3.
b. Suppose that this network is a datagram network. Can you write down a forwarding table in router A, such that all
traffic from H1 destined to host H3 is forwarded through interface 3, while all traffic from H2 destined to host H3 is
forwarded through interface 4? (Hint: this is a trick question.)
c. Now suppose that this network is a virtual circuit network and that there is one ongoing call between H1 and H3,
and another ongoing call between H2 and H3. Write down a forwarding table in router A, such that all traffic from H1
destined to host H3 is forwarded through interface 3, while all traffic from H2 destined to host H3 is forwarded
through interface 4.
d. Assuming the same scenario as (c), write down the forwarding tables in nodes B, C, and D.
P10. Consider a datagram network using 32-bit host addresses. Suppose a router has four links, numbered 0 through
3, and packets are to be forwarded to the link interfaces as follows:
Destination Address Range Link Interface
11100000 00000000 00000000 00000000
through 0
11100000 00111111 11111111 11111111
11100000 01000000 00000000 00000000
through 1
11100000 01000000 11111111 11111111
11100000 01000001 00000000 00000000
through 2
given house has a unique name. Suppose this planet has a mail service that
[Seq No. = 207, 40 bytes]
11100001 01111111 11111111 11111111
delivers letters from source house to destination house. The mail service
[ACK No. = 247] requires that (1) the letter be in an envelope, and that (2) the address of the
otherwise 3
a. Provide a forwarding table that has five entries, uses longest prefix matching, and forwards packets to the correct
destination house (and nothing more) be clearly written on the envelope. Suppose
[Seq No. = 127, 80 bytes]
each family has a delegate family member who collects and distributes letters for the other link interfaces.
[ACK No. = 247] family members. The letters do not necessarily provide any indication of the recipients of b. Describe how your forwarding table determines the appropriate link interface
for datagrams with destination addresses:
the letters.
P28,
11001000 10010001 01010001 01010101
a. Using the solution to Problem R1 above as inspiration, describe a protocol
Since Host B cannot read the data Host A send fast enough TCP that the delegates can use to deliver letters from a sending family member
11100001 01000000 11000011 00111100
Flow Control is utilized. TCP FC allows host B to set its receive
11100001 10000000 00010001 01110111
to a receiving family member.
window to 0 until it can start receiving from A again. Host A listens b. In your protocol, does the mail service ever have to open the envelope and
P11. Consider a datagram network using 8-bit host addresses. Suppose a router uses longest prefix matching and has
and adjusts its send rate based on what it hears. This maximizes examine the letter in order to provide its service?
the following forwarding table:
data transfer and is why Flow Control I s important.
Prefix
Match Interface
R5. Why is it that voice and video traffic is often sent over TCP rather than UDP
P31,
00
0
in todays Internet? (Hint: The answer we are looking for has nothing to do
Estimated RTT = Sample RTTx + [1-x] Estimated RTT
010
1
with TCPs congestion-control mechanism.)
Dev RTT = Sample RTTy Estimated RTT + (1 y) Dev RTT
011
2
R6. Is it possible for an application to enjoy reliable data transfer even when the
TOI (time out interval) = Estimated RTT + 4 * Dev RTT
10
2
application runs over UDP? If so, how?
First Sample RTT, 0.125*106+0.875*100 = 100.75ms
11
3
R7. Suppose a process in Host C has a UDP socket with port number 6789. Suppose
Dev RTT = 0.25 * 106 100.75 +0.75*5 = 5.06ms
both Host A and Host B each send a UDP segment to Host C with destination port number For each of the four interfaces, give the associated range of destination host addresses and the number of addresses
TOI = 100.75+4*5.06=120.99ms
6789. Will both of these segments be directed to the same socket at Host C? If so, how will in the range.
Second Sample RTT = 120ms
the process at Host C know that these two segments originated from two different hosts? P13. Consider a router that interconnects three subnets: Subnet 1, Subnet 2, and Subnet 3. Suppose all of the
Estimated RTT = 103.15ms
interfaces in each of these three subnets are required to have the prefix 223.1.17/24. Also suppose that Subnet 1 is
R8. Suppose that a Web server runs in Host C on port 80. Suppose this Web
Dev RTT= 8ms
required to support at least 60 interfaces, Subnet 2 is to support at least 90 interfaces, and Subnet 3 is to support at
server uses persistent connections, and is currently receiving requests from
TOI = 135.15ms
least 12 interfaces. Provide three network addresses (of the form a.b.c.d/x) that satisfy these constraints.
two different Hosts, A and B. Are all of the requests being sent through the
Third Sample RTT = 140ms
P19. Consider sending a 2400-byte datagram into a link that has an MTU of 700 bytes. Suppose the original datagram
same socket at Host C? If they are being passed through different sockets, do
Estimated RTT = 107.8ms
is stamped with the identification number 422. How many fragments are generated? What are the values in the
both of the sockets have port 80? Discuss and explain.
Dev RTT= 14ms
various fields in the IP datagram(s) generated related to fragmentation?
R15. Suppose Host A sends two TCP segments back to back to Host B over a
TOI = 164ms
P22. Suppose you are interested in detecting the number of hosts behind a NAT. You observe that the IP layer stamps
TCP connection. The first segment has sequence number 90; the second has sequence
Fourth Sample RTT = 90ms
an identification number sequentially on each IP packet. The identification number of the first IP packet generated by
number 110.
Estimated RTT = 105.5ms
a host is a random number, and the identification numbers of the subsequent IP packets are sequentially assigned.
a. How much data is in the first segment?
Dev RTT= 14.4ms
Assume all IP packets generated by hosts behind the NAT are sent to the outside world.
b. Suppose that the first segment is lost but the second segment arrives at B.
TOI = 163ms
a. Based on this observation, and assuming you can sniff all packets sent by the NAT to the outside, can you outline a
In the acknowledgment that Host B sends to Host A, what will be the
Fifth Sample RTT = 115ms
simple technique that detects the number of unique hosts behind a NAT? Justify your answer.
acknowledgment number?
Estimated RTT = 106.7ms
P14. Consider a reliable data transfer protocol that uses only negative acknowledgments. b. If the identification numbers are not sequentially assigned but randomly assigned, would your technique work?
Dev RTT= 12.9ms
Suppose the sender sends data only infrequently. Would a NAK-only protocol be preferable Justify your answer.
TOI = 158ms
to a protocol that uses ACKs? Why? Now suppose the sender has a lot of data to send and P26. Consider the following network. With the indicated link costs, use Dijkstras shortest-path algorithm to compute
P37,
the end-to-end connection experiences few losses. In this second case, would a NAK-only the shortest path from x to all network nodes. Show how the algorithm works by computing a table similar to Table
A) GBN = 9 segments, 8 ACKs, Seq No. 0,1,2,3,4,1,2,3,4
4.3.
protocol be preferable to a protocol that uses ACKs? Why?
SR = 6 segments, 5 ACKs, Seq No. 0,1,2,3,4,1
P24. Answer true or false to the following questions and briefly justify your
TCP = 6 segments 5 ACKs, Seq No. 0,1000,2000,3000,4000,1000 answer:
B) TCP
a. With the SR protocol, it is possible for the sender to receive an ACK for a
P43,
packet that falls outside of its current window.
There is no danger in overflow to the receiver since the receivers b. With GBN, it is possible for the sender to receive an ACK for a packet that
buffer can hold the full file. Also since theres no loss and ACKs are falls outside of its current window.
return prior to the timer expires TCP Congestion Control doesnt c. The alternating-bit protocol is the same as the SR protocol with a sender
accelerate the sender. Yet, The process in host A wont
and receiver window size of 1.
continuously send data to the socket since this will make the send d. The alternating-bit protocol is the same as the GBN protocol with a sender
buffer fill up. Once the send buffer is full data will be passed at an and receiver window size of 1.
average rate.
P26. Consider transferring an enormous file of L bytes from Host A to Host B.
P46,
Assume an MSS of 536 bytes.
A) WS * 1500 / RTT
a. What is the maximum value of L such that TCP sequence numbers are not
Window size = 83.3
exhausted? Recall that the TCP sequence number field has 4 bytes.
Window size ~ 84
P28. Consider the network shown below, and assume that each node initially knows the costs to each of its neighbors.
b. For the L you obtain in (a), find how long it takes to transmit the file.
B) AvgWS = 83*.75 = 62.25 ~ 63 segments
Consider the distance-vector algorithm and show the distance table entries at node z.
Assume that a total of 66 bytes of transport, network, and data-link header
AvgThroughput = 10Mb * .75 = 7.5 Mb
are added to each segment before the resulting packet is sent out over a
C) RTT = 42
155 Mbps link. Ignore flow control and congestion control so A can pump
4.2 seconds
out the segments back to back and continuously.
P55,
P27. Host A and B are communicating over a TCP connection, and Host B has already
A) The server will send to the spoofed address Y since its the
received from A all bytes up through byte 126. Suppose Host A then sends two segments
matching address.
to Host B back-to-back. The first and second segments contain 80 and 40 bytes of data,
B) The server can never actually be sure it was sent to the correct respectively. In the first segment, the sequence number is 127, the source port number is
address and not a spoofed address in this case.
302, and the destination port number is 80. Host B sends an acknowledgment whenever it
receives a segment from Host A.
P37. Consider the network shown below. Suppose AS3 and AS2 are running
OSPF for their intra-AS routing protocol. Suppose AS1 and AS4 are running RIP
for their intra-AS routing protocol. Suppose eBGP and iBGP are used for the
inter-AS routing protocol. Initially suppose there is no physical link between AS2
and AS4. 424 CHAPTER 4 THE NETWORK LAYER
a. Router 3c learns about prefix x from which routing protocol: OSPF, RIP,
eBGP, or iBGP?
b. Router 3a learns about x from which routing protocol?
c. Router 1c learns about x from which routing protocol?
d. Router 1d learns about x from which routing protocol?
TRUE OR FALSE
a. Host A is sending Host B a large file over a TCP connection. Assume Host B
has no data to send Host A. Host B will not send acknowledgments to Host A
because Host B cannot piggyback the acknowledgments on data. False
b. The size of the TCP rwnd never changes throughout the duration of the
connection. False
c. Suppose Host A is sending Host B a large file over a TCP connection. The
number of unacknowledged bytes that A sends cannot exceed the size of the
receive buffer. True
d. Suppose Host A is sending a large file to Host B over a TCP connection. If the
sequence number for a segment of this connection is m, then the sequence
number for the subsequent segment will necessarily be m + 1. False
e. The TCP segment has a field in its header for cwnd. False
f. Suppose that the last SampleRTT in a TCP connection is equal to 1 sec. The
current value of Timeout Interval for the connection will necessarily be 1 sec.
False
g. Suppose Host A sends one segment with sequence number 38 and 4bytes of
data over a TCP connection to Host B. In this same segment the
acknowledgment number is necessarily 42. False
QUIZ I PART 2
Q. Assuming TCP Reno is the protocol experiencing the behavior shown in the
figure
below, answer the following questions.
a. Identify the intervals of time when TCP slow start is operating. [1,6], [23,26]
b. Identify the intervals of time when TCP congestion avoidance is operating.
[6,16] and [17,22]
c. Identify the starting transmission round when TCP fast recovery is operating.
17
d. After the 16th transmission round, is segment loss detected by a triple
duplicate ACK or by a timeout? Triple duplicate ACK
e. After the 22nd transmission round, is segment loss detected by a triple
duplicate ACK or by a timeout? Timeout
f. What is the initial value of ssthresh at the first transmission round? 32
g. What is the value of ssthresh at the 18th transmission round? 21
h. What is the value of ssthresh at the 24th transmission round? 14
st
i. During what transmission round is the 60th segment sent? During the 1
nd
transmission round, packet 1 is sent; packet 2-3 are sent in the 2 Transmission
rd
round; packets 4-7 are sent in the 3 transmission round; packets 8-15 are sent
th
th
in the 4 transmission round; packets 16-31 are sent in the 5 transmission
th
round; packets 32-63 are sent in the 6 transmission round;
j. Assuming a packet loss is detected after the 26th round by the receipt of a
triple duplicate ACK, what will be the values of the ssthresh? 4