SlideShare a Scribd company logo
COMPUTER NETWORKS
18CS52
Text Books: 1.James F Kurose and Keith W Ross, Computer Networking, A Top-Down Approach, Sixth edition,
Pearson,2017 . 2. Nader F Mir, Computer and Communication Networks, 2nd Edition, Pearson, 2014.
DNS—The Internet’s Directory Service
• Just as humans can be identified in many ways, so too can Internet
hosts.
• One is hostname. such as cnn.com, www.yahoo.com, jss.edu
• They are mnemonic and are therefore appreciated by humans.
• However, hostnames provide little, if any, information about the
location within the Internet of the host.
• So we have IP addresses.
• four bytes eg 121.7.106.83
• People prefer mnemonic hostname identifier, while routers prefer
fixed-length, hierarchically structured IP addresses.
• DNS- domain name system.
• directory service that translates hostnames to IP addresses.
• DNS = Database + Protocol
• a distributed database implemented in a hierarchy of DNS servers
• an application-layer protocol that allows hosts to query the
distributed database.
• DNS servers often UNIX machines running the Berkeley Internet
Name Domain (BIND) software .
• DNS protocol runs over UDP and uses port 53.
• commonly employed by other application-layer protocols— HTTP,
SMTP, and FTP
• to translate user-supplied hostnames to IP addresses
what happens when a browser ( an HTTP client) ,running on some user’s host,
requests URL www.someschool.edu/index.html?
1. user host machine runs the client side of the DNS application.
2. browser extracts the hostname, www.someschool.edu, from the URL and
passes the hostname to the client side of the DNS application.
3. DNS client sends a query containing the hostname to a DNS server.
4. DNS client eventually receives a reply, which includes the IP address for
the hostname.
5. Once the browser receives the IP address from DNS, it can initiate a TCP
connection to the HTTP server process located at port 80 at that IP address.
How DNS Works?
• Heart- DNS servers (database-hostname v/s ip address)
• A simple design- one DNS server that contains all the mappings- Centralized
Problems:
1. A single point of failure.
2. Traffic volume
3. Distant centralized database:
A single DNS server cannot be “close to” all the querying clients.
 If single DNS server in New York , then all queries from Australia
must travel to the other side of the globe
over slow and congested links- lead to significant delays.
4. Maintenance:
 centralized database be huge
 it would have to be updated frequently to account for every new host.
A Distributed, Hierarchical Database
3 classes of DNS
servers:
1. Root DNS servers
2. Top-level domain (TLD)
servers.
3. Authoritative DNS
servers.
• Root DNS servers
 13 root DNS servers (labeled A through M), most of which are
located in North America
 each “server” is actually a network of replicated servers, for both
security and reliability purposes.
• Top-level domain (TLD) servers
 responsible for top-level domains such as com, org, net, edu, gov
 Also top-level domains such as uk, fr, ca, in etc
 The company Verisign Global Registry Services maintains the TLD
servers for the com top-level domain,
 The company Educause maintains the TLD servers for the edu
top-level domain.
• Authoritative DNS servers.
 Every organization with publicly accessible hosts ( Web servers, mail
servers) on Internet must provide Public DNS records that map the
names of those hosts to IP addresses.
 authoritative DNS server to hold these records for a given domain
 an organization can choose to implement its own or can pay some
service provider.
 large companies implement and maintain their own primary and
secondary (backup) authoritative DNS server
• Local DNS server
• Organizations also frequently use DNS internally.
• DNS lookups and records stay within the corporate network instead of on
the Internet. “private” or “local”
Iterative DNS Query
Recursive DNS Query
DNS Caching
• In a query chain, when a DNS server receives a DNS reply
it can cache the mapping in its local memory.
• When another query arrives to the DNS server for the same
hostname, the DNS server can provide the desired IP
address, even if it is not authoritative for the hostname.
• Since mappings between hostnames and IP addresses are
by no means permanent, DNS servers discard cached
information after a period of time (often set to two days).
DNS Records and Messages
• DNS distributed database store resource records (RRs)
• RRs that provide hostname-to-IP address mappings.
• Each DNS reply message carries one or more RRs
• [RFC 1034; RFC 1035].
• A resource record is a four-tuple that contains the following
fields: (Name, Value, Type, TTL)
• TTL - time to live of the RR (when a resource should be
removed from a cache).
• meaning of Name and Value depend on Type
 If Type=A
