Homework 5 - Communication, networking, and distributed systems
Due 10/22/21 at 11am
Reminder: lab 5 writeup due at the same time
Instructions
Submit these in slide format (ppt, pptx, or pdf) with each section on a different slide. Please do not put your name on the PDF, so that we can anonymize grading in Canvas. Number the questions/question parts. Questions in blue are optional/questions for you to think about to yourself.
You are graded on good-faith effort, not correctness. This means that you should attempt to answer every question, and if you did not reach an answer, you should describe your process and where you got stuck.
Resources
Some optional resources on interpreting terminology of interfaces, networks, and distributed systems:
Note: these resources use outdated terminology for roles of nodes in asymmetrical control. Following the lead of the Open Source Hardware Association terminology for SPI, we will use “Controller” and “Peripheral.”
Wolff, Embedded System Interfacing, Chapter 2 (O’Reilly learning access, free with Brown login)
Bran Selic, Distributed Software Design: Challenges and Solutions. Available here (Canvas login required).
Interpreting network message descriptions
In lecture, we will provide an overview of several communication protocols and standards. In this homework, you will get practice interpreting a standard often used in safety-critical embedded systems, CAN.
- (3 pts) Read pages 2-3 of this brief tutorial on CAN (also available on Canvas). Notice that the data field of a CAN frame can be 0-8 bytes long. When a receiver is processing a CAN frame, how does it know how many bytes to read? It will be helpful to refer to section 3 (page 3) of the TI Introduction to the Controller Area Network (CAN) (also available on Canvas).
Error detection and prevention
(4 pts) CAN uses “bit stuffing” as one of its error prevention mechanisms. This means that, when generating a frame, the sender inserts an opposite bit after five consecutive bits of the same value (for example, the message
1000 0001
would turn into1000 0010 1
, with spaces added for readability). Why do you think this is done (i.e. what failure mode is bit stuffing trying to prevent)?(3 pts) What other error detection/prevention mechanism does CAN have? Describe how it works at a very high level (1-2 sentences), citing sources if need be.
Arbitration
(3 pts) Assume there are three devices on a CAN network, A, B, and C. Say they all try to send a message at the same time. The arbitration fields of eachs device’s message are:
A : 0000 1110 000 B : 0000 0111 111 C : 0000 1101 111
Which device’s message will end up being sent to the other two devices? Why?