You are on page 1of 6

Assignment 2

Data Networks and


Communications
Dr. Khurram Zaidi

Amna (FA19-REE-020)
Q#1:
Differences between TCP and UDP
TCP (Transmission control protocol) and UDP (User Datagram Protocol) are internet transport
layer protocols. Both protocols provide different features. Following are the differences between
TCP and UDP from view point of P2P, Socket, Email and HTTP.

TCP UDP
TCP is a connection oriented protocol. It UDP is a connectionless protocol. It does
provides error checking mechanism and provide basic error checking mechanism. It
reliable communication. Retransmission of does not provide reliable communication and
missing packets is possible in TCP. Moreover, packets may miss in transmission. Moreover,
TCP is slower than UDP. UDP is faster than TCP
P2P communication uses TCP as its transport P2P communication uses UDP to control
protocol. packets.

Loss intolerant applications use TCP and their Loss tolerant applications use
socket programming is done with TCP. UDP and their socket programming is done
with UDP.

Email needs reliable communication i.e. UDP does not provide reliable
message must be transferred and it can bear communication. So, email that needs message
elastic throughput. Moreover, TCP provides to be transferred correctly does not use this
security. So, Email uses TCP protocol.

File transfer needs reliable communication. So, File transfer can bear time delay but it cannot
HTTP uses TCP as underlying protocol. bear loss of data. That’s why it does not use
UDP as its underlying transport protocol.

Q#2
Cookies and Caches
Cookies and caches both store data on the user’s machine. But both serve very different
purposes. Cookies are stored on user’s machine to track user’s activities. It generally stores
information that is specific to a website i.e. password, date and time of the visit etc. When a user
loads a website its cookie is being sent back to the server to notify the website for user’s activity.
Cookies store data for a short period of time. After that time, cookie expires.
Cache stores data i.e. files and images etc. to reduce the time of access of a website. Moreover, it
also reduces the bandwidth usage and server load. When a user loads a specific website, caches
store data of the website. And when a user access it again, the file is loaded from the cache.
Q#3
a- Differences between POP3 and IMAP
Both POP3 and IMAP are used to access email from server on the receiving side. Both of them
serves the same purpose, but they offer different features. The differences between POP3 and
IMAP are given below:

POP3 IMAP
POP3 is a stateless protocol IMAP is not a stateless protocol. It keeps user
state.
It downloads the message on a single It keeps all the messages on the server.
computer and deletes it from the server.
It does not allow user to organize messages in It allows user to organize messages in
different folders. different folders.
Powerful protocol to access email offline Powerful protocol for receiving emails on
multiple devices

b- Difference between commercial level mails( Gmail) and outlook, thunderbird

Gmail Outlook/Thunderbird
It provides service of sending and receiving It is an email client that uses the services
messages provided by other email service providers.
Provide a feature to search messages based on Sorts messages by date, size etc.
date, topic etc.
Tag messages with labels Organize messages in folders
Star important messages Flag important messages
Color code labels Provide colors to messages
Manage incoming emails with filters Manage incoming emails with rules
Archives messages Deletes messages to save space
Less messages go to spam More secure because it has a strict criteria to
scrutinize data

Q#4
Role of Root, TLD and Authoritative DNS servers
DNS servers i.e. Root, TLD and Authoritative provide a hierarchical structure [ CITATION
Ren \l 1033 ]. All serve for a different purpose. If one DNS server is used, it would provide a
single point of failure. Moreover, traffic volume would be high and maintenance would be
difficult. Following are the main purposes of these DNS servers:
Root main servers are at the highest rank in the hierarchy. They are contacted by local
servers to resolve name. They contact the Authoritative DNS servers to get the mapping if
they do not know it and return it to the local server. Second in hierarchy are TLD DNS
servers. They are responsible for .edu, .com, .org etc. Organization’s own DNS servers are
Authoritative DNS servers. They are managed by the organization, or a service provider.
Local DNS server does not strictly belong to the hierarchy. It forwards queries into the
hierarchy.
Queries by a Local DNS servers can be iterative or recursive. In iterative query, when a local
server sends query for gaia.cs.umass.edu to Root main server, it replies with the name of
TLD server that has .edu extension. Then Local server contacts the TLD server that replies
with the name of respective Authoritative server. Then Local server finally contacts the
Authoritative server to get the mapping for gaia.cs.umass.edu.
In recursive query, Local DNS server contacts Toot DNS server, it asks TLD DNS server.
TLD server requests Authoritative DNS server. Authoritative DNS server replies to TLD
DNS server, TLD replies to root DNS server which provides the required mapping to the
Local DNS server. This type of query result in heavy load at upper levels of hierarchy.

Figure 1 - Hierarchy of DNS servers

Q#5
Working of BitTorrent
BitTorrent uses peer to peer (P2P) communication. In this type of communication, there is no
client and server. Peers are all users and they share data with each other [ CITATION Blo \l
1033 ]. Torrent is basically a group of peers that are exchanging data in chunks. Torrent has a
tracker to tracks the peers that are entered in a network.

Figure 2 - P2P Communication Model

For example, Alice joins the network and it requests the list of peers from the tracker and
begins exchanging data with the other peers in torrent. At first, Alice might not have data to
exchange, but eventually it will accumulate data and start exchanging it in the network. Alice
might change peer with whom she exchanges data in the network. When Alice receives the
complete file, she may keep uploading it to the other peers or may leave the network.

References
Blockchain and P2P Web: Is It ‘Web 3.0’? (n.d.). Retrieved from skalex.io:
https://www.skalex.io/blockchain-p2p-web/

ReneMolenaar. (n.d.). Introduction to DNS. Retrieved from networklessons.com:


https://networklessons.com/cisco/ccna-routing-switching-icnd1-100-105/introduction-to-dns

You might also like