SlideShare a Scribd company logo
Ipv4 tutorial
IPv4
i
AbouttheTutorial
Internet Protocol version 4 (IPv4) is the fourth version in the development of the Internet
Protocol (IP) and the first version of the protocol to be widely deployed. IPv4 is described
in IETF publication RFC 791 (September 1981), replacing an earlier definition (RFC 760,
January 1980).
This tutorial will help you in understanding IPv4 and its associated terminologies along
with appropriate references and examples.
Audience
This tutorial has been designed to help beginners understand basic concepts of IPv4
required to work with any TCP/IP based protocols. After completing this tutorial, you will
find yourself at a moderate level of expertise of IPv4 from where you can take yourself to
next levels.
Prerequisites
Before you start proceeding with this tutorial, I'm making an assumption that you are
already aware of basic computer and network concepts such as what is a protocol, why do
we need protocol, Network Layers, etc.
Copyright&Disclaimer
 Copyright 2017 by Tutorials Point (I) Pvt. Ltd.
All the content and graphics published in this e-book are the property of Tutorials Point (I)
Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish
any contents or a part of contents of this e-book in any manner without written consent
of the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely as
possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.
Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our
website or its contents including this tutorial. If you discover any errors on our website or
in this tutorial, please notify us at contact@tutorialspoint.com
IPv4
ii
TableofContents
About the Tutorial....................................................................................................................................i
Audience..................................................................................................................................................i
Prerequisites............................................................................................................................................i
Copyright & Disclaimer.............................................................................................................................i
Table of Contents....................................................................................................................................ii
1. IPV4 ─ OVERVIEW................................................................................................................1
What is Network? ...................................................................................................................................1
Host Addressing ......................................................................................................................................2
2. IPV4 ─ THE OSI MODEL........................................................................................................3
Network Layer.........................................................................................................................................4
3. IPV4 ─ THE TCP/IP MODEL...................................................................................................5
Internet Protocol Version 4 (IPv4) ...........................................................................................................5
4. IPV4 ─ PACKET STRUCTURE .................................................................................................6
5. IPV4 ─ ADDRESSING.............................................................................................................8
Unicast Addressing Mode........................................................................................................................8
Broadcast Addressing Mode....................................................................................................................8
Multicast Addressing Mode.....................................................................................................................9
Hierarchical Addressing Scheme............................................................................................................10
Subnet Mask .........................................................................................................................................10
Binary Representation ..........................................................................................................................10
6. IPV4 ─ ADDRESS CLASSES...................................................................................................12
Class A Address .....................................................................................................................................12
Class B Address .....................................................................................................................................13
IPv4
iii
Class C Address......................................................................................................................................13
Class D Address .....................................................................................................................................13
Class E Address......................................................................................................................................13
7. IPV4 ─ SUBNETTING...........................................................................................................14
Class A Subnets .....................................................................................................................................14
Class B Subnets .....................................................................................................................................15
Class C Subnets......................................................................................................................................16
8. IPV4 ─ VLSM ......................................................................................................................17
9. IPV4 ─ RESERVED ADDRESSES............................................................................................19
Private IP Addresses..............................................................................................................................19
Loopback IP Addresses..........................................................................................................................19
Link-local Addresses..............................................................................................................................20
10. IPV4 ─ EXAMPLE................................................................................................................21
Packet Flow in Network ........................................................................................................................21
Step 1 – Acquiring an IP Address (DHCP) ...............................................................................................22
Step 2 – DNS Query ...............................................................................................................................22
Step 3 – ARP Request ............................................................................................................................22
11. IPV4 ─ SUMMARY..............................................................................................................23
Internet Protocol v6 (IPv6) ....................................................................................................................23
IPv4
4
This era is said to be the era of computers. Computers have significantly changed the way we
live. A computing device when connected to other computing device(s) enables us to share
data and information at lightning fast speed.
WhatisNetwork?
A Network in the world of computers is said to be a collection of interconnected hosts, via
some shared media which can be wired or wireless. A computer network enables its hosts to
share and exchange data and information over the media. Network can be a Local Area
Network spanned across an office or Metro Area Network spanned across a city or Wide Area
Network which can be spanned across cities and provinces.
A computer network can be as simple as two PCs connected together via a single copper cable
or it can be grown up to the complexity where every computer in this world is connected to
every other, called the Internet. A network then includes more and more components to reach
its ultimate goal of data exchange. Below is a brief description of the components involved in
computer network:
 Hosts - Hosts are said to be situated at ultimate end of the network, i.e. a host is a
