Worksheet: J7 | CS 2113 Software Engineering - Fall 2024

Worksheet: J7

Worksheets are self-guided activities that reinforce lectures. They are not graded for accuracy, only for completion. They are due, on github by 11:59pm on the day of the lecture.

Create a new repo using all the steps in Lab 0 called yourgitusername-worksheet-J7. Submit a file called worksheet-J7.md in your repo for this assignment.

Questions

  1. What is inside a packet?

  2. What is the purpose of an internet layer in the TCP/IP protocol? What do you, as a client, need to specify in this protocol?

  3. What is the purpose of the transport layer in the TCP/IP protocol? What do you, as a client, need to specify in this protocol?

  4. What is the difference between SMTP and HTTP?

  5. What is the difference between an IP address and a domain name?

  6. How does the operating system use ports?

  7. Write code that creates a socket connection to ip address 123.45.678.900 at port 4040. Then, print a color to that socket’s output.

  8. What is the difference between a socket’s input stream and its output stream?

  9. What is the difference between a Socket and a SocketServer?

  10. How are threads useful with servers? How does a server manage to always be listening for sockets trying to connect?