Sunteți pe pagina 1din 68

Computer Networks and Security

ECE-3251

Network Model(OSI)
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
Xin chào,
did name
your he say?
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
Hi, What is is Hi, to
Nice
my name is
meet
yourHarry, Gary,
name ?nice to and what is
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
Windows
running IPX
PC running
protocol
IP protocol

IPX IPX

Netware PC
Windows running IPX
PC running protocol
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
Systems 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.
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 Data Stream
Application Application

Data Stream DataStream


Data Stream Data
DataStream
Stream Data Stream
Presentation Presentation

Data Stream Data Stream


Data Stream
Session Data Stream Session
This is called
segment

Data This one is Data Stream


Data Data Data
Data Stream
Transport Data Data
Data Stream
Data Transport
called
packet

IP Header 1 This one is


IP
IP Header
Header Data
Data 11 IP Header Data 1
Data
Data
Network Network
called
frame

Frame Header
Frame Header IP
IPHeader Data 11
Header Data II IP Header Data 1
Data Link Frame Header IP Header Data 1 I Data Link

Physical Physical
The Application Layer
 Doesn’t mean that it has computer
applications, rather it contains protocols
for using network applications like google
chrome, firefox, skype etc.
The Application Layer
The Website is delivered to you…
 Let’s look at what is happening:
The Application layer provide
a set of tools and services
that
Howthe Web
the WebBrowser
Browser used to

You are surfing on the Internet… complete


can do thatit?job

You type an address of a Website…


You are giving a
command

Web Server
Web Browser
The Application Layer

 The Application layer is the top layer of


the OSI model.
Application

Web Server
Presentation
Web Browser
Session

 The purpose of the Application layer is to


Transport

manage communications between


Network

applications. Data Link

Physical
The Application Layer
 Example of the Application layer:
 File transfer
 Electronic mail
 Web Browser
The Presentation Layer
 Let’s look at what is happening:
OK, I will send
I want that
that filefile
buttoI
MAConly accept
PC in it in DES
DES format and
I have a good
in 3DESencryption format
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


MAC PC

the Application layer and above the
Session layer.
Windows
PC
Application

Presentation
Sun PC

The Presentation ensuresSession


that the
information that the application
Transport
layer
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 conversion
 Data compression
 Data encryption

 Examples of the Presentation layer:


 PICT – This is picture format used by Macintosh

 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
InternetOk, I will meet you at port 80.
Explorer.
And what aboutOk, FTP ? meet at
We will
port 21.

Web Browser The Session layer allows Web Server


them to meet each other
and make agreement.
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

communicating hosts. Session

Transport

Network

Data Link

Physical
Web Browser Web Server
The session layer
 Actions of the Session layer:
 Sessions

 Dialog

 Conversations

 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
 The Transportlayer
layercan
is below the Session
guarantee layer.
that packets
are received.
Application
Application Application
Presentation
Presentation Hey, Session layer, give Presentation
your data to me and I
guarantee that they will Session
Session Session
be given to the right
destination Transport
Transport 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 Presentation
Data Stream
Session Session

Transport Data Data Data 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
 Let’s
So
That’s
Harry
The
Buthe
the
letter
look
OK.
want
goes
letter
at
then
The
to
what
may
the
letter
send
delivered
be
happens:
local
is
mail
lost
not
Post
from
on
toimportant,
Wilson
the
Office
theway
local
and
and
itPost
isleft
never
just
Office
the
a
friendly
through
come to
letter letter.
the
the Post
there destination.
Office system arrive at the
Destination Post Office then delivered to Wilson

Post Office
system
Local Destination
Harry Post Office Wilson
Post Office
The Transport Layer
Connectionless transmissions
(cont)
 The second
Working reason
in the same is way,
that it’s OKconnectionless
with iftransmission
there is a good
 The advantage of connectionless using
and
The reliable
The first
packets connection
may
reason
transmission
 connectionless is be
using that’sbetween
lostisthe
on data
connectionless
protocol that the
theit way source
isisprotocol,
not
very and
(internet).
important
fast.whenthe
But
destination
that’sAOK.
Host want to send data to Host B, it only put the
packet onto the network and hope that it will be
arrived at the destination.
Post Office
system
Local Destination
Harry Post Office Wilson
Post Office

Internet

Local Destination Host B


Host A
Router Router
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
 But