source of information and another host will be the destination. Information flows end
to end between hosts. A host can be a user’s PC, an internet Server, a database server
etc.
 Media - If wired, then it can be copper cable, fiber optic cable, and coaxial cable. If
wireless, it can be free-to-air radio frequency or some special wireless band. Wireless
frequencies can be used to interconnect remote sites too.
 Hub - A hub is a multiport repeater and it is used to connect hosts in a LAN segment.
Because of low throughputs hubs are now rarely used. Hub works on Layer-1 (Physical
Layer) of OSI Model.
 Switch - A Switch is a multiport bridge and is used to connect hosts in a LAN segment.
Switches are much faster than Hubs and operate on wire speed. Switch works on
Layer-2 (Data Link Layer), but Layer-3 (Network Layer) switches are also available.
 Router - A router is Layer-3 (Network Layer) device which makes routing decisions
for the data/information sent for some remote destination. Routers make the core of
any interconnected network and the Internet.
 Gateways - A software or combination of software and hardware put together, works
for exchanging data among networks which are using different protocols for sharing
data.
 Firewall - Software or combination of software and hardware, used to protect users’
data from unintended recipients on the network/internet.
All components in a network ultimately serve the hosts.
1. IPv4 ─ Overview
IPv4
5
HostAddressing
Communication between hosts can happen only if they can identify each other on the network.
In a single collision domain (where every packet sent on the segment by one host is heard by
every other host) hosts can communicate directly via MAC address.
MAC address is a factory coded 48-bits hardware address which can also uniquely identify a
host. But if a host wants to communicate with a remote host, i.e. not in the same segment
or logically not connected, then some means of addressing is required to identify the remote
host uniquely. A logical address is given to all hosts connected to Internet and this logical
address is called Internet Protocol Address.
IPv4
6
The International Standard Organization has a well-defined model for Communication
Systems known as Open System Interconnection, or the OSI Model. This layered model is a
conceptualized view of how one system should communicate with the other, using various
protocols defined in each layer. Further, each layer is designated to a well-defined part of
communication system. For example, the Physical layer defines all the components of physical
nature, i.e. wires, frequencies, pulse codes, voltage transmission etc. of a communication
system.
The OSI Model has the following seven layers:
 Application Layer (Layer-7): This is where the user application sits that needs to
transfer data between or among hosts. For example: HTTP, file transfer application
(FTP) and electronic mail etc.
 Presentation Layer (Layer-6): This layer helps to understand data representation
in one form on a host to other host in their native representation. Data from the sender
is converted to on-the-wire data (general standard format) and at the receiver’s end
it is converted to the native representation of the receiver.
 Session Layer (Layer-5): This layer provides session management capabilities
between hosts. For example, if some host needs a password verification for access and
2. IPv4 ─ The OSI Model
IPv4
7
if credentials are provided then for that session password verification does not happen
again. This layer can assist in synchronization, dialog control and critical operation
management (e.g., an online bank transaction).
 Transport Layer (Layer-4): This layer provides end-to-end data delivery among
hosts. This layer takes data from the above layer and breaks it into smaller units called
Segments and then gives it to the Network layer for transmission.
 Network Layer (Layer-3): This layer helps to uniquely identify hosts beyond the
subnets and defines the path which the packets will follow or be routed to reach the
destination.
 Data Link Layer (Layer-2): This layer takes the raw transmission data (signal,
pulses, etc.) from the Physical Layer and makes Data Frames, and sends that to the
upper layer and vice versa. This layer also checks any transmission errors and sorts it
out accordingly.
 Physical Layer (Layer-1): This layer deals with hardware technology and actual
