











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of networking concepts, focusing on java's object-oriented view and networking api. Topics include networking background, protocols, internet addresses, ports, sockets, urls, connection types, and reliability. Learn about the history of networking, the importance of protocols, and how java supports networking through its api.
Typology: Study notes
1 / 19
This page cannot be seen from the preview
Don't miss anything!












1
2
Exception handling Streams Threads Graphics user interfaces (GUIs) Networking
3
Overview
Background Concepts Java’s objected-oriented view Java’s networking API (Application Program Interface) Network applications
This lecture
Next lecture
4
Networking Background
Set of computers using common protocols to communicate over connecting media
1986 NSFnet 1995 Internet
7
Protocols – Email Delivery
8
Protocol – HTTP GET (Web Page)
Client connects to server on port 80 GET /~pugh/index.html HTTP/1.
Server responses with HTTP headers HTTP/1.1 200 OK Date: Mon, 20 Feb 2006 03:47:44 GMT Server: Apache Last-Modified: Wed, 15 Feb 2006 01:17:09 GMT ETag: "9b2b1c-948-1222af40" Accept-Ranges: bytes Content-Length: 2376 Connection: close Content-Type: text/html; charset=ISO-8859-
Followed by blank line, then contents of response
9
Network Model
Multiple layers (7) One function each Each layer relies on previous layer
10
Network Model – Layers
Transmit data as 0’s and 1’s over connection
Between two physically connected computers
Between any two computers connected to network
Deliver network data to application
Between two applications using network
13
Internet (IP) Address
Running out of 32-bit IP addresses Caused by initial address allocation Stanford & MIT given more IP addresses than China
1+ million addresses per square meter on Earth
14
IP Address – DNS
Protocol for translating domain names to IP addresses Example: cs.umd.edu → 128.8.128. Multiple DNS servers on internet DNS server may need to query other DNS servers edu DNS server queries umd.edu server to find cs.umd.edu
15
IP Address – DHCP
Protocol used by networked computers to obtain Unique IP addresses Default router, subnet mask IP addresses for DNS servers DHCP server on local network Used when computers first connect to network Settings (leases) periodically refreshed
16
IP Address – NAT
Rewriting source / destination IP addresses As data passes through router Permits sharing of single IP address among multiple computers Used in home networking (NAT box)
19
Sockets
Represents network connection Implemented in software Supports both UDP and TCP protocols
Introduced in Berkley UNIX in 1980s Networking API
20
Sockets
Receives data packet Relays to specific port
port port port port port
TCP or UDP
port #, data Packet
app app app app app
Transport Layer
21
Uniform Resource Locators (URLs)
Web pages Arbitrary files …
http://www.cs.umd.edu/index.html ftp://www.cs.umd.edu/pub/doc/csd_policies.pdf https://login.yahoo.com/ file://dir/my.txt
22
Uniform Resource Locators (URLs)
Protocol http ftp https (secure http) file … IP address (or domain name) Port (optional) http://www.cs.umd.edu:80/ Reference to anchor (optional)
25
Connection Oriented
26
Connection Oriented
Simpler scheme Easier to use Higher quality communication Less likely to lose data (at network layer)
27
Packet Oriented
Break message up into packets Transmit packets separately Assemble packets at destination
Packet switching Connectionless
US Mail VOIP (Voice over IP)
28
Packet Oriented
31
Internet
32
Internet Protocol (IP)
33
User Datagram Protocol (UDP)
Ping Streaming multimedia Online games
34
Transmission Control Protocol (TCP)
Extra messages between sender / recipient Resend packets if necessary Ensure all packets eventually arrive Store packets and process in order
37
Reliability
Data not guaranteed to Arrive ⇒ lost data Arrive in order ⇒ out of order data Less overhead Faster Transfers responsibility to higher layer Extra work for higher layer Compensate with timeouts Estimate packet lost if longer than average round trip
38
Reliability
Data-link
Physical Network
Transport Reliable ⇒ TCP Unreliable ⇒ UDP Application