SlideShare ist ein Scribd-Unternehmen logo
1 von 20
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

Weitere ähnliche Inhalte

Was ist angesagt?

Congestion control
Congestion controlCongestion control
Congestion controlAman Jaiswal
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithmBushra M
 
MEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLMEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLjunnubabu
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference ModelMukesh Tekwani
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptxAcad
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network LayerManoj Kumar
 
Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCPselvakumar_b1985
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitivesStudent
 
TCP- Transmission Control Protocol
TCP-  Transmission Control Protocol TCP-  Transmission Control Protocol
TCP- Transmission Control Protocol Akhil .B
 
Computer network switching
Computer network switchingComputer network switching
Computer network switchingShivani Godha
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)Ramola Dhande
 
Mobile transportlayer
Mobile transportlayerMobile transportlayer
Mobile transportlayerRahul Hada
 

Was ist angesagt? (20)

Congestion control
Congestion controlCongestion control
Congestion control
 
Domain name system
Domain name systemDomain name system
Domain name system
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
TCP and UDP
TCP and UDP TCP and UDP
TCP and UDP
 
MEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLMEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROL
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Pure aloha
Pure alohaPure aloha
Pure aloha
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
 
Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCP
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
 
The medium access sublayer
 The medium  access sublayer The medium  access sublayer
The medium access sublayer
 
Issues in Data Link Layer
Issues in Data Link LayerIssues in Data Link Layer
Issues in Data Link Layer
 
TCP- Transmission Control Protocol
TCP-  Transmission Control Protocol TCP-  Transmission Control Protocol
TCP- Transmission Control Protocol
 
Link state routing protocol
Link state routing protocolLink state routing protocol
Link state routing protocol
 
Computer network switching
Computer network switchingComputer network switching
Computer network switching
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)
 
Mobile transportlayer
Mobile transportlayerMobile transportlayer
Mobile transportlayer
 
Network layer logical addressing
Network layer logical addressingNetwork layer logical addressing
Network layer logical addressing
 

Andere mochten auch

Smart growth 2011 street network and safety
Smart growth 2011 street network and safetySmart growth 2011 street network and safety
Smart growth 2011 street network and safetyTheLastMile
 
Academic Presentation On Review Of Road Network
Academic Presentation On Review Of Road NetworkAcademic Presentation On Review Of Road Network
Academic Presentation On Review Of Road NetworkKamal Rumah
 
Traffic problems & solutions in mumbai
Traffic problems & solutions in mumbaiTraffic problems & solutions in mumbai
Traffic problems & solutions in mumbaiVijaykumar Nishad
 
Traffic Congestion PowerPoint Presentation
Traffic Congestion PowerPoint PresentationTraffic Congestion PowerPoint Presentation
Traffic Congestion PowerPoint PresentationRoad Safety
 
Traffic growth rate estimation using transport
Traffic growth rate estimation using transportTraffic growth rate estimation using transport
Traffic growth rate estimation using transporteSAT Publishing House
 

Andere mochten auch (9)

Smart growth 2011 street network and safety
Smart growth 2011 street network and safetySmart growth 2011 street network and safety
Smart growth 2011 street network and safety
 
Review of road network
Review of road networkReview of road network
Review of road network
 
Academic Presentation On Review Of Road Network
Academic Presentation On Review Of Road NetworkAcademic Presentation On Review Of Road Network
Academic Presentation On Review Of Road Network
 
Traffic presentation
Traffic presentationTraffic presentation
Traffic presentation
 
Traffic problems & solutions in mumbai
Traffic problems & solutions in mumbaiTraffic problems & solutions in mumbai
Traffic problems & solutions in mumbai
 
TRAFFIC JAM
TRAFFIC JAMTRAFFIC JAM
TRAFFIC JAM
 
Traffic congestion
Traffic congestionTraffic congestion
Traffic congestion
 
Traffic Congestion PowerPoint Presentation
Traffic Congestion PowerPoint PresentationTraffic Congestion PowerPoint Presentation
Traffic Congestion PowerPoint Presentation
 
Traffic growth rate estimation using transport
Traffic growth rate estimation using transportTraffic growth rate estimation using transport
Traffic growth rate estimation using transport
 

Ähnlich wie Transport services

Chapter 4 communication2
Chapter 4 communication2Chapter 4 communication2
Chapter 4 communication2DBU
 
group11_DNAA:protocol stack and addressing
group11_DNAA:protocol stack and addressinggroup11_DNAA:protocol stack and addressing
group11_DNAA:protocol stack and addressingAnitha Selvan
 
SYBSC IT COMPUTER NETWORKS UNIT I Network Models
SYBSC IT COMPUTER NETWORKS UNIT I Network ModelsSYBSC IT COMPUTER NETWORKS UNIT I Network Models
SYBSC IT COMPUTER NETWORKS UNIT I Network ModelsArti Parab Academics
 
