Portfolio Reflection Questions
Make a copy of this document in your Portfolio Assignments folder and answer these questions in the spaces below. Once complete, turn in this assignment according to the steps given by your teacher.
6.4 IP Addresses and Domain Names Curriculum Page
Answer the following questions:
Trial #
Number of Messages Received
Message Received
1
1
hello
1
2
yo
2
3
Whats up
2
4
oi
3
5
What's good
3
6
jajaja
This design could lead to messages being lost when both senders send at the same time because the TinyWebDB is only designed to receive and store one message at a time. Every 3 seconds, the DB tests for new messages, so if two are sent to the same recipient within those three seconds then only the second one is stored. For instance, if both sender one and two send a message within 3 seconds but the second sender sends theirs second, then only the second message is recorded.
A list variable would me more appropriate to store the recipients messages because rather than just storing one string at a time, it could store all of the messages that the user has sent and save them in a list. This is a good alternative to storing just one message at a time.
Insert_at_end_of_list(msg)
Insert_at_front_of_list(msg)
Remove_msg_at_end_of_list
Remove_msg_at_front_of_list
mailbox ← empty list
Repeat every 3 seconds
{
Repeat until mailbox is empty list
{
Remove_msg_at_end_of_list
}
}
recipient's mailbox ← Insert_at_front_of_list(msg)( "sender1:7.13:hello")
2. Include a screenshot of your message log in the DNS Simulation app in Activity 1.
(POGIL) Discuss why and how a list variable would be a better choice for storing the recipient’s multiple messages in the DNS simulation app.
Answer
A list variable would me more appropriate to store the recipients messages because rather than just storing one string at a time, it could store all of the messages that the user has sent and save them in a list. This is a good alternative to storing just one message at a time.
3. (POGIL) Include the pseudocode algorithms you developed for the sender and receiver to handle multiple messages to a recipient.
Answer
mailbox ← empty list
Repeat every 3 seconds
{
Repeat until mailbox is empty list
{
Remove_msg_at_end_of_list
}
}
recipient's mailbox ← Insert_at_front_of_list(msg)( "sender1:7.13:hello")
Trial #
Number of Messages Received
Message Received
1
1
hello
1
2
yo
2
3
Whats up
2
4
oi
3
5
What's good
3
6
jajaja
This design could lead to messages being lost when both senders send at the same time because the TinyWebDB is only designed to receive and store one message at a time. Every 3 seconds, the DB tests for new messages, so if two are sent to the same recipient within those three seconds then only the second one is stored. For instance, if both sender one and two send a message within 3 seconds but the second sender sends theirs second, then only the second message is recorded.