communication mechanism such as signaling, voltage, cable type and length, etc.
NetworkLayer
The network layer is responsible for carrying data from one host to another. It provides means
to allocate logical addresses to hosts, and identify them uniquely using the same. Network
layer takes data units from Transport Layer and cuts them into smaller unit called Data Packet.
Network layer defines the data path, the packets should follow to reach the destination.
Routers work on this layer and provides mechanism to route data to its destination.
IPv4
8
A majority of the internet uses a protocol suite called the Internet Protocol Suite also known
as the TCP/IP protocol suite. This suite is a combination of protocols which encompasses a
number of different protocols for different purpose and need. Because the two major protocols
in this suites are TCP (Transmission Control Protocol) and IP (Internet Protocol), this is
commonly termed as TCP/IP Protocol suite. This protocol suite has its own reference model
which it follows over the internet. In contrast with the OSI model, this model of protocols
contains less layers.
Figure: Comparative depiction of OSI and TCP/IP Reference Models
This model is indifferent to the actual hardware implementation, i.e. the physical layer of OSI
Model. This is why this model can be implemented on almost all underlying technologies.
Transport and Internet layers correspond to the same peer layers. All three top layers of OSI
Model are compressed together in single Application layer of TCP/IP Model.
InternetProtocolVersion4(IPv4)
Internet Protocol is one of the major protocols in the TCP/IP protocols suite. This protocol
works at the network layer of the OSI model and at the Internet layer of the TCP/IP model.
Thus this protocol has the responsibility of identifying hosts based upon their logical addresses
and to route data among them over the underlying network.
3. IPv4 ─ The TCP/IP Model
IPv4
9
IP provides a mechanism to uniquely identify hosts by an IP addressing scheme. IP uses best
effort delivery, i.e. it does not guarantee that packets would be delivered to the destined host,
but it will do its best to reach the destination. Internet Protocol version 4 uses 32-bit logical
address.
IPv4
10
Internet Protocol being a layer-3 protocol (OSI) takes data Segments from layer-4 (Transport)
and divides it into packets. IP packet encapsulates data unit received from above layer and
add to its own header information.
The encapsulated data is referred to as IP Payload. IP header contains all the necessary
information to deliver the packet at the other end.
IP header includes many relevant information including Version Number, which, in this
context, is 4. Other details are as follows:
 Version: Version no. of Internet Protocol used (e.g. IPv4).
 IHL: Internet Header Length; Length of entire IP header.
 DSCP: Differentiated Services Code Point; this is Type of Service.
 ECN: Explicit Congestion Notification; It carries information about the congestion seen
in the route.
4. IPv4 ─ Packet Structure
IPv4
11
 Total Length: Length of entire IP Packet (including IP header and IP Payload).
 Identification: If IP packet is fragmented during the transmission, all the fragments
contain same identification number to identify original IP packet they belong to.
 Flags: As required by the network resources, if IP Packet is too large to handle, these
‘flags’ tell if they can be fragmented or not. In this 3-bit flag, the MSB is always set to
‘0’.
 Fragment Offset: This offset tells the exact position of the fragment in the original
IP Packet.
 Time to Live: To avoid looping in the network, every packet is sent with some TTL
value set, which tells the network how many routers (hops) this packet can cross. At
each hop, its value is decremented by one and when the value reaches zero, the packet
is discarded.
 Protocol: Tells the Network layer at the destination host, to which Protocol this packet
belongs to, i.e. the next level Protocol. For example protocol number of ICMP is 1, TCP
is 6 and UDP is 17.
 Header Checksum: This field is used to keep checksum value of entire header which
is then used to check if the packet is received error-free.
 Source Address: 32-bit address of the Sender (or source) of the packet.
 Destination Address: 32-bit address of the Receiver (or destination) of the packet.
 Options: This is optional field, which is used if the value of IHL is greater than 5.
These options may contain values for options such as Security, Record Route, Time
Stamp, etc.
IPv4
12
End of ebook preview
If you liked what you saw…
Buy it from our store @ https://store.tutorialspoint.com

More Related Content

PPTX
Internet, Intranet and Extranet
DOCX
interoperatbility between IPv4 and IPv6
PPTX
ipv4 & ipv6 by pavan
PPT
Ipv4 vs Ipv6 comparison
PPTX
IPv4 to Ipv6
PPTX
Compatibility between IPv4 and IPv6
PDF
Ipv4 tutorial
PDF
In Defence of NATs
Internet, Intranet and Extranet
interoperatbility between IPv4 and IPv6
ipv4 & ipv6 by pavan
Ipv4 vs Ipv6 comparison
IPv4 to Ipv6
Compatibility between IPv4 and IPv6
Ipv4 tutorial
In Defence of NATs

What's hot (20)

PPTX
IPV6 Introduction
PDF
IPv6 Adressvergabe und Adressierung
PPTX
A very good introduction to IPv6
PPTX
PPT
Internet Protocol Version 6
PPTX
Comparative study of IPv4 and IPv6 on Windows and Linux.
PDF
IPV6 by Philip Smith
PDF
Unit 7 - Internet and Intranet Applications - IT
PPTX
Ipv4 & ipv6
PPTX
PPT
Internet Protocol Version 6 By Suvo 2002
PPTX
IPV4 vs IPV6
PPTX
Topic 2.4 network services
PPTX
Topic 2.3 network addressing for tcpip
PPTX
I pv4 vs ipv6
PDF
Power point presentation
PPTX
IPv6 - The Next next generation protocol
PPTX
98 366 mva slides lesson 8
PPT
Basic of ip subnet and addressing
IPV6 Introduction
IPv6 Adressvergabe und Adressierung
A very good introduction to IPv6
Internet Protocol Version 6
Comparative study of IPv4 and IPv6 on Windows and Linux.
IPV6 by Philip Smith
Unit 7 - Internet and Intranet Applications - IT
Ipv4 & ipv6
Internet Protocol Version 6 By Suvo 2002
IPV4 vs IPV6
Topic 2.4 network services
Topic 2.3 network addressing for tcpip
I pv4 vs ipv6
Power point presentation
IPv6 - The Next next generation protocol
98 366 mva slides lesson 8
Basic of ip subnet and addressing
Ad

Similar to Ipv4 tutorial (20)

PDF
Ipv4 tutorial
PDF
CN 5151(15) Module II part 2 13082020.pdf
PPTX
Unit 1- Network Layer and Protocols-4.pptx
PPTX
Week 2 - Computer networks lab - ACU.pptx
PPTX
Introduction to computer networks
PPTX
Network layer in computer networks .pptx
PPTX
8-Lect_8 Addressing the Network.tcp.pptx
PDF
IP ADDRESSING AND SUBNETTING REPORT
PPTX
Cn ipv4 addressing
PDF
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
PPT
Internet Protocol Version-4 Addressing.ppt
PPT
network layer and networking Chapter 4.ppt
PPTX
ffuyu yguyguyg.pptx
PDF
Network layer logical addressing
PPTX
Web technology unit I - Part B
PPTX
PDF
Chapter 2 - Networks including the internet.pdf
PDF
21 Scheme_ MODULE-3_CCN.pdf
PPTX
Understanding Internet Protocol 4.p hptx
PDF
IPv4 vs IPv6 Know the Difference Between Two IP Versions.pdf
Ipv4 tutorial
CN 5151(15) Module II part 2 13082020.pdf
Unit 1- Network Layer and Protocols-4.pptx
Week 2 - Computer networks lab - ACU.pptx
Introduction to computer networks
Network layer in computer networks .pptx
8-Lect_8 Addressing the Network.tcp.pptx
IP ADDRESSING AND SUBNETTING REPORT
Cn ipv4 addressing
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Internet Protocol Version-4 Addressing.ppt
network layer and networking Chapter 4.ppt
ffuyu yguyguyg.pptx
Network layer logical addressing
Web technology unit I - Part B
Chapter 2 - Networks including the internet.pdf
21 Scheme_ MODULE-3_CCN.pdf
Understanding Internet Protocol 4.p hptx
IPv4 vs IPv6 Know the Difference Between Two IP Versions.pdf
Ad

More from HarikaReddy115 (20)

PDF
Dbms tutorial
PDF
Data structures algorithms_tutorial
PDF
Wireless communication tutorial
PDF
Cryptography tutorial
PDF
Cosmology tutorial
PDF
Control systems tutorial
PDF
Computer logical organization_tutorial
PDF
Computer fundamentals tutorial
PDF
Compiler design tutorial
PDF
Communication technologies tutorial
PDF
Biometrics tutorial
PDF
Behavior driven development_tutorial
PDF
Basics of computers_tutorial
PDF
Basics of computer_science_tutorial
PDF
Basic electronics tutorial
PDF
Auditing tutorial
PDF
Artificial neural network_tutorial
PDF
Artificial intelligence tutorial
PDF
Antenna theory tutorial
PDF
Analog communication tutorial
Dbms tutorial
Data structures algorithms_tutorial
Wireless communication tutorial
Cryptography tutorial
Cosmology tutorial
Control systems tutorial
Computer logical organization_tutorial
Computer fundamentals tutorial
Compiler design tutorial
Communication technologies tutorial
Biometrics tutorial
Behavior driven development_tutorial
Basics of computers_tutorial
Basics of computer_science_tutorial
Basic electronics tutorial
Auditing tutorial
Artificial neural network_tutorial
Artificial intelligence tutorial
Antenna theory tutorial
Analog communication tutorial

