0% found this document useful (0 votes)
43 views

Week 5 Calculations

The document provides information about TCP connections between clients and a server. Client A connects to the server on port 4000 using port 450. Client B initially connects using port 455, and then starts a second application that connects using the next available port, 456. The sockets at each endpoint that identify the connection for the second Client B application are given.

Uploaded by

jumpman006
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Week 5 Calculations

The document provides information about TCP connections between clients and a server. Client A connects to the server on port 4000 using port 450. Client B initially connects using port 455, and then starts a second application that connects using the next available port, 456. The sockets at each endpoint that identify the connection for the second Client B application are given.

Uploaded by

jumpman006
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Compute the sum with carry-wraparound (sometimes called the one’s complement sum) of the following

two numbers. Give answer in 8-bit binary, zero-padded to 8 bits if necessary, with no spaces (e.g. 00101000).
Please note this is different than the checksum calculation.
Compute the sum with carry-wraparound (sometimes called the one’s complement sum) of the following
two numbers. Give answer in 8-bit binary, zero-padded to 8 bits if necessary, with no spaces (e.g. 00101000).
Please note this is different than the checksum calculation.

1
10010110
10010000
100100110
1
00100111 Final answer

What is the one’s complement of the following number:

10010110
HostA has established a TCP connection with HostB in a remote network. HostA is sending packets to
HostB. Assume we have configured TCP, somehow, to ACK every segment (no ACKing every other
segment). Assume that the timeout is the same for all packets. HostB’s “window size” is 20000 bytes.
HostB has already received and acknowledged everything sent by HostA’s application up to and including
byte #3,692. HostA now sends segments of the same application data stream in order:

P: 488 bytes
Q: 312 bytes
R: 414 bytes

Suppose that segments P, Q, and R are received, but the acknowledgements for segments P and Q are
lost. If there are more segments waiting to be transmitted, what is the sequence number of the next
segment transmitted after the ACK for segment R is received?

Even though the acknowledgements of P and Q were lost, HostB still received those segments, so it will
be expecting the next segment after R.

Sequence number of segment after R:


3,692 + 488 + 312 + 414 + 1 = 4,907
HostA has established a TCP connection with HostB in a remote network. HostA is sending packets to
HostB. Assume we have configured TCP, somehow, to ACK every segment (no ACKing every other segment).
Assume that the timeout is the same for all packets. HostB’s “window size” is 20000 bytes. HostB has
already received and acknowledged everything sent by HostA’s application up to and including byte #4,227.
HostA now sends segments of the same application data stream in order:

P: 285 bytes
Q: 104 bytes
R: 262 bytes

Suppose segments P, Q, and R arrive at Host B in order. What is the acknowledgment number on the
segment sent in response to segment R?

Pay close attention to whether the question is asking for the sequence or the acknowledgment number!!!
The sequence number will be the first byte of the segment.
The acknowledgment number will be the byte number that is expected next, which means it is 1 byte above
the total bytes sent so far.

To get the acknowledgment number sent in response to segment R (since the segments arrived IN ORDER):

= (all bytes already received/ACKed) + (bytes of segment P) + (bytes of segment Q) + (bytes of segment R) + 1
= 4227 + 285 + 104 + 262 + 1
Extra info:
= 4,879
P sequence number:
4227 + 1 = 4,228
P acknowledgement number:
4227 + 285 + 1 = 4,513
Q sequence number:
4227 + 285 + 1 = 4,513
Q acknowledgement number:
4227 + 285 + 104 + 1 = 4,617
R sequence number:
4227 + 285 + 104 + 1 = 4,4617
HostA has established a TCP connection with HostB in a remote network. HostA is sending packets to
HostB. Assume we have configured TCP, somehow, to ACK every segment (no ACKing every other segment).
Assume that the timeout is the same for all packets. HostB’s “window size” is 20000 bytes. HostB has
already received and acknowledged everything sent by HostA’s application up to and including byte #1,769.
HostA now sends segments of the same application data stream in order:

P: 408 bytes
Q: 337 bytes
R: 481 bytes

Suppose the segments arrive at Host B in the order Q, P, and R. What is the acknowledgment number on
the segment sent in response to segment Q?
The segments arrived out of order, so Host B is still expecting to receive segment P. The acknowledgment
number will be the sequence number of P, which is 1 byte above everything that has been acknowledged
and received so far:

1,769 + 1 = 1,770

HostA has established a TCP connection with HostB in a remote network. HostA is sending packets to HostB.
Assume we have configured TCP, somehow, to ACK every segment (no ACKing every other segment).
Assume that the timeout is the same for all packets. HostB’s “window size” is 20000 bytes. HostB has
already received and acknowledged everything sent by HostA’s application up to and including byte #1,065.
HostA now sends segments of the same application data stream in order:

P: 318 bytes
Q: 340 bytes
R: 102 bytes

Suppose that packet P is lost, but packets Q and R are received. What is the acknowledgement number in
the ACK for packet R.

Very similar to above, Host B is still expecting to receive segment P next:

1,065 + 1 = 1,066
Assume a TCP sender is continuously sending 1,301-byte segments. If a TCP receiver advertises a window
size of 5,460 bytes, and with a link transmission rate 24 Mbps an end-to-end propagation delay of 15.2
ms, what is the utilization? Assume no errors, no processing or queueing delay, and ACKs transmit
instantly. Also assume the sender will not transmit a non-full segment. Give answer in percentages,
rounded to one decimal place, without units (e.g. for an answer of 10.43% you would enter "10.4"
without the quotes).

- Number of whole segments that can fit in a window:


= window size / segment size
= 5,460 / 1,301
= 4.197
= 4 (we round down because we want the number of whole segments that fit)

- Segment size in bits:


1,301 bytes = 10, 408 bits

- Link transmission rate in bps:


24 Mbps = 24,000,000 bps

- end-to-end propagation delay in ms:


= 15.2 ms

• Notes:
- multiplying by 1000 above converts seconds to milliseconds
- multiplying by 100 above converts from a decimal to percentage form
- PAY ATTENTION TO THE UNITS GIVEN – your conversion may need to be slightly different

All put together:

10,408
4 * * 1000
24,000,000
* 100 = 5.6
10,408
* 1000 + 15.2 * 2
24,000,000
Server X is running Diablo II services on port #4000. Client A is running an application that uses port #450
to request an Diablo II TCP connection to Server X. Client B is running an application that uses port #455 to
request an Diablo II TCP connection to Server X.

IP addresses:
•Server X: 152.111.20.36
•Client A: 113.13.131.10
•Client B: 114.192.111.23

Client B starts a second application (running at the same time as the first application) that uses the next
incremental port number to request an Diablo II TCP connection to Server X. The connection created for
Client B is identified by the sockets at the endpoints as follows:

IP address and port socket identifier


IP Address Port Number

On Client B 152.111.20.36 4000

On Server X 114.192.111.23 456

You might also like