0% found this document useful (0 votes)
10 views15 pages

Transport Service

The Transport Layer provides essential services such as process-to-process communication, reliable data transfer, multiplexing, connection management, flow control, and error detection to facilitate efficient data transmission between applications on different hosts. It manages connections through protocols like TCP, ensuring reliable communication via handshakes for establishment and proper termination. Additionally, it employs mechanisms for congestion control, segmentation, and full-duplex communication to enhance data integrity and performance.

Uploaded by

Sukhwinder Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views15 pages

Transport Service

The Transport Layer provides essential services such as process-to-process communication, reliable data transfer, multiplexing, connection management, flow control, and error detection to facilitate efficient data transmission between applications on different hosts. It manages connections through protocols like TCP, ensuring reliable communication via handshakes for establishment and proper termination. Additionally, it employs mechanisms for congestion control, segmentation, and full-duplex communication to enhance data integrity and performance.

Uploaded by

Sukhwinder Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

‭ .

‬‭Explain in detail various services provided by the Transport layer to‬


8
‭upper layers. Also discuss connection management.‬
‭The Transport Service – Services Provided to the Upper Layers‬
‭The‬‭Transport Layer‬‭provides services that enable‬‭reliable and efficient‬
‭data communication between processes‬‭running on different hosts. It‬
‭acts as an intermediary between the‬‭Application Layer‬‭and the‬‭Network‬
‭Layer‬‭.‬
‭Services Provided to the Upper Layers:‬
‭1.‬ ‭Process-to-Process Communication:-‬‭Unlike the Network Layer ,‬
‭the Transport Layer ensures data is delivered to the correct process‬
‭on the receiving machine using port numbers.‬
‭Each process on a host is identified by a port number, enabling‬
‭multiplexing and demultiplexing of data.‬
‭2.‬ ‭Reliable Data Transfer:-‬‭Transport Layer ensures that data is‬
‭delivered without loss, duplication, or errors, and in the correct order.‬
‭In protocols like TCP, reliability is achieved using Acknowledgments‬
‭(ACKs),Retransmissions,Sequence numbers,Checksums‬
‭Example: TCP provides reliable data transfer, whereas UDP does‬
‭not.‬
‭3.‬ ‭Multiplexing and Demultiplexing:-‬
‭Multiplexing:-‬‭The transport layer gathers data from multiple‬
‭applications on the sending host and encapsulates it into a single‬
‭segment for transmission.‬
‭Demultiplexing:-‬‭At the receiving end, the transport layer uses port‬
‭numbers to identify the correct receiving application for the data,‬
‭4.‬ ‭Connection Establishment and Termination:-‬‭The transport layer‬
‭establishes and terminates connections between hosts, providing‬
‭reliable communication. This is often achieved using protocols like‬
‭TCP, which uses a handshake to establish a robust connection, and‬
‭cleanly closes‬‭the connection after data transfer ends.‬
‭5.‬ ‭Flow Control:-‬‭The transport layerPrevents the sender from‬
‭overwhelming the receiver with too much data at once.‬
‭The transport layer uses mechanisms like the sliding window protocol‬
‭to regulate the rate of data transmission.‬
‭Example: TCP uses window size to implement flow control.‬
‭6.‬ ‭Congestion Control:-‬‭Transport layer prevents too much data from‬
‭being injected into the network, which can cause packet loss and‬
‭delays.‬
‭ CP uses algorithms like slow start, congestion avoidance, and AIMD‬
T
‭to manage congestion.‬
‭7.‬ ‭Segmentation and Reassembly:-‬‭Messages from the application‬
‭layer may be large and need to be divided into smaller segments.‬
‭The transport layer breaks down data into manageable segments.‬
‭On the receiving side, these segments are reassembled in the correct‬
‭order before passing them to the application.‬
‭8.‬ ‭Error Detection and Correction:- It uses techniques like‬
‭checksums and acknowledgments to ensure data integrity and‬
‭retransmits lost or corrupted segments,‬
‭9.‬ ‭Full-Duplex Communication:-‬‭The transport layer supports‬
‭simultaneous two-way data transmission‬‭, allowing both hosts to‬
‭send and receive data concurrently.‬

‭ lements of Transport Protocols‬