CN unit 1 part 2 2023.ppt
CN unit 1 part 2 2023.pptCN unit 1 part 2 2023.ppt
CN unit 1 part 2 2023.pptmohanravi1986
 
Comparison and Contrast between OSI and TCP/IP Model
Comparison and Contrast between OSI and TCP/IP ModelComparison and Contrast between OSI and TCP/IP Model
Comparison and Contrast between OSI and TCP/IP ModelConferencias FIST
 
Advances in computer networks, computer architecture
Advances in computer networks, computer architectureAdvances in computer networks, computer architecture
Advances in computer networks, computer architecturesandhyagowdah
 
Cisco ccna certification knowledge to pass the exam
Cisco ccna certification knowledge to pass the examCisco ccna certification knowledge to pass the exam
Cisco ccna certification knowledge to pass the examle_dung762
 
Lecture 2 -_understanding_networks_with_presenter_notes
Lecture 2 -_understanding_networks_with_presenter_notesLecture 2 -_understanding_networks_with_presenter_notes
Lecture 2 -_understanding_networks_with_presenter_notesSerious_SamSoul
 
OSI and TCPIP Model
OSI and TCPIP ModelOSI and TCPIP Model
OSI and TCPIP ModelTapan Khilar
 
computer network and chapter 7 OSI layers.pptx
computer network and chapter 7 OSI layers.pptxcomputer network and chapter 7 OSI layers.pptx
computer network and chapter 7 OSI layers.pptxgadisaAdamu
 
OSI and TCP/IP reference models in networking
OSI and TCP/IP reference models in networkingOSI and TCP/IP reference models in networking
OSI and TCP/IP reference models in networkingMeenakshiGupta233101
 

Ähnlich wie Transport services (20)

CS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKSCS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKS
 
Osi
OsiOsi
Osi
 
Chapter 4 communication2
Chapter 4 communication2Chapter 4 communication2
Chapter 4 communication2
 
group11_DNAA:protocol stack and addressing
group11_DNAA:protocol stack and addressinggroup11_DNAA:protocol stack and addressing
group11_DNAA:protocol stack and addressing
 
Week10 transport
Week10 transportWeek10 transport
Week10 transport
 
SYBSC IT COMPUTER NETWORKS UNIT I Network Models
SYBSC IT COMPUTER NETWORKS UNIT I Network ModelsSYBSC IT COMPUTER NETWORKS UNIT I Network Models
SYBSC IT COMPUTER NETWORKS UNIT I Network Models
 
Chapter4 Network
Chapter4 NetworkChapter4 Network
Chapter4 Network
 
NP-lab-manual (1).pdf
NP-lab-manual (1).pdfNP-lab-manual (1).pdf
NP-lab-manual (1).pdf
 
NP-lab-manual.pdf
NP-lab-manual.pdfNP-lab-manual.pdf
NP-lab-manual.pdf
 
NP-lab-manual.docx
NP-lab-manual.docxNP-lab-manual.docx
NP-lab-manual.docx
 
CN unit 1 part 2 2023.ppt
CN unit 1 part 2 2023.pptCN unit 1 part 2 2023.ppt
CN unit 1 part 2 2023.ppt
 
Osi
OsiOsi
Osi
 
Comparison and Contrast between OSI and TCP/IP Model
Comparison and Contrast between OSI and TCP/IP ModelComparison and Contrast between OSI and TCP/IP Model
Comparison and Contrast between OSI and TCP/IP Model
 
Advances in computer networks, computer architecture
Advances in computer networks, computer architectureAdvances in computer networks, computer architecture
Advances in computer networks, computer architecture
 
Cisco ccna certification knowledge to pass the exam
Cisco ccna certification knowledge to pass the examCisco ccna certification knowledge to pass the exam
Cisco ccna certification knowledge to pass the exam
 
Lecture 2 -_understanding_networks_with_presenter_notes
Lecture 2 -_understanding_networks_with_presenter_notesLecture 2 -_understanding_networks_with_presenter_notes
Lecture 2 -_understanding_networks_with_presenter_notes
 
Layering and Architecture
Layering and ArchitectureLayering and Architecture
Layering and Architecture
 
OSI and TCPIP Model
OSI and TCPIP ModelOSI and TCPIP Model
OSI and TCPIP Model
 
computer network and chapter 7 OSI layers.pptx
computer network and chapter 7 OSI layers.pptxcomputer network and chapter 7 OSI layers.pptx
computer network and chapter 7 OSI layers.pptx
 
OSI and TCP/IP reference models in networking
OSI and TCP/IP reference models in networkingOSI and TCP/IP reference models in networking
OSI and TCP/IP reference models in networking
 

Kürzlich hochgeladen

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Kürzlich hochgeladen (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

Transport services

  • 1.
  • 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();  }}