QUESTION IMAGE
Question
1 tcp sequence numbers
relevant lectures: lecture 14-16
suppose a and b create a tcp connection with initial sequence numbers 5000 and 80000, respectively, and an initial window of 4000 bytes. the table below depicts the flow of the connection, which has 3 main events:
- a sends three 200-byte segments, (which we will name dataa1, dataa2, and dataa3), and b sends acks for each.
- between segments dataa2 and dataa3, the application on b calls read() on the socket associated with this connection, which returns 400 bytes.
- b sends a 200-byte segment datab1 to a and begins the connection termination process with a fin.
in the table, fill in the seq, ack, and win fields for each packet shown, given the initial sequence numbers and window sizes.
hint: try to create a similar connection flow using the tcp reference, while looking at the packets sent in wireshark-this should allow you to view the changes in sequence numbers, and window sizes. another reference that may be useful is section 17.3 of the dordal textbook.
\
Analyze the initial handshake
We track the sequence numbers, acknowledgment numbers, and window sizes for both hosts, \(A\) and \(B\).
- Host \(A\) initial sequence number (\(ISN_A\)): \(5000\).
- Host \(B\) initial sequence number (\(ISN_B\)): \(80000\).
- Both start with an initial window size of \(4000\) bytes.
At \(t=0\): \(A\) sends SYN, seq=5000, win=4000.
- This consumes \(1\) sequence number.
At \(t=1\): \(B\) sends SYN, ACK.
- Since \(A\)'s
SYNhadseq=5000, \(B\) acknowledges it withack = 5001. - \(B\)'s sequence number is
seq = 80000. - \(B\)'s window is
win = 4000. - This
SYNfrom \(B\) also consumes \(1\) sequence number.
At \(t=2\): \(A\) sends ACK to complete the handshake.
- \(A\)'s sequence number is
seq = 5001. - \(A\) acknowledges \(B\)'s
SYN(seq=80000), soack = 80001. - \(A\)'s window is
win = 4000.
Track data transmission from A to B
At \(t=3\): \(A\) sends DataA1 (200 bytes).
seq = 5001.ack = 80001(no new data from \(B\) to acknowledge yet).win = 4000.- This segment carries bytes \(5001\) to \(5200\).
At \(t=4\): \(B\) acknowledges DataA1.
- \(B\)'s sequence number remains
seq = 80001(since \(B\) hasn't sent data yet). - \(B\) acknowledges up to byte \(5200\), so
ack = 5201. - \(B\)'s buffer has received 200 bytes which are not yet read by the application. Thus, \(B\)'s advertised window decreases by 200:
win = 4000 - 200 = 3800.
At \(t=5\): \(A\) sends DataA2 (200 bytes).
seq = 5201.ack = 80001.win = 4000.- This segment carries bytes \(5201\) to \(5400\).
At \(t=6\): \(B\) acknowledges DataA2.
seq = 80001.- \(B\) acknowledges up to byte \(5400\), so
ack = 5401. - \(B\)'s buffer now holds 400 unread bytes (DataA1 and DataA2). Thus,
win = 4000 - 400 = 3600.
Process the socket read event
At \(t=7\): The application on \(B\) calls read(), which returns 400 bytes.
- This empties \(B\)'s receive buffer, restoring \(B\)'s available window size back to
4000.
At \(t=8\): \(A\) sends DataA3 (200 bytes).
seq = 5401.ack = 80001.win = 4000.- This segment carries bytes \(5401\) to \(5600\).
At \(t=9\): \(B\) acknowledges DataA3.
seq = 80001.- \(B\) acknowledges up to byte \(5600\), so
ack = 5601. - \(B\)'s buffer now holds 200 unread bytes (DataA3). Thus,
win = 4000 - 200 = 3800.
Track data transmission from B to A
At \(t=10\): \(B\) sends DataB1 (200 bytes).
seq = 80001.ack = 5601.win = 3800.- This segment carries bytes \(80001\) to \(80200\).
At \(t=11\): \(A\) acknowledges DataB1.
seq = 5601.- \(A\) acknowledges up to byte \(80200\), so
ack = 80201. - \(A\)'s buffer has received 200 bytes. Since no read is mentioned on \(A\), \(A\)'s window decreases:
win = 4000 - 200 = 3800.
Track connection termination
At \(t=12\): \(B\) sends FIN, ACK.
seq = 80201(since 200 bytes of DataB1 were sent).ack = 5601.win = 3800.- The
FINflag consumes \(1\) sequence number.
At \(t=13\): \(A\) acknowledges \(B\)'s FIN.
seq = 5601.- \(A\) acknowledges \(B\)'s
FIN(seq=80201),…
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
- t = 1:
SYN,ACK, seq=80000, ack=<blank>8001</blank>, win=4000 - t = 2:
ACK, seq=<blank>5001</blank>, ack=<blank>80001</blank>, win=4000 - t = 3:
ACK, seq=<blank>5001</blank>, ack=<blank>80001</blank>, win=<blank>4000</blank>, data=DataA1 - t = 4:
ACK, seq=<blank>80001</blank>, ack=<blank>5201</blank>, win=<blank>3800</blank> - t = 5:
ACK, seq=<blank>5201</blank>, ack=<blank>80001</blank>, win=<blank>4000</blank>, data=DataA2 - t = 6:
ACK, seq=<blank>80001</blank>, ack=<blank>5401</blank>, win=<blank>3600</blank> - t = 8:
ACK, seq=<blank>5401</blank>, ack=<blank>80001</blank>, win=<blank>4000</blank>, data=DataA3 - t = 9:
ACK, seq=<blank>80001</blank>, ack=<blank>5601</blank>, win=<blank>3800</blank> - t = 10:
ACK, seq=<blank>80001</blank>, ack=<blank>5601</blank>, win=<blank>3800</blank>, data=DataB1 - t = 11:
ACK, seq=<blank>5601</blank>, ack=<blank>80201</blank>, win=<blank>3800</blank> - t = 12:
FIN,ACK, seq=<blank>80201</blank>, ack=<blank>5601</blank>, win=<blank>3800</blank> - t = 13:
ACK, seq=<blank>5601</blank>, ack=<blank>80202</blank>, win=<blank>3800</blank>