SlideShare a Scribd company logo
7
Most read
8
Most read
12
Most read
Transport services
The Transport Layer
The transport layer is the heart of the protocol
hierarchy.
The network layer provides end-to-end packet
delivery using datagrams or virtual circuits.
The transport layer builds on the network layer
to provide data transport from a process on a
source machine to a process on a destination
machine with a desired level of reliability
The Transport Service
• Services Provided to the Upper Layers
• Transport Service Primitives
• Berkeley Sockets
• An Example of Socket Programming:
An Internet File Server
Services Provided to the Upper Layers
The ultimate goal of the transport layer is to provide
efficient, reliable, and cost-effective data transmission
service to its users, normally processes in the
application layer.
To achieve this, the transport layer makes use of the
services provided by the network layer. The software
and/or hardware within the transport layer that does
the work is called the transport entity
Services Provided to the Upper Layers
The (logical) relationship of the network, transport, and
application layers .
Transport Service Primitives
To allow users to access the transport service, the
transport layer must provide some operations to
application programs, that is, a transport service
interface.
Each transport service has its own interface.
 This transport interface is truly bare bones, but it
gives the essential flavor of what a connection-
oriented transport interface has to do. It allows
application programs to establish, use, and then
release connections, which is sufficient for many
applications
Transport Service Primitives
 the purpose of the transport layer—to provide a
reliable service on top of an unreliable network
To get an idea of what a transport service might be
like, consider the five primitives .
 To start with, the server executes a LISTEN primitive,
typically by calling a library procedure that makes a
system call that blocks the server until a client turns
up. When a client wants to talk to the server, it
executes a CONNECT primitive.
The transport entity carries out this primitive by
blocking the caller and sending a packet to the server.
Transport Service Primitives
The primitives for a simple transport
service.
Transport Service Primitives
 the term segment for messages sent from transport entity
to transport entity. TCP, UDP and other Internet
protocols use this term.
Thus, segments (exchanged by the transport layer) are
contained in packets (exchanged by the network layer).
 In turn, these packets are contained in frames (exchanged
by the data link layer). When a frame arrives, the data link
layer processes the frame header and, if the destination
address matches for local delivery, passes the contents of
the frame payload field up to the network entity.
The network entity similarly processes the packet header
and then passes the contents of the packet payload up to
the transport entity
Transport Service Primitives (3)
The nesting of TPDUs, packets, and frames.
Transport Service Primitives (2)
A state diagram for a simple connection management scheme.
Transitions labeled in italics are caused by packet arrivals. The
solid lines show the client's state sequence. The dashed lines show
the server's state sequence.
Berkeley Sockets
 This is another set of transport primitives, the socket
primitives as they are used for TCP.
 Sockets were first released as part of the Berkeley
UNIX 4.2BSD software distribution in 1983.
The primitives are now widely used for Internet
programming on many operating systems, especially
UNIX-based systems, and there is a socket-style API
for Windows called ‘‘winsock.’’ it is used for
inter-process communication (IPC)
Berkeley Sockets
socket() creates a new socket of a certain socket type,
identified by an integer number, and allocates system
resources to it.
bind() is typically used on the server side, and associates a
socket with a socket address structure, i.e. a specified local
port number and IP address.
listen() is used on the server side, and causes a bound TCP
socket to enter listening state.
accept() is used on the server side. It accepts a received
incoming attempt to create a new TCP connection from the
remote client, and creates a new socket associated with the
socket address pair of this connection.
 This is a methods provided by the Berkeley sockets API library:
