CS475: Computer Networks - The Application Layer

Activity Goals

The goals of this activity are:
  1. To describe the functionality of application layer protocols including HTTP and SMTP
  2. To implement a multithreaded, multiplexed socket I/O application that implements an application layer protocol

Supplemental Reading

Feel free to visit these resources for supplemental background reading material.

The Activity

Directions

Consider the activity models and answer the questions provided. First reflect on these questions on your own briefly, before discussing and comparing your thoughts with your group. Appoint one member of your group to discuss your findings with the class, and the rest of the group should help that member prepare their response. Answer each question individually from the activity on the Class Activity Questions discussion board. After class, think about the questions in the reflective prompt and respond to those individually in your notebook. Report out on areas of disagreement or items for which you and your group identified alternative approaches. Write down and report out questions you encountered along the way for group discussion.

Model 1: HTTP

Http request telnet ubuntu

Questions

  1. If a web page contained an image, what would need to happen? How might this be optimized? Hint: this optimization is implemented in HTTP/1.1
  2. What information could be stored to maintain state between requests; that is, to associate a request with a particular user or session? Why isn't a stateful session mechanism built into HTTP?
  3. Look up a few HTTP response code numbers. What pattern do you see?
  4. What are some HTTP client headers and what do they do?
  5. How do you upload a file via HTTP?
  6. Since socket I/O is typically a blocking call, how can you know how much data to read from the socket so that you don't block forever waiting for data that never arrives?

Model 2: SMTP


(From Wikipedia)

Questions

  1. How does a mail client indicate to the server that they are finished sending a message? What if the sender wishes to transmit that character?
  2. How might a sender authenticate against the server?
  3. Where does the sender indicate their email address? What unfortunate consequence could result from this?
  4. How might a sender attach a file?
  5. What might you do if you were sending non-text, like an MP3 file, over a text-based protocol like this one?

Model 3: Socket Programming

Socket Programming Tutorial
Threaded Socket Programming Example

Questions

  1. Create a socket to connect to your favorite web server and make an HTTP request, printing its response to the screen.
  2. What port number does your server socket use, and what port should your client use to connect?
  3. How do we free up the primary server socket port for subsequent connections, so that they can be handled simultaneously?

Embedded Code Environment

You can try out some code examples in this embedded development environment! To share this with someone else, first have one member of your group make a small change to the file, then click "Open in Repl.it". Log into your Repl.it account (or create one if needed), and click the "Share" button at the top right. Note that some embedded Repl.it projects have multiple source files; you can see those by clicking the file icon on the left navigation bar of the embedded code frame. Share the link that opens up with your group members. Remember only to do this for partner/group activities!

Model 4: End-to-End Review

Questions

  1. Describe, in your own words, the life of a packet from end to end!

Submission

Submit your answers to the questions using the Class Activity Questions discussion board. You may also respond to questions or comments made by others, or ask follow-up questions there. Answer any reflective prompt questions in the Reflective Journal section of your OneNote Classroom personal section.