Galle, LK--:--5/6 sites live

Networking 06 — Transport: TCP, UDP, the Three-Way Handshake, Timers and Ports

Reliable vs best-effort delivery, the handshake and teardown, retransmission and keep-alive timers, and the port numbers every engineer should know.

6 Aug 20265 min readSelf Guide · Stage 2#TCP#UDP#Transport#Sinhala

These notes began as two handwritten notebooks for COM 3401 — Data Communication and Networking at Rajarata University. I OCR'd them, rewrote them in English, and paired every section with a Sinhala explanation so the concept comes first and the English terms stay intact for the exam. Diagrams are redrawn as vector graphics.

TCP

ටීසීපී

TCP stands for Transmission Control Protocol. It will ensure that the data will reach its destination and that it will not be corrupted on the way.

සිංහලෙන්: TCP යනු සම්ප්‍රේෂණ පාලන ප්‍රොටෝකෝලයයි. එය දත්ත එහි ගමනාන්තයට ළඟා වන බව සහතික කරනු ඇති අතර එය අතරමගදී එය දූෂිත නොවේ.

It lies between the application and network layers, which are used in providing reliable delivery services. It is a connection oriented protocol for communications that helps in the exchange of messages between the devices over a network.

සිංහලෙන්: එය විශ්වාසදායක බෙදාහැරීමේ සේවා සැපයීම සඳහා භාවිතා කරන යෙදුම සහ ජාල ස්ථර අතර පිහිටා ඇත. එය ජාලයක් හරහා උපාංග අතර පණිවිඩ හුවමාරු කර ගැනීමට උපකාර වන සන්නිවේදනය සඳහා සම්බන්ධක නැඹුරු ප්‍රොටෝකෝලයකි.

It is a transport layer protocol, it does congestion control, and it maintains the order of data using sequence numbers.

සිංහලෙන්: එය ප්‍රවාහන ස්ථර ප්‍රොටෝකෝලයකි, එය තදබදය පාලනය කරයි, සහ අනුක්‍රමික අංක භාවිතයෙන් දත්ත අනුපිළිවෙල පවත්වාගෙන යයි.

UDP

යූඩීපී

UDP stands for User Datagram Protocol. When not all data is reaching, that is, data can be lost and that is fine by us, we use UDP.

සිංහලෙන්: UDP යනු User Datagram Protocol යන්නයි. සියලුම දත්ත ළඟා නොවන විට, එනම්, දත්ත නැති විය හැකි අතර එය අපට හොඳින් සිදු වේ, අපි UDP භාවිතා කරමු.

Unlike TCP, it is an unreliable and connectionless protocol. It is a transport layer protocol. UDP is used for real time services like computer gaming, voice or video communication and live conferences.

සිංහලෙන්: TCP මෙන් නොව, එය විශ්වාස කළ නොහැකි සහ සම්බන්ධතා රහිත ප්‍රොටෝකෝලයකි. එය ප්‍රවාහන ස්ථර ප්‍රොටෝකෝලයකි. පරිගණක ක්‍රීඩා, හඬ හෝ වීඩියෝ සන්නිවේදනය සහ සජීවී සම්මන්ත්‍රණ වැනි තත්‍ය කාලීන සේවා සඳහා UDP භාවිතා වේ.

The Three Way Handshake

ත්‍රිපාද අතට අත දීම

A three way handshake is a method used in a TCP/IP network to create a connection between a local host or client and a server.

සිංහලෙන්: තුන් ආකාරයකින් හෑන්ඩ්ෂේක් යනු TCP/IP ජාලයක දේශීය ධාරකයෙකු හෝ සේවාලාභියෙකු සහ සේවාදායකයක් අතර සම්බන්ධතාවයක් ඇති කිරීමට භාවිතා කරන ක්‍රමයකි.

It is a three step method designed to allow both communicating ends to initiate and negotiate the parameters of the network TCP socket connection at the same time, before data such as HTTP and SSH is transmitted.

සිංහලෙන්: එය HTTP සහ SSH වැනි දත්ත සම්ප්‍රේෂණය කිරීමට පෙර, සන්නිවේදන අන්ත දෙකටම එකවර ජාල TCP සොකට් සම්බන්ධතාවයේ පරාමිතීන් ආරම්භ කිරීමට සහ සාකච්ඡා කිරීමට ඉඩ සැලසෙන පරිදි නිර්මාණය කර ඇති පියවර තුනකි.

TCP three way handshake

TCP 3-way handshake

  • Step one, SYN. The client wants to establish a connection with a server, so it sends a segment with SYN, which stands for synchronize sequence number. This informs the server that the client is likely to start communication and with what sequence it starts the segment.
  • Step two, SYN plus ACK. The server responds to the client request with the SYN and ACK signal bits set. The acknowledgment signifies the response of the segment it received, and the SYN signifies with what sequence number it is likely to start the segments.
  • Step three, ACK. In the final part the client acknowledges the response of the server, and they both establish a reliable connection with which they will start the actual data transfer.

සිංහලෙන්: පළමු පියවර, SYN. සේවාදායකයාට සේවාදායකයක් සමඟ සම්බන්ධතාවයක් ඇති කර ගැනීමට අවශ්‍ය වේ, එබැවින් එය SYN සමඟ කොටසක් යවයි, එනම් සමමුහුර්ත අනුක්‍රමික අංකයයි. සේවාදායකයා සන්නිවේදනය ආරම්භ කිරීමට ඉඩ ඇති බවත් එය කුමන අනුපිළිවෙලකින් කොටස ආරම්භ කරන්නේද යන්න මෙය සේවාදායකයට දන්වයි.දෙවන පියවර, SYN plus ACK. SYN සහ ACK සංඥා බිටු කට්ටලය සමඟ සේවාදායකයා සේවාදායක ඉල්ලීමට ප්‍රතිචාර දක්වයි. පිළිගැනීම මගින් එයට ලැබුණු කොටසේ ප්‍රතිචාරය සනිටුහන් වන අතර SYN යන්නෙන් අදහස් කරන්නේ කුමන අනුක්‍රමික අංකයකින් එය කොටස් ආරම්භ කළ හැකිද යන්නයි.තුන්වන පියවර, ACK. අවසාන කොටසේදී සේවාදායකයා සේවාදායකයේ ප්‍රතිචාරය පිළිගන්නා අතර, ඔවුන් දෙදෙනාම සත්‍ය දත්ත හුවමාරුව ආරම්භ කරන විශ්වාසනීය සම්බන්ධතාවයක් ස්ථාපිත කරයි.

TCP Timers

ටීසීපී ටයිමර

Timers used by TCP to avoid excessive delays during communication are called TCP timers. There are four types of timers.

සිංහලෙන්: සන්නිවේදනය අතරතුර අධික ප්‍රමාදයන් වළක්වා ගැනීමට TCP විසින් භාවිතා කරන ටයිමර් TCP ටයිමර් ලෙස හැඳින්වේ. ටයිමර් වර්ග හතරක් ඇත.

Retransmission Timer

It is also known as the time out timer. TCP uses a time out timer for retransmission of lost segments or packets. The sender starts a time out timer after transmitting a TCP segment to the receiver.

සිංහලෙන්: එය ටයිමරය ලෙසද හැඳින්වේ. නැතිවූ කොටස් හෝ පැකට් නැවත සම්ප්‍රේෂණය කිරීම සඳහා TCP කල් ඉකුත් වීමේ ටයිමරයක් භාවිතා කරයි. යවන්නා TCP කොටස ග්‍රාහකයාට සම්ප්‍රේෂණය කිරීමෙන් පසු කාල සීමාවක් ආරම්භ කරයි.

If the sender receives an acknowledgment before the timer goes off, it stops the timer. If the sender does not receive any acknowledgment and the time goes off, then the sender retransmits the same segment and resets the timer. The value of the time out timer is dynamic and changes with the amount of traffic in the network.

සිංහලෙන්: ටයිමරය ක්‍රියා විරහිත වීමට පෙර යවන්නාට පිළිගැනීමක් ලැබුණහොත්, එය ටයිමරය නතර කරයි. යවන්නාට කිසිදු පිළිගැනීමක් නොලැබුණහොත් සහ කාලය අවසන් වන්නේ නම්, යවන්නා එම කොටසම නැවත සම්ප්‍රේෂණය කර ටයිමරය යළි සකසයි. කාලය අවසන් වන ටයිමරයේ අගය ගතික වන අතර ජාලයේ ගමනාගමන ප්‍රමාණය සමඟ වෙනස් වේ.

Persistent Timer

TCP uses a persistent timer to deal with a zero window size deadlock situation. It keeps the window size information flowing even if the other end closes its receiver window.

සිංහලෙන්: TCP ශුන්‍ය කවුළු ප්‍රමාණයේ අවහිර තත්වයක් සමඟ කටයුතු කිරීමට ස්ථීර ටයිමරයක් භාවිතා කරයි. අනෙක් අන්තය එහි ග්‍රාහක කවුළුව වැසුවත් එය කවුළු ප්‍රමාණයේ තොරතුරු ගලා යයි.

Keep Alive Timer

TCP uses a keep alive timer to prevent long idle connections. Each time the server hears from the client, it resets the keep alive timer to two hours.

