Tags:
tag this topic
create new tag
view all tags
-- Main.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. 1 Explain what the role of a port number is in a computer network. 1 Write a Java program that talks to Google.com 1 Write a Java program that can make a TCP connection 1 Write a Java program that can accept a TCP connection 1 Write a Java program that can send and receive data on an established TCP connection 1 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) 1 Compare and contrast the properties of a TCP vs UDP "connection." 1 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: [[http://www.cs.ubc.ca/~acton/ReceiveUPDPacketJava.m4v][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 * [[http://cgi2.cs.rpi.edu/~hollingd/netprog/netprog.php][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 * [[http://www.faqs.org/faqs/unix-faq/socket/][Socket FAQ]] * [[http://beej.us/guide/bgnet/][Beej's Guide to Network Programming]] The perspective is primarily from C, but it does provide a decent overview of program structure and what needs to be done. * [[http://cs.baylor.edu/~donahoo/practical/CSockets/PracticalSocketC.pdf]] Socket Pocket series of books for C and Java (and likely others). ---++ 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?
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r7
<
r6
<
r5
<
r4
<
r3
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r7 - 2011-07-05
-
DonaldActon
Home
Site map
BETA web
Communications web
Faculty web
Imager web
LCI web
Main web
SPL web
Sandbox web
TWiki web
TestCases web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback