Вы находитесь на странице: 1из 6

Internet Based Networking Practical 2 CSC734

310CSC734 Internet Based Networking


Practical 2: Layered Design

Introduction:
In the following, we are going to try to take a step back and
look at layered designs more objectively from the
perspective of one interested in seeing the strengthens and
weakness of using this particular approach to solve
problems. As a consequence, we will hopefully be able to
more appropriately use layered designs when solving
problems.

Layered Design as one way of solving problems:


The process of layered design introduced within the first lecture offers one particular
means of solving a given problem. In particular, a problem is broken up into a number of
different parts (termed layers). In the examples provided within the lecture, the layers
conceptually build upon one another which is simply to say that we can identify lower
level and higher level layers, with a particular layer offering a number of pieces of
functionality to the next layer up, i.e. think of the OSI model - Physical Layer Data
Link Layer Network Layer.

When using this approach there are typically two different but often mixed parts to
solving the problem, namely modelling the problem and then solving the problem.
Modelling a problem can be viewed as breaking the problem up into layers and defining
the functionality of each layer. Solving a problem can be viewed as showing how the
layers interact with one another to achieve the desired outcome.

Whilst it is true that the majority of computer networking problems are modelled and
solved using a layered approach, it is worthwhile asking yourself what other types of
problem can be readily and elegantly solved using a layered approach.

The above statement is telling, in that it alludes to the fact that a range of different
approaches can be used when solving problems. For a given problem, certain approaches
will be better than others (what constitutes a better approach is likewise dependent upon
the problem). Consequentially, for many problems (including some networking
problems) use of a layered approach will not offer a good problem solution.

As such, if you solve a problem using a layered design you should be able to justify your
approach in terms of why a layered design is a suitable means of tackling this problem.
Applying this further, in all the problems presented within this (and the next practical),
the key requirement of any solution you develop is that of justifiability be it in terms of
why a particular layer was selected, or why a certain item of functionality is assigned to a
particular layer, etc. thereby moving away from the notion of having one correct
solution, towards a situation where there are many possible justifiable solutions.

1
Internet Based Networking Practical 2 CSC734

As an aid towards defining suitable criteria against which a design may be scrutinised, we
will be well served if we select the same criteria as was used within the ISO OSI 7-layer
model, in particular layers should:

Represent a level of abstraction


Perform a well defined function
Minimize information flow between layers

Of course the above assumes that a layered approach represents a suitable means of
modelling and solving the problem.

In what follows a number of situations will be described, requiring that a suitable layered
design be produced (hopefully, enabling the somewhat general and abstract treatment of
layered design, outlined above, to be tied down in specific instances).

Problem 1: Layered Design of a Florist


Assume we wish to produce a layered design modelling
the operation of a florist. For our simplified situation, let
us assume customers phone in their orders for flowers
(providing details of the destination address as well as a
description of the type of flowers to be sent). The florist
assembles the order, before then passing it on to a
courier who is charged with delivering the flowers to the
final destination.

Given the above, develop a layered design to model the


process, identifying layers and justifying their selection.
You should also decide on the major items of functionality that each layer should
possess.

When you have developed your own layered design, have a look at the attached sample
solution however, do bear in mind the above comments concerning the validity of
different designs. In particular, how does your solution differ from the presented sample
solution the sample solution makes a number of simplifying assumptions (what about
your design?).

2
Internet Based Networking Practical 2 CSC734

Problem 2: Seismologist Faxing Information:


Assume an artic seismology survey is measuring tectonic plate
movement. As the Internet has yet to reach this part of the world,
in order to relay data back from the base station an engineer uses
a printer to make a hardcopy of the days seismic measurements.
This information is then faxed to the parent company, where
another engineer analyses the data and produces a one page
summary that is e-mailed to a central monitoring organisation.

Develop a layered design for this situation, again identifying


major layer functionality and providing justifications where
appropriate. When you have done this have a look at the provided example solution.

Problem 3: The Mad Professor

Dr. Hanna has unfortunately suffered from years of academic


exposure and in his old age has taken up collecting jigsaws. In
particular, he has two very old but identical puzzles which he
wishes to send to a fellow collector. However, being paranoid
he does not wish to damage any pieces of the puzzle, hence
each jigsaw piece is individually packaged (complete with
protective covering), and then posted individually to the
destination. Finally, it is very important to Dr. Hanna that pieces
from the two identical jigsaw puzzles are not mixed together.

Given the above problem, develop a layered design (including major layer functionality)
and furnish it with justifications where appropriate. I would like you to E-mail me your
model and justification of this problem at least one day before the start of the next
lecture. If you want you can make use of the skeletal answer document (available from
the web page) as a basis for constructing your reply.

Problem 4: Questions concerning Layered Design


Hopefully from reflection on the above, it should be clear that certain problems cannot be
readily modelled and solved using a layered approach. For example, the problem of how
to juggle is better solved by providing a number of steps which describe the hand
movements and ball throws which take place, i.e. by developing an algorithm (trying to
enforce layers upon this problem is unlikely to lead to a satisfactory solution).

Think of another problem where use of a layered design would not be appropriate (and
explain why it is not appropriate). For your stated problem, how do you think someone
should go about modelling and solving the problem? As with problem 3, I would like you
to E-mail me your ideas.