Let’s
Harry
When
He
The this
look
then want
lettertime,
Harryatto
goes
thenwhat
toitsend
receive is happens:
sent
the an
anmail
and important
Local to Wilson
acknowledge
when
Post business
Wilson
Office again.
phone
and letter.
from
receives
send the
the
Wilson,
letter
So hein he
and
want is Wilson
see now
thatstop
a certified is worrying
form.
it phone him about
anItimportant
means tothat the letter.
businessPost
acknowledge letter,
Office
so he then
when guarantee
Wilsonphone the
Harry
receive letter
theto letter.
will
acknowledge
arrive at thethat
right
he
destination.
had received the letter.

Post Office
system
Local Destination
Harry Post Office Wilson
Post Office
The Transport Layer
Connection-oriented transmissions
(cont)

 Because
The
But after
When advantage
Working Host
Hostwaiting
in theAsame
of
and
for
A receiveconnection-oriented
Host
away,
predefined
an Bwith
bothconnection-oriented
use
time,
acknowledgement connection-
transmission
Hostpacket,
A doesit
oriented
using
not receive
then connection-oriented
protocol
transmission
stop anusing
acknowledgement
worrying toconnection-oriented
send and
about protocol
the receive
packet
packet.is that
packets.
from
it is Host
protocol, So
when
reliable
B, HostHost
although
A will
B
A receive
resend
wantit to
haspacket
the
higher
sendpacket
from
data latency
and
toA,Host
itwait.
than
will
B, send
The
it putan
the
acknowledge
connectionless
processonto
packet happenspacket
theprotocol.
untiltoHost
network specify
andA wait
receive
thatfor
it an
has received.
the destination
acknowledgement
to acknowledge of packet from
receiving Host B.
packet.

Post Office
system
Local Destination
Harry Post Office Wilson
Post Office

Internet

Local Destination Host B


Host A
Router Router
The Transport Layer
Connection-oriented 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 connection-


oriented session with the receiver, which is
called a call setup, or three-way handshake
The Transport Layer
the three-way handshake (cont)

 Let’s
In
Host Blook
theA after at
three-way what
(receiver)
receives
afterhappens:
handshake
the
examine process,
synchronize
the when from
synchronize
segment Host
A (sender)
Host
packet
B, from want
it willHost
sendtoA,an
establish
agree,aitsession
if acknowledgement with
will send Host B to
segment
(receiver), it first send
acknowledgement
Host B to acknowledge to
tothe
synchronize receiver
segment
connection. a to Host A.
synchronize segment.

Synchronize (Can I talk to you ?)


TCP Connection Established TCP
Ask (Yes), Synchronize ( Can I talk to you ?)
Sender Receiver
Data Transfer
Host A (send segments)
Ack (Yes)
Host B
The Transport layer
Flow Control
 Suppose Server can transmit data
maximum at 100 mbps, and mobile can
process it at 10 mbps.
 So if server send data at a rate more than
10 mbps, mobile can tell the server with
the help of transport layer to send the
data within a rate of 10 mbps.
The Transport layer
Flow Control
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 ta data data
da da
ta ta data data
da da
ta data data
da
ta
da
ta
da
ta
da
The Transport layer
Flow Control (cont)
 The second reason is that multiple devices need to
send data to the same destination.

ta
da

da
ta

da
ta
ta
da
ta
da
ta
da

da
ta
da
ta ta
da
ta
da da
ta
da
ta
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

da
ta
ta
da

ta
da
da

ta
ta

da ta
da

da
ta
ta
da ta
da
ta
da
at
da
at
da
The Transport layer
Flow Control (cont)
 If the datagrams are small in part, this buffering
solves the problem.

ta
da

da
ta
ta
da

ta
da
da

ta
ta

da ta
da

da
ta
ta
da ta
da
ta
da
at
da
at
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
So, the data
will be lost ?

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

da ta
da

ta da
da

da
ta

da
ta
ta da
ta
da
ta
da

ta da
da
ta

da
a
t

ta
da

ta
t

da
da
a
t
da

at
da
ta
da

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

da
ta
da
ta
da
ta

ta
da
ta
da
ta
da
da
ta ta
da

ta da
da
ta

ta da
ta da ta
da
ta
da

ta da
da
ta

da
at

ta
da

ta
t

da
da

t a
p
da s to
t a
da
ta
da

rt
ta

po
da

ns
Tra
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
at
da

at
da

t a p
da s to
t a
da
ta
da

rt
ta

po
da

ns
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.

Go
at
da

at
da

a
da
t
go
t a
da
ta
da

ort
ta

sp
da

n
Tra
The Transport layer
Flow Control (cont)
 When they receives this indicator, the senders can
