| Question:   | When you're communicating (sending blocks) say from layer 3 to the layer 3 on the other machine or process, is that communication direct? Or does your "message" travel down the layers when being sent, broken up into messages then bytes, and received, reconstructed, as it moves up the layer? |
| Answer:   | The only mechanism you have for sending data from layer3 is layer 2. From layer 2 the only things you can use to send data is layer 1. So, yes - the message does travel down the layers and then back up to the peer layer 3. |
| | |
| Question:   | Does the maximum size given for layer 2 packets include header bytes? |
| Answer:   | No, you should assume that layer 3 can give you a 999 byte message to deliver (you can actually send more bytes than 999 to actually deliver the layer3 stuff). |
| | |
| Question:   | Should write functions return the TOTAL number of bytes sent, or only the number of bytes sent as data, ignoring the header? |
| Answer:   | layer2 write should return the number of data bytes delivered, not the number sent to layer 1. Otherwise we would all need to agree on the exact nature of the headers sent by layer 2 (my layer 3 doesn't care how many header bytes your layer 2 code sent). |
| | |
| Question:   | I don't get what we are supposed to do about the size restriction (999 bytes for layer 2), can you explain this? |
| Answer:   | Layer 2 does not deliver more than 999 bytes of data. This means that your l2_write should return an error if asked to send a message larger than 999 bytes. There is no such restriction on layer 3 or layer 4, you should not assume that they "know" about this restriction. If layer 2 refuses to deliver a message (returns an error), then l3_write should just return an error as well. In this simplified layered system we don't have any mechanism for "finding out" what the error was, but we do know when things work right. This is not unusual with real networks (as we will see when we look at TCP/IP). The statment in the projects description that you should never put more bytes into a buffer than the size of the buffer (the reading functions need to worry about this) is not a rules specific to this set of layered functions - it's common sense. If you write a routine that accepts a buffer (an address) and the length of that buffer - you should never put more stuff in the buffer than you know it can handle. |
| | |
| Question:   | It said that we can submit up to 10 times. Is that mean each time we submit, are they gonna be grade and return to us with the grade we got? or , it means that we simply just can submit what we think is better than the older version without knowing what we got on the older one? |
| Answer:   | We grade only the last submission |
| | |
| Question:   | My checksum is a negative number, what am I doing wrong? |
| Answer:   | Your checksum may be correct. The char datatype is signed and when you print the value you are printing it as a two's compliment signed number, not as an 8 bit unsigned number like you would expect. To verify this negative number is correct, find the absolute value of that number and add the correct checksum to it. The result should equal 256. |