0% found this document useful (0 votes)
10 views17 pages

Unit 3 Computer CN Hand Written Notes

The document explains various network communication protocols, focusing on Binary Exponential Back-off (BEB), Carrier Sense Multiple Access (CSMA), and Slotted ALOHA. BEB is a collision resolution algorithm that reduces retransmission collisions by introducing random wait times after each collision, while CSMA allows devices to sense the channel before transmitting to minimize collisions. The document also discusses the IEEE 802 standards for managing local area networks, emphasizing the importance of interoperability and efficient communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views17 pages

Unit 3 Computer CN Hand Written Notes

The document explains various network communication protocols, focusing on Binary Exponential Back-off (BEB), Carrier Sense Multiple Access (CSMA), and Slotted ALOHA. BEB is a collision resolution algorithm that reduces retransmission collisions by introducing random wait times after each collision, while CSMA allows devices to sense the channel before transmitting to minimize collisions. The document also discusses the IEEE 802 standards for managing local area networks, emphasizing the importance of interoperability and efficient communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Unit : 3

Ques: Explain the Binary Exponential Back-off (BEB) with suitable example ? [Dec2024]
Ans: Binary Exponential Back-off is a collision resolution algorithm used in network communication protocols like Ethernet
(CSMA/CD) and Wi-Fi (CSMA/CA). It controls how devices retry transmitting data after a collision happens on a shared
communication medium.
Why is BEB needed?
In networks where multiple devices share the same communication channel, two or more devices might try to send data
simultaneously, causing a collision. When this happens, the data is corrupted and must be resent. If all devices try to resend
immediately, collisions will keep occurring, creating network congestion.
BEB helps by making devices wait for a random amount of time before trying to resend, reducing the chances that they
collide again.
How does Binary Exponential Back-off work?
1. Collision Detection: When a device detects that its data transmission collided with another device's transmission, it
stops sending data.
2. Wait Time Calculation: The device waits for a random number of time slots before trying to retransmit. This
random waiting time is chosen from a range of numbers between 0 and (2^k - 1), where k is the number of
collisions the device has experienced for that frame.
3. Exponential Increase: After each collision, the range doubles, exponentially increasing the waiting time window.
This exponential growth helps spread out retransmission attempts over time to avoid repeated collisions.
4. Maximum Limit: The value of k is limited to a maximum number (usually 10 or 16). After that, the back-off range
does not increase further, and if collisions continue, the transmission is dropped.
Example:
 First collision (k = 1):
The device picks a random wait time from 0 to 1 time slot (2^1 - 1 = 1).
It might wait for 0 or 1 slot before retrying.
 Second collision (k = 2):
The device picks a random wait time from 0 to 3 time slots (2^2 - 1 = 3).
It might wait for 0, 1, 2, or 3 slots before retrying.
 Third collision (k = 3):
The device picks a random wait time from 0 to 7 time slots (2^3 - 1 = 7).
It might wait for any number from 0 to 7 slots.
This process repeats until the device successfully sends the data or reaches the maximum retry limit.
Why is BEB effective?
 Reduces Collisions: By spreading out retransmission times, devices avoid trying to send simultaneously.
 Adapts to Network Load: When collisions are rare, back-off times are short, allowing faster retransmission. When
collisions increase, back-off times grow exponentially to reduce network congestion.
 Simple to Implement: The algorithm only needs a random number generator and counters.

Ques: Explain in briefly about the Persistent and Non- Persistent CSMA Protocol ? [Dec2024]
Ans: Carrier Sense Multiple Access (CSMA) is a method used in networks where many devices share the same
communication channel. Before sending data, a device listens to the channel to check if someone else is already
transmitting. If the channel is busy, it waits until it becomes free.
This “listen before talk” approach helps reduce collisions (when two devices send data at the same time), which was a big
problem in older systems like ALOHA. However, collisions can still happen because of delays in sensing the channel,
especially in large networks. When collisions occur, the devices stop transmitting and try again after waiting for a random
time. This way, CSMA improves overall network performance and efficiency.
TYPE OF CASMA Access model
(i) 1-Persistent CSMA (Carrier Sense Multiple Access)
the station follows a strict rule to send data as soon as the channel is found to be free. The steps are:
1. The station continuously senses the channel to check if it is idle or busy.
2. If the channel is busy, it keeps waiting and sensing until it becomes idle.
3. As soon as the channel is idle, it immediately transmits the data with probability 1 (100%).
Why it's called "1-Persistent":
 The term "1-Persistent" means the station has a 100% chance of transmitting as soon as the channel becomes free.
