flow control

Download Report

Transcript flow control

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 ?

Let’s look at what happen:
Oh my
God,
what
Hi, What is
did name
he say
your
?
?
Xin chào,
bạn tên là gì
vậy ?
Không biết
thằng này
đang nói
cái gì nữa
?
They do not understand each other
because they are using different
languages.
What are Protocols ? (cont)

Now, Let’s look at what happens next:
my name is
My name
is Hi, to
Hi, What
is
Nice
meet
Gary,
and what is
yourHarry,
name ?nice to
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
Windows
PC running
IP protocol
IPX
Windows
PC running
IPX
protocol
IPX
Netware PC
running IPX
protocol
IPX
Netware 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
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.(Mô hình OSI ó thể trả
lời những câu hỏi đặt ra)
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
Data Stream
DataStream
Stream
Data
Presentation
Application
Data
DataStream
Stream
Data Stream
This
is called
Data
Stream
Session
Data Stream
Presentation
Data Stream
Data
Stream
Session
segment
This one is
Data Data
Stream
Data
Data
called
Data
Transport
Data Stream
Data
Data
Data
Data Stream
Transport
packet
Data
IP Header
Network
1
Data
IP
IP Header
Header Data
This one is
called
11
IP Header Data
1
Frame Header IP Header Data
1
Data
Network
frame
Data Link
Physical
Data 11
Frame Header
Header IP
Frame
IPHeader
Header Data
II
I
IP Header Data
Data Link
Physical
1
The Application Layer
The Website is delivered to you…

Let’s look at what is happening:
You are surfing on the Internet…
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 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
Web Browser
Presentation
Web Server
Session

Transport
The purpose of the Application
layer is to
Network
manage communications between
Data Link
applications.
Physical
The Application Layer

Example of the Application layer:





File transfer
Electronic mail
Terminal access
Word processing
Web Browser
The Presentation Layer

Let’s look at what is happening:
I want
that
filefile
buttoI
OK, I will
send
that
accept
it in DES
MAConly
PC in
DES format
and
I
have
a
good
format
in 3DESencryption
format to 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
Presentation
Sun
PC
The Presentation ensuresSession
that the
information that the application
layer
Transport
of one system sends out isNetwork
readable
by the application layer of Data
another
Link
system.
Physical
The Presentation Layer

Actions of the Presentation layer:






Format of data
Data structure
Data conversion
Data compression
Data encryption
Examples of the Presentation layer:
 PICT – This is picture format used by Macintosh

MIDI – The Musical Instrument Digital Interface is used for digitized
music.


MPEG – The Moving Picture Experts Group’s 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

Let’s look at what is happening:
Hey, Web Server, I want to
access your web site using my
I will meet you at port 80.
InternetOk,
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.
But how the Web
Browser and Web Server
can negotiate the
meeting port ?
Web Server
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
Physical
Web Server
The session layer


Actions of the Session layer:
 Sessions
 Dialog
 Conversations
 Data exchange
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
Application
Presentation
Session
Transport
Application
Hey, Session layer, give
your data to me and I
guarantee that they will
be given to the right
destination
Presentation
Session
Transport
Presentation
Session
Transport
Network
Network
Network
Data Link
Data Link
Data Link
Physical
Physical
Physical
The Transport Layer

The Transport layers segments and reassembles data
into a data stream
Data Stream
Application
Application
Data Stream
Presentation
Session
Transport
Presentation
Data Stream
Data
Data
Data
Session
Transport
Network
Network
Data Link
Data Link
Physical
Physical
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

That’s
The
Buthe
the
letter
OK.
letter
then
The
may
letter
delivered
be
is
lost
not
from
on
the
theway
local
and
itPost
isleft
never
just
Office
a
Let’s
So
Harry
look
want
goes
at
to
what
the
send
happens:
local
mail
Post
toimportant,
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)
 The
second
reason
is way,
that it’s
OKconnectionless
iftransmission
there is a good
Working
in the
same
with
 The
advantage
of connectionless
using
and
reliable
connection
between
the
source
and
the
The first
packets
may
lostisthe
on
theit way
(internet).
But
 connectionless
The
reason
is be
that’s
data
not
important
transmission
using
connectionless
protocol
that
isisprotocol,
very
fast.when
destination
line)
that’sAOK.
Host
want(lease
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
Harry
Local
Post Office
Destination
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
toitsend
sent
the
and
Local
when
Post
Wilson
Office
and
receives
send
the
the
But
Let’s
Harry
this
look
want
time,
atto
what
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
anItimportant
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
(báo cho
right
biết)
when
Wilson
receive
the
destination.
that he had received the letter.
Post Office
system
Harry
Local
Post Office
Destination
Post Office
Wilson
The Transport Layer
Connection-oriented transmissions
(cont)


Because
The
But after
advantage
Host
waiting
Asame
of
and
for
connection-oriented
Host
away,
predefined
Bwith
bothconnection-oriented
use
time,
connectiontransmission
Hostpacket,
A doesit
When
Working
Host
in
the
A receive
an
acknowledgement
oriented
using
not receive
connection-oriented
protocol
anusing
acknowledgement
toconnection-oriented
send and
protocol
receive
packet
is that
packets.
from
it is Host
So
then
transmission
stop
worrying
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,Host
itwait.
than
will
The
A receive
want
send
data
to
B, send
it putan
the
acknowledge
connectionless
processonto
happens
packet
protocol.
untiltoHost
specify
A wait
receive
thatfor
it an
has
received.
packet
the
network
and
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
theA
three-way
handshake
process,
when from
Host
Host
Blook
after
(receiver)
receives
after
the
examine
synchronize
the
synchronize
segment
Let’s
at
what
happens:
A
(sender)
want
toA,an
establish
with
Host B to
Host
packet
B, from
it will
Host
send
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.
TCP
Synchronize (Can I talk to you ?)
Connection Established
TCP
Ack (Yes), Synchronize ( Can I talk to you ?)
Sender
Host A
Data Transfer
(send
segments)
Ack (Yes)
Receiver
Host B
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
a
da
t
a
ta
da
ta
da
ta
da
ta
da
ta
da
da
t

ta
da
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
a
da
t
a
ta
da
ta
da
ta
da
ta
da
ta
da
da
t

ta
da
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.
ta
da
ta
da
So, the data
will be lost ?
ta
da
ta
da
ta
da
ta
da
ta
da
a
a
da
t
da
t
a
a
da
t
da
t
da
ta
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
ta

ta
da
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
a
a
da
t
da
t
a
a
p
s to
da
t
da
t
ta
da
ta
da
da
ta
ta
da
ta
da
ta
da
ta
da
ta
da
ta
da
ta
da
ta
da
rt
po
s
n
Tra
ta
da
ta
da
da
ta

ta
da
The Transport layer
Flow Control (cont)
This acts like a stop sign and signal the sender to
discontinue sending segment traffic to the receiver.
a
a
p
s to
da
t
da
ta
da
t
a
da
t
da
t
a
Stop
da
ta

rt
po
s
n
Tra
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.
a
a
go
da
t
da
ta
da
t
a
da
t
da
t
a
Go
da
ta

ort
sp
n
Tra
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 (Thông báo xác thực) 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 (điều trở ngại).
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
Receive 1
Ack 2
Send 2
Receive 2
Ack 3
The Transport Layer
Windowing (cont)

Now let’s examine an example with windows size of 3.
TCP
TCP
You and I will use window
I agree size of 3 ?
Receiver
Sender
Send 1
Receive 1
Send 2
Receive 2
Send 3
Receive 3
Ack 4
Send 4
Send 5
Send 6
Receive 4
Connection lost !!!
Receive 6
Ack 5
Send 5
Receive 5
Ack 7
The Network Layer

172.16.1.1 is in
network
attached to E2.
So……
Let’s look at what is happening:
Packet with Destination
IP address of 172.16.1.1
E0
192.168.1.1
E1
E2
It is because router is a Network
layer device
and the
Network
The Network
layer
also layer
provide
a set aofmechanism
tools for router
provides
for to
collect
about
router informations
to route packet
to
172.16.1.1 host.
172.16.1.1
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.
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
Presentation
E1
Session
192.168.1.1
E2
10.0.0.1
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
Sotonetwork
So
Yeah,
But
I have
the
host
10.0.0.1
re-encapsulate
is
attached
located
this packet
in
tonetwork
S0
intois Frame
a
Frame
attached
Relay to
frame.
network
S0.
This is a packet with a
destination IP address of
10.0.0.1

Let’s look at what is happening:
E0
S0
Frame
Relay
Br0
192.168.1.1
So
ThisE0
packet
And my
is anis
destined
for 10.0.0.1
Ethernet
interface.
ISDN
S0
E0
that is in network
attached to my E0
interface.
Br0
10.0.0.1
ISDN
router
E0
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
Presentation
MAC address
00-06-7B-02-EF-05
Network
Data Link
Physical
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)
The Data Link Layer
Logical Link Control (LLC) sublayer

Logical Link Control (LLC) sublayer is responsible
for identifying Network layer protocols and then
encapsulating into frame
Application
But
If the
if the
Network
Network
layer
layer
givegive
me me
an IP
an
IPX
packet,
packet,
I will
I will
encapsulate
encapsulate
it into
it into
a
frame
frame
like
like
this
Presentation
Session
Transport
Network
Data Link
Physical
Logical Link Control
(LLC)
Media Access Control
(MAC)
The Data Link Layer
Media Access Control (MAC) sublayer

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.
Application
Presentation
Session
Transport
Network
Data Link
Physical
Logical Link Control
(LLC)
Media Access Control
(MAC)
The physical layer

Transmission of an unstructured bit stream over
a physical link between end systems.




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
