0% found this document useful (0 votes)
34 views

DCN Unit-5 Notes

The document discusses IP protocol and addressing schemes. It describes IP protocol, IP addresses, IP datagrams, IPv4 and IPv6 header formats. It also covers addressing schemes including classful addressing, finding address classes, network addresses and properties of network addresses.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

DCN Unit-5 Notes

The document discusses IP protocol and addressing schemes. It describes IP protocol, IP addresses, IP datagrams, IPv4 and IPv6 header formats. It also covers addressing schemes including classful addressing, finding address classes, network addresses and properties of network addresses.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Data Communication & Networking

Unit-5 IP Protocol and Network Applications


5.1 IP Protocol
5.2 Addressing Schemes
5.3 Subnet and Masking
5.4 DNS
5.5 Email Protocols
5.6 FTP
5.7 HTTP

5.1 IP Protocol
The internet protocol provides for transmitting blocks of data called datagrams from sources to
destinations, where sources and destinations are hosts identified by fixed length addresses. The internet
protocol does not provide a reliable communication facility. There are no acknowledgments, it is either
end-to-end or hop-by-hop.
Definition
The internet protocol is specifically limited in scope to provide the functions necessary to deliver a
package of bits from a source to a destination over an interconnected system of networks.
IP Address
An address that identifies the connection of host to its network is called IP address. An IP address is 32-bit
address. It is unique address. Unique here means two devices on Internet can never have same address at
same time.

IP Datagram
Datagram is a variable length packet consisting of two parts
1) Header
2) Data IP datagram

Header (20-60 bytes) Data


Total 20-65,536 bytes

Header is 20 to 60 bytes in length and contains information required to routing and delivery of
datagram. IPV4 header format shown in fig.

Types of IP Address Notation


Two notations that shows the IP address
1) Binary notation
2) Dotted Decimal notation
Data Communication & Networking

Binary Notation
IP address is 32-bit address. To make address readable, one or more spaces is usually inserted
between each 8 bits.

EXAMPLE OF AN IP ADDRESS IN BINARY NOTATION


Dotted – Decimal Notation
To make 32-bit address shorts and easier to read Internet address are written in decimal from with
decimal points separated by dot. So, it is called dotted decimal Notation.

EXAMPLE OF AN IP ADDRESS IN DOTTED DECIMAL NOTATION


IPv4
IPv4 stands for Internetwork Protocol Version 4. The Address Space is 32 bits. The length of
header is 20-60 bytes. The number of Header fields is 12. Checksum field is used to measure error in the
header. There are 4 bytes allocated for each address in the header. Internet protocol Security with respect
to network security is optional.
IPv4 Header Format
Data Communication & Networking

VER: Version
This field defines the version of IP. Currently version is 4: IPv4 with a binary value 0100. IPv6: IP version
6, with binary value 0110.
HLEN: Header Length
This field defines the length of header in IP diagram. Length is in multiples of 4 bytes. This is 4-bit
information means number between 0 and 15 (0000-1111), which is multiply by 4 bytes.
Service Type
This field defines how the datagram should be handled. It contains bits that specify the type of services the
sender wants, such as reliability, delay and level of throughput.
Total length
This field defines total length of IP datagram. Header length + Data length = Total length. This is 16-bit
field. From this 20-60 bytes are the header and the rest of it is data from upper layer.
Identification
Identification field is used in fragmentation. A datagram when passing through different network may be
divided into fragments to match the network frame size. So, each fragment is identified with sequence
number in this field. All the fragments have same identification number. This identification number helps
the destination in rearrangement process of datagram.
Flags
This is a 3-bit field. 1st bit is reserved for future. 2nd bit is called the do not fragment bit. 3rd bit is the
more fragment bit.

Fragmentation Offset
The fragmentation offset is a pointer that shows position of fragment in the original datagram.
Time to live
This field is used to control the maximum numbers of hops (routers) visited by the datagram. This prevents
the datagram from going back and forth forever between routers.
Protocol
This field defines the higher-level protocol that uses the services of the IP layer. Higher layer protocols
such as TCP, UDP, ICMP, IGMP etc.
Header Checksum
This is 16-bit field used to check the header part, not the rest of packet.
Source IP address
This field specifies 4 bytes (32 bit) Internet address of the source. This field must remain unchanged during
the time datagram travels from one network to another.
Destinations IP addresses
This field defines IP address of destination. This is also 4 byte Internet address. This field must remain
unchanged during the time the datagram travels from one network to another.
Options
Optional part means it is not required for every datagram. They are used for network testing, debugging,
control routing, timing, management etc. Options field gives more functionality to the IP datagram.
Data Communication & Networking

IPv6
IPv6 stands for Internetwork Protocol Version 6. In IPv6, format and length of IP addresses were
changed along with the packet format. IPv6 provide 128 bits addressing. IPv6 has some advantages over
IPv4. Checksum field is eliminated from the header. Internet protocol Security with respect to network security is
mandatory.
IPv6 Header Format

VER (Version)
The four-bit field defines the version number of IP.

TRAFFIC CLASS
The four-bit field to set the priority of the packet with respect to traffic congestion.

FLOW LABEL
The flow label is the field that is designed to provide special handling for a particular flow of data.

PAYLOAD LENGTH
The two-byte payload length field defines the total length of the IP datagram excluding the base header.

NEXT HEADER
The next header is an eight-bit field defining the header the follow the base header in the datagram. The
next header is either one of the optional extension headers used by IP or the header for an Upper layer
protocol like UDP or TCP. Each extension header also contains this field.

HOP LIMIT
The eight-bit hop limit field serves the same purpose as the TTL field in IPv4.

SOURCE ADDRESS
The source address field is a 16-byte internet address that identifies the original source of the datagram.
Data Communication & Networking

DESTINATION ADDRESS
The Destination address field is 16-byte address that identifies the final destination of the datagram.
However, if the source routing is used, this field contains the address of the next router.

Features of IPv6
1) Large Address Space
IPv6 address is 128-bits long. It provides very large address space compare to IPv4.
2) Better Header Format
IPv6 uses a new header format in which option are separated from header and inserted (when required)
between header and data.

Header Options Data


3) New Options
IPv6 has new options to allow for additional functionalities.

4) Allowing Extension
IPv6 is designed to allow the extension of the protocol if required by new technologies.
5) Support for Resource Allocation
In IPv6, the type of service field has been removed, but flow label has been added to enable the source
to request special handling of packet. This is used to support traffic such as real-time audio and video.
6) Support for more Security
IPv6 provides more security compare to IPv4. The encryption and authentication options in IPv6
provide confidentiality to the packet.

Addressing Schemes
Classful Addressing
The address space is divided into five classes: Class A, Class B, Class C, Class D and Class E.
Addresses in classes A, B and C are used for unicast communication i.e. one source to one destination.
Addresses in class D are used for multicast communication i.e. one source to many destination. Addresses
in class E are reserved for future use. IP addresses in class A, B and C is divided into net id and host id.
Net id - Network Identification Number
Host id - Host Address
Data Communication & Networking

Finding the class in Binary Notation


If we want to find out the class of any IP address by using binary notation then we have to consider
the first byte and the method is like below in the fig. If any IP address starting with binary 0 then it belongs
to class A. If it starts with binary 10 then it belongs to class B. If it starts with binary 110 then it belongs
to class C. If it starts with binary 1110 then it belongs to class D. If it starts with binary 1111 then it belongs
to class E.
Finding the class in Dotted-Decimal Notation
If we want to find out the class of any IP address by using dotted decimal notation then we have
to consider the first byte and the method is like above in the fig. If an IP address starts with decimal in
between 0 to 127 it belongs to class A, if it starts is between 128 to 191 it belongs to class B. if it starts
between 192 to 223 it belongs to class C, if it starts between 224 to 239 it belongs to class D, , if it starts
between 240 to 255 it belongs to class E.
Network Address
The network address is an address that defines the network itself, it cannot be assigned to host.

Properties of Network Address


1) All host id bytes are 0’s.
2) The network address defines the network to the rest of Internet. Router can route a packet based on
network address.
3) The network address is first address on the block.
4) Given the network address, we can find the class of address.
Data Communication & Networking

Classless Addressing
In classless addressing, when an entity, small or large, needs to be connected to the Internet, it is
granted a block (range) of addresses. The size of the block (the number of addresses) varies based on the
nature and size of the entity.
To overcome address depletion and give more organizations access to the Internet, classless
addressing was designed and implemented. In this scheme, there are no classes, but the addresses are still
granted in blocks.
To simplify the handling of addresses, the Internet authorities impose three restrictions on classless
address blocks:
1) The addresses in a block must be contiguous, one after another.
2) The number of addresses in a block must be a power of 2 (1, 2, 4, 8,...).
3) The first address must be evenly divisible by the number of addresses.

