0% found this document useful (0 votes)
67 views16 pages

NA Lec4 Application Layer Protocols

The document discusses the Domain Name System (DNS), which is a distributed database that maps human-friendly domain names to IP addresses. DNS has a hierarchical structure with root name servers at the top level that help resolve domain names by directing queries through the hierarchy to authoritative name servers. Local DNS servers cache recent name lookups to improve lookup speed but may return outdated address mappings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views16 pages

NA Lec4 Application Layer Protocols

The document discusses the Domain Name System (DNS), which is a distributed database that maps human-friendly domain names to IP addresses. DNS has a hierarchical structure with root name servers at the top level that help resolve domain names by directing queries through the hierarchy to authoritative name servers. Local DNS servers cache recent name lookups to improve lookup speed but may return outdated address mappings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 16

Chapter 2

Application Layer

A note on the use of these ppt slides: Computer


We’re making these slides freely available to all (faculty, students, readers).
They’re in PowerPoint form so you see the animations; and can add, modify, Networking: A
and delete slides (including this one) and slide content to suit your needs.
They obviously represent a lot of work on our part. In return for use, we only Top Down
ask the following:
 If you use these slides (e.g., in a class) that you mention their source Approach
(after all, we’d like people to use our book!)
 If you post any slides on a www site, that you note that they are adapted
6th edition
from (or perhaps identical to) our slides, and note our copyright of this Jim Kurose, Keith Ross
material. Addison-Wesley
Thanks and enjoy! JFK/KWR March 2012
All material copyright 1996-2012
J.F Kurose and K.W. Ross, All Rights Reserved

Application Layer 2-1


Chapter 2: outline
2.1 principles of network 2.6 P2P applications
applications 2.7 socket programming
 app architectures with UDP and TCP
 app requirements
2.2 Web and HTTP
2.3 FTP
2.4 electronic mail
 SMTP, POP3, IMAP
2.5 DNS

Application Layer 2-2


DNS: domain name system (‫)نظام أسماء النطاقات‬

‫هو عبارة عن قاعدة بيانات كبيرة وظيفتها تحويل األسماء المفهومة من قبل البشر إلى أسماء مفهومة من قبل الجهاز والعكس‬ •

people: many identifiers: Domain Name System:


 SSN, name, passport #  distributed database
Internet hosts, routers: (‫األجهزة لها‬ implemented in hierarchy of
‫)نوعين من األسماء‬ many name servers (‫قاعدة بيانات موزعة‬
 IP address (32 bit) - ‫)وتبنى بشكل هرمي‬

used for addressing  application-layer protocol:


datagrams hosts, name servers
 “name”, e.g., communicate to resolve
names (address/name
www.yahoo.com -
translation) (‫)موجود في األجهزة الطرفية فقط‬
used by humans
 note: core Internet function,
Q: how to map between IP implemented as application-
address and name, and layer protocol (‫)وظيفة مركزية لالنترنت‬
vice versa ? (‫كيف يمكن التحويل بين هذه‬  complexity at network’s
‫)األسماء‬
“edge”(‫طالما وهي عملية معقدة فنبقيها قريبة من‬
‫)األجهزة الطرفية وبعيدة عن أجهزة الموجهات‬
Application Layer 2-3
DNS: services, structure
DNS services why not centralize DNS? (‫هيكل‬
)‫)هرمي وليس مركزي (مخدم وحيد‬
 hostname to IP address  single point of failure
translation  traffic volume (‫)حجم الطلبات‬
 host aliasing (‫)أسماء وهمية‬
 canonical, alias names
 distant centralized database
(‫)بطئ في االستجابة‬
 mail server aliasing  maintenance
 load distribution (‫)توزيع الحمل‬
 replicated Web A: doesn’t scale! (‫إذا‬
servers: many IP ‫كان جهاز واحد ال يستطيع تحمل عدد كبير‬
‫)من الطلبات‬
addresses correspond
to one name (‫كل سيرفر عنده أكثر‬
‫من عنوان وفي مواقع مختلفة فيتم تحويل الطلب الى‬
‫)السيرفر األقل حمل‬

Application Layer 2-4


DNS: a distributed, hierarchical database
Root DNS Servers

… …

com DNS servers org DNS servers edu DNS servers

pbs.org poly.edu umass.edu


yahoo.com amazon.com
DNS servers DNS serversDNS servers
DNS servers DNS servers

client wants IP for www.amazon.com; 1st approx:


 client queries root server to find com DNS server
 client queries .com DNS server to get amazon.com DNS server
 client queries amazon.com DNS server to get IP address for
www.amazon.com
‫العملية السابقة تحدث بأجزاء من الثانية بدون أن يشعر المستخدم‬ •

Application Layer 2-5


DNS: root name servers
 contacted by local name server that can not resolve name
 root name server:
 contacts authoritative name server if name mapping not known
 gets mapping (‫)التحويل بين الـهوست والعنوان‬ ‫ مخدمات جذرية في الواليات‬10 ‫بسبب وجود‬ •
 returns mapping to local name server ‫ العالمي سوف‬Traffic ‫المتحدة فإن معظم الـ‬
‫يمر بالواليات المتحدة األمريكية لذلك يقال أن‬
‫أمريكا تتحكم باألنترنت عبر العالم‬
c. Cogent, Herndon, VA (5 other sites)
d. U Maryland College Park, MD k. RIPE London (17 other sites)
h. ARL Aberdeen, MD
j. Verisign, Dulles VA (69 other sites ) i. Netnod, Stockholm (37 other sites)

m. WIDE Tokyo
e. NASA Mt View, CA (5 other sites)
f. Internet Software C.
Palo Alto, CA (and 48 other sites)

a. Verisign, Los Angeles CA 13 root name


(5 other sites)
b. USC-ISI Marina del Rey, CA
“servers” worldwide
l. ICANN Los Angeles, CA
(41 other sites)
g. US DoD Columbus,
OH (5 other sites)

Application Layer 2-6


TLD, authoritative servers
TLD ‫ مباشرة تسمى‬Root ‫• بما أنها هرمية فإن الطبقة التي تأتي بعد الـ‬

top-level domain (TLD) servers:


 responsible for com, org, net, edu, aero, jobs, museums,
and all top-level country domains, e.g.: uk, fr, ca, jp
 Network Solutions maintains servers for .com TLD (‫تدار من قبل‬
‫)شركات‬
 Educause for .edu TLD
authoritative DNS servers:authoritative servers ‫ هو الـ‬TLD ‫• النوع التالي في الهرمية بعد الـ‬
 organization’s own DNS server(s), providing authoritative
hostname to IP mappings for organization’s named hosts
(‫ االدارة محلية يوفر تحويل السماء الى عناوين لالجهزة المحلية المتصلة بهذه المنظومة‬,‫)مملوك لشركة أو مؤسسة خاصة‬
 can be maintained by organization or service provider (‫يدار من‬
‫ أما عند استئجار مخدم من مزود الخدمة الموجود في الكلود فيدار من قبل‬,‫قبل قسم األي تي في الشركة عند عمل مخدم محلي‬
‫)مزود الخدمة‬

Application Layer 2-7


Local DNS name server
 does not strictly belong to hierarchy (‫ليس بالضرورة أن يكون جزء من‬
‫ وقد ينظم بشكل مؤقت للهرم وقد يغادر في أي وقت‬,‫)الهرمية ألنه قد يكون في شبكة منزلية أو ماشابه‬
 each ISP (residential ISP, company, university)
has one (‫)أول مخدم تتصل به االجهزة عندما تطلب عنوان معين‬
 also called “default name server”
 when host makes DNS query, query is sent to its
local DNS server
 has local cache of recent name-to-address translation
pairs (but may be out of date!)
 acts as proxy, forwards query into hierarchy (‫يعمل كوسيط حيث‬
‫)يحول الطلبات من جهاز المستخدم إلى مخدمات الهرمية‬

Application Layer 2-8


DNS name DNS server ‫• كيف يعمل الـ‬
root DNS server
resolution example
2
 host at cis.poly.edu 3
TLD DNS server
wants IP address for 4
gaia.cs.umass.edu
5
‫يوجد نوعين من الطلبات‬ •
local DNS server
iterated query: (‫)الطلب التكراري‬ dns.poly.edu
 contacted server replies 7 6
1 8
with name of server to
contact
authoritative DNS server
 “ I don’t know this dns.cs.umass.edu
name, but ask this requesting host
cis.poly.edu
server”
‫العملية تحصل في أجزاء من الثانية‬ • gaia.cs.umass.edu
‫كل الحمل كان على السيرفر المحلي‬ •

Application Layer 2-9


DNS name root DNS server
resolution example
2 3
recursive query: 7
6
 puts burden of name TLD DNS
resolution on contacted server
name server
local DNS server
 heavy load at upper dns.poly.edu 5 4
levels of hierarchy?
1 8

authoritative DNS server


dns.cs.umass.edu
requesting host
cis.poly.edu

‫أكبر حمل يكون على السيرفر الجذري‬ • gaia.cs.umass.edu

Application Layer 2-10


DNS: caching, updating records
 once (any) name server learns mapping, it caches
mapping (‫)كيف يتم المحافظة على بيانات الكاش حقيقية ومحدثة‬
 cache entries timeout (disappear) after some time (TTL)
(‫ كل حقل له رقم معين بإسم تي تي‬,‫كل الحقول في الكاش بعد إنتهاء فترة زمنية معينة تنتهي وتطلب تحديث البيانات من جديد‬
‫)ال‬
 TLD servers typically cached in local name servers
TLD ‫•المعلومات غالبًا ما تجدها في الـ‬
• thus root name servers not often visited Root servers ‫ونادرًا ما يتم زيارة الـ‬
 cached entries may be out-of-date (best effort
name-to-address translation!)
 if name host changes IP address, may not be known
Internet-wide until all TTLs expire
 update/notify mechanisms proposed IETF standard
 RFC 2136

Application Layer 2-11


DNS records (*)
DNS: distributed db storing resource records (RR)
‫•كل سجل في قاعدة بينات الـ‬
RR format: (name, value, type, ttl) ‫ يحتوي على البيانات‬DNS
‫التالية‬

type=A type=CNAME
 name is alias name for some “ canonical
 name is hostname
” (the real) name
 value is IP address  www.ibm.com is really
type=NS servereast.backup2.ibm.com
 name is domain (e.g.,  value is canonical name
foo.com) (‫قد يكون مخصص لدوين‬ (www.ibm.com)
‫)خاصة بشبكة محلية أو شركة أو جامعة‬
 value is hostname of
authoritative name server type=MX
for this domain  Value(Maile1.google.com) is name of
mailserver associated with
name(www.google .com)

Application Layer 2-12


DNS protocol, messages (*)
 query and reply messages, both with same message format
2 bytes 2 bytes

msg header identification flags

 identification: 16 bit # for # questions # answer RRs


query, reply to query uses
# authority RRs # additional RRs
same #
 flags: questions (variable # of questions)
 query or reply
 recursion desired answers (variable # of RRs)
 recursion available
 reply is authoritative authority (variable # of RRs)

additional info (variable # of RRs)

Application Layer 2-13


DNS protocol, messages (*)

2 bytes 2 bytes

identification flags

# questions # answer RRs

# authority RRs # additional RRs

name, type fields


questions (variable # of questions)
for a query
RRs in response answers (variable # of RRs)
to query
records for authority (variable # of RRs)
authoritative servers
additional “ helpful” additional info (variable # of RRs)
info that may be used
Application Layer 2-14
Inserting records into DNS (*)
 example: new startup “ Network Utopia” ‫•إذا ظهر موقع جديد بإسم‬
 register name networkuptopia.com at DNS registrar
(e.g., Network Solutions)
 provide names, IP addresses of authoritative name server
(primary and secondary)
 registrar inserts two RRs into .com TLD server:
(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

Application Layer 2-15


‫ مما‬DNS ‫•حصل مسبقًا هجوم على بعض مخدمات الـ‬
‫جعلها خارج الخدمة لبعض من الوقت وهذا أدى إلى‬
‫خسائر بمئات الماليين من الدوالرات للعديد من الشركات‬

Attacking DNS (*)


DDoS attacks (distributed DOS) Redirect attacks (‫)هجوم إعادة التوجيه‬
 Man-in-middle
 Bombard root servers with
 Intercept queries
traffic
 Not successful to date (‫حتى اليوم لم‬  DNS poisoning
‫)ينجح أي هجوم من هذا النوع على مخدمات الروت‬
 Send bogus relies to
 Traffic Filtering (‫بسبب وجود العديد من‬ DNS server, which
‫) الفالتر مثل الفيرول وغيرها‬
 Local DNS servers cache caches
IPs of TLD servers, allowing Exploit DNS for DDoS
(‫)استخدامه في الهجوم‬
root server bypass(‫والن معظم الطلبات‬
‫)غالبًا ما يتم الرد عليها من المخدمات في الهرمية األدني‬  Send queries with
 Bombard TLD servers spoofed source address:
 Potentially more dangerous target IP
(‫)هنا الهجوم عليها أخطر ألن الترافيك المار عليها كثير‬
 Requires amplification
Application Layer 2-16

You might also like