Data communication Part 1-Computer Networks-Lab Assignment, Exercises of Computer Networks

This lab assignment was submitted to Sir Nauman Shamim at Pakistan Institute of Engineering and Applied Sciences, Islamabad (PIEAS) for Computer Networks course. It includes: Data, Communication, Application, Layer, Processing, Communication, Input, Pass, Display

Typology: Exercises

2011/2012

Uploaded on 07/08/2012

nademm
nademm 🇵🇰

5

(2)

4 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
DataCommunicationLab01
Date:3/9/2010
Aboutthislab
Theobjectiveofthislabistounderstandtheworkingofinterlayercommunication;understandits
purposeandusefulness.Duringthislabyouwillanalyzeareallifesystem,willstructureitasamultilayer
function,andwillimplementitinC/C++orJava,youhavetosubmitareportasspecifiedattheendof
thisdocument.
Youareprovidedwithaclientserverprogramwhichsimplyconnectsaclienttoaserverandisableto
sendacharacterarrayof50bytes,wewilltrytodevelopalayeredcommunicationarchitecturewith
thehelpofthiscode,firstwewilldefineourlayersandtheirfunctionality,thenwewilldefinea
problemandasolution,afterdoingthatwewilldistributeitsfunctionalityovermultiplelayer.
Layers
a. ApplicationLayer.
b. Processing
c. CommunicationLayer
(Wehavediscussedtheworkingoftheselayersalready)
HelloProblem
Usersendsahellomessageandserverdisplaysit,forourinterlayercommunicationwecallhello
messageasourpackettobesent,applicationlayerwillreceiveinputfromuser,processinglayerwilladd
extrainformationonitifrequiredsuchassendersname,communicationlayerdetermineshowtotake
messagetotheserver(socket).Theoveralltaskisdividedinfollowingpieces
Applicationlayer
Inputfromuser
Inputfromprocessinglayer
Passtodisplay
Passtoprocessinglayer
Processinglayer
Inputfromprocessinglayer
Inputfromcommunicationlayer
Passtoapplicationlayer
Passtocommunicationlayer
Communicationlayer
Inputfromprocessinglayer
Inputfromprocessingnetwork
Passtoprocessinglayer
Passtonetwork
docsity.com
pf2

Partial preview of the text

Download Data communication Part 1-Computer Networks-Lab Assignment and more Exercises Computer Networks in PDF only on Docsity!

Data Communication Lab‐ 01

Date: 3/9/ About this lab The objective of this lab is to understand the working of inter layer communication; understand its purpose and usefulness. During this lab you will analyze a real life system, will structure it as a multilayer function, and will implement it in C/C++ or Java, you have to submit a report as specified at the end of this document. You are provided with a client server program which simply connects a client to a server and is able to send a character array of 50 bytes, we will try to develop a layered communication architecture with the help of this code, first we will define our layers and their functionality , then we will define a problem and a solution, after doing that we will distribute its functionality over multiple layer. Layers a. Application Layer. b. Processing c. Communication Layer (We have discussed the working of these layers already) Hello Problem User sends a hello message and server displays it, for our interlayer communication we call hello message as our packet to be sent, application layer will receive input from user, processing layer will add extra information on it if required such as senders name, communication layer determines how to take message to the server (socket). The overall task is divided in following pieces Application layer

  • Input from user
  • Input from processing layer
  • Pass to display
  • Pass to processing layer Processing layer
  • Input from processing layer
  • Input from communication layer
  • Pass to application layer
  • Pass to communication layer Communication layer
  • Input from processing layer
  • Input from processing network
  • Pass to processing layer
  • Pass to network

docsity.com

Each layer has at least two service primitives, we define them as Layer_primitive(parameter), application layer primitives are app_send(char data[], int length, Address) app_recive(char data[],int length,Address) Task‐ 1 Define complete service primitives for all layers in c/c++, try to send hello message using these primitives, at this point implement it as one way communication i.e. client will send and server will receive. Taks‐ 2 Extend task one and define hellox message where x=1,2,3,4. .. , each hellox message will have a meaning that you should also define, both client and server should know these messages, in this scenario , client will send only hello1 or hello2 or hellox message and server will display the message corresponding to that hello message Taks‐ 3 Extend task‐ 2 and add error processing and error adding logic at the processing layer, to add error simply insert zeros in message, to make it random use rand function Task‐ 4 Select a real life communication system, like traffic system, post system, working of an office environment, working of machine, execution of a program, any distributed application e.g. web, or conceive a new system, decompose its functionality and define service primitives and pseudo code for logic each layer. Submission A report explaining the system you selected, the architecture you defined, brief explanation of the classes you defined and flow of the data from top layer in sender to the top layer in receiver. Also provide answers to the questions given below. If you have completed the lab try to answer these questions 1 ‐ Was the system already working in layers? If your answer is yes don’t answer the next question 2 ‐ Is there any gain in terms of cost , complexity, efficiency , flexibility or dependency of the system if its functionality is multilayered (explain briefly) 3 ‐ Can there be more than one service primitives? 4 ‐ Can layered architecture wok for multiple job requests from different clients at the same time, (parallelism) 5 ‐ Your comments regarding this lab exercise?

docsity.com