Subnet and Masking


Subnet
Dividing a larger network into smaller sub-networks is called subnetting. IP address is 32-bits
long. In the addressing, one portion of the address indicates a network (net id), and the other portion
indicates the host (or device) on network (host id).
IP addressing are designed with two-level of hierarchy. To reach a host on Internet, we must first
reach to network using first portion of address (net id). Then we must reach the host it self-using the
second portion (host id).
[Network Net id host id]
Data Communication & Networking

Sometimes these two levels of hierarchy is not suitable to the organization, so at that point network
needs to be divided into several smaller networks.
The further division of a network into smaller networks called sub networks. For example,
University has many departments. The university has one network address, but its departments have
several sub networks addresses. Each sub network is identified by its sub network address. When we
divide a network into several subnets, we have three level of hierarchy.
[Network Sub Network Host]
For Example:
Without Sub Netting
Two level Hierarchy
141.14.2.21 Class B address

141.14 • 2.21
Net Id Host Id

With Sub Netting


Three level Hierarchy

141.14 • 2 • 21
Net Id Sub-Net Id Host Id

Masking
Masking is a process that extracts the address of the network from an IP address. When a router
receives a packet with destination address, it needs to route the packet. The routing is based on network
address and sub network address. The router outside the organization (Network) routes the packet based
on the network address. The router inside the organization routes the packet based on sub network address.
A network administrator knows the network address and sub network addresses but router does not. Router
uses masking process.
Router uses masking process. Masking is a process that extracts the address of network from an
IP address. Masking can be done whether we have sub-netting or not. If we have not sub-netted the
network, masking extracts the network address from an IP address. If we have sub-netted, masking extracts
the sub-network address from an IP address.
For Example
IP address - 141.14.2.21
Mask - 255.255.0.0
Network Address - 141.14.0.0

Class Default Mask


A 255.0.0.0
B 255.255.0.0
C 255.255.255.0
D N/A
Data Communication & Networking

E N/A

DNS
To identify an entity, the internet uses an IP address, which uniquely identifies the connection of
a computer to the internet. But user prefers to use names instead of numeric addresses. Because of
remember numeric addresses are difficult compare to names. Therefore, we need a system that can map a
name to an address or an address to name. The naming scheme used in internet is called the DNS (Domain
Name System). In DNS names must be unique because the addresses are unique.
Domain names are case insensitive. Each domain is partitioned into sub domains and these are
further partitioned and so on. Once an organization has been assigned domain, the suffix is received for
the organization. Means no other organization will be assigned the same name and suffix. Means unique
domain suffix is assigned to each organization. To map a name into an IP address, an application program
calls a library procedure called the resolver, passing it the name as a parameter. The resolver sends a UDP
packet to local DNS server, which then looks up the name and returns the IP address to the resolver, which
then returns it to caller processor.
DNS names are defined in an inverted tree structure with the root at top. Each node in the tree has
a label, which is a string with maximum of 63 characters.
Domain Name
Each node in a tree has a domain name. A full domain name is a sequence of labels separated by dots. Full
path names must not exceed 255 characters. Domain names are always read from the bottom to top. Last
label is the label of the root. The root label is a null string (Empty String). Means a full domain name
always ends in a null label.
Name Server
Information contained in the domain name system must be stored. It is very inefficient and not
reliable to have just one computer store such large information. Because, any failure on that computer
makes data inaccessible. To solve above problem, we have to distribute the information among many
computers called DNS servers. One way to do this is to divide the whole space into many domains based
on first level.
DNS allows domains to be divided future into smaller domains. Each server can be responsible for
a domain. We have a hierarchy of servers. DNS name space is divided into zones. (Non-overlapping area)
Each zone contains some part of a tree and also contain name server. The server makes a database called
a zone file and keeps all the information for every node under that domain. Root server is a server whose
zone consists of a whole tree. It has authority to other servers, keeping references to those servers.
DNS in the Internet
In the internet, domain name space is divided into three different sections-
1) Generic domain.
2) Country domain.
Data Communication & Networking

