0% found this document useful (0 votes)
27 views128 pages

Next Unit Slide

Uploaded by

Archi Goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views128 pages

Next Unit Slide

Uploaded by

Archi Goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 128

RANDOM ACCESS

1. In random access methods, no station is superior to another station and none is assigned the control
over another.
2. No station permits, or does not permit, another station to send.
3. Two features.
• First, there is no scheduled time for a station to transmit. Transmission is random among the
stations. That is why these methods are called random access.
• Second, no rules specify which station should send next. Stations compete with one another to
access the medium.
However, if more than one station tries to send, there is an access conflict-collision-and the frames will be
either destroyed or modified.
ALOHA
• Earliest random-access method, was developed at the University of
Hawaii around 1970.

• It was designed for a radio (wireless) LAN, but it can be used on any
shared medium.

• The original ALOHA protocol is called pure ALOHA. This is a simple,


but elegant protocol.

• The idea is that each station sends a frame whenever it has a frame
to send. However, there is the possibility of collision between frames Norman Manuel Abramson
from different stations.
• We assume that the stations send fixed-length frames with each frame taking Tt to send.
• Vulnerable time in which there is a possibility of collision, we see that the time during
which a collision may occur in pure ALOHA, is 2 times the frame transmission time.
• Pure ALOHA vulnerable time= 2 x Tt
ALOHA
SLOTTED ALOHA
• Pure ALOHA has a vulnerable time of 2 x Tt. This is so because there is no rule that defines when the
station can send. A station may send soon after another station has started or soon before another
station has finished.
• Slotted ALOHA was invented to improve the efficiency of pure ALOHA. In slotted ALOHA we divide the
time into slots of Tt s and force the station to send only at the beginning of the time slot.
• Because a station is allowed to send only at the beginning of the synchronized time slot, if a
station misses this moment, it must wait until the beginning of the next time slot. This means
that the station which started at the beginning of this slot has already finished sending its
frame.
• Off course, there is still the possibility of collision if two stations try to send at the beginning of
the same time slot. However, the vulnerable time is now reduced to one-half, equal to Tt
Aspect Pure ALOHA Slotted ALOHA
Time Structure No specific time structure; data can be Operates on time slots; data is sent at
sent at any time. the beginning of a time slot.

Efficiency Lower efficiency (~18.4%) due to


higher probability of collisions.
Higher efficiency (~37%) as it reduces
the chance of collisions.

Messages are sent in synchronized


time slots, reducing the chance of
Collision Handling If a collision occurs, the message is
resent after a random time interval. collision but if a collision occurs, it is
handled similarly to Pure ALOHA.

Complexity Less complex as it doesn't require


synchronization.
More complex due to the need for
time synchronization.
CARRIER SENSE MULTIPLE ACCESS (CSMA)
• To minimize the chance of collision and, therefore, increase the performance, the CSMA
method was developed. The chance of collision can be reduced if a station senses the medium
before trying to use it.
• Carrier sense multiple access (CSMA) requires that each station first listen to the medium (or
check the state of the medium) before sending, so "sense before transmit" or" listen before
talk." CSMA can reduce the possibility of collision, but it cannot eliminate it.
• The possibility of collision still exists because of propagation delay; when a station sends a
frame, it still takes time (although very short) for the first bit to reach every station and for
every station to sense it. In other words, a station may sense the medium and find it idle, only
because the first bit sent by another station has not yet been received.
VULNERABLE TIME
• The vulnerable time for CSMA is the propagation time Tp. When a station sends a frame
and any other station tries to send a frame during this time, a collision will result.
• But if the first bit of the frame reaches the end of the medium, every station will already
have heard the bit and will refrain from sending.
Persistence Methods

• What should a station do if the channel is busy? What should a station


do if the channel is idle?
• Three methods have been devised to answer these questions:

• 1-persistent method

• Non-persistent method

• P-persistent method.
• 1-Persistent
• If the station finds the line idle, it sends its frame immediately,
• If the channel is not idle, the station will continuously sense the channel
• Nonpersistent
• If the station finds the channel idle, it sends its frame immediately.
• Stations will wait for a random amount of time if they find the channel is busy,
• and when the channel is idle, it will send the frame again
• P-Persistent
• The p-persistent approach combines the advantages of the other two strategies. It reduces the chance of
collision and improves efficiency. In this method, after the station finds the line idle it follows these steps:
• With probability p, the station sends its frame.
• With probability q = 1 - p, the station waits for the beginning of the next time slot and checks the line again.
• a. If the line is idle, it goes to step 1.
• b. If the line is busy, it acts as though a collision has occurred and uses the backoff procedure.
CARRIER SENSE MULTIPLE ACCESS WITH COLLISION DETECTION (CSMA/CD)
• In this method, a station monitors the medium after it sends a frame to see if the transmission
was successful. If so, the station is finished. If, however, there is a collision, the frame is sent
again.
• Minimum Frame Size - For CSMA / CD to work, we need a restriction on the minimum frame
size. Before sending the last bit of the frame, the sending station must detect a collision, if any,
and abort the transmission.
• This is so because the station, once the entire frame is sent, does not monitor the line for
collision detection. Therefore, the frame transmission time Tt must be at least two times the
maximum propagation time Tp.
• To understand the reason, let us think about the worst-case scenario. If the two stations
involved in a collision are the maximum distance apart, the signal from the first takes time Tp to
reach the second, and the effect of the collision takes another time Tp to reach the first. So the
requirement is that the first station must still be transmitting after 2Tp.
• Energy Level
• We can say that the level of energy in a channel can have three values: zero, normal, and abnormal. At the
zero level, the channel is idle. At the normal level, a station has successfully captured the channel and is
sending its frame.
• At the abnormal level, there is a collision and the level of the energy is twice the normal level. A station that
has a frame to send or is sending a frame needs to monitor the energy level to determine if the channel is
idle, busy, or in collision mode.
CARRIER SENSE MULTIPLE ACCESS WITH COLLISION AVOIDANCE (CSMA/CA)
• In a wireless network, much of the sent energy is lost in transmission. The received signal has very little energy.
Therefore, a collision may add only 5 to 10 percent additional energy. This is not useful for effective collision
detection.
• We need to avoid collisions on wireless networks because they cannot be detected. Carrier sense multiple access
with collision avoidance (CSMA / CA) was invented for this network. Collisions are avoided through the use of
CSMA / CA
• three strategies: the interframe space, the contention window, and acknowledgment
• Interframe Space (IFS)
• First, collisions are avoided by delay transmission even if the channel is found idle. When an idle channel is
found, the station does not send immediately. It waits for a period of time called the interframe space or
IFS.

• The IFS time allows the front of the transmitted signal by the distant station to reach this station. If after the
IFS time the channel is still idle, the station can send, but it still needs to wait a time, equal to the
contention time. The IFS variable can also be used to prioritize stations or frame types.
CONTENTION WINDOW
• The contention window is an amount of time divided into slots. A station that is ready to send chooses a random number
of slots as its wait time.

• The number of slots in the window changes according to the binary exponential back-off strategy.

• This means that it is set to one slot the first time and then doubles each time.

• One interesting point about the contention window is that the station needs to sense the channel after each time slot.

• However, if the station finds the channel busy, it does not restart the process; it just stops the timer and restarts it when
the channel is sensed as idle. This gives priority to the station with the longest waiting time.
• Acknowledgment
• With all these precautions, there still may be a collision resulting in destroyed data. In addition, the data may
be corrupted during the transmission. The positive acknowledgment and the time-out timer can help
guarantee that the receiver has received the frame.
ACK in Random Access Protocol
• ALOHA uses ACK because there’s no collision avoidance; the sender needs
feedback to know if the data was received.

• CSMA doesn’t use ACK because it assumes collisions are rare if the channel is
clear when sending.

• CSMA/CD doesn’t use ACK because it detects collisions as they happen and
handles them immediately.

• CSMA/CA uses ACK because detecting collisions in wireless networks is difficult,


so an acknowledgment is necessary to confirm successful transmission.
•Controlled access protocol

• Which station will send the packet ! this is done by taking the information
from all other station.

• In this protocol basically 3 methods are used:


• Polling
• Reservation
• Token Passing
•Polling:

• There is a Centralized controller which polls ‘stations’, and


gives them an opportunity to send one packet.
• All the data which needs to exchange must go through the
controller.
• Example : Star Topology
•Advantage: It avoids collisions, as only the polled device can transmit.
•Disadvantage: It introduces latency because a device must wait for its
turn to be polled, even if it has high-priority data to send.
• Efficiency = Useful time / total time

• Useful time = Tt
• Total time = Tpo + Tp + Tt

Efficency = Tt / (Tpo + Tp + Tt )
• Reservation:
• Station that wants to send data needs to make a reservation.

• Time is divided into slots.

• In each slots, a reservation frame precedes the data frames sent in that
interval.
•Advantage: It ensures efficient use of the channel and can support high-bandwidth transmissions
without collisions.

•Disadvantage: Reservation may take some time, introducing a delay before actual transmission
can occur.
In the above figure there are 3 slots made if 3 stations want
to send data.
In the first interval, only station 1, and station 3 made a
reservation and in the second interval. Only station 1 made a
reservation
Token passing:
• Stations are connected in the form of ring.
• Access is granted through the token.
• when the station receives the token, it can send a frame (if it has frame) before it passes the
token to the next station;
• if the station does not have a frame simply, it will pass the token to the next station

Advantage: It avoids collisions, as only one device can transmit at a time.

•Disadvantage: If the token is lost or corrupted, the entire network can be disrupted until
the token is regenerated.
Delay Token Reinsertion &Early Token Reinsertion
• Delay Token Reinsertion and Early Token Reinsertion are strategies used in token passing
networks to control how quickly the token is released back into the network after a device has
finished transmitting data.
• Delay Token Reinsertion is a strategy where, after a device has finished sending
its data, it holds on to the token until the data transmission has fully completed.
This includes waiting for the packet to make a full round-trip around the network,
at which point the device receives its own packet back. This return serves as an
implicit acknowledgment that the data has reached its destination. Only after this
happens does the device release the token back into the network.
• How it Works:

•When a device gets the token and transmits data, it waits until the data returns to the sender (with
or without an acknowledgment bit set by the receiver) before releasing the token for the next
device.
•This method ensures that the data has been successfully transmitted through the network, but it
also means that the token is held for longer, potentially reducing overall network efficiency
Early Token Reinsertion

Early Token Reinsertion is a strategy where the token is reinserted into the
network as soon as data transmission begins, without waiting for
confirmation that the data has been successfully received by the recipient.
This allows the token to be available for other devices to use even while the
current device is still transmitting its data.

How it Works:
•When a device obtains the token and starts transmitting data, it quickly releases the
token back into the network, so other devices can begin their transmissions
concurrently.
•This method increases network efficiency by not requiring the token to "wait" for the
full transmission to complete at each device. However, it introduces the risk of collision
or errors if the data transfer fails, as no confirmation is received before the token
moves on
Channelization protocol

• Channelization is a multiple-access method in which the


available bandwidth of a link is shared in time, frequency,
between different stations
Frequency division multiple access:
In FDMA, the available bandwidth of the common channel is divided into bands.
Each station has an assigned separate channel
NETWORK LAYER
SWITCHING
• Switching in networking refers to the process of directing data packets between devices
within a network. It involves deciding the path that data should take to travel from the
source to the destination.
• Switches are devices that make this decision by inspecting packet information and
forwarding it to the correct destination.

Switching
Methods

Circuit Packet
Switching Switching

Datagra Virtual
m Approach
Approach
• Circuit switching needs to be handled at the Physical layer.
• There must be reservation of resources before the communication takes place
• Resources get reserved during the set-up phase, and for the entire duration, it gets fixed until
there is a teardown phase.
•Communication happens in three phases:
•Set up phase: A dedicated path needed to be established before the
•transfer of data.
•Data transfer phase: transfer of data takes place in this phase.
•Tear down phase: A signal is sent to release the resource.
• When the path has established, there is no danger of congestion.
• Switching at the traditional telephone network uses the circuit switching.
• Advantages of Circuit Switching: It has the following advantages :
• The main advantage of circuit switching is that a committed transmission channel is
established between the computers which gives a guaranteed data rate.
• In circuit switching there is no delay in data flow because of the dedicated transmission
path.
• No Header is required
• Reordering of data cannot happen.

•Disadvantages of Circuit Switching: It has the following disadvantages :


•It takes long time to establish connection.
•More bandwidth is required in setting up of dedicated channels.
•It cannot be used to transmit any other data even if the channel is free as the connection is
dedicated in circuit switching.
PACKET SWITCHING
• The message is divided into packets which are fixed or variable sized networks.
• There is no need to establish a dedicated path in advance.
• The allocation of resources is done on FCFS basis.

www.knowledgegat
Datagram network:
• In this, each packet has no relation to the other packet.
• It is normally done at the network layer.
• A switch in the datagram network uses a routing table which is based on the destination address.
• Sometimes, it is said that these networks are connectionless, which means the switch does not keep
the information about the connection state.
• The destination address in each packet remains the same.
• Packet may reach out of order as shown in the diagram.
Switching on the internet is done using the datagram approach.
• Virtual network - A virtual-circuit network is a cross between a circuit-switched
network and a datagram network. It has some characteristics of both. Used now-
a-days in telephone networks
• Virtual network –

•Predefined Logical Path:


A virtual circuit is established before data transmission, ensuring that all packets follow the same
predefined path.
•Connection-Oriented:
Virtual circuit switching requires a setup phase to establish the circuit, making it connection-oriented like
circuit switching.
•In-Order Packet Delivery:
Since all packets travel the same path, they are guaranteed to arrive in order at the destination, reducing
the need for reordering.
•Efficient Routing:
Routers and switches forward packets based on a label or identifier, which speeds up routing decisions
compared to traditional packet switching.
•Dynamic or Permanent Circuits:
Virtual circuits can be dynamic (Switched Virtual Circuits, SVCs) for temporary connections or permanent
(Permanent Virtual Circuits, PVCs) for long-term connections.
•Resource Management:
Resources are reserved for the duration of the communication session.
•32-bit Addressing:
IPV4
IPv4 uses 32-bit addresses, written as four numbers separated by dots (e.g.,
192.168.0.1).
•Packet-Based:
Data is broken into packets, each containing a header with source and
destination IP addresses.
•Connectionless:
IPv4 does not require a connection before sending data; each packet can take a
different route.
•Routing:
Routers use the destination IPv4 address to forward packets across networks.
•Address Exhaustion:
IPv4 addresses are running out, leading to the development of IPv6 with a larger
address space.
IPV4

www.knowledgegat
DATAGRAM FORMAT
• Packets used by the IP are called datagrams.
• A datagram is a variable-length packet consisting of two parts: header and payload (data).
• The header is 20 to 60 bytes in length and contains information essential to routing and delivery.
• Point to Note
• The length of IP header always lies in the range of [20 bytes, 60 bytes]
• The initial 5 rows of the IP header are always used. So, minimum length of IP header = 5 x 4 bytes =
20 bytes.
• The size of Options field can go up to 40 bytes. So, maximum length of IP header = 20 bytes + 40
bytes = 60 bytes.
• The range of header length field value is always [5, 15] as [20/4 = 5, 60/4 = 15]
• The range of header length is always [20, 60].
• Version Number: The 4-bit version number (VER) field defines the version of the
IPv4 protocol, which, has the value of 4.
• Header Length: The 4-bit header length (HLEN) field defines the total length of the datagram header in 4-byte
words. The IPv4 datagram has a variable-length header.

• Scaling Factor:
• To make the value of the header length (number of bytes) fit in a 4-bit header length, the total length of the
header is calculated as 4-byte words.
• The total length is divided by 4 and the value is inserted in the field.
• The receiver needs to multiply the value of this field by 4 to find the total length.
• Example: If header length field contains decimal value 5 (represented as 0101), then Header length = 5 x 4 =
20 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.
• Precedence is a 3-bit subfield ranging from 0 (000 in binary) to 7 (111 in binary). The precedence
defines the priority of the datagram in issues such as congestion. If a router is congested and
needs to discard some datagrams, those datagrams with lowest precedence are discarded first.
• Service Type: It defines how the datagram should be handled. Service type is an 8-bit field
that is used for Quality of Service (QoS).
• TOS bits is a 4-bit subfield with each bit having a special meaning. 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
• Total Length: It defines the total length (header plus data) of the IP datagram in bytes. This
field helps the receiving device to know when the packet has completely arrived.
• Minimum total length of datagram = 20 bytes (20 bytes header + 0 bytes data)
• Maximum total length of datagram = Maximum value of 16-bit word = 65535 bytes
• To find the length of the data coming from the upper layer, subtract the header length from
the total length.
• Length of data = total length − (HLEN) × 4
MAXIMUM TRANSFER UNIT (MTU)
it refers to the largest size (in bytes) of a data packet that can be
transmitted over a network medium without needing to be fragmented.

Example of MTU:

Imagine you're sending a letter, and the envelope size represents the MTU. If the MTU is
1500 bytes, you can put up to 1500 bytes of data into one packet (or one "envelope"). If the
data exceeds 1500 bytes, the message will need to be split into smaller packets and sent
across the network. This process of splitting is called fragmentation.
 The value of the MTU differs from one physical network protocol to another. For example, the value for a LAN is
normally 1500 bytes, but for a WAN it can be larger or smaller.
 When a datagram is fragmented it means that the payload of the IP datagram is fragmented and each fragment
has its own header with most of the fields repeated, but some have been changed such as flags, fragmentation
offset, and total length and checksum is recalculated at each point.
 A fragmented datagram may itself be fragmented if it encounters a network with an even smaller MTU. Thus,
datagram may be fragmented several times before it reaches the final destination.
• Identification: 16-bit identification field identifies a datagram originating from the source host.
To guarantee uniqueness, IP protocol uses a counter to label the datagrams.
• The counter is initialized to a positive number. When the IP protocol sends a datagram, it copies
the current value of the counter to the identification field and increments the counter by one.
• When a datagram is fragmented, the value in the identification field is copied into all
fragments, used for the identification of the fragments of an original IP datagram. The
identification number helps the destination in reassembling the datagram.
FRAGMENTATION
• Fragmentation is a process of dividing the datagram into fragments during its transmission.
• Datagram can be fragmented by the source host or any router in the path.
• The reassembly of the datagram, is done only by the destination host, because each fragment
becomes an independent datagram.
• The fragmented datagram can travel through different routes.
• Flag Field: The 3-bit flags field defines three flags.
• The leftmost bit is reserved (not used).
• The second bit (D bit) is called the do not fragment bit.
• If its value is 1, the machine must not fragment the datagram.
• If its value is 0, the datagram can be fragmented if necessary.
• The third bit (M bit) is called the more fragment bit.
• If its value is 1, it means the datagram is not the last fragment; there are more
fragments after this one.
• If its value is 0, it means this is the last or only fragment.
• Fragmentation Offset: The 13-bit fragmentation offset field shows the relative position of this fragment with
respect to the whole datagram.
• It is the offset of the data in the original datagram measured in units of 8 bytes.
 The bytes in the original datagram are numbered 0 to 3999.
 The first fragment carries bytes 0 to 1399. The offset value => 0/8 = 0.
 The second fragment carries bytes 1400 to 2799; the offset value => 1400/8 = 175.
 The third fragment carries bytes 2800 to 3999. The offset value => 2800/8 = 350.
• Time-to-Live (TTL): field in a datagram dictates the maximum number of hops (via routers) it
can take, generally set to twice the highest number of routers between any two hosts.
• Every router the datagram passes through decreases the TTL value by one; the datagram is
discarded if the TTL reaches zero, preventing it from circulating indefinitely due to potential
routing table errors.
• Besides limiting a datagram's lifespan, the TTL field can be used to restrict a packet's journey
deliberately, like confining it to a local network by setting the TTL value to 1, causing its discard
at the first router.
• Protocol: In TCP/IP, the data section of a packet, called the payload, carries the whole packet from
another protocol. A datagram, for example, can carry a packet belonging to any transport-layer
protocol such as UDP or TCP.
• When the datagram arrives at the destination, the value of this field helps to define to which
protocol the payload should be delivered.
Header checksum: The IP header checksum field only verifies the header, not the payload, indicating that
IP is not entirely reliable as it doesn't affirm the payload remains unaltered during transmission.
• Due to alterations in fields such as TTL at every router, the checksum needs frequent recalculations.
• Upper-level protocols encapsulating data in the IPv4 datagram maintain separate checksums that cover
the complete packet, thus the IPv4 datagram checksum doesn't validate the contained data.
• The IPv4 packet's header, which changes at each visited router (but not the data), is the only section
included in the checksum, preventing unnecessary increases in processing time from recalculating the
entire packet's checksum at every router.
• Source and Destination Addresses: These 32-bit source and destination address
fields define the IP address of the source and destination respectively.
IPV4 ADDRESSES
• The Internet Protocol addresses are 32 bits in length; this gives us a maximum of 232
addresses. These addresses are referred to as IPv4.

• This means that, theoretically, if there were no restrictions, more than 4 billion
(4,29,49,67,296) devices could be connected to the Internet. The actual number is much
less because of the restrictions imposed on the addresses.

• World population is often used to refer to the total number of humans currently living, and
was
estimated to have exceeded 8.0 billion as of Sept 2023
• The need for more addresses, in addition to other concerns about the IP layer, motivated a
new design of the IP layer called the new generation of IP or IPv6 (lP version 6). In this version,
the Internet uses 128-bit addresses that give much greater flexibility in address allocation
(3.4 *1038). These addresses are referred to as IPv6 (IP version 6) addresses.
UNIQUE AND UNIVERSAL
• An IP address is uniquely and universally defining the connection of a host or a router to the
Internet.

• They are unique in the sense that each address defines one, and only one, connection to the
Internet. Two devices on the Internet can never have the same address at the same time.

• The IPv4 addresses are universal in the sense that the addressing system must be accepted by any
host that wants to be connected to the Internet.

• The IP address is the address of the connection, not the host or the router, because if the device is
moved to another network, the IP address may be changed.
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. An
example of an IPv4 address in binary notation:
01110101 10010101 00011101 00000010

• 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
CLASSFUL ADDRESSING
• IPv4 addressing, at its inception, used the concept of classes. This architecture is called classful
addressing.
• A 32-bit IPv4 address is hierarchical and divided only into two parts:
• The first part of the address, called the prefix, defines the network (NetworkID).
• The second part of the address, called the suffix, defines the node (connection of a device to the
Internet (HostID)).
• IPv4 was first designed as a fixed-length prefix and is referred to as 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.
• To accommodate both small and large networks, three fixed-length prefixes were designed
(n = 8, n = 16, and n = 24).
CLASS A
• In Class A NetID = 8 bits and HostID = 24.
• How to identify class A address
• First bit is reserved to 0 in binary notation
• Range of 1st octet is [0, 127] in dotted decimal notation
• Total number of connections in class A is 231 (2,14,74,83,648)

• There are 27 -2 = 126 networks in Class A network.


• In Class A, total network available are 2 less, because:
• IP Address 0.0.0.0 is reserved for broadcasting requirements
• IP Address 127.0.0.1 is reserved for loopback address / self-connectivity.
• The range of 1st octet is [0, 127] but since two addresses are reserved it is: [1, 126].
• There are 224 – 2 (1,67,77,214) HostID in Class A.

• In all the classes, total number of hosts that can be configured are 2 less because:
• This is to account for the two reserved IP addresses in which all the bits for host ID are
either zero or one.
• When all Host ID bits are 0, it represents the Network ID for the network.
• When all Host ID bits are 1, it represents the Broadcast Address.

• Class A is used by organizations requiring very large size networks like Indian Railways.
CLASS B
• In Class B NetID = 16 bits and HostID = 16.
• How to identify class B address
• First two bits are reserved to 10 in binary notation
• Range of 1st octet is [128, 191] in dotted decimal notation
• Total number of connections in class B is 230 (1,07,37,41,824)
• Total number of networks available in class B is 214 (16,384)
• Total number of hosts that can be configured in every network in class B is 216 –
2 (65,534)
• Class B is used by organizations requiring medium size networks
• Total number of connections in class B is 230 (1,07,37,41,824)
• Total number of networks available in class B is 214 (16,384)
• Total number of hosts that can be configured in every network in class B is 216 –
2 (65,534)
• Class B is used by organizations requiring medium size networks
Class C
• In Class C NetID = 24 bits and HostID = 8.
• How to identify class C address
• First three bits are reserved to 110 in binary notation
• Range of 1st octet is [192, 223] in dotted decimal notation
• Total number of connections in class C is 229 (53,68,70,912)
• Total number of networks available in class C is 221 (20,97,152)
• Total number of hosts that can be configured in every network in class C is 28 – 2
(254)
• Class C is used by organizations requiring small to medium size networks.
CLASS D
• Class D is not divided into Network ID and Host ID.
• How to identify class D address
• First four bits are reserved to 1110 in binary notation
• Range of 1st octet is [224, 239] in dotted decimal notation
• Total number of IP Addresses available in class D = 228 (26,84,35,456)
• Class D is reserved for multicasting, in multicasting, there is no need to
extract host address from the IP Address, this is because data is not
destined for a particular host.
CLASS E
• Class E is not divided into Network ID and Host ID.
• How to identify class E address
• First four bits are reserved to 1111 in binary notation
• Range of 1st octet is [240, 255] in dotted decimal notation
• Total number of IP Addresses available in class E = 228
(26,84,35,456)
• Class E is reserved for future or experimental
purposes.
POINTS TO NOTE
• All the hosts in a single network always have the same network ID but different Host ID.

• Two hosts in two different networks can have the same host ID.

• Only those devices which have the network layer will have IP Address, switches, hubs and
repeaters does not have any IP Address.
CASTING IN NETWORKS
Types of Casting
• Casting in a network is basically of three type: Unicast, Multicast and Broadcast.
• Broadcast: Transmitting data from one source host to all other hosts
residing in a network either same or other network is called as broadcast. It
is a one to all transmission.

• Limited Broadcast:
• Direct Broadcast:

Unicast: Transmitting data from one source host to one
destination host is called as unicast. It is a one to one transmission.
• Limited Broadcast: Transmitting data from one source host to all other hosts
residing in the same network is called as limited broadcast. Limited Broadcast
Address for any network is All 32 bits set to 1 =
11111111.11111111.11111111.11111111 = 255.255.255.255
• Direct Broadcast: Transmitting data from one source host to all other hosts
residing in some other network is called as direct broadcast.
• Direct Broadcast Address for any network is the IP Address where, Network ID
is the IP Address of the network where all the destination hosts are present
and Host ID bits are all set to 1.
• Multicast: Transmitting data from one source host to a particular group of
hosts having interest in receiving the data is called as multicast. It is a one
to many transmissions.
REASON FOR SUBNETTING
o Maintenance of a very big network like class A and class B is very difficult for
network administrator.
REASON FOR SUBNETTING
o Having all the computer from different departments in a company on the same
networks is less secure from company prospective.
REASON FOR SUBNETTING
o So, if an organization was granted a large block in class A or B, it could divide the addresses
into several contiguous groups and assign each group to smaller networks (called subnets) or,
in rare cases, share part of the addresses with neighbours.
 Conclusion: An organization (or an ISP) that is granted a range of addresses may divide the
range into several subranges and assign each subrange to a subnetwork (or subnet). A
subnetwork can be divided into several sub-subnetworks. A sub-subnetwork can be divided
into several sub-sub-subnetworks, and so on.
Advantages
 It improves the security.
 The maintenance and administration of subnets is easy.

Disadvantages
 Identification of a station is difficult
 Not possible to directed broadcast from outside network.
TYPES OF SUBNETTING
Subnets can be of two types:
1.Fixed Length Subnetting
2.Variable Length Subnetting
Fixed Length Subnetting
 Fixed length subnetting (classful subnetting) divides the network into
subnets such that:
• All the subnets are of same size.
• All the subnets have equal number of hosts.
• All the subnets have same subnet mask.
Q CONSIDER THE NETWORK HAVING IP ADDRESS 200.1.2.0. DIVIDE THIS NETWORK INTO
TWO SUBNETS.
Q Consider the network having IP Address 200.1.2.0. Divide this network into two subnets.
1ST SUBNET 2nd Subnet
 IP Address of the subnet / Subnet id = 200.1.2.0  IP Address of the subnet / Subnet id = 200.1.2.128
 Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127  Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255
 Total number of IP Addresses = 27 = 128  Total number of IP Addresses = 27 = 128
 Range of IP Addresses = [200.1.2.0, 200.1.2.127]  Range of IP Addresses = [200.1.2.128, 200.1.2.255]
 Total number of hosts that can be configured = 128 – 2 = 126  Total number of hosts that can be configured = 128 – 2 =
 Range of Allocated IP Addresses = [200.1.2.1, 200.1.2.126] 126
 Range of Allocated IP Addresses = [200.1.2.129,
200.1.2.254]
Q CONSIDER WE HAVE A BIG SINGLE NETWORK HAVING IP ADDRESS 200.1.2.0. WE
WANT TO DO SUBNETTING AND DIVIDE THIS NETWORK INTO 4 SUBNETS.
Q CONSIDER WE HAVE A BIG SINGLE NETWORK HAVING IP ADDRESS 200.1.2.0. WE WANT TO DO
and divide this network into 4 subnets. SUBNETTING
2nd Subnet
1st Subnet
 IP Address of the subnet / Subnet id = 200.1.2.64
 IP Address of the subnet / Subnet id = 200.1.2.0
 Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127
 Direct Broadcast Address = 200.1.2.00111111 = 200.1.2.63
 Total number of IP Addresses = 26 = 64
 Total number of IP Addresses = 2 = 64
6

 Range of IP Addresses = [200.1.2.64, 200.1.2.127]


 Range of IP Addresses = [200.1.2.0, 200.1.2.63]
 Total number of hosts that can be configured = 64 – 2 = 62
 Total number of hosts that can be configured = 64 – 2 = 62
 Range of Allocated IP Addresses = [200.1.2.65, 200.1.2.126]
 Range of Allocated IP Addresses = [200.1.2.1, 200.1.2.62]

3rd Subnet 4th Subnet


 IP Address of the subnet / Subnet id = 200.1.2.128  IP Address of the subnet / Subnet id = 200.1.2.192
 Direct Broadcast Address = 200.1.2.10111111 = 200.1.2.191  Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255
 Total number of IP Addresses = 26 = 64  Total number of IP Addresses = 26 = 64
 Range of IP Addresses = [200.1.2.128, 200.1.2.191]  Range of IP Addresses = [200.1.2.192, 200.1.2.255]
 Total number of hosts that can be configured = 64 – 2 = 62  Total number of hosts that can be configured = 64 – 2 = 62
 Range of Allocated IP Addresses = [200.1.2.129, 200.1.2.190]  Range of Allocated IP Addresses = [200.1.2.193, 200.1.2.254]
VARIABLE LENGTH SUBNETTING
 Variable length subnetting (classless subnetting) the network
divides subnets such that: into

• All the subnets are not of same size.


• All the subnets do not have equal number of hosts.
• All the subnets do not have same subnet mask.
Q Consider we have a big single network having IP Address 200.1.2.0. We want to do subnetting and divide this
network into 3 subnets, such that first contains 126 hosts, and other two contains 62 hosts each?
Q CONSIDER WE HAVE A BIG SINGLE NETWORK HAVING IP ADDRESS 200.1.2.0. WE WANT TO DO SUBNETTING
AND DIVIDE THIS
NETWORK INTO 3 SUBNETS, SUCH THAT FIRST CONTAINS 126 HOSTS, AND OTHER TWO CONTAINS 62 HOSTS EACH?
2nd Subnet
 IP Address of the subnet / Subnet id = 200.1.2.128
 Direct Broadcast Address = 200.1.2.101111111 = 200.1.2.191
 Total number of IP Addresses = 26 = 64
1st Subnet 
 Range of IP Addresses = [200.1.2.128, 200.1.2.191]
IP Address of the subnet / Subnet id = 200.1.2.0
 Total number of hosts that can be configured = 64 – 2 = 62
 Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127
 Range of Allocated IP Addresses = [200.1.2.129, 200.1.2.190]
 Total number of IP Addresses = 27 = 128
 Range of IP Addresses = [200.1.2.0, 200.1.2.127]
 Total number of hosts that can be configured = 128 – 2 = 126 3rd Subnet
 IP Address of the subnet / Subnet id = 200.1.2.192
 Range of Allocated IP Addresses = [200.1.2.1, 200.1.2.126]
 Direct Broadcast Address = 200.1.2.111111111 = 200.1.2.255
 Total number of IP Addresses = 26 = 64
 Range of IP Addresses = [200.1.2.192, 200.1.2.255]
 Total number of hosts that can be configured = 64 – 2 = 62
 Range of Allocated IP Addresses = [200.1.2.193, 200.1.2.254]
Q CONSIDER WE HAVE A BIG SINGLE NETWORK HAVING IP ADDRESS 200.1.2.0. WE WANT TO DO SUBNETTING
AND DIVIDE THIS
NETWORK INTO 3 SUBNETS, SUCH THAT FIRST CONTAINS 126 HOSTS, AND OTHER TWO CONTAINS 62 HOSTS EACH?
1st Subnet
 IP Address of the subnet / Subnet id = 200.1.2.0
 Direct Broadcast Address = 200.1.2.00111111 = 200.1.2.63
 Total number of IP Addresses = 26 = 64
 Range of IP Addresses = [200.1.2.0, 200.1.2.63]
3rd Subnet
 Total number of hosts that can be configured = 64 – 2 = 62  IP Address of the subnet / Subnet id = 200.1.2.128
 Range of Allocated IP Addresses = [200.1.2.1, 200.1.2.62]  Direct Broadcast Address = 200.1.2.111111111 = 200.1.2.255
 Total number of IP Addresses = 27 = 128
 Range of IP Addresses = [200.1.2.128, 200.1.2.255]
2nd Subnet
 IP Address of the subnet / Subnet id = 200.1.2.64  Total number of hosts that can be configured = 128 – 2 = 126
 Direct Broadcast Address = 200.1.2.011111111 = 200.1.2.127  Range of Allocated IP Addresses = [200.1.2.129, 200.1.2.254]
 Total number of IP Addresses = 26 = 64
 Range of IP Addresses = [200.1.2.64, 200.1.2.127]
 Total number of hosts that can be configured = 64 – 2 = 62
 Range of Allocated IP Addresses = [200.1.2.65, 200.1.2.126]
POINT TO NOTE:
 Subnetting increases the number of 1’s in the mask
SUBNET MASKS
 In case of subnetting the problem is how to identify to which subnet the incoming packet from outside the
network must be delivered. To solve this problem, we use the idea of subnet mask.

 Subnet mask is a 32-bit number which is a sequence of 1’s followed by a sequence of 0’s where:
o 1’s represents the Network ID part along with the subnet ID.
o 0’s represents the host ID part.

 Default mask for different classes of IP Address are:


o Default subnet mask of Class A = 255.0.0.0
o Default subnet mask for Class B = 255.255.0.0
o Default subnet mask for Class C = 255.255.255.0

o Networks of same size always have the same subnet mask.


ADDRESS DEPLETION
• The addresses were not distributed properly as class A and B are usually very large for any organization
and class C is usually very small

• Flexibility is not there is classful addressing, we cannot have the exact allocation as we want for e.g. if
some company wants 150 IP address then must go for 256, resulting into address depletion.

• Wastage of addresses, for example: Class E addresses were almost never used, wasting the whole
class.

• Conclusion: The Internet was faced with the problem of the addresses being rapidly used up, resulting
in no more addresses available for organizations and individuals that needed to be connected to the
Internet.
CLASSLESS ADDRESSING (BLOCKS/NETWORK)
• Classless Addressing is an improved IP Addressing system.
• The class privilege is removed from the distribution to compensate for the address depletion,
so no class.
• Here we can ask exact set of IP address which are required and a Variable-length blocks are
assigned which satisfy the request.
CIDR NOTATION
• The question is as there are no classes, how to identify block id and host id, as address in classless
addressing does not define the block or network to which the address belongs.
• To solve this problem now we have a new CIDR notation, this notation is informally referred to as
slash notation and formally as classless interdomain routing or CIDR.
• To find the prefix(net_id), n is added to the address, separated by a slash.
• n represent number of bits in net_id
EXTRACTING INFORMATION FROM AN ADDRESS
 The number of addresses in the block is found as N = 232−n.
 Tofind the first address, we keep the n leftmost bits and set the (32 −
n) rightmost bits all to 0s.
 Tofind the last address, we keep the n leftmost bits and set the (32 −
n) rightmost bits all to 1s.
Q FIND THE NUMBER OF ADDRESSES, FIRST AND LAST ADDRESS OF THE
CIDR BLOCK TO WHICH FOLLOWING ADDRESS BELONGS TO
167.199.170.82/27 (10100111 11000111 10101010 01010010)
167.199.170.82/27 (10100111 11000111 10101010 01010010)

10100111 11000111 10101010 010_ _ _ _ _

No of Address = 2 5
167.199.170.82/27 (10100111 11000111 10101010 01010010)

64
10100111 11000111 10101010 0100 0 0 0 0
10100111 11000111 10101010 0101 1 1 1 1
95
ADDRESS MASK
 The address mask is a 32-bit number in which the n leftmost bits are set to 1s
and the rest of the bits (32 − n) are set to 0s.
 It is another way to find the first and last addresses in the block.
 Using the three bit-wise operations NOT, AND, and OR a computer can find:
