SlideShare a Scribd company logo
1 of 31
R.Mohan
Mailam EngineeringCollege
Sri ManakulaVinayagarGroup of Institutions
Layering and Protocols
• When the system gets complex, the system designer
introduces another level of abstraction
• In network, abstraction leads to layering. Layering
provides two features:
It decomposes the problem of building a network into
more manageable components.
It provides more modular design
Protocols:
A protocol is a set of rules that governs data
communication. It defines what is communicated, how it is
communicated, and when it is communicated. The key
elements of a protocol are syntax, semantics and timing.
Each protocol defines two different interfaces.
 Service interface - to the other objects on the same
computer that want to use its communication services.
 Peer interface - to its counterpart (peer) on another
machine.
• Encapsulation
Control information must be added with the data to
instruct the peer how to handle with the received message.
It will be added into the header or trailer.
 Header - Small data structure from few bytes to few
kilobytes attached to the front of message.
 Trailer – Information will be added at the end of the
message
• Multiplexing and De-Multiplexing
multiple flows of data over a single physical link
The OSI Model
 International standard organization (ISO) established a
committee in 1977 to develop an architecture for systems
communication.
 Open System Interconnection (OSI) reference model is
the result of this effort.
 This model allows any two different systems to
communicate regardless of their underlying architecture.
 The OSI model describes how data flows from one
computer, through a network to another computer.
Seven layers of the OSI model
1. Physical Layer
2. Data link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
Seven layers of the OSI model
User Support Layers
Network Support Layers
Application
Presentation
Session
Transport
Network
Data Link
Physical
Seven layers of the OSI model
Remember:
All
People
Seem
To
Need
Data
Processing
Application
Presentation
Session
Transport
Network
Data Link
Physical
Seven layers of the OSI model
Application
Presentation
Session
Transport
Network
Data Link
Physical
To Transmit bits over a medium; to provide
Mechanical and electrical specifications
To organize bits into frames; to provide
Hop-to-hop delivery
To move packets from source to
destination; to provide internetworking
To Provide reliable process-to-process
Message delivery and error recovery
To establish, manage, and terminate
session
To Translate, encrypt, and compress
data
To allow access to network resources
Physical Layer
 Physical layer is the bottom(layer 1) of OSI model.
 It is responsible for the actual physical connection between
the devices.
 The physical layer is responsible for movements of
individual bits from one node to next.
Physical characteristics of interface and medium
Representation of bits
Data rate
Synchronization of bits
Line configuration
Physical topology
Transmission mode
Functions of Physical Layer
Data Link Layer
 The data link layer is responsible for moving frames from
one node to the next
Functions of Data Link Layer
Framing
Physical addressing
Flow Control
Error Control
Access Control
Network Layer
 It is responsible for the source to destination delivery of a
packets across multiple networks
Functions of Network layer
Logical addressing
Routing
Transport Layer
 It is responsible for source process to destination
process delivery of entire message
Functions of Transport Layer
Service-point addressing
Segmentation and reassembly
Connection control
Flow control
Error Control
Session Layer
 It is responsible for beginning, maintaining & ending the
communication between two devices, which is called
session
Functions of Session Layer
Dialog Control
Synchronization
Presentation Layer
 This layer is concerned with the syntax and semantics of
the information exchanged between two systems.
Functions of Presentation Layer
Translation
Encryption
Compression
Application Layer
 Provides User interfaces and support for Services, like
e-mail, file transfer
Functions of Application Layer
Network virtual terminal
File transfer, access and management
Mail services
Directory services
TCP/IP Model
 TCP and IP are two protocols of this model.
 This model was initially used by ARPANET.
 The TCP/IP protocol suite was defined as having four
layers:
1) Host-to-network
2) Internet
3) Transport
4) Application
Host to Network Layer
 It is the bottom layer of TCP/IP model also known as
Network interface layer.
 The purpose of this layer is to connect the host to the
