Transcript emc165_lec6

Network Protocols
Profs. Chuah and Kishore
EMC 165
Spring 2005
Lecture 6
Last Time/Today

We look at business trends in several related
technologies.

Today, we begin our discussion on how networks
are designed.

We begin by looking at how the design of such
complex systems is first divided into a series of
tasks that enables modular design.

This motivates protocol layering, the topic of today’s
lecture.
Protocols and Protocol Layers

Two devices exchanging information need to follow
some simple rules or protocols so that information
can be interpreted correctly.

A network protocol gives a set of rules that are to be
followed by entities (machines) situated on different
parts of a network.

These protocols can be listed in order. The resulting
order can be used to defined protocol layers.
Protocol Layers

To communicate from information from one machine
to another, data has to be prepared in a special
format.

Think of protocol layers as an assembly line.

At each layer, certain things happen to the data that
prepare it for the next layer.

To understand this concept, let’s look at 4 layer
communication between two philosophers.
Layering Example


Assume there are two philosophers, A and B.
Philosopher A is in the U.S. and B is in France.

Philosopher A has thoughts (in English) and wishes
to communicate them to philosopher B, who only
understands French. The communication link
between the two philosophers is a phone line, which
they use via a fax machine.

Clearly (given the language issues) the data (the
thought) has to be properly prepared at Philosopher
A’s office before being sent over the fax line to
Philosopher B’s office.
Layering Example

At philosopher B’s office, the information has to be
processed and conveyed to philosopher B in the
language he understands.

Assume no one in philosopher A’s office speaks
French and no one in philosopher B’s office speaks
English.

Assume that a translator and a secretary work at
each philosopher’s office.

Somehow an agreement had to have been
established between Philosopher A and B so that
they can talk to each other.
Layering Example (Cont’d)

The contents of this agreement are the protocols of
this communication link.

From these protocols, we will see that an assembly
line is constructed at both Philosopher A’s office and
Philosopher B’s office.

This assembly line will give us the protocol layers for
this type of communication between philosophers.
Philosopher-Translator-Secretary
Architecture
Location A
Dest: B
I like
rabbits
L: Dutch
Dest: B
Ik hou
Van
konijnen
Fax # -L: Dutch
Dest: B
Ik hou
Van
konijnen
Fax
Location B
Message
Information
for the remote
translator
Message
for the remote
secretary
J’aime
les
lapins
Philospher
L: Dutch
Dest: B
Ik hou
Van
konijnen
Translator
Fax # -L: Dutch
Dest: B
Ik hou
Van
konijnen
Secretary
Fax
Examining Layering Example

This communication architecture has four layers, at
each end of the communication link.

In the first layer, the philosopher generates a
thought. He/she decides this thought should be
conveyed to philosopher B (whose office may
employ several philosophers).

He/she writes this thought on paper and indicates
on it the “destination” of this message. He/she then
sends it to a translator.
Examining Layering Example (Cont’d)

In the second layer, the translator looks at the
destination of the message and realizes that the
destination office does not speak English.

The translator then determines a common language
between the two offices, Dutch.

He/she converts the philospher’s message to Dutch
and adds a header to the message indicating that it
has been converted to Dutch.
Examining Layer Example (Cont’d)

Note, the translator cares only about the conversion
of the message, not its meaning.

In the third layer, the secretary takes the message
(not caring about what language it is in or what it
means) and determines the fax number of the
destination office where philosopher B works.

He/she then faxes the message to the Philosopher
B’s office fax number.
Examining Layer Example (Cont’d)

In the fourth layer, the fax machines communicate
with each other.

They have their own “language” that carries data
from source to destination.

The source and destination points are given to this
lowest layer by the higher layers.
Example (Cont’d)

At the receiving end, reconstruction of philospher A’s
thoughts begins with the receiving fax machine (the
lowest layer).

The fax machine produces a document on which the
destination fax number has been indicated.

This document is passed up to the third layer, where
the secretary checks the correct fax number and
then looks at the language indicator in the message.
Example (Cont’d)

Based on the language, the secretary passes the
document to the correct translator (if there is more
than one working at this office).

Once the document reaches the translator, it has
passed up to the second layer at the destination.

Here, the translator looks at the message content
and the destination philosopher’s name and
determines that the message has to be translated
into French.
Example (Cont’d)

The translator translates the message into French
and then takes the document over to philosopher
B’s desk.

Finally, the document reaches the top layer at the
destination, i.e., the destination philosopher’s hands
and can be read and understood.
Protocol Layers

This type of layered conversation also happens in
computer/telecommunication networks.

Most of these networks operate on either a 4, 5 or 7
layer protocol stack.

Layer n on one host carries a “conversation” with
layer n on another host.
Rules/conventions used in this conversation are
collectively known as the layer n protocol.