සිංහලෙන්: TCP දිගු නිෂ්ක්‍රීය සම්බන්ධතා වැලැක්වීම සඳහා Keep alive ටයිමරයක් භාවිතා කරයි. සේවාදායකයා සේවාදායකයාගෙන් අසන සෑම අවස්ථාවකම, එය පණපිටින් තබාගැනීමේ කාලසීමාව පැය දෙකකට නැවත සකසයි.

If the server does not hear from the client for two hours, it sends ten probe segments to the client. These probe segments are sent at a gap of 75 seconds. If the server receives no response after sending ten probe segments, it assumes that the client is down and then the server terminates the connection automatically.

සිංහලෙන්: සේවාදායකයා සේවාදායකයාගෙන් පැය දෙකක් නොඇසෙන්නේ නම්, එය සේවාදායකයාට පරීක්ෂණ කොටස් දහයක් යවයි. මෙම පරීක්ෂණ කොටස් තත්පර 75 ක පරතරයකින් යවනු ලැබේ. පරීක්ෂණ කොටස් දහයක් යැවීමෙන් පසු සේවාදායකයට ප්‍රතිචාරයක් නොලැබුනේ නම්, එය සේවාදායකයා අක්‍රිය වී ඇති බව උපකල්පනය කරයි, එවිට සේවාදායකය ස්වයංක්‍රීයව සම්බන්ධතාවය අවසන් කරයි.

Time Wait Timer

TCP uses a time wait timer during connection termination. The sender starts the time wait timer after sending the acknowledgment for the FIN segment.

සිංහලෙන්: සම්බන්ධතා අවසන් කිරීමේදී TCP කාල පොරොත්තු ටයිමරයක් භාවිතා කරයි. FIN කොටස සඳහා පිළිගැනීමක් යැවීමෙන් පසු යවන්නා කාල පොරොත්තු කාලය ආරම්භ කරයි.

It allows the final acknowledgment to be resent if it gets lost. It prevents the just closed port from reopening again quickly to some other application, and it ensures that all the segments heading towards the just closed port are discarded. The value of the time wait timer is usually set to twice the lifetime of a TCP segment.

සිංහලෙන්: එය අවසන් පිළිගැනීම නැති වුවහොත් එය නැවත යැවීමට ඉඩ සලසයි. එය යන්තම් වසා දැමූ වරාය වෙනත් යෙදුමකට ඉක්මනින් නැවත විවෘත කිරීම වළක්වන අතර, වසා දැමූ වරාය දෙසට යන සියලුම කොටස් ඉවතලන බව සහතික කරයි. සාමාන්‍යයෙන් TCP කොටසක ආයු කාලය මෙන් දෙගුණයක් ලෙස පොරොත්තු කාල ගණකයේ අගය සකසා ඇත.

Port Numbers

පෝට් අංක

Applications are differentiated using port numbers. Every application has a different port number which is used by the router after the IP address to decide to which application the data needs to be sent.

සිංහලෙන්: තොට අංක භාවිතයෙන් යෙදුම් වෙනස් වේ. සෑම යෙදුමකටම වෙනස් තොට අංකයක් ඇති අතර එය දත්ත යැවිය යුත්තේ කුමන යෙදුමටද යන්න තීරණය කිරීමට IP ලිපිනයට පසුව රවුටරය භාවිතා කරයි.

The IP address will identify the computer and the port number will identify the application. All the HTTP traffic will happen on port 80.

සිංහලෙන්: IP ලිපිනය පරිගණකය හඳුනා ගන්නා අතර වරාය අංකය යෙදුම හඳුනා ගනී. සියලුම HTTP ගමනාගමනය වරාය 80 මත සිදුවනු ඇත.

A port number is a 16 bit number, so the total is two to the power sixteen which is about 65,000 ports.

සිංහලෙන්: තොට අංකයක් යනු බිටු 16 අංකයකි, එබැවින් මුළු බලය දහසයට දෙකක් වන අතර එය වරායන් 65,000ක් පමණ වේ.

  • Port numbers 0 to 1023 are reserved ports.
  • Port numbers 1024 to 49152 are registered for specific applications.
  • The remaining ones we can use freely.

සිංහලෙන්: වරාය අංක 0 සිට 1023 දක්වා වෙන් කළ වරායන් වේ.වරාය අංක 1024 සිට 49152 දක්වා නිශ්චිත යෙදුම් සඳහා ලියාපදිංචි කර ඇත.ඉතිරි ඒවා අපට නිදහසේ භාවිතා කළ හැකිය.


Keep going: ← Previous chapter · Next chapter → · Networking stage in the Self Guide