Name:______________________________     Alpha:________________________________ 
Print this page and give the answers.
  1. [10pts] You are given an integer x that is an 8-bit number (i.e., x is between 0 and 255).
  2. [10pts] Bob would like to connect to Alice and have a netcat chat with him. Alice's IP address is 100.101.102.103, and she will listen at UDP port 9876. Give a terminal command for each of Alice and Bob. (Note: Understand every detail correctly so you don't miss anything)
    Alice:
    
    
    
    Bob:
    
    
    
  3. [8pts] For a TCP server socket, you need to do the following.

    1. Create a socket by calling ___________________.

    2. You need to _________________ the socket to a specific port so that the clients can connect the server by using that specific port.

    3. Call ________________ to look for any connection attempt from a remote client.

    4. Now, you can _______________ any connection request.
  4. [12pts] For a TCP client socket, you need to do the following.

    1. Create a socket by calling _________________.

    2. Connect to a server by calling _________________.

    3. Use _______________ and ________________. You need to use the data of ___________________ type.

    4. Close the socket by calling ________________.

Submission deadline

Check the course calendar for the deadline. Bring your work to class.