21
/dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Embed Size (px)

Citation preview

Page 1: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

/dev/urandom

Barry Britt, Systems Support Group

Department of Computer ScienceIowa State University

Page 2: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Outline

DNS Samba Apache NAT & routing

Page 3: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

DNS

How does your machine find out that: popeye.cs.iastate.edu => 129.186.3.66

Domain Name System Consists of name servers, each responsible for

“domains” What are domains?

.edu .com .org .iastate.edu

Page 4: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

DNS querying

Every FQDN (Fully Qualified Domain Name) has an implied '.' at the end of it

popeye.cs.iastate.edu. www.google.com. en.wikipedia.org.

Queries are handled by the DNS servers referenced on your computer.

/etc/resolv.conf on most Linux machines

Page 5: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Anatomy of a DNS Query

How does your machine know what to do?

RFC 1035 (DNS Protocol Specification)

Says, start at the end and work to the beginning.

Let's query: www.google.com.

Your Computer Your DNS

Where is www.google.com?

. (root)Name servers

Where is .com.? Where is .google.com.?

.comName servers

.google.comName servers

Where is www.google.com.??

Page 6: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

More DNS

Queries must be done for every host name (but results are cached for a period of time)

Note: One server process can be a client process for

another service e.g. - network time protocol (NTP)

Queries a time server (time.iastate.edu) for the correct time.

Uses DNS to resolve time.iastate.edu

Page 7: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Samba

What is it? Short Answer: Software that allows a UNIX

machine to work as a Windows File Server Long Answer:

M$ uses a protocol called CIFS for file sharing (Common Internet File System)

M$ uses a transport protocol for CIFS called SMB (Server Message Block)

Samba is an implementation of SMB/CIFS that runs on many types of machines

Page 8: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Samba History

1992 → Andrew Tridgell Wanted to connect DOS PC and UNIX Server AND Wanted to use NetBIOS on both

So... he accomplished this by: Writing a packet sniffer Reverse engineering the SMB protocol Implementing this on a UNIX machine so that it

behaved like a Then, he released the code to the public

Page 9: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Samba History

1994 → Tridgell wanted to link wife's windows machine to his Linux network.

Tried his old code, and it worked! 1999 → Samba 2.0 is released

Testing shows that Samba 2.0 is 2x faster than Windows 2000 Server

2003 → Samba 3.0 is released Testing shows that Samba 3.0 is 2.5x faster than

Windows 2003 Server

Page 10: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Samba Misc. Info

Samba project is HUGE (www.samba.org) Samba is mentioned in the famous “Halloween

Memo” from Microsoft (leaked memo in the late 80's)

License is GPL Server can be any (or all) of the following:

NetBIOS (name resolution) server Domain Browser Authentication server File & Print Server

Page 11: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Samba Misc. Info

Client Feels like it's talking to a Windows Server

Can Mount files Can get NetBIOS resolution Can authenticate to Samba server Can browse the Domain

For More Info.... SMB How-To at www.tldp.org Official How-To at www.samba.org

Chapter 2

You WILL be doing this in Lab.

Page 12: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Apache

License: Apache Software License (ASL) Free software license, similar to GPL but allows

for patented software inclusion. Why? Want 3rd party contributions from

companies. Known for...

HTTP Server Apache 1.0 → release 1995 After 1 year, Apache is the #1 web server on the

Internet

Page 13: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Apache

Today: Apache is the #1 web server on the internet October 2004

Apache: 67.9% share IIS: 21.1% share

November 2005 Apache: 70.9% share IIS: 20.2% share

Runs on all major platforms, and some non-major ones too

Runs sites that get tens of millions of unique hits per day

Page 14: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Apache

Customization Apache uses modules that are can be loaded at

compile time or run time Why use Apache?

Acc'd to netcraft “Most Reliable Hosting Company” as of Aug 2010, out of the top 10:

8 are Linux based 2 are Free BSD based

Apache/Linux runs the content on the Internet

Page 15: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Apache for Lab

You will Set up a basic HTTP server Static content

HTML pages that sit on a location on the server

Dynamic content Pages that are constructed by the server Output because of:

Executable (C or some other language) Script (CGI, bash script, etc...)

Page 16: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Apache for Lab

References Chapter 26 of textbook Many apache how-to docs at www.tdlp.org Apache documentation

httpd.apache.org

www.apache.org

Page 17: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Routing

Router Device that interconnects 2 or more computer

networks Example: a home network

2 IP address, one for each network

PC2

PC3

Router

PC1

ISP/Internet/etc...192.168.0.x 203.176.5.49

Internal (private) External (public)

Page 18: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

Routing

Router's Job Any traffic from 192.168.0.x subnet

Destined for internet → forward to 203.176.5.49 Destined for local → resend internally

Hosts specify the router's internal address as “gateway”

Page 19: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

NAT

Network Address Translation Actually modifies the network addresses in the IP

packets Why?

IP Masquerading → the NAT Router sends all traffic AS ITSELF

The outside world cannot see the 192.168.0.x subnet (private network)

Therefore, we can “share” the internet connection from our ISP over our home network, ISP has no way to tell

Page 20: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

NAT

Some IP address blocks are reserved for private networks

10.0.0.0 – 10.255.255.255 (24 bit block) 172.16.0.0 – 172.31.255.255 (20 bit block) 192.168.0.0 – 192.168.255.255 (16 bit block)

All these ranges are safe to use for private networks

Page 21: dev/urandom Barry Britt, Systems Support Group Department of Computer Science Iowa State University

NAT

NAT has significantly slowed the consumption of IPv4 addresses.

Delay of Ipv6 adoption is primarily due to NAT How many devices connected to Internet?

Recent estimate: > 5,000,000,000 Over IPv4 limit of 232

Google Server Farm(s) may have > 10,000 all inside of private IP space using NAT

Only the front-end “gateway”s need proper IP addresses