COMP30023 – Computer Systems
Application Layer – DNS – Mail – Streaming
Dr Lachlan Andrew 2021
Recap
• History of WWW
• Introduction to HTTP
– Persistent vs non-persistent – Caching/Proxies
– Requests/Responses
– Cookies
© 2021 University of Melbourne
2
Summary
• Still at Application Layer
– DNS
– Mail
– Streaming
© 2021 University of Melbourne
3
Domain Name System – DNS
• Remember back to URLs
– WeuseDNStoresolvetheURLtoanabsolutelocation
• Briefly mentioned IP addresses before
– Fornow,justconsiderthemtobeuniquenumericalidentifiers
• 8.8.8.8 Google Public DNS server
• 203.2.218.208 – abc.com.au
• Note: Conceptually an IP addresses should uniquely identify a socket/jack (or wireless interface) on a computer
– Often not the case today
– We will see why when look at the network layer in Week 11
© 2021 University of Melbourne
4
Domain Name System – DNS
• DNS is essentially the technology behind mapping host.domain.com to an IP address.
• Four elements comprise the DNS:
– Domainnamespace:DNSusesatree-structurednamespaceto
identify resources on the Internet.
– DNS database: Each node/leaf in the name space tree names a set of information that is contained in a resource record (RR). The collection of all RRs is organized into a distributed database.
– Name servers: Server programs that hold information about a portion of the domain name tree structure and the associated RRs.
– Resolvers:Theseareprogramsthatextractinformationfromname servers in response to client requests.
© 2021 University of Melbourne
5
Domain name characteristics
• Domain names:
– arecaseinsensitive
– canhaveupto63charactersperconstituent
– canhaveupto255charsperpath
– canbeinternationalised(since1999)–causedsecurityproblems
• Naming conventions usually follow either organisational or physical boundaries e.g.,
– au.ibm.com/uk.ibm.com(foremail) – ibm.com.au/ibm.co.uk(forweb)
• Absolute domain names ends in a ‘.’
• Relative domain names end in a constituent e.g., .com
© 2021 University of Melbourne
6
Conceptual division of DNS namespace
© 2021 University of Melbourne
7
Top-level domains
• The same followed within country TLDs
But excptions…
• abc.net.au is not a network provider
• Many new starting 2014 – .accenture
– .calvinklein
©
8
2021 UniversityofMelbourne
Resource Records
© 2021 University of Melbourne
9
Resource Record Example
©2021 Universityof Melbourne
©
10
Inserting records into DNS
• Example: new start-up Network Utopia
• Register name networkuptopia.com at DNS registrar
(e.g., Network Solutions)
– providenames,IPaddressesofauthoritativenameserver(primary and secondary)
– registrarinsertstwoRRsintocomTLDserver:
• (networkutopia.com, dns1.networkutopia.com, NS)
• (dns1.networkutopia.com, 212.212.212.1, A)
– create authoritative server:
• Type A record for www.networkuptopia.com;
• Type MX record for networkutopia.com
© 2021 University of Melbourne
11
Example of tools
• Using DNS query tools:
– nslookup – dig
– host
© 2021 University of Melbourne
12
Name server zones
© 2021 University of Melbourne
13
Name server zones
• Zones:
– DNSnamespaceisdividedintooverlappingzones.Thenameservers
are authoritative for that zone.
• usually two name servers for a zone
– Nameserversarearrangedinahierarchicalmannerextendingfrom a set of root servers
• Root name servers:
– Therootserversformtheauthoritativeclusterforenquiries.The root servers are contacted by a local name server that can not resolve name.
– Thereare13“rootnamesservers”globally
– a“rootserver”maybeaclusterofgeographicallydispersedservers
• F-ROOT 252 sites; J-ROOT 162 sites
2021 © University of Melbourne 14
Types of name servers
• Top-level domain DNS servers: responsible for com, org, net, edu, etc, and all top-level country domains uk, fr, au, jp.
– Examples include: Network Solutions maintains servers for com; and Educause for edu
• Authoritative DNS servers: organizations DNS servers, providing authoritative hostname to IP mappings for organizations servers (e.g., Web, mail).
– Can be maintained by the organization itself or service provider.
• Local DNS server: Typically, each ISP (residential ISP, company,
university) has a “default name server” which handles DNS queries
– Returns cached value if one exists
– Otherwise, acts as proxy, and forwards the request up the query hierarchy
© 2021 University of Melbourne
15
Resolving a query
• A resolver client asks the local DNS for the domain to IP mapping:
– ifanswerisknownbythelocalDNS,thenitsendstheanswer.
– ifanswerisnotknown,thenthelocalDNSqueriesupthehierarchy to the top level (root) DNS for the domain and then relays the answer to the resolver client.
• Essentially, this is a recursive query mode. Queries are subject to timers to avoid longer than necessary response times.
2021 © University of Melbourne 16
Example Resolver Query
© 2021 University of Melbourne
17
HOSTS File
• Hard-coding mappings – Unix: /etc/hosts
– Windows: C:\Windows\System32\drivers\etc\hosts • Example:
127.0.0.1 localhost
127.0.1.1 username-VirtualBox
# ad blocking
0.0.0.0 pagead2.googlesyndication.com 0.0.0.0 static.adsafeprotected.com
• Local DNS Providers
© 2021 University of Melbourne
18
DNS Security
• No security in original design – DNSspoofing
– DNSflooding • Solutions
– DNSSEC
– Rootsigning
© 2021 University of Melbourne
19
Email services and architecture
• Email has a long heritage (since 1960s)
• In this time, evolutionary steps in infrastructure and
standards have been taken.
• Standards for Internet-enabled email are based on 2 RFC’s
– RFC821(transmission)
– RFC822(messageformat)
– RFC2821andRFC2822(revisedversionsofearlierRFCs)
• Architecture and Services
– Useragents(UA’s/MUA’s)
• allow user to read and send email
– Messagetransferagents(MTA’s)
• transport messages from source – destination
© 2021 University of Melbourne
20
Email services and architecture
There may be SMTP relays between the sender’s MTA and the receiver’s
https://blog.mailchannels.com/what-is-an-smtp-relay-service
© 2021 University of Melbourne
21
User agent (mail program)
• Basic functions:
– compose,report,display,dispose
• Envelope and contents:
– encapsulation of transport related information
• Header
– user agent control info
• Body
– forhumanrecipient
• User must provide message, destination, optional other parameters
• Addressing scheme user@dns-address
© 2021 University of Melbourne
22
Mail Message Format
© 2021 University of Melbourne
23
Message Header Fields
Headers the user usually sees
To:
Cc:
Bcc:
From:
Date:
Subject:
Message-Id:
In-Reply-To:
References:
Reply-To:
Sender:
Return-Path:
Keywords:
Received:
Headers the user usually doesn’t see.
What are they for?
© 2021 University of Melbourne
24
SMTP – Simple Message Transfer Protocol
• SMTP uses TCP to reliably transfer email message from client to server, default port 25
• Typically direct transfer: sending server to receiving server
• Three phases of transfer (1) handshaking (greeting),
(2) transfer of messages, and (3) closure
• Command/response interaction: commands in ASCII text and response consists of status code and phrase
• Messages must be in 7-bit ASCII
© 2021 University of Melbourne
25
SMTP – Interaction Example
Note: many back-and-forth exchanges.
Slow on modern networks, where latency is larger than serialization delay.
Modern approach of one header has lower
delay.
© 2021 University of Melbourne
26
MIME – Multipurpose Internet Mail Extensions
• In the early days of email, messages were in English and used only ASCII – RFC 822 reflects these simple constraints. In time, the limitations of RFC822 became clear:
– otherlanguagerequirements
– alternativemessagecontenttype(audio/images)
• MIME has 5 additional message headers:
– MIME-Version:identifiestheMIMEversion
– Content-Description:humanreadabledescribingcontents
– Content-Id:uniqueidentifier
– Content-Transfer-Encoding:howbodyiswrappedfortransmission – Content-Type:typeandformatofcontent
© 2021 University of Melbourne
27
MIME – Content-Types
© 2021 University of Melbourne
28
Message Transfer & Access
• Transfer
– SMTP:delivery/storagetoreceiver’sserver
• Delivery
– Local
– POP3:PostOfficeProtocol;authorization(agent–server)and download
– IMAP:InternetMailAccessProtocol;morefeatures(morecomplex); provides for the manipulation of stored messages on server
– HTTP:gmail,Hotmail,Yahoo!Mail,etc.
© 2021 University of Melbourne
29
Receiving Mail: Local vs Remote
Possibly Intermittent connection
a) Sending and reading mail when the receiver has a permanent Internet connection and the user agent runs on the same machine as the message transfer agent (now rare).
b) Current case: notebook/PC/phone is not an MTA.
© 2021 University of Melbourne
30
POP3 – Post Office Protocol
• Three states of a POP3 transaction
– Authorisation – Transactions – Update
• Syntax
– USER/PASS
– LIST
– RETR/DELE
– QUIT(update)
• Issue: “download and delete” mode does not allow messages to be re-read.
© 2021 University of Melbourne
31
POP3
2021 © University of Melbourne 32
IMAP – Internet Message Access Protocol
• IMAP keeps user state across sessions.
– Retainmailboxcontentsonline(server)andallowmanipulationof
online and offline messages and mailbox folders
– Implications of server infrastructure to support high volume of IMAP users. This implies storage projections by the provider, and hence limitations.
© 2021 University of Melbourne
33
Streaming
• 40% of internet download traffic is streaming (video, audio) – Not necessarily 40% of core traffic, due to caching
• WebSockets (ws://… and wss://…)
– Multiplexing full-duplex channels over one TCP connection
– Everything on TCP port 80 or 443 (HTTP/HTTPS) to pass firewalls
– Unlike HTTP, doesn’t require client to keep requesting. streaming
• RTP + RTCP/RTSP (Real Time [Control/Streaming] Protocol)
– RTP uses a playback buffer to deliver packets with the same spacing as
they were sent, undoing network jitter
– RTCP Monitors delays, adapts video coding rate to available capacity
– RTSP provides play/record/pause services
• Real Time Messaging Protocol (RTMP, used by Flash)
© 2021 University of Melbourne
34
And finally…
© 2021 University of Melbourne
35