1. The number of addresses in the block N = NOT (mask) + 1.
2. The first address in the block = (Any address in the block) AND (mask).
3. The last address in the block = (Any address in the block) OR [(NOT (mask)].
RULES FOR CREATING CIDR BLOCK (NETWORK)
 All the IP Addresses in the CIDR block must be contiguous.
 The size of the block (total number of IP Addresses contained in the block) must
be presentable as power of 2, size of any CIDR block will always be in the
form 21, 22, 23, 24, 25 and so on. (calculation can be easy)
 First IP Address of the block must be divisible by the size of the block. (so that
we get the host id from all 0 to all 1)
SUBNETTING IN CIDR

Q Consider the network having IP Address 40.30.20.10/25 Divide this


network into two subnets.
Q Consider the network having IP Address 40.30.20.10/25 Divide this network into two subnets.
1ST SUBNET 40.30.20.00001010 2st Subnet
 40.30.20.00001010  40.30.20.01001010
 Total number of IP Addresses = 26 = 64  Total number of IP Addresses = 26 = 64
 First Address of the Subnet = 40.30.20.00000000  First Address of the Subnet = 40.30.20.01000000
 Last Address of the Subnet = 40.30.20.00111111  Last Address of the Subnet = 40.30.20.01111111
 Range of IP Addresses = [40.30.20.0, 40.30.20.63]  Range of IP Addresses = [40.30.20.64, 40.30.20.127]
 Total number of hosts that can be configured = 64 – 2 = 62  Total number of hosts that can be configured = 64 – 2 = 62
 Range of Allocated IP Addresses = [40.30.20.1, 40.30.20.62]  Range of Allocated IP Addresses = [40.30.20.65, 40.30.20.126]
 CIRD Representation 40.30.20. /26  CIRD Representation 40.30.20. /26

0,1,2,3,4,5, ,63 64,65,66,67, ,127


Q CONSIDER WE HAVE A BIG SINGLE NETWORK HAVING IP ADDRESS
200.1.2.0/24 WE WANT TO DO SUBNETTING AND DIVIDE THIS NETWORK
INTO 4 SUBNETS.
Q CONSIDER WE HAVE A BIG SINGLE NETWORK HAVING IP ADDRESS 200.1.2.0/24. WE
WANT TO DO SUBNETTING AND DIVIDE THIS NETWORK INTO 4 SUBNETS.
2nd Subnet
1st Subnet
 IP Address of the subnet / Subnet id = 200.1.2.64
 IP Address of the subnet / Subnet id = 200.1.2.0
 Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127
 Direct Broadcast Address = 200.1.2.00111111 = 200.1.2.63
 Total number of IP Addresses = 26 = 64
 Total number of IP Addresses = 2 = 64
6

 Range of IP Addresses = [200.1.2.64, 200.1.2.127]


 Range of IP Addresses = [200.1.2.0, 200.1.2.63]
 Total number of hosts that can be configured = 64 – 2 = 62
 Total number of hosts that can be configured = 64 – 2 = 62
 Range of Allocated IP Addresses = [200.1.2.65, 200.1.2.126]
 Range of Allocated IP Addresses = [200.1.2.1, 200.1.2.62]

3rd Subnet 4th Subnet


 IP Address of the subnet / Subnet id = 200.1.2.128  IP Address of the subnet / Subnet id = 200.1.2.192
 Direct Broadcast Address = 200.1.2.10111111 = 200.1.2.191  Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255
 Total number of IP Addresses = 26 = 64  Total number of IP Addresses = 26 = 64
 Range of IP Addresses = [200.1.2.128, 200.1.2.191]  Range of IP Addresses = [200.1.2.192, 200.1.2.255]
 Total number of hosts that can be configured = 64 – 2 = 62  Total number of hosts that can be configured = 64 – 2 = 62
 Range of Allocated IP Addresses = [200.1.2.129, 200.1.2.190]  Range of Allocated IP Addresses = [200.1.2.193, 200.1.2.254]
Q Consider we have a big single network having IP Address 200.1.2.0/24. We want to do subnetting and divide this
network into 3 subnets, such that first contains 126 hosts, and other two contains 62 hosts each?
Q CONSIDER WE HAVE A BIG SINGLE NETWORK HAVING IP ADDRESS 200.1.2.0/24. WE WANT TO DO SUBNETTING
AND DIVIDE THIS
NETWORK INTO 3 SUBNETS, SUCH THAT FIRST CONTAINS 126 HOSTS, AND OTHER TWO CONTAINS 62 HOSTS EACH?
2nd Subnet
 IP Address of the subnet / Subnet id = 200.1.2.128
 Direct Broadcast Address = 200.1.2.101111111 = 200.1.2.191
1st Subnet  Total number of IP Addresses = 26 = 64
 IP Address of the subnet / Subnet id = 200.1.2.0  Range of IP Addresses = [200.1.2.128, 200.1.2.191]
 Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127  Total number of hosts that can be configured = 64 – 2 = 62
 Total number of IP Addresses = 27 = 128  Range of Allocated IP Addresses = [200.1.2.129, 200.1.2.190]
 Range of IP Addresses = [200.1.2.0, 200.1.2.127]
 Total number of hosts that can be configured = 128 – 2 = 126
3rd Subnet
 Range of Allocated IP Addresses = [200.1.2.1, 200.1.2.126]  IP Address of the subnet / Subnet id = 200.1.2.192
 Direct Broadcast Address = 200.1.2.111111111 = 200.1.2.255
 Total number of IP Addresses = 26 = 64
 Range of IP Addresses = [200.1.2.192, 200.1.2.255]
 Total number of hosts that can be configured = 64 – 2 = 62
 Range of Allocated IP Addresses = [200.1.2.193, 200.1.2.254]
Q CONSIDER WE HAVE A BIG SINGLE NETWORK HAVING IP ADDRESS 200.1.2.0/24. WE WANT TO DO SUBNETTING
AND DIVIDE THIS
NETWORK INTO 3 SUBNETS, SUCH THAT FIRST CONTAINS 126 HOSTS, AND OTHER TWO CONTAINS 62 HOSTS EACH?
1st Subnet
 IP Address of the subnet / Subnet id = 200.1.2.0
 Direct Broadcast Address = 200.1.2.00111111 = 200.1.2.63
 Total number of IP Addresses = 26 = 64
 Range of IP Addresses = [200.1.2.0, 200.1.2.63]
3rd Subnet
 Total number of hosts that can be configured = 64 – 2 = 62  IP Address of the subnet / Subnet id = 200.1.2.128
 Range of Allocated IP Addresses = [200.1.2.1, 200.1.2.62]  Direct Broadcast Address = 200.1.2.111111111 = 200.1.2.255
 Total number of IP Addresses = 27 = 128
 Range of IP Addresses = [200.1.2.128, 200.1.2.255]
2nd Subnet
 IP Address of the subnet / Subnet id = 200.1.2.64  Total number of hosts that can be configured = 128 – 2 = 126
 Direct Broadcast Address = 200.1.2.011111111 = 200.1.2.127  Range of Allocated IP Addresses = [200.1.2.129, 200.1.2.254]
 Total number of IP Addresses = 26 = 64
 Range of IP Addresses = [200.1.2.64, 200.1.2.127]
 Total number of hosts that can be configured = 64 – 2 = 62
 Range of Allocated IP Addresses = [200.1.2.65, 200.1.2.126]
DESIGNING SUBNETS FOR CIDR NOTATIONS
• Assume:
• The total number of addresses granted to the organization is N
• The prefix length is n
• The assigned number of addresses to each sub-network is Nsub
• The prefix length for each sub-network is nsub.
• Then, The number of addresses in each sub-network should be a power of 2.

• The prefix length for each sub-network should be found using the following formula: nsub = 32
- log2Nsub

• The starting address in each sub-network should be divisible by the number of addresses in
that sub-network. This can be achieved if we first assign addresses to larger sub-networks.
SUPER NETTING IN CLASSFUL ADDRESSING
• In super netting, an organization can combine several blocks to create a larger range of addresses. In
other words, several networks are combined to create a super network or a supernet.

• An organization can apply for a set of class C blocks instead of just one. For example, an organization
that needs 1000 addresses can be granted four contiguous class C blocks. The organization can then
use these addresses to create one super network.

• Super netting decreases the number of 1’s in the mask.


SUPER NETTING / AGGREGATION WITH CIDR
• Rules for Super netting in CIDR
• All network should be contiguous
• first net id should be divisible by size of the block
Q PERFORM CIDR AGGREGATION ON THE FOLLOWING IP ADDRESSES-

128.56.25.0/24
128.56.26.0/24
128.56.27.0/24
128.56.24.0/24

• Rules for Super netting in CIDR


• All network should be contiguous
• first net id should be divisible by size of the block

You might also like