network.
Internet Layer
 Internet layer is similar to network layer of OSI model in
functionality.
 This layer is responsible for delivering IP packets to their
destinations.
 An important protocol of this layer is IP(Internet
Protocol).
Transport Layer
 Transport layer of TCP/IP model also provides
connection oriented and connectionless services.
1) Connection Oriented – TCP(Transmission Control
Protocol)
2) Connection Less – UDP(User Datagram Protocol)
Application Layer
 This layer is the combination of Application, Presentation
and Session layer of the OSI model.
 This layer provides various services to different user
applications.
Socket (Network Software - API)
A socket is one endpoint of a two-way communication
link between two programs running on the network. A socket is
bound to a port number so that the TCP layer can identify the
application that data is destined to be sent to. An endpoint is a
combination of an IP address and a port number
Application Programming Interface (Sockets)
The place to start when implementing a network
application is the interface exported by the network. Since most
network protocols are implemented in software (especially those
high in the protocol stack), and nearly all computer systems
implement their network protocols as part of the operating
system, when we refer to the interface “exported by the
network,” we are generally referring to the interface that the OS
provides to its networking subsystem. This interface is often
called the network application programming interface (API)
The main abstraction of the socket interface, not
surprisingly, is the socket. A good way to think of a socket is as
the point where a local application process attaches to the
network. The interface defines operations for creating a socket,
attaching the socket to the network, sending/ receiving
messages through the socket, and closing the socket.
The first step is to create a socket, which is done with the
following operation:
int socket(int domain, int type, int protocol)
On a server machine, the application process performs a
passive open — the server says that it is prepared to accept
connections, but it does not actually establish a connection. The
server does this by invoking the following three operations:
int bind(int socket, struct sockaddr *address, int addr len)
int listen(int socket, int backlog)
int accept(int socket, struct sockaddr *address, int *addr len)
On the client machine, the application process performs
an active open; that is, it says who it wants to communicate with
by invoking the following single operation:
int connect(int socket, struct sockaddr *address, int addr len)
Once a connection is established, the application
processes invoke the following two operations to send and
receive data:
int send(int socket, char *message, int msg len, int flags)
int recv(int socket, char *buffer, int buf len, int flags)
CN unit 1 part 2 2023.ppt

More Related Content

Similar to CN unit 1 part 2 2023.ppt

Manish Jha- Research Scholar- Internet Basics Requriement
Manish Jha- Research Scholar- Internet Basics RequriementManish Jha- Research Scholar- Internet Basics Requriement
Manish Jha- Research Scholar- Internet Basics RequriementManish Jha
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA Aiman Hud
 
006 Osi Model
006 Osi Model006 Osi Model
006 Osi ModelBELKA08
 
Ccent notes part 1
Ccent notes part 1Ccent notes part 1
Ccent notes part 1ahmady
 
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
 
BAPANKAR15800121011 SOFT.pptx
BAPANKAR15800121011 SOFT.pptxBAPANKAR15800121011 SOFT.pptx
BAPANKAR15800121011 SOFT.pptxBapanKar2
 
Internetworking
InternetworkingInternetworking
InternetworkingRaghu nath
 
OSI and TCP/IP Model
OSI and TCP/IP ModelOSI and TCP/IP Model
OSI and TCP/IP ModelNajmulIslam38
 
Osi model and tcpip model.
Osi model and tcpip model.Osi model and tcpip model.
Osi model and tcpip model.kona paul
 

Similar to CN unit 1 part 2 2023.ppt (20)

Manish Jha- Research Scholar- Internet Basics Requriement
Manish Jha- Research Scholar- Internet Basics RequriementManish Jha- Research Scholar- Internet Basics Requriement
Manish Jha- Research Scholar- Internet Basics Requriement
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
chapter 4.pptx
chapter 4.pptxchapter 4.pptx
chapter 4.pptx
 
