05-10-2012 09:42 AM - edited 03-04-2019 04:19 PM
A friend of mine was given this link to do, so I want to try it myself but don't understand it.
05-11-2012 07:05 AM
The question is asking you to create packet flow sequence. Something like this:
05-11-2012 07:53 AM
Hello Shanemcanuff,
on the link that you have provided there is a question that would like to test your understanding of TCP.
You are requested to draw the exchange of IP packets ( into ethernet frames) between a client and a server including initial packets to setup the session and taking in account the advertised window in bytes.
TCP is a protocol for exchanging byte streams in an ordered and controlled way (reliable). Each host in the initializiation phase will choice and advertise an initial sequence number and a receive byte window.
A TCP packet data unit contains a TCP header and a payload. TCP header fields are used during the negotiation, during the data exchange and for session termination. TCP header has also a checksum field that allows to detect data corruption.
Data exchange is performed in a controlled way because data sent by host H1 is explicitly acknowledged by host H2.
The initial sequence number of each side provides a starting point for the data exchange.
Sending 1000 bytes over the session from H1 to H2 means sending a packet with an IP header followed by the TCP header and 1000 bytes of payload. TCP header has to indicate the current sequence number and the number of bytes transferred.
H2 when receives the packet checks if it is correct checking the TCP header and sends an ACK ISN+1000 to H1
When H1 receives the ACK for ISN+1000 knows that the transfer of first 1000 bytes have been successful and can go on with the transmission of other data bytes as needed in the session.
Actually, sender H1 can send up to W2 bytes to H2, where W2 is the byte window that H2 has declared during negotiation.
So H1 can send multiple data packets to H2 before having to wait for an acknowledgement from H2.
In reality the receive window can change over time depending on resources availability on receiver host H2.
The problem asks to use the following data:
TCP send and receive window sizes are 4,500 Bytes
• Ethernet frames can contain 1,500 Bytes
• Application dialogue is illustrated in Figure 1, one request/response
transaction
client sends a request over the session with a 100 byte packet, servers thinks for 300 msec then answers with 14000 bytes of data.
We suppose the window is fixed at 4500 bytes.
TCP header is 20 bytes, IPv4 header is 20 bytes too. 1500-20-20 = 1460 is the maximum size of TCP payload that can travel in an ethernet frame.
a) TCP session setup
3 packets are exchanged between H1 and H2 in order to initialize respective initial sequence numbers and to advertise respective receive windows (ISN1, ISN2, W1, W2 respectively)
We suppose H1 = applicatio client, H2 = application server and that H1 starts the session
H1 R1 R2 H2
TCP SYN --------------------------------------------->
TCP SYN,ACK <------------------------------------------
TCP ACK --------------------------------------------->
at this point the session is opened and client H1 can make the application request
H1 R1 R2 H2
Request (ISN1+100) ---------------------------------------------->
the request is a single packet with a payload of 100 bytes
H2 the server has to provide a 14000 bytes data stream to H1, first packet will contain the ACK for the 100 byte client request. H2 can send 4 packets before waiting for ACK from H1
H1 R1 R2 H2
<------------------------------------------------------- ISN2+1460, ACK of ISN1+100
<------------------------------------------------------- ISN2+1460+1460
<------------------------------------------------------- ISN2+1460+1460+1460
H1 sends an ACK telling it has received the first 1460*3 bytes of the expected data stream
H1 R1 R2 H2
-------------------------------------------------------> ACK of ISN2+3*1460,W1= 4500
H2 can send again other three data packets
H1 R1 R2 H2
<------------------------------------------------------- ISN2+1460*4
<------------------------------------------------------- ISN2+1460*5
<------------------------------------------------------- ISN2+1460*6
H1 sends an ACK telling it has received the first 1460*6 ytes of the expected data stream
H1 R1 R2 H2
-------------------------------------------------------> ACK of ISN2+6*1460,W1= 4500
H2 can send again other three data packets
H1 R1 R2 H2
<------------------------------------------------------- ISN2+1460*7
<------------------------------------------------------- ISN2+1460*8
<------------------------------------------------------- ISN2+1460*9
H1 sends an ACK telling it has received the first 1460*6 ytes of the expected data stream
H1 R1 R2 H2
-------------------------------------------------------> ACK of ISN2+9*1460,W1= 4500
H2 sends remaining bytes
H1 R1 R2 H2
<------------------------------------------------------- ISN2+14000
H1 acknowledges
H1 R1 R2 H2
-------------------------------------------------------> ACK of 14000,W1= 4500
H1 closes the session with FYN flag set, H2 acknowledges session closing
H1 R1 R2 H2
-------------------------------------------------------> FIN
<------------------------------------------------------- ACK
<------------------------------------------------------- FIN
-------------------------------------------------------> ACK
Edit:
for further reading have a look at
http://www.slac.stanford.edu/grp/scs/net/.../tcpip.ppt
Hope to help
Giuseppe
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide