IP Addressing5
IP Addressing5
5
Logical Addressing
• Address Space
• A protocol such as IPv4 that defines addresses
has an address space. An address space is the
total number of addresses used by the protocol.
• If a protocol uses N bits to define an address,
the address space is 2 because each bit can
have two different values (0 or 1) and N bits
can have 2 values.
• IPv4 uses 32-bit addresses, which means that
the address space is 232 or 4,294,967,296 (more
than 4 billion).
6
Logical Addressing
• Notations
• There are two prevalent notations to show an IPv4
address: binary notation and dotted decimal
notation.
• Binary Notation
• In binary notation, the IPv4 address is displayed as
32 bits. Each octet is often referred to as a byte.
• So it is common to hear an IPv4 address referred to
as a 32-bit address or a 4-byte address.
• The following is an example of an IPv4 address in
binary notation:
• 01110101 10010101 00011101 00000010
7
Logical Addressing
• Dotted-Decimal Notation
• To make the IPv4 address more compact and
easier to read, Internet addresses are usually
written in decimal form with a decimal point
(dot) separating the bytes. The following is the
dotted~decimal notation of the above address:
117.149.29.2
8
Logical Addressing
Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
9
Logical Addressing
• Example 19.1
• Change the following IPv4 addresses from binary
notation to dotted-decimal notation.
• a. 10000001 00001011 00001011 11101111
• b. 11000001 10000011 00011011 11111111
• Solution
• We replace each group of 8 bits with its equivalent
decimal number and add dots for separation.
• a. 129.11.11.239
• b. 193.131.27.255
10
Logical Addressing
• Find the error, if any, in the following IPv4
addresses.
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
11
Logical Addressing
• Classful Addressing
• IPv4 addressing, at its inception, used the concept of
classes. This architecture is called classful addressing.
• In classful addressing, the address space is divided into
five classes: A, B, C, D, and E. Each class occupies
some part of the address space
• We can find the class of an address when given the
address in binary notation or dotted-decimal notation.
• If the address is given in binary notation, the first few
bits can immediately tell us the class of the address. If
the address is given in decimal-dotted notation, the first
byte defines the class.
12
Logical Addressing
Figure 19.2 Finding the classes in binary and dotted-decimal notation
13
Internet Protocol
• Datagram
• Packets in the IPv4 layer are called datagrams.
• A datagram is a variable-length packet
consisting of two parts: header and data.
• The header is 20 to 60 bytes in length and
contains information essential to routing and
delivery.
• It is customary in TCP/IP to show the header in
4-byte sections.
14
Internet Protocol
Figure 20.4 Position of IPv4 in TCP/IP protocol suite
15
Internet Protocol
• IPv4 is an unreliable and connectionless
datagram protocol-a best-effort delivery
service. The term best-effort means that IPv4
provides no error control or flow control.
• If reliability is important, IPv4 must be paired
with a reliable protocol such as TCP.
• IPv4 is also a connectionless protocol for a
packet-switching network that uses. the
datagram approach
16
Internet Protocol
• Datagram
• Packets in the IPv4 layer are called datagrams.
• A datagram is a variable-length packet
consisting of two parts: header and data.
• The header is 20 to 60 bytes in length and
contains information essential to routing and
delivery. It is customary in TCP/IP to show the
header in 4-byte sections.
• Version (VER). This 4-bit field defines the
version of the IPv4 protocol.
17
Internet Protocol
• Header length (HLEN). This 4-bit field defines
the total length of the datagram header in 4-byte
words.
• This field is needed because the length of the
header is variable (between 20 and 60 bytes).
• Services. IETF has changed the interpretation
and name of this 8-bit field. This field,
previously called service type, is now called
differentiated services.
18
IP Packet Header
21
Internet Protocol
22
Internet Protocol
• Checksum. The checksum concept and its
calculation.
• Source address. This 32-bit field defines the IPv4
address of the source. This field must remain
unchanged during the time the IPv4 datagram
travels from the source host to the destination host.
• Destination address. This 32-bit field defines the
IPv4 address of the destination.
• This field must remain unchanged during the time
the IPv4 datagram travels from the source host to
the destination host.
23
Internet Protocol
• Fragmentation
• A datagram can travel through different networks.
Each router decapsulates the IPv4 datagram from
the frame it receives, processes it, and then
encapsulates it in another frame.
• The format and size of the received frame depend
on the protocol used by the physical network
through which the frame has just traveled.
• The format and size of the sent frame depend on
the protocol used by the physical network through
which the frame is going to travel.
24
Internet Protocol
Figure 20.9 Maximum transfer unit (MTU)
25
Internet Protocol
• IPv6
• The next-generation IP, or IPv6, has some advantages
over IPv4 that can be summarized as follows:
• Larger address space. An IPv6 address is 128 bits
long. Compared with the 32-bit address of IPv4, this is
a huge (2 ) increase in the address space.
• Better header format. IPv6 uses a new header format in
which options are separated from the base header and
inserted, when needed, between the base header and
the upper-layer data.
• This simplifies and speeds up the routing process
because
26
most of the options do not need to be checked
by routers.
Internet Protocol
• New options. IPv6 has new options to allow for
additional functionalities.
• Allowance for extension. IPv6 is designed to allow
the extension of the protocol if required by new
technologies or applications.
• Support for resource allocation. In IPv6, the type-
of-service field has been removed, but a
mechanism (called low label) has been added to
enable the source to request special handling of the
packet. This mechanism can be used to support
traffic such as real-time audio and video.
• Support for more security. The encryption and
authentication options in IPv6 provide
confidentiality
27
and integrity of the packet.
Internet Protocol
• Packet Format
• Each packet is composed of a mandatory base
header followed by the payload. The payload
consists of two parts: optional extension
headers and data from an upper layer.
• The base header occupies 40 bytes, whereas the
extension headers and data from the upper layer
contain up to 65,535 bytes ofinformation.
28
Internet Protocol
Figure 20.15 IPv6 datagram header and payload
29
Internet Protocol
Figure 20.16 Format of an IPv6 datagram
30
Internet Protocol
• Version. This 4-bit field defines the version
number of the IP. For IPv6, the value is 6.
• Priority. The 4-bit priority field defines the
priority of the packet with respect to traffic
congestion.
• Flow label. The flow label is a 3-byte (24-bit)
field that is designed to provide special
handling for a particular flow of data.
• Payload length. The 2-byte payload length field
defines the length of the IP datagram excluding
31
the base header.
Internet Protocol
• Next header. The next header is an 8-bit field defining the
header that follows the base header in the datagram. The next
header is either one of the optional extension headers used by
IP or the header of an encapsulated packet such as UDP or
TCP. Each extension header also contains this field. Note that
this field in version 4 is called the protocol.
• Hop limit. This 8-bit hop limit field serves the same purpose as
the TIL field in IPv4.
• Source address. The source address field is a 16-byte (128-bit)
Internet address that identifies the original source of the
datagram.
• Destination address. The destination address field is a 16-byte
(128-bit) Internet address that usually identifies the final
destination of the datagram. However, if source routing is
used, this field contains the address of the next router.
32
Domain Name Addressing
• Most web browsers do not use the IP address to locate
Web sites and individual pages.
• They use domain name addressing.
• A domain name is a unique name associated with a
specific IP address by a program that runs on an
Internet host computer.
• The program, which coordinates the IP addresses and
domain names for all computers attached to it, is called
DNS (Domain Name System ) software.
• The host computer that runs this software is called a
domain name server.
Domain Name Addressing
• Domain names can include any number of parts separated by
periods, however most domain names currently in use have only
three or four parts.
• Domain names follow hierarchical model that you can follow
from top to bottom if you read the name from the right to the
left.
• For example, the domain name gsb.uchicago.edu is the computer
connected to the Internet at the Graduate School of Business
(gsb), which is an academic unit of the University of Chicago
(uchicago), which is an educational institution (edu).
• No other computer on the Internet has the same domain name.
Uniform Resource Locators
• The IP address and the domain name each identify a particular
computer on the Internet.
• However, they do not indicate where a Web page’s HTML
document resides on that computer.
• To identify a Web pages exact location, Web browsers rely on
Uniform Resource Locator (URL).
• URL is a four-part addressing scheme that tells the Web
browser:
➢ What transfer protocol to use for transporting the file
➢ The domain name of the computer on which the file resides
➢ The pathname of the folder or directory on the computer on
which the file resides
➢ The name of the file
Structure of a Uniform Resource Locators
pathname
protocol
http://www.chicagosymphony.org/civicconcerts/index.htm