ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Computer Networks
    COMP2119
    Progress0 / 24 topics
    Topics
    1. Introduction and Protocols Architecture2. Basic Concepts of Networking3. Network Topologies4. Layered Architecture5. Physical Layer Functionality6. Data Link Layer Functionality7. Multiple Access Techniques8. Circuit Switching and Packet Switching9. LAN Technologies10. Wireless Networks11. MAC Addressing12. Networking Devices13. Network Layer Protocols14. IPv4 and IPv615. IP Addressing16. Sub Netting17. CIDR18. Routing Protocols19. Transport Layer Protocols20. Ports and Sockets21. Connection Establishment22. Flow and Congestion Control23. Application Layer Protocols24. Latest Trends in Computer Networks
    COMP2119›Connection Establishment
    Computer NetworksTopic 21 of 24

    Connection Establishment

    3 minread
    501words
    Beginnerlevel

    Connection establishment is a crucial process in networking, particularly for connection-oriented protocols like TCP (Transmission Control Protocol). This process ensures that a reliable communication channel is established between two devices (hosts) before any data is transmitted. Here’s an overview of how connection establishment works, focusing on TCP, including the key steps and concepts involved.

    TCP Connection Establishment

    The Three-Way Handshake

    TCP uses a method called the three-way handshake to establish a connection. This process involves three main steps:

    1. SYN (Synchronize):

      • The client sends a SYN packet to the server to initiate a connection. This packet includes:
        • The client’s initial sequence number, which is used for tracking data segments.
      • Purpose: To signal the server that the client wants to establish a connection.
    2. SYN-ACK (Synchronize-Acknowledge):

      • The server responds with a SYN-ACK packet. This packet includes:
        • The server’s own initial sequence number.
        • An acknowledgment of the client’s SYN (the server acknowledges the received SYN by incrementing the client’s sequence number by 1).
      • Purpose: To confirm receipt of the client's request and to indicate that the server is ready to establish a connection.
    3. ACK (Acknowledge):

      • The client sends an ACK packet back to the server, acknowledging the server’s SYN-ACK.
      • This packet increments the server's sequence number by 1.
      • Purpose: To confirm that the client received the server’s response and complete the connection establishment.

    Diagram of the Three-Way Handshake

    Client                      Server
       |  SYN (Seq = x)         |
       | ----------------------> |
       |                         |
       |  SYN-ACK (Seq = y, Ack = x+1) |
       | <---------------------- |
       |                         |
       |  ACK (Seq = x+1, Ack = y+1) |
       | ----------------------> |
    

    Key Concepts

    • Sequence Numbers: These numbers are used by TCP to ensure data is delivered in the correct order and to manage the flow of data. Each byte of data is assigned a sequence number, allowing the receiver to reorder segments as necessary.

    • Acknowledgments (ACKs): TCP uses acknowledgments to confirm the successful receipt of data. If the sender does not receive an ACK within a certain time frame, it assumes the data was lost and retransmits it.

    • Reliability: The three-way handshake ensures that both the client and server are ready to communicate, providing a reliable connection before data transmission begins.

    Importance of Connection Establishment

    1. Reliability: Ensures that both ends are synchronized and prepared for data transfer, which is critical for applications that require guaranteed delivery (like web browsing and file transfers).

    2. Flow Control: Allows for the negotiation of parameters such as window size, which helps manage the flow of data and prevents network congestion.

    3. Error Handling: The establishment phase helps in setting up mechanisms for error detection and correction throughout the session.

    Conclusion

    Connection establishment through the three-way handshake is a fundamental aspect of TCP, ensuring reliable and ordered delivery of data between devices. Understanding this process is essential for anyone involved in networking, application development, or troubleshooting network issues. If you have more questions or would like to explore related topics, feel free to ask!

    Previous topic 20
    Ports and Sockets
    Next topic 22
    Flow and Congestion Control

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time3 min
      Word count501
      Code examples0
      DifficultyBeginner