Assignment 3 - Data Comms
Assignment 3 - Data Comms
1. What is the role of each layer in the OSI network model and the TCP/IP
network model?
The Open Systems Interconnection (OSI) model describes seven layers that computer systems use to
communicate over a network. It was the first standard model for network communications, adopted
by all major computer and telecommunication companies in the early 1980s
The modern Internet is not based on OSI, but on the simpler TCP/IP model. However, the OSI 7-layer
model is still widely used, as it helps visualize and communicate how networks operate, and helps
isolate and troubleshoot networking problems.
OSI was introduced in 1983 by representatives of the major computer and telecom companies, and
was adopted by ISO as an international standard in 1984.
We’ll describe OSI layers “top down” from the application layer that directly serves the end user, down
to the physical layer.
7. Application Layer
The application layer is used by end-user software such as web browsers and email clients. It provides
protocols that allow software to send and receive information and present meaningful data to users.
A few examples of application layer protocols are the Hypertext Transfer Protocol (HTTP), File
Transfer Protocol (FTP), Post Office Protocol (POP), Simple Mail Transfer Protocol (SMTP), and
Domain Name System (DNS).
6. Presentation Layer
The presentation layer prepares data for the application layer. It defines how two devices should
encode, encrypt, and compress data so it is received correctly on the other end. The presentation
layer takes any data transmitted by the application layer and prepares it for transmission over the
session layer.
5. Session Layer
The session layer creates communication channels, called sessions, between devices. It is responsible for
opening sessions, ensuring they remain open and functional while data is being transferred, and
closing them when communication ends. The session layer can also set checkpoints during a data
transfer—if the session is interrupted, devices can resume data transfer from the last checkpoint.
4. Transport Layer
The transport layer takes data transferred in the session layer and breaks it into “segments” on the
transmitting end. It is responsible for reassembling the segments on the receiving end, turning it back
into data that can be used by the session layer. The transport layer carries out flow control, sending
data at a rate that matches the connection speed of the receiving device, and error control, checking
if data was received incorrectly and if not, requesting it again.
3. Network Layer
The network layer has two main functions. One is breaking up segments into network packets, and
reassembling the packets on the receiving end. The other is routing packets by discovering the best
path across a physical network. The network layer uses network addresses (typically Internet
Protocol addresses) to route packets to a destination node.
The data link layer establishes and terminates a connection between two physically-connected nodes on
a network. It breaks up packets into frames and sends them from source to destination. This layer is
composed of two parts—Logical Link Control (LLC), which identifies network protocols, performs
error checking and synchronizes frames, and Media Access Control (MAC) which uses MAC addresses
to connect devices and define permissions to transmit and receive data.
1. Physical Layer
The physical layer is responsible for the physical cable or wireless connection between network nodes. It
defines the connector, the electrical cable or wireless technology connecting the devices, and is
responsible for transmission of the raw data, which is simply a series of 0s and 1s, while taking care
of bit rate control.
2. Give the specific purposes of the DNS, HTTP SMB and SMTP/POP application
layer protocols
DNS – Domain Name System
The Domain Name System (DNS) is the phonebook of the Internet. Humans access information online
through domain names, like nytimes.com or espn.com. Web browsers interact through Internet
Protocol (IP) addresses. DNS translates domain names to IP addresses so browsers can load Internet
resources.
Each device connected to the Internet has a unique IP address which other machines use to find the
device. DNS servers eliminate the need for humans to memorize IP addresses such as 192.168.1.1 (in
IPv4), or more complex newer alphanumeric IP addresses such as 2400:cb00:2048:1::c629:d7a2 (in
IPv6).
The process of DNS resolution involves converting a hostname (such as www.example.com) into a
computer-friendly IP address (such as 192.168.1.1). An IP address is given to each device on the
Internet, and that address is necessary to find the appropriate Internet device - like a street address
is used to find a particular home. When a user wants to load a webpage, a translation must occur
between what a user types into their web browser (example.com) and the machine-friendly address
necessary to locate the example.com webpage.
In order to understand the process behind the DNS resolution, it’s important to learn about the
different hardware components a DNS query must pass between. For the web browser, the DNS
lookup occurs "behind the scenes" and requires no interaction from the user’s computer apart from
the initial request.
HTTP is a communication protocol which is employed for delivering data (usually HTML files,
multimedia files, etc.) on the World Wide Web through its default TCP port 80. However, there are
other ports also which can be implemented for this function. HTTP has two different versions,
HTTP/1.0, which is the old one and the newest HTTP/1.1. In its older version, a separate connection
was required. In the case of a new version, the same connection can be recycled several times.
Here is the basic block diagram of web application architecture which makes use of HTTP in it.
The HTTP is meant for request/response depending on a client-server architecture where the user
requests information through a web browser to the web server, which then responds to the
requested data.
Web Client: The client of this client-server architecture asks for a request to a specific server through
the HTTP (TCP/IP connection) as a request method in the form of a URL. It also contains a MIME-like
message that contains request modifier and client information.
Web Server: This accepts the request and process with a response by a status line, together with the
version of the message's protocol as well as the success or error code, followed by a MIME-like
message having server information, some metadata, and possible the entity-body content holding
the requested information.
Features of HTTP:
HTTP is connectionless: An HTTP request is initiated by the browser (HTTP client) as per the
user's request for information. The server will process the request and launch back with a
response which the client waits for.
HTTP is simple: HTTP/2 does the encapsulation of HTTP messages into frames; i.e., HTTP is
typically designed to be plain and human-readable.
HTTP is extensible/customized: HTTP can be integrated with new functionality by providing a
simple agreement between a client and a server.
HTTP is stateless, but not sessionless: HTTP is stateless, which means there is no connection
among two requests being consecutively carried out on the same connection. However,
when the core of HTTP is itself a stateless one, HTTP cookies provide in making use of stateful
sessions. Through the concept of header extensibility, HTTP cookies can be incorporated into
the workflow, making session creation on each HTTP request for sharing the same content.
Developed by the IT group IBM in 1983, various versions and implementations of the protocol have
been released over the past decades. SMB first became available for the public as part of the OS/2
network operating system LAN Manager and its successor LAN Server. The main application of the
protocol has since been the Windows operating system series because its network services are
backwards-compatible with SMB. This allows devices with newer editions to easily communicate with
devices that have an older Microsoft operating system installed. What’s more, the free software
project Samba offers a solution that enables the use of Server Message Block in Linux and Unix
distributions, thereby allowing cross-platform communication via SMB.
The Server Message Block protocol enables the client to communicate with other participants in the
same network, allowing it to access files or services open to it in the network. For this to work, the
other system also needs to have implemented the network protocol and receive and process the
respective client request using an SMB server application. But both parties must first establish a
connection, which is why they first exchange corresponding messages. In IP networks, SMB uses the
Transmission Control Protocol (TCP) that provides for a three-way handshake between the client and
server, before finally establishing a connection. Subsequent data transport is regulated by the
provisions of the TCP protocol.
Working of SMTP
1. Composition of Mail: A user sends an e-mail by composing an electronic mail message using a
Mail User Agent (MUA). Mail User Agent is a program which is used to send and receive mail.
The message contains two parts: body and header. The body is the main part of the message
while the header includes information such as the sender and recipient address. The header also
includes descriptive information such as the subject of the message. In this case, the message
body is like a letter and header is like an envelope that contains the recipient's address.
2. Submission of Mail: After composing an email, the mail client then submits the completed e-
mail to the SMTP server by using SMTP on TCP port 25.
3. Delivery of Mail: E-mail addresses contain two parts: username of the recipient and domain
name. For example, [email protected], where "vivek" is the username of the recipient and
"gmail.com" is the domain name. If the domain name of the recipient's email address is
different from the sender's domain name, then MSA will send the mail to the Mail Transfer
Agent (MTA). To relay the email, the MTA will find the target domain. It checks the MX record
from Domain Name System to obtain the target domain. The MX record contains the domain
name and IP address of the recipient's domain. Once the record is located, MTA connects to the
exchange server to relay the message.
4. Receipt and Processing of Mail: Once the incoming message is received, the exchange server
delivers it to the incoming server (Mail Delivery Agent) which stores the e-mail where it waits for
the user to retrieve it.
5. Access and Retrieval of Mail: The stored email in MDA can be retrieved by using MUA (Mail
User Agent). MUA can be accessed by using login and password.
It works on Delete mode when a user is accessing an email service from a permanent device. In this,
once the mails are downloaded or retrieved from the mailbox, mails are deleted from the mailbox
permanently.
It operates on Keep mode when the user is not accessing mails from the primary device. In this, it
keeps the mails after retrieval also for later retrieval.
Features of POP3
o In POP3, all the emails are downloaded to the local computer, and once all the emails are
downloaded, they are deleted from the server.
o Downloaded emails can be accessed offline also.
o Emails are not synchronized between different devices, which means if we set up our email
using our mobile phone with POP3, those emails will be downloaded completely on your mobile
phone, and can’t be accessed from other devices.
3. When is it appropriate to use TCP or UDP and what are some examples of
applications that use each protocol?
Features of TCP
The following are the features of the TCP:
o Data delivery
TCP protocol ensures that the data is received correctly, no data is missing and in order. If TCP
protocol is not used, then the incorrect data can be received or out of order. For example, if we
try to view the web page or download a file without using TCP, then some data or images could
be missing.
o Protocol
TCP is a connection-oriented protocol. Through the word connection-oriented, we understand
that the computers first establish a connection and then do the communication. This is done by
using a three-way handshake. In a three-way handshake, the first sender sends the SYN message
to the receiver then the receiver sends back the SYN ACK message to confirm that the message
has been received. After receiving the SYN ACK message, the sender sends the acknowledgment
message to the receiver. In this way, the connection is established between the computers.
Once the connection is established, the data will be delivered. This protocol guarantees the data
delivery means that if the data is not received then the TCP will resend the data.
What is UDP?
The UDP stands for User Datagram Protocol. Its working is similar to the TCP as it is also used for
sending and receiving the message. The main difference is that UDP is a connectionless protocol.
Here, connectionless means that no connection establishes prior to communication. It also does
not guarantee the delivery of data packets. It does not even care whether the data has been
received on the receiver's end or not, so it is also known as the "fire-and-forget" protocol. It is also
known as the "fire-and-forget" protocol as it sends the data and does not care whether the data is
received or not. UDP is faster than TCP as it does not provide the assurance for the delivery of the
packets.
o Type of protocol
Both the protocols, i.e., TCP and UDP, are the transport layer protocol. TCP is a connection-
oriented protocol, whereas UDP is a connectionless protocol. It means that TCP requires
connection prior to the communication, but the UDP does not require any connection.
o Reliability
TCP is a reliable protocol as it provides assurance for the delivery of the data. It follows the
acknowledgment mechanism. In this mechanism, the sender receives the acknowledgment from
the receiver and checks whether the acknowledgment is positive or negative. If the ACK is
positive means, the data has been received successfully. If ACK is negative, then TCP will resend
the data. It also follows the flow and error control mechanism. UDP is an unreliable protocol as
it does not ensure the delivery of the data.
o Flow Control
TCP follows the flow control mechanism that ensures a large number of packets are not sent to
the receiver at the same time, while UDP does not follow the flow control mechanism.
o Ordering
TCP uses ordering and sequencing techniques to ensure that the data packets are received in
the same order in which they are sent. On the other hand, UDP does not follow any ordering
and sequencing technique, i.e., data can be sent in any sequence.
o Speed
Since TCP establishes a connection between a sender and receiver, performs error checking, and
also guarantees the delivery of data packets while UDP neither creates a connection nor it
guarantees the delivery of data packets, so UDP is faster than TCP.
o Flow of data
In TCP, data can flow in both directions means that it provides the full-duplex service. On the
other hand, UDP is mainly suitable for the unidirectional flow of data.
4. What are the reserved and special IPv4 addresses, and how they are used?
IPv4 - Reserved Addresses
There are a few reserved IPv4 address spaces which cannot be used on the internet. These
addresses serve special purpose and cannot be routed outside the Local Area Network.
Private IP Addresses
Every class of IP, (A, B & C) has some addresses reserved as Private IP addresses. These IPs can be
used within a network, campus, company and are private to it. These addresses cannot be routed
on the Internet, so packets containing these private addresses are dropped by the Routers.
In order to communicate with the outside world, these IP addresses must have to be translated to
some public IP addresses using NAT process, or Web Proxy server can be used.
The sole purpose to create a separate range of private addresses is to control assignment of
already-limited IPv4 address pool. By using a private address range within LAN, the requirement
of IPv4 addresses has globally decreased significantly. It has also helped delaying the IPv4 address
exhaustion.
IP class, while using private address range, can be chosen as per the size and requirement of the
organization. Larger organizations may choose class A private IP address range where smaller
organizations may opt for class C. These IP addresses can be further sub-netted and assigned to
departments within an organization.
Loopback IP Addresses
The IP address range 127.0.0.0 – 127.255.255.255 is reserved for loopback, i.e. a Host’s self-
address, also known as localhost address. This loopback IP address is managed entirely by and
within the operating system. Loopback addresses, enable the Server and Client processes on a
single system to communicate with each other. When a process creates a packet with destination
address as loopback address, the operating system loops it back to itself without having any
interference of NIC.
Data sent on loopback is forwarded by the operating system to a virtual network interface within
operating system. This address is mostly used for testing purposes like client-server architecture
on a single machine. Other than that, if a host machine can successfully ping 127.0.0.1 or any IP
from loopback range, implies that the TCP/IP software stack on the machine is successfully loaded
and working.
Link-local Addresses
In case a host is not able to acquire an IP address from the DHCP server and it has not been
assigned any IP address manually, the host can assign itself an IP address from a range of reserved
Link-local addresses. Link local address ranges from 169.254.0.0 -- 169.254.255.255.
Assume a network segment where all systems are configured to acquire IP addresses from a DHCP
server connected to the same network segment. If the DHCP server is not available, no host on
the segment will be able to communicate to any other. Windows (98 or later), and Mac OS (8.0 or
later) supports this functionality of self-configuration of Link-local IP address. In absence of DHCP
server, every host machine randomly chooses an IP address from the above mentioned range and
then checks to ascertain by means of ARP, if some other host also has not configured itself with
the same IP address. Once all hosts are using link local addresses of same range, they can
communicate with each other.
These IP addresses cannot help system to communicate when they do not belong to the same
physical or logical segment. These IPs are also not routable.
OSI vs TCP/IP
The OSI stands for Open System Interconnection, which was developed in 1980s. It is a conceptual
model used for network communication. It is not implemented entirely, but it is still referenced
today. This OSI model consists of seven layers, and each layer is connected to each other. The
data moves down the OSI model, and each layer adds additional information. The data moves
down until it reaches the last layer of the OSI model. When the data is received at the last layer of
the OSI model, then the data is transmitted over the network. Once the data is reached on the
other side, then the process will get reversed.
What is TCP/IP model?
The TCP model stands for Transmission Control Protocol, whereas IP stands for Internet Protocol.
A number of protocols that make the internet possibly comes under the TCP/IP model. Nowadays,
we do not hear the name of the TCP/IP model much, we generally hear the name of the IPv4 or
IPv6, but it is still valid. This model consists of 4 layers. Now, we will look at the diagrammatic
representation of the TCP/IP model.
As shown in the above diagram, the TCP/IP model has 4 layers, while the OSI model consists of 7
layers. Diagrammatically, it looks that the 4 layers of the TCP/IP model exactly fit the 7 layers of
the OSI model, but this is not reality. The application layer of the TCP/IP. model maps to the first
three layers, i.e., application, session, and presentation layer of the OSI model. The transport layer
of the TCP maps directly to the transport layer of the OSI model. The internet layer of the TCP/IP
model maps directly to the network layer of the OSI model. The last two layers of the OSI model
map to the network layer of the TCP/IP model. TCP/IP is the most widely used model as compared
to the OSI model for providing communication between computers over the internet.
Let's see the differences between the OSI and TCP/IP model in a tabular form: