Docsity

Distributed Applications Networking Basics - Slides | CS 6452, Study notes of Computer Science

Partial preview of the text

Download Distributed Applications Networking Basics - Slides | CS 6452 and more Study notes Computer Science in PDF only on Docsity!

Distributed Applications

Networking Basics

What is a “Network?”

 Depends on what level you’re at

 One person’s “network” is another person’s “application”

 OSI Seven Layer Model

 (^) The physical wire itself  (^) Ethernet, 802.11b  (^) Routing protocols  (^) ...

  1. Application FTP, HTTP, SMTP, etc.
  2. Presentation
  3. Session
  4. Transport TCP
  5. Network IP
  6. Data Link ARP, RARP
  7. Physical Ethernet

Topology of the Internet

My Home Network gatech.edu google.com

Some Terminology: Protocols

 Protocols : rules that facilitate information exchange among

programs on a network

 (^) Example from human world: “roger” and “over” for radio geeks

 Similar to how you design the interfaces between objects in your

program

 (^) A callback expects to get a certain set of parameters in a certain order  (^) You need to know this in order to use the callback

 Likewise:

 (^) A networked program expects you to communicate with it in certain ways (using certain messages, in a known format)  (^) You need to know this in order to use the program

Some Terminology: Clients

 Client : a program that connects to a server to use whatever

service it provides

 (^) Examples:  (^) Web browser connects to web servers to access/view HTML documents  (^) Mail client (Outlook, etc.) connects to mail servers for mail storage, transmission  (^) IM clients connect to IM servers to access info about who is on, etc.

 Most servers can be connected to by multiple clients at the same

time

Some Terminology: Host

 Host : Simply a machine that’s connected to the network

 Generally running clients and/or servers

 (^) The machine “hosts” a server

What Will You Have to Do?

  1. Connect to the other machine(s)  (^) Know how to refer to it: which machine do you want to connect to?  (^) Know how to perform the connection  (^) Know how to deal with errors (server is down, etc.)
  2. Send messages to it (e.g., “I’m online now!”)  (^) Know how to “marshall” arguments  (^) Know how to do the transmission  (^) Know how to deal with errors (server crashed while sending, etc.)
  3. Receive messages from it (e.g., list of online users)  (^) Know how to “unmarshall” arguments  (^) Know how to read data  (^) Know how to deal with errors (e.g., got unexpected data from server, etc.)
  4. Disconnect from it  (^) This is the easy part!

Why All the Focus on Errors?

 Networking in inherently error-prone

 Different than single application programming

 (^) Errors generally result from a bug, and just crash entire program

 Networking: errors may be caused by reasons outside of your

control

 (^) Network is down, server has crashed, server slow to respond, etc.  (^) During a chat I could shut my laptop and walk away  (^) Someone could trip over the power cord for an access point  (^) Networks can’t even guarantee that messages will get from A to B

 Good goal: robustness

 (^) Your program should survive the crash of another program on the network, receiving malformed data, etc  (^) “Defensive programming”

Internet Addressing

 Every machine on the Internet has an address

 Internet addresses are sequences of 4 bytes

 (^) Usually written in “dotted quad” notation  (^) Examples: 192.168.13.40, 13.2.117.

 Addresses identify a particular machine on the Internet

 (^) Example: 64.223.161.104 is the machine www.google.com

 One special address

 (^) localhost  (^) Refers to the local machine always

Where do IP Addresses Come

From?

 You can’t just set your IP address to any random value and have it

work

 (^) The rest of the Internet won’t know how to reach you  (^) You have to use values that are compatible with whatever network you’re on

 In most cases a service called DHCP will take care of this for you

 (^) Dynamic Host Configuration Protocol  (^) Assigns you a valid IP address when you boot your machine, wake your laptop, etc.  (^) E.g., LAWN at Georgia Tech  (^) IP address may change from time to time: in other words, don’t count on this being your address forever

 If DHCP isn’t available, you may have to set your IP address by

hand, but only with a value provided by an administrator

Public Versus Private Addressing

 Not all IP addresses may be reachable from any given machine

 Simple case: machines behind a firewall

 (^) Example: my old machine at PARC was 13.1.0.128, but only reachable from within PARC

 More complex case:

 (^) Some IP addresses are private (also called non-routable )  (^) Three blocks of addresses that cannot be connected to from the larger Internet  (^) 10.0.0.0 - 10.255.255.  (^) 172.16.0.0 - 172.31.255.  (^) 192.168.0.1 - 192.168.255.

Why Private Addresses?

 Two reasons: IP address conservation and security

 (^) Public addresses uniquely define a given machine  (^) There’s a limited number of these, and they’re running out  (^) Private addresses can be reused (although not on the same network)  (^) Probably hundreds of thousands of machines with 192.168.0.1 on private networks (corporation internal, homes, etc.)  (^) Certain network configs let you share a single public IP address across multiple private machines  (^) Network Address Translation  (^) Built into most home routers  (^) E.g., BellSouth gives me the address 68.211.58.  (^) My router gives my home machines 192.168 addresses  (^) Connections out are translated so that it looks like they come from 68.211.58.  (^) Internal machines are “invisible” since they have non-routed addresses

Naming

 When you go to a web browser, you don’t type in 64.223.161.104,

you type in www.google.com

 The Domain Name Service

 (^) A big distributed database of all the machines on the Internet  (^) Each organization manages its own little portion of it  (^) Maps from host names to IP addresses

 Ultimately, the Internet runs on IP addresses. Names are a

convenience for humans

 (^) When you type www.google.com, the browser resolves that name to an IP address by talking to a DNS server  (^) If name resolution can’t be done (DNS is down; you’re not connected to the network), then browsing will fail

Naming Configuration

 Much like IP addressing, you may not have much control over the

DNS name for your machine

 (^) In general, you won’t have a name resolvable by DNS, even if your machine has a “local” name  (^) In the CoC, CNS sets up DNS names for the machines they administer, mapping them to fixed IP addresses  (^) If you were to take these machines to different networks (where they get different IP addresses), those names would no longer work  (^) Resolve to the incorrect address  (^) Personally owned machines, even if they get an IP address from DHCP, generally get sucky names, if they get a name at all  (^) Example: lawn-199-77-214-212 on my laptop