Berkeley Sockets
connect() is used on the client side, and assigns a
free local port number to a socket. In case of a
TCP socket, it causes an attempt to establish a
new TCP connection.
send() and recv(), or write() and read(), 
or sendto() and recvfrom(), are used for sending
and receiving data to/from a remote socket.
close() causes the system to release resources
allocated to a socket. In case of TCP, the
connection is terminated.
Berkeley Sockets
The first four primitives in the list are executed in that
order by servers. The SOCKET primitive creates a new
endpoint and allocates table space for it within the
transport entity.
The parameters of the call specify the addressing format to
be used, the type of service desired and the protocol. A
successful SOCKET call returns an ordinary file descriptor
for use in succeeding calls, the same way an OPEN call on
a file does.
Newly created sockets do not have network addresses.
These are assigned using the BIND primitive.
Once a server has bound an address to a socket, remote
clients can connect to it.
Socket
Programming
Example:
Internet File
Server
Client code using
sockets.
6-6-1
Client code using socket
import java.net.*;
import java.io.*;
class MyClient{
public static void main(String args[])throws Exception{
Socket s=new Socket("localhost",6666);
DataInputStream din=new DataInputStream(s.getInputStream());
DataOutputStream dout=new DataOutputStream(s.getOutputStream());
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str="",str2="",str3="";
while(!str.equals("stop")){
str=br.readLine();
dout.writeUTF(str);
str3=br.readLine() ;
dout.writeUTF(str3);
dout.flush();
str2=din.readUTF();
System.out.println("Server says: "+str2);
}
dout.close();
s.close();
}}
Socket
Programming
Example:
Internet File
Server (2)
Client code using
sockets.
Server code using socket
 import java.net.*;
 import java.io.*;

 class MyServer{
 public static void main(String args[])throws Exception{
 ServerSocket ss=new ServerSocket(6666);
 Socket s=ss.accept();
 DataInputStream din=new DataInputStream(s.getInputStream());
 DataOutputStream dout=new DataOutputStream(s.getOutputStream());
 BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

 String str="",str2="";
 while(!str.equals("stop")){
 str=din.readUTF();
 System.out.println("client says: "+str);
 str2=br.readLine();
 dout.writeUTF(str2);
 dout.flush();
 }
 din.close();
 s.close();
 ss.close();
 }}
Thanks
Presented by:
Navin Kumar

More Related Content

PPTX
Tcp/ip model
PPTX
PPTX
Internetworking
PPTX
Unit 4 - Transport Layer
PPTX
Transport layer protocols : TCP and UDP
PPTX
Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...
PPTX
Unit 4-Transport Layer Protocols.pptx
Tcp/ip model
Internetworking
Unit 4 - Transport Layer
Transport layer protocols : TCP and UDP
Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...
Unit 4-Transport Layer Protocols.pptx

What's hot (20)

PPTX
Transport layer
PPSX
Issues in Data Link Layer
PPT
Sliding window protocol
PPTX
Network software
PPT
Network layer tanenbaum
PPT
Distance vector routing
PPTX
Computer network switching
PPTX
Network layer - design Issues
PPT
Chapter 4 data link layer
PDF
Stop and-wait protocol
PPTX
Media Access Control
PPT
Routing protocols-network-layer
PDF
Multiplexing
PPT
Switching techniques
PPT
Unit 3 Network Layer PPT
PPTX
Data link layer
PDF
QOS (Quality of Services) - Computer Networks
PPTX
Query processing and optimization (updated)
PPTX
Computer Network - Network Layer
PPTX
Transport layer
Transport layer
Issues in Data Link Layer
Sliding window protocol
Network software
Network layer tanenbaum
Distance vector routing
Computer network switching
Network layer - design Issues
Chapter 4 data link layer
Stop and-wait protocol
Media Access Control
Routing protocols-network-layer
Multiplexing
Switching techniques
Unit 3 Network Layer PPT
Data link layer
QOS (Quality of Services) - Computer Networks
Query processing and optimization (updated)
Computer Network - Network Layer
Transport layer
Ad

Viewers also liked (9)