E
‭The transport layer is responsible for reliable and efficient delivery of data‬
‭between processes on different hosts. To achieve this, transport protocols‬
‭like‬‭TCP‬‭and‬‭UDP‬‭include the following key elements:‬
‭1. Addressing:-‬‭To deliver data to the correct application process, the‬
‭transport layer uses port numbers.Every process is identified by <IP‬
‭address, Port number>‬
‭This allows the transport layer to distinguish between multiple running‬
‭processes on the same host.‬
‭2. Multiplexing and Demultiplexing‬
‭●‬ ‭Multiplexing‬‭: Allows multiple application processes to share a single‬
‭transport connection or network path.‬
‭The transport layer‬‭adds headers with port numbers‬‭to identify‬
‭which data belongs to which process.‬
‭●‬ ‭Demultiplexing‬‭: At the receiving side, the transport layer‬‭uses port‬
‭numbers‬‭to deliver incoming data to the correct application.‬
‭3. connection establishment in book page 10.9‬
‭4.connection release‬
‭5. Flow Control and Error Control‬
‭Flow Control:-‬‭It prevents a fast sender from overwhelming a slower‬
‭receiver.Sliding window mechanism used in TCP adjusts the amount of‬
‭data that can be sent without acknowledgment.‬
‭Error Control:-‬‭It ensures reliable data delivery even in the presence of‬
‭network errors.Mechanisms include Checksums to detect corrupted data,‬
‭ACKs/NACKs and Retransmissions on timeout or errors‬
‭ . Crash Recovery:-‬‭It Involves restoring communication after one or both‬
6
‭hosts crash or reboot.‬
‭In connection-oriented protocols, crash recovery ensures Unacknowledged‬
‭data is retransmitted and Connection states are restored‬
‭Some protocols support checkpointing, which saves the connection state‬
‭periodically to allow rollback or recovery.‬
‭Transport Service Primitives‬
‭Transport service primitives are the‬‭basic operations (or commands)‬‭that‬
‭applications use to interact with the transport layer. These primitives allow‬
‭applications to‬‭establish connections, send data, receive data, and‬
‭terminate connections‬‭.‬
‭The set of primitives that are available greatly depends upon the nature of‬
‭the service that is being provided. The primitives for connection-oriented‬
‭service are different from those of connectionless service.‬
‭Types of Service Primitives‬
‭There are five types of service primitives:‬
‭1.‬ ‭LISTEN‬‭:-When a server is ready to accept an incoming connection, it‬
‭executes the LISTEN primitive.It blocks waiting for an incoming‬
‭connection.‬
‭2.‬ ‭CONNECT‬‭:-It connects the server by establishing a‬
‭connection.Response is awaited.‬
‭3.‬ ‭RECEIVE‬‭:-Then the RECEIVE call blocks the server.‬
‭4.‬ ‭SEND‬‭:When the client executes the SEND primitive to transmit its‬
‭request, followed by the execution of RECEIVE to get the reply.Send‬
‭the message.‬
‭5.‬ ‭DISCONNECT‬‭:-This primitive is used for terminating the connection.‬
‭After this primitive, one cannot send any message.When the client‬
‭sends the DISCONNECT packet, then the server also sends the‬
‭DISCONNECT packet to acknowledge the client.When the server‬
‭packet is received by the client, then the process is terminated.‬
‭Parameters of Service Primitives:-‬‭The parameters of primitives are‬
‭CONNECT, DATA, DISCONNECT‬‭which are used to:‬
‭●‬ ‭Establish a connection‬
‭●‬ ‭Send data‬
‭●‬ ‭Disconnect a connection‬
‭Confirmation of Services:-‬‭Generally, services can be either‬‭confirmed‬
‭or unconfirmed‬‭:‬
‭●‬ ‭Confirmed Service‬‭: The connection-oriented services are called‬
‭confirmed services.‬
‭●‬ U ‭ nconfirmed Service‬‭: The connectionless services are called‬
‭unconfirmed services.‬
‭Connection-Oriented Service Primitives‬
‭The service primitives for the connection-oriented services are as follows:‬
‭●‬ ‭CONNECT.request‬‭: Request a connection to be established.‬
‭●‬ ‭CONNECT.indication‬‭: Signal the called party (phone ringing).‬
‭●‬ ‭CONNECT.response‬‭: The receiver decides whether to accept or‬
‭reject the connection.‬
‭●‬ ‭CONNECT.confirm‬‭: The initiator is informed whether the connection‬
‭was accepted.‬
‭●‬ ‭DATA.request‬‭: Data is submitted for transmission.‬
‭●‬ ‭DATA.indication‬‭: The receiving side is notified of incoming data.‬
‭●‬ ‭DISCONNECT.request‬‭: A connection release is initiated.‬
‭●‬ ‭DISCONNECT.indication‬‭: The peer is notified about the‬
‭disconnection request.‬
‭An example of connection-oriented communication is the‬‭telephone‬
‭system‬‭, where both parties establish a call before talking.‬
‭Connectionless Service Primitives‬
‭The service primitives for the connectionless services are as follows:‬
‭●‬ ‭SENDING‬‭: Sends data (like traditional postal service).‬
‭●‬ ‭REPORT.confirm‬‭: Availability of reports that data reached at‬
‭destination (registered post).‬
‭UDP IN BOOK PAGE 10.16‬

