computer networks - monet.skku.edumonet.skku.edu/wp-content/uploads/2019/03/homework... · problem...

10
NETWORKING LABORATORY H. CHOO Computer Networks Homework #5: Not to submit For the final exam/Preparation. Problem #1. Assume a TCP server is expecting to receive byte 6001. It receives a segment with the sequence number 6001 that carries 2000 bytes. a. If the server has bytes 4001 to 5000 to send, what should the reaction of the TCP server be to this event? b. Can you justify the reaction? Sol) a. The server needs to store the new bytes, but send a segment with sequence number 4001 and acknowledgment number 8001 (piggybacking). b. This saves bandwidth because the data needs to go in the other direction, and it is better to acknowledge the received bytes in the same packet (Rule 1 in ACK generation). Problem #2. An HTTP client opens a TCP connection using an initial sequence number (ISN) of 14,534 and the ephemeral port number of 59,100. The server opens the connection with an ISN of 21,732. Show the three TCP segments during the connection establishment if the client defines the rwnd of 4000 and the server defines the rwnd of 5000. Ignore the calculation of the checksum field. Sol)

Upload: others

Post on 09-May-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

NETWORKING LABORATORY H. CHOO

Computer Networks

Homework #5: Not to submit

For the final exam/Preparation.

Problem #1. Assume a TCP server is expecting to receive byte 6001. It receives a segment with

the sequence number 6001 that carries 2000 bytes.

a. If the server has bytes 4001 to 5000 to send, what should the reaction of the TCP server

be to this event?

b. Can you justify the reaction?

Sol)

a. The server needs to store the new bytes, but send a segment with sequence number

4001 and acknowledgment number 8001 (piggybacking).

b. This saves bandwidth because the data needs to go in the other direction, and it is

better to acknowledge the received bytes in the same packet (Rule 1 in ACK

generation).

Problem #2. An HTTP client opens a TCP connection using an initial sequence number (ISN)

of 14,534 and the ephemeral port number of 59,100. The server opens the connection with an

ISN of 21,732. Show the three TCP segments during the connection establishment if the client

defines the rwnd of 4000 and the server defines the rwnd of 5000. Ignore the calculation of the

checksum field.

Sol)

NETWORKING LABORATORY H. CHOO

Problem #3. In TCP, assume a client has 100 bytes to send. The client creates 10 bytes at a time

in each 10ms and delivers them to the transport layer. The server acknowledges a segment when

there is a previous segment that has not been acknowledged (every other segment) or if a timer

time-out at 60ms. The round-trip time is 20ms, but the sender timer is set to 100ms.

a. Show the time line for the segments and the bytes each segment carries if the

implementation uses Nagle’s algorithm with maximum segment size (MSS) of 30 bytes.

b. Does any segment carry the maximum segment size?

Sol)

a. The following shows the time line for each segment.

NETWORKING LABORATORY H. CHOO

b. Two segments are sent with the maximum segment size: 2, 4

Problem #4. If originally RTTS = 14ms and α is set to 0.2, calculate the new RTTS after the

following events (times are relative to Event 1):

- Event 1: 00ms Segment 1 was sent.

- Event 2: 06ms Segment 2 was sent.

- Event 3: 16ms Segment 1 was timed-out and resent.

- Event 4: 21ms Segment 1 was acknowledged.

- Event 5: 23ms Segment 2 was acknowledged.

Sol)

NETWORKING LABORATORY H. CHOO

According to Karn’s algorithm, we need to ignore the RTT for segment 1 in our

calculation because it was timed-out and resent. Using only segment 2, the calculation is

shown below:

RTTM = 23 − 6 = 17ms → RTTS = (1 − 0.2) RTTS + 0.2 × RTTM = 14.6ms

Problem #5. Each of the following addresses belongs to a block. Find the first and the last

address in each block

a. 14.12.72.8/24

b. 200.107.16.17/18

c. 70.110.19.17/16

Sol)

a. Given: 00001110 00001100 01001000 00001000 14.12.72.8/24

First: 00001110 00001100 01001000 00000000 14.12.72.0/24

Last: 00001110 00001100 01001000 11111111 14.12.72.255/24

b. Given: 11001000 01101011 00010000 00010001 200.107.16.17/18