• then Name = hostname and Value = IP address for the hostname.
• Type A record provides the standard hostname-to-IP address mapping.
• example RR : (relay1.bar.foo.com, 145.37.93.126, A) is a Type A record
 If Type=NS
• then Name = a domain (say foo.com)
• Value= hostname of an authoritative DNS server that knows how to
obtain the IP addresses for hosts in that domain.
• used to route DNS queries further along in the query chain.
• example, (foo.com, dns.foo.com, NS) is a Type NS record.
Meaning of Name and Value depend on Type
 If Type=CNAME
• then Value = canonical hostname for the alias hostname Name.
• provides querying hosts the canonical name for a hostname.
• example, (foo.com, relay1.bar.foo.com, CNAME) is a CNAME record.
 If Type=MX
• then Value = canonical name of a mail server that has an alias hostname Name.
• example, (foo.com, mail.bar.foo.com, MX) is an MX record.
• allows the hostnames of mail servers to have simple aliases.
Note:
• a company can have the same aliased name for its mail server and for one of its
other servers (such as its Web server).
• To obtain the canonical name for the mail server, a DNS client would query for an
MX record
• to obtain the canonical name for the other server, the DNS client would query for
the CNAME record
Examples of using CNAME records
• Providing a separate hostname for specific network services,
such as email or FTP, and pointing that hostname to the root
domain
• Many hosted services provide a subdomain for each customer
on the service provider’s domain (e.g. company.hostname.com),
and use CNAME to point to the customer’s domain
(www.company.com).
• Registering the same domain in several countries and pointing
the country versions to the main “.com” domain
• Pointing from several websites owned by the same organization
to a primary website
DNS Messages and format
• DNS query and reply messages
• First 12 bytes -header section.
• first field of header section is a 16-bit
number that identifies the query.
• This identifier is copied into the reply
message to a query, allowing the client
to match received replies with sent
queries.
• flags field.
• A 1-bit query/reply flag- query (0) or a
reply (1).
• A 1-bit authoritative flag is set in a
reply message when a DNS server is an
authoritative server for a queried
name.
• A1-bit recursion-desired flag
• A 1-bit recursion available field is set in
a reply if the DNS server supports
recursion
• Question section contains information about the query made.
• includes 1. a name field (name that is being queried) and 2. a type field type
of question being asked about the name—(Type A, Type MX etc).
• In a reply from a DNS server, the Answer section contains the RRs for the
name that was originally queried.
• A reply can return multiple RRs in the answer, since a hostname can have
multiple IP addresses( replicated Web servers)
• Authority section contains records of other authoritative servers.
• The additional section contains other helpful records. For example, the
answer field in a reply to an MX query contains a resource record providing
the canonical hostname of a mail server.additional section contains a Type A
record providing the IP address for the canonical hostname of the mail
server.
Peer-to-Peer Applications- BitTorrent
• BitTorrent is a popular P2P protocol for file distribution
• collection of all peers participating in the distribution of a particular file is
called a torrent.
• Peers in a torrent download equal-size chunks of the file from one
another, with a typical chunk size of 256 KB. When a peer first joins a
torrent, it has no chunks.
• Over time it accumulates more and more chunks.
• While it downloads chunks it also uploads chunks to other peers
• Once a peer has acquired the entire file, it may (selfishly) leave the
torrent, or (altruistically) remain in the torrent and continue to upload
chunks to other peers.
• Also, any peer may leave the torrent at any time with only a subset of
chunks, and later rejoin the torrent.
• Each torrent has an
infrastructure node called a
tracker.
• When a peer joins a torrent, it
registers itself with the tracker
and periodically informs the
tracker that it is still in the
torrent.
• tracker keeps track of the peers
that are participating in the
torrent.
• A given torrent may have fewer
than ten or more than a
thousand peers participating at
any instant of time.
• tracker randomly selects a subset of peers (say 50) from the set of
participating peers, and sends the IP addresses of these 50 peers to Alice.
• Alice attempts to establish concurrent TCP connections with all the peers
on this list.
• If Alice succeeds in establishing a TCP connection- “neighboring peers.”
• As time evolves, some of these peers may leave and other peers may
attempt to establish TCP connections with Alice.
• So a peer’s neighboring peers will fluctuate over time.
• At any given time, each peer will have a subset of chunks from the file
• different peers having different subsets.
• Periodically, Alice will ask neighboring peers for the list of chunks they
have.
• If Alice has L different neighbors, she will obtain L lists of chunks.
• Alice requests for chunks she currently does not have.
when a new peer, Alice, joins the torrent..
2 important decisions Alice should make
1. which chunks should she request first?
2. to which of her neighbors should she send
requested chunks?
Answer
1.Rarest first.
2.Clever trading algorithm.
• priority to the neighbors that are currently supplying her data at the highest rate.
• Alice continually measures the rate at which she receives bits and determines the
four peers that are feeding her bits at the highest rate.
• sends chunks to these four peers.
• Every 10 seconds, recalculate & possibly modifies the set of four peers.
• these four peers - said to be unchoked.
• Also, every 30 seconds, she picks one additional neighbor at random (say Bob) and
sends it chunks.
• Bob is said to be optimistically unchoked.
• Because Alice is sending data to Bob, she may become one of Bob’s top four
uploaders, in which case Bob would start to send data to Alice.
• If the rate at which Bob sends data to Alice is high enough, Bob could then, in
turn, become one of Alice’s top four uploaders.
• incentive mechanism for trading- tit-for-tat
Clever trading algorithm
Distributed Hash Tables (DHTs)
• Example: Bob & Charlie has Linux copy
• key-value pairs (Linux, IPBob) and (Linux, IPCharlie).
• some peer, say Dave, will be responsible for the key “Linux” and
will have the corresponding key-value pairs (but why Dave!!!)
• suppose Alice wants a copy of Linux.
• she queries the DHT with “Linux” as the key.
• DHT determines that the peer Dave is responsible for the key
“Linux.”
• DHT then contacts peer Dave, obtains from Dave the key-value
pairs (Linux, IPBob) and (Linux, IPCharlie), and passes them on to
Alice.
• Alice can then download the latest Linux distribution from either
IPBob or IPCharlie.
Naive approach to build DHT
• randomly scatter the (key, value) pairs across all the peers and have each peer
maintain a list of the IP addresses of all participating peers.
• peer sends its query to all other peers, and the peers containing the (key, value) pairs
that match the key can respond with their matching pairs.
• unscalable, requires each peer to not only know about all other peers (possibly
millions of such peers!) but even worse, have each query sent to all peer.
Elegant Hash approach
• A hash function is a many-to-one function for which two different inputs can have
the same output.
• closest successor of the key.
• 8 peers with identifiers 1, 3, 4, 5, 8, 10, 12, and 15.
• Finally, suppose we want to store the (key, value) pair (11, Johnny Wu) in one of the
eight peers. since peer 12 is the closest successor for key 11, we therefore store the
pair (11, Johnny Wu) in the peer 12.
• Problem is Alice should know all peers id
Circular DHT
• Each peer only keeps track of its immediate
successor and immediate predecessor (modulo
2n).
• suppose peer 3 wants to determine which peer
in the DHT is responsible for key 11??
• message “Who is responsible for key 11?” is
sent clockwise around the circle.
• worst case- all N nodes in the DHT will have to
forward a message around the circle N/2
messages
• tradeoff between the number of neighbors each
peer has to track and the number of messages
that the DHT needs to send to resolve a single
query.
Overlay Circular DHT with shortcuts
Peer Churn
• In P2P systems, a peer can come or go without warning.
• Thus, when designing a DHT, we also must be concerned about maintaining
the DHT overlay in the presence of such peer churn.
• each peer to track its first and second successors
• Suppose peer 5 abruptly leaves.
• two peers preceding the departed peer (4 and 3) learn that 5 has departed,
since it no longer responds to ping messages.
• Peers 4 and 3 thus need to update their successor state information.
• how peer 4 updates its state:
1. Peer 4 replaces its first successor (5) with its second successor (8).
2. Peer 4 then asks its new first successor (peer 8) for the identifier and IP
address of its immediate successor (peer 10). Peer 4 then makes peer
10 its second successor
Socket Programming: Creating Network Applications
UDP
Socket
TCP
Socket
Computer Networks Module 1 - part 2.pdf

More Related Content

What's hot

TCP/IP model
TCP/IP modelTCP/IP model
TCP/IP model
Krishnkant Pandey
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
Dawood Faheem Abbasi
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
Rajan Pandey
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
FabMinds
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
Naiyan Noor
 
Multiple Access Protocal
Multiple Access ProtocalMultiple Access Protocal
Multiple Access Protocal
tes31
 
Transmission Impairment (Attenuation, Distortion, Noise)
Transmission Impairment (Attenuation, Distortion, Noise)Transmission Impairment (Attenuation, Distortion, Noise)
Transmission Impairment (Attenuation, Distortion, Noise)
Noor Nabi
 
Chapter 6 - Computer Networking a top-down Approach 7th
Chapter 6 - Computer Networking a top-down Approach 7thChapter 6 - Computer Networking a top-down Approach 7th
Chapter 6 - Computer Networking a top-down Approach 7th
Andy Juan Sarango Veliz
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
Manoj Kumar
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
Kruti Niranjan
 
Data communications and networking(DCN)
Data communications and networking(DCN)Data communications and networking(DCN)
Data communications and networking(DCN)
hiteshchowdary5
 
Introduction to Application layer
Introduction to Application layerIntroduction to Application layer
Introduction to Application layer
Dr. C.V. Suresh Babu
 
transport layer
transport layer transport layer
transport layer
usman19
 
TCP/IP
TCP/IPTCP/IP
Chap 8 switching
Chap 8 switchingChap 8 switching
Chap 8 switching
Mukesh Tekwani
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
Mukesh Tekwani
 
Sania rtp
Sania rtpSania rtp
Sania rtp
saniacorreya
 
Tcp and udp
Tcp and udpTcp and udp
Tcp and udp
Ahmad Khalid Nasrat
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
Harish Chand
 
Ethernet - Networking presentation
Ethernet - Networking presentationEthernet - Networking presentation
Ethernet - Networking presentation
Viet Nguyen
 

What's hot (20)

TCP/IP model
TCP/IP modelTCP/IP model
TCP/IP model
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
 
Multiple Access Protocal
Multiple Access ProtocalMultiple Access Protocal
Multiple Access Protocal
 
Transmission Impairment (Attenuation, Distortion, Noise)
Transmission Impairment (Attenuation, Distortion, Noise)Transmission Impairment (Attenuation, Distortion, Noise)
Transmission Impairment (Attenuation, Distortion, Noise)
 
Chapter 6 - Computer Networking a top-down Approach 7th
Chapter 6 - Computer Networking a top-down Approach 7thChapter 6 - Computer Networking a top-down Approach 7th
Chapter 6 - Computer Networking a top-down Approach 7th
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
 
Data communications and networking(DCN)
Data communications and networking(DCN)Data communications and networking(DCN)
Data communications and networking(DCN)
 
Introduction to Application layer
Introduction to Application layerIntroduction to Application layer
Introduction to Application layer
 
transport layer
transport layer transport layer
transport layer
 
TCP/IP
TCP/IPTCP/IP
TCP/IP
 
Chap 8 switching
Chap 8 switchingChap 8 switching
Chap 8 switching
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
 
Sania rtp
Sania rtpSania rtp
Sania rtp
 
Tcp and udp
Tcp and udpTcp and udp
Tcp and udp
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
 
Ethernet - Networking presentation
Ethernet - Networking presentationEthernet - Networking presentation
Ethernet - Networking presentation
 

Similar to Computer Networks Module 1 - part 2.pdf

Presentation on Domain Name System
Presentation on Domain Name SystemPresentation on Domain Name System
Presentation on Domain Name System
Chinmay Joshi
 
Dns
DnsDns
DNS
DNSDNS
10 - Domain Name System.ppt
10 - Domain Name System.ppt10 - Domain Name System.ppt
10 - Domain Name System.ppt
ssuserf7cd2b
 
Domain name system advanced power point presentation
Domain name system advanced power point presentationDomain name system advanced power point presentation
Domain name system advanced power point presentation
rituchouhan1508
 
DNS(In_Linux).pptx
DNS(In_Linux).pptxDNS(In_Linux).pptx
DNS(In_Linux).pptx
ShanmugapriyaSenthil3
 
DNS_Presentation.pptx
DNS_Presentation.pptxDNS_Presentation.pptx
DNS_Presentation.pptx
RAJESHKUMAR216309
 
Intro to DNS
Intro to DNSIntro to DNS
Intro to DNS
ThousandEyes
 
3-Application Layer.pptx
3-Application Layer.pptx3-Application Layer.pptx
3-Application Layer.pptx
SachinDUpadhye
 
Dns ppt
Dns pptDns ppt
Introduction to DNS
Introduction to DNSIntroduction to DNS
Introduction to DNS
MifrazMurthaja
 
Dns
DnsDns
Secure shell (ssh)
Secure shell (ssh)Secure shell (ssh)
Secure shell (ssh)
Ishucs
 
Lets talk dns
Lets talk dnsLets talk dns
Lets talk dns
Abhinav Mehta
 
Chapter4 configuringandmanagingthednsserverrole-140520003253-phpapp01
Chapter4 configuringandmanagingthednsserverrole-140520003253-phpapp01Chapter4 configuringandmanagingthednsserverrole-140520003253-phpapp01
Chapter4 configuringandmanagingthednsserverrole-140520003253-phpapp01
velimamedov
 
slide on DNS
slide on DNSslide on DNS
slide on DNS
webhostingguy
 
23rd PITA AGM and Conference: DNS Security - A holistic view
23rd PITA AGM and Conference: DNS Security - A holistic view 23rd PITA AGM and Conference: DNS Security - A holistic view
23rd PITA AGM and Conference: DNS Security - A holistic view
APNIC
 
Domain Name System (DNS) - Domain Registration and Website Hosting Basics
Domain Name System (DNS) - Domain Registration and Website Hosting BasicsDomain Name System (DNS) - Domain Registration and Website Hosting Basics
Domain Name System (DNS) - Domain Registration and Website Hosting Basics
Asif Shahzad
 
Dn sonly
Dn sonlyDn sonly
Dn sonly
vikram vivek
 
Chapter 4 configuring and managing the dns server role
Chapter 4   configuring and managing the dns server roleChapter 4   configuring and managing the dns server role
Chapter 4 configuring and managing the dns server role
Luis Garay
 

Similar to Computer Networks Module 1 - part 2.pdf (20)

Presentation on Domain Name System
Presentation on Domain Name SystemPresentation on Domain Name System
Presentation on Domain Name System
 
Dns
DnsDns
Dns
 
DNS
DNSDNS
DNS
 
10 - Domain Name System.ppt
10 - Domain Name System.ppt10 - Domain Name System.ppt
10 - Domain Name System.ppt
 
Domain name system advanced power point presentation
Domain name system advanced power point presentationDomain name system advanced power point presentation
Domain name system advanced power point presentation
 
DNS(In_Linux).pptx
DNS(In_Linux).pptxDNS(In_Linux).pptx
DNS(In_Linux).pptx
 
DNS_Presentation.pptx
DNS_Presentation.pptxDNS_Presentation.pptx
DNS_Presentation.pptx
 
Intro to DNS
Intro to DNSIntro to DNS
Intro to DNS
 
3-Application Layer.pptx
3-Application Layer.pptx3-Application Layer.pptx
3-Application Layer.pptx
 
Dns ppt
Dns pptDns ppt
Dns ppt
 
Introduction to DNS
Introduction to DNSIntroduction to DNS
Introduction to DNS
 
Dns
DnsDns
Dns
 
Secure shell (ssh)
Secure shell (ssh)Secure shell (ssh)
Secure shell (ssh)
 
Lets talk dns
Lets talk dnsLets talk dns
Lets talk dns
 
Chapter4 configuringandmanagingthednsserverrole-140520003253-phpapp01
Chapter4 configuringandmanagingthednsserverrole-140520003253-phpapp01Chapter4 configuringandmanagingthednsserverrole-140520003253-phpapp01
Chapter4 configuringandmanagingthednsserverrole-140520003253-phpapp01
 
slide on DNS
slide on DNSslide on DNS
slide on DNS
 
23rd PITA AGM and Conference: DNS Security - A holistic view
23rd PITA AGM and Conference: DNS Security - A holistic view 23rd PITA AGM and Conference: DNS Security - A holistic view
23rd PITA AGM and Conference: DNS Security - A holistic view
 
Domain Name System (DNS) - Domain Registration and Website Hosting Basics
Domain Name System (DNS) - Domain Registration and Website Hosting BasicsDomain Name System (DNS) - Domain Registration and Website Hosting Basics
Domain Name System (DNS) - Domain Registration and Website Hosting Basics
 
Dn sonly
Dn sonlyDn sonly
Dn sonly
 
Chapter 4 configuring and managing the dns server role
Chapter 4   configuring and managing the dns server roleChapter 4   configuring and managing the dns server role
Chapter 4 configuring and managing the dns server role
 

Recently uploaded