PPT
Smart growth 2011 street network and safety
PPT
Review of road network
PPTX
Academic Presentation On Review Of Road Network
PPT
Traffic presentation
PPTX
Traffic problems & solutions in mumbai
PPTX
TRAFFIC JAM
PPT
Traffic congestion
PPTX
Traffic Congestion PowerPoint Presentation
PDF
Traffic growth rate estimation using transport
Smart growth 2011 street network and safety
Review of road network
Academic Presentation On Review Of Road Network
Traffic presentation
Traffic problems & solutions in mumbai
TRAFFIC JAM
Traffic congestion
Traffic Congestion PowerPoint Presentation
Traffic growth rate estimation using transport
Ad

Similar to Transport services (20)

PDF
Transport laye
PDF
Ajp notes-chapter-04
PPTX
Module 1 part 2.pptx with clear notes and explanation
PDF
28 networking
DOCX
Final networks lab manual
PPTX
transport Layer in Computer Networks Pptx
PPTX
Transport layer services (cn)
PPTX
PPTX
transportlayerUnit4ComputerNetworkUnit4.pptx
PDF
Socket Programming
PDF
Network Sockets
PDF
Sockets
PPT
Socket Programming - nitish nagar
PPTX
Engineering Computer network data communication and networkig fibre optical c...
PPT
Sockets in unix
PDF
CS6551 COMPUTER NETWORKS
PPTX
Byte Ordering - Unit 2.pptx
PDF
sockets SMTP Bmsce ppt information science and engineering
PPTX
Basics of sockets
PPTX
Socket Programming
Transport laye
Ajp notes-chapter-04
Module 1 part 2.pptx with clear notes and explanation
28 networking
Final networks lab manual
transport Layer in Computer Networks Pptx
Transport layer services (cn)
transportlayerUnit4ComputerNetworkUnit4.pptx
Socket Programming
Network Sockets
Sockets
Socket Programming - nitish nagar
Engineering Computer network data communication and networkig fibre optical c...
Sockets in unix
CS6551 COMPUTER NETWORKS
Byte Ordering - Unit 2.pptx
sockets SMTP Bmsce ppt information science and engineering
Basics of sockets
Socket Programming

Recently uploaded (20)

PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Institutional Correction lecture only . . .
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
Business Ethics Teaching Materials for college
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Cell Types and Its function , kingdom of life
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
VCE English Exam - Section C Student Revision Booklet
Institutional Correction lecture only . . .
PPH.pptx obstetrics and gynecology in nursing
O5-L3 Freight Transport Ops (International) V1.pdf
Pre independence Education in Inndia.pdf
Business Ethics Teaching Materials for college
Final Presentation General Medicine 03-08-2024.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
01-Introduction-to-Information-Management.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Cell Types and Its function , kingdom of life
Week 4 Term 3 Study Techniques revisited.pptx
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Anesthesia in Laparoscopic Surgery in India
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf

Transport services

  • 2. The Transport Layer The transport layer is the heart of the protocol hierarchy. The network layer provides end-to-end packet delivery using datagrams or virtual circuits. The transport layer builds on the network layer to provide data transport from a process on a source machine to a process on a destination machine with a desired level of reliability
  • 3. The Transport Service • Services Provided to the Upper Layers • Transport Service Primitives • Berkeley Sockets • An Example of Socket Programming: An Internet File Server
  • 4. Services Provided to the Upper Layers The ultimate goal of the transport layer is to provide efficient, reliable, and cost-effective data transmission service to its users, normally processes in the application layer. To achieve this, the transport layer makes use of the services provided by the network layer. The software and/or hardware within the transport layer that does the work is called the transport entity
  • 5. Services Provided to the Upper Layers The (logical) relationship of the network, transport, and application layers .
  • 6. Transport Service Primitives To allow users to access the transport service, the transport layer must provide some operations to application programs, that is, a transport service interface. Each transport service has its own interface.  This transport interface is truly bare bones, but it gives the essential flavor of what a connection- oriented transport interface has to do. It allows application programs to establish, use, and then release connections, which is sufficient for many applications
  • 7. Transport Service Primitives  the purpose of the transport layer—to provide a reliable service on top of an unreliable network To get an idea of what a transport service might be like, consider the five primitives .  To start with, the server executes a LISTEN primitive, typically by calling a library procedure that makes a system call that blocks the server until a client turns up. When a client wants to talk to the server, it executes a CONNECT primitive. The transport entity carries out this primitive by blocking the caller and sending a packet to the server.
  • 8. Transport Service Primitives The primitives for a simple transport service.
  • 9. Transport Service Primitives  the term segment for messages sent from transport entity to transport entity. TCP, UDP and other Internet protocols use this term. Thus, segments (exchanged by the transport layer) are contained in packets (exchanged by the network layer).  In turn, these packets are contained in frames (exchanged by the data link layer). When a frame arrives, the data link layer processes the frame header and, if the destination address matches for local delivery, passes the contents of the frame payload field up to the network entity. The network entity similarly processes the packet header and then passes the contents of the packet payload up to the transport entity
  • 10. Transport Service Primitives (3) The nesting of TPDUs, packets, and frames.
  • 11. Transport Service Primitives (2) A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client's state sequence. The dashed lines show the server's state sequence.
  • 12. Berkeley Sockets  This is another set of transport primitives, the socket primitives as they are used for TCP.  Sockets were first released as part of the Berkeley UNIX 4.2BSD software distribution in 1983. The primitives are now widely used for Internet programming on many operating systems, especially UNIX-based systems, and there is a socket-style API for Windows called ‘‘winsock.’’ it is used for inter-process communication (IPC)
  • 13. Berkeley Sockets socket() creates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it. bind() is typically used on the server side, and associates a socket with a socket address structure, i.e. a specified local port number and IP address. listen() is used on the server side, and causes a bound TCP socket to enter listening state. accept() is used on the server side. It accepts a received incoming attempt to create a new TCP connection from the remote client, and creates a new socket associated with the socket address pair of this connection.  This is a methods provided by the Berkeley sockets API library:
  • 14. Berkeley Sockets connect() is used on the client side, and assigns a free local port number to a socket. In case of a TCP socket, it causes an attempt to establish a new TCP connection. send() and recv(), or write() and read(),  or sendto() and recvfrom(), are used for sending and receiving data to/from a remote socket. close() causes the system to release resources allocated to a socket. In case of TCP, the connection is terminated.
  • 15. Berkeley Sockets The first four primitives in the list are executed in that order by servers. The SOCKET primitive creates a new endpoint and allocates table space for it within the transport entity. The parameters of the call specify the addressing format to be used, the type of service desired and the protocol. A successful SOCKET call returns an ordinary file descriptor for use in succeeding calls, the same way an OPEN call on a file does. Newly created sockets do not have network addresses. These are assigned using the BIND primitive. Once a server has bound an address to a socket, remote clients can connect to it.
  • 17. Client code using socket import java.net.*; import java.io.*; class MyClient{ public static void main(String args[])throws Exception{ Socket s=new Socket("localhost",6666); DataInputStream din=new DataInputStream(s.getInputStream()); DataOutputStream dout=new DataOutputStream(s.getOutputStream()); BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str="",str2="",str3=""; while(!str.equals("stop")){ str=br.readLine(); dout.writeUTF(str); str3=br.readLine() ; dout.writeUTF(str3); dout.flush(); str2=din.readUTF(); System.out.println("Server says: "+str2); } dout.close(); s.close(); }}
  • 19. Server code using socket  import java.net.*;  import java.io.*;   class MyServer{  public static void main(String args[])throws Exception{  ServerSocket ss=new ServerSocket(6666);  Socket s=ss.accept();  DataInputStream din=new DataInputStream(s.getInputStream());  DataOutputStream dout=new DataOutputStream(s.getOutputStream());  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));   String str="",str2="";  while(!str.equals("stop")){  str=din.readUTF();  System.out.println("client says: "+str);  str2=br.readLine();  dout.writeUTF(str2);  dout.flush();  }  din.close();  s.close();  ss.close();  }}