OSI &TCP/IP Model
OSI &TCP/IP ModelOSI &TCP/IP Model
OSI &TCP/IP Model
 
Learn basics of ip addressing
Learn basics of  ip addressingLearn basics of  ip addressing
Learn basics of ip addressing
 
006 Osi Model
006 Osi Model006 Osi Model
006 Osi Model
 
Ccent notes part 1
Ccent notes part 1Ccent notes part 1
Ccent notes part 1
 
OSI & TCP model
OSI & TCP modelOSI & TCP model
OSI & TCP 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
 
BAPANKAR15800121011 SOFT.pptx
BAPANKAR15800121011 SOFT.pptxBAPANKAR15800121011 SOFT.pptx
BAPANKAR15800121011 SOFT.pptx
 
Week2 lec2-bscs1
Week2 lec2-bscs1Week2 lec2-bscs1
Week2 lec2-bscs1
 
Wp simoneau osi_model
Wp simoneau osi_modelWp simoneau osi_model
Wp simoneau osi_model
 
Internetworking
InternetworkingInternetworking
Internetworking
 
Osi model
Osi modelOsi model
Osi model
 
OSI and TCP/IP Model
OSI and TCP/IP ModelOSI and TCP/IP Model
OSI and TCP/IP Model
 
Assignment3
Assignment3Assignment3
Assignment3
 
Osi model 7 Layers
Osi model 7 LayersOsi model 7 Layers
Osi model 7 Layers
 
osi and tcpip.ppt
osi and tcpip.pptosi and tcpip.ppt
osi and tcpip.ppt
 
Osi and tcpip
Osi and tcpipOsi and tcpip
Osi and tcpip
 
Osi model and tcpip model.
Osi model and tcpip model.Osi model and tcpip model.
Osi model and tcpip model.
 

Recently uploaded

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 

Recently uploaded (20)

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 

