Sunteți pe pagina 1din 62

The OSI Model

Topics

What are Protocols ? Why we need Protocols and Standards The OSI Reference Model The Seven Layers of the Model Responsibilities of Each Layer The Application Layer The Presentation Layer The Session Layer The Transport Layer The Network Layer

The Data Link Layer


The Physical Layer

What are Protocols ?

Lets look at what happen:


Oh my God, what Hi, What is did name he say your ? ?
Xin cho, bn tn l g vy ?

Khng bit thng ny ang ni ci g na ?

They do not understand each other because they are using different languages.

What are Protocols ? (cont)

Now, Lets look at what happens next:


my name is My name is Hi, to Hi, What is Nice meet Gary, and what is your name ?nice to Harry, you, too. meet you. your name ?

They can understand each other because they are using the same language.

What are Protocols ? (cont)

So in order for two people to speak to each other, the first thing they should to agree on is the language, or protocols, to use. Communication between hosts on the network is the same. When hosts begin communicating with each other, they first must agree on what protocols to use.

What are Protocols ? (cont)


IP
IPX
Netware PC running IPX protocol

Windows PC running IP protocol

IPX

IPX
Netware PC running IPX protocol

Windows PC running IPX protocol

What are Protocols ? (cont)

A group of protocol is called a protocol suite or a protocol stack.

When combined with other protocols, the protocol group that result is called a protocol suite. TCP/IP, for example, is a protocol suite.

Why We Need Protocols and Standards

Rules or protocols and standards are important to ensure compatibility between different kinds of things
Developing protocols is an ongoings (vic ang pht trin lin lc), ever-changing (lun lun thay i) science. As the industry is increasing so dynamically (si ni) and rapidly.

However, before a protocol is accepted and widely implemented, it has to pass rigorous testing. So a standard framework is used to help design, compare, test, and evaluate protocols.

The OSI Reference Model

For network communications to take place, hundreds of questions must be answered by a set of protocol (how, when, what). Evaluating and working with these hundreds of questions would be unmanageable.

The OSI Reference Model (cont)

So, in 1977, the International Standards Organization (ISO) adopted (chp nhn) the Open Standard Interconnection (OSI) model.

The OSI model breaks down the many tasks involved in moving data from one host to another.
The hundreds of questions are divided into seven smaller. The seven groups are called layers.

The OSI Reference Model (cont)

The OSI reference model is exactly that; it is only a model.


If we think of the model as a set of questions that have to be answered, then the protocols are the answers. Any one protocol may answer only a few of the questions, or in other words, address specific layers in the model. By combining multiple protocols into a protocol suite, we can answer all the questions posed (t ra) by the model.

The Seven Layers of the OSI Model

The goal of the OSI model is to break down the task of data communication into simple steps. These steps are called layers. The OSI model is made up of seven distinct layers. Each layer has certain responsibilities.

The Seven Layers of the OSI Model


Application Presentation Session Transport Network Data Link Physical

Responsibilities of Each Layer

The purpose of each layer in the OSI model is to provide services to the layer above it.

The higher layers do not need to what happened at the lower layers. Following is the process of moving data from one host to another:

Data Stream Application

Data Stream

Application

Presentation

Data Stream

DataStream Stream Data

Data DataStream Stream

Data Stream Presentation

Data Stream Session

Data Stream This is called

Data Stream

Data Stream Session

segment
This one is Data Data Stream Data Data called

Transport

Data

Data Data Data Data Stream

Data Stream

Transport

packet
Data IP IP Header Header Data This one is called

Data IP Header Network

1 1

IP Header Data

Network

Data

frame
Data Link
Data 1 Frame Header Header IP Frame 1 IPHeader Header Data

I I

Frame Header IP Header Data

IP Header Data

Data Link

Physical

Physical

The Application Layer


The Website is delivered to you

Lets look at what is happening:


The Application layer provide a set of tools and services that the Web Browser used to How the Web Browser complete can do thatit ?job

You are surfing on the Internet

You type an address of a Website


You are giving a command

Web Browser

Web Server

The Application Layer

The Application layer is the top layer of the OSI model.


Application Presentation Web Server Session

Web Browser

Transport The purpose of the Application layer is to Network manage communications between Data Link applications. Physical

Example of the Application layer:


The Application Layer

File transfer Electronic mail Terminal access Word processing Web Browser

The Presentation Layer

Lets look at what is happening:


I want that file but I OK, I will send that file to only accept it in DES MAC PC in DES format and I have aformat good to Sun encryption format in 3DES PC file now.

MAC PC
The Presentation provide set of tools for Window PC to encrypt the file in the suitable format before sending it to Mac PC and Sun PC

Windows PC

I want that file too but in 3DES encryption format

Sun PC

The Presentation Layer

The Presentation layer is the layer below the Application layer and above the Session layer.
MAC PC Windows PC

Application

The Presentation ensures that the Session information that the application layer Transport of one system sends out isNetwork readable by the application layer of Data another Link system. Physical

Presentation Sun PC

The Presentation Layer

Actions of the Presentation layer:


Examples of the Presentation layer: PICT This is picture format used by Macintosh

Format of data Data structure Data conversion Data compression Data encryption

MIDI The Musical Instrument Digital Interface is used for digitized


music.

MPEG The Moving Picture Experts Groups standard for the compression and coding of motion video for CDs. RTF Rich Text Format is a file format that lets you exchange text files
between different word processors, even in different operating systems.

The Session Layer

Lets look at what is happening:


Hey, Web Server, I want to access your web site using my Ok, I will meet you at port 80. Internet Explorer. And what about ? meet at Ok, FTP We will port 21.

Web Browser

The Session layer allows them to meet each other and make agreement.

Web Server

But how the Web Browser and Web Server can negotiate the meeting port ?

The Session Layer

The Session is below the Presentation layer. The Session layer establishes, manages, Application and terminates sessions between two Presentation Session communicating hosts.
Transport Network Data Link

Web Browser

Web Server

Physical

Actions of the Session layer: Sessions Dialog Conversations Data exchange

The session layer

Examples of the Session layer: Network File System (NFS) Developed by Sun Microsystems and used with TCP/IP and Unix workstation to allow transparent access to remote resources. AppleTalk Session Protocol (ASP) client/server

mechanism, which both establishes and maintains sessions between AppleTalk client and server machines.

The Transport Layer


TheTransport Transportlayer layercan is below the Session layer. The guarantee that packets
are received.
Application Presentation Session Transport Network Data Link Physical
Hey, Session layer, give your data to me and I guarantee that they will be given to the right destination

Application
Application Presentation Session Transport Network Data Link Physical

Presentation Session Transport Network Data Link Physical

The Transport Layer

The Transport layers segments and reassembles data into a data stream
Data Stream

Application
Data Stream

Application Presentation
Data Stream

Presentation Session Transport Network Data Link Physical

Session Transport Network Data Link Physical

Data

Data

Data

The Transport Layer

Connectionless transmission
Connection-oriented transmission The three-way handshake

Flow control
Acknowledgement Windowing

The Transport Layer

The primary function of the Transport layer is to ensure that the data packets it receives from the Session layer arrive reliably. The Transport layer does this by using two types of transmissions: connectionless and connection oriented.
The Transport layer also has the job of managing the speed of communication between devices. This is known as flow control.

The Transport Layer Connectionless transmissions


Thats The Buthe the letter OK. letter then The may letter delivered be is lost not from on important, the the way local and itPost is left never just Office a Lets So Harry look want goes at to what the send happens: local mail Post to Wilson Office and the friendly through come to letter. the the Post destination. Office system arrive at the letter there
Destination Post Office then delivered to Wilson

Post Office system


Harry
Local Post Office

Destination Post Office

Wilson

The Transport Layer Connectionless transmissions (cont)


second reason is way, that its OK if there is a good The Working in the same with connectionless The advantage of connectionless transmission using and reliable connection between the source and the connectionless The first packets may lost on the (internet). But The reason is be thats the data is not important transmission using connectionless protocol, when protocol is that it way is very fast.

destination (lease line) thats Host AOK. want to send data to Host B, it only put the packet onto the network and hope that it will be arrive at the destination.
Post Office system
Destination Post Office

Harry

Local Post Office

Wilson

Internet
Host A
Local Router Destination Router
Host B

The Transport Layer Connectionless transmissions (cont)

User Datagram Protocol (UDP) is an example of connectionless protocol Applications that use UDP to send their data information is DNS, TFTP.

The Transport Layer Connection-oriented transmissions

When Harry receive an acknowledge phone from He The then letter goes then to sent the and Local when Post Wilson Office and receives send the the But Lets Harry this look want time, atto what it send is happens: an mail important to Wilson business again. letter. Wilson, he is Wilson now the letter. letter and a certified see thatstop form. it phone is worrying an Itimportant means business Post letter, So hein want him about tothat acknowledge Office so he then guarantee phone the Harry letter to letter. will acknowledge arrive at the (bo cho right bit) when Wilson receive the

destination. that he had received the letter.

Post Office system


Harry
Local Post Office

Destination Post Office

Wilson

Connection-oriented transmissions
(cont)

The Transport Layer