Example of Information Flow in 5 Layer
Protocol Network
5
Layers
4
3
M
M
H4
H4
M
H3 H4 M1
H3 M2
2 H2 H3 H4 M1 T2 H2 H3 M2 T2
H3 H4 M1
M
H3 M2
H2 H3 H4 M1 T2 H2 H3 M2 T2
1
Source
Host
Destination
Host
Why do this?

This is an example of modular design.

Think of each layer as a module in the design of a
communication system.

Basically, communication tasks are assigned to
logically distinct modules, i.e., layers.
Why do this? (Cont’d)

Each layer performs a specific data communication
function. We will review these tasks in a bit.

Interfaces between each layer allow each layer to
communicate with the layers directly above and
below it.

Each layer may also communicate with its peer layer
on a remote computer/network device.
Why do this? (Cont’d)

By breaking up communication/computer systems
into a series of tasks, components can be designed
for each task.

As long as the components are designed to perform
their specific task and co-exist with the layer above
and below, they can be designed in any way.

In other words, how the task is implemented in the
component is entirely up to the component designer.
Why do this? (Cont’d)

This way multiple vendors can design different
components of a system and these components will
work together.

In other words, network components become
standardized and multiple vendors can be used to
develop and support a communication/computer
system.

Another benefit of layering: advances in technology
that impact one layer can be easily integrated
without impacting the design of the whole system
(other layers do not need to redesigned).
Why do this? (Cont’d)

To see this, consider how roles and responsibilities
get separated in real life – at a restaurant, one
person may cook your dinner, another one serves it,
and yet another washes dishes after you are done.

In this way, any one element can be replaced or
altered without having a huge impact on the others.

Overall, layering helps tackle the design of complex
communication/computer networks.

It also helps in learning about such systems.
How are Real Networks Layered?

The most popular model used to teach people about
network protocols is the Open Systems Interface
(OSI) Reference Model developed by the ISO.

This is a 7-layer system designed in 1970’s when
designers encountered problem of incompatible
computing components, i.e., IBM components would
not work with Digital component, etc.

Goal of ISO was to create a reference model that
would clearly define network functions and
responsibilities, ultimately allowing different
components to interconnect and communicate.
How are Real Networks Layered? (Cont’d)

Today OSI is primarily a reference model; no
practical implementation exists.

In reality most network protocol stacks tend to map
the model roughly.

Protocol stack refers to the cumulative set of
protocols that make up some n-layer model.
How are Real Networks Layered? (Cont’d)

The Department of Defense model, developed in the
1970s for DARPA, is a 4-layer protocol stack that
maps closely to current common internet protocols.
It is based on a more "pragmatic" approach to
networking than OSI. This model is called the
TCP/IP Model.

Although developed at the same time, the TCP/IP
model had more traction than the OSI model in real
implementation.

Reason: more reliable implementations of TCP/IP
were realized, TCP/IP was closely associated with
Unix making it popular in academia, etc.
OSI Protocol Stack vs TCP/IP Protocol
Stack
Layers in each stack are known by name and number:
OSI
Layer 7
TCP/IP
Application
Layer 4
Application
Layer 6
Presentation
Layer 5
Session
Layer 3
Transport (TCP, UDP)
Layer 4
Transport
Layer 2
Internet Protocol (IP)
Layer 3
Network
Layer 1
Host
to
Network
Layer 2
Data Link
Layer 1
Physical
More on Network Layering

The higher the layer number is the closer that
component is to the end user input, i.e., user
interacts with the application layer.

To remember OSI protocol stack: “All People Seem
To Need Data Processing.”

When two computers communicate on a network,
software at each layer on one computer assumes it
is communicating with the same layer on the other
computer.
More on Network Layering (Cont’d)

For example, the Transport layer of one computer
communicates with the Transport layer on the other
computer.

The Transport layer on the first computer has no
regard for how the communication actually passes
through the lower layers of the first computer, across
the physical media, and then up through the lower
layers of the second computer.
7-Layer Example: James Bond

James Bond meets Number One on the 7th floor of
the spy headquarters building. Number One gives
Bond a secret message that must get through to the
US Embassy across town. (Application Layer)

Bond proceeds to the 6th floor where the message
is translated into an intermediary language,
encrypted and miniaturized. (Presentation Layer)

Bond takes the elevator to the 5th floor where
Security checks the message to be sure it is all
there and puts some checkpoints in the message so
his counterpart at the US end can be sure he’s got
the whole message. (Session Layer)
7-Layer Example (Cont’d)

On the 4th floor, the message is analyzed to see if it
can be combined with some other small messages
that need to go to the US end. Also if the message
was very large it might be broken into several small
packages so other spies can take it and have it
reassembled on the other end. (Transport Layer)

The 3rd floor personnel check the address on the
message and determine who the addressee is and
advising Bond of the fastest route to the Embassy.
(Network Layer)
7-Layer Example (Cont’d)

On the 2nd floor the message is put into a special
courier pouch. It contains the message, the sender
and destination ID. It also warns the recipient if
other pieces are still coming. (Data Link Layer)

Bond proceeds to the 1st floor where Q has
prepared the Aston Martin for the trip to the
Embassy. (Physical Layer)
7-Layer Example (Cont’d)

Bond departs for the US Embassy with the secret
packet in hand. On the other end the process is
reversed. Bond proceeds from floor to floor where
the message is decoded.

The US Ambassador is very grateful the message
got through safely.

"Bond, please tell Number One I’ll be glad to
meet him for dinner tonight."
7-Layer Example (Cont’d)

This example was provided by Lewis Technology
(http://www.lewistech.com/rlewis/Resources/JamesB
ondOSI2.aspx).

It actually gives a fair description of the tasks
assigned to each layer of the OSI protocol stack.
OSI Protocol Stack “Humor”

The 7 layer model has often been extended in a
humorous manner, to refer to non-technical issues
or problems. A common joke is the 9 layer model,
with layers 8 and 9 being the "financial" and
"political" layers.

Network technicians will sometimes refer
euphemistically to "layer-eight problems," meaning
problems with an end user and not with the network.
“Humor” (Cont’d)

Carl Malamud, in his book "Stacks," defines layers
8, 9, and 10 as "Money", "Politics", and "Religion".

The "Religion layer" is used to describe non-rational
behavior and/or decision-making that cannot be
accounted for within the lower nine levels. (For
example, a manager who insists on migrating all
systems to a Microsoft platform "because everyone
else is doing it" is said to be operating in Layer 10.)

The OSI model has also sometimes been jokingly
called the "Taco Bell model", since the restaurant
chain has sometimes sold a 7 layer burrito.
Summary Thus Far

The tasks performed by computers/devices in a
communication network are separated into “layers.”

This layering is an example of modular design which
helps tackle the design of complex
communication/computer networks.

It leads to standardization of network components,
eases technology migration, and allows for
multivendor development and support.
Recall

Recall data passed between systems in a
communication network is referred to as a packet
(collection of bits).

Packets contain the actual data (user data) being
passed between devices as well as additional
information (header/trailer) which contains things
like source/destination address, error correction
information, etc.

As data flows down the layers of the OSI stack, the
various layers encapsulate it, usually adding header
(or possibly trailer) information to it.
Data Moving Down Protocol Stack
Message
(User Data)
Layer n
M
H4
H3 H4 M1
Layer n -1
M
H3 M2
H2 H3 H4 M1 T2 H2 H3 M2 T2
And so on
Layer n - 2
Layer n - 3
OSI Layering

So what exactly happens in each layer?

What tasks are each layer of the OSI stack
responsible for?

We look at this next.
But first,…

We stress that although we list the tasks of each
OSI layer here, the way in which these tasks are
implemented can vary.

In fact, several protocols have been developed over
the years for each layer of the protocol stack. Many
of these protocols have been standardized, i.e.,
made into consistent rules for how these tasks are
conducted.

Vendors typically develop their products to be
compatible with these standards.
Application Layer
Application Layer

The Application layer is the top layer of the OSI
model, and is considered to be the place where
users interact with the network.

This interaction usually occurs by running a
program, such as a web browser or a spreadsheet
application.

This layer doesn’t really worry about the network.
Instead, it simply knows how to make a request for
something (this is the user data), and then what to
do with the reply (the user data that was requested).
Application Layer (Cont’d)

In the case of a user browsing a website, the client
application (the web browser) makes a request that
will be understood by the receiving application at the
other end (the web server). This is sometimes
referred to as program-to-program communication.

Other typical applications: email, ftp, www, etc.

This layer also converts data into a standard format
that the other layers can understand. Other layers
will be concerned with correctly encapsulating this
standard data.
Application Layer Summary

Applications and users interact with the network at
this layer.

Common examples of application layer programs
and protocols include:




Email clients (SMTP,POP3,IMAP)
Web browsers and servers (HTTP)
File transfers (FTP)
For example, companies like google or yahoo
develop their products to be consistent with these
types of application protocols.
Presentation Layer

The Presentation layer is primarily responsible for
data representation and formatting, ensuring that
data can be viewed correctly.

These formats are sometimes referred to as the
“data syntax” of the applications in use.

For example, different systems may use different
schemes to represent data. While one system might
use ASCII or EBCIDC, another might use
UNICODE.
Presentation Layer (Cont’d)

Since these schemes contain different character
possibilities, it is the responsibility of the
Presentation layer to make sure they are displayed
in the correct or common format between the client
and the server.

The Presentation layer is also where data
compression and encryption are generally
considered to take place.

For example, encoding video in MPEG or
QuickTime, graphics into JPEG or TIFF, sound into
MIDI, etc.
Aside: What is Encoding?

We have already talked about one encoding
method: using quantization to convert an analog
signal to digital.

Quantization may not always be the most efficient
way to convert analog signals (like voice, video,
pictures, etc.) to digital.

Schemes like MPEG, JPEG, TIFF, WAV, etc. convert
analogs information into compressed digital files.

The more compressed the digital file is the quicker it
can be transported over a network.
Aside: What is Encryption?

When a digital will be transmitted over a network, it
may be desirable to encrypt it to prevent any nonauthorized party from reading or changing data.

The level of protection provided by encryption is
determined by an encryption algorithm.

Later in the semester we will discuss encryption in
greater detail.
Presentation Layer Summary

Layer responsible for data representation,
formatting, compression, and encryption.

Common presentation layer protocols include:
 ASCII, EBCIDC, UNICODE, RTF.
 MPEG, AVI
 JPG, PNG, TIFF
Session Layer

The Session layer is responsible for the creation,
management, and termination of sessions between
systems.

A session is best described as a type of managed
connection between systems for the purpose of a
specific type of communication. For example, a
session might be created for the purpose of user
authentication, or to initiate a file transfer.
Session Layer (Cont’d)

The Session layer is also responsible for
coordinating how the communication between
systems takes place, which is known as dialog
control.

In some sessions, only a single system is allowed to
communicate at any point in time, referred to as
half-duplex.

The Session layer would be responsible for
determining whose turn it is in these situations, and
for how long each system is allowed to
communicate.
Session Layer (Cont’d)

In other cases, both systems can communicate at
once, which is also known as full duplex.

If the communication stream were somehow
interrupted, the Session layer would be responsible
for recognizing this and re-establishing the session.
Session Layer Summary

Layer responsible for creation, management, and
termination of sessions between systems.

Common Session Layer protocols include:



X Windows: Remote desktop sessions
Structured Query Language (SQL): Local or
remote database queries.
Remote Procedure Call (RPC): Client-Server
communication mechanism.
Transport Layer

Transport layer has three main responsibilities:




Data segmentation;
Establishment of end-to-end connection between
hosts; and
Flow control.
We describe each of these functions in greater
detail.
Transport Layer: Data Segmentation

Transport layer divides data passed down into
segments prior to passing them down the Network
Layer.

Segmentation involves cutting up a big message
into a numbered sequence of chunks, called
segments, in which each chunk represents the
maximum data payload that the network layer can
handle between the sender and the receiver.

The network layer will use these segment to
construct packets.
Data Segmentation (Cont’d)

With segmentation comes the responsibility of
reassembly. At the receiving end, transport
protocols also deal with reordering and
reassembling segments so that it can pass the
correct data format to the session layer above.
Transport Layer: Establishing End-to-End
Reliable Connection

Transport layer’s job is to ensure reliable end-to-end
transmission of data from sender to receiver.

The Transport layer often includes end-to-end errordetection and error-recovery data.

If data is received in error, the transport layer is also
responsible for asking for retransmission.
Transport Layer: Flow Control

Flow control helps ensure that sending system does
not transmit data at rates beyond what the receiving
system can handle.

Most computers/communication devices reserve
some amount of memory space as buffer to hold
data that has been received more quickly than it can
be processed.

Once buffer space fills, system runs risk of dropping
additional data that it may receive.
Flow Control (Cont’d)

To account for this, Transport layer on receiving
machine may send status information to sender,
asking it to stop sending segments if buffer is full.

Once buffer is available, another message may be
send to reinstate the transmission.

Once again, how this flow control is achieved
depends on the specific transport protocol.
Examples of transport protocols are TCP and UDP.
Transport Layer (Cont’d)

TCP: Transmission Control Protocol is the transport
layer protocol used “on the internet.”

Actually, it is the transport protocol used to maintain
a session between two different networks. Recall:
the internet is a collection of networks.

It is possible for a session within a network, say a
computer sending files to another computer on a
local network, may use some other transport
protocol even though the network is connected to
the Internet.
Transport Layer Summary

Layer responsible for data segmentation,
establishment of end-to-end connection, and flow
control.

Common Transport Layer Protocols:


TCP
UDP (User Datagram Protocol)
References for Today’s Lecture

http://www.velsoft.com/advanced/ccna/module1.pdf

http://www.lewistech.com/rlewis/Resources/james.a
spx

http://www.velsoft.com/advanced/ccna/module1.pdf

Bertsekas and Gallagher, Data Networks.