Sunteți pe pagina 1din 44

Protocol Hierarchies

To reduce the complexity, most of the networks are organized 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.

Conti.
Layer n on one machine carries on a conversation with layer n 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:

Conti.
Host 1 Layer 5 Protocol Layer 5 Layer 4 / 5 interface Layer 4 Protocol Layer 4 Layer 3 / 4 interface Layer 3 Protocol Layer 3 Layer 2 / 3 interface Layer 2 Protocol Layer 2 Layer 1 / 2 interface Layer 1 Protocol Layer 1 Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Host 2

Physical Medium

Conti.
The entities comprising the corresponding layers on different machines 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 medium through which actual communication occurs.
4

Conti.
These layers are also capable of doing virtual communication shown 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 vise versa.

Network Architecture
Network is a combination of hosts, applications, routers, hardware, software and links of media. Network architecture is a guideline and technology for designing building and managing a network. A set of layers and protocols is called a network architecture.

A list of protocols used by a certain system, one protocol per layer is called a protocol stack.

Goal and Use of Network Architecture


1. To provide assistance and guidance to implement high quality 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.

Design Issues For the Layers


Every layer needs a mechanism for identifying senders and receivers. 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

Conti.
Another set of design decisions concerns the rules for data transfer. 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

Conti.
The protocol must also determine how many logical channels the connection correspond to, and what their priorities are. Many networks provide at least two logical channels per connection, one for normal data and one for urgent data.

10

Conti.
Error control is an important issue because physical communication 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

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 to be 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

Conti.
An issue that occurs at every level is how to synchronize the senders 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

Conti.
When it is expensive or inconvenient to set up a separate connection for each pair of communicating processes, the layers may decide to use the same connection for multiple, unrelated conversations.

As long as this multiplexing and demultiplexing is done it can be use by any layer. When their is multiple paths between source and destination, a route must be chosen. Sometimes this decision must be split over two or more decision.
14

Message passing in n layer model


How to provide communication to the top layer of five-layer model?
Layers 5 Layer 5 Protocol M 4 H4 3 H3 H4 M1 2 H2 H3 H4 M1 T2 H2 H3 M2 T2 Protoco H2 H3 l H4 M1 T2 H2 H3 M2 T2 H3 M2 Layer 2 M Layer 3 Protocol H3 H4 M1 H3 M2 M

Layer 4 Protocol H4 M

Source Machine

Destination Machine
15

Conti.
A message M is provided by an application of layer 5 and given to layer 4 for transmission. Layer 4 puts a header in 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

Conti.
In many networks there is no limit to the size of messages transmitted 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

Conti.
Layer 2 adds not only header to each piece, but also trailer and 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

Connection-oriented and Connectionless service


The function of layers is to offer services to the layers above it. This can be done in two modes:-

1. Connection-oriented service 2. Connectionless service

19

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. 2. 3. 4. Pick up your telephone Dial the destination number which is unique Say what you want to convey Hang up your phone
20

Conti
A similar mode of operation is followed in the case of connection 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

Conti.
Imagine a tube of certain length that is connected to a tap and the other end connected to a bucket. If you push water through the tap end, the water flows directly to the bucket without flowing elsewhere. This is an example of end to end transmission and is what happens in the case of connection oriented service.

22

Connectionless service
Services are modeled after postal services. A connectionless services is just a service with no preestablished 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

Conti.
The packets send need not arrive in the same order in which they 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

Reliable and Unreliable Service


Both connection oriented and connectionless services have reliable 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

Conti.
In cases like FTP, we might require that the sender acknowledge 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

Conti.
Unreliable (meaning not acknowledged) connectionless service is often called datagram service, in analogy with telegram service, which also does not return an acknowledgement to the sender.

TCP is one protocol that uses connection oriented service concept and UDP is another protocol that uses connectionless service concept.

27

Six different types of services

28

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

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

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

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

33

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

Conti.
The set of primitives available depends on the nature of the service being provided. The primitives for connection-oriented service are different from those of connectionless service.

35

Five service primitives for Conn-Oriented

36

Conti.
First ,the server executes the LISTEN to indicate that it is prepared 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

Conti.
The CONNECT call needs to specify who to connect to so it might 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 the operating system there.

38

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 and 2. 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

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

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 perform on behalf of its users. Doesnt specify the implementation details of these operations.

41

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 a layer. Entities use protocols to implement their service definitions.

42

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

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 between a service and a protocol.


44

S-ar putea să vă placă și