CN unit 1 part 2 2023.ppt

  • 2. Layering and Protocols • When the system gets complex, the system designer introduces another level of abstraction • In network, abstraction leads to layering. Layering provides two features: It decomposes the problem of building a network into more manageable components. It provides more modular design
  • 3.
  • 4. Protocols: A protocol is a set of rules that governs data communication. It defines what is communicated, how it is communicated, and when it is communicated. The key elements of a protocol are syntax, semantics and timing. Each protocol defines two different interfaces.  Service interface - to the other objects on the same computer that want to use its communication services.  Peer interface - to its counterpart (peer) on another machine.
  • 5.
  • 6. • Encapsulation Control information must be added with the data to instruct the peer how to handle with the received message. It will be added into the header or trailer.  Header - Small data structure from few bytes to few kilobytes attached to the front of message.  Trailer – Information will be added at the end of the message • Multiplexing and De-Multiplexing multiple flows of data over a single physical link
  • 7. The OSI Model  International standard organization (ISO) established a committee in 1977 to develop an architecture for systems communication.  Open System Interconnection (OSI) reference model is the result of this effort.  This model allows any two different systems to communicate regardless of their underlying architecture.  The OSI model describes how data flows from one computer, through a network to another computer.
  • 8. Seven layers of the OSI model 1. Physical Layer 2. Data link Layer 3. Network Layer 4. Transport Layer 5. Session Layer 6. Presentation Layer 7. Application Layer
  • 9.
  • 10. Seven layers of the OSI model User Support Layers Network Support Layers Application Presentation Session Transport Network Data Link Physical
  • 11. Seven layers of the OSI model Remember: All People Seem To Need Data Processing Application Presentation Session Transport Network Data Link Physical
  • 12. Seven layers of the OSI model Application Presentation Session Transport Network Data Link Physical To Transmit bits over a medium; to provide Mechanical and electrical specifications To organize bits into frames; to provide Hop-to-hop delivery To move packets from source to destination; to provide internetworking To Provide reliable process-to-process Message delivery and error recovery To establish, manage, and terminate session To Translate, encrypt, and compress data To allow access to network resources
  • 13. Physical Layer  Physical layer is the bottom(layer 1) of OSI model.  It is responsible for the actual physical connection between the devices.  The physical layer is responsible for movements of individual bits from one node to next.
  • 14. Physical characteristics of interface and medium Representation of bits Data rate Synchronization of bits Line configuration Physical topology Transmission mode Functions of Physical Layer
  • 15. Data Link Layer  The data link layer is responsible for moving frames from one node to the next Functions of Data Link Layer Framing Physical addressing Flow Control Error Control Access Control
  • 16. Network Layer  It is responsible for the source to destination delivery of a packets across multiple networks Functions of Network layer Logical addressing Routing
  • 17. Transport Layer  It is responsible for source process to destination process delivery of entire message Functions of Transport Layer Service-point addressing Segmentation and reassembly Connection control Flow control Error Control
  • 18. Session Layer  It is responsible for beginning, maintaining & ending the communication between two devices, which is called session Functions of Session Layer Dialog Control Synchronization
  • 19. Presentation Layer  This layer is concerned with the syntax and semantics of the information exchanged between two systems. Functions of Presentation Layer Translation Encryption Compression
  • 20. Application Layer  Provides User interfaces and support for Services, like e-mail, file transfer Functions of Application Layer Network virtual terminal File transfer, access and management Mail services Directory services
  • 21. TCP/IP Model  TCP and IP are two protocols of this model.  This model was initially used by ARPANET.  The TCP/IP protocol suite was defined as having four layers: 1) Host-to-network 2) Internet 3) Transport 4) Application
  • 22.
  • 23.
  • 24. Host to Network Layer  It is the bottom layer of TCP/IP model also known as Network interface layer.  The purpose of this layer is to connect the host to the network. Internet Layer  Internet layer is similar to network layer of OSI model in functionality.  This layer is responsible for delivering IP packets to their destinations.  An important protocol of this layer is IP(Internet Protocol).
  • 25. Transport Layer  Transport layer of TCP/IP model also provides connection oriented and connectionless services. 1) Connection Oriented – TCP(Transmission Control Protocol) 2) Connection Less – UDP(User Datagram Protocol) Application Layer  This layer is the combination of Application, Presentation and Session layer of the OSI model.  This layer provides various services to different user applications.
  • 26.
  • 27. Socket (Network Software - API) A socket is one endpoint of a two-way communication link between two programs running on the network. A socket is bound to a port number so that the TCP layer can identify the application that data is destined to be sent to. An endpoint is a combination of an IP address and a port number Application Programming Interface (Sockets) The place to start when implementing a network application is the interface exported by the network. Since most network protocols are implemented in software (especially those high in the protocol stack), and nearly all computer systems implement their network protocols as part of the operating system, when we refer to the interface “exported by the network,” we are generally referring to the interface that the OS provides to its networking subsystem. This interface is often called the network application programming interface (API)
  • 28. The main abstraction of the socket interface, not surprisingly, is the socket. A good way to think of a socket is as the point where a local application process attaches to the network. The interface defines operations for creating a socket, attaching the socket to the network, sending/ receiving messages through the socket, and closing the socket. The first step is to create a socket, which is done with the following operation: int socket(int domain, int type, int protocol)
  • 29. On a server machine, the application process performs a passive open — the server says that it is prepared to accept connections, but it does not actually establish a connection. The server does this by invoking the following three operations: int bind(int socket, struct sockaddr *address, int addr len) int listen(int socket, int backlog) int accept(int socket, struct sockaddr *address, int *addr len) On the client machine, the application process performs an active open; that is, it says who it wants to communicate with by invoking the following single operation: int connect(int socket, struct sockaddr *address, int addr len)
  • 30. Once a connection is established, the application processes invoke the following two operations to send and receive data: int send(int socket, char *message, int msg len, int flags) int recv(int socket, char *buffer, int buf len, int flags)