First: 11001000 01101011 00000000 00000000 200.107.0.0/18

Last: 11001000 01101011 00111111 11111111 200.107.63.255/18

c. Given: 01000110 01101110 00010011 00010001 70.110.19.17/16

First: 01000110 01101110 00000000 00000000 70.110.0.0/16

Last: 01000110 01101110 11111111 11111111 70.110.255.255/16

Problem #6. Assume we have an internet with an 8-bit address space. The addresses are equally

divided between eight networks (N0 to N7). The internetwork communication is done through

a router with eight interfaces (m0 to m7). Show the internet outline and the forwarding table

(with two columns: prefix in binary and the interface number) for the only router that connects

the networks. Assign a network address to each network.

Sol)

Block Range Range in binary n Prefix

0 0 to 63 00000000 to 00111111 2 00

1 64 to 127 01000000 to 01111111 2 01

2 128 to 191 10000000 to 10111111 2 10

3 192 to 255 11000000 to 11111111 2 11

The following shows the outline and the forwarding table. Note that each interface can use

one of the addresses in the corresponding block.

NETWORKING LABORATORY H. CHOO

Problem #7. A router has the following (CIDR) entries in its routing table:

Address/mask Next hop

128.114.56.0/22 Interface 0

128.114.60.0/22 Interface 1

192.168.30/23 Router 1

Default Router 2

For packets with the following IP addresses, show where the router will send the packet

(a) 128.114.63.09

(b) 128.114.57.11

(c) 128.114.52.02

(d) 192.168.33.05

(e) 192.168.31.06

Sol)

NETWORKING LABORATORY H. CHOO

Problem #8. Consider sending a 2400-byte datagram into a link that has an MTU of 700 bytes.

Suppose the original datagram is stamped with the identification number 422. How many

fragments are generated? What are the values in the various fields in the IP datagram(s)

generated related to fragmentation?

Sol)

The maximum size of data field in each fragment = 680 (because there are 20 bytes IP

header). Thus the number of required fragments = (2400-20)/680 = 3.5 = 4

Each fragment except the last one will be of size 700 bytes (including IP header). The last

datagram will be of size 360 bytes (including IP header). The offsets of the 4 fragments

will be 0, 680/8=85, (680+680)/8=170, (680+680+680)/8=255. Each of the first 3 fragments

will have flag=1; the last fragment will have flag=0.

NETWORKING LABORATORY H. CHOO

Problem #9. Create the shortest-path tree and the forwarding table for node B in Figure below.

The following shows the steps to create the shortest path tree for node B and the forwarding

table for this node.

NETWORKING LABORATORY H. CHOO

Another approach: You can compute the shortest path from node B like the table below:

Step Start N D(A),

p(A)

D(C),

p(C)

D(D),

p(D)

D(E),

p(E)

D(F),

p(F)

D(G),

p(G)

0 B 2, B 5, B Infinity 4, B Infinity Infinity

1 BA 5, B 5, A 4, B Infinity Infinity

2 BAE 5, B 5, A 6, E Infinity

3 BAEC 5, A 6, E 8, C

4 BAECD 6, E 7, F

5 BAECDF 7, F

6 BAECDFG

The shortest path is derived from the table:

A C

D E

B

F

G

Wireshark

Note: Provide Wireshark screenshots for all the problems.

Problem #10. Run wireshark and set the display filter to only show traffic between client (your

system) and the course page. Then open the monet.skku.ac.kr -> courses -> details -> syllabus.

After this stop the capture in wireshark and show the comparison between TCP data segments

and total TCP packets between client and server using IOgraph

Answer:

NETWORKING LABORATORY H. CHOO

Problem #11. Run wireshark and set the display filter to only show traffic between client (your

system) and the course page. Then open the monet.skku.ac.kr -> courses -> details -> syllabus.

After this stop the capture in wireshark and show the comparison between the total TCP Seq

messages, TCP Ack messages and TCP non-zero ACK message using IOgraph. Also write that

what you analyze from this graph

Answer:

NETWORKING LABORATORY H. CHOO

What can be inferred from this graph is that almost all the ACK messages are containing

zero as next expected SEQ number, hence there are same amount of ACK messages as

there are Seq messages. This also shows that mostly there are short lived TCP streams

that’s why most of ACK messages are zero