Upload
rrs1988
View
226
Download
0
Embed Size (px)
Citation preview
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
1/44
Protocol Hierarchies
To reduce the complexity, most of the networks areorganized as a series of layers or levels, each one built upon
the one below it.
The number of layers, the name of layer, the contents of
layer and function of layer differ from network to network.
In general the purpose of each layer is to offer services to
higher layers.
1
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
2/44
Conti.
Layer non one machine carries on a conversation with layern on another machine.
The rules and convention used in this conversation are
correctively known as layer n protocol.
Following figure illustrates example of five layer protocol:
2
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
3/44
Conti.
3
Host 1Layer 5
Layer 4
Layer 3
Layer 2
Layer 1
Host 2Layer 5
Layer 4
Layer 3
Layer 2
Layer 1
Layer 4 / 5 interface
Layer 3 / 4 interface
Layer 2 / 3 interface
Layer 1 / 2 interface
Layer 5 Protocol
Layer 4 Protocol
Layer 3 Protocol
Layer 2 Protocol
Layer 1 Protocol
Physical Medium
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
4/44
Conti.
The entities comprising the corresponding layers on differentmachines are called peers.
In reality no data are directly transferred from layer n on one
machine to layer n on another machine.
Each layer passes data and control information to the layer
immediately below it, until the lowest layer is reached.
Below layer 1 is the physical mediumthrough which actual
communication occurs.
4
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
5/44
Conti.
These layers are also capable of doing virtual communicationshown by dotted lines.
The solid line presents physical communication.
Between each pair of adjacent layer there is an interface.
The interface defines which primitive operation and
services the lower layer offers to the upper one and viseversa.
5
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
6/44
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
7/44
Goal and Use of Network Architecture
1. To provide assistance and guidance to implement highquality network.
2. Not only helps to deploy the network but also assists in
troubleshoot and maintaining architecture.
3. Helps for security management and disaster recovery.
7
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
8/44
Design Issues For the Layers
Every layer needs a mechanism for identifying senders andreceivers.
Since a network normally has many computers, some of
which have multiple processes, a means is needed for a
process on one machine to specify with whom it wants to
talk.
As a consequences of having multiple destinations, some
form of addressing is needed in order to specify a specific
destination.
8
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
9/44
Conti.
Another set of design decisions concerns the rules for datatransfer.
In some systems, data travel in one direction (simplex
communication).
In others, they can travel in either direction, but not
simultaneously (half duplex communication).
In others, they travel in both directions at once (full duplex
communication).
9
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
10/44
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
11/44
Conti.
Error control is an important issue because physicalcommunication circuits are not perfect.
Many error detecting and error correcting codes are known,
but both ends of connection must agree on which one is
being used.
In addition, the receiver must have some way of telling the
sender which messages have been correctly received and
which have not.
11
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
12/44
Conti.
Not all communication channels are preserve the order of
messages sent on them.
To deal with a possible loss of sequencing, the protocol must
make explicit provision for the receiver to allow the pieces tobe put back together properly.
An obvious solution is to number the pieces, but this solution
still leaves open the question of what should be done with
pieces that arrive out of order.
12
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
13/44
Conti.
An issue that occurs at every level is how to synchronize thesenders and receivers clock.
To handle this protocol must have facility of feedback from
the receiver to sender, either directly or indirectly.
Protocol must give the facility of disassembling, transmitting
and then reassembling messages.
13
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
14/44
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
15/44
Message passing in n layer model
How to provide communication to the top layer of five-layer model?
15
Layers
M
H4
5
4
Layer 5 Protocol
Layer 4 Protocol
Layer 3 Protocol
Layer 2
Protoco
l
M
H3 M1H4 H3 M2
3
H2 M1H4H3 T2 H2 M2H3 T2 H2 M1H4H3 T2 H2 M2H3 T2
M
H4 M
H3 M1H4 H3 M2
2
Source
Machine
Destination
Machine
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
16/44
Conti.
A message M is provided by an application of layer 5 andgiven to layer 4 for transmission.
Layer 4 puts a headerin front of the message to identify the
message and passes the result to layer 3.
The header contains the control information, such as
sequence numbers to allow layer 4 on the destination
machine to deliver messages in the right order.
Sometimes it has sizes, times, and other fields.
16
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
17/44
Conti.
In many networks there is no limit to the size of messagestransmitted in the layer 4, but there is limit imposed by layer
3 protocol.
So layer 3 must break the incoming messages into smaller
units, packets pretending layer 3 header to each packet. So
M is break as M1 and M2.
Layer 3 decides which of outgoing lines to use and passes the
packet to layer 2.
17
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
18/44
Conti.
Layer 2 adds not only header to each piece, but also trailerand gives the resulting unit to layer 1 for physical
transmission.
At receiving machine the message moves upward from layer
to layer, with headers being stripped off as it progress.
18
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
19/44
Connection-oriented and Connectionless service
The function of layers is to offer services to the layers aboveit.
This can be done in two modes:-
1. Connection-oriented service
2. Connectionless service
19
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
20/44
Connection-oriented service
Services are modeled after telephone system.
Consider the case when you make a telephone call.
Here are the steps you would take in order to connect to the
person at the other end.
1. Pick up your telephone
2. Dial the destination number which is unique
3. Say what you want to convey
4. Hang up your phone
20
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
21/44
Conti
A similar mode of operation is followed in the case ofconnection oriented services.
1. Establish a connection between the sender and the
receiver.
2. Make use of the connection by sending and receiving
information.
3. When done, terminate the existing connection.
21
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
22/44
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
23/44
Connectionless service
Services are modeled after postal services.
A connectionless services is just a service with no pre-
established connection.
It is more like a postal system wherein you send and receive
mails with the help of destination address and several
offices that route your mails to the correct destination.
23
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
24/44
Conti.
The packets send need not arrive in the same order in whichthey are sent.
This is basically because all packets might not take the same
route since there is no preset connection in such services.
The routers route the packets according to their built in
algorithms and the receiver might need to reorder the
packet.
24
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
25/44
Reliable and Unreliable Service
Both connection oriented and connectionless serviceshavereliable as well as unreliable services.
Reliable services in the sense that we are assured of the
receiver receiving the data and in unreliable the receiver
might not actually get the data.
This is monitored by usually setting a feedback required or
not mechanism.
25
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
26/44
Conti.
In cases like FTP, we might require that the senderacknowledge the receipt.
For this we use reliable connection oriented services.
The acknowledgement process introduces overhead and
delays, which are often worth it but are sometimes
undesirable.
In other cases such as database queries, it is not really
required that the receiver sends an acknowledgement.
In these cases, we use unreliable connectionless services.
26
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
27/44
Conti.
Unreliable (meaning not acknowledged) connectionlessservice is often called datagram service, in analogy with
telegram service, which also does not return an
acknowledgement to the sender.
TCPis one protocol that uses connection oriented service
concept and UDPis another protocol that uses
connectionless service concept.
27
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
28/44
Six different types of services
28
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
29/44
Conti.
Reliable Message Stream:-The message boundaries are preserved.
When two 1-KB messages are sent, they arrive as two
distinct 1-KB messages, not as 2 KB messages.
Reliable Byte Stream:-
Message boundaries are not preserved.
When 2KB message arrive at receiver, there is no way to tell
if they were sent as one 2KB message or two 1KB messages.
29
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
30/44
Conti.
Unreliable connection:-In some application the delays introduced by
acknowledgements are unacceptable.
Unreliable datagram:-
Unreliable connectionless service is often called as datagram
service,which does not provide an acknowledgement back
to the sender.
30
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
31/44
Conti.
Acknowledged datagram:-
In some applications, without establishing connection
reliability is important.
The acknowledged datagram service can be provided for
these applications.
It is like sending register letter and requesting a return
receipt.
When receipt comes back, the sender is absolutely sure that
letter was delivered to intended party.
31
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
32/44
Conti.
Request-reply:-The sender transmits a single datagram containing a request;
the reply contains the answer.
Request-reply is commonly used to implement
communication in the client server model: the client issues a
request and the server responds to it.
32
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
33/44
33
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
34/44
Service Primitives
A service is formally specified by a set of primitives(operations) available to a user process to access the service.
These primitives tell the service to perform some action or
report on an action taken by a peer entity.
If the protocol stack is located in the operating system, as it
often is, the primitives are normally system calls.
These calls cause a trap to kernel mode, which then turns
control of the machine over to the operating system to send
the necessary packets.34
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
35/44
Conti.
The set of primitives available depends on the nature of theservice being provided.
The primitives for connection-oriented service are different
from those of connectionless service.
35
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
36/44
36
Five service primitives for Conn-Oriented
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
37/44
Conti.
First ,the server executes the LISTEN to indicate that it isprepared to accept incoming connections.
A common way to implement LISTEN is to make it a blocking
system call.
After executing the primitive, the server process is blocked
until a request for connection appears.
Next the client process executes CONNECT to establish a
connection with the server.
37
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
38/44
Conti.
The CONNECT call needs to specify who to connect to so itmight have a parameter giving the servers address.
The operating system then typically sends a packet to the
peer asking it to connect.
The client process is suspended until there is a response.
When the packet arrives at the server, it is processed by theoperating system there.
38
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
39/44
Conti.
When the system sees that the packet is requesting a
connection, it checks to see if there is a listener.
If so, it does two things :-
1. Unblocks the listener and2. Sends back an acknowledgement
The arrival of this acknowledgement then releases the client.
At this point the client and server are both running and they
have a connection established.
39
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
40/44
Conti.
Note that the acknowledgement is generated by the protocol
code itself.
If a connection request arrives and there is no listener the
result is undefined.
In some systems the packet may be queued for a short time
in anticipation of a LISTEN.
40
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
41/44
The Relationship between Services and Protocols
Def:-
A service is a set of primitives (operations) that a layer
provides to the layer above it.
It defines what operations the layer is prepared to performon behalf of its users.
Doesnt specify the implementation details of these
operations.
41
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
42/44
Conti.
It relates an interface between two layers, with the lower layer being the
service provider and upper layer being the service user.
Definition of a protocol:-
A protocol in contrast , is a set of rules governing the format and meaning
of packets or messages that are exchanged by the peer entities within alayer.
Entities use protocols to implement their service definitions.
42
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
43/44
Conti.
A service is like an abstract data type or an object in an
object-oriented language.
It defines operations that can be performed on an object but
does not specify how these operations are implemented.
A protocol relates to the implementation of the service and
as such is not visible to the user of the service.
43
8/13/2019 Chapter 1- Introduction to Computer Networks_Second PPT
44/44
Conti.
In short,
Services relate to the interfaces between layers.
Protocols relate to the packets sent between peer entities on
different machines.
Fig. The relationship betweena serviceand a protocol.