‭ emote Procedure Call‬


R
‭Remote Procedure Call (RPC) is a communication protocol used in‬
‭computer networks that allows a program on one computer (client) to call a‬
‭function (procedure) on another computer (server) as if it were a local‬
‭function.‬
‭RPC hides the details of network communication.The calling code doesn’t‬
‭need to know if the procedure is local or remote — this complexity is‬
‭hidden by the RPC mechanism.‬
‭The actual steps in making an RPC are shown in Fig. 4.17.‬
‭ tep 1 is the client calling the client stub. This call is a local procedure call,‬
S
‭with the parameters pushed onto the stack in the normal way.‬
‭Step 2 is the client stub packing the parameters into a message and‬
‭making a system call to send the message. Packing the parameters is‬
‭called marshaling.‬
‭Step 3 is the operating system sending the message from the client‬
‭machine to the server machine.‬
‭Step 4 is the operating system passing the incoming packet to the server‬
‭stub.‬
‭Finally, step 5 is the server stub calling the server procedure with the‬
‭unmarshaled parameters.‬
‭Advantages:‬
‭●‬ ‭It simplifies network programming.‬
‭●‬ ‭It enhances modular design of distributed systems.‬
‭●‬ ‭It offers a clear abstraction of remote communication.‬
‭Disadvantages:‬
‭●‬ ‭Latency and network failure can affect performance.‬
‭●‬ ‭It is not suitable for real-time or time-sensitive operations without‬
‭extra control.‬
‭●‬ ‭It requires careful data serialization to handle system differences‬
‭(e.g., byte ordering).‬
‭Example:‬‭Sun RPC‬‭,‬‭gRPC (by Google)‬‭,‬‭XML-RPC‬‭,‬‭JSON-RPC‬‭.‬
‭Components Involved:‬
‭●‬ ‭Client Stub‬‭: A placeholder function in the client system that behaves‬
‭like the remote function.‬
‭●‬ S
‭ erver Stub‬‭: Receives the request and invokes the actual‬
‭server-side function.‬

‭●‬ M
‭ arshalling/Unmarshalling‬‭: Packing and unpacking data to be sent‬
‭over a network.‬

‭●‬ R ‭ PC Runtime‬‭: Handles message transmission and reception over‬


‭the network.‬
‭Key Terms in RPC:‬
‭●‬ ‭Stub‬‭: A placeholder function on the client that represents the remote‬
‭function.‬

‭●‬ M
‭ arshalling‬‭: Converting parameters into a byte stream to send over‬
‭a network.‬

‭●‬ U
‭ nmarshalling‬‭: Converting received byte stream back into usable‬
‭data.‬

‭In book page 10.18‬

‭TCP Protocol‬
‭ CP segment header page no, 10.14‬
T
‭Connection establishment.connection page no. 10.20‬
‭ odelling TCP Connection Management‬
M
‭TCP connection management‬‭can be modeled using a‬‭Finite State‬
‭Machine (FSM)‬‭to describe how a TCP connection transitions through‬
‭different‬‭states‬‭during‬‭establishment‬‭,‬‭data transfer‬‭, and‬‭termination‬‭.‬
‭Each participant in the communication (client and server) goes through‬
‭specific states triggered by events like sending/receiving‬‭SYN‬‭,‬‭ACK‬‭, or‬‭FIN‬
‭flags.‬
‭Each connection starts in the CLOSED state. It leaves that state when it‬
‭does either a passive open (LISTEN) or an active open (CONNECT). If the‬
‭other side does the opposite one, a connection is established and the state‬
‭becomes ESTABLISHED. Connection release can be initiated by either‬
‭side. When it is complete, the state returns to CLOSED.‬