resume segment transmission.

ta
da

da
ta
ta
da
ta
da

ta
da

da
ta
ta
da

ta
da
go

rt
s po
n
Tra
The Transport Layer
Acknowledgement
 The transport layer provide a reliable service regardless
of the quality of the underlying network

port
r a ns
T
The Transport Layer
Acknowledgement (cont)
 One technique that is used to guarantee reliable delivery
is called positive acknowledgement with retransmission.

 This requires the receiver to issue an acknowledgement


message to the sender when it receives 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.
 If the sender has to wait for an acknowledgement of
each data segment, the throughput will be very low.

ta
da A technique called
ta Windowing is used to
da
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 ?
Sender Receiver
Send 1 Receive 1
Send 2 Receive 2
Send 3 Receive 3
Ack 4

Send 4 Receive 4
Send 5 Connection lost !!!
Send 6 Receive 6
Ack 5

Send 5 Receive 5
The Transport Layer
Windowing (cont)
 Windowing controls the flow of data.
 Windows are sized in bytes.
 Window full = wait for acknowledgement.
 Acknowledgement tells what is expected
to receive next. (i.e receive 3, ack 4;see
previous slide)
 Window size is dynamic.
The Network Layer
172.16.1.1 is in
network
 Let’s look at what is happening:
Packet with Destination
IP address of 172.16.1.1 attached to E2.
So……
E0 E1

192.168.1.1 10.0.0.1
E2 But how router know that the
172.16.1.1 host is in the network
It is because router is a Network
attached to E2 interface. And how
layer device and the
The Network Network
layer also layer it can route the packet to the
provide a set aofmechanism
provides tools for router
for to destination.
collect
router informations about
to route packet to
172.16.1.1 host.

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
Presentation
E0 E1
Session

192.168.1.1 10.0.0.1 Transport


E2
Network

Data Link
A packet with destination
IP address of 172.16.1.1 Physical

172.16.1.1
The Network Layer
Path Determination:
 A computer can connect
with another computer or
server in a number of
ways. Choosing the best
possible path for data
delivery from source to
destination is called path
destination.
 For example, OSPF, IS-IS,
BGP protocols.
The Network Layer
 Actions that the Network layer have to deal
with:
 Packets
 Route, routing table, routing protocol
 Logical address
 Path determination

 Examples of the Network layer protocols:


 Internet Protocol (IP)
 Internetwork Packet Exchange (IPX)
The Data Link Layer
This is a packet with a So
Yeah,
But Sotonetwork
I have
the
host 10.0.0.1
re-encapsulate
is
destination IP address of
10.0.0.1
attached
located
this packet
in
tonetwork
S0
intois Frame
a
 Let’s look at what is happening: Frameattached
Relay tonetwork
frame.
S0.

E0 S0
Frame S0
Br0 Relay
192.168.1.1
E0
So
And my
ThisE0 is anis
packet
ISDN destined
Ethernet for 10.0.0.1
interface.
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
 Frame Relay:
 Frame Relay is a wide area network technology which is
used to specify the physical and data link layers of digital
telecommunications channels.
 It is usually implemented by network providers as a
voice and data encapsulation technique that is used
between LANs (Local Area Networks) and WANs (Wide
Area Networks).
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


Presentation

Session
transmission of the data. Transport

Network
MAC address
Data Link
00-06-7B-02-EF-05
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 Logical Link Control


(LLC)
Data Link
Media Access Control
Physical (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
But
If the
if the
Network
Networklayer layer
givegive
me me an IP
an
IPX
packet,
packet,
I will
I will
encapsulate
encapsulate it into
it into
a
Application
frame
frame likelike
this
Presentation

Session

Transport

Network Logical Link Control


(LLC)
Data Link
Media Access Control
Physical (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
Application
crossover cable. I will transfer
But if the network interface
Presentation frame on pin 2 and receive frame
card (NIC) has BNC port, I will
Session on pin 3
transfer frame in another way.
Transport

Network Logical Link Control


(LLC)
Data Link
Media Access Control
Physical (MAC)
The physical layer
 Transmission of an unstructured bit stream over
a physical link between end systems.
 In this layer, bits (received from data link layer)
is converted to signals for sending over the
media(cable).
 Electrical, mechanical, procedural and functional
specifications
 Physical data rate
 Physical connector
The physical layer

 For Example:
 Coaxial cable, Fiber cable
 RJ45, RJ11 connector

 DB9, DB25 connector

 10base2, 10base5 (thinwire connector)

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