Professional Documents
Culture Documents
CN Unit 4
CN Unit 4
Transport Layer
Presented by
Dr. B.Rajalingam
Associate Professor & HOD(AI&DS)
Department of Computer Science and Engineering
St.Martin’s Engineering College
UNIT 4
• Transport Services
• Connection management
• TCP protocols
• UDP protocols
PACKET FRAME
Encapsulated unit created at the Network Encapsulated unit created at the data link
layer of the OSI model. layer of the OSI
Ex: IP-Packet Ex:Ethernet Frame
Packet contains Source and destination IP Frame contains Source and destination MAC
address along with Top layer data address along with Top layer data.
Segment is encapsulated with in a packet. packet is encapsulated within a frame.
Hence segment is the data part Hence packet is the data part
Thus, a packet typically contains logical Thus a frame typically contains physical
address information address information.
message.
• The transport layer, ensures that the whole message arrives intact and
in order, overseeing both error control and flow control at the source –
to – destination level.
• UDP-Connectionless protocol-Simple
• The packets are not numbered ; they may be delayed or lost or may arrive out of
sequence.
• UDP is connectionless…
• A connection oriented transport layer makes a connection with the transport layer
TCP &SCTP protocol will implement flow and error control at the
transport layer . But it is slower and more complex service.
• If the application layer program does not need reliability, it means most real-time
application does not demand flow and error control,but it demand fast service.
So unreliable protocol UDP is used.
• At the Data link layer, we need a MAC address to choose ONE node among
SEVERAL node.
• At the Network layer we need an IP address to choose one Host among Millions.
• Port number for a client host program defines itself randomly by the transport
layer. at this is called ephemeral port number ranging from 49,152 to 65,535
• In these cases, delivery to the session layer means the delivery to the
application layer.
• The port variable represents a particular TS user of a specified station known as a Transport
Service access point (TSAP).
• The transport layer protocols need to know which upper-layer protocols are
communicating.
• So each party must initialize communication and get approval from other party
before any data are transferred.
Example:
• An application program, called the client, wants to make a connection with
another application program, called the server, using TCP as the transport
layer protocol.
The process starts with server.
• The server program tells its TCP that it is ready to accept connection.
• This is called request for a passive open.
• The client application tells its TCP that it need to connect to a particular
server.
• This is called request for active open.
• TCP can now starts the three – way handshaking process.
As soon as a client requests a communication session with the server, a three-way handshake
process initiates TCP traffic by following three steps.
Step 2: The server receives the SYN packet from the client node
Step 3: Client node receives the SYN/ACK from the server and responds with an ACK packet.
The client node receives the SYN/ACK from the server and responds with an ACK packet. Once
again, each side must acknowledge the sequence number received by incrementing it by one.
• First, a connection between server and client is established, so the target server must have open
ports that can accept and initiate new connections.
• The client node sends a SYN (Synchronize Sequence Number) data packet over an IP network
to a server on the same or an external network.
• This SYN packet is a random sequence number that the client wants to use for the
communication (for example, X).
• The objective of this packet is to ask/infer if the server is open for new connections.
• When the server receives the SYN packet from the client node, it responds and returns a
confirmation receipt – the ACK (Acknowledgement Sequence Number) packet or SYN/ACK
packet.
• This packet includes two sequence numbers.
• The first one is ACK one, which is set by the server to one more than the sequence number it
received from the client (e.g. X+1).
• The second one is the SYN sent by the server, which is another random sequence number (for
example, Y).
• This sequence indicates that the server correctly acknowledged the client’s packet, and that is
sending its own to be acknowledged as well.
• Step 3: Client node receives the SYN/ACK from the server and responds with an ACK packet.
The client node receives the SYN/ACK from the server and responds with an ACK packet.
Once again, each side must acknowledge the sequence number received by incrementing it by
one.
• So now it’s the turn of the client to acknowledge the server’s packet by adding one to the
sequence number (in this case, Y+1), and resend it to the server.
• Upon completion of this process, the connection is created and the host and server can
communicate.
• All these steps are necessary to verify the serial numbers originated by both sides, guaranteeing
the stability of the connection.
• Since both hosts must acknowledge the connection parameters of the other side, a missing or
out-of-order segment can be quickly detected before the actual data transfer process is initiated.
Connection Termination
10 November 2022
TCP/IP Protocol Suite CN(Unit 4): Dr.
50 B.Rajalingam 47
Connection termination using three-way handshake
• TCP sliding window looks like the Go-Back-N protocol because it does not use
NAKs; it looks like selective repeat because the receiver holds the out of order
Sliding window of TCP is byte oriented Sliding window of data link layer is frame oriented
TCP sliding window is variable size Data link layer sliding window is fixed size
• The source does not have to send a full window’s worth of data.
• The size of the window can be increased or decreased by the destination
• The destination can send an acknowledgment at any time.
• The bytes inside the window are the bytes that can be transit ; they can be sent
without worrying about acknowledgment
• The window has two wall : one left and one right
• The window is opened, closed or shrunk. this activities are in the control of
receiver , not the sender.
• The sender should obey.
• When the timer expires , the earliest outstanding segment is retransmitted even
though lack of ACK is due to delayed segment, a delayed ACK, or a lost ACK,
• RTO timer will never set for a segment that carries only an
acknowledgment.
Like UDP,TCP also provides process-to- process Communication using port numbers.
• In case of UDP delivery the message from a process is added with its own
Sending and receiving processes may not write or read data at the same speed,
TCP needs buffers for storage
Field Purpose
Source Port Destination Port Identifies originating application Identifies destination application
Sequence Number byte Sequence number of first octet in the segment-TCP generates a random no between 0-2^32-1 for the no of first
Acknowledgment # Len Sequence number of the next expected octet (if ACK flag set)
Flags Window Length of TCP header in 4 octet units-Header length can be between 20 and 60 bytes.
Checksum TCP flags: SYN, FIN, RST, PSH, ACK, URG
Urgent Pointer Options Number of octets from ACK that sender will accept Checksum of IP pseudo-header + TCP header + data Pointer to
end of “urgent data”
Special TCP options such as MSS and Window Scale
• If a process wants to send a small message and does not care much about
reliability , it can use UDP
• This is the Port number used by the process running on the machine
• If the source host is client an ephemeral port number is chosen by the UDP for that
particular process requested.
• If the source host is server the port number is a well-known port number.
• This port number used by the process running on the destination host.
• If the destination host is the client(a server sending a response),the port number
is an ephemeral port number most case.
• This is a 16 bit field that defines the total length of the user datagram , Header plus
Data.
4.Checksum
• This field is used to detect errors over the entire user datagram(header plus data)
• The protocol field is added to ensure that the packet belongs to UDP , not to
other transport layer protocol . value of UDP is 17.
It is a communications protocol,
It is same as the TCP protocol except this
using which the data is transmitted
doesn’t guarantee the error-checking and
between systems over the network.
data recovery.
In this, the data is transmitted into the
1 Definition If you use this protocol, the data will be
form of packets.
sent continuously, irrespective of the
It includes error-checking, guarantees
issues in the receiving end.
the delivery and preserves the order
of the data packets.