‭ he states used in the TCP connection management finite state machine‬


T
‭are:-‬
‭ CP connection management finite state machine. The heavy solid line is‬
T
‭the normal path for a client. The heavy dashed line is the normal path for a‬
‭server. The light lines are unusual events. Each transition is labeled with‬
‭the event causing it and the action resulting from it, separated by a slash.‬

‭ CP Transmission Policy – Explained‬


T
‭The‬‭TCP Transmission Policy‬‭governs‬‭how data is sent‬‭over the‬
‭network to ensure‬‭reliable, efficient, and orderly delivery‬‭. This includes‬
‭strategies for when and how data is transmitted, buffered, acknowledged,‬
‭and retransmitted if necessary.‬
‭ . In the above example, the receiver has 4096-byte buffer.‬
1
‭2. If the sender transmits a 2048-byte segment that is correctly received,‬
‭the receiver will acknowledge the segment.‬
‭3. Now the receiver will advertise a window of 2048 as it has only 2048 of‬
‭buffer space, now.‬
‭4. Now the sender transmits another 2048 bytes which are acknowledged,‬
‭but the advertised window is’0’.‬
‭ . The sender must stop until the application process on the receiving host‬
5
‭has removed some data from the buffer, at which time TCP can advertise a‬
‭layer window.‬
‭Or‬
‭Window probe is a packet sent by the sender, who can send a 1-byte‬
‭segment to force the receiver to reannounce the next byte expected and‬
‭the window size.‬
‭• Delayed acknowledgements is an optimization, where the idea is to delay‬
‭acknowledgements and window updates for up to 500 msec in the hope of‬
‭acquiring some data on which to hitch a free ride.‬
‭Nagle’s algorithm is a way to reduce the bandwidth wastage by a sender‬
‭that sends multiple short packets (e.g., 41-byte packets containing 1 byte of‬
‭data).‬
‭• When data come into the sender in small pieces, just send the first piece‬
‭and buffer all the rest until the first piece is acknowledged. Then send all‬
‭the buffered data in one TCP segment and start buffering again until the‬
‭next segment is acknowledged.‬
‭• Silly window syndrome is a problem that occurs when data are passed to‬
‭the sending TCP entity in large blocks, but an interactive application on the‬
‭receiving side reads data only 1 byte at a time.‬
‭ lark’s solution is to prevent the receiver from sending a window update for‬
C
‭1 byte. Instead, it is forced to wait until it has a decent amount of space‬
‭available and advertise that instead.‬
‭• Nagle’s algorithm and Clark’s solution to the silly window syndrome are‬
‭complementary. Nagle was trying to solve the problem caused by the‬
‭sending application delivering data to TCP a byte at a time. Clark was‬
‭trying to solve the problem of the receiving application sucking the data up‬
‭from TCP a byte at a time.‬
‭• Both solutions are valid and can work together. The goal is for the sender‬
‭not to send small segments and the receiver not to ask for them.‬
‭TCP CONGESTION CONTROL:‬
‭TCP does to try to prevent the congestion from occurring in the first place‬
‭in the following way:‬
‭When a connection is established, a suitable window size is chosen and‬
‭the receiver specifies a window based on its buffer size. If the sender sticks‬
‭to this window size, problems will not occur due to buffer overflow at the‬
‭receiving end. But they may still occur due to internal congestion within the‬
‭network. Let’s see this problem occurs.‬
‭ hen a connection is established, the sender initializes the congestion‬
W
‭window to the size of the max segment in use our connection.‬
‭➢ It then sends one max segment .if this max segment is acknowledged‬
‭before the timer goes off, it adds one segment s worth of bytes to the‬
‭congestion window to make it two maximum size segments and sends 2‬
‭segments.‬
‭➢ As each of these segments is acknowledged, the congestion window is‬
‭increased by one max segment size.‬
‭➢ When the congestion window is ‘n’ segments, if all ‘n’ are acknowledged‬
‭on time, the congestion window is increased by the byte count‬
‭corresponding to ‘n’ segments.‬
‭➢ The congestion window keeps growing exponentially until either a time‬
‭out occurs or the receiver’s window is reached.‬

