You are on page 1of 36

Lecture No.

08

Protocol Layering
Protocol

• A network protocol is an established set of rules that


determine how data is transmitted between different
devices in the same network
• Essentially, it allows connected devices to communicate
with each other, regardless of any differences in their
internal processes, structure or design
• Network protocols are the reason that we can easily
communicate with people all over the world, and thus
play a critical role in modern digital communications
Protocol Layering

• When communication is simple,we need only one simple


protocol; when the communication is complex, we need
to divide the task between different layers, in which case
we need a protocol at each layer
• Dividing the task between different layers is called
Protocol layering
• Two simple scenarios to understand the need for protocol
layering
First Scenario
• In the first scenario, communication is simple that it can
occur in only one layer.
• Assume Maria and Ann are neighbors with a lot of
common ideas.
• Communication between Maria and Ann takes place in
one layer, face to face, in the same language, as shown in
Figure
Set of rules followed in this scenario:

• First, Maria and Ann know that they should greet each
other when they meet.
• Second,they know that they should confine their
vocabulary to the level of their friendship.
• Third, each party knows that she should refrain( not
talking) from speaking when the other party is speaking.
• Fourth, each party knows that the conversation should be
a dialog.
• Fifth, they should exchange some nice words when they
leave.
Second Scenario

• In the second scenario, we assume that Ann is offered a


higher-level position in her company, but needs to move to
another branch located in a city very far from Maria.
• The two friends still want to continue their communication
and exchange ideas because they have come up with an
innovative project to start a new business when they both
retire.
• They decide to continue their conversation using regular mail
through the post office.
• They agree on an encryption/decryption technique.
• The sender of the letter encrypts it to make it unreadable by
an intruder; the receiver of the letter decrypts it to get the
original letter
• Consider that Maria sends the first letter to Ann.
• Maria talks to the machine at the third layer as though the
machine is Ann and is listening to her.
• The third layer machine listens to what Maria says and
creates the plaintext (a letter in English), which is passed to
the second layer machine.
• The second layer machine takes the plaintext ,encrypts it,
and creates the ciphertext, which is passed to the first layer
machine.
• The first layer machine, takes the ciphertext, puts it in an
envelope,adds the sender and receiver addresses, and mails
it.
Protocol Layering & Modularity
• Protocol layering enables us to divide a complex task into
several smaller and simpler tasks.
• For example, in the previous figure, we could have used only
one machine to do the job of all three machines.
• However, if Maria and Ann decide that the
encryption/decryption done by the machine is not enough to
protect their secrecy, they would have to change the whole
machine.
• In the present situation, they need to change only the
second layer machine; the other two can remain the same.
• This is referred to as modularity
Principles of Protocol Layering

First Principle
• If we want bidirectional communication, we need to make
each layer so that it is able to perform two opposite tasks,
one in each direction.
• For example, the third layer task is to listen (in one direction)
and talk (in the other direction).
• The second layer needs to be able to encrypt and decrypt.
• The first layer needs to send and receive mail
Principles of Protocol Layering
Second Principle
• The second principle that we need to follow in protocol layering is
that the two objects under each layer at both sites should be
identical.
• For example, the object under layer 3 at both sites should be a
plaintext letter.
• The object under layer 2 at both sites should be a cipher text letter.
• The object under layer 1 at both sites should be a piece of mail.
• Logical connection between each layer is shown in next figure
• We have layer-to-layer communication.
• Maria and Ann can think that there is a logical (imaginary)
connection at each layer through which they can send the object
created from that layer
Example: organization of air travel

ticket (purchase) ticketing service ticket (complain)


baggage (check) baggage service baggage (claim)
gates (load) gate service gates (unload)
runway takeoff runway service runway landing
airplane routing routing service
airplane routing airplane routing

layers: each layer implements a service


 via its own internal-layer actions
 relying on services provided by layer below
Why layering?
Approach to designing complex systems:
 categorical structure allows identification, relationship of
system’s pieces
 modularization eases maintenance, updating of system
• change in layer's service implementation: transparent to rest of
system
• e.g., change in gate procedure doesn’t affect rest of system
Protocol “layers” and reference models
Networks are complex, Question: is there any
with many “pieces”: hope of organizing
 hosts structure of network?
 routers
 links of various media
 applications
 protocols
 hardware, software
Network protocol layering

• network designers organize protocols—and the network


hardware and software that implement the protocols— in
layers.
• Each protocol belongs to one of the layers, just as each
function in the airline architecture.
• each layer provides its service by
(1)performing certain actions within that layer and by
(2)using the services of the layer directly below it.
Network Models
Layered Internet protocol stack
 application: supporting network applications
• HTTP, IMAP, SMTP, DNS application
application
 transport: process-process data transfer
• TCP, UDP transport
transport
 network: routing of datagrams from source to
destination network
• IP, routing protocols
link
 link: data transfer between neighboring
network elements physical
• Ethernet, 802.11 (WiFi), PPP
 physical: bits “on the wire”
ISO/OSI reference model
Two layers not found in Internet
protocol stack! application

 presentation: allow applications to interpret presentation


meaning of data, e.g., encryption, session
compression, machine-specific conventions transport
 session: synchronization, checkpointing, network
recovery of data exchange
link
 Internet stack “missing” these layers!
physical
• these services, if needed, must be
implemented in application The seven layer OSI/ISO
reference model
• needed?
TCP/IP (Transmission Control Protocol/lnternet
Protocol)

• TCP/IP is a protocol suite ( a set of protocols organized in


different layers) used in the Internet today.
• A hierarchical protocol made up of interactive modules,
each which provides a specific functionality.
• Each upper level protocol is supported by the services
provided by one or more lower protocols.
• A protocol layer can be implemented in software, in
hardware, or in a combination of the two.
• Application layer protocols always implemented in software
in the end systems; so are transport-layer protocols.
• Because the physical layer and data link layers are
responsible for handling communication over a specific link,
they are typically implemented in a network interface card
(NIC ) for example, Ethernet or WiFi interface cards
associated with a given link. (Hardware)
• The network layer is often a mixed implementation of
hardware and software
Application Layer

• Communication is between two programs running in the


sender's and receiver’s computers.
• 'In the application layer, a message is prepared and sent
with a destination friendly address such as a name or an
email address.
• We'll refer to exchanged information at the application
layer as messages.
• Some application layer protocols:
• Hypertext Transfer Protocol (HTTP) to access the World
Wide Web.
• Simple Mail Transfer Protocol (SMTP) used in e-mail
service.
• File Transfer Protocol (FTP) used for transferring files.
• Terminal Network(TELNET) and Secure Shell(SSH) used for
accessing the site remotely.
• Simple Network Management Protocol (SNMP) used by an
administrator to manage the Internet at global and local
levels.
• Domain Name System(DNS) used by other protocols to
find the network-layer address (IP) of a computer.
Transport Layer

• It gets the message from the application layer, encapsulates


it into packets called ( segments or user datagrams).
• It adds a port address (process address) which is the address
of the destination’s process responsible of this message.
• Transport layer has different protocols and each application
program can use the protocol that best matches its
requirement.
• The main protocol is Transmission Control Protocol (TCP):
• It is a connection oriented protocol that first establishes a
logical connection between transport layers at two hosts
before transferring data.
• It breaks long messages into shorter segments.
• It provides flow control (matching the sending data rate of
the source host with the receiving data rate of the
destination host to prevent overwhelming the destination).
• It provides error control ( to guarantee that the segments
arrive at the destination without error and resending the
corrupted ones).
• It provides congestion control ( to reduce the loss of
segments due to congestion in the network).
• The other common protocol in the network layer is User
Datagram Protocol (UDP).
• It is a connectionless protocol which transmits user
datagrams without first creating a logical connection.
• It does not provide flow, error, or congestion control.
• It does not guarantee data reliability.
Network Layer
• It is responsible for creating a connection between the source
computer and the destination computer. ( host-to-host
communication)
• It is also responsible for routing the packets through possible routes.
• Network layer includes the Internet Protocol, IP protocol:
• Defines the format and the structure of addresses used in this layer.
• Responsible of routing a packet from its source to its destination.
• It is a connectionless protocol. That provides no flow control, no error
control, and no congestion control services.
Data-link Layer
• An internet is made up of several links (LANs and WANs) connected
by routers.
• There may be several overlapping sets of links in between the host to
the destination.
• The data-link layer takes a datagram and encapsulates it in a packet
called a frame.
• The data-link layer is responsible for taking the frame and moving it
across the link.
• Each link layer protocol may provide a different service. Some link
layer protocols provide complete error detection and correction, and
some provide only error detection.
Physical Layer

• Responsible of carrying individual bits in a frame across the


link.
• The transmission media is a hidden layer under the physical
layer.
• The transmission medium does not carry bits; it carries
electrical or optical signals.
• So the bits received from the data link layer are
transformed and sent through the transmission media.
Encapsulation at Source host

1. At the application layer, the data to be exchanged is referred to as a


message. It does not contain any header or trailer only the friendly
address. The message is passed to the transport layer.
2. The transport layer takes the message as a payload. It adds the
transport layer header which contains the identifier of the source
and destination application programs (port numbers), plus some
more information (in TCP packets) related to data flow, error
control, or congestion control. The result is the transport-layer
packet which is called the segment in TCP and user datagram in
UDP.
3. The network layer takes the payload and adds its own header
which contains the address of the source and destination
information. The result is the network layer packet called the
datagram.
4. The Data-link layer takes the payload and adds its own header
which contains link-layer addresses of the host and the next
hop. The result is the link-layer packet called a frame.
5. The frame is passed to the physical layer for transmission.
message M
source
application
Encapsulation: an
segment
datagram Hn Ht
Htt M
M
transport
network
end-end view
frame Hl Hn Ht M link
physical
link
physical

switch

destination Hn Ht M network
M Hl Hn Ht M link Hn Ht M
application
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
physical
Addressing

• We need 4 pairs of addresses for the top 4 layers.


• In the application layer addresses are names that define the
services such as someorg.com or the email address such as
somebody@coldmail.com.
• At the transport layer, addresses are called port numbers,
and these define the application-layer programs at the
source and destination. Port numbers are used to distinguish
between several programs running at the same time.
• At the network layer, the addresses are global with the
whole Internet as a scope. It is used to uniquely identify
the connection of a device to the Internet (IP address). It
is called logical address.
• The link-layer addresses called MAC addresses are locally
defined addresses each defines a specific host in a
network. It is called physical address.
OSI Model

• Back in the late 1970s, the International Organization for


Standardization (ISO) proposed that computer networks be
organized around seven layers, called the Open Systems
Interconnection (OSI) model.
• OSI is a set of protocols that allows any two different systems to
communicate regardless of their underlying architecture.
• The purpose of OSI model, is to show how to facilitate the
communication between different systems without requiring
changes to logic of the underlying hardware and software.
Lack of OSI model's success

• OSI was completed when TCP/IP was fully in place and a


lot of time and money had been spent on the suite;
changing it would cost a lot.
• Some layers in the OSI model were never fully defined.
• When OSI was implemented by an organization in a
different application, it did not show a high enough level
of performance to switch from the TCP/IP protocol suite.

You might also like