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)