TCP/IP Animation TCP/IP Animation

TCP/IP Animation , TCP,UDP communication

Google Play Apple store


TCP,UDP communication

TCP(Transmission Control Protocol) and UDP(User Datagram Protocol) are rules for controlling data communication. TCP manages the communication more rigidly than UDP. Therefore TCP suits the communication which needs accuracy and UDP suits the communication which needs quickness.

During communication, the data is divided into small pieces called packets. And TCP or UDP header is added to the all packets.

*detail of TCP
In TCP, first the connection between the source PC and the destination one is established. Then data is sent as packets and the receiver put them together. And it confirms TCP header contents and actual data. After confirming, the receiver responses every time.
If some troubles happen in the communication, the same data is sent again.

*Content of TCP and UDP header
'Source and Destination port': PC port No.
'Sequence No.': Sent data No. It increases by 1 for each byte.
'ACK No.': Addition 1 to received Sequence No.
'MSS(option)': Maximum data size(bytes) at a packet.
'Window': This means data size which is sent sequentially without waiting for ACK. (example)Window(2000 bytes)=MSS(1000 bytes)*2
'Checksum': Value for confirming data accuracy.




TCP

Standard TCP communication


*About '[(S)No.00]'
'No.00' means the Sequence No. in TCP header.'(S)' means server side Sequence No. and '(P)' means PC side one.

1.When PC accesses web server, TCP connection for communication is first established between PC and server.

2.This connection is called '3 way hand shake'.And during establishing the connection, each starting Sequence No. and MSS size is decided.

3.Under establishing TCP connection

4.PC : Accesses the website 'http://www.ogumo.co.jp'.(SYN) Requests TCP connection. [(P)No.2000]

5.Server : (ACK) OK. [(P)No.2001] (SYN) I Request TCP connection, too. [(S)No.6000]

6.PC : (ACK) OK. [(S)No.6001]

7.PC : The connection is established.

8.Server : The connection is established.

9.When PC or server sent 'SYN', each starting Sequence No. was set at random. PC(2000),Server(6000)

10.PC : (PSH) Requests the website data.

11.Starts the communication of the website data.

12.PC : This request size is 1 packet, the amount is 10 bytes. [(P)No.2001-2010]

13.Request and response between PC and server

14.Server : (ACK) OK. [(P)No.2011] (PSH) Sends the website data. (1 packet, the amount is 1000 bytes) [(S)No.6001-7000]

15.PC : Got the half of the website data.

16.PC : (ACK) OK. [(S)No.7001]

17.Server : (PSH) Sends the latter half of the site data (1 packet, 1000 bytes). [(S)No.7001-8000]

18.PC : Got the website data.

19.PC : (ACK) OK. [(S)No.8001]

20.Under finishing the connection

21.PC : (FIN) Finishes viewing the website.This request size is 1 packet, the amount is 1 byte. [(P)No.2011]

22.Server : (ACK) OK. [(P)No.2012]

23.Server : (FIN) Finishes the connection, too. [(S)No.8001]

24.PC : (ACK) OK. [(S)No.8002]

25.Server : The connection has finished.

26.PC : The communication has finished.



TCP trouble

Some trouble occurs during TCP communication.


*About '[(S)No.00]'
'No.00' means the Sequence No. in TCP header.'(S)' means server side Sequence No. and '(P)' means PC side one.

1.The connection for communication has been already established for concise explanation.

2.When PC or server sent 'SYN', each starting Sequence No. was set at random. PC[2000],Server[6000].And these No. are increased 1 during 3 way handshake.

3.PC : (PSH) Requests the website data.

4.Starts the communication of the website data.

5.PC : This request size is 1 packet, the amount is 10 bytes. [(P)No.2001-2010]

6.Request and response between PC and server

7.Server : (ACK) OK. [(P)No.2011] (PSH) Sends the website data. (1 packet, the amount is 1000 bytes) [(S)No.6001-7000]

8.The part of data is missed.

9.PC : The data isn't able to be restored.

10.PC : The amount of received data is actually 800 bytes. It decreased 200 bytes.

11.PC : lost Sequence No. [(S)No.6801-7000]

12.PC : This provokes Checksum error. In this case, PC can't send ACK.

13.Server : (PSH) Sends the same packets again because the ACK doesn't return despite of passing for a period. [(S)No.6001-7000]

14.PC : (ACK) OK. [(S)No.7001]

15.Server : (PSH) Sends the website data. (1 packet, the amount is 1000 bytes) [(S)No.7001-8000]

16.PC : Got the website data.

17.PC : (ACK) OK. [(S)No.8001]

18.PC : ACK packet was missed.

19.Server : (PSH) Sends the same packets again because the ACK doesn't return despite of passing for a period. [(S)No.7001-8000]

20.PC : (ACK) Got the website data.

21.Server : Received ACK. [(S)No.8001] All the website data has been sent.

22.Finishing the connection is left out.



TCP Window

Setting 'Window' size enables continuous communication.


*About '[(S)No.00]'
'No.00' means the Sequence No. in TCP header.'(S)' means server side Sequence No. and '(P)' means PC side one.

1.The connection for communication has been already established for concise explanation.

2.Sequence No., MSS and Window size is decided when the connection is established. Window=MSS*2.So the site data is sent 2 times in a row without receiving ACK.

3.Starts the communication of the website data.

4.PC : (PSH) Requests the website data.

5.PC : This request size is 1 packet, the amount is 10 bytes. [(P)No.2001-2010]

6.Request and response between PC and server

7.Server sends sequentially before accepting ACK according to Window size.

8.Server : (ACK) OK. [(P)No.2011] (PSH) Sends the website data. (1 packet, the amount is 1000 bytes) [(S)No.6001-7000]

9.Server : (PSH) Sends the next packet. [(S)No.7001-8000]

10.PC : (ACK) Got the half of the website data.

11.Server : Received ACK. [(S)No.7001]

12.PC : (ACK) Got the website data.

13.Server : Received ACK. [(S)No.8001] All the website data has been sent.

14.Finishing the connection is left out.

15.Because Window size is set, the communication time is made to shorten.



TCP Window trouble

Some trouble occurs when 'Window' size is set.


*About '[(S)No.00]'
'No.00' means the Sequence No. in TCP header.'(S)' means server side Sequence No. and '(P)' means PC side one.

1.The connection for communication has been already established for concise explanation.

2.Sequence No., MSS and Window size is decided when the connection is established. Window=MSS*2.So the site data is sent 2 times in a row without receiving ACK.

3.Starts the communication of the website data.

4.PC : (PSH) Requests the website data.

5.PC : This request size is 1 packet, the amount is 10 bytes. [(P)No.2001-2010]

6.Request and response between PC and server

7.Server sends sequentially before accepting ACK according to Window size.

8.Server : (ACK) OK. [(P)No.2011] (PSH) Sends the website data. (1 packet, the amount is 1000 bytes) [(S)No.6001-7000]

9.PC : Got the website data. [(S)No.6001-6800] The part of data is missed.

10.Server : (PSH) Sends the next packet. [(S)No.7001-8000]

11.The part of data is missed.

12.Server : Server is Waiting for the first ACK. [(S)No.7001]

13.PC : (ACK) Got the latter half of the website data. [(S)No.7001-8000]

14.PC : Only the second ACK is returned. ACK No. shows that PC requests the first packet. [(S)No.6001]

15.PC : If the site data packet that differs from the first are sent to PC, it returns the same ACK. [(S)No.6001]

16.Server : If the same ACK is returned several times in a row or time out happens, server sends the packet again. [(S)No.6001-7000]

17.Server : (PSH) Sends the same packets again because the past ACK No. is still sent. [(S)No.6001-7000]

18.PC : (ACK) Got the website data. [(S)No.6001-7000]

19.Server : Received ACK. [(S)No.8001] All the website data has been sent.

20.Finishing the connection is left out.

21.If the data isn't sent correctly in the way, the receiver waits for the lack data and keeps to tell the sender with the same ACK No.



UDP

UDP communication. This example is obsolete web video.


1.Before video data is started to download with UDP, PC has to access the website which publishes the video with TCP.Explanation about TCP is concise.

2.PC : (PSH) Requests the website data.

3.Server : (ACK)+(PSH) Sends the website data.

4.PC : (ACK) Got the website data.

5.The connection is established and site data is downloaded with TCP.Video data isn't downloaded yet.

6.PC : (PSH) Plays the video with the button.

7.Server : (ACK) OK.

8.This connection is for TCP communication. UDP doesn't need it.It is vanished here for explanation.

9.This video application transmits the data with UDP.

10.Server : This video application transmits the data with UDP.

11.PC : PC got the video data and views it.

12.Server : Sends the next data without data check and waiting response.

13.Server : This video application transmits the data with UDP.

14.Video data is sent one after another.

15.PC : PC got the video data and views it.

16.Server : This video application transmits the data with UDP.

17.UDP communication finished suddenly by manipulation of PC.From now on,the data will be sent with TCP.

18.PC : (PSH) Presses the end button.

19.Server : (ACK) OK.

20.PC : Finished watching the video.



UDP trouble

Some trouble occurs during UDP communication.


1.Before video data is started to download with UDP, PC has to access the website which publishes the video with TCP.Explanation about TCP is concise.

2.PC : (PSH) Requests the website data.

3.Server : (ACK)+(PSH) Sends the website data.

4.PC : (ACK) Got the website data.

5.The connection is established and site data is downloaded with TCP.Video data isn't downloaded yet.

6.PC : (PSH) Plays the video with the button.

7.Server : (ACK) OK.

8.This connection is for TCP communication. UDP doesn't need it.It is vanished here for explanation.

9.This video application transmits the data with UDP.

10.Server : This video application transmits the data with UDP.

11.PC : PC got the video data and views it.

12.Server : Sends the next data without data check and waiting response.

13.Server : This video application transmits the data with UDP.

14.Video data is sent one after another.

15.PC : PC got the video data and views it.

16.Server : This video application transmits the data with UDP.

17.Even if data is lost, data isn't check by UDP.

18.But because data amount is recorded in UDP header, application can do with it for resolving the trouble.

19.UDP communication finished suddenly by manipulation of PC.From now on,the data will be sent with TCP.

20.PC : (PSH) Presses the end button.

21.Server : (ACK) OK.

22.PC : Finished watching the video.



Actual Network / Website, SSL / Email / FTP / VPN /

Devices / DNS / LAN, DHCP, NAT / IP address / PC port /

Layer of TCP/IP / TCP,UDP communication / IP communication / Top scene


us / es / cn / ja / kr / de / fr / pt / it / ru / ar / Ogumo top