Recently uploaded (20)

PPTX
History, Philosophy and sociology of education (1).pptx
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
Complications of Minimal Access Surgery at WLH
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Classroom Observation Tools for Teachers
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Cell Types and Its function , kingdom of life
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
History, Philosophy and sociology of education (1).pptx
Weekly quiz Compilation Jan -July 25.pdf
UNIT III MENTAL HEALTH NURSING ASSESSMENT
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
01-Introduction-to-Information-Management.pdf
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
Complications of Minimal Access Surgery at WLH
Microbial disease of the cardiovascular and lymphatic systems
Orientation - ARALprogram of Deped to the Parents.pptx
Final Presentation General Medicine 03-08-2024.pptx
Classroom Observation Tools for Teachers
Final Presentation General Medicine 03-08-2024.pptx
Computing-Curriculum for Schools in Ghana
Chinmaya Tiranga quiz Grand Finale.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Cell Types and Its function , kingdom of life
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Anesthesia in Laparoscopic Surgery in India
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
What if we spent less time fighting change, and more time building what’s rig...

Ipv4 tutorial

  • 2. IPv4 i AbouttheTutorial Internet Protocol version 4 (IPv4) is the fourth version in the development of the Internet Protocol (IP) and the first version of the protocol to be widely deployed. IPv4 is described in IETF publication RFC 791 (September 1981), replacing an earlier definition (RFC 760, January 1980). This tutorial will help you in understanding IPv4 and its associated terminologies along with appropriate references and examples. Audience This tutorial has been designed to help beginners understand basic concepts of IPv4 required to work with any TCP/IP based protocols. After completing this tutorial, you will find yourself at a moderate level of expertise of IPv4 from where you can take yourself to next levels. Prerequisites Before you start proceeding with this tutorial, I'm making an assumption that you are already aware of basic computer and network concepts such as what is a protocol, why do we need protocol, Network Layers, etc. Copyright&Disclaimer  Copyright 2017 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at contact@tutorialspoint.com
  • 3. IPv4 ii TableofContents About the Tutorial....................................................................................................................................i Audience..................................................................................................................................................i Prerequisites............................................................................................................................................i Copyright & Disclaimer.............................................................................................................................i Table of Contents....................................................................................................................................ii 1. IPV4 ─ OVERVIEW................................................................................................................1 What is Network? ...................................................................................................................................1 Host Addressing ......................................................................................................................................2 2. IPV4 ─ THE OSI MODEL........................................................................................................3 Network Layer.........................................................................................................................................4 3. IPV4 ─ THE TCP/IP MODEL...................................................................................................5 Internet Protocol Version 4 (IPv4) ...........................................................................................................5 4. IPV4 ─ PACKET STRUCTURE .................................................................................................6 5. IPV4 ─ ADDRESSING.............................................................................................................8 Unicast Addressing Mode........................................................................................................................8 Broadcast Addressing Mode....................................................................................................................8 Multicast Addressing Mode.....................................................................................................................9 Hierarchical Addressing Scheme............................................................................................................10 Subnet Mask .........................................................................................................................................10 Binary Representation ..........................................................................................................................10 6. IPV4 ─ ADDRESS CLASSES...................................................................................................12 Class A Address .....................................................................................................................................12 Class B Address .....................................................................................................................................13
  • 4. IPv4 iii Class C Address......................................................................................................................................13 Class D Address .....................................................................................................................................13 Class E Address......................................................................................................................................13 7. IPV4 ─ SUBNETTING...........................................................................................................14 Class A Subnets .....................................................................................................................................14 Class B Subnets .....................................................................................................................................15 Class C Subnets......................................................................................................................................16 8. IPV4 ─ VLSM ......................................................................................................................17 9. IPV4 ─ RESERVED ADDRESSES............................................................................................19 Private IP Addresses..............................................................................................................................19 Loopback IP Addresses..........................................................................................................................19 Link-local Addresses..............................................................................................................................20 10. IPV4 ─ EXAMPLE................................................................................................................21 Packet Flow in Network ........................................................................................................................21 Step 1 – Acquiring an IP Address (DHCP) ...............................................................................................22 Step 2 – DNS Query ...............................................................................................................................22 Step 3 – ARP Request ............................................................................................................................22 11. IPV4 ─ SUMMARY..............................................................................................................23 Internet Protocol v6 (IPv6) ....................................................................................................................23
  • 5. IPv4 4 This era is said to be the era of computers. Computers have significantly changed the way we live. A computing device when connected to other computing device(s) enables us to share data and information at lightning fast speed. WhatisNetwork? A Network in the world of computers is said to be a collection of interconnected hosts, via some shared media which can be wired or wireless. A computer network enables its hosts to share and exchange data and information over the media. Network can be a Local Area Network spanned across an office or Metro Area Network spanned across a city or Wide Area Network which can be spanned across cities and provinces. A computer network can be as simple as two PCs connected together via a single copper cable or it can be grown up to the complexity where every computer in this world is connected to every other, called the Internet. A network then includes more and more components to reach its ultimate goal of data exchange. Below is a brief description of the components involved in computer network:  Hosts - Hosts are said to be situated at ultimate end of the network, i.e. a host is a source of information and another host will be the destination. Information flows end to end between hosts. A host can be a user’s PC, an internet Server, a database server etc.  Media - If wired, then it can be copper cable, fiber optic cable, and coaxial cable. If wireless, it can be free-to-air radio frequency or some special wireless band. Wireless frequencies can be used to interconnect remote sites too.  Hub - A hub is a multiport repeater and it is used to connect hosts in a LAN segment. Because of low throughputs hubs are now rarely used. Hub works on Layer-1 (Physical Layer) of OSI Model.  Switch - A Switch is a multiport bridge and is used to connect hosts in a LAN segment. Switches are much faster than Hubs and operate on wire speed. Switch works on Layer-2 (Data Link Layer), but Layer-3 (Network Layer) switches are also available.  Router - A router is Layer-3 (Network Layer) device which makes routing decisions for the data/information sent for some remote destination. Routers make the core of any interconnected network and the Internet.  Gateways - A software or combination of software and hardware put together, works for exchanging data among networks which are using different protocols for sharing data.  Firewall - Software or combination of software and hardware, used to protect users’ data from unintended recipients on the network/internet. All components in a network ultimately serve the hosts. 1. IPv4 ─ Overview
  • 6. IPv4 5 HostAddressing Communication between hosts can happen only if they can identify each other on the network. In a single collision domain (where every packet sent on the segment by one host is heard by every other host) hosts can communicate directly via MAC address. MAC address is a factory coded 48-bits hardware address which can also uniquely identify a host. But if a host wants to communicate with a remote host, i.e. not in the same segment or logically not connected, then some means of addressing is required to identify the remote host uniquely. A logical address is given to all hosts connected to Internet and this logical address is called Internet Protocol Address.
  • 7. IPv4 6 The International Standard Organization has a well-defined model for Communication Systems known as Open System Interconnection, or the OSI Model. This layered model is a conceptualized view of how one system should communicate with the other, using various protocols defined in each layer. Further, each layer is designated to a well-defined part of communication system. For example, the Physical layer defines all the components of physical nature, i.e. wires, frequencies, pulse codes, voltage transmission etc. of a communication system. The OSI Model has the following seven layers:  Application Layer (Layer-7): This is where the user application sits that needs to transfer data between or among hosts. For example: HTTP, file transfer application (FTP) and electronic mail etc.  Presentation Layer (Layer-6): This layer helps to understand data representation in one form on a host to other host in their native representation. Data from the sender is converted to on-the-wire data (general standard format) and at the receiver’s end it is converted to the native representation of the receiver.  Session Layer (Layer-5): This layer provides session management capabilities between hosts. For example, if some host needs a password verification for access and 2. IPv4 ─ The OSI Model
  • 8. IPv4 7 if credentials are provided then for that session password verification does not happen again. This layer can assist in synchronization, dialog control and critical operation management (e.g., an online bank transaction).  Transport Layer (Layer-4): This layer provides end-to-end data delivery among hosts. This layer takes data from the above layer and breaks it into smaller units called Segments and then gives it to the Network layer for transmission.  Network Layer (Layer-3): This layer helps to uniquely identify hosts beyond the subnets and defines the path which the packets will follow or be routed to reach the destination.  Data Link Layer (Layer-2): This layer takes the raw transmission data (signal, pulses, etc.) from the Physical Layer and makes Data Frames, and sends that to the upper layer and vice versa. This layer also checks any transmission errors and sorts it out accordingly.  Physical Layer (Layer-1): This layer deals with hardware technology and actual communication mechanism such as signaling, voltage, cable type and length, etc. NetworkLayer The network layer is responsible for carrying data from one host to another. It provides means to allocate logical addresses to hosts, and identify them uniquely using the same. Network layer takes data units from Transport Layer and cuts them into smaller unit called Data Packet. Network layer defines the data path, the packets should follow to reach the destination. Routers work on this layer and provides mechanism to route data to its destination.
  • 9. IPv4 8 A majority of the internet uses a protocol suite called the Internet Protocol Suite also known as the TCP/IP protocol suite. This suite is a combination of protocols which encompasses a number of different protocols for different purpose and need. Because the two major protocols in this suites are TCP (Transmission Control Protocol) and IP (Internet Protocol), this is commonly termed as TCP/IP Protocol suite. This protocol suite has its own reference model which it follows over the internet. In contrast with the OSI model, this model of protocols contains less layers. Figure: Comparative depiction of OSI and TCP/IP Reference Models This model is indifferent to the actual hardware implementation, i.e. the physical layer of OSI Model. This is why this model can be implemented on almost all underlying technologies. Transport and Internet layers correspond to the same peer layers. All three top layers of OSI Model are compressed together in single Application layer of TCP/IP Model. InternetProtocolVersion4(IPv4) Internet Protocol is one of the major protocols in the TCP/IP protocols suite. This protocol works at the network layer of the OSI model and at the Internet layer of the TCP/IP model. Thus this protocol has the responsibility of identifying hosts based upon their logical addresses and to route data among them over the underlying network. 3. IPv4 ─ The TCP/IP Model
  • 10. IPv4 9 IP provides a mechanism to uniquely identify hosts by an IP addressing scheme. IP uses best effort delivery, i.e. it does not guarantee that packets would be delivered to the destined host, but it will do its best to reach the destination. Internet Protocol version 4 uses 32-bit logical address.
  • 11. IPv4 10 Internet Protocol being a layer-3 protocol (OSI) takes data Segments from layer-4 (Transport) and divides it into packets. IP packet encapsulates data unit received from above layer and add to its own header information. The encapsulated data is referred to as IP Payload. IP header contains all the necessary information to deliver the packet at the other end. IP header includes many relevant information including Version Number, which, in this context, is 4. Other details are as follows:  Version: Version no. of Internet Protocol used (e.g. IPv4).  IHL: Internet Header Length; Length of entire IP header.  DSCP: Differentiated Services Code Point; this is Type of Service.  ECN: Explicit Congestion Notification; It carries information about the congestion seen in the route. 4. IPv4 ─ Packet Structure
  • 12. IPv4 11  Total Length: Length of entire IP Packet (including IP header and IP Payload).  Identification: If IP packet is fragmented during the transmission, all the fragments contain same identification number to identify original IP packet they belong to.  Flags: As required by the network resources, if IP Packet is too large to handle, these ‘flags’ tell if they can be fragmented or not. In this 3-bit flag, the MSB is always set to ‘0’.  Fragment Offset: This offset tells the exact position of the fragment in the original IP Packet.  Time to Live: To avoid looping in the network, every packet is sent with some TTL value set, which tells the network how many routers (hops) this packet can cross. At each hop, its value is decremented by one and when the value reaches zero, the packet is discarded.  Protocol: Tells the Network layer at the destination host, to which Protocol this packet belongs to, i.e. the next level Protocol. For example protocol number of ICMP is 1, TCP is 6 and UDP is 17.  Header Checksum: This field is used to keep checksum value of entire header which is then used to check if the packet is received error-free.  Source Address: 32-bit address of the Sender (or source) of the packet.  Destination Address: 32-bit address of the Receiver (or destination) of the packet.  Options: This is optional field, which is used if the value of IHL is greater than 5. These options may contain values for options such as Security, Record Route, Time Stamp, etc.
  • 13. IPv4 12 End of ebook preview If you liked what you saw… Buy it from our store @ https://store.tutorialspoint.com