Pages

Wednesday, February 5, 2014

Lab2

Question 3A


Propagation Delay = Length/C

Length = 36000m       C = 299792458 m/s


D=360002997924580.00012s0.12ms
           
(M = Message Length) (R= Transmission Speed)
Transmission delay = M/R


Transmission delay=102208110984ms


Latency = Transmission delay + Propagation delay

Latency = 0.12+84=84.12ms


Final Answer= 84.12ms


  

Question 3B


Propagation Delay = Length/C          Length = 2m
C = 299792458 m/s


D=22997924586.6710-6ms


Transmission Delay = M/R

Transmission delay=102208108.4109ms


Latency = Transmission delay + Propagation delay
Latency = 6.6710-6+8.4109

=8.4109ms


4)         We use Pipes to connect the flow of data from one process to another. These functions are needed to be able to implement the IPC using pipes. Those needed for communication using shared memory are as follows:

popen() – This begins another to send/receive data
pclose() – This ends the file stream that was opened
shmget() –  This allows us to accesses memory that is shared
shmctl() – This alters characteristics and permissions of a shared memory
shmat() –  This connects memory portions
shmdt() – This breaks memory portions


5)         We use Fread() and Fwrite() for reading and writing in binary mode. The main function of Fread() is that it uses memory that is saved in that space to a single unit type of data in which you will be reading in that location. The function of Fwrite () is that it copies the number of units in the first parameter that locates all the memory. Examples of both are listed below.

fread function :

size_p fread(void *ptr, size_p size, size_p nmemb, FILE *stream);

fwrite function :

size_p fwrite(const void *ptr, size_p size, size_p nmemb, FILE *stream);


1 comment:

  1. need to write the program for fread and fwrite! Just take one of your C++ ones and change fin and fout to fread and fwrite

    ReplyDelete

Note: Only a member of this blog may post a comment.