SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)k33a
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networksguesta81d4b
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptxAcad
 
Architecture of Mobile Computing
Architecture of Mobile ComputingArchitecture of Mobile Computing
Architecture of Mobile ComputingJAINIK PATEL
 
Ch 18 intro to network layer - section 1
Ch 18   intro to network layer - section 1Ch 18   intro to network layer - section 1
Ch 18 intro to network layer - section 1Hossam El-Deen Osama
 
Congestion control
Congestion controlCongestion control
Congestion controlAman Jaiswal
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical ClocksDilum Bandara
 
VTU 5TH SEM CSE COMPUTER NETWORKS-1 (DATA COMMUNICATION) SOLVED PAPERS
VTU 5TH SEM CSE COMPUTER NETWORKS-1 (DATA COMMUNICATION)  SOLVED PAPERSVTU 5TH SEM CSE COMPUTER NETWORKS-1 (DATA COMMUNICATION)  SOLVED PAPERS
VTU 5TH SEM CSE COMPUTER NETWORKS-1 (DATA COMMUNICATION) SOLVED PAPERSvtunotesbysree
 
OOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - LabOOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - LabVicter Paul
 
IEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and ServicesIEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and ServicesSayed Chhattan Shah
 
Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocolasimnawaz54
 

La actualidad más candente (20)

Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)
 
Network layer tanenbaum
Network layer tanenbaumNetwork layer tanenbaum
Network layer tanenbaum
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
5. protocol layering
5. protocol layering5. protocol layering
5. protocol layering
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networks
 
Transport layer
Transport layer Transport layer
Transport layer
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Architecture of Mobile Computing
Architecture of Mobile ComputingArchitecture of Mobile Computing
Architecture of Mobile Computing
 
Computer networks - Channelization
Computer networks - ChannelizationComputer networks - Channelization
Computer networks - Channelization
 
Ch 18 intro to network layer - section 1
Ch 18   intro to network layer - section 1Ch 18   intro to network layer - section 1
Ch 18 intro to network layer - section 1
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical Clocks
 
VTU 5TH SEM CSE COMPUTER NETWORKS-1 (DATA COMMUNICATION) SOLVED PAPERS
VTU 5TH SEM CSE COMPUTER NETWORKS-1 (DATA COMMUNICATION)  SOLVED PAPERSVTU 5TH SEM CSE COMPUTER NETWORKS-1 (DATA COMMUNICATION)  SOLVED PAPERS
VTU 5TH SEM CSE COMPUTER NETWORKS-1 (DATA COMMUNICATION) SOLVED PAPERS
 
Timestamp protocols
Timestamp protocolsTimestamp protocols
Timestamp protocols
 
Transport layer
Transport layerTransport layer
Transport layer
 
OOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - LabOOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - Lab
 
IEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and ServicesIEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and Services
 
Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocol
 
Routing ppt
Routing pptRouting ppt
Routing ppt
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 

Destacado

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
 

Destacado (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
 

Similar a 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
 

Similar a 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
 

Último

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
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
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 

Último (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
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
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

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