Dont forget about the Discussion Forums on Queens Online if youd like to ask a wider
question to the class.

3
Internet Based Networking Practical 2 CSC734

Sample Solution 1: Layered Design of a Florist


Consider the following sample layered design:

Customer Layer
Functionality: PlaceOrder( Flower Description, Destination Address )

Florist Layer
Functionality: AssembleOrder( Flower Description ) returns Flowers
SendOrder( Flowers, Destination Address )

Courier Layer
Functionality: DispatchOrder( Flowers, Destination Address )

(Road) Transport Network Layer


Functionality: GoFromPointAToPointB

Justification of Approach:
At least in terms of an initial attempt to model the problem, the use of a layered
approach appears suitable the processes apparently can be separated into a
number of distinct layers (Customer, Florist, Courier, etc.) with communication
occurring in a fixed direction (i.e. Customer -> Florist -> Courier).

Justification of Layers and Layer Functionality:


The Customer layer appears to be reasonable unproblematic, both in terms of
representing a well defined layer of abstraction, i.e. the customer, and having a
well defined function placing the initial order.
Likewise the Florist layer equally represents a well defined layer of abstraction.
Various pieces of functionality might be defined within this layer (see later),
however, here we have simply concluded a florist can assemble a particular order,
taking a description and producing a corresponding bunch of flowers.
Additionally, the florist can also forward an order on to the courier who is charged
with the actual delivery to the destination address.
The Courier layer can also be seen to represent a well defined layer of abstraction,
having one major and hence readily identifiable piece of functionality, that of the
actual delivery of a bunch of flowers (the fact that a courier will also delivery
items other than flowers is not considered here).
Finally, the Transport Network, i.e. roads, etc. is our lowest level layer. Unlike the
other layers, the Transport Network Layer was not explicitly identified within the
problem description. As such, it is arguable if this layer is strictly needed within
our solution however, it is included as the courier transports the flowers from
the source (florist shop) to the destination (recipient) over a transport network (i.e.
it is included for reasons of completeness). In terms of functionality, the transport
network permits traversal from one point to another.

4
Internet Based Networking Practical 2 CSC734

Comments/Questions on this solution:


All of the layered design examples with the lecture notes identify layer interfaces
and layer protocols. The protocols detail how two layer n processes may
communicate with one another. What about this design? Can it be said to use
protocols? What about a layered design for the other side of our model, i.e. when
the courier arrives at the destination. Certainly, the courier should arrive at the
destination; however, the flowers are then passed on to the recipient not to
another florist.
The rather simplified description of how a florist operates has left out any
mention of payment. In particular, the customer will have to pay the florist, and in
turn, the florist will have to pay for courier. What impacts would the introduction
of payment have on the sample solution? On your solution?
Consider the Florist layer. Two major items of functionality were outlined
namely assembling an order, and also passing it on to the courier. Should the
Florist layer not include a third item of functionality receiving an order from the
customer? (Yes it probably should). If it should, then why does the sample
solution not include this item? To answer my own question, I wanted to highlight
some prickly issues concerning the definition of functionality within a layer in
particular, where rests the correct balance between describing either too much or
alternatively too little functionality (we neither want to omit important pieces of
functionality, nor do we want to obscure the important pieces of functionality
within a sea of unimportant, minor pieces of functionality). Additionally, is it
more important to include layer functionality dealing with communication
between layers (e.g. SendOrder) when compared to items of functionality that do
not involve inter-layer communication (e.g. AssembleOrder)?
Aside: The majority of the questions raised above do not have one universally
correct answer, i.e. depending upon the specifics of the problem, it will be
possible to justify a particular course of action.

5
Internet Based Networking Practical 2 CSC734

Sample Solution 2: Seismologist Faxing Information:


Consider the following sample layered design:

Raw Seismic Data Collection Layer


Functionality: CollectRawSeismicData() returns Raw Seismic Data

Printing Layer
Functionality: PrintRawSeismicData( Raw Seismic Data ) returns
Hardcopy Seismic Data
Faxing Layer
Functionality: FaxSeismicData( Hardcopy Seismic Data, Destination )

Summary Report Layer


Functionality: ReceiveFaxedSeismicData
returns Hardcopy Seismic Data
ProduceSummary( Hardcopy Seismic Data )
returns 1-Page Summary Report
E-mail Report Layer
Functionality: EmailReport( 1-Page Summary Report, Destination )

Justification of Approach:
Certainly it appears that the outlined process can be very elegantly modelled using
a layered approach i.e. the process is somewhat linear in nature and involves the
transferral of information between easily identified and independent entities (as
such it is easy for us to extract and clearly define the boundaries of individual
layers).

Justification of Layers and Layer Functionality:


As mentioned above, the layers employed within the sample solution can be
readily extracted from the problem description. However, this particular solution
differs from the Florist example as it does not include layers which we can
implicitly derive given the problem description. For example, we could introduce
a Telephone Network Layer and an Internet Layer over which the fax and E-
mail would respectively travel (producing a more complete model, but at the
expense of introducing additional layers, and hence complexity). For the given
problem both approaches are equally valid.
As before, a number of equally valid choices can be made concerning layer
functionality depending upon if we wish to promote either inter- or intra- layer
functionality.

Вам также может понравиться