Quick viewing(Text Mode)

“Some Application Layer Stuff” Ports Port Field Is Overloaded Well

“Some Application Layer Stuff” Ports Port Field Is Overloaded Well

“Some Ports Stuff” • TCP and UDP each contain a 2 byte source port and a 2 byte destination port in each • Layer 3 gets packets from here to there (given packet a four byte IP address) Packet “on the wire”

• Layer 4 makes a reliable and well behaved (wrt Layer 2 Layer 3 Layer 4 Application Specific network load) connection using timeouts and Header Header Header Data retransmission

• What’s left? - Applications must find the “port” of their Dest IP Source IP Dest Port Source Port peer Connection Identifier - Look up IP address based on a name - Infinite variety of application specific klud- • Each connection is independent ges • Up to 232 independent connections between a pair of computers

Port Field is Overloaded Well Known Ports

• In practice, can’t have 232 connections • port is #23 between a pair of computers • If I open a connection to any system and spec- • “Well Known Ports” used to find applications ify a destination port of 23, it means I want to without negotiations open a telnet connection

• “Privileged Ports” indicate that the corre- • Implies a single computer can only open 216 sponding application is running with elevated simultaneous telnet sessions to another com- privileges on its computer puter

• In many implementations, ports assigned to • Telnet daemon “listens” on port 23 applications for all IP addresses and all paired - O/S forwards all connect requests on port 23 ports to that daemon - That process “owns” all connections from any port and any IP address to port 23 - Typically starts a subprocess to handle each active connection (IP address/source port combination) Privileged Ports System (DNS) • Only privileged processes are allowed to open connections from low numbered source ports • Distributed database for looking up 4 byte IP address from names like “www.yahoo.com” • A time sharing system could open connections on behalf of its users and assert user identities • Control is delegated. If you control as part of the application protocol yahoo.com, you can define properties for any name of the form *.yahoo.com, Open TCP SP=117; DP=rlogin *.*.yahoo.com, etc.

OK • You can in turn delegate control of some sub- domain to someone else Requesting user is jsmith

is configured with source IP addresses to trust, and what port numbers are low enough to be trusted at that IP address

Tying DNS together Tying DNS together

• Every client must know the IP address of some DNS server (sometimes learned through dhcp) Root Server - Preferably more than one for failover

• Every server must know all information about 2 .com Server things in its own part of the (its 3 zone) yahoo.com Server

• A server is either the Primary Master for its 4 zone, or it is a secondary master and knows the random.mit.edu Server IP address of the Primary Master 1 • Every server must know the IP addresses of Client servers controlling child

• Every server must know the IP address of • Any DNS server can either answer your query some DNS server for the root or point you to a closer server - Preferably more than one for failover DNS Query Types Caching

• Iterative: if you don’t have the data tell me • After recursive lookup, or any other time, DNS about someone closer server can information from other serv- ers • Recursive: if you don’t have the data, look it up for me • All data has a “” (TTL) controlling how stale the cache may be

• Client can set “authoritative bit” in query ask- ing server to bypass cache

DNS Administration What information is stored in DNS? • Initially, fixed small set of Top Level Domains: • Primarily IP addresses associated with names - .com, .edu, .gov, .mil, .org, .net, .arpa (A records)

• Later added two letter country codes as top • Information for tying the system together (e.g. level domains names and IP addresses of other servers) - .us, .au, .tv, .to, .tm, ... • With dnssec, domain keys and digital signa- • Initially loosely administered on first come tures first served basis • Application specific extra information • Subject of ongoing political, legal, and eco- - Most important is MX records nomic squabbling addressing What is “www.” for?

[email protected] • Web faced same scaling problems as mail

• Could have created WX records containing user account name names of web servers for a domain on host • Instead adopted convention of using a separate name with prepended www. • This model was too restrictive: • Usage is fading... most sites today accessible - A single host not fast enough or reliable with or without the www. enough to handle all the mail for a large company - Hide the user’s mail server name - Might want mail to go to different machine than the one named in the

• Solution: MX record for iris.com has list of machines that accept mail so addressed

How does the web work? What’s in a URL?

• Terminology: • http://www.microsoft.com/security - : the communications network sup- porting many applications, including email, • “http:” says use http protocol. Alternatives remote login, file sharing, etc. include ftp:

- : an application of the Inter- • “www..com” is a domain name net where information is linked together with whose address is looked up in DNS for open- (Universal Resource Locators) and ing a connection displayed using a browser - HTTP: HyperText Transport Protocol. A pro- • “security” is information passed to the server tocol using TCP/IP that browsers use to com- to specify what information is desired municate with web servers - initially, this was usually a file name - HTML: HyperText Markup Language. A - today, it is typically a complex formula with very flexible syntax for carrying information sub-parts that are interpreted by the server including fonts, colors, layout, embedded pictures, and “” links to other URLs - e.g. a command to run and parameters to sup- ply to the command - XML: eXtended Markup Language. An even more flexible successor to HTML Elaborate URLs Confusing URLs

• http://video.lycos.com/myvideocenter/ • general syntax is: viewvmail.asp?vm=578650&e=57Uk/ - ://@:/ Z0JeuvHc&r=1

• “http://” implies port to connect to and proto- • What does this mean?? col to speak - http://www.cnn.com&story=breaking_news • “video.lycos.com” is looked up to find the IP @18.69.0.44/evarady/www/top_story.htm> address

• “myvideocenter/viewmail.asp” might be the name of a program to run

• “vm=578650&e=57Uk/Z0JeuvHc&r=1” is likely a set of parameters passed to the pro- gram

• HTML often contains generated URLs that allow the server to maintain context

Web Statelessness Constructing a Web Session

• HTTP is “stateless” • On any request to web site, server looks for a cookie named “login_cookie=” in the request - Protocol has no concept of a “session” - TCP connection often broken and reformed • If none present, return a page containing a between clicks login screen (requesting user name and pass- - Designed for navigating static web pages word) linked together with URLs - Applications that want a concept of a session • When fields filled in and “login” button have to build it from dynamically generated pushed, generates a request to server contain- URLs, referrals, and cookies ing that info

• Referral: if you call up a page by clicking on a • Server returns “login_cookie=Er5sleQ” along URL, the server is told the URL of the page with the login succeeded page containing the reference • Server knows all subsequent requests are asso- • Cookies: when a page is returned, it can ciated with this session include non-displayed information that will be returned when any other page is requested • Logout button causes server to set from the same server “login_cookie=” Cookies and Privacy

• With persistent cookies, a site can know when the same user returns on another day

• Cookies only go to the site they came from to protect privacy and security - Different sites can’t corrolate actions of a sin- gle user - Hostile sites can’t get session identifiers and impersonate user back to original server

• But... advertising embedded in web pages allows the advertiser to corrolate actions based on referrals and advertiser cookies

• If you give your name, email address, or other identification to any site, it can be associated with any other sites you visit