Because The But after advantage Host waiting Asame of and for connection-oriented Host a predefined B both use time, connectiontransmission Host A does When Working Host in the A receive way, an acknowledgement with connection-oriented packet, it oriented using not receive connection-oriented protocol an acknowledgement to send and protocol receive packet is that packets. from it is Host So then transmission stop worrying using connection-oriented about the packet. protocol, when reliable B, Host Host although A will B resend it to has packet the higher packet from latency and A, it wait. than will The A receive want send data to Host B, send it putan the acknowledge connectionless processonto happens packet protocol. until toHost specify A wait receive that it an has received. packet the network and for the destination acknowledgement from Host B. to acknowledge of packet receiving packet.
Post Office system

Harry

Local Post Office

Destination Post Office

Wilson

Internet
Host A
Local Router Destination Router
Host B

The Transport Layer Connectionless transmissions (cont)

Transmission Control Protocol (TCP) is an example of connection-oriented protocol

Applications that use TCP to send their data information is DNS, FTP, HTTP, SMTP,

The Transport Layer the three-way handshake

In connection-oriented transmission, both the sender and receiver have to join to the session. The receiver must know that the sender is sending packets in order to answer (acknowledgment)
So, the sender must first establish a connectionoriented session with the receiver, which is called a call setup, or three-way handshake

The Transport Layer the three-way handshake (cont)

In the three-way handshake process, when from Host Host A Blook after (receiver) receives after the examine synchronize the synchronize segment Lets at what happens:

A (sender) want to establish with Host B to Host packet B, from it will Host send A, an if acknowledgement agree,aitsession will send segment (receiver), it first send to receiver a to Host A. acknowledgement synchronize segment Host B to acknowledge tothe connection. synchronize segment.
Synchronize (Can I talk to you ?) Connection Established Ack (Yes), Synchronize ( Can I talk to you ?)

TCP

TCP Receiver Host B

Sender Host A

Data Transfer (send segments) Ack (Yes)

The Transport layer Flow Control

Once data transfer is in progress, congestion can occur for two reasons.

The Transport layer Flow Control (cont)

First, the sending device might be able to generate traffic faster than the network can transfer it.

ta da ta da ta da ta da ta da ta da ta da ta da ta da
data data data data data data

The Transport layer Flow Control (cont)

The second reason is that multiple devices need to send data to the same destination.
ta da
ta da

ta da ta da ta da ta da ta da

ta da

ta da ta da
ta da ta da

ta da

The Transport layer Flow Control (cont)

When datagram arrive too quickly for a device to process, it temporarily stores them in memory.
ta da

ta da
ta da
ta da ta da ta da ta da

ta da

ta da

ta da

da t

da t

ta da

The Transport layer Flow Control (cont)

If the datagrams are part of a small burst, this buffering solves the problem.
ta da

ta da
ta da
ta da ta da ta da ta da

ta da

ta da

ta da

da t

da t

ta da

The Transport layer Flow Control (cont)

However, if the traffic continues at this rate, the device eventually exhausts its memory and must discard additional datagrams that arrive.
So, the data will be lost ?
ta da

ta da

ta da

ta da

ta da
ta da
ta da ta da

ta da ta da

ta da
ta da

ta da ta da
ta da ta da

ta da ta da

ta da ta da

da t

a
a

da t

ta da

da ta

da ta

da t

da t

The Transport layer Flow Control (cont)

Instead of losing the data, the transport function can issue a not ready indicator to the sender.

ta da

ta da

ta da
ta da
ta da ta da

ta da ta da

ta da
ta da

ta da ta da
ta da ta da

ta da ta da

ta da ta da

da t

a
a

da ta

da t

p s to

da t

ta da

da t

rt po s n Tra

da ta

The Transport layer Flow Control (cont)

This acts like a stop sign and signal the sender to discontinue sending segment traffic to the receiver.

Stop

da t a

a
da t a

da ta

da t

p s to

da t

rt po s n Tra

da ta

The Transport layer Flow Control (cont)

After the receiving device has processed sufficient segments to free space in its buffer, the receiver sends a ready transport indicator which is like a go signal.

Go

da t

a
da t a

da ta

da t

go ort sp n Tra

da ta

da t

The Transport layer Flow Control (cont)

When they receives this indicator, the senders can resume segment transmission.
ta da

ta da
ta da

ta da
ta da

ta da

ta da

go rt po s n Tra

ta da

The Transport Layer Acknowledgement

The transport layer provide a reliable service regardless of the quality of the underlying network

ort p ns a r T

The Transport Layer Acknowledgement (cont)

One technique that is used to guarantee reliable delivery is called positive acknowledgement (Thng bo xc thc) with retransmission. This requires the receiver to issue an acknowledgement message to the sender when it receivers data.

ta da

ta da

The Transport Layer Acknowledgement (cont)

The sender also start a timer when it sent a packet.


If the timer expires before an acknowledgement is received, it retransmits the packet.

ta da

The Transport Layer Windowing

Acknowledging every data segment, however, has its drawback (iu tr ngi).
If the sender has to wait for an acknowledgement of each data segment, the throughput will be very low.

ta da

ta da

A technique called Windowing is used to increase the throughput.

The Transport Layer Windowing (cont)

The quantity of data segments (measured in bytes) that the transmitting machine is allowed to send without receiving an acknowledgment for them is called a window. the size of the window controls how much information is transferred from one end to the other
TCP

TCP

You and I will use window I agree size of 1 ?


Sender Receiver

Send 1 Send 2

Receive 1 Ack 2 Receive 2 Ack 3

The Transport Layer Windowing (cont)

Now lets examine an example with windows size of 3.


TCP TCP

You and I will use window I agree size of 3 ?


Sender Receiver

Send 1 Send 2 Send 3

Receive 1 Receive 2 Receive 3 Ack 4

Send 4 Send 5 Send 6 Connection lost !!!

Receive 4 Receive 6 Ack 5

Send 5

Receive 5 Ack 7

The Network Layer

Lets look at what is happening:


Packet with Destination IP address of 172.16.1.1

172.16.1.1 is in network attached to E2. So

E0 192.168.1.1
It is because router is a Network layer device and the Network The Network layer also layer provide a set a of tools for router provides mechanism for to collect about router informations to route packet to 172.16.1.1 host.

E1 10.0.0.1 But how router know that the 172.16.1.1 host is in the network attached to E2 interface. And how it can route the packet to the destination.

E2

172.16.1.1

The Network Layer

The Network layer, which is below the Transport layer. It is responsible for routing the packet based on its logical address. Application
E0 E1 10.0.0.1
Presentation Session

192.168.1.1

E2

Transport Network Data Link

A packet with destination IP address of 172.16.1.1

Physical

172.16.1.1

The Network Layer

Actions that the Network layer have to deal : (x l) with:


Packets Route, routing table, routing protocol Logical address Fragmentation

Examples of the Network layer protocols:


Internet Protocol (IP) Internetwork Packet Exchange (IPX)

The Data Link Layer

Lets look at what is happening:


E0 S0 Br0
Frame Relay

This is a packet with a destination IP address of 10.0.0.1

Soto So Yeah, But I have the host network 10.0.0.1 re-encapsulate is attached located this packet in tonetwork S0 into is Frame a Frame attached Relay to frame. network S0.

S0

192.168.1.1

ISDN

So This packet is And my E0 is an destined for 10.0.0.1 Ethernet interface.


that is in network attached to my E0 interface.

E0

Br0

10.0.0.1
E0

ISDN router

172.16.1.1

The Data Link Layer

The Data Link layer is below the Network layer.


The Data Link layer is concerned with physical addressing.
Application

The Data Link layer provides the physical Session transmission of the data. Transport
MAC address 00-06-7B-02-EF-05
Network Data Link Physical

Presentation

The Data Link Layer

The Data Link layer is made up of 2 sublayers:


The Logical Link Control (LLC) sublayer. The Media Access Control (MAC) sublayer

Application Presentation Session Transport Network Data Link Physical


Logical Link Control (LLC) Media Access Control (MAC)

Logical Link Control (LLC) sublayer

The Data Link Layer

Logical Link Control (LLC) sublayer is responsible for identifying Network layer protocols and then encapsulating into frame

Application Presentation Session Transport Network Data Link Physical

But If the if the Network Network layer layer give give me me an IP an IPX packet, packet, I will I will encapsulate encapsulate it into it into a frame frame like like this

Logical Link Control (LLC) Media Access Control (MAC)

Media Access Control (MAC) sublayer

The Data Link Layer

Media Access Control (MAC) sublayer defines how packets are placed on the media.
If the network interface card (NIC) has RJ45 port and connected to crossover cable. I will transfer But if the network interface frame on pin 2 and receive frame card (NIC) has BNC port, I will on pin 3 transfer frame in another way.
Logical Link Control (LLC) Media Access Control (MAC)

Application Presentation Session Transport Network Data Link Physical

Transmission of an unstructured bit stream over a physical link between end systems.

The physical layer

Electrical, mechanical, procedural and functional specifications Physical data rate Distances Physical connector

The physical layer

For Example:
UTP, STP, coaxial, Fiber cable RJ45, RJ11 connector DB9, DB25 connector 10base2, 10base5, 100baseT, 1000baseTx

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