Example:
 Suppose two stations (A and B) both want to send data.
 Both are sensing the channel.
 As soon as the channel becomes free, both stations transmit immediately.
 This causes a collision.
Drawbacks of 1-Persistent CSMA:
1.High Collision Chance: Multiple stations may transmit at the same time when the channel becomes idle.
2. Propagation Delay Issue: A station may not detect an ongoing transmission due to signal delay, causing collisions.
3. Wasted Bandwidth: Collisions lead to data loss and require retransmission, reducing overall efficiency.
4. Unfair Waiting: Stations that just missed the idle channel may have to wait longer, leading to unfair access.

(ii) Non-persistent CSMA


 In this method, when a station wants to send data, it first checks if the channel is busy (i.e., another station is
transmitting).
 If the channel is busy, the station will not keep sensing it continuously.
 Instead, it waits for a random period of time before checking the channel again.
 After waiting, it again senses the channel to check if it is free.
 If the channel is free, the station transmits the data immediately.
 If it is still busy, the station repeats the process: wait randomly, then check again.
 This method reduces the chances of collision because it avoids multiple stations trying to transmit at the same
time.
 However, it can cause a bit more delay, because the station waits instead of capturing the channel immediately
when it becomes free.
 In simple terms, non-persistent CSMA is polite—it waits and tries again later, instead of constantly watching the
channel.
Advantage of non-persistent
1. It reduces the chance of collision because stations don’t all try to send at once.
2. Each station waits a random time, so it’s rare that two pick the same time to send.
Disadvantage of Non-Persistent CSMA:
1. It can reduce network efficiency because the channel stays idle even when stations are ready to send.
2. This happens because stations are waiting randomly, instead of using the channel right away.

Fig 3.6 Non-persistent CSMA


(iii) p-persistent CSMA
1. This method is used when the channel has time slots, each as long as the maximum propagation delay.
2. When a station wants to send data, it senses the channel first.
3. If the channel is busy, the station waits for the next time slot.
4. If the channel is idle, it transmits with a probability p (like 50%, 75%, etc.).
5. With probability q = 1 - p, it waits for the next slot instead of sending.
6. In the next slot, if the channel is still idle, it again tries with probability p.
7. This process continues until the station transmits or another station starts transmitting.
8. If another station transmits first, it acts like a collision happened and the station waits randomly before trying
again.
Advantage of p-Persistent CSMA:
1. It reduces the chances of collision because not all stations send at once.
2. It improves network efficiency by balancing delay and transmission attempts.

Ques: Explain the working principle of Slotted ALOHA with suitable sketch ? [May 2023]
Ans: Slotted ALOHA is a random access protocol in which the time is divided into discrete slots, and stations are allowed to
transmit data only at the beginning of these time slots to reduce collisions and improve channel efficiency.
Slotted ALOHA – Working Principle
1. In Slotted ALOHA, time is divided into equal time slots.
2. A station is only allowed to send data at the beginning of a time slot.
3. These time slots are exactly equal to the time needed to send one packet.
4. All users are synchronized to these time slots. This means everyone waits for the next slot to start before
transmitting.
5. This system reduces collision time to just one packet time.
6. When a user wants to send a frame, it waits for the next time slot and then transmits.
7. If the receiver gets the frame successfully, it sends back an acknowledgment.
8. If the sender does not receive acknowledgment, it assumes a collision occurred and retries in another time slot.
9. Slotted ALOHA increases channel efficiency compared to pure ALOHA because fewer collisions happen.
10. However, users may experience more delay because they must wait for the next time slot before transmitting.
Ques: What is Limited contention Protocols? Explain the working principle of Adaptive Tree Walk Protocol with suitable
Example? [May 2023]
Ans: Limited Contention Protocols: Adaptive Tree Walk
Limited Contention Protocols are hybrid protocols that combine the advantages of both contention-based and contention-
free protocols.
 At low traffic load, they use contention-based methods to keep delay low.
 At high traffic load, they switch to a contention-free approach to maintain high channel efficiency.
These protocols work by reducing the number of stations competing at any given time (limiting contention).
They divide stations into groups, and only one group competes for the channel at a time (contention happens within a
limited set of stations).
If a station in the group successfully acquires the channel, it transmits; if not (collision or no station wants to send), the next
group gets a chance.
This division into groups reduces competition, increasing the chance of successful transmissions and improving overall
network performance.

Working Principle Adaptive Tree Walk Protocol


 At the start, all nodes try to send their data at once.
 If only one node sends, it successfully acquires the channel and transmits its frame.
 If multiple nodes send at the same time, a collision occurs.
 When a collision happens, the nodes are divided into two equal groups.
 Only the first group competes for the channel in the next time slot.
 If a node in the first group successfully transmits, the next time slot is reserved for the other group.
 If there is another collision within a group, that group is divided again into two smaller groups, and the same
process repeats.
 This splitting and competing process continues like walking down a binary tree until all nodes have sent their
frames without collision.

Many improvements could be made to the algorithm.


For example, consider the case of nodes G and H being the only ones wanting to transmit. At slot 1 a collision will be
detected and so 2 will be tried and it will be found to be idle. Hence it is pointless to probe 3 and one should directly go to
6,7.
Ques: What the function of MAC Layer? Explain following protocols of MAC Layer
i. Pure and slotted ALOHA
ii. CSMA

Ans: Function of the MAC Layer


The MAC (Media Access Control) layer is a sublayer of the Data Link Layer (Layer 2) in the OSI model. Its main job is to
control how devices on a shared network medium access and transmit data.
Key functions of the MAC layer:
1. Channel Access Control: It decides when a device can use the communication channel to send data, preventing
collisions and managing multiple devices trying to send at the same time.
2. Frame Delimiting and Addressing: It adds a MAC address to each data frame, which uniquely identifies the sender
and receiver devices on the local network.
3. Error Detection: The MAC layer adds error-checking information (like a CRC) to frames so the receiving device can
detect if the data was corrupted during transmission.
4. Frame Formatting: It organizes data into frames with proper headers and trailers for transmission.

Pure and slotted ALOHA


(i).Pure ALOHA
 In Pure ALOHA, devices send their data whenever they have something to send. They do not check if the channel is
free or busy before sending.
 If two or more devices send data at the same time, their data collides and gets destroyed.
 Whenever a device sends data, it waits for a confirmation message called an acknowledgment from the receiver.
 If the device does not get this acknowledgment within a certain time, it assumes that the data or the
acknowledgment was lost or destroyed.
 If the data was lost because of a collision, the device waits for a random amount of time before sending the data
again.
 This waiting time must be random, or else the same data will collide again and again.
 So, Pure ALOHA says that after the waiting time, every device should wait for a random time before trying to send
again.
This random waiting time helps reduce the chance of more collisions happening.

(ii) Slotted ALOHA


 Slotted ALOHA was created to make Pure ALOHA better because Pure ALOHA has a lot of collisions.
 In Slotted ALOHA, the shared channel’s time is divided into equal parts called time slots.
 Stations can only send their data frames at the start of each time slot. Only one frame can be sent during a slot.
 If a station misses the start of a time slot, it must wait for the next time slot to send its frame.
 Collisions can still happen if two stations send data at the start of the same slot.
 But Slotted ALOHA reduces collisions to about half compared to Pure ALOHA, making it more efficient.
(2) CASMA
Carrier Sense Multiple Access (CSMA) is a way for devices on a network to share the communication channel.
Before a device sends data, it listens to check if the channel is free. If it is busy, the device waits. This helps
reduce chances of two devices sending data at the same time (called a collision), making communication
smoother. CSMA is used in networks like Ethernet and Wi-Fi.
Vulnerable Time is a small time period when two devices might still try to send data at the same time even after
checking the channel is free. This can cause collisions.

Types of CSMA:
1. CSMA/CD (Collision Detection)
After sending data, the device checks if a collision happened. If yes, it stops, waits a random time, and
tries again.
2. CSMA/CA (Collision Avoidance)
Used mainly in wireless networks where it’s hard to detect collisions. Devices try to avoid collisions by
waiting for random times and sending acknowledgments when data is received successfully.

How CSMA/CD works:


 If a device wants to send data, it first listens to the channel.
 If the channel is free, it sends data.
 If two devices send data at the same time, a collision happens.
 Devices detect the collision, stop sending, send a jam signal to inform others, wait randomly, and try
again.

CSMA Access Modes:


 1-Persistent: Keep checking the channel and send immediately when free.
 Non-Persistent: Check the channel; if busy, wait random time before checking again.
 P-Persistent: Send data with a probability when channel is free.
 O-Persistent: Devices send data in an assigned order or time slot.

Advantages of CSMA:
 Efficient use of the network.
 Simple and easy to implement.
 Works on wired and wireless networks.
 Low cost.
Disadvantages of CSMA:
 Not good for very large networks.
 Can cause delays when the network is busy.
 May have unreliable communication due to interference.
 Vulnerable to attacks like jamming.

Ques Short note:


a) IEEE Standards 802 series
b) CASMA/CD
c) CASMA/CA

# IEEE Standards 802 series


The IEEE 802 series is a family of standards developed by the Institute of Electrical and Electronics Engineers (IEEE) for
creating and managing local area networks (LANs) and metropolitan area networks (MANs). These standards define the
rules for physical connections, data transmission, and network access control among multiple devices within a network.
The IEEE 802 standards mainly cover the first two layers of the OSI model:
 Layer 1 – Physical Layer: Deals with electrical signals, cables, connectors, and transmission techniques.
 Layer 2 – Data Link Layer: Divided into MAC (Media Access Control) and LLC (Logical Link Control) sublayers. It
handles how devices identify each other and share the communication medium without conflict.
The purpose of these standards is to ensure interoperability, compatibility, and standard communication protocols
between network devices from different manufacturers. They make networking cost-effective, reliable, and scalable.

📘 Major IEEE 802 Standards (Short Summary)


Standard Used For Brief Info
802.1 Network Management VLANs, Spanning Tree Protocol.
802.2 Logical Link Control Common LLC for all 802 networks.
802.3 Ethernet Wired LAN using CSMA/CD.
802.4 Token Bus Obsolete – used in industrial networks.
802.5 Token Ring Obsolete – ring-based LAN.
802.11 Wireless LAN (Wi-Fi) Most popular WLAN standard.
802.15 WPAN (Bluetooth) Short-range wireless – Bluetooth, Zigbee.
802.16 WiMAX Long-distance broadband wireless.
802.21 Media Handoff Seamless handover across Wi-Fi, cellular.
802.22 WRAN Internet in rural areas via TV white space.

📶 IEEE 802.11 Variants (Wi-Fi Versions) – In Short


Variant Wi-Fi Version Speed
802.11a/b/g Wi-Fi 1–3 11–54 Mbps
802.11n Wi-Fi 4 Up to 600 Mbps
802.11ac Wi-Fi 5 Up to 1.3 Gbps
802.11ax Wi-Fi 6 Up to 10 Gbps
802.11be Wi-Fi 7 >30 Gbps

✅ Advantages of IEEE 802 Standards (In Points)


1. Interoperability – Devices from different brands work together smoothly.
2. Standardization – Ensures uniform rules and structure for networking.
3. Reliability – Provides stable and proven network communication.
4. Scalability – Easy to expand the network by adding more devices.
5. Security – Supports secure protocols like 802.1X and 802.11i.
6. Wired + Wireless Support – Covers both Ethernet and Wi-Fi technologies.
7. Flexibility – Supports many technologies like Bluetooth, WiMAX, VLANs.

❌ Disadvantages of IEEE 802 Standards (In Points)


1. Complexity – Some standards are difficult to implement and manage.
2. High Upgrade Cost – Newer standards may require costly new hardware.
3. Obsolete Standards – Some like 802.4 and 802.5 are outdated.
4. Limited Wireless Range – Wi-Fi range can be short and signal may weaken.
5. Security Risks – Improper configuration may lead to vulnerabilities.
6. Compatibility Issues – Newer versions may not support older devices fully.
❌ Limitations of IEEE 802 Standards (In Points)
1. Limited Wireless Range – Wi-Fi signals (802.11) cover a short distance and weaken through walls.
2. Obsolete Standards – Some standards like 802.4 and 802.5 are outdated and no longer used.
3. Security Risks – Wireless networks can be vulnerable if not properly configured.
4. Signal Interference – Wi-Fi faces interference from devices like microwave ovens, cordless phones, etc.
5. Compatibility Issues – Older devices may not support the latest versions of the standards.

# CSMA/CD (Carrier Sense Multiple Access with Collision Detection)


📌 CSMA/CD (Carrier Sense Multiple Access/Collision Detection) - Easy Explanation
📍 What is CSMA/CD?
 It was used in old Ethernet systems where all computers were connected using a single cable (bus topology).
 Now we use switches (star or point-to-point), so CSMA/CD is not used much, but still supported.

⚙️Why Was CSMA/CD Needed?


 Imagine ‘n’ computers want to send data at the same time.
 If 2 or more send data together, it creates a collision (mixing of data).
 CSMA/CD helps control when to send data and what to do if a collision happens.

🔄 Steps of How CSMA/CD Works


1. ✅ Check if sender is ready to send data.
2. 👂 Listen to the network (Is anyone else sending?).
o If no one is sending, then the sender starts transmission.
o If someone is sending, it waits.
3. 📤 Send data & check for collision:
o While sending, the device keeps checking if a collision happens.
o If a collision is found, it stops sending, sends a jam signal, then waits for a random time before trying again.
4. 🟢 If no collision, the sender finishes sending and resets.

❓ How Do Devices Know a Collision Happened?


 Let's say Station A sends data at time 0.
 After 30 mins, a collision happens (e.g., another station sends at the same time).
 The collision signal reaches A after 30 more mins.
 So, A finds out about the collision 1 hour later (2 × 30 mins).

To safely detect a collision, the rule is:


Transmission Time (Tt) ≥ 2 × Propagation Time (Tp)
So the data stays on the wire long enough for a collision signal to return.

🧮 Minimum Packet Size Rule


We calculate the minimum packet size like this:
Packet Length ≥ 2 × Tp × Bandwidth
If the packet is too short, we add padding (extra bits) to meet the size requirement.

⭐ Main Features of CSMA/CD


 Carrier Sense: Device checks if the line is free before sending.
 Multiple Access: All devices share the same cable.
 Collision Detection: Devices know when data collided.
 Jam Signal: Sent after collision to alert others.
 Backoff Time: Device waits random time before trying again.
 Minimum Frame Size: Helps detect collisions properly.
✅ Advantages of CSMA/CD
 Simple and easy to use.
 Fair to all devices.
 Prevents too many collisions and keeps the network working well.
❌ Disadvantages of CSMA/CD
 Doesn’t work well with large networks.
 Can’t stop collisions, only detects them.
 Wastes bandwidth when too many devices try together.
 No security features; easy to attack.

# Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)

Basic Idea:
 Goal: Stations should be able to receive while transmitting to detect collisions from different stations.
 In Wired Networks: When a collision occurs, the energy of the received signal nearly doubles, so the station can
easily detect it.
 In Wireless Networks: Most energy is used for transmission, and a collision only raises received signal energy by 5-
10%, making collision detection by the station very difficult.
 Result: CSMA/CA is specially designed for wireless networks to avoid collisions rather than detect them.

Three Main Strategies in CSMA/CA:


1. InterFrame Space (IFS):
o When a station finds the channel busy, it waits and senses the channel again.
o When the channel becomes idle, the station waits a period called IFS time before sending.
o IFS also helps prioritize stations or frames — higher IFS means lower priority.
2. Contention Window:
o The time is divided into slots.
o Stations ready to send choose a random number of slots as their wait time before transmission, reducing
collisions.
3. Acknowledgments:
o Positive acknowledgments (ACK) and time-out timers help guarantee successful frame transmission.
Characteristics of CSMA/CA:
 Carrier Sense: Devices listen before transmitting to ensure the channel is free.
 Multiple Access: Many devices share the same channel and can transmit (with coordination).
 Collision Avoidance: Uses random backoff times to minimize the chance of collisions.
 Acknowledgment (ACK): Receiving device sends ACK after successful receipt.
 Fairness: Ensures all devices get fair access to the channel.
 Binary Exponential Backoff: On collision, wait time before retransmission doubles with each attempt.
 Interframe Spacing: Minimum wait time between transmissions to reduce collisions.
 RTS/CTS Handshake:
o Some implementations use a Request To Send (RTS) and Clear To Send (CTS) handshake before data
transmission.
o This reserves the channel and further reduces collisions.
 Wireless Network Quality: Performance depends on signal strength, interference, and congestion.
 Adaptive Behavior: Protocol adjusts dynamically to network conditions for efficient channel use.
Ques: What do you understand by collision free protocol? Explain the binary count down with suitable example
Ans: In CSMA/CD, most collisions (when two devices send data at the same time) can be stopped, but sometimes collisions
still happen during a busy time called the contention period. This happens especially when the network cable is very long
and the data packets being sent are very short. When collisions happen in this way, it makes the network slower and less
efficient.
This problem became bigger when fiber optic cables started being used because they can be very long and fast. To fix this,
some special methods or protocols were created to reduce collisions during this busy time.

 Bit-map Protocol
 Binary Countdown
 Limited Contention Protocols
 The Adaptive Tree Walk Protocol
Pure and slotted Aloha, CSMA and CSMA/CD are Contention based Protocols:
 Try-if collide-Retry
 No guarantee of performance
 What happen if the network load is high?
Collision Free Protocols:
 Pay constant overhead to achieve performance guarantee
 Good when network load is high

Binary Countdown Protocol is used to reduce the overhead of sending extra bits by using the stations’ binary addresses to
decide who gets to send data first. Every station that wants to send data broadcasts its address as a binary number, starting
with the leftmost (most important) bit.
All station addresses are the same length. When multiple stations want to send data at the same time, they compare their
binary addresses bit by bit to decide who has the highest priority to use the channel.
Example: Suppose four stations with addresses 0001, 1001, 1100, and 1011 want to send data at the same time.
 First, all stations send their first bit:
o Station 0001 sends 0
o Station 1001 sends 1
o Station 1100 sends 1
o Station 1011 sends 1
Since 0001 sees others sending 1, it knows another station has a higher address, so it stops trying in this round.
 Next, the remaining stations (1001, 1100, 1011) send their second bit:
o 1001 sends 0
o 1100 sends 1
o 1011 sends 0
Stations 1001 and 1011 see a 1 from 1100, so they give up.
 Station 1100 wins and starts transmitting its data.
After 1100 finishes, the process repeats for other stations that want to send.
Unit 4

Ques : Explain the Fragmentation and reassembly using suitable example.


Ans: Fragmentation and Reassembly
In computer networks, data is sent in small pieces called packets. Sometimes, the size of the data packet created
by a sender is larger than the maximum size allowed by the network it must travel through. To handle this, the
large packet is broken into smaller pieces, called fragments — this process is called Fragmentation.
When these smaller fragments reach the destination, they are put back together in the correct order to
reconstruct the original data. This process is called Reassembly.

Why is Fragmentation Needed?


Different networks have different Maximum Transmission Unit (MTU) sizes — the largest packet size they can
handle. If a packet is larger than the MTU of a network on the route, it must be fragmented.
Reasons for Fragmentation (Simple Summary)
 Different networks can only handle data packets up to a certain size, so big packets need to be split.
 The sender doesn’t always know the smallest packet size allowed on the path, so breaking packets helps
avoid problems.
 Every small piece gets extra information (header), which can slow things down if too many pieces are
made.
 Some devices can only send or receive small amounts of data at once.
 Network rules sometimes require smaller packet sizes.
 Different network types use different packet sizes, so splitting is needed when moving between them.
 Large packets take longer to send and can hold up other data.
 If a big packet is damaged, all of it must be sent again; smaller pieces make fixing errors easier.

Fields Related to Fragmentation


 Identification
This is a unique 16-bit number given to every packet sent.
If a packet is broken into parts (fragments), all parts keep the same Identification number so the receiver
can know which fragments belong together.
 Flags
This is a 3-bit field with special bits:
o Do Not Fragment (DF) bit: If set, the packet must not be broken into fragments. If it’s too big, it
will be dropped and an error sent back.
o More Fragments (MF) bit: If set, it means more parts of this packet are coming. If not set, it means
this is the last part or the packet wasn’t split.
 Fragment Offset
This tells the receiver the exact place of each fragment inside the original big packet. It helps put all
fragments back in the right order. The offset counts in blocks of 8 bytes.
Example:

Let’s say a large datagram has 4000 bytes of data. These bytes are numbered from 0 to 3999. Now, suppose this
datagram is too large for the network and needs to be broken into 3 fragments.

Here’s how the fragmentation will happen:

First Fragment

Carries bytes: 0 to 1399


Fragment Offset: 0/8 = 0
Explanation: This fragment starts at the beginning of the data. So its offset is 0.
Second Fragment

Carries bytes: 1400 to 2799


Fragment Offset: 1400/8 = 175
Explanation: This fragment starts from byte 1400. Dividing by 8 gives offset 175.
Third Fragment

Carries bytes: 2800 to 3999


Fragment Offset: 2800/8 = 350
Explanation: This is the last part, starting from byte 2800. Offset becomes 350.
fragmentation
Ques: Describe the working principle of Bellman Ford algorithm using suitable example.
Ans:
Ques: Write a brief note on ICMP (Internet Control Message Protocol) Using its Frame formats.
Ans:
📘 Brief Note on ICMP (Internet Control Message Protocol)
ICMP (Internet Control Message Protocol) is a network layer protocol used by network devices, like routers and
hosts, to send error messages and operational information. It is mainly used for diagnostics and reporting errors
when IP packets cannot reach their destination.

🔧 Purpose of ICMP:
 Reports errors (like unreachable destination).
 Used for network diagnostics (like ping and traceroute).
 Helps in troubleshooting connectivity issues.
 Works closely with the IP protocol, but it is not used to exchange data between applications.

🧩 ICMP Frame Format (Packet Structure):


+--------+--------+------------------+---------------------+
| Type | Code | Checksum | Message Body |
+--------+--------+------------------+---------------------+
1. Type (8 bits):
 Identifies the type of ICMP message (e.g., 0 = Echo Reply, 8 = Echo Request, 3 = Destination Unreachable).
2. Code (8 bits):
 Provides further details about the message type.
o For example: In Type 3 (Destination Unreachable), Code 0 = network unreachable, Code 1 = host
unreachable, etc.
3. Checksum (16 bits):
 Used for error-checking the ICMP message.
4. Rest of the Header / Message Body:
 Varies based on the type and code.
 For echo messages: includes Identifier, Sequence Number, and Payload.

🧪 Examples of ICMP Messages:


Type Message Used in
0 Echo Reply ping reply
3 Destination Unreachable Path or host errors
5 Redirect Message Better route exists
8 Echo Request ping request
11 Time Exceeded Used in traceroute

Ques: Give the comparative study of IPv4 and IPv6.


Ans:
Feature IPv4 IPv6
Address Size 32 bits 128 bits
Decimal, dotted (e.g., Hexadecimal, colon-separated (e.g.,
Address Format
192.168.1.1) 2001:0db8::1)
Total Addresses ~4.3 billion addresses ~3.4 x 10³⁸ addresses (virtually unlimited)
Header Size 20 bytes (variable) 40 bytes (fixed)
Security Optional (IPSec is optional) Mandatory (IPSec is built-in)
Auto-configuration using SLAAC or
Configuration Manual or via DHCP
DHCPv6
No broadcast; uses multicast and anycast
Broadcast Supports broadcast
instead
Fragmentation Routers and sending host can Only sending host handles fragmentation
Feature IPv4 IPv6
fragment
Checksum Present in the header Removed (handled at transport layer)
NAT (Network Address Commonly used due to address
Not needed due to vast address space
Translation) shortage
Simplified header improves routing
Routing Efficiency Less efficient, more complex
efficiency
Mobility Support Limited Better mobility support
No backward compatibility with Supports dual-stack, tunneling for
Transition Mechanism
IPv6 transition
Uses Flow Label field for more efficient
QoS Support Uses Type of Service (ToS) field
QoS
DNS Support Uses A record (IPv4 address) Uses AAAA record (IPv6 address)

Ques: Explain various classes of IP addresses in terms of their network-ID bits, host-ID bits, number of possible
host, number of possible network and range for each classes.
Ans:
IP addresses are divided into five classes: A, B, C, D, and E.
Each class has a different number of Network ID bits and Host ID bits, which decides how many networks and
hosts per network can be made.
✅ Class A
 🧠 Network ID: 8 bits
 🧑‍💻 Host ID: 24 bits
 Networks ban sakte hain: 128 (but 126 hi use hote hain)
 👥 Har network mein devices (hosts): 16 million+
 📍 IP Range: 1.0.0.0 se 126.255.255.255
 🔧 Use: Bahut bade companies ke liye (jaise Google, Microsoft)

✅ Class B
 🧠 Network ID: 16 bits
 🧑‍💻 Host ID: 16 bits
 Networks: 16,384
 👥 Har network mein hosts: 65,534
 📍 IP Range: 128.0.0.0 se 191.255.255.255
 🔧 Use: Medium level networks ke liye (jaise colleges, universities)

✅ Class C
 🧠 Network ID: 24 bits
 🧑‍💻 Host ID: 8 bits
 Networks: 20 lakh+
 👥 Har network mein hosts: 254
 📍 IP Range: 192.0.0.0 se 223.255.255.255
 🔧 Use: Small businesses ya ghar ke liye

✅ Class D – Multicast
 🧑‍🏫 Use hota hai ek saath multiple devices ko data bhejne ke liye
 🛑 Isme host ya network ID nahi hoti
 📍 IP Range: 224.0.0.0 se 239.255.255.255

✅ Class E – Experimental
 🧪 Ye research aur future use ke liye rakha gaya hai
 🛑 Normally use nahi hota
 📍 IP Range: 240.0.0.0 se 255.255.255.255
📋 Ek Simple Table (Easy to Remember)
Class Network Bits Host Bits Networks Hosts IP Range Use
A 8 24 126 1.6 crore 1.0.0.0 – 126.255.255.255 Big Companies
B 16 16 16,384 65K 128.0.0.0 – 191.255.255.255 Colleges, Medium Org
C 24 8 20+ Lakh 254 192.0.0.0 – 223.255.255.255 Small Businesses, Homes
D - - - - 224.0.0.0 – 239.255.255.255 Multicast, group communication
E - - - - 240.0.0.0 – 255.255.255.255 Research, Testing

Ques: Describe the working principle of Least Cost Routing using suitable example.

You might also like