Unit 4
Unit 4
Syllabus
Those that operate at the physical and data link layers (a bridge or a
two-layer switch).
Those that operate at the physical, data link, and network layers (a
router or a three-layer switch).
• A bridge operates in both the physical and the data link layer.
• That is, a network designed to use the OSI model can be connected to
another network using the Internet model.
• IPv4 addresses are unique- Two devices on the Internet can never have
the same address at the same time.
• 2N addresses
Address Space of IPv4
• IPv4 uses 32-bit addresses, which means that the address space (total
no: of addresses)is 232 or 4,294,967,296 (more than 4 billion).
1. Binary notation
2. Dotted-decimal notation.
Binary 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.
Classful Addressing
• Say for example -NID(Network ID) = 8bit, and HID(Host ID) = 24bit.
• So there are 28 that is 256 total network are created and 224 that is 16M
Host per network.
Blocks
Class A
• IP addresses belonging to class A are assigned to the networks that contain a
large number of hosts.
• The network ID is 8 bits long.
• The host ID is 24 bits long.
Class B
• IP address belonging to class B is assigned to networks that range from
medium-sized to large-sized networks.
• The network ID is 16 bits long.
• The host ID is 16 bits long.
Class C
• IP addresses belonging to class C are assigned to small-sized networks.
• The network ID is 24 bits long.
• The host ID is 8 bits long.
Class D
• IP address belonging to class D is reserved for multi-casting. The higher-
order bits of the first octet of IP addresses belonging to class D is always
set to 1110.
Class E
• IP addresses belonging to class E are reserved for experimental and
research purposes. IP addresses of class E range from 240.0.0.0 –
255.255.255.255.
Mask
• Mask is a 32-bit binary number that separates an IP address into two
parts: the network and the host
• The mask can help us to find the netid and the hostid.
• The concept does not apply to classes D and E
• Example, the mask for a class C address has 24 1s, which means the
first 24 bits of any address in class C define the netid; the next 8 bits
define the hostid
Subnetting
• The time came when most of the class A and class B addresses were
depleted; however, there was still a huge demand for midsize blocks.
• An organization can apply for a set of class C blocks instead of just one.
• In this scheme, there are no classes, but the addresses are still granted
in blocks.
Address Blocks
• 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.
• For example, a household may be given only two addresses;
• a large organization may be given thousands of addresses.
• An ISP, as the Internet service provider, may be given thousands or
hundreds of thousands based on the number of customers it may serve.
Restrictions
• However, in classless addressing the mask for a block can take any
value from 0 to 32
• It is very convenient to give just the value of n preceded by a slash.
Network Addresses
• A very important concept in IP addressing is the network address.
• When an organization is given a block of addresses, the organization is
free to allocate the addresses to the devices that need to be connected to
the Internet.
• The first address in the class, however, is normally (not always) treated
as a special address.
• The first address is called the network address and defines the
organization network.
• It defines the organization itself to the rest of the world.
• The first address is the one that is used by routers to direct the message
sent to the organization from the outside.
Network Address Translation (NAT)
• The number of home users and small businesses that want to use the
Internet is ever-increasing.
• Many have created small networks with several hosts and need an IP
address for each host.
• With the shortage of addresses, this is a serious problem
• A quick solution to this problem is called network address translation
(NAT).
• NAT enables a user to have a large set of addresses internally and one
address, or a small set of addresses, externally
• The traffic inside can use the large set; the traffic outside, the small
set.
• To separate the addresses used inside the home or business and the
ones used for the Internet, the Internet authorities have reserved three
sets of addresses as private addresses
• Any organization can use an address out of this set without permission from
the Internet authorities.
• Everyone knows that these reserved addresses are for private networks.
• They are unique inside the organization, but they are not unique globally.
• No router will forward a packet that has one of these addresses as the
destination address.
• The site must have only one single connection to the global Internet through
a router that runs the NAT software.
• The router that connects the network to the global address uses one
private address and one global address.
The private network is transparent to the rest of the Internet; the rest
of the Internet sees only the NAT router with the address 200.24.5.8.
• Address Translation All the outgoing packets go through the NAT router, which
replaces the source address in the packet with the global NAT address.
• All incoming packets also pass through the NAT router, which replaces the
destination address in the packet (the NAT router global address) with the
appropriate private address.
IPv6 Addresses
• An IPv6 address consists o- 16 bytes
(octets); it is 128 bits long.
• IPv6 has a much larger address space; 2128 addresses are available(340
billion ).
• A few leftmost bits, called the type prefix, in each address define its
category.
• One to one
• Registry identifier. This 5-bit field indicates the agency that has
registered the address.
• Node identifier. The last field defines the identity of the node
connected to a subnet. A length of 48 bits is recommended for this
field to make it compatible with the 48-bit link (physical)address used
by Ethernet.
Multicast Addresses
• Multicast addresses are used to define a group of hosts
• A packet sent to a multicast address must be delivered to each member of the
group.
• One to many
• The second field is a flag that defines the group address as either
permanent or transient.
• A loopback address is used by a host to test itself without going into the network.
• A compatible address is used during the transition from IPv4 to IPv6.It is used
when a computer using IPv6 wants to send a message to another computer using
IPv6, but the message needs to pass through a part of the network that still operates in
IPv4.
• A mapped address is also used during the transition. However, it is used when a
computer that has migrated to IPv6 wants to send a packet to a computer still using
IPv4.
Local Addresses
• These addresses are used when an organization wants to use IPv6
protocol without being connected to the global Internet. Nobody
outside the organization can send a message to the nodes using these
addresses.
• The term best-effort means that IPv4 provides no error control or flow
control.
• IPv4 assumes the unreliability of the underlying layers and does its
best to get a transmission through to its destination.
• This implies that datagrams sent by the same source to the same
destination could arrive out of order.
2. Data Part.
• Version (VER): This 4-bit field defines the version of the IPv4
protocol. Currently, the version is 4. However, version 6 (or IPng) may
totally replace version 4 in the future.
• 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).
IPV4 DATAGRAM HEADER
• Services- 8-bit field. This field, previously called service type, is now
called differentiated services.
Service Type
• Although a bit can be either 0 or 1, one and only one of the bits can
have the value of 1 in each datagram.