3) Inverse domain.
Generic Domain
Generic domain defines registered hosts according to their generic behaviour. Each node in a tree
defines a domain. In first level, generic domain uses three-character codes.
1) Com – Commercial organization
2) Edu – Educational Institutions
3) Mil – Military Groups
4) Org – Non-profit organization
5) Int – International organization
6) Gov – Government institutions
7) Net – Network Organizations

Country Domain
It uses a two-character country abbreviation in place of three-character abbreviation at first level.
Data Communication & Networking

Inverse Domain
It is used to map an address to a name. When a server has received a request from a client to do a
task. Whereas server has a file that contains a list of authorized clients, server lists only the IP address of
the client.

Email Protocols
Electronic mail, often abbreviated to e-mail, or simply mail, is a store-and-forward method of
writing, sending, receiving and saving messages over electronic communication systems. The term “e-
Data Communication & Networking

mail” applies to the internet e-mail systems based on simple mail transfer protocol (SMTP), to network
systems based on other protocols and to various mainframe, minicomputer, or intranet systems allowing
users within one organization to send messages to each other in support of workgroup collaboration.
E-mail is most popular network services. It is system for sending message to other computer uses
based on email address. Sending message that include text, audio, video or graphics. Sending single
message to one or more recipients. SMTP is standard protocol use for electronic mail in the internet.

Sending Mail: Format of email


To send mail, the user creates mail that looks very similar to postal mail. It has two parts.
1) Envelope.
2) Message.
Envelope
It contains the sender address, the receiver address and other information.
Message
It contains the header and body. Header of the message contains the address of the sender, receiver and
subject of message, data, etc. Body of the message contains the actual information to be read by recipient.
Receiving Mail
The email system periodically checks the mail-boxes. If a user has mail, it informs the user with notice. If
the user is ready to read the mail, a list is displayed on the screen which contains brief summary of email.
User Agents
The user agent prepares the message, creates the envelope and puts the message in envelope. Mail transfer
agent transfers the mail across the internet.
Data Communication & Networking

Composing Messages
User Agent provides a template (or form) on the screen to be filled in by user. A user can use their favourite
text editor or word processor to create the message and impart it or cut and paste into the user agent.
Reading Messages
When a user login, first User Agent checks the mail in the incoming mailbox. User Agent show a one-line
summary of each received mail which contain the following details Number field of the message, the size
of the message, the sender’s name, the subject field, flag field, which shows if the mail is new, already
read but not replied, read and replied and so on.
Replying Messages
After reading messages, a user can use the user agent to reply to the message. The reply message contains
the original message and the new message.
Forwarding Messages
Forwarding means to send the message to the third party. A user agent allows the receiver to forward the
message, with or without extra comments to a third party.
Handling Mailboxes
User agent creates two mailboxes
1) Inbox
2) Outbox
Each box is a file with special format that can be handled by user agent. The inbox keeps the entire received
emails unit they are deleted by the user. The Outbox keeps all the sent emails until the user deletes them.
Data Communication & Networking

SMTP
Simple Mail Transfer Protocol, a protocol for sending e-mail messages between servers. Most e-
mail systems that send mail over the internet use SMTP to send messages from one server to another. The
messages can then be retrieved with an e-mail client using either POP (Post Office Protocol) or IMAP
(Internet Message Access Protocol).
SMTP client and SMTP server has two components
1) UA – User Agent
2) MTA – Mail Transfer Agent
User Agent
The UA prepares the message, creates the envelope and puts the message in envelope.
Mail Transfer Agent
MTA transfers the mail across the internet.

POP3
Post Office Protocol, a protocol used to retrieve e-mail server. Most e-mail applications sometimes
called an e-mail client use the POP protocol, although some can use the newer IMAP (Internet Message
Access Protocol). Local e-mail clients uses the Post Office Protocol version 3 (POP3), an application-
layer internet standard protocol, to retrieve e-mail from remote server over TCP/IP connection.
POP3 stands for Post Office Protocol. POP3 is an extremely simple mail access protocol. The
user agent of the client opens a TCP connection to the mail server of the server. After TCP connection
is established, POP3 progresses through 3 phases: authorization, transaction and update. During first
phase, the user agent sends a username and password to authenticate the user. During second phase, the
user agent retrieves messages. During third phase, the client issues the quit command to end the POP3
session.
Data Communication & Networking

