Tags:
create new tag
view all tags
-- DonaldActon - 21 Jun 2011

Socket Programming

Knowledge assumed prior to starting this module

  • Data is sent in packets
  • For TCP data is streamed and broken up into packets
  • Data can be lost in UDP
  • Packets have addresses in them that are used to indicate where the packet is delivered

Learning Outcomes

  1. Explain what the role of an IP address is in a computer network.
  2. Explain what the role of a port number is in a computer network.
  3. Write a Java program that talks to Google.com
  4. Write a Java program that can make a TCP connection
  5. Write a Java program that can accept a TCP connection
  6. Write a Java program that can send and receive data on an established TCP connection
  7. Enumerate and explain the different type of network related errors a program using/establishing a TCP connection might encounter and why/how they might be caused (e.g. connection not accepted, connection times out, connection failure during transfer)
  8. Compare and contrast the properties of a TCP vs UDP "connection."
  9. Something about XDR and the interpretation of data.

Lesson Plan

Lecture 1

  • Pre class Activities
    • Video discussing the construction of code to send a UDP packet
    • Video Discussing the construction of code to receive a UDP packet. Sample video: ReceiveUDPPacketJava.m4v
  • In Class Activities
    • Student groups assigned to be either the client or the server and then they have to exchange data between each other. First they send character data, then they go to numbers
    • Have to interact with a provided server that does things in binary
    • What happens when a packet arrives that is too large for the receiving buffer. Have students enumerate the possible outcomes and propose a way of determining what actually happens.
    • Invention activity for XDR
  • After Class Activities

Lecture 2

  • Pre-class Activities
    • Video discussing the construction of code to make a TCP connection
    • Video discussing the construction of code to accept a TCP connection
  • In Class Activities
  • Post Class Activities

Instructor Resources

  • RPI Introductory Networking Course The course content includes things like:
    • Simple Client Server using TCP
    • Simple UDP client and server
    • Byte Ordering issues
    • Errors that can be returned by socket API
    • I/O multiplexing
    • Java Network Programming

Student Resources

COMMENTS

  • discuss how IP-port src/dest matching occurs
  • asymmetric nature of sockets (accept/connect)
  • may need to explain what happens which a client connects to server, why is the port different?
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r7 - 2011-07-05 - DonaldActon
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback