Application-Layer Protocols: Based On Notes by D. Hollinger
Application-Layer Protocols: Based On Notes by D. Hollinger
– Interoperability
– Precision
– Extensibility
– Efficiency
– Minimality
• Server class
– KnockKnockServer.java
• Protocol class
– KnockKnockProtocol.java
Netprog 2002 DNS 7
Supporting multiple clients
Server
Process
NVT NVT
TCP TCP
• echo modes
• See GenericClient.java
Control
Server PI User PI
Control
A
A Data B
B
B
B Data C
C
Netprog 2002 DNS 33
Access Control Commands
USER specify user
PASS specify password
CWD change directory
CDUP change directory to parent
QUIT logout
rpi albany
rpi.edu
rpi.edu rpi.edu
DNSrpi.edu
DB
DNS DB DNS
DNSDBDB
Authoritative Replicas
> rpi.edu
Server: oldtotter.cs.rpi.edu
Address: 128.213.8.12
Non-authoritative answer:
Name: rpi.edu
Addresses: 128.113.26.42, 128.113.26.41
rpi albany
Netprog 2002 DNS 58
Server Operation
• If a server has no clue about where to
find the address for a hostname, ask the
root server.
• The root server will tell you what
nameserver to contact.
• A request may get forwarded a few
times.
HEADER
HEADER
QUERIES
QUERIES
Response
Response RESOURCE
RESOURCE RECORDS
RECORDS
Response
Response AUTHORITY
AUTHORITY RECORDS
RECORDS
Response
Response ADDITIONAL
ADDITIONAL INFORMATION
INFORMATION
• flags
• # of questions
• # of RRs
•
•
# of authority RRs
# of additional RRs
} Response
ad = InetAddress.getByName(hostname);
myAddress = InetAddress.getLocalHost();
ad.getHostName();
ad.getHostAddress();
• getAllByName(hostname) returns an
array of InetAddress instances for the given
host name.
– One host name may be mapped to multiple
machines.
– One host name can map to multiple addresses in
the same machine (virtual addresses).
Netprog 2002 DNS 70
Additional InetAddress
methods
• isMulticastAddress() returns a boolean
representing whether it is a Class D address.
• getAllByName(hostname) returns an
array of InetAddress instances for the given
host name.
– One host name may be mapped to multiple
machines.
– One host name can map to multiple addresses in
the same machine (virtual addresses).
Netprog 2002 DNS 71