ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

CMPUT 379, Assignment

2019-02-09 19:43:45  阅读:291  来源: 互联网

标签:do processes covertsigs process Assignment messages 379 will CMPUT



CMPUT 379, Assignment 1, Winter 2019
University of Alberta / Department of Computing Science
Instructor: Ioanis Nikolaidis (nikolaidis@ualberta.ca)
(UNIX signals, timers,error detection)
Objective
During thecourse, we will study numerous forms of inter-process communication (IPC).Therearesystem utilities (like
netstat) thatallow oneto observetheIPC activity between processes.Thereexists however a form of very crudeIPC, Unix
signals, that is notexpected to be used for meaningful messageexchanges. As such, signal activity usually "flies under the
radar" of typical IPC inspection tools,and,as a result,can be used as a covert communication channel. Your assignment is to
usesignals to createa channel for communicating messages between two processes.The processes aresymmetric, i.e.,each
process sends to,and receives from, the other process.
Specification
You areasked to writea C program that produces an executablethat can send and receive messages to/from another
process.We will usetwo processes thatarerunning thesameexecutablecode. You are going to useconditional compilation
flags to allow you to createtwo versions of this program. One(the default) uses two signals (SIGUSR1 and SIGUSR2) and the
other (conditionally compiled as -DSINGLE) uses only onesignal (SIGUSR1)
When invoked the program reports its own process ID and then expects to read from standard input the process ID of the
process with which it will communicate.Subsequently,each line of input is treated as a separate message.For example:
% covertsigs
Own PID: 15310
14252
This is my first message
This is my second message
.
%
The name of theexecutableis covertsigs. Here 14252 is thefirst linetyped by the user which is the PID of the process to
communicate with.Then the messages areentered one-at-a-time. A line with a single period terminates the program (note
that it does not terminatetheexecution of the other process (14252) with which we werecommunicating).Thereceiving
process reports thereceived messages prefixing them with a ! exclamation mark symbol if it is confident it received it
correctly and with a ? question mark symbol if it has detected an error (yes it is possibleto haveerrors -- read on).For
example
% covertsigs
Own PID: 14252
15310
! This is my first message
! This is my second message
but it could have been (dueto errors in thefirst message):
% covertsigs
Own PID: 14252
15310
? ThIWE%@
! This is my second message
or any other combination that might results from errors and such.Thereason wecould havea messagein error is because,
as you will discover, thesignals are notalways reliableand also becauseit depends on how you decideto codethe messages
using signal(s).
In theinterest of readability, theexample presented above had one process sending and onereceiving. You areexpected
though to have,ateach process,a mix of messages received and messages sent. Consider for examplea session transcript
likethis:
% covertsigs
Own PID: 13333
13338
! Hi!
Hi to you too
! how's the weather
Fine
? same h3254dsg 453
Did you say "same here"
! yes
Essentially it is a two person chat channel (but generally of low speed and subject to errors).
Design Requirements
The most strict requirement is that the processes are notallowed to useany other form of communication between them
except for thespecified signals.
A performance-related requirement is thatyour throughput of delivering messages between the processes should be, on
average, 80 characters per minute or better.
Many aspects areleft under your own control.Each oneis a corresponding design decision thatyou need to explain and
report. You areexpected to report on at least thefollowing:
1. How do you code messages for the onesignal option (only SIGUSR1 used)?
2. How do you code messages for thetwo signals option (both SIGUSR1 and SIGUSR2 used)?
3. How do you represent message boundaries?
4. How do you check for errors?
5. Whaterrors may you not beableto catch?
6. How do you handletheinterleaving of input/output?
7. Is thereany other signal you had to use(and why)? -- such signal is of course notallowed for communication
8. How do you ensurethatyou do not spend unnecessary CPU cycles?
Deliverables
You should submityour assignmentas a singlecompressed archivefile(zip or tar.gz) containing:
The Makefile needed to compileyour program.The use of make and Makefile specifications will also bea requirement in
subsequentassignments.Theexecutable produced should be named covertsigs and your Makefile should at thevery
least providetargets covertsigs.single covertsigs.double and clean. Depending on whether you specified
covertsigs.single or covertsigs.double as thetarget, thecompilation will use(or not use) the -DSINGLE flag when
producing the covertsigs executable.
You must provideall of thesourcefiles needed to producetheexecutable. Remember that this must be C codeonly, using
the C99 style.
A file readme.md (plain text or Markdown markup) with your answers to the design questions. At theend of the readme.md
you must includea section describing how you balanced the work across thetwo group members. Also indicate whether
your code was tested (and running) on the official VM OR on the physical hosts in lab CSC 219.
Monday, January 7, 2019

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 

微信:codinghelp

标签:do,processes,covertsigs,process,Assignment,messages,379,will,CMPUT
来源: https://www.cnblogs.com/pythonwriter/p/10357875.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有