CCNP-Studies
Routing
4-BGP
5 Tcp for Bgp

Transmission Control Protocol (TCP) in BGP

Transmission Control Protocol (TCP) in BGP:

TCP plays a pivotal role in the functioning of the Border Gateway Protocol (BGP). Understanding its aspects is essential to comprehend BGP's operation.

  • Port 179:

    • BGP operates on port 179 within the TCP protocol suite.
    • TCP serves as BGP's underlying foundation, offering critical functionalities like reliable transport, in-order delivery, retransmission mechanisms, and more.
    • Leveraging TCP for these core features prevents the need to reinvent the wheel.
  • BGP Client and Server Roles:

    • In the BGP context, the client initiates connections using random high port numbers and source IPs.
    • The server, on the other hand, listens and accepts incoming connections on TCP port 179.
    • You can observe these roles in action using tools like Wireshark or by issuing the CLI command "show tcp brief."
    • In case of a collision, the router with the higher router-ID assumes the client role.
  • TCP Session Establishment and Teardown:

    • TCP sessions in BGP follow specific procedures.
    • The 3-Way Handshake is the initial connection setup and involves three frames: SYN, SYN/ACK, and ACK.
    • When gracefully terminating a session, four frames are exchanged: FIN/PSH/ACK, ACK, FIN/PSH/ACK, and ACK.
    • You can also inspect these interactions using the CLI command "debug ip packet detail."
  • Maximum Segment Size (MSS):

    • MSS is a critical parameter, especially during the 3-Way Handshake initiation.
    • It is a Layer 4 construct and should not be confused with IP Maximum Transmission Unit (MTU), which operates at Layer 3.
    • As a rule of thumb, MSS is calculated as 1500 - TCP Header - IP Header (e.g., 1500 - 20 - 20 = 1460).
    • MSS adjustments become significant when employing overlay, encapsulation, and encryption techniques:
      • For GRE, an additional 24 bytes are added.
      • In the case of IPsec (Transport Mode), 36 bytes are included.
      • IPsec (Tunnel Mode) introduces 52 extra bytes.
      • Combining IPsec (Transport Mode) with GRE results in 60 extra bytes.
      • For IPsec (Tunnel Mode) with GRE, an additional 76 bytes are used.

Understanding the role of TCP and MSS in BGP is crucial for efficient communication and reliable session management in the context of routing and peering. This knowledge forms the basis for secure and optimized BGP operations.