IMAP4
Internet Message Access Protocol, a protocol for retrieving e-mail messages. The latest version,
IMAP4 is similar to POP3 but supports some additional features. For example, with IMAP4, you can
search through your e-mail messages for keyboards while the messages are still on mail server. You can
choose which messages to download to your machine. IMAP was developed at Stanford University in
1986. It is more powerful and complex. It provides extra functions such as:
1) User can check the e-mail header before downloading the mail.
2) User can search the contents of the email for a specific string of characters before downloading.
3) User can partially download e-mail.
4) User can create, delete or rename mailbox on mail server.
5) User can create a hierarchy of mailboxes in a folder for email storage.

MIME
Multipurpose Internet Mail Extensions, a specification for formatting non-ASCII messages so they
can be sent over the internet. Many e-mail clients now support MIME, which enables them to send and
receive graphics, audio and video files via the internet mail systems. In addition, MIME supports messages
in character sets other than ASCII. MIME was defined in 1992 by the Internet Engineering Task Force
(IETF).
SMTP can send messages only in 7-bit ASCIT format. SMTP has limitation that it cannot be used
for languages that are not supported by 7-bit ASCII characters. MIME is supplementary protocol that
allows non-ASCII data to be sent through SMTP. MIME is not a mail protocol and cannot replace SMTP
it is only an extension to SMTP. Whenever transmission of non-ASCII data at that time MIME and SMTP
both are required.

FTP
FTP stands for File Transfer Protocol. FTP is a standard mechanism provided by TCP/IP model
for copying a file from one computer to another. Transferring files from one computer to another is one
of the most common tasks expected from a networking or internetworking environment. File Transfer
Protocol, the protocol for exchanging files over the Internet. FTP works in the same way as HTTP for
transferring web pages from a server to user’s browser and SMTP for transferring electronic mail across
the Internet in that, like these technologies. FTP uses the internet’s TCP/IP protocols to enable data
transfer.
FTP is most commonly used to download a file from server using the internet or to upload a file
to server (e.g. uploading a web page file to a server). Transferring a file from one system to another system
suffers from many problems like two systems may use different OS, two systems may use different file
name conventions, two systems may have different ways to represent text and data, and two systems may
have different directory structures. All of these problems have been solved by FTP.
FTP creates two connections between client and server one connection is used for data transfer
and other for control information (Commands and response). Control connection uses very simple rules
of communication. We need to transfer only one line of command or one line of response at a time. Data
connections, on the other hand needs more complex rules due to variety of data type transferred.
The control connection is made between the control processes. The data connection is made
between the data transfer processes. Control connection is maintained during the entire interactive FTP
session. The data connection is opened and closed for each file transferred. Port 21 used for the control
connection and Port: 20 used for data connection.
Data Communication & Networking

TFTP (Trivial File Transfer Protocol)


When we need to simply copy a file without need of all functions of FTP protocol. For Example,
when a diskless computer is booted, we need to download files from servers. So, at that time we do not
need all the sophistication problems solution provided by FTP. We just require protocol to copy file from
one computer to another. Reading file in TFTP means copying file from the server site to client site.
Writing file in TFTP means copying file from client site to server site. TFTP does not have
authorization (FTP have authorization). TFTP client and server use UDP protocol instead of TCP. TFTP
uses the User Datagram Protocol (UDP) and provides no security features. It is often used by servers to
boot devices like routers. TFTP is less powerful than FTP. Code for TFTP requires less memory than the
code for FTP.

HTTP
HTTP is said to be a connectionless protocol and is used to interconnect web pages. HTTP stands
for Hyper Text Transfer Protocol. WWW is about communication between web clients and servers.
Communication between client computers and web servers is done by sending HTTP Requests and
receiving HTTP Response. HTTP has some built-in request methods as follows:

Method Action
GET Request to read a web page
HEAD Request to read a web page’s header
POST Sends some information from the client to the server
PUT Request to store a web page
DELETE Remove the web page
.
Communication between clients and servers is done by requests and responses:
1) A client (a browser) sends an HTTP request to the web.
2) A web server receives the request.
3) The server runs an application to process the request.
4) The server returns an HTTP response (output) to the browser.
5) The client (the browser) receives the response

You might also like