‭ The internet congestion control algorithm uses a third parameter, the‬
‭“threshold” in addition to receiver and congestion windows.‬
‭Different congestion control algorithms used by TCP are:‬
‭• RTT variance Estimation.‬
‭• Exponential RTO back-off Re-transmission Timer Management‬
‭• Karn’s Algorithm‬
‭• Slow Start‬
‭• Dynamic window sizing on congestion‬
‭• Fast Retransmit Window Management‬
‭• Fast Recovery‬
‭1. RTT Variance Estimation:-‬‭RTT (Round-Trip Time) variance estimation‬
‭is used to predict how long it takes for a data segment to be acknowledged.‬
‭Instead of relying on a fixed timeout, TCP uses a‬‭smoothed average of‬
‭RTT (SRTT)‬‭and estimates the‬‭variance (RTTVAR)‬‭to calculate a more‬
‭accurate‬‭Retransmission Timeout (RTO)‬‭. This adaptive approach allows‬
‭TCP to adjust to network conditions dynamically, improving efficiency and‬
‭reliability.‬
‭2. Exponential RTO Back-off (Retransmission Timer Management):-‬
‭When a segment is retransmitted and still no ACK is received, TCP‬
‭exponentially increases the RTO (Retransmission Timeout)‬‭. This‬
‭technique is called‬‭Exponential Back-off‬‭, and it helps reduce congestion‬
‭during packet loss or heavy traffic. Each time a retransmission fails, the‬
‭timeout period is doubled to avoid flooding the network with repeated‬
‭attempts.‬
‭3. Karn’s Algorithm:-‬‭Karn’s Algorithm addresses a key issue in‬
‭measuring RTT during retransmissions. When a segment is retransmitted,‬
‭it is unclear whether the ACK was for the original or the retransmitted‬
‭segment, making RTT calculation inaccurate. Karn's Algorithm solves this‬
‭by‬‭ignoring RTT samples for retransmitted segments‬‭and using‬
‭exponential back-off‬‭for setting the RTO during such events.‬
‭4. Slow Start:-‬‭The‬‭Slow Start algorithm‬‭helps TCP avoid overwhelming‬
‭the network by starting with a‬‭small congestion window (‬‭ cwnd‬ ‭)‬‭, typically‬
‭1 MSS (Maximum Segment Size). It‬‭doubles‬‭ cwnd‬‭every RTT‬‭, leading to‬
‭exponential growth in data transmission rate. This continues until a‬
‭threshold (‬‭
ssthresh‬ ‭) is reached or packet loss is detected, after which‬
‭TCP transitions to congestion avoidance mode.‬
‭5. Dynamic Window Sizing on Congestion (Congestion Avoidance):-‬
‭Once TCP exits the slow start phase, it enters‬‭congestion avoidance‬‭,‬
‭ sing a dynamic window sizing approach. Here,‬‭
u cwnd‬‭grows‬‭linearly‬
‭rather than exponentially‬‭—increasing by 1 MSS per RTT. This more‬
‭conservative growth strategy avoids congestion and is adjusted based on‬
‭feedback from the network, allowing TCP to dynamically respond to varying‬
‭capacity.‬
‭6. Fast Retransmit (Window Management):-‬‭The‬‭Fast Retransmit‬
‭mechanism allows TCP to detect packet loss without waiting for a timeout.‬
‭If the sender receives‬‭three duplicate ACKs‬‭, it assumes a packet was lost‬
‭and‬‭retransmits it immediately‬‭. This reduces waiting time and improves‬
‭responsiveness, especially in networks with low delay but occasional loss.‬
‭7. Fast Recovery:-‬‭After a Fast Retransmit, instead of returning to slow‬
‭start, TCP enters‬‭Fast Recovery‬‭. It‬‭temporarily reduces the congestion‬
‭window‬‭(typically to half) and then resumes congestion avoidance instead‬
‭of resetting‬‭cwnd‬‭to 1. This avoids unnecessarily slow recovery and allows‬
‭for better throughput in mildly congested networks.‬

You might also like