Network Programming (2) iClicker/WUTexter Question Using

3/3/2014
iClicker/WUTexter Question
Which protocol is responsible for in‐order delivery of data bytes traveling over the Internet?
Network Programming (2)
CSE 132
A.
B.
C.
D.
E.
Internet Protocol (IP)
Transmission Control Protocol (TCP)
Domain Name Service (DNS)
Java Socket class
Java ServerSocket class
Using Sockets
• Time
Time
• Mail
• National Institute of Standards and Technology (NIST)
• Internet Time Service (ITS)
• Web pages
• Multiple protocols for reporting time
– time.nist.gov (and many other servers)
– Time (RFC 868)
– Daytime (RFC 867)
– Network Time (RFC 1307)
• Database access
Time (RFC‐868)
• Open socket to port 37
• Server responds with 4‐byte integer
– Represents seconds since 1 January 1900
– Will roll over in 2036
– Current values are negative if interpreted as a signed integer
– Time.java builds up a long from 4 input bytes
Daytime (RFC‐867)
• Open socket to port 13
• Server responds with ASCII string
–
–
–
–
–
–
–
–
JJJJJ YR‐MO‐DA HH:MM:SS TT L H msADV UTC(NIST) OTM
JJJJJ is modified Julian date (started 17‐Nov‐1858)
YR‐MO‐DA and HH:MM:SS are what you expect
Daylight saving time code (50 in summer)
L Leap second coming, H health digit: 0=good
msADV milliseconds adjust for network delay
UTC(NIST) coordinated universal time
OTM on time marker
1
3/3/2014
Mail Delivery
• SMTP – Simple Mail Transfer Protocol
• Open socket to port 25
• Request/response protocol:
Studio 6
• Caesar’s cipher – substitution cipher
• Each letter in plaintext is replaced by a letter some fixed number of positions down the alphabet
– MAIL establish return address (sender of mail)
– RCPT establish recipient(s), e.g., to: cc: bcc:
– DATA send message text
• Server responds with result codes indicating success/failure
IP Address
• From command line prompt:
– hostname
– ipconfig
Web Browsing
• HTTP – Hypertext Transfer Protocol
• Open socket to port 80
• Request/response protocol:
– HEAD ask for header information (meta‐info)
– GET ask for contents of page
• Contents of page frequently in HTML (Hypertext Markup Language)
CD Database Access
•
•
•
•
CDDB – Compact Disk Database
Hosted at freedb.org
Database of track listings for > 2,000,000 CDs
Protocol documented on web (link on class page)
iClicker/WUTexter Question
When using a Caesar cypher with a shift value of 2, the proper encoding of the phrase “hello world” is:
A. mjqqt btwqi
B. nkrru cuxrj
C. gdkkn vnqkc
D. ifmmp xpsme
E. jgnnq yqtnf
2
3/3/2014
Lab 4a
•
•
•
•
•
Build on Weasley Clock from Studio W
I provide a working version of Studio W My solution is listening on port 10400
Request/response protocol described in lab
Build a GUI in client that acts as view for Weasley Clock model running in server 3