原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
OKORIE1
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
UNIT-III- DATA CONVERTERS ANALOG TO DIGITAL CONVERTER
UNIT-III- DATA CONVERTERS ANALOG TO DIGITAL CONVERTERUNIT-III- DATA CONVERTERS ANALOG TO DIGITAL CONVERTER
UNIT-III- DATA CONVERTERS ANALOG TO DIGITAL CONVERTER
vmspraneeth
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
Kamal Acharya
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
Properties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure MeasurementProperties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure Measurement
Indrajeet sahu
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
DharmaBanothu
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 
Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.
supriyaDicholkar1
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUESAN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
drshikhapandey2022
 
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
GiselleginaGloria
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
EMERSON EDUARDO RODRIGUES
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 

Recently uploaded (20)

原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
UNIT-III- DATA CONVERTERS ANALOG TO DIGITAL CONVERTER
UNIT-III- DATA CONVERTERS ANALOG TO DIGITAL CONVERTERUNIT-III- DATA CONVERTERS ANALOG TO DIGITAL CONVERTER
UNIT-III- DATA CONVERTERS ANALOG TO DIGITAL CONVERTER
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
Properties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure MeasurementProperties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure Measurement
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 
Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence.
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUESAN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
 
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
3rd International Conference on Artificial Intelligence Advances (AIAD 2024)
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 

Computer Networks Module 1 - part 2.pdf

  • 1. COMPUTER NETWORKS 18CS52 Text Books: 1.James F Kurose and Keith W Ross, Computer Networking, A Top-Down Approach, Sixth edition, Pearson,2017 . 2. Nader F Mir, Computer and Communication Networks, 2nd Edition, Pearson, 2014.
  • 2. DNS—The Internet’s Directory Service • Just as humans can be identified in many ways, so too can Internet hosts. • One is hostname. such as cnn.com, www.yahoo.com, jss.edu • They are mnemonic and are therefore appreciated by humans. • However, hostnames provide little, if any, information about the location within the Internet of the host. • So we have IP addresses. • four bytes eg 121.7.106.83 • People prefer mnemonic hostname identifier, while routers prefer fixed-length, hierarchically structured IP addresses. • DNS- domain name system. • directory service that translates hostnames to IP addresses.
  • 3. • DNS = Database + Protocol • a distributed database implemented in a hierarchy of DNS servers • an application-layer protocol that allows hosts to query the distributed database. • DNS servers often UNIX machines running the Berkeley Internet Name Domain (BIND) software . • DNS protocol runs over UDP and uses port 53. • commonly employed by other application-layer protocols— HTTP, SMTP, and FTP • to translate user-supplied hostnames to IP addresses
  • 4. what happens when a browser ( an HTTP client) ,running on some user’s host, requests URL www.someschool.edu/index.html? 1. user host machine runs the client side of the DNS application. 2. browser extracts the hostname, www.someschool.edu, from the URL and passes the hostname to the client side of the DNS application. 3. DNS client sends a query containing the hostname to a DNS server. 4. DNS client eventually receives a reply, which includes the IP address for the hostname. 5. Once the browser receives the IP address from DNS, it can initiate a TCP connection to the HTTP server process located at port 80 at that IP address.
  • 5. How DNS Works? • Heart- DNS servers (database-hostname v/s ip address) • A simple design- one DNS server that contains all the mappings- Centralized Problems: 1. A single point of failure. 2. Traffic volume 3. Distant centralized database: A single DNS server cannot be “close to” all the querying clients.  If single DNS server in New York , then all queries from Australia must travel to the other side of the globe over slow and congested links- lead to significant delays. 4. Maintenance:  centralized database be huge  it would have to be updated frequently to account for every new host.
  • 6. A Distributed, Hierarchical Database 3 classes of DNS servers: 1. Root DNS servers 2. Top-level domain (TLD) servers. 3. Authoritative DNS servers.
  • 7. • Root DNS servers  13 root DNS servers (labeled A through M), most of which are located in North America  each “server” is actually a network of replicated servers, for both security and reliability purposes. • Top-level domain (TLD) servers  responsible for top-level domains such as com, org, net, edu, gov  Also top-level domains such as uk, fr, ca, in etc  The company Verisign Global Registry Services maintains the TLD servers for the com top-level domain,  The company Educause maintains the TLD servers for the edu top-level domain.
  • 8. • Authoritative DNS servers.  Every organization with publicly accessible hosts ( Web servers, mail servers) on Internet must provide Public DNS records that map the names of those hosts to IP addresses.  authoritative DNS server to hold these records for a given domain  an organization can choose to implement its own or can pay some service provider.  large companies implement and maintain their own primary and secondary (backup) authoritative DNS server • Local DNS server • Organizations also frequently use DNS internally. • DNS lookups and records stay within the corporate network instead of on the Internet. “private” or “local”
  • 11. DNS Caching • In a query chain, when a DNS server receives a DNS reply it can cache the mapping in its local memory. • When another query arrives to the DNS server for the same hostname, the DNS server can provide the desired IP address, even if it is not authoritative for the hostname. • Since mappings between hostnames and IP addresses are by no means permanent, DNS servers discard cached information after a period of time (often set to two days).
  • 12. DNS Records and Messages • DNS distributed database store resource records (RRs) • RRs that provide hostname-to-IP address mappings. • Each DNS reply message carries one or more RRs • [RFC 1034; RFC 1035]. • A resource record is a four-tuple that contains the following fields: (Name, Value, Type, TTL) • TTL - time to live of the RR (when a resource should be removed from a cache). • meaning of Name and Value depend on Type
  • 13.  If Type=A • then Name = hostname and Value = IP address for the hostname. • Type A record provides the standard hostname-to-IP address mapping. • example RR : (relay1.bar.foo.com, 145.37.93.126, A) is a Type A record  If Type=NS • then Name = a domain (say foo.com) • Value= hostname of an authoritative DNS server that knows how to obtain the IP addresses for hosts in that domain. • used to route DNS queries further along in the query chain. • example, (foo.com, dns.foo.com, NS) is a Type NS record. Meaning of Name and Value depend on Type
  • 14.  If Type=CNAME • then Value = canonical hostname for the alias hostname Name. • provides querying hosts the canonical name for a hostname. • example, (foo.com, relay1.bar.foo.com, CNAME) is a CNAME record.  If Type=MX • then Value = canonical name of a mail server that has an alias hostname Name. • example, (foo.com, mail.bar.foo.com, MX) is an MX record. • allows the hostnames of mail servers to have simple aliases. Note: • a company can have the same aliased name for its mail server and for one of its other servers (such as its Web server). • To obtain the canonical name for the mail server, a DNS client would query for an MX record • to obtain the canonical name for the other server, the DNS client would query for the CNAME record
  • 15. Examples of using CNAME records • Providing a separate hostname for specific network services, such as email or FTP, and pointing that hostname to the root domain • Many hosted services provide a subdomain for each customer on the service provider’s domain (e.g. company.hostname.com), and use CNAME to point to the customer’s domain (www.company.com). • Registering the same domain in several countries and pointing the country versions to the main “.com” domain • Pointing from several websites owned by the same organization to a primary website
  • 16. DNS Messages and format • DNS query and reply messages • First 12 bytes -header section. • first field of header section is a 16-bit number that identifies the query. • This identifier is copied into the reply message to a query, allowing the client to match received replies with sent queries. • flags field. • A 1-bit query/reply flag- query (0) or a reply (1). • A 1-bit authoritative flag is set in a reply message when a DNS server is an authoritative server for a queried name. • A1-bit recursion-desired flag • A 1-bit recursion available field is set in a reply if the DNS server supports recursion
  • 17. • Question section contains information about the query made. • includes 1. a name field (name that is being queried) and 2. a type field type of question being asked about the name—(Type A, Type MX etc). • In a reply from a DNS server, the Answer section contains the RRs for the name that was originally queried. • A reply can return multiple RRs in the answer, since a hostname can have multiple IP addresses( replicated Web servers) • Authority section contains records of other authoritative servers. • The additional section contains other helpful records. For example, the answer field in a reply to an MX query contains a resource record providing the canonical hostname of a mail server.additional section contains a Type A record providing the IP address for the canonical hostname of the mail server.
  • 18. Peer-to-Peer Applications- BitTorrent • BitTorrent is a popular P2P protocol for file distribution • collection of all peers participating in the distribution of a particular file is called a torrent. • Peers in a torrent download equal-size chunks of the file from one another, with a typical chunk size of 256 KB. When a peer first joins a torrent, it has no chunks. • Over time it accumulates more and more chunks. • While it downloads chunks it also uploads chunks to other peers • Once a peer has acquired the entire file, it may (selfishly) leave the torrent, or (altruistically) remain in the torrent and continue to upload chunks to other peers. • Also, any peer may leave the torrent at any time with only a subset of chunks, and later rejoin the torrent.
  • 19. • Each torrent has an infrastructure node called a tracker. • When a peer joins a torrent, it registers itself with the tracker and periodically informs the tracker that it is still in the torrent. • tracker keeps track of the peers that are participating in the torrent. • A given torrent may have fewer than ten or more than a thousand peers participating at any instant of time.
  • 20. • tracker randomly selects a subset of peers (say 50) from the set of participating peers, and sends the IP addresses of these 50 peers to Alice. • Alice attempts to establish concurrent TCP connections with all the peers on this list. • If Alice succeeds in establishing a TCP connection- “neighboring peers.” • As time evolves, some of these peers may leave and other peers may attempt to establish TCP connections with Alice. • So a peer’s neighboring peers will fluctuate over time. • At any given time, each peer will have a subset of chunks from the file • different peers having different subsets. • Periodically, Alice will ask neighboring peers for the list of chunks they have. • If Alice has L different neighbors, she will obtain L lists of chunks. • Alice requests for chunks she currently does not have. when a new peer, Alice, joins the torrent..
  • 21. 2 important decisions Alice should make 1. which chunks should she request first? 2. to which of her neighbors should she send requested chunks? Answer 1.Rarest first. 2.Clever trading algorithm.
  • 22. • priority to the neighbors that are currently supplying her data at the highest rate. • Alice continually measures the rate at which she receives bits and determines the four peers that are feeding her bits at the highest rate. • sends chunks to these four peers. • Every 10 seconds, recalculate & possibly modifies the set of four peers. • these four peers - said to be unchoked. • Also, every 30 seconds, she picks one additional neighbor at random (say Bob) and sends it chunks. • Bob is said to be optimistically unchoked. • Because Alice is sending data to Bob, she may become one of Bob’s top four uploaders, in which case Bob would start to send data to Alice. • If the rate at which Bob sends data to Alice is high enough, Bob could then, in turn, become one of Alice’s top four uploaders. • incentive mechanism for trading- tit-for-tat Clever trading algorithm
  • 23. Distributed Hash Tables (DHTs) • Example: Bob & Charlie has Linux copy • key-value pairs (Linux, IPBob) and (Linux, IPCharlie). • some peer, say Dave, will be responsible for the key “Linux” and will have the corresponding key-value pairs (but why Dave!!!) • suppose Alice wants a copy of Linux. • she queries the DHT with “Linux” as the key. • DHT determines that the peer Dave is responsible for the key “Linux.” • DHT then contacts peer Dave, obtains from Dave the key-value pairs (Linux, IPBob) and (Linux, IPCharlie), and passes them on to Alice. • Alice can then download the latest Linux distribution from either IPBob or IPCharlie.
  • 24. Naive approach to build DHT • randomly scatter the (key, value) pairs across all the peers and have each peer maintain a list of the IP addresses of all participating peers. • peer sends its query to all other peers, and the peers containing the (key, value) pairs that match the key can respond with their matching pairs. • unscalable, requires each peer to not only know about all other peers (possibly millions of such peers!) but even worse, have each query sent to all peer. Elegant Hash approach • A hash function is a many-to-one function for which two different inputs can have the same output. • closest successor of the key. • 8 peers with identifiers 1, 3, 4, 5, 8, 10, 12, and 15. • Finally, suppose we want to store the (key, value) pair (11, Johnny Wu) in one of the eight peers. since peer 12 is the closest successor for key 11, we therefore store the pair (11, Johnny Wu) in the peer 12. • Problem is Alice should know all peers id
  • 25. Circular DHT • Each peer only keeps track of its immediate successor and immediate predecessor (modulo 2n). • suppose peer 3 wants to determine which peer in the DHT is responsible for key 11?? • message “Who is responsible for key 11?” is sent clockwise around the circle. • worst case- all N nodes in the DHT will have to forward a message around the circle N/2 messages • tradeoff between the number of neighbors each peer has to track and the number of messages that the DHT needs to send to resolve a single query.
  • 26. Overlay Circular DHT with shortcuts
  • 27. Peer Churn • In P2P systems, a peer can come or go without warning. • Thus, when designing a DHT, we also must be concerned about maintaining the DHT overlay in the presence of such peer churn. • each peer to track its first and second successors • Suppose peer 5 abruptly leaves. • two peers preceding the departed peer (4 and 3) learn that 5 has departed, since it no longer responds to ping messages. • Peers 4 and 3 thus need to update their successor state information. • how peer 4 updates its state: 1. Peer 4 replaces its first successor (5) with its second successor (8). 2. Peer 4 then asks its new first successor (peer 8) for the identifier and IP address of its immediate successor (peer 10). Peer 4 then makes peer 10 its second successor
  • 28. Socket Programming: Creating Network Applications UDP Socket
  • 29.