0% found this document useful (0 votes)
3 views13 pages

DNS+TCPSockets (1)

The document discusses DNS resolution processes, including iterative resolution and message formats, as well as email protocols like SMTP and POP3. It explains the roles of transport layer protocols such as TCP and UDP in data delivery and connection management. Additionally, it covers the functionalities of IMAP for remote mailbox operations and the structure of FTP for file transfers.

Uploaded by

Ashish Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views13 pages

DNS+TCPSockets (1)

The document discusses DNS resolution processes, including iterative resolution and message formats, as well as email protocols like SMTP and POP3. It explains the roles of transport layer protocols such as TCP and UDP in data delivery and connection management. Additionally, it covers the functionalities of IMAP for remote mailbox operations and the structure of FTP for file transfers.

Uploaded by

Ashish Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

DNS Resolution:

If ROOT and
TLD name servers support Recursion
Dr. Gaurav Varshney IIT Jammu

Dr. Gaurav Varshney IIT Jammu

DNS: Iterative Resolution


• STEP 1: You enter www.example.com in the browser. So the operating system's
resolver will send a DNS query for the A record to the DNS server
172.16.200.30.
Dr. Gaurav Varshney IIT Jammu

• The DNS server 172.16.200.30 on receiving the query, will look through its
tables(cache) to find the IP address(A record) for the domain
www.example.com. But it does not have the entry.

• STEP 3: Now instead of querying the root server's, our DNS server will reply us
back with a referral to root servers. Now our operating system resolver, will
query the root servers for the answer and so on. All the Name Servers will return
a referral without accepting to perform recursion on behalf of the resolver.

Dr. Gaurav Varshney IIT Jammu


DNS: Iterative Resolution
Dr. Gaurav Varshney IIT Jammu

Dr. Gaurav Varshney IIT Jammu

DNS Message Format


A 1-bit query/reply flag indicates
whether the message is a query (0) or a reply
(1).

A1-bit authoritative flag is set in a


reply message when a DNS server is an
Dr. Gaurav Varshney IIT Jammu

authoritative server for a queried name.

A 1-bit recursion-desired flag is set when a


client (host or DNS server) desires that the
DNS server perform recursion when it doesn’t
have the record.

A 1-bit recursion available


field is set in a reply if the DNS server supports
recursion.

Dr. Gaurav Varshney IIT Jammu


DNS Message Format
Dr. Gaurav Varshney IIT Jammu

Dr. Gaurav Varshney IIT Jammu

DNS: Records
Dr. Gaurav Varshney IIT Jammu

Dr. Gaurav Varshney IIT Jammu


DNS: Records
Dr. Gaurav Varshney IIT Jammu

Dr. Gaurav Varshney IIT Jammu

DNS Zone File


Dr. Gaurav Varshney IIT Jammu

https://www.slashroot.in/what-dns-z
one-file-complete-tutorial-zone-file-
and-its-contents Dr. Gaurav Varshney IIT Jammu
DNS Zone File
Dr. Gaurav Varshney IIT Jammu

https://www.slashroot.in/what-dns-z
one-file-complete-tutorial-zone-file-
and-its-contents
Dr. Gaurav Varshney IIT Jammu

DNS Zone File


https://www.slashroot.in/what-dns-z
one-file-complete-tutorial-zone-file-
and-its-contents
Dr. Gaurav Varshney IIT Jammu

http://www.tcpipguide.com/free/t_DNSReverseNameResolutionUsingtheINAD
DRARPADomain-2.htm https://www.cloudflare.com/learning/dns/dns-records/dns-soa-record/
Dr. Gaurav Varshney IIT Jammu
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/4/html/reference_guide/s2-bind-conf
RDNS iguration-zone-reverse
http://www.tcpipguide.com/free/t_DNSReverseNameResolutionUsingtheINADDRARPADomain-2.htm
Dr. Gaurav Varshney IIT Jammu

Jon Postel proposed a Mail Transfer Protocol in 1980

Electronic mail service: Email


As with ordinary postal mail, e-mail is an asynchronous
communication medium—people send and read
messages when it is convenient for them, without having
to coordinate with other people’s schedules.
Dr. Gaurav Varshney IIT Jammu

SMTP is the principal application-layer protocol for


Internet electronic mail. It uses the reliable data
transfer service of TCP to transfer mail from the
sender’s mail server to the recipient’s mail server.

As with most application-layer protocols, SMTP has


two sides: a client side, which executes on the sender’s
mail server, and a server side, which executes on the
recipient’s mail server. Both the client and server sides
of SMTP run on every mail server.
Dr. Gaurav Varshney IIT Jammu
SMTP: RFC 5321
SMTP is much older than HTTP. (The original
SMTP RFC
dates back to 1982,

telnet serverName
Dr. Gaurav Varshney IIT Jammu

25/465/587

The first Web Mail implementation was developed


Dr. Gaurav Varshney IIT Jammu
at CERN in 1993 by Phillip Hallam-Baker

Mail Access Protocols [POP3 : Post Office Protocol]


POP3 is an extremely simple mail access protocol. It is defined
in [RFC 1939], which is short and quite readable.

POP3 begins when the user agent (the client) opens a TCP
Dr. Gaurav Varshney IIT Jammu

connection to the mail server (the server) on port 110.

POP3 progresses through three phases: authorization,


transaction, and update. During the first phase, authorization, the
user agent sends a username and a password (in the clear) to
authenticate the user. During the second phase, transaction, the
user agent retrieves messages; also during this phase, the user
agent can mark messages for deletion, remove deletion marks,
and obtain mail statistics.

Dr. Gaurav Varshney IIT Jammu


Mail Access Protocols [POP3 : Post Office Protocol]
Dr. Gaurav Varshney IIT Jammu

Dr. Gaurav Varshney IIT Jammu

IMAP- Internet Message Access Protocol]


