--
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
- Explain what the role of an IP address is in a computer network.
- Explain what the role of a port number is in a computer network.
- Write a Java program that talks to Google.com
- Write a Java program that can make a TCP connection
- Write a Java program that can accept a TCP connection
- Write a Java program that can send and receive data on an established TCP connection
- 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)
- Compare and contrast the properties of a TCP vs UDP "connection."
- 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?
This topic: Main
> TWikiUsers >
DonaldActon >
DonaldActonSandbox >
ComputerScience317Cwsei > SocketProgramming
Topic revision: r7 - 2011-07-05 - DonaldActon