You are on page 1of 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 he say your name ? ?
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 is Hi, What name is Hi, my name is Nice to meet is Gary, and what 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 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 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

Data Stream Data Stream

Data Stream Data Stream

Data Stream Presentation

Data Stream Session

Data Stream This is called

Data Stream

Data Stream Session

segment
This one is Data Stream Data called Data Data

Transport

Data

Data Data Data StreamData

Data Stream

Transport

packet
IP Header Data IP This one is Header Data called 1 1

IP Header Data Network

IP Header Data

Network

Data

frame
Data Link
Frame Header IP Header Data 1 Frame Header IP Header Data 1 I I Frame Header IP Header Data 1 I 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 3DES format to format a good in have encryption Sun 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 Link another 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 FTP will meet at Ok, We ? 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


The Transport layer is guarantee that packets The Transport layer canbelow the Session layer.
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 want may local Post Office itPost Office The letter then letter mailfrom the local is just a But look The send lost on delivered important, Letsthe letterwhat beis notto Wilson and left the So he OK.at to the happens: the way and never Harry goes friendly the Post Office system arrive at the through the destination. come there letter toletter.
Destination Post Office then delivered to Wilson

Post Office system


Harry
Local Post Office

Destination Post Office

Wilson

The Transport Layer Connectionless transmissions (cont)


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

destination (lease line) thats want Host AOK. 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 Local Post Office receives He letter atto sent and when Wilson and send the The want Butthen time,tosendan acknowledge again. the Harrylook then it thean important business letter. Letsthis goes what happens:Wilson phone from is mail to Wilson, a is Wilson phonemeans that letter and seenow form. Itimportant business letter, Post So hein hecertifiedstop worrying about the letter. want that it is an him to acknowledge Office guarantee Harry to will arrive at the cho bit) so he Wilson receive the acknowledge (bo right when then phonethe letter letter.

destination. received the letter. that he had

Post Office system


Harry
Local Post Office

Destination Post Office

Wilson

Connection-oriented transmissions
(cont)

The Transport Layer

Because in A receive a predefined time,transmission The after waiting connection-oriented Host A does But advantage and an acknowledgement packet, When Host the sameHost B both use connection- it Working Host Aoffor way, with connection-oriented oriented protocol toabout and packet. that it is Host usingstop worrying connection-oriented from So not connection-oriented protocol is thenreceive an acknowledgement packetprotocol, transmission using send the receive packets. when Host B receive packet fromand it thansend an reliable although it to the packet to Host B, The the B, Host A will want has higher latency will it put A resend send data A, wait. acknowledge packet toHost A wait for an destination connectionless protocol. and receive has received. process happens until specify that it the packet onto the network acknowledgement receiving packet. to acknowledge of packet from Host B.
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 the synchronize Host B after receives happens: (receiver) after examine process, when Host LetsAlook at whatthe synchronize segment from

A (sender) want to an acknowledgement segment to Host B, from Host A, if agree,aitsession with Host B packet it will send establish will send (receiver),acknowledgeto the receiver a to Host A. acknowledgement synchronize segment Host B to it first send to 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(Yes) Ack segments)

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

ort sp 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

ort sp 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 rt po ns 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 ort sp n Tra

ta da

The Transport Layer Acknowledgement

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

rt po s ran 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 size of 1 ? I agree


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 size of 3 ? I agree


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 layer The Network layer also provide a set a mechanism for to provides of tools for router collect informations about router 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

So So But theto10.0.0.1 is Yeah, hostnetwork I have re-encapsulate attached in network located to S0 is Frame this packet into a Frame Relay to S0. attached frame. network

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 Network layer give me IP If the Network layer give me an an IPX packet, I will encapsulateinto a packet, I will encapsulate it it into frame like this frame like

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

You might also like