Logging in to Remote IMAP Server Check out the sent box
IMAP allow the user to do operations
remotely on the mailbox. This was not telnet imap.servername.com 143 A EXAMINE INBOX.Sent
possible in POP3 as the mails are
downloaded to the client machine and Login Create a New Folder in Inbox
doing all remote operations such as moving
Dr. Gaurav Varshney IIT Jammu

mail from one to other folder, creating A1 LOGIN username password A CREATE INBOX.NEW
remote folder, retrieving components of a
message etc. are not possible. Displaying remote folder list Check Status of an INBOX

IMAP provides additional functionalities to A2 LIST “” * A STATUS INBOX (MESSAGES)


the email access clients
Examine a specific folder contents Check Flags of Specific Message

A3 EXAMINE INBOX A FETCH 1 FLAGS

https://www.atmail.com/blog/imap-commands/ Select a specific message from INBOX Copy and email from one to another

A FETCH 1 BODY[] A COPY 1 INBOX.Trash

Dr. Gaurav Varshney IIT Jammu


The most striking difference is that FTP uses two parallel TCP
FTP File Transfer Protocol connections to transfer a file, a control connection and a data
connection.

The control connection is used for sending control information


between the two hosts—information such as user identification,
password, commands to change remote directory, and
commands to “put” and “get” files.

The data connection is used to actually send a file.


Dr. Gaurav Varshney IIT Jammu

When the server side receives a command for a file transfer over
the control connection (either to, or from, the remote host), the
server side initiates a TCP data connection to the client side.

FTP sends exactly one file over the data connection and then
closes the data connection. If, during the same session, the user
wants to transfer another file, FTP opens another data connection.

Dr. Gaurav Varshney IIT Jammu


Dr. Gaurav Varshney IIT Jammu

PORT ( h1,h2,h3,h4,p1,p2 ).

(p1 * 256) + p2 = data port

http://www.simotime.com/ftp4cmd1.
htm

Dr. Gaurav Varshney IIT Jammu


Transport Layer Services
• Transport Layer provides process to
process delivery by multiplexing and
demultiplexing.
• It provides a logical connection
Dr. Gaurav Varshney IIT Jammu

between processes running on two


end systems

Dr. Gaurav Varshney IIT Jammu

Transport Layer Services

• Transport Layer Protocol run in end systems and is responsible for


moving messages from applications to network layer.
• Different Transport Layer Protocols provide different set of services to
Dr. Gaurav Varshney IIT Jammu

the applications.
• Transport layer services are constrained by services provided by
network layer. Like Transport layer has not much to commit on delay
and bandwidth if lower layers do not provide any commitments.
• Though it can add some services: such as reliability

Dr. Gaurav Varshney IIT Jammu


Transport Layer Protocols: UDP and TCP
• Always remember that protocol used at network layer or IP is
unreliable and best effort delivery service. [we will come back to it in
the Network Layer]
• User Datagram Protocol provides the minimal services expected from
Dr. Gaurav Varshney IIT Jammu

a transport layer protocol that includes:


• Process to process data delivery
• Error checking
• Transmission Control Protocol provides additional services that
includes:
• Reliable data transfer between two processes
• Congestion control: Fair share of network resources to communicating
applications.
Dr. Gaurav Varshney IIT Jammu

Transport Layer Services


• The job of gathering data chunks at the source
host from different sockets, encapsulating each
data chunk with header information (that will
later be used in demultiplexing) to create
segments, and passing the segments to the
Dr. Gaurav Varshney IIT Jammu

network layer is called multiplexing.


• Job of delivering the data in a transport-layer
segment to the correct socket is called
demultiplexing.
• A process (as part of a network application) can
have one or more sockets, doors through which
data passes from the network to the process and
through which data passes from the process to
the network.
Dr. Gaurav Varshney IIT Jammu
Transport Layer Services
• Source port number field and the Destination
port number field help in process to process
delivery between two hosts.
• Applications open socket which are uniquely
identified by transport layer protocol, port
Dr. Gaurav Varshney IIT Jammu

numbers and IP addresses.


• Transport layer while reading the segment
headers [having destination port number field]
passes the segment data to the appropriate
socket attached to the given port number in the
end system.
• Each port number is a 16-bit number, ranging
from 0 to 65535. The port numbers ranging
from 0 to 1023 are called well-known port
numbers and are restricted Dr. Gaurav Varshney IIT Jammu

Transport Layer: Connectionless UDP


the source port number serves as part of
a “return address”—when B wants to send
a segment back to A, the destination port
in the B-to-A segment will take its value
You may be wondering now, what is the purpose from the source port value of the A-to-B
of the source port number in the segment header ? segment.

It is important to note that a UDP socket


Dr. Gaurav Varshney IIT Jammu

is fully identified by a two-tuple


consisting of a destination IP address
and a destination port number.

Dr. Gaurav Varshney IIT Jammu


Transport Layer: Connection Oriented TCP
The TCP server application has a “welcoming socket,” that waits
for connection establishment requests from TCP clients
Dr. Gaurav Varshney IIT Jammu

Dr. Gaurav Varshney IIT Jammu

TCP: Concurrent
Dr. Gaurav Varshney IIT Jammu

https://www.cs.dartmouth.edu/~ca
mpbell/cs50/socketprogramming.ht
Dr. Gaurav